[FSSDK-12820] Upgrade to uuid v13#1159
Open
raju-opti wants to merge 4 commits into
Open
Conversation
Upgrade uuid to v13 (ESM-only). Update rollup config to bundle uuid into CJS outputs instead of keeping it as an external dependency, since CJS consumers cannot require() an ESM-only package. Add a CJS require hook shim so mocha/ts-node tests can still load uuid in CommonJS mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Upgrade the SDK’s uuid dependency to v13 (ESM-only) while preserving CommonJS consumer compatibility by bundling uuid into CJS builds and adding test/example coverage for CJS require() usage.
Changes:
- Upgrade
uuidto^13.0.2and update build/test tooling to accommodate ESM-only dependency behavior. - Update Rollup config to bundle
uuidinto CJS outputs (keep externals for ESM outputs). - Add a CommonJS example + CI job, plus a Mocha/ts-node require-hook shim to keep existing CJS-mode tests running; refactor TypeScript example to use shared datafile assets.
Reviewed changes
Copilot reviewed 12 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds ts-node configuration to force CommonJS module output for Mocha/ts-node runs. |
| scripts/run-ts-example.js | Updates TypeScript example runner to use shared datafile server path and avoid modifying package-lock when installing packed SDK. |
| scripts/run-cjs-example.js | Adds a runner script to validate CommonJS require() compatibility against a packed SDK tarball. |
| rollup.config.mjs | Bundles uuid into CJS outputs (since uuid@13 is ESM-only) while keeping it external for ESM outputs. |
| package.json | Upgrades uuid, updates ts-node, changes Mocha bootstrap to include UUID shim, and adds test-commonjs script. |
| lib/tests/uuid_cjs_shim.js | Adds a require-hook shim so Mocha/ts-node (CommonJS mode) can load uuid functionality. |
| examples/typescript/src/index.ts | Points the example at the shared datafile path. |
| examples/typescript/README.md | Removes references to datafile files that moved to examples/shared. |
| examples/typescript/package-lock.json | Adds a committed lockfile for the TypeScript example. |
| examples/typescript/.gitignore | Stops ignoring the TypeScript example’s package-lock.json. |
| examples/shared/datafile.json | Adds shared datafile used by multiple examples. |
| examples/shared/datafile-server.js | Converts the shared datafile server script to CommonJS. |
| examples/node-commonjs/package.json | Adds a minimal CommonJS example package. |
| examples/node-commonjs/index.js | Adds a CommonJS example validating event dispatch UUID generation under require(). |
| .github/workflows/javascript.yml | Adds a CI job to run the CommonJS example. |
Files not reviewed (1)
- examples/typescript/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade uuid to v13 (ESM-only). Update rollup config to bundle uuid into CJS outputs instead of keeping it as an external dependency, since CJS consumers cannot require() an ESM-only package. Add a CJS require hook shim so mocha/ts-node tests can still load uuid in CommonJS mode.
Test plan
Issues