Skip to content

refactor(storage-resize-images): use Node built-ins for uuid and mkdir - #2947

Open
IzaakGough wants to merge 1 commit into
fix/storage-resize-images-sharp-0.35from
refactor/storage-resize-images-node-builtins
Open

refactor(storage-resize-images): use Node built-ins for uuid and mkdir#2947
IzaakGough wants to merge 1 commit into
fix/storage-resize-images-sharp-0.35from
refactor/storage-resize-images-node-builtins

Conversation

@IzaakGough

Copy link
Copy Markdown

Stacked on #2946. Retarget to kits once that merges.

What was broken: the kit depends on mkdirp and uuid for things Node covers natively. The extension removed both, along with uuidv4 and rimraf, in 9bb0c1fa and c6fbf3b7, which landed before the kit was created.

What changed: six call sites move to crypto.randomUUID() and fs.promises.mkdir(dir, { recursive: true }), matching the extension. Both dependencies come out of package.json. mkdirp leaves the tree entirely; uuid remains transitively via genkit and the Google client libraries, so this is dependency hygiene rather than a fix for the uuid advisory.

Verification: npm ci and npm run build are clean. Exercised the changed paths directly: downloadOriginalFile writes to a uuid-named file under the temp dir with contents intact, two consecutive calls produce distinct paths and neither fails on the already-existing directory, replaceWithDefaultPlaceholder swaps in the bundled placeholder, and constructMetadata regenerates firebaseStorageDownloadTokens as a uuid when REGENERATE_TOKEN is on. The full Storage upload path was not exercised.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes the external dependencies mkdirp and uuid from the storage-resize-images kit, replacing them with native Node.js APIs (fs.promises.mkdir and crypto.randomUUID()). It also simplifies a TypeScript type assertion in util.ts. There are no review comments, so I have no feedback to provide.

@IzaakGough
IzaakGough force-pushed the refactor/storage-resize-images-node-builtins branch from f0b0596 to 518525b Compare August 17, 2026 12:02
@IzaakGough
IzaakGough marked this pull request as ready for review August 17, 2026 12:09
@IzaakGough
IzaakGough requested a review from a team as a code owner August 17, 2026 12:09
Drops the mkdirp and uuid dependencies in favour of crypto.randomUUID()
and fs.promises.mkdir with recursive. The extension removed the same two
packages before the kit was created.
@IzaakGough
IzaakGough force-pushed the refactor/storage-resize-images-node-builtins branch from 518525b to 725bf76 Compare August 17, 2026 12:25
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