Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/stack-cjs-uuid-and-column-builders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@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?


Expose `EncryptedTable.columnBuilders` as a public, read-only field so consumers can iterate the typed column-builder map of an encrypted table without reaching into the built `TableDefinition` (`schema.build().columns`) or the private internal.
2 changes: 1 addition & 1 deletion packages/stack/src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class EncryptedTable<T extends EncryptedTableColumn> {

constructor(
public readonly tableName: string,
private readonly columnBuilders: T,
public readonly columnBuilders: T,
) {}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default defineConfig([
target: 'es2022',
tsconfig: './tsconfig.json',
external: ['drizzle-orm', '@supabase/supabase-js'],
noExternal: ['evlog'],
noExternal: ['evlog', 'uuid'],
},
])
Loading