diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 32265ea..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 @@ -19,9 +16,19 @@ jobs: working-directory: ./expression-js steps: - uses: actions/checkout@v4 - - name: Install + - 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 + run: npm i - name: Build 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..8e4ef39 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.1" +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..17b0bf4 100644 --- a/expression-js/Cargo.toml +++ b/expression-js/Cargo.toml @@ -1,9 +1,8 @@ [package] -name = "expression-js" -version = "0.1.0" +name = "lago-expression" +version = "0.1.1" edition = "2021" - [lib] crate-type = ["cdylib"] @@ -18,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 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" 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"