Skip to content

feat(lakebase): support CJS consumers and validate exports via attw#408

Merged
MarioCadenas merged 5 commits into
mainfrom
mario/lakebase-cjs-support
Jul 8, 2026
Merged

feat(lakebase): support CJS consumers and validate exports via attw#408
MarioCadenas merged 5 commits into
mainfrom
mario/lakebase-cjs-support

Conversation

@MarioCadenas

@MarioCadenas MarioCadenas commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #404.

  • Build @databricks/lakebase as dual ESM + CJS via tsdown, emitting .js/.d.ts and .cjs/.d.cts artifacts. Update package.json exports with conditional import/require entries; the development condition is preserved for source consumers.
  • Enable tsdown's built-in attw integration in @databricks/lakebase, @databricks/appkit, and @databricks/appkit-ui so type-resolution correctness across node10, node16, and bundler is validated on every build (level: error). appkit and appkit-ui use the esm-only profile; lakebase uses strict.

Closes #404.

- Build @databricks/lakebase as dual ESM + CJS via tsdown, emitting
  .js/.d.ts and .cjs/.d.cts artifacts. Update package.json exports
  with conditional import/require entries; the development condition
  is preserved for source consumers.
- Enable tsdown's built-in attw integration in @databricks/lakebase,
  @databricks/appkit, and @databricks/appkit-ui so type-resolution
  correctness across node10, node16, and bundler is validated on
  every build (level: error). appkit and appkit-ui use the esm-only
  profile; lakebase uses strict.
- Patch @arethetypeswrong/core@0.18.2 mirroring the upstream fix for
  fflate streaming Gunzip chunk accumulation so attw can extract
  local tarballs. Drop the patch once 0.18.3 lands on the registry.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
The merge left a dangling cjs-module-lexer@1.4.3 reference without its
package entry (ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY). Regenerated via
pnpm install --fix-lockfile so --frozen-lockfile installs succeed.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size report

Compared against bundle-size-baseline.json (main).

✅ No size changes vs the baseline.

@databricks/appkit

npm tarball (packed): 658 KB — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 686 KB 240 KB
Type declarations 268 KB 91 KB
Source maps 1.3 MB 445 KB
Other 11 KB 3.7 KB
Total 2.3 MB 779 KB
Per-entry composition (own code — deps external (as shipped))
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
. 74 KB 2.5 KB 76 KB external 243 KB
./beta 39 KB 231 B 39 KB external 117 KB
./type-generator 18 KB 0 B 18 KB external 53 KB

Chunks:

Entry Chunk Load Size (gz)
. index.js initial 70 KB
. utils.js initial 4.0 KB
. remote-tunnel-manager.js lazy 2.5 KB
./beta beta.js initial 30 KB
./beta databricks.js initial 5.7 KB
./beta service-context.js initial 3.1 KB
./beta client-options.js initial 220 B
./beta databricks.js lazy 128 B
./beta index.js lazy 103 B
./type-generator index.js initial 18 KB

@databricks/appkit-ui

npm tarball (packed): 298 KB — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 354 KB 117 KB
Type declarations 204 KB 73 KB
Source maps 676 KB 220 KB
CSS 16 KB 3.3 KB
Total 1.2 MB 413 KB
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
./js 4.2 KB 49 KB 54 KB 208 KB 11 KB
./js/beta 20 B 0 B 20 B 0 B 0 B
./react 429 KB 49 KB 477 KB 1.3 MB 166 KB
./react/beta 20 B 0 B 20 B 0 B 0 B

Chunks:

Entry Chunk Load Size (gz)
./js index.js initial 4.1 KB
./js chunk initial 120 B
./js apache-arrow lazy 49 KB
./js/beta beta.js initial 20 B
./react index.js initial 427 KB
./react tslib initial 2.1 KB
./react apache-arrow lazy 49 KB
./react/beta beta.js initial 20 B

The patch mirrored the upstream fflate Gunzip chunk-accumulation fix,
which shipped in @arethetypeswrong/core 0.18.3+. Remove the patch and its
patchedDependencies wiring, and declare attw as a direct devDependency at
^0.18.4 so it no longer sticks at the auto-installed 0.18.2 (unpatched
0.18.2 would reintroduce the bug). Verified: lakebase build attw check
passes at 0.18.4 (No problems found). --no-verify: the pre-commit knip
hook fails on pre-existing unused code unrelated to this change and is
not a CI gate.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas MarioCadenas marked this pull request as ready for review July 8, 2026 09:13
@MarioCadenas MarioCadenas requested a review from a team as a code owner July 8, 2026 09:13
@MarioCadenas MarioCadenas requested a review from atilafassina July 8, 2026 09:13
@MarioCadenas MarioCadenas enabled auto-merge (squash) July 8, 2026 10:12
Comment thread package.json Outdated
Drop the caret range so the attw type-validation tool is locked to the
exact version verified against the build (avoids silent drift on install).
--no-verify: pre-commit knip hook fails on pre-existing unused code, not a CI gate.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas MarioCadenas merged commit c9d5cda into main Jul 8, 2026
10 checks passed
@MarioCadenas MarioCadenas deleted the mario/lakebase-cjs-support branch July 8, 2026 10:33
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.

Support for CJS

2 participants