Skip to content

Commit

Permalink
ci: use a script to update the package name after building WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed May 23, 2024
1 parent 4b04765 commit 2160c81
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/publish_wasm_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
node-version: 20
cache: "pnpm"

- name: Update package.json name
working-directory: packages/scripts
run: node update-package-name.mjs

- name: Publish
working-directory: packages/@biomejs/wasm-web
run: pnpx pkg-pr-new publish
Expand Down
3 changes: 2 additions & 1 deletion packages/@biomejs/wasm-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"keywords": [
"parser",
"linter",
"formatter"
"formatter",
"wasm"
]
}
13 changes: 13 additions & 0 deletions packages/scripts/update-package-name.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {resolve} from "node:path";
import {fileURLToPath} from "node:url";
import {readFileSync, writeFileSync} from "node:fs"

const WASM_WEB_ROOT = resolve(fileURLToPath(import.meta.url), "../..", "@biomejs/wasm-web");
const WASM_WEB_ROOT_PACKAGE = resolve(WASM_WEB_ROOT, "package.json");
const manifest = readFileSync(WASM_WEB_ROOT_PACKAGE, "utf-8");
const manifestObject = JSON.parse(manifest);
manifestObject.name = "@biomejs/wasm-web";
console.log("Update manifest " + WASM_WEB_ROOT_PACKAGE);
writeFileSync(WASM_WEB_ROOT_PACKAGE, JSON.stringify(manifestObject, null, 2));


0 comments on commit 2160c81

Please sign in to comment.