-
Notifications
You must be signed in to change notification settings - Fork 183
Stellar: Fix download Rust package function #648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a CommonJS proxy module at packages/core/stellar/zip-env-rust.js that re-exports ./dist/zip-rust via module.exports. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNone found. Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduces a new entry point for the Stellar package’s Rust zip utility by adding an alias file that re-exports the built module. Class diagram for new zip-env-rust module entry pointclassDiagram
class zip_env_rust {
+exports zip_rust
}
class zip_rust {
<<module>>
}
zip_env_rust --> zip_rust : re-exports
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/core/stellar/zip-env-rust.js (2)
1-1: Be explicit with the file extension to avoid resolver edge cases.Some resolvers and CDNs behave better with explicit extensions.
-module.exports = require('./dist/zip-rust'); +module.exports = require('./dist/zip-rust.js');
1-1: Export map and types: expose a subpath export and d.ts for TS consumers.To make
@openzeppelin/wizard-stellar/stellar/zip-env-rusta stable subpath for both Node and CDNs, add an exports entry and wire types to the built d.ts. Example forpackages/core/package.json:{ "name": "@openzeppelin/wizard-stellar", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.cjs" + }, + "./stellar/zip-env-rust": { + "types": "./dist/zip-rust.d.ts", + "import": "./dist/zip-rust.js", + "require": "./stellar/zip-env-rust.js" + } + }, + "files": [ + "dist/**", + "stellar/**" + ] }Also consider adding a tiny type shim so editors resolve correctly (if not already emitted in
dist):// packages/core/stellar/zip-env-rust.d.ts export * from '../dist/zip-rust'; export { default } from '../dist/zip-rust';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/core/stellar/zip-env-rust.js(1 hunks)
⏰ 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). (3)
- GitHub Check: build (solidity, default)
- GitHub Check: build (stellar, compile)
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/core/stellar/zip-env-rust.js (3)
1-1: Targeted proxy looks good and should unblock the bare-specifier import.Creating a thin proxy to
./dist/zip-rustis a pragmatic fix to make@openzeppelin/wizard-stellar/zip-env-rustresolvable by consumers. This aligns with the PR objective to fix the download error from the Wizard UI.
1-1: No changes needed for zip-env-rust.jsThe
packages/core/stellar/package.jsonhas no"type"field (defaults to CommonJS), and there are no otherzip-env-*stubs to align with, somodule.exports = require('./dist/zip-rust');is correct as-is.
1-1: Update publish-time verification script to correctly inspect the packed tarballThe current script redirects npm pack’s stdout (the filename) into
/tmp/pkg.tgz, so you end up with a text file rather than the actual tarball. Instead, let npm pack create the.tgzin the package directory, capture its filename, then inspect that file.Please replace your verification snippet with the following:
- # From repo root, pack just the core package and inspect contents - pkg_dir="packages/core" - ( cd "$pkg_dir" && npm pack --silent >/tmp/pkg.tgz ) - tar -tf /tmp/pkg.tgz | rg -nP 'stellar/zip-env-rust\.(js|cjs|d\.ts)$|dist/zip-rust\.(js|d\.ts)$' -n + # From repo root, pack just the core package and inspect contents + pkg_dir="packages/core" + ( + cd "$pkg_dir" + # npm pack writes the .tgz filename to stdout + tarball=$(npm pack --silent) + # List the contents of the real tarball + tar -tf "$tarball" \ + | rg -nP '^(stellar/zip-env-rust\.(js|cjs|d\.ts)|dist/zip-rust\.(js|d\.ts))$' -n + )Then confirm you see at least:
stellar/zip-env-rust.js(or.cjs)dist/zip-rust.jsin the output. This ensures the file is published in the npm tarball and resolvable by the subpath consumers use.
Fixes #647
Summary by Sourcery
Bug Fixes: