chore: crisp packages publishing#963
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughRenames CRISP example packages from the Changes
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 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)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ 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)
🔇 Additional comments (1)
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 |
a34e27f to
5995e27
Compare
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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-e3scope.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-inputswith appropriatepublishConfigfor public access. The version0.0.1-testindicates 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/contractswith test versionfilesarray updated to include bothcontractsanddistdirectoriesexportsfield properly configured for contract wildcards and type definitionspublishConfigcorrectly set for public accessAlso 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-inputspackage.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/mainand the newpublish:packagesscript has been added to support the publishing workflow. Dependencies incrisp-sdkhave 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-testsuggests 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
tsxshebang and__dirnameworkaround 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-checksflag 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.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 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 (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 npmAdditionally, 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.
fcd86a6 to
f9aee47
Compare
fix #960
Summary by CodeRabbit
New Features
Documentation
Chores
Removed