-
Notifications
You must be signed in to change notification settings - Fork 86
chore: sync constants version with lit-client #919
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
base: naga
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR implements a version synchronization system to keep the constants package version in sync with the lit-client package. It adds a script that automatically copies the version from @lit-protocol/lit-client
package.json into the constants version file and integrates it into the build process.
- Adds a Node.js script to synchronize version constants between packages
- Updates the build process to automatically run version synchronization
- Includes documentation comment explaining the synchronization mechanism
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
scripts/sync-version.mjs | New script that reads lit-client version and updates constants version file |
packages/constants/src/lib/version.ts | Updated version value and added explanatory comment |
package.json | Added sync-version script and integrated it into build command |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
const repoRoot = resolve(__dirname, '..'); | ||
|
||
// Matches the exported version constant in packages/constants/src/lib/version.ts. | ||
const VERSION_EXPORT_PATTERN = /export const version = ['"]([^'\"]+)['"];?/; |
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.
The regex character class [^'\"]+
contains an unescaped double quote inside the brackets, which could cause parsing issues. The double quote should be escaped: [^'\\\"]+
const VERSION_EXPORT_PATTERN = /export const version = ['"]([^'\"]+)['"];?/; | |
const VERSION_EXPORT_PATTERN = /export const version = ['"]([^'\\"]+)['"];?/; |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Anson <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Anson <[email protected]>
WHAT
scripts/sync-version.mjs
to copy the@lit-protocol/lit-client
version intopackages/constants/src/lib/version.ts
bun run build
Testing