Skip to content

build: migrate from unbuild to obuild - #24

Merged
dinwwwh merged 1 commit into
middleapi:mainfrom
pi0x:chore/obuild
Oct 3, 2026
Merged

dinwwwh merged 1 commit into
middleapi:mainfrom
pi0x:chore/obuild

Conversation

@pi0x

@pi0x pi0x commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Replaces unbuild with obuild (rolldown) and enables minifyLibs.

  • build.config.ts lists the bin and preset entries explicitly and turns off declaration sourcemaps
  • Relative imports in src now end in .ts, and package.json is imported with with { type: 'json' }, so obuild --stub runs the source natively on Node (module: ESNext in the package tsconfig). The test-only register.ts loader is no longer needed and is removed.
unbuild obuild
dist 10 files, 1,267 kB 14 files, 395 kB
tarball 302 kB 136 kB

Note

This PR was generated with an AI assistant.

🤖 Generated with AI assistant

@pi0x pi0x changed the title chore: migrate from unbuild to obuild build: migrate from unbuild to obuild Oct 3, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Build config — build.config.ts now imports defineBuildConfig from obuild/config and replaces rollup.inlineDependencies with an explicit type: 'bundle' entry for bin plus the two presets, minifyLibs: true, and dts: { sourcemap: false }.
  • Scripts and dependencies — unbuild is replaced by obuild in the root check script, in root devDependencies, and in the package prepack.
  • Source and tsconfig — relative imports gained explicit .ts extensions, cli.ts imports package.json with with { type: 'json' }, and the package tsconfig adds module: ESNext.
  • Tests — the register.ts loader is removed and the harness now runs src/bin.ts directly under Node's native type stripping.

I rebuilt the package with obuild@0.4.43 against this checkout: --stub emits exactly dist/bin.mjs and dist/presets/{oxfmt,oxlint}.mjs (entry names are derived relative to src/), and both the stubbed and fully bundled CLIs run standalone. The real build bundles the devDependencies into dist/_chunks/libs/* while leaving the peer dependencies external, so the published package stays self-contained. tsc --noEmit -p packages/uncheck/tsconfig.json passes and tests/uncheck/tsc.test.ts passes through the updated harness.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dinwwwh
dinwwwh merged commit 9d2cc80 into middleapi:main Oct 3, 2026
6 of 7 checks passed
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