fix: Remove uuid dependency and modernize Node.js imports#365
Merged
Conversation
The uuid package was declared as a dependency but never actually imported or used in the library source. Node's built-in crypto.randomUUID() is available on all supported Node versions (>=18) and is the modern replacement for uuid.v4(). - Drop uuid and @types/uuid from .projenrc.ts so the package no longer ships with the dependency. - Drop uuid and @types/uuid from the ServerlessProject and Datastore projen components so downstream projects no longer receive them transitively. - Regenerate package.json, tsconfig, and other projen-managed files. - Normalize bare node built-in imports (fs, path, os) to the node: protocol for consistency.
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.
What kind of change does this PR introduce?
Dependency removal and code modernization
What is the current behavior?
The project currently depends on the
uuidpackage and uses CommonJS-style Node.js built-in imports (e.g.,import * as fs from 'fs').What is the new behavior (if this is a feature change)?
uuidand@types/uuiddependencies from the projectnode:protocol prefix (e.g.,import * as fs from 'node:fs')Does this PR introduce a breaking change?
Partly. The
uuidpackage was not being used anywhere in the codebase, so removing it has no functional impact. The import modernization is a code quality improvement with no behavioral changes. Automatic addition of uuid to the deps of child projects does no longer happen as you shoudl usecrypto.randomUUID.Other information:
This change improves code quality by:
node:protocol for built-in modules, which is the recommended approach in Node.js and improves clarity that these are built-in modulesAll existing tests continue to pass with these changes.
https://claude.ai/code/session_01K11KEz63qGKG4RnrKSSLwW