Skip to content

feat: bundle uuid into stack package and expose schema builder#451

Open
calvinbrewer wants to merge 1 commit into
mainfrom
bug-esm
Open

feat: bundle uuid into stack package and expose schema builder#451
calvinbrewer wants to merge 1 commit into
mainfrom
bug-esm

Conversation

@calvinbrewer
Copy link
Copy Markdown
Contributor

@calvinbrewer calvinbrewer commented May 14, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed crashes for CommonJS users by properly bundling dependencies
  • New Features

    • Column builders on encrypted tables are now publicly accessible as a read-only field, making it easier to programmatically access and iterate over table column information

Review Change Stack

@calvinbrewer calvinbrewer requested a review from a team as a code owner May 14, 2026 18:28
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

🦋 Changeset detected

Latest commit: 1c2fdbf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@cipherstash/stack Minor
@cipherstash/bench Patch
@cipherstash/prisma-next Patch
@cipherstash/basic-example Patch
@cipherstash/prisma-next-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45365e30-6f9e-44fc-a575-ab6aed61c810

📥 Commits

Reviewing files that changed from the base of the PR and between c1c863e and 1c2fdbf.

📒 Files selected for processing (3)
  • .changeset/stack-cjs-uuid-and-column-builders.md
  • packages/stack/src/schema/index.ts
  • packages/stack/tsup.config.ts

📝 Walkthrough

Walkthrough

This PR introduces two updates to @cipherstash/stack: a public API field exposure for typed column-builder access on EncryptedTable, and a CommonJS build configuration fix that bundles the ESM-only uuid dependency to prevent runtime crashes for CommonJS consumers.

Changes

Stack Release: columnBuilders API & CJS uuid Fix

Layer / File(s) Summary
EncryptedTable.columnBuilders public API
packages/stack/src/schema/index.ts, .changeset/stack-cjs-uuid-and-column-builders.md
EncryptedTable now exposes columnBuilders as a public read-only field instead of private, allowing external code to access and iterate the encrypted table's typed column-builder map. The changeset documents this as a minor release addition.
CJS build configuration for uuid bundling
packages/stack/tsup.config.ts
The tsup noExternal configuration is updated to bundle uuid for CommonJS output alongside evlog, fixing crashes when CommonJS consumers import the library by inlining the ESM-only uuid module into the CJS build.

Possibly related PRs

  • cipherstash/stack#360: Both PRs modify packages/stack/tsup.config.ts to change CJS bundling behavior for ESM-only dependencies (uuid bundling in this PR; evlog bundling in the prior PR).

Suggested reviewers

  • auxesis
  • coderdan

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A tiny PR hops into view,
Making columnBuilders public and true—
And bundling uuid for CommonJS delight,
So consumers won't crash in the dead of night. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both main changes: bundling uuid into the stack package and exposing the columnBuilders schema builder property.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug-esm

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

"@cipherstash/stack": minor
---

Fix CJS consumers crashing with `Must use import to load ES Module: .../uuid/dist-node/index.js`. The `uuid` package is pure ESM and has no CJS entry point, so the CJS build of `@cipherstash/stack` could not `require()` it at runtime. `uuid` is now bundled into the CJS output (the ESM build is unchanged).
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.

Can we add something to tests/CI to validate this and prevent regressions?

Copy link
Copy Markdown
Contributor

@coderdan coderdan left a comment

Choose a reason for hiding this comment

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

I'd prefer to add some test or verification before approving.

Copy link
Copy Markdown
Contributor

@auxesis auxesis left a comment

Choose a reason for hiding this comment

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

Agree with @coderdan on this — let's get a regression test added, and then it'll be good to merge.

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