Skip to content

Commit c9b864a

Browse files
committed
chore: refresh project maintenance
1 parent 231bd99 commit c9b864a

11 files changed

Lines changed: 158 additions & 76 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly

.github/workflows/ci.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,41 @@ on:
66
pull_request:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest
1215

1316
steps:
1417
- name: Checkout repository
15-
uses: actions/checkout@v4
18+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
1619

1720
- name: Setup Deno
18-
uses: denoland/setup-deno@v2
21+
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
22+
with:
23+
deno-version: v2.6.8
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
1927
with:
20-
deno-version: v2.x
28+
node-version: 24
29+
30+
- name: Run checks
31+
run: deno task check
2132

22-
- name: Verify formatting
23-
run: deno fmt --check
33+
- name: Build npm package
34+
run: deno task build:npm
2435

25-
- name: Run linter
26-
run: deno lint
36+
- name: Smoke test npm entry points
37+
run: >-
38+
node --input-type=module -e
39+
'await Promise.all([
40+
import("./npm/esm/mod.js"),
41+
import("./npm/esm/src/nondeterministic.js"),
42+
import("./npm/esm/src/perf.js")
43+
])'
2744
28-
- name: Run tests
29-
run: deno test
45+
- name: Verify npm package contents
46+
run: npm pack ./npm --dry-run

.github/workflows/publish.yml

Lines changed: 76 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,112 @@ on:
44
tags:
55
- "v*"
66

7+
concurrency:
8+
group: publish-${{ github.ref }}
9+
cancel-in-progress: false
10+
711
jobs:
12+
preflight:
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
20+
21+
- name: Setup Deno
22+
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
23+
with:
24+
deno-version: v2.6.8
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
28+
with:
29+
node-version: 24
30+
31+
- name: Verify tag matches deno.json version
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
tag="${GITHUB_REF_NAME}"
36+
if [[ ! "${tag}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
37+
echo "Tag '${tag}' is not a stable semantic version."
38+
exit 1
39+
fi
40+
deno_version="$(deno eval 'console.log(JSON.parse(Deno.readTextFileSync("deno.json")).version)')"
41+
if [[ "${tag}" != "v${deno_version}" ]]; then
42+
echo "Tag '${tag}' does not match deno.json version '${deno_version}'."
43+
exit 1
44+
fi
45+
46+
- name: Run checks
47+
run: deno task check
48+
49+
- name: Verify JSR package
50+
run: deno publish --dry-run
51+
52+
- name: Build npm package
53+
run: deno task build:npm
54+
55+
- name: Smoke test npm entry points
56+
run: >-
57+
node --input-type=module -e
58+
'await Promise.all([
59+
import("./npm/esm/mod.js"),
60+
import("./npm/esm/src/nondeterministic.js"),
61+
import("./npm/esm/src/perf.js")
62+
])'
63+
64+
- name: Verify npm package contents
65+
run: npm pack ./npm --dry-run
66+
867
publish-jsr:
968
runs-on: ubuntu-latest
69+
needs: preflight
1070

1171
permissions:
1272
contents: read
1373
id-token: write
1474

1575
steps:
16-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
77+
78+
- name: Setup Deno
79+
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
80+
with:
81+
deno-version: v2.6.8
1782

1883
- name: Publish to JSR
19-
run: npx jsr publish
84+
run: deno publish
2085

2186
publish-npm:
2287
runs-on: ubuntu-latest
2388
needs: publish-jsr
2489

2590
permissions:
2691
contents: read
92+
id-token: write
2793

2894
steps:
29-
- uses: actions/checkout@v4
95+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
3096

3197
- name: Setup Deno
32-
uses: denoland/setup-deno@v2
98+
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2
3399
with:
34-
deno-version: v2.x
100+
deno-version: v2.6.8
35101

36102
- name: Setup Node
37-
uses: actions/setup-node@v4
103+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
38104
with:
39-
node-version: 20
105+
node-version: 24
40106
registry-url: "https://registry.npmjs.org"
41107

42108
- name: Build npm package
43109
run: deno task build:npm
44110

45111
- name: Publish to npm
46-
run: npm publish ./npm --access public
112+
run: npm publish ./npm --access public --provenance
47113
env:
48114
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49115

@@ -55,22 +121,10 @@ jobs:
55121
contents: write
56122

57123
steps:
58-
- uses: actions/checkout@v4
124+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
59125
with:
60126
fetch-depth: 0
61127

62-
- name: Verify tag matches deno.json version
63-
shell: bash
64-
run: |
65-
set -euo pipefail
66-
tag="${GITHUB_REF_NAME}"
67-
version="${tag#v}"
68-
deno_version="$(node -p "require('./deno.json').version")"
69-
if [[ "${deno_version}" != "${version}" ]]; then
70-
echo "Tag '${tag}' does not match deno.json version '${deno_version}'."
71-
exit 1
72-
fi
73-
74128
- name: Generate changelog
75129
shell: bash
76130
run: |
@@ -99,7 +153,7 @@ jobs:
99153
} > RELEASE_NOTES.md
100154
101155
- name: Create GitHub release
102-
uses: softprops/action-gh-release@v2
156+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
103157
with:
104158
name: ${{ github.ref_name }}
105159
tag_name: ${{ github.ref_name }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.vscode
22
.coverage
33
.notes
4-
npm
5-
npm/
4+
/npm/

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
Run these from the repo root:
1818

19-
- `deno task check`: Formats, lints, and runs tests
20-
(`deno fmt && deno lint && deno test --ignore=npm`).
19+
- `deno task check`: Checks formatting, lints, and runs tests
20+
(`deno fmt --check && deno lint && deno test --ignore=npm`).
2121
- `deno test`: Run the test suite.
2222
- `deno fmt`: Auto-format code and Markdown.
2323
- `deno lint`: Static analysis for TS/JS.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ compose them into a grammar.
1212
### Deno (JSR)
1313

1414
```ts
15-
import { seq, str } from "jsr:@claudiu-ceia/combine@^0.2.6";
15+
import { seq, str } from "jsr:@claudiu-ceia/combine@^0.3.0";
1616
```
1717

1818
Subpath imports are also supported:
@@ -37,7 +37,10 @@ import { seq, str } from "@claudiu-ceia/combine";
3737
If you're in a CommonJS project, use a dynamic import:
3838

3939
```js
40-
const { seq, str } = await import("@claudiu-ceia/combine");
40+
(async () => {
41+
const { seq, str } = await import("@claudiu-ceia/combine");
42+
// Use seq and str here.
43+
})();
4144
```
4245

4346
## Quickstart

deno.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@
77
"./perf": "./src/perf.ts"
88
},
99
"publish": {
10-
"exclude": ["bench/", "tests/", "npm/"]
10+
"exclude": [
11+
".github/",
12+
"AGENTS.md",
13+
"bench/",
14+
"deno.lock",
15+
"npm/",
16+
"scripts/",
17+
"tests/"
18+
]
1119
},
1220
"tasks": {
13-
"check": "deno fmt && deno lint && deno test --ignore=npm",
21+
"check": "deno fmt --check && deno lint && deno test --ignore=npm",
1422
"coverage": "deno test --ignore=npm --clean --coverage=.coverage && deno coverage --detailed --html .coverage",
1523
"build:npm": "deno run -A scripts/build-npm.ts",
1624
"hooks:install": "ln -sf ../../scripts/pre-commit .git/hooks/pre-commit && chmod +x scripts/pre-commit",
1725
"hooks:uninstall": "rm -f .git/hooks/pre-commit"
1826
},
1927
"imports": {
20-
"@std/assert": "jsr:@std/assert@^1.0.17",
28+
"@std/assert": "jsr:@std/assert@^1.0.19",
2129
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
2230
"parsimmon": "npm:parsimmon@1.18.1"
2331
}

deno.lock

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)