Skip to content

fix: externalize @deepnote/blocks types in convert and reactivity packages#213

Merged
saltenasl merged 2 commits intomainfrom
ls/externalize-blocks
Jan 14, 2026
Merged

fix: externalize @deepnote/blocks types in convert and reactivity packages#213
saltenasl merged 2 commits intomainfrom
ls/externalize-blocks

Conversation

@saltenasl
Copy link
Contributor

@saltenasl saltenasl commented Jan 14, 2026

Summary

  • Fix type compatibility issue where @deepnote/blocks types were bundled inline instead of being imported
  • Add tsdown.config.ts to @deepnote/convert and @deepnote/reactivity with external: ['@deepnote/blocks']
  • Simplify build scripts in both packages

Problem

The bundled .d.ts files contained inline copies of types from @deepnote/blocks, causing type incompatibility for consumers using both packages:

import type { DeepnoteBlock } from '@deepnote/blocks'
import { convertJupyterNotebookToBlocks } from '@deepnote/convert'

// Type error: convert's bundled DeepnoteBlock ≠ @deepnote/blocks' DeepnoteBlock
const blocks: DeepnoteBlock[] = convertJupyterNotebookToBlocks(notebook)

Solution

Configure tsdown to treat @deepnote/blocks as external, so generated .d.ts files import types instead of bundling them inline.

Before: dist/index.d.ts ~646 KB (convert), ~179 KB (reactivity)
After: dist/index.d.ts ~23 KB (convert), ~5 KB (reactivity)

Summary by CodeRabbit

  • Chores
    • Bumped convert package version to 2.1.2 and reactivity package version to 1.0.3.
    • Updated build configuration for packages.
    • Expanded .gitignore exclusion paths.

✏️ Tip: You can customize this high-level summary in your review settings.

@saltenasl saltenasl requested a review from a team as a code owner January 14, 2026 05:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

This PR consolidates tsdown build configuration by extracting it from package.json scripts into dedicated config files. The convert and reactivity packages each receive a new tsdown.config.ts file specifying entry points, output formats (ESM and CJS), declaration generation, and external dependencies. Corresponding build and watch scripts are simplified to plain tsdown invocations. Package versions are incremented, and .pnpm-store is added to .gitignore.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately describes the main change: externalizing @deepnote/blocks types in two packages to fix type compatibility issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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



📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dec9119 and 7208b81.

📒 Files selected for processing (5)
  • .gitignore
  • packages/convert/package.json
  • packages/convert/tsdown.config.ts
  • packages/reactivity/package.json
  • packages/reactivity/tsdown.config.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Place test files next to source files with .test.ts or .test.tsx extension
Use strict type checking in TypeScript files
Prefer type safety over convenience in TypeScript
Use const for immutable values
Avoid any types - use proper type definitions
Follow Biome's rules (configured in biome.json)
Use literal keys instead of bracket notation when possible
Prefer single quotes for strings (except when avoiding escapes)
Keep code clean and readable following Biome standards

Files:

  • packages/reactivity/tsdown.config.ts
  • packages/convert/tsdown.config.ts
🔇 Additional comments (5)
.gitignore (1)

12-12: LGTM!

Correct to ignore pnpm's local store.

packages/reactivity/tsdown.config.ts (1)

1-8: LGTM!

Clean config. Externalizing @deepnote/blocks fixes the type bundling issue.

packages/convert/tsdown.config.ts (1)

1-8: LGTM!

Mirrors reactivity config. Two entry points correctly preserved.

packages/convert/package.json (1)

3-3: LGTM!

Version bump and script simplification. Config file now owns the build options.

Also applies to: 33-33, 35-35

packages/reactivity/package.json (1)

30-32: LGTM!

Scripts simplified. Note: watch mode skips the Python script copy—fine if only needed for production builds.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.57%. Comparing base (dec9119) to head (7208b81).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #213   +/-   ##
=======================================
  Coverage   91.57%   91.57%           
=======================================
  Files          41       41           
  Lines        2041     2041           
  Branches      630      630           
=======================================
  Hits         1869     1869           
  Misses        172      172           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@saltenasl saltenasl merged commit f74140a into main Jan 14, 2026
20 checks passed
@saltenasl saltenasl deleted the ls/externalize-blocks branch January 14, 2026 05:50
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.

1 participant