Skip to content

[FSSDK-12820] Upgrade to uuid v13#1159

Open
raju-opti wants to merge 4 commits into
masterfrom
raju/uuid-13-commonjs-refactor
Open

[FSSDK-12820] Upgrade to uuid v13#1159
raju-opti wants to merge 4 commits into
masterfrom
raju/uuid-13-commonjs-refactor

Conversation

@raju-opti

Copy link
Copy Markdown
Contributor

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

  • added test app to validate nodejs require(). Also added to CI

Issues

  • FSSDK-12820

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 uuid to ^13.0.2 and update build/test tooling to accommodate ESM-only dependency behavior.
  • Update Rollup config to bundle uuid into 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.

Comment thread examples/typescript/package-lock.json Outdated
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 77.713% (+0.02%) from 77.691% — raju/uuid-13-commonjs-refactor into master

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.

3 participants