Skip to content

Commit

Permalink
Refine management of development dependencies (#144)
Browse files Browse the repository at this point in the history
Fixes GH-143

* Bump deno
* Bump esm and the paackage versions
* Replace npm with nix to inject stylelint except the plugin
* Replace deno fmt with dprint to avoid jsonc trailling comma warning in vscode
* Prefer import maps
* Fix cache targets with rough glob
* Pin typos version to avoid PR as GH-142
* Replace skypack with esm.sh for fflate
  • Loading branch information
kachick authored Sep 4, 2024
1 parent 71ff579 commit 68c29d9
Show file tree
Hide file tree
Showing 15 changed files with 317 additions and 711 deletions.
3 changes: 3 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"nix": {
"enabled": false
},
"ignoreDeps": [
"crate-ci/typos"
],
"schedule": ["on Tuesday"]
}
2 changes: 2 additions & 0 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ on:
- '*.nix'
- 'flake.*'
- 'deno.jsonc'
- '**.css'
pull_request:
paths:
- '.github/workflows/ci-nix.yml'
- '*.nix'
- 'flake.*'
- 'deno.jsonc'
- '**.css'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
- uses: dprint/[email protected]
with:
dprint-version: '0.45.1' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","dprint --version | cut -d ' ' -f 2"]}
- uses: crate-ci/typos@v1.24.3 # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["bash","-c","typos --version | cut -d ' ' -f 2"]}
- uses: crate-ci/typos@v1.21.0 # selfup {"extract":"\\d\\.\\d+\\.\\d+","replacer":["bash","-c","typos --version | cut -d ' ' -f 2"]}
- uses: denoland/setup-deno@v1
with:
deno-version: '1.44.3' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
deno-version: '1.45.5' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
- run: deno task check
build:
timeout-minutes: 15
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: '1.44.3' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
deno-version: '1.45.5' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
- name: Ensure cache before build
run: deno task cache
- name: Install gh-action-escape
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: '1.44.3' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
deno-version: '1.45.5' # selfup {"extract":"\\d[^']+","replacer":["bash","-c","deno --version | head -n 1 | cut -d ' ' -f 2"]}
- name: Ensure cache before build
run: deno task cache
- name: Install gh-action-escape
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/stylelint.yml

This file was deleted.

37 changes: 21 additions & 16 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
{
"tasks": {
"build": "deno run --quiet --allow-net --allow-read --allow-write --allow-env scripts/build.ts",
"build": "deno run --node-modules-dir --quiet --allow-net --allow-read --allow-write --allow-env scripts/build.ts",
"clean": "rm -rf ./dist",
"check": "dprint check && typos && deno fmt --check && deno lint && deno check src/*.ts* scripts/*.ts && deno task check:manifest",
"check:manifest": "deno run scripts/manifestValidator.ts",
"stylelint": "deno task cache:stylelint && deno run --node-modules-dir --allow-env --allow-read --allow-sys npm:stylelint@15.10.3/stylelint src/*.css | deno run --allow-sys scripts/checkEmpty.ts",
"check": "dprint check && typos && dprint check && deno lint && deno check --node-modules-dir src/*.ts* scripts/*.ts && deno task check:manifest",
"check:manifest": "deno run --node-modules-dir scripts/manifestValidator.ts",
"stylelint": "deno task cache && stylelint src/*.css",
"deps": "deno --version && mogrify --version && dprint --version && typos --version && rg --version",
"cache": "deno cache --node-modules-dir --reload **/*.ts **/*.tsx",
"update": "deno cache --lock-write --node-modules-dir npm:[email protected] npm:[email protected] **/*.ts **/*.tsx",
"cache:stylelint": "deno cache --node-modules-dir npm:[email protected] npm:[email protected]",
"cache": "deno cache --frozen=false --node-modules-dir --reload npm:[email protected] src/*.ts* scripts/*.ts",
// Required ImageMagick dependency
"resize": "mogrify -resize 128x128! assets/icons/**/*.png",
"remove-exif": "exiftool -all= ./assets/**/*.png ./assets/**/*.jpg",
"all": "deno task deps && deno task check && deno task build && deno task stylelint && deno task resize",
"all": "deno task deps && deno task check && deno task build && deno task stylelint && deno task resize"
},
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"dom.asynciterable",
"deno.ns",
"deno.ns"
],
"types": [
"https://esm.sh/v128/[email protected].216/index.d.ts",
"https://esm.sh/v135/[email protected].301/index.d.ts"
],
"jsx": "react-jsx",
"jsxImportSource": "https://esm.sh/v135/[email protected]"
},
"lint": {
"include": ["src/", "scripts/"],
"rules": {
"tags": ["recommended"],
},
},
"fmt": {
"singleQuote": true,
"include": ["src/", "scripts/"],
"tags": ["recommended"]
}
},
"imports": {
"@deno/emit": "jsr:@deno/emit@^0.45.0",
"@std/assert": "jsr:@std/assert@^1.0.3",
"@std/encoding": "jsr:@std/encoding@^1.0.3",
"@std/path": "jsr:@std/path@^1.0.3",
"ajv": "https://esm.sh/v135/[email protected]",
"fflate": "https://esm.sh/v135/[email protected]",
"pretty-bytes": "https://esm.sh/v135/[email protected]"
}
}
Loading

0 comments on commit 68c29d9

Please sign in to comment.