Skip to content

Commit

Permalink
refactor: cleanup test and cli building scripts usage
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
  • Loading branch information
jerome-benoit committed Sep 6, 2024
1 parent 01ea2f7 commit 44e5b93
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,4 @@ jobs:
- name: Bundle
run: bun bundle
- name: Run Tests
run: |
bun test:node
bun test:deno
bun test:bun
run: bun run test
5 changes: 1 addition & 4 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ jobs:
run: bun bundle

- name: Run Tests
run: |
bun test:node
bun test:deno
bun test:bun
run: bun run test

publish-jsr:
needs: build-release
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ In the cloned repository root directory, run:
### Deno

```shell
bun cli:deno
bun build:cli:deno
```

### Bun

```shell
bun cli:bun
bun build:cli:bun
```

The standalone binary can be moved to a directory in your path.
The standalone binary in `./dist/<runtime_name>` can be moved to a directory in your path.

## CLI usage examples

Expand Down
Binary file modified bun.lockb
Binary file not shown.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
"check:write": "biome check . --write",
"check:ci": "biome ci .",
"bundle": "bun bundle.ts",
"test": "run-s test:*",
"test:node": "node tests/test.js",
"test:deno": "deno run --allow-sys --allow-hrtime tests/test.js && deno run --allow-sys --allow-hrtime tests/test.ts",
"test:bun": "bun tests/test.js && bun tests/test.ts",
"cli:node": "npx rimraf tatami && node --experimental-sea-config sea-config.json && npx ncp $(volta which node || n which lts || nvm which node || command -v node) tatami && npx postject tatami NODE_SEA_BLOB tatami.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 && npx rimraf tatami.blob",
"cli:deno": "deno run --allow-env --allow-read --allow-write npm:rimraf tatami && deno compile --allow-read --allow-run --allow-sys --allow-hrtime --output=tatami ./cli.js",
"cli:bun": "bunx rimraf tatami && bun build --compile --minify --sourcemap ./cli.js --outfile tatami"
"build:cli": "run-p build:*",
"build:cli:node": "npx --yes rimraf ./dist/node/tatami && npx --yes mkdirp ./dist/node && node --experimental-sea-config sea-config.json && npx --yes ncp $(volta which node || n which lts || nvm which node || command -v node) ./dist/node/tatami && npx --yes postject ./dist/node/tatami NODE_SEA_BLOB ./dist/node/tatami.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 && npx --yes rimraf ./dist/node/tatami.blob",
"build:cli:deno": "deno run --allow-env --allow-read --allow-write npm:rimraf tatami && deno compile --allow-read --allow-run --allow-sys --allow-hrtime --output=./dist/deno/tatami ./cli.js",
"build:cli:bun": "bunx rimraf ./dist/bun/tatami && bun build --compile --minify --sourcemap ./cli.js --outfile ./dist/bun/tatami"
},
"dependencies": {
"peowly": "^1.3.2"
Expand All @@ -53,6 +55,7 @@
"@types/bun": "^1.1.8",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"npm-run-all2": "^6.2.2",
"prettier": "^3.3.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sea-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"main": "./cli.js",
"output": "./tatami.blob",
"output": "./dist/node/tatami.blob",
"disableExperimentalSEAWarning": true
}

0 comments on commit 44e5b93

Please sign in to comment.