From e57cfd36f53e69ced0fa5af49552476b114bde17 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Fri, 29 Nov 2024 10:13:13 +0100 Subject: [PATCH 1/5] install deps --- .github/workflows/javascript.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 32265ea..344045f 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -19,8 +19,10 @@ jobs: working-directory: ./expression-js steps: - uses: actions/checkout@v4 - - name: Install + - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install dependencies + run: npm i - name: Build run: npm run build - name: Package From e7a7a8eae6e8a7c94fc9df5fee879b70b9cc5a28 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Fri, 29 Nov 2024 10:46:18 +0100 Subject: [PATCH 2/5] publish package --- .github/workflows/javascript.yml | 8 ++++++++ Cargo.lock | 26 +++++++++++++------------- expression-js/Cargo.toml | 3 +-- expression-js/package-lock.json | 3 ++- expression-js/package.json | 1 + 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 344045f..de4af77 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -19,6 +19,10 @@ jobs: working-directory: ./expression-js steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Install dependencies @@ -27,3 +31,7 @@ jobs: run: npm run build - name: Package run: wasm-pack pack + - name: Publish + run: wasm-pack publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/Cargo.lock b/Cargo.lock index d7bbd5c..52815ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -283,18 +283,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "expression-js" -version = "0.1.0" -dependencies = [ - "bigdecimal", - "console_error_panic_hook", - "expression-core", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "fastrand" version = "2.1.1" @@ -369,6 +357,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "lago-expression" +version = "0.1.0" +dependencies = [ + "bigdecimal", + "console_error_panic_hook", + "expression-core", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "lago_expression" version = "0.0.1" diff --git a/expression-js/Cargo.toml b/expression-js/Cargo.toml index c61bbc7..01cd6bf 100644 --- a/expression-js/Cargo.toml +++ b/expression-js/Cargo.toml @@ -1,9 +1,8 @@ [package] -name = "expression-js" +name = "lago-expression" version = "0.1.0" edition = "2021" - [lib] crate-type = ["cdylib"] diff --git a/expression-js/package-lock.json b/expression-js/package-lock.json index bbac42e..345da78 100644 --- a/expression-js/package-lock.json +++ b/expression-js/package-lock.json @@ -1,9 +1,10 @@ { - "name": "expression-js", + "name": "lago-expression", "lockfileVersion": 3, "requires": true, "packages": { "": { + "name": "lago-expression", "devDependencies": { "@wasm-tool/wasm-pack-plugin": "1.7.0", "html-webpack-plugin": "^5.6.0", diff --git a/expression-js/package.json b/expression-js/package.json index a584eae..0d81551 100644 --- a/expression-js/package.json +++ b/expression-js/package.json @@ -1,4 +1,5 @@ { + "name": "lago-expression", "scripts": { "build": "webpack", "serve": "webpack serve" From 0886c8b1cc04ccfc8d5af7a708feb58368ef5472 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Fri, 29 Nov 2024 13:41:27 +0100 Subject: [PATCH 3/5] revert back to rust 1.81 --- expression-js/rust-toolchain.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 expression-js/rust-toolchain.toml diff --git a/expression-js/rust-toolchain.toml b/expression-js/rust-toolchain.toml new file mode 100644 index 0000000..8b913e9 --- /dev/null +++ b/expression-js/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] + channel = "1.81" From ccee607feaffb8465b8cf7e98a8f8f1474519335 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Fri, 29 Nov 2024 13:42:24 +0100 Subject: [PATCH 4/5] re-use wasm-opt --- Cargo.lock | 2 +- expression-js/Cargo.toml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52815ff..8e4ef39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -359,7 +359,7 @@ dependencies = [ [[package]] name = "lago-expression" -version = "0.1.0" +version = "0.1.1" dependencies = [ "bigdecimal", "console_error_panic_hook", diff --git a/expression-js/Cargo.toml b/expression-js/Cargo.toml index 01cd6bf..17b0bf4 100644 --- a/expression-js/Cargo.toml +++ b/expression-js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lago-expression" -version = "0.1.0" +version = "0.1.1" edition = "2021" [lib] @@ -17,6 +17,3 @@ web-sys = { version = "0.3.72", features = ["console"] } [profile.release] lto = true opt-level = 's' - -[package.metadata.wasm-pack.profile.release] -wasm-opt = false From 8ee5a1274dbfa49b5098f0b01b85e46a032aca05 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Fri, 29 Nov 2024 13:44:33 +0100 Subject: [PATCH 5/5] remove required input param --- .github/workflows/javascript.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index de4af77..66c0a26 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -4,10 +4,7 @@ on: release: types: [released] workflow_dispatch: - inputs: - version: - description: Version - required: true + env: CARGO_TERM_COLOR: always