Skip to content

Commit

Permalink
renamed files
Browse files Browse the repository at this point in the history
  • Loading branch information
dovgopoly committed Sep 16, 2024
1 parent 68a418e commit 7826356
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ jobs:

- name: Get package name and version
run: |
echo "NAME=$(grep '^name' Cargo.toml | sed -E 's/name = \"(.*)\"/\1/')" >> $GITHUB_ENV
echo "CARGO_NAME=$(grep '^name' Cargo.toml | sed -E 's/name = \"(.*)\"/\1/')" >> $GITHUB_ENV
echo "NPM_NAME=${{ env.CARGO_NAME }} | sed 's/_/-/g'
echo "VERSION=$(grep '^version' Cargo.toml | sed -E 's/version = \"(.*)\"/\1/')" >> $GITHUB_ENV
- name: Build ESM
run: |
wasm-pack build --release --target web -d pkg
mv pkg/${{ env.NAME }}.js pkg/${{ env.NAME }}_esm.js
mv pkg/${{ env.CARGO_NAME }}.js pkg/${{ env.NPM_NAME }}-esm.js
mv pkg/${{ env.CARGO_NAME }}.d.ts pkg/${{ env.NPM_NAME }}.d.ts
mv pkg/${{ env.CARGO_NAME }}_bg.wasm pkg/${{ env.NPM_NAME }}-bg.wasm
sed -i "s/${{ env.CARGO_NAME }}_bg.wasm/${{ env.NPM_NAME }}-bg.wasm/g" "pkg/${{ env.NPM_NAME }}-esm.js"
- name: Build CommonJS
run: |
npm install --global rollup
rollup pkg/${{ env.NAME }}_esm.js --file pkg/${{ env.NAME }}_cjs.js --format cjs
rollup pkg/${{ env.NPM_NAME }}-esm.js --file pkg/${{ env.NPM_NAME }}-cjs.js --format cjs
- name: Create package.json
run: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aptos_wasm_bindings"
version = "0.2.0"
version = "0.2.1"
edition = "2021"

[dependencies]
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
"name": "@distributedlab/aptos-wasm-bindings",
"version": "",
"files": [
"aptos_wasm_bindings_bg.wasm",
"aptos_wasm_bindings_cjs.js",
"aptos_wasm_bindings_esm.js",
"aptos_wasm_bindings.d.ts"
"aptos-wasm_bindings-bg.wasm",
"aptos-wasm_bindings-cjs.js",
"aptos-wasm_bindings-esm.js",
"aptos-wasm-bindings.d.ts"
],
"main": "aptos_wasm_bindings_cjs.js",
"module": "aptos_wasm_bindings_esm.js",
"types": "aptos_wasm_bindings.d.ts",
"main": "aptos-wasm-bindings-cjs.js",
"module": "aptos-wasm-bindings-esm.js",
"types": "aptos-wasm-bindings.d.ts",
"exports": {
".": {
"require": {
"default": "aptos_wasm_bindings_cjs.js"
"default": "aptos-wasm-bindings-cjs.js"
},
"import": {
"default": "aptos_wasm_bindings_esm.js"
"default": "aptos-wasm-bindings-esm.js"
}
}
}
Expand Down

0 comments on commit 7826356

Please sign in to comment.