Skip to content

chore: set up tsup for crisp-sdk#976

Merged
cedoor merged 1 commit into
devfrom
chore/tsup
Nov 6, 2025
Merged

chore: set up tsup for crisp-sdk#976
cedoor merged 1 commit into
devfrom
chore/tsup

Conversation

@cedoor

@cedoor cedoor commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Closes #977

Summary by CodeRabbit

  • Build & Performance

    • Improved build process with enhanced caching and incremental compilation support
    • Modernized TypeScript compiler configuration (ES2022 target)
  • New Features

    • Added zero-knowledge proof runtime libraries for enhanced cryptographic operations

@vercel

vercel Bot commented Nov 6, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
crisp Skipped Skipped Nov 6, 2025 6:40pm
enclave-docs Skipped Skipped Nov 6, 2025 6:40pm

@coderabbitai

coderabbitai Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The PR modifies CRISP JavaScript packages to transition from TypeScript compiler to tsup bundling, upgrades TypeScript configuration for ES2022 with incremental builds, reorganizes dependencies between contracts and SDK packages, and adds cryptographic/arithmetic operation dependencies.

Changes

Cohort / File(s) Summary
Package dependency restructuring
examples/CRISP/packages/crisp-contracts/package.json
Moved @crisp-e3/sdk from dependencies to devDependencies; added @crisp-e3/zk-inputs to devDependencies.
Build tooling migration & dependencies
examples/CRISP/packages/crisp-sdk/package.json
Replaced tsc build command with tsup bundler; added tsup as devDependency; upgraded TypeScript to 5.8.3; added @aztec/bb.js and @noir-lang/noir_js runtime dependencies.
TypeScript configuration enhancement
examples/CRISP/packages/crisp-sdk/tsconfig.json
Updated target from ES2020 to ES2022; enabled esModuleInterop and allowSyntheticDefaultImports; configured declaration generation and incremental builds; expanded include patterns to src and tests; added node_modules and dist exclusions.
Build bundler configuration
examples/CRISP/packages/crisp-sdk/tsup.config.js
New file introducing tsup configuration with src/index.ts entry point, ES module format output, disabled code splitting, enabled sourcemaps and type declarations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • tsconfig.json changes require verification that ES2022 target, new compiler options (incremental builds, noEmit), and expanded include patterns don't introduce breaking changes or type-checking regressions.
  • Build tooling migration from tsc to tsup needs validation that output formats, source maps, and type declaration generation produce equivalent artifacts.
  • New runtime dependencies (@aztec/bb.js, @noir-lang/noir_js) warrant verification of version compatibility and absence of conflicting transitive dependencies.

Possibly related PRs

Suggested reviewers

  • ctrlc03

Poem

🐰 Bundling hops with tsup's grace,
ES2022 in every place,
Type declarations now ascend,
On cryptographic deps we depend,
Build tooling dreams, reimagined!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: set up tsup for crisp-sdk' accurately reflects the main changes: adding tsup configuration and related build setup for the crisp-sdk package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/tsup

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d14826c and 5096789.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • examples/CRISP/packages/crisp-contracts/package.json (1 hunks)
  • examples/CRISP/packages/crisp-sdk/package.json (2 hunks)
  • examples/CRISP/packages/crisp-sdk/tsconfig.json (1 hunks)
  • examples/CRISP/packages/crisp-sdk/tsup.config.js (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 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-contracts/package.json
  • examples/CRISP/packages/crisp-sdk/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/packages/crisp-contracts/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). (12)
  • GitHub Check: crisp_e2e
  • GitHub Check: build_enclave_cli
  • GitHub Check: test_contracts
  • GitHub Check: build_sdk
  • GitHub Check: integration_prebuild
  • GitHub Check: rust_unit
  • GitHub Check: test_net
  • GitHub Check: rust_integration
  • GitHub Check: build_sdk
  • GitHub Check: rust_integration
  • GitHub Check: integration_prebuild
  • GitHub Check: rust_unit
🔇 Additional comments (7)
examples/CRISP/packages/crisp-sdk/package.json (3)

24-24: Build tooling successfully migrated to tsup.

The migration from TypeScript compiler to tsup bundling aligns with the new tsup.config.js and updated tsconfig.json. This should provide faster builds and better tree-shaking.


36-37: TypeScript version pinned appropriately.

Using tsup 8.5.0 and TypeScript 5.8.3 provides a stable, modern build foundation. The specific version pinning helps ensure consistent builds across environments.


48-50: Both cryptographic dependencies are actively imported and utilized.

The packages are integrated into core SDK functions:

  • @aztec/bb.js (UltraHonkBackend) is instantiated in generateProof, executeProof, and verifyProof functions
  • @noir-lang/noir_js (Noir, CompiledCircuit) are used across the same proof generation and verification flow

No bundle bloat concern exists; these are legitimate runtime dependencies performing essential cryptographic operations.

examples/CRISP/packages/crisp-sdk/tsup.config.js (1)

7-17: LGTM! Well-configured tsup setup for a library.

The configuration is appropriate for an SDK package:

  • Single entry point (src/index.ts) provides a clear public API
  • ESM format aligns with the package's "type": "module"
  • Type declarations (dts: true) ensure TypeScript consumers get proper typing
  • Sourcemaps and clean builds aid development workflow
examples/CRISP/packages/crisp-sdk/tsconfig.json (2)

3-15: LGTM! TypeScript configuration correctly aligned with tsup.

The configuration changes properly support the tsup-based build:

  • noEmit: true prevents TypeScript from emitting files (tsup handles bundling)
  • declaration: true and declarationMap: true allow tsup to generate type declarations via dts: true
  • ES2022 target provides modern JavaScript features while maintaining broad compatibility
  • esModuleInterop and allowSyntheticDefaultImports improve module interoperability
  • Incremental builds will speed up type-checking

This is the correct pattern for using TypeScript with tsup.


17-18: Include/exclude patterns properly scoped.

Expanding the include to cover both src and tests ensures comprehensive type-checking, while excluding node_modules and dist avoids redundant checking of external/generated code.

examples/CRISP/packages/crisp-contracts/package.json (1)

61-62: Verification complete: No issues found.

The packages @crisp-e3/sdk and @crisp-e3/zk-inputs are in devDependencies, and no imports of these packages were found in the source files (deploy scripts, hardhat config, or test files). The package exports are limited to ./contracts/* and ./types, which do not depend on these packages. The code change is correct.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cedoor cedoor linked an issue Nov 6, 2025 that may be closed by this pull request
@cedoor cedoor requested a review from ctrlc03 November 6, 2025 18:46
@cedoor cedoor enabled auto-merge (squash) November 6, 2025 18:52
@cedoor cedoor merged commit 87a4a0a into dev Nov 6, 2025
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up tsup build for crisp-sdk

2 participants