diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml new file mode 100644 index 0000000..52e8624 --- /dev/null +++ b/.github/workflows/deploy-demo.yml @@ -0,0 +1,52 @@ +name: Build and Deploy demo to Netlify + +on: + # Runs on pushes targeting the default branch + push: + branches: ['main'] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - name: Install Just + uses: extractions/setup-just@v2 + + - name: install wasm-pack + uses: jetli/wasm-pack-action@v0.4.0 + with: + version: latest + + - name: build pkg + run: just build + + - uses: actions/setup-node@v4 + with: + node-version: lts/* + + - uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm i + + - name: Build + run: pnpm build + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v3.0 + with: + publish-dir: './packages/demo-wallet/dist' + production-branch: main + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy from GitHub Actions" + enable-pull-request-comment: false + enable-commit-comment: true + overwrites-pull-request-comment: true + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2de2381..05d71d9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,5 @@ packages/demo-wallet/dist/* packages/e2e-tests/dist/* ./dist/* -!packages/demo-wallet/dist/serve.json +!packages/demo-wallet/dist/_headers !packages/e2e-tests/dist/serve.json diff --git a/Cargo.toml b/Cargo.toml index 112a227..a29e1e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ zcash_client_backend = { git = "https://github.com/ChainSafe/librustzcash", rev zcash_client_memory = { git = "https://github.com/ChainSafe/librustzcash", rev = "37c765025386912c6152ba5e9816099a067497e5", features = ["orchard"] } zcash_primitives = { git = "https://github.com/ChainSafe/librustzcash", rev = "37c765025386912c6152ba5e9816099a067497e5" } zcash_address = { git = "https://github.com/ChainSafe/librustzcash", rev = "37c765025386912c6152ba5e9816099a067497e5" } -zcash_proofs = { git = "https://github.com/ChainSafe/librustzcash", rev = "37c765025386912c6152ba5e9816099a067497e5", default-features = false, features = ["bundled-prover"] } +zcash_proofs = { git = "https://github.com/ChainSafe/librustzcash", rev = "37c765025386912c6152ba5e9816099a067497e5", default-features = false, features = ["bundled-prover", "multicore"] } zip321 = { git = "https://github.com/ChainSafe/librustzcash", rev = "37c765025386912c6152ba5e9816099a067497e5" } diff --git a/README.md b/README.md index 7a3a758..e4c6d8c 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,10 @@ Browser tests are run in a headless browser environment and can be run with just test-web ``` +## Known Issues + +You might notice the demo-wallet builds using parcel despite being configured to use Vite for development. This is due to a [known issue](https://github.com/vitejs/vite/issues/7015) with vite where it cannot correctly handle what it deems to be a cyclic dependency introduced by `wasm_bindgen_rayon` webworkers. Other bundlers tested to not seem to be affected. + ## Security Warnings These libraries are currently under development, have received no reviews or audit, and come with no guarantees whatsoever. diff --git a/justfile b/justfile index 46ea915..341e34e 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ default: just --list build *features: - wasm-pack build --no-opt -t web --scope webzjs --release --out-dir ./packages/webz-core --no-default-features --features="wasm wasm-parallel {{features}}" -Z build-std="panic_abort,std" + wasm-pack build -t web --scope webzjs --release --out-dir ./packages/webz-core --no-default-features --features="wasm wasm-parallel {{features}}" -Z build-std="panic_abort,std" # All Wasm Tests test-web *features: diff --git a/package.json b/package.json index a86ec47..285164e 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,14 @@ { "scripts": { "preinstall": "npx only-allow pnpm", - "build": "parcel build --no-cache --no-autoinstall packages/demo-wallet", "serve": "pnpm --filter ./packages/demo-wallet run serve", - "start:dev": "parcel --no-autoinstall packages/demo-wallet", + "dev": "pnpm --filter ./packages/demo-wallet run dev", + "build": "pnpm --filter ./packages/demo-wallet run build", "test:e2e": "pnpm --filter ./packages/e2e-tests test" }, "dependencies": { - "@webzjs/webz-core": "workspace:^", - "@webzjs/demo-wallet": "workspace:^" - }, - "devDependencies": { - "@parcel/core": "^2.12.0", - "parcel": "^2.12.0", - "process": "^0.11.10" + "@webzjs/demo-wallet": "workspace:^", + "@webzjs/webz-core": "workspace:^" }, "packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b" } diff --git a/packages/demo-wallet/dist/_headers b/packages/demo-wallet/dist/_headers new file mode 100644 index 0000000..cabbdca --- /dev/null +++ b/packages/demo-wallet/dist/_headers @@ -0,0 +1,3 @@ +/* + Cross-Origin-Opener-Policy: same-origin + Cross-Origin-Embedder-Policy: require-corp diff --git a/packages/demo-wallet/dist/serve.json b/packages/demo-wallet/dist/serve.json deleted file mode 100644 index 117f86c..0000000 --- a/packages/demo-wallet/dist/serve.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "headers": [ - { - "source": "**/*", - "headers": [ - { - "key": "Cross-Origin-Opener-Policy", - "value": "same-origin" - }, - { - "key": "Cross-Origin-Embedder-Policy", - "value": "require-corp" - } - ] - } - ] - } - \ No newline at end of file diff --git a/packages/demo-wallet/src/index.html b/packages/demo-wallet/index.html similarity index 63% rename from packages/demo-wallet/src/index.html rename to packages/demo-wallet/index.html index 60c5356..a49cdca 100644 --- a/packages/demo-wallet/src/index.html +++ b/packages/demo-wallet/index.html @@ -3,10 +3,9 @@