diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b81f0e63..4f6aceab 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,12 +32,16 @@ jobs: with: node-version-file: ".nvmrc" cache: "pnpm" + - name: Install Rust + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-src - name: Install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build wasm - run: RUSTFLAGS="" pnpm run build:wasm + run: pnpm run build:wasm - name: Build playground run: pnpm run build - name: Setup Pages diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 53176aba..f9a11c57 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -72,7 +72,9 @@ jobs: node-version-file: ".nvmrc" cache: "pnpm" - run: pnpm install --frozen-lockfile - - uses: dtolnay/rust-toolchain@nightly + - uses: dtolnay/rust-toolchain@nightly-2024-07-22-x86_64-unknown-linux-gnu + with: + components: rust-src - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - run: pnpm run ci test: diff --git a/playground/package.json b/playground/package.json index 4300d4cc..1a7bca29 100644 --- a/playground/package.json +++ b/playground/package.json @@ -2,7 +2,7 @@ "name": "playground", "type": "module", "scripts": { - "build:wasm": "wasm-pack build ../crates/lib-wasm --release --target web --out-dir ../../playground/src/pkg", + "build:wasm": "cross-env RUSTFLAGS=\"-C opt-level=z\" wasm-pack build ../crates/lib-wasm --target web --out-dir ../../playground/src/pkg -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort", "build": "pnpm run build:wasm && vite build", "dev": "vite", "dev:wasm": "wasm-pack build ../crates/lib-wasm --dev --target web --out-dir ../../playground/src/pkg", @@ -13,6 +13,7 @@ "@typescript-eslint/eslint-plugin": "^8.6.0", "@typescript-eslint/parser": "^8.6.0", "classnames": "^2.5.1", + "cross-env": "^7.0.3", "eslint": "^9.10.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.30.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e56c55e..1163c4e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,6 +87,9 @@ importers: classnames: specifier: ^2.5.1 version: 2.5.1 + cross-env: + specifier: ^7.0.3 + version: 7.0.3 eslint: specifier: ^9.10.0 version: 9.10.0(jiti@1.21.6) @@ -1217,6 +1220,11 @@ packages: core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + cross-env@7.0.3: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + cross-spawn@6.0.5: resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==} engines: {node: '>=4.8'} @@ -4281,6 +4289,10 @@ snapshots: core-util-is@1.0.3: {} + cross-env@7.0.3: + dependencies: + cross-spawn: 7.0.3 + cross-spawn@6.0.5: dependencies: nice-try: 1.0.5