diff --git a/flake.nix b/flake.nix index 9090d0cb..b88d80f1 100644 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,7 @@ postBuild = '' npm run pkg -- \ --output=out \ - --bin=dist/polykey.js \ + --bin=dist/polykey.mjs \ --node-version=${utils.nodeVersion} \ --platform=${platform} \ --arch=${arch} diff --git a/npmDepsHash b/npmDepsHash index 81c8362a..bd9cd2ed 100644 --- a/npmDepsHash +++ b/npmDepsHash @@ -1 +1 @@ -sha256-seF0UmaonXcbXIQQMq1ZrtoYm1GmIwfK2+lUZB12jYU= +sha256-S4tLgjpsyta1Jo5Dv0+YTMRf2//EHEWpuxHWJI7FjK0= diff --git a/package-lock.json b/package-lock.json index 8cae2c67..92d52103 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polykey-cli", - "version": "0.18.3", + "version": "0.18.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "polykey-cli", - "version": "0.18.3", + "version": "0.18.4", "license": "GPL-3.0", "bin": { "pk": "dist/polykey.mjs", diff --git a/package.json b/package.json index 6eebe219..40d88eea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polykey-cli", - "version": "0.18.3", + "version": "0.18.4", "homepage": "https://polykey.com", "author": "Roger Qiu", "contributors": [ @@ -105,7 +105,7 @@ "node_modules/sodium-native/prebuilds/win32-x64/node.napi.node" ], "scripts": [ - "dist/polykeyWorkerManifest.mjs" + "dist/polykeyWorkerManifest.js" ] }, "scripts": { diff --git a/scripts/build.mjs b/scripts/build.mjs index 066b43b7..1de1ed5f 100755 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -92,6 +92,28 @@ async function main(argv = process.argv) { console.error('Running esbuild:'); console.error(esbuildOptions); await esbuild.build(esbuildOptions); + // Rename worker script + console.error('Renaming worker script'); + childProcess.execFileSync( + 'mv', + ['dist/polykeyWorkerManifest.mjs', 'dist/polykeyWorkerManifest.js'], + { + stdio: ['inherit', 'inherit', 'inherit'], + windowsHide: true, + encoding: 'utf-8', + shell: platform === 'win32' ? true : false, + }, + ); + childProcess.execFileSync( + 'mv', + ['dist/polykeyWorkerManifest.mjs.map', 'dist/polykeyWorkerManifest.js.map'], + { + stdio: ['inherit', 'inherit', 'inherit'], + windowsHide: true, + encoding: 'utf-8', + shell: platform === 'win32' ? true : false, + }, + ); } /* eslint-enable no-console */