Skip to content

Conversation

Ansonhkg
Copy link
Collaborator

WHAT

  • add scripts/sync-version.mjs to copy the @lit-protocol/lit-client version into packages/constants/src/lib/version.ts
  • run the sync as part of bun run build

Testing

bun run sync-version

// post-bun/pnpm
pnpm run sync-version

@Copilot Copilot AI review requested due to automatic review settings September 24, 2025 16:28
Copy link
Contributor

@Copilot Copilot AI left a 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 = ['"]([^'\"]+)['"];?/;
Copy link
Preview

Copilot AI Sep 24, 2025

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: [^'\\\"]+

Suggested change
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]>
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.

1 participant