Skip to content

Commit ece96a4

Browse files
dahliaclaude
andcommitted
Add Node.js support alongside Deno
- Add package.json with npm dependencies - Configure tsdown for Node.js builds - Update test imports to use node: protocol - Add pnpm lockfile for dependency management - Configure GitHub Actions for both Deno and Node.js - Update development tooling configuration Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3daeab1 commit ece96a4

22 files changed

+3897
-1502
lines changed

.claude/settings.local.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"WebFetch(domain:nodejs.org)",
5+
"Bash(grep:*)",
6+
"Bash(rg:*)",
7+
"Bash(awk:*)",
8+
"Bash(sed:*)",
9+
"Bash(deno task:*)",
10+
"Bash(deno test:*)"
11+
],
12+
"deny": []
13+
}
14+
}

.github/workflows/main.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
- uses: denoland/setup-deno@v2
1717
with:
1818
deno-version: v2.x
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
1922
- run: deno task test --coverage --junit-path=junit.xml
2023
env:
2124
RUST_BACKTRACE: ${{ runner.debug }}
@@ -33,6 +36,8 @@ jobs:
3336
with:
3437
token: ${{ secrets.CODECOV_TOKEN }}
3538
files: coverage.lcov
39+
- run: pnpm install
40+
- run: pnpm test
3641
- run: deno task check
3742

3843
publish:
@@ -47,16 +52,36 @@ jobs:
4752
- uses: denoland/setup-deno@v2
4853
with:
4954
deno-version: v2.x
55+
- uses: pnpm/action-setup@v4
56+
with:
57+
version: 10
5058
- if: github.ref_type == 'branch'
5159
run: |
60+
set -euo pipefail
5261
jq \
5362
--arg build "$GITHUB_RUN_NUMBER" \
5463
--arg commit "${GITHUB_SHA::8}" \
5564
'.version = .version + "-dev." + $build + "+" + $commit' \
5665
deno.json > deno.json.tmp
5766
mv deno.json.tmp deno.json
67+
jq \
68+
--arg build "$GITHUB_RUN_NUMBER" \
69+
--arg commit "${GITHUB_SHA::8}" \
70+
'.version = .version + "-dev." + $build + "+" + $commit' \
71+
package.json > package.json.tmp
72+
mv package.json.tmp package.json
5873
- if: github.ref_type == 'tag'
59-
run: '[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]'
74+
run: |
75+
set -euo pipefail
76+
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
77+
[[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]]
78+
- run: pnpm install
79+
- run: |
80+
if [[ "$GITHUB_REF_TYPE" = tag ]]; then
81+
pnpm publish --access public --no-git-checks
82+
else
83+
pnpm publish --access public --no-git-checks --tag dev
84+
fi
6085
- run: deno publish --allow-dirty
6186
- if: github.ref_type == 'tag'
6287
id: extract-changelog
@@ -77,6 +102,7 @@ jobs:
77102
body_path: ${{ steps.extract-changelog.outputs.output-file }}
78103
name: BotKit ${{ github.ref_name }}
79104
generate_release_notes: false
105+
files: fedify-botkit-*.tgz
80106

81107
publish-docs:
82108
if: github.event_name == 'push'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
coverage/
2+
dist/
3+
node_modules/
4+
fedify-botkit-*.tgz

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"Pixelfed",
6969
"smallweb",
7070
"Tailscale",
71+
"tsdown",
7172
"unfollow",
7273
"unfollowed",
7374
"unfollowing",

deno.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,22 @@
2121
"@fedify/fedify": "jsr:@fedify/fedify@^1.6.1",
2222
"@fedify/markdown-it-hashtag": "jsr:@fedify/markdown-it-hashtag@^0.3.0",
2323
"@fedify/markdown-it-mention": "jsr:@fedify/markdown-it-mention@^0.3.0",
24-
"@hongminhee/x-forwarded-fetch": "jsr:@hongminhee/x-forwarded-fetch@^0.2.0",
2524
"@logtape/logtape": "jsr:@logtape/logtape@^1.0.0",
2625
"@phensley/language-tag": "npm:@phensley/language-tag@^1.12.2",
27-
"@std/assert": "jsr:@std/assert@^1.0.12",
2826
"hono": "jsr:@hono/hono@^4.8.2",
2927
"html-entities": "npm:html-entities@^2.6.0",
3028
"markdown-it": "npm:markdown-it@^14.1.0",
3129
"mime-db": "npm:mime-db@^1.54.0",
30+
"tsdown": "npm:tsdown@^0.12.8",
3231
"uuid": "npm:uuid@^11.1.0",
32+
"x-forwarded-fetch": "jsr:@hongminhee/x-forwarded-fetch@^0.2.0",
3333
"xss": "npm:xss@^1.0.15"
3434
},
35-
"lock": false,
35+
"nodeModulesDir": "none",
3636
"exclude": [
3737
".github",
3838
".vscode",
39+
"dist",
3940
"docs",
4041
"src/css"
4142
],
@@ -48,8 +49,7 @@
4849
]
4950
},
5051
"tasks": {
51-
"embed-css": "deno run -A jsr:@smallweb/embed src/css src/static",
52-
"check": "deno check src/ && deno lint && deno fmt --check && deno publish --dry-run --allow-dirty",
52+
"check": "deno check src/ && deno lint && deno fmt --check && deno publish --dry-run --allow-dirty && deno run scripts/check_versions.ts",
5353
"test": "deno test --allow-env=NODE_V8_COVERAGE,JEST_WORKER_ID --allow-net=hollo.social --parallel",
5454
"test-all": "deno task check && deno task test",
5555
"coverage": "deno task test --coverage --clean && deno coverage --html",

0 commit comments

Comments
 (0)