Skip to content

chore: crisp packages publishing#963

Merged
ctrlc03 merged 7 commits into
devfrom
chore/crisp-org
Nov 5, 2025
Merged

chore: crisp packages publishing#963
ctrlc03 merged 7 commits into
devfrom
chore/crisp-org

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Nov 5, 2025

Copy link
Copy Markdown
Collaborator

fix #960

Summary by CodeRabbit

  • New Features

    • Added an automated package publishing workflow to streamline releases.
  • Documentation

    • Added publishing instructions to the CRISP example README (duplicate sections added).
  • Chores

    • Rebranded packages to the @crisp-e3/* namespace.
    • Bumped several package versions to test releases and configured packages for public npm publishing.
    • Added a publish script and updated dependency versions.
  • Removed

    • Removed an existing Solidity test from the CRISP example.

@ctrlc03 ctrlc03 requested a review from cedoor November 5, 2025 13:19
@ctrlc03 ctrlc03 self-assigned this Nov 5, 2025
@vercel

vercel Bot commented Nov 5, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
crisp Ready Ready Preview Comment Nov 5, 2025 2:28pm
enclave-docs Ready Ready Preview Comment Nov 5, 2025 2:28pm

@ctrlc03 ctrlc03 linked an issue Nov 5, 2025 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Renames CRISP example packages from the @enclave* namespace to @crisp-e3*, updates package manifests and imports, adds publish metadata and a new TypeScript CRISPPublisher script, bumps viem versions, updates client manifest, adds README publish instructions, and removes one Solidity test file.

Changes

Cohort / File(s) Summary
Documentation
examples/CRISP/Readme.md
Added two "Publishing packages to npm" sections showing pnpm publish:packages x.x.x.
Workspace root
examples/CRISP/package.json
Renamed package to @crisp-e3/main; added publish:packages script (tsx scripts/publish.ts); minor script formatting.
Client manifest
examples/CRISP/client/package.json
Renamed package to @crisp-e3/client; bumped viem from 2.30.62.38.6; transient edit to @enclave-e3/sdk line (no net change).
Contracts package manifest
examples/CRISP/packages/crisp-contracts/package.json
Renamed to @crisp-e3/contracts; version → 0.0.1-test; files adjusted to ["contracts","dist"]; added exports mappings and publishConfig.access: "public".
ZK inputs package manifest
examples/CRISP/packages/crisp-zk-inputs/package.json
Renamed to @crisp-e3/zk-inputs; version → 0.0.1-test; added publishConfig.access: "public".
SDK package & source
examples/CRISP/packages/crisp-sdk/package.json, .../src/constants.ts, .../src/vote.ts, .../tests/vote.test.ts
Manifest renamed to @crisp-e3/sdk, version → 0.0.1-test; dependency @enclave/crisp-zk-inputs@crisp-e3/zk-inputs; imports updated accordingly.
Publishing script
examples/CRISP/scripts/publish.ts
New TypeScript CRISPPublisher class and CLI added: validates version, optional git checks, bumps package versions, updates lockfile, builds, publishes packages, optional git commit/tag; exports CRISPPublisher.
Removed test
examples/CRISP/packages/crisp-contracts/tests/CRISPProgram.t.sol
Deleted entire Solidity test file and its test scaffolding/imports.
Root pnpm overrides
package.json
Updated pnpm override for viem from 2.30.62.38.6.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI entry
    participant Pub as CRISPPublisher
    participant Git as Git
    participant FS as FileSystem
    participant Build as Builder
    participant NPM as npm/pnpm

    CLI->>Pub: instantiate(version, options)
    CLI->>Pub: publishAll()
    Pub->>Pub: validateVersion()
    Pub->>FS: getCurrentVersion()
    Pub->>Git: checkGitStatus()
    alt dry-run == false
        Pub->>FS: bumpNpmPackages()  --> updatePackageJson()
        Pub->>FS: updateLockFiles()  --> run `pnpm install`
        Pub->>Build: buildPackages() --> run `pnpm build` per package
        Pub->>NPM: publishPackages() --> run `pnpm publish` per package
        alt not skipGit
            Pub->>Git: performGitOperations() --> git add & commit & tag
        end
    else dry-run
        Pub-->>CLI: print planned changes (no writes)
    end
    Pub-->>CLI: log summary / exit
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Files needing extra attention:
    • examples/CRISP/scripts/publish.ts — version parsing, CLI flags, external command invocation, dry-run and error handling, git operations.
    • examples/CRISP/packages/crisp-contracts/package.jsonexports mapping correctness for consumers (import/require paths).
    • Cross-package references and workspace resolution after renames (crisp-sdk, zk-inputs, contracts).
    • Deletion of CRISPProgram.t.sol — verify test coverage impact.

Possibly related PRs

Suggested reviewers

  • cedoor
  • 0xjei

Poem

🐇 I hopped through manifests, changed names with a spin,
From @enclave burrows to @crisp-e3 kin.
A script for publishing, a README cheer,
One test tucked away — prepare the next release gear! 🎩📦

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Most changes align with the scope of independent CRISP package publishing; however, the deletion of CRISPProgram.t.sol test file and viem version bumps appear unrelated to the core packaging objective. Clarify whether test file deletion and viem dependency updates are necessary for the publishing objective, or move them to a separate PR to maintain focused scope.
✅ 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: crisp packages publishing' accurately describes the main change of setting up independent publishing infrastructure for CRISP packages with renamed package names and a new publish script.
Linked Issues check ✅ Passed The PR successfully addresses issue #960 by renaming CRISP packages to @crisp-e3 scope and adding publishing infrastructure to enable independent publication separate from Enclave packages.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/crisp-org

📜 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 e6e7fba and f9aee47.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.791Z
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). (8)
  • GitHub Check: test_contracts
  • GitHub Check: build_e3_support_dev
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: test_net
  • GitHub Check: integration_prebuild
  • GitHub Check: rust_unit
  • GitHub Check: rust_integration
🔇 Additional comments (1)
package.json (1)

73-73: viem upgrade verified—no breaking changes, tests passing.

viem 2.38.6 is a patch release with no breaking changes, and viem 2.30.x versions contain no breaking changes. The EVM test suite (199 tests) passes successfully with this version, confirming compatibility across SDK and contract functionality. The upgrade from 2.30.6 to 2.38.6 is safe to merge.


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.

@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 5, 2025 13:20 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 5, 2025 13:20 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
examples/CRISP/scripts/publish.ts (1)

229-257: Consider using a more robust approach for the git commit message.

The multi-line commit message is interpolated into a command string with double quotes (Line 247). While the version is validated with a semver regex earlier, this approach could be fragile if the message format changes or contains unexpected characters in the future.

Consider one of these safer alternatives:

Option 1: Use git commit with -F flag and a temporary file

const commitMessage = `chore(crisp): publish version ${this.newVersion}

- Updated @crisp-e3/sdk to ${this.newVersion}
- Updated @crisp-e3/contracts to ${this.newVersion}
- Updated @crisp-e3/zk-inputs to ${this.newVersion}
- Published to npm`

const tempFile = join(this.crispDir, '.commit-msg-temp')
writeFileSync(tempFile, commitMessage)
execSync(`git commit -F ${tempFile}`, { cwd: this.crispDir, stdio: 'pipe' })
execSync(`rm ${tempFile}`, { cwd: this.crispDir })

Option 2: Use exec with array arguments (if switching to a library like execa)

This would avoid shell interpolation entirely.

📜 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 bd5d35a and bb3e468.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • examples/CRISP/Readme.md (1 hunks)
  • examples/CRISP/client/package.json (1 hunks)
  • examples/CRISP/package.json (2 hunks)
  • examples/CRISP/packages/crisp-contracts/package.json (1 hunks)
  • examples/CRISP/packages/crisp-sdk/package.json (2 hunks)
  • examples/CRISP/packages/crisp-sdk/src/constants.ts (1 hunks)
  • examples/CRISP/packages/crisp-sdk/src/vote.ts (1 hunks)
  • examples/CRISP/packages/crisp-sdk/tests/vote.test.ts (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/package.json (2 hunks)
  • examples/CRISP/scripts/publish.ts (1 hunks)
🧰 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.
⏰ 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: integration_prebuild
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: build_e3_support_dev
  • GitHub Check: test_contracts
  • GitHub Check: test_net
  • GitHub Check: rust_unit
  • GitHub Check: rust_integration
🔇 Additional comments (22)
examples/CRISP/client/package.json (1)

2-2: LGTM! Package renamed to @crisp-e3 namespace.

The package name change aligns with the broader CRISP publishing workflow under the @crisp-e3 scope.

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

2-5: LGTM! Package configuration updated for publishing.

The package has been correctly renamed to @crisp-e3/zk-inputs with appropriate publishConfig for public access. The version 0.0.1-test indicates this is a pre-release test version, which is appropriate for validating the publishing workflow before an official release.

Also applies to: 17-19

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

2-3: LGTM! Package configuration looks solid.

The package metadata, exports mappings, and publish configuration are correctly set up:

  • Package renamed to @crisp-e3/contracts with test version
  • files array updated to include both contracts and dist directories
  • exports field properly configured for contract wildcards and type definitions
  • publishConfig correctly set for public access

Also applies to: 5-21, 26-28

examples/CRISP/packages/crisp-sdk/src/vote.ts (1)

7-7: LGTM! Import path updated consistently.

The import source has been correctly updated to reflect the renamed @crisp-e3/zk-inputs package.

examples/CRISP/packages/crisp-sdk/tests/vote.test.ts (1)

8-8: LGTM! Test import updated consistently.

The import path in the test file has been correctly updated to match the renamed package.

examples/CRISP/packages/crisp-sdk/src/constants.ts (1)

7-7: LGTM! Import path updated.

Consistent with the package namespace migration to @crisp-e3/zk-inputs.

examples/CRISP/package.json (1)

2-2: LGTM! Main package updated with publish script.

The package name has been updated to @crisp-e3/main and the new publish:packages script has been added to support the publishing workflow. Dependencies in crisp-sdk have been correctly updated to reference @crisp-e3/zk-inputs.

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

3-3: Confirm the "-test" version suffix is intentional.

The version 0.0.1-test suggests this is for testing purposes. Ensure this is intentional and not accidentally committed, as it will be published to npm with this pre-release identifier.

examples/CRISP/scripts/publish.ts (14)

1-14: LGTM!

The imports and ES module setup are correct. The tsx shebang and __dirname workaround for ES modules are appropriate.


16-25: LGTM!

The type definitions are clean and well-documented. The interfaces appropriately capture the required data structures.


43-129: LGTM!

The main publishing workflow is well-orchestrated with proper validation, error handling, and user feedback. The dry-run mode and optional git operations provide good flexibility.


134-167: LGTM!

The build process properly checks for build scripts before execution and provides clear feedback. Error handling is appropriate.


172-201: LGTM!

The publishing logic correctly determines the npm tag based on version format (pre-release vs stable) and properly publishes packages with public access. The --no-git-checks flag is appropriate here since the script handles git validation separately.


206-224: LGTM!

The git status check is well-implemented with clear error messages and appropriate fallback handling. The bypass option provides flexibility when needed.


262-273: LGTM!

Simple and effective helper for retrieving the current version from the SDK package.


278-290: LGTM!

Correctly updates the lock file after version changes. The warning fallback is appropriate since this is not always critical to the publishing workflow.


295-300: LGTM!

The semantic version validation regex correctly matches the semver specification including optional pre-release and build metadata. Good error message.


305-326: LGTM!

The version bumping logic cleanly iterates through all CRISP packages with appropriate logging and error handling.


331-339: LGTM!

Correctly updates the package.json file while preserving standard formatting (2-space indent, trailing newline).


344-348: LGTM!

Simple utility function for extracting package names.


352-384: LGTM!

The CLI argument parsing is clean and handles all the documented options correctly. Good validation and error messages.


431-438: LGTM!

The module execution check and export are correctly implemented, allowing both direct execution and programmatic usage of the CRISPPublisher class.

Comment thread examples/CRISP/Readme.md
Comment thread examples/CRISP/scripts/publish.ts
Comment thread examples/CRISP/scripts/publish.ts
cedoor
cedoor previously approved these changes Nov 5, 2025

@cedoor cedoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@vercel vercel Bot temporarily deployed to Preview – crisp November 5, 2025 13:36 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 5, 2025 13:36 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 5, 2025 13:41 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 5, 2025 13:41 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 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 bb3e468 and e6e7fba.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • examples/CRISP/Readme.md (1 hunks)
  • examples/CRISP/client/package.json (3 hunks)
  • examples/CRISP/packages/crisp-contracts/tests/CRISPProgram.t.sol (0 hunks)
  • examples/CRISP/scripts/publish.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • examples/CRISP/packages/crisp-contracts/tests/CRISPProgram.t.sol
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/CRISP/scripts/publish.ts
🧰 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.
🪛 LanguageTool
examples/CRISP/Readme.md

[style] ~317-~317: Consider a more concise word here.
Context: ... round. ## Publishing packages to npm In order to publish a new version of the CRISP pack...

(IN_ORDER_TO_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
examples/CRISP/Readme.md

316-316: No space after hash on atx style heading

(MD018, no-missing-space-atx)

⏰ 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). (2)
  • GitHub Check: build_enclave_cli
  • GitHub Check: test_net
🔇 Additional comments (3)
examples/CRISP/Readme.md (1)

316-322: Fix the Markdown heading formatting.

The heading on Line 316 is missing proper spacing after the hash symbol for atx-style headers per Markdown standards (MD018).

Apply this diff to fix the formatting:

-## Publishing packages to npm
+## Publishing packages to npm

Additionally, Line 318 reads slightly verbose; consider tightening it for conciseness:

-In order to publish a new version of the CRISP packages to npm, you can use:
+To publish a new version of the CRISP packages to npm, use:

Likely an incorrect or invalid review comment.

examples/CRISP/client/package.json (2)

2-2: Package namespace update aligns with PR objectives.

The package name has been correctly updated to @crisp-e3/client, reflecting the broader namespace shift to publish CRISP packages independently from Enclave.


40-40: Confirm intent of viem version pinning; no breaking change risk identified for code usage.

The viem dependency is indeed pinned to an exact version (2.38.6) while nearly all other dependencies use carets—this inconsistency is accurate. However, verification shows the code uses only stable viem utilities (encodeAbiParameters, parseAbiParameters, bytesToHex) that are not affected by the breaking changes documented between v2.30.6 and v2.38.6. The exact pinning appears intentional for reproducibility, which aligns with project preferences noted in release workflows. Clarify whether this exact pinning is intentional or should be aligned with the project's caret convention.

Comment thread examples/CRISP/client/package.json
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.

Sort out versioning and naming for CRISP packages

2 participants