Skip to content

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

Draft
MarioCadenas wants to merge 3 commits into
mainfrom
mario/lakebase-cjs-support
Draft

feat(lakebase): support CJS consumers and validate exports via attw#408
MarioCadenas wants to merge 3 commits into
mainfrom
mario/lakebase-cjs-support

Conversation

@MarioCadenas

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.
  • 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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for CJS

1 participant