chore: update vercel install command#1015
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
WalkthroughAdds Vercel and npm client config, introduces wasm-pack devDependency, centralizes circuit compilation into a shell script, updates several package.json scripts to call the new compile step, and extends the CRISP publish script to update the client package's Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Publish as publish.ts
participant Registry as npm Registry
participant Git as Git
participant ClientPkg as client/package.json
Dev->>Publish: pnpm publish (runs publishAll)
Publish->>Publish: build workspace (including wasm & sdk)
Publish->>Registry: publish packages
Publish->>Git: create commit & tag
Note over Publish,ClientPkg: NEW — sync client dependency
Publish->>ClientPkg: read package.json
Publish->>ClientPkg: set `@crisp-e3/sdk` to new version
Publish->>ClientPkg: write package.json
Publish->>Dev: report completion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
examples/CRISP/scripts/vercel-install.sh (1)
9-28: Add error handling for download and extraction failures.The script lacks safeguards against download or extraction failures. If a curl command fails silently or a tar extraction encounters corrupted data, the script continues with
set -erelying only on non-zero exit codes. Add explicit checks for critical operations.Consider adding checks for download success and file integrity:
# NARGO if [ ! -x "$TOOLS_DIR/nargo" ]; then echo "Downloading nargo..." NARGO_VERSION="v1.0.0-beta.3" - curl -L "https://github.com/noir-lang/noir/releases/download/${NARGO_VERSION}/nargo-x86_64-unknown-linux-musl.tar.gz" \ - | tar -xz -C "$TOOLS_DIR" + NARGO_URL="https://github.com/noir-lang/noir/releases/download/${NARGO_VERSION}/nargo-x86_64-unknown-linux-musl.tar.gz" + if ! curl -fL "$NARGO_URL" | tar -xz -C "$TOOLS_DIR"; then + echo "Failed to download or extract nargo" >&2 + exit 1 + fi chmod +x "$TOOLS_DIR/nargo" fiAlso standardize the download approach (wasm-pack uses
curl -owhile nargo pipes directly—pick one pattern for consistency).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
examples/CRISP/client/package.json(1 hunks)examples/CRISP/client/vercel.json(1 hunks)examples/CRISP/scripts/vercel-install.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
📚 Learning: 2025-10-29T23:35:30.146Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 936
File: scripts/run-crisp-test.sh:1-3
Timestamp: 2025-10-29T23:35:30.146Z
Learning: In the scripts/run-crisp-test.sh file, the use of `rm -rf *` is acceptable as it's intentionally designed as a definitive reset-and-test script for clean checkouts.
Applied to files:
examples/CRISP/scripts/vercel-install.sh
📚 Learning: 2025-11-05T14:12:57.814Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
Applied to files:
examples/CRISP/client/package.json
📚 Learning: 2025-08-25T10:28:56.174Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.
Applied to files:
examples/CRISP/client/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: build_sdk
- GitHub Check: build_e3_support_dev
- GitHub Check: rust_unit
- GitHub Check: build_enclave_cli
- GitHub Check: integration_prebuild
- GitHub Check: test_net
- GitHub Check: rust_integration
- GitHub Check: test_contracts
🔇 Additional comments (2)
examples/CRISP/client/package.json (1)
22-22: Dependency conflict: @crisp-e3/sdk vs @enclave-e3/sdk based on prior learning.A recent learning from PR 963 (2025-11-05) explicitly states that the CRISP client should depend on
@enclave-e3/sdk, not@crisp-e3/sdk. However, the current code depends on@crisp-e3/sdk. These are different packages:
@enclave-e3/sdkis inpackages/enclave-sdk/package.json@crisp-e3/sdkis inexamples/CRISP/packages/crisp-sdk/package.jsonVerify whether this change to
@crisp-e3/sdkis intentional or if the dependency should remain@enclave-e3/sdkper the documented design decision.examples/CRISP/client/vercel.json (1)
3-3: Review comment is based on incorrect assumptions about Vercel's working directory behavior.Vercel sets the working directory to the project's Root Directory, which for this nested project is
examples/CRISP/client/wherevercel.jsonis located. Both the install and build commands execute from this same directory:
- Install phase:
bash ../scripts/vercel-install.shruns fromexamples/CRISP/client/, creating.vercel/cache/toolsrelative to this CWD- Build phase:
export PATH=.vercel/cache/tools:$PATHruns from the same CWD, resolving to the tools created in the install phaseThe relative path is consistent across both phases and resolves correctly. The configuration is correct as-is.
Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/CRISP/scripts/compile_circuits.sh (1)
42-42: Optional: Add cleanup trap for temp file on error.While the temp file created by
mktempis stored in the system temp directory and will eventually be cleaned, adding an explicit cleanup handler makes the script more robust:+TEMP_FILE=$(mktemp) +trap "rm -f '$TEMP_FILE'" EXIT { echo "$LICENSE_HEADER" tail -n +3 packages/crisp-contracts/contracts/CRISPVerifier.sol } > "$TEMP_FILE"This ensures the temp file is removed even if the script exits unexpectedly.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
crates/wasm/package.json(1 hunks)examples/CRISP/client/vercel.json(1 hunks)examples/CRISP/package.json(1 hunks)examples/CRISP/packages/crisp-zk-inputs/package.json(1 hunks)examples/CRISP/scripts/compile_circuits.sh(1 hunks)examples/CRISP/scripts/vercel-install.sh(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- examples/CRISP/client/vercel.json
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: build_e3_support_dev
- GitHub Check: test_net
- GitHub Check: build_sdk
- GitHub Check: integration_prebuild
- GitHub Check: build_enclave_cli
- GitHub Check: rust_integration
- GitHub Check: test_contracts
- GitHub Check: rust_unit
- GitHub Check: Build & Push Image
🔇 Additional comments (6)
crates/wasm/package.json (1)
65-69: ✓ Appropriate addition of wasm-pack tooling.Adding
wasm-packas a devDependency aligns with the PR objectives to enable in-repo WASM builds. The version constraint^0.13.1allows flexibility for patch/minor updates while maintaining stability.examples/CRISP/packages/crisp-zk-inputs/package.json (1)
32-36: ✓ Consistent wasm-pack dependency across CRISP packages.The version
^0.13.1matches the addition incrates/wasm/package.json, ensuring consistent tooling versions across the monorepo for WASM builds.examples/CRISP/scripts/vercel-install.sh (2)
1-20: ✓ Vercel installation script is well-structured.The script uses strict error handling (
set -euo pipefail), downloads nargo from the official noir-lang repository, and includes defensive checks (idempotent download). The verification step at line 19 confirms successful installation before reporting success.
11-11: Verify that nargo v1.0.0-beta.3 is the intended version for production Vercel deployments.The script pins nargo to a beta release. Consider whether a stable release is more appropriate for production deployments, or if the beta version is intentional for CRISP's current development stage.
examples/CRISP/scripts/compile_circuits.sh (1)
34-47: ✓ Safe file rewriting pattern with proper SPDX license header.The temp file + atomic rename pattern at lines 42–47 is the standard approach for safe in-place file updates. The license header format is correct (
SPDX-License-Identifier: LGPL-3.0-only), andtail -n +3correctly skips the auto-generated Apache license from the first two lines.examples/CRISP/package.json (1)
24-24: ✓ Compilation pipeline refactored for maintainability.Delegating the
compile:circuitcommand to a dedicated bash script improves separation of concerns and enables future enhancements to the compilation and post-processing pipeline (e.g., license header injection) without modifyingpackage.json.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/CRISP/scripts/publish.ts (1)
278-278: Consider usingunknowninstead ofanyfor better type safety.The
anytype bypasses TypeScript's type checking. Consider usingunknownorErrorfor the error parameter.- } catch (error: any) { + } catch (error: unknown) { console.error("❌ Error during git operations:", error.message);Note: You'll need to add a type guard to access
error.messagesafely:} catch (error: unknown) { const message = error instanceof Error ? error.message : String(error); console.error("❌ Error during git operations:", message);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
examples/CRISP/client/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
examples/CRISP/client/.npmrc(1 hunks)examples/CRISP/client/vercel.json(1 hunks)examples/CRISP/packages/crisp-sdk/package.json(1 hunks)examples/CRISP/packages/crisp-zk-inputs/package.json(1 hunks)examples/CRISP/scripts/publish.ts(5 hunks)
✅ Files skipped from review due to trivial changes (1)
- examples/CRISP/client/.npmrc
🚧 Files skipped from review as they are similar to previous changes (2)
- examples/CRISP/client/vercel.json
- examples/CRISP/packages/crisp-zk-inputs/package.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
📚 Learning: 2025-11-05T14:12:57.814Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
Applied to files:
examples/CRISP/packages/crisp-sdk/package.json
🧬 Code graph analysis (1)
examples/CRISP/scripts/publish.ts (1)
examples/CRISP/crates/zk-inputs-wasm/src/lib.rs (1)
version(131-133)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: build_e3_support_dev
- GitHub Check: build_enclave_cli
- GitHub Check: build_sdk
- GitHub Check: integration_prebuild
- GitHub Check: test_net
- GitHub Check: rust_integration
- GitHub Check: rust_unit
- GitHub Check: test_contracts
- GitHub Check: Build & Push Image
🔇 Additional comments (4)
examples/CRISP/packages/crisp-sdk/package.json (1)
24-24: Script chaining looks good; verify toolchain availability.The updated build and test scripts correctly chain
build:wasm→compile:circuit→ final compilation steps, with proper failure propagation via&&. The ordering ensures WASM artifacts are ready before circuits compile.However, these scripts now require
nargoto be available on the system. Per the PR objectives, a deployment setup script should install required toolchains (Rust, Nargo, wasm-pack).Please verify:
- The deployment script (mentioned in issue #999 objectives) properly installs
nargoand other required tools.- The path
../../circuitscorrectly resolves to the circuit directory in your monorepo structure.- The
../crisp-zk-inputspackage has a validbuildscript defined.If tool installation fails on deployment, the error message should clearly indicate which toolchain is missing. Consider adding setup documentation or validation checks.
Also applies to: 26-27
examples/CRISP/scripts/publish.ts (3)
7-14: LGTM! Clean ES module setup.The imports and ES module
__dirnamesetup are correct and follow best practices for TypeScript ESM scripts.
42-143: LGTM! Well-orchestrated publish flow.The integration of the client dependency update step is well-placed in the sequence:
- Bump package versions
- Update client dependency (new)
- Update lock files
- Build and publish
The dry-run and success messaging correctly reflects this additional step.
380-421: I need to investigate further. The script output reveals a conflict with the learning: the client actually depends on@crisp-e3/sdk, which is what the script updates. However, the learning states it should depend onenclave-e3/sdk. Let me verify the broader context.Let me check the publish script context to understand what's being published and whether the dependency choice is intentional:
The web search results don't contain information about the project-specific
@crisp-e3/sdkor@enclave-e3/sdkpackages. These appear to be internal to the Enclave project. Let me check the broader context within the publish script to understand what it's publishing and whether the client should be using a different SDK:Based on my verification, the actual state of the client dependencies contradicts the retrieved learning. The client currently depends on
@crisp-e3/sdk, which is what the script updates—so the script logic is correct for the current package state. However, the learning indicates the CRISP client should intentionally depend onenclave-e3/sdkinstead.This represents either an outdated learning, an intentional change, or a misconfiguration in the client dependencies. Since the packages appear to be project-specific and not publicly documented, I cannot definitively resolve this conflict through web search.
Verify that the CRISP client should depend on
@crisp-e3/sdkand not@enclave-e3/sdk.The script correctly updates the current
@crisp-e3/sdkdependency in client/package.json (Line 401, 404). However, retrieved learnings indicate the CRISP client should intentionally depend onenclave-e3/sdk(the general Enclave SDK), not@crisp-e3/sdk(the CRISP-specific SDK).The script will execute successfully as-is because
@crisp-e3/sdkexists in client/package.json. Confirm whether:
- The client should actually be using
@crisp-e3/sdk(CRISP-specific), or- It should be using
@enclave-e3/sdk(general Enclave SDK)—in which case the script needs adjustmentAdditionally, Line 404 sets exact version pinning without
^or~prefix. Verify if this is intentional.
Closes #999
Instead of adding a custom deployment script for Vercel, this PR introduces the pnpm
link-workspace-packagesoption. This allows the workspace to link the local package even when a static version is defined. On Vercel, this option is simply disabled, so the published npm package is used instead.It also adds
wasm-packas an npm dependency, which is far easier to maintain than relying on external binaries. A few script improvements were included as well to streamline the workflow.Summary by CodeRabbit