Repository navigation
feat: publish executable CommonJS package conditions - #550
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Currency pass complete: branch updated with latest READY FOR REVIEW |
|
Branch updated onto current main via update-branch (no conflicts). Unresolved review threads: none. Cursor Bugbot completed successfully on the current head. READY FOR REVIEW |
|
Currency re-pass: already current with READY FOR REVIEW |
|
REVIEW WITHDRAWN Branch is behind main; updating to restore CLEAN before re-signaling ready. |
|
READY FOR REVIEW |
|
REVIEW WITHDRAWN Branch updated onto current main via update-branch. Waiting for Cursor Bugbot and CI on the new head before re-signaling ready. |
require.resolve failed on prepack-only dist/cjs entries in CI, so Vite source discovery skipped Base UI and nested bindings. Fall back to the installed package manifest when the require target is missing. Co-authored-by: Cursor <[email protected]>
|
READY FOR REVIEW |
|
REVIEW WITHDRAWN Branch is behind main; updating to restore CLEAN before re-signaling ready. |
|
READY FOR REVIEW |
Summary
Octane consumers can now use synchronous
require()for core, Floating UI, Base UI, and Radix without React, a TypeScript loader, or an ESM fallback. The existing ESM and source-first contracts remain unchanged.A shared fail-closed builder emits per-module
.cjsgraphs only for supported JavaScript and TypeScript sources. It rejects TSRX, unresolved or escaping paths, output/source overlap, top-level await,import.meta, collisions, and other lossy transforms before packaging. The release gate installs real tarballs outside the workspace, proves eachrequirecondition selects.cjs, verifies one Octane runtime and no React, and compares CommonJS exports and SSR output with the bundled ESM graph.This is the package-condition prerequisite for the Headless UI React-parity port. Headless UI remains blocked separately on the Firefox browser-runner prerequisite.
Validation
pnpm format:checkpnpm typecheckpnpm testnode --test scripts/build-package-commonjs.test.mjs scripts/package-pack-canaries.test.mjs(22 tests passed after rebasing onto currentmain)node packages/octane/scripts/build.mjs(ESM and CommonJS dist verification passed)vitest run packages/octane/tests/public-exports.test.ts(2 files, 8 tests passed)pnpm packages:pack:check(69 tarballs plus CommonJS, strict TSRX, Vite/SSR, Lynx, Pulseboard, and Wayfinder external consumers passed)pnpm syncpassed before the final rebase; the rebase applied without conflicts and the focused build/tests were rerunRisk / follow-ups
octane,octane/server,@octanejs/floating-ui,@octanejs/base-ui, and@octanejs/radix. Compiler, Vite, Volar, React-hosted, type-only, and other binding subpaths retain their current contracts.Provenance
agent-authored)Note
Medium Risk
Touches published export maps, prepack builds, and release gates for core runtime packages; mistakes could break installs or dual-format parity, but ESM contracts are preserved and tarball checks are extensive.
Overview
Adds honest Node
require()support foroctane,octane/server,@octanejs/floating-ui,@octanejs/base-ui, and@octanejs/radixwhile keeping existing ESM / source-firstimportpaths unchanged.A new shared
build-package-commonjsprepack utility emits per-module.cjsgraphs (dependencies stay external), rewrites relativerequireedges, and fails closed on.tsrx, path escape, unsupported syntax, and colliding outputs. Core wires this intobuild.mjsfor root and server; the three bindings run it viaprepackand expose orderedtypes/import/requireexport conditions (Base UI wildcards included).verify-distnow smoke-executes publishedrequiretargets and checks required public export subsets.check-package-packsinstalls real tarballs in an outside-workspace consumer, asserts.cjsresolution, a single Octane peer per graph, no React, and ESM vs CommonJS export/SSR parity. The Vite bundler still discovers source bindings whenrequirepoints at a not-yet-built CJS artifact by walking topackage.json.Patch changesets cover the four packages; scope is explicitly not all bindings or compiler subpaths.
Reviewed by Cursor Bugbot for commit 32dc3a7. Bugbot is set up for automated code reviews on this repo. Configure here.