mirror of
https://github.com/fluencelabs/aquavm
synced 2024-12-04 23:20:18 +00:00
Switch to cjs (#65)
* Use CJS instead of ESM * fix the issue with branch packages being pushed to npm as latest
This commit is contained in:
parent
05499a6bc1
commit
d8ff68843e
13
.github/workflows/publish_interpreter.yml
vendored
13
.github/workflows/publish_interpreter.yml
vendored
@ -102,23 +102,28 @@ jobs:
|
||||
- name: Generate aquamarine.wasm.base64.js
|
||||
run: |
|
||||
cat << EOF > pkg/aquamarine.wasm.base64.js
|
||||
export const wasmBs64 = "$(base64 -w0 pkg/aquamarine_client_bg.wasm)";
|
||||
module.exports = "$(base64 -w0 pkg/aquamarine_client_bg.wasm)";
|
||||
EOF
|
||||
|
||||
### Generate index files so import works as: | import {wasmBs64} from "@fluencelabs/aquamarine-stepper"; |
|
||||
- name: Generate index.js & index.d.ts
|
||||
run: |
|
||||
cat << EOF > index.js
|
||||
export * from "./aquamarine.wasm.base64.js";
|
||||
const wasmBs64 = require("./aquamarine.wasm.base64.js");
|
||||
module.exports = wasmBs64;
|
||||
EOF
|
||||
|
||||
cp index.js index.d.ts
|
||||
cat << EOF > index.d.ts
|
||||
declare const wasmBs64: string;
|
||||
export default wasmBs64;
|
||||
EOF
|
||||
working-directory: pkg
|
||||
|
||||
- name: Generate aquamarine.wasm.base64.d.ts
|
||||
run: |
|
||||
cat << EOF > aquamarine.wasm.base64.d.ts
|
||||
export const wasmBs64: string;
|
||||
declare const wasmBs64: string;
|
||||
export default wasmBs64;
|
||||
EOF
|
||||
working-directory: pkg
|
||||
|
||||
|
15
.github/workflows/publish_interpreter_dev.yml
vendored
15
.github/workflows/publish_interpreter_dev.yml
vendored
@ -125,23 +125,28 @@ jobs:
|
||||
- name: Generate aquamarine.wasm.base64.js
|
||||
run: |
|
||||
cat << EOF > pkg/aquamarine.wasm.base64.js
|
||||
export const wasmBs64 = "$(base64 -w0 pkg/aquamarine_client_bg.wasm)";
|
||||
module.exports = "$(base64 -w0 pkg/aquamarine_client_bg.wasm)";
|
||||
EOF
|
||||
|
||||
### Generate index files so import works as: | import {wasmBs64} from "@fluencelabs/aquamarine-stepper"; |
|
||||
- name: Generate index.js & index.d.ts
|
||||
run: |
|
||||
cat << EOF > index.js
|
||||
export * from "./aquamarine.wasm.base64.js";
|
||||
const wasmBs64 = require("./aquamarine.wasm.base64.js");
|
||||
module.exports = wasmBs64;
|
||||
EOF
|
||||
|
||||
cp index.js index.d.ts
|
||||
cat << EOF > index.d.ts
|
||||
declare const wasmBs64: string;
|
||||
export default wasmBs64;
|
||||
EOF
|
||||
working-directory: pkg
|
||||
|
||||
- name: Generate aquamarine.wasm.base64.d.ts
|
||||
run: |
|
||||
cat << EOF > aquamarine.wasm.base64.d.ts
|
||||
export const wasmBs64: string;
|
||||
declare const wasmBs64: string;
|
||||
export default wasmBs64;
|
||||
EOF
|
||||
working-directory: pkg
|
||||
|
||||
@ -184,7 +189,7 @@ jobs:
|
||||
node-version: '14'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- run: npm publish --access public
|
||||
- run: npm publish --access public --tag=beta
|
||||
working-directory: pkg
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
Loading…
Reference in New Issue
Block a user