fix(core): restore bundler resolution for source-imported deps - #41885
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Restore a green typecheck on
v2by reverting the threeNodeNextcompiler options added topackages/core/tsconfig.jsonin 4acdeff (refactor(core): require explicit import extensions), while keeping that commit's ~300 files of explicit.jsimport extensions.Before / After
Before:
bun typecheckfailed repo-wide atv2HEAD (c217ebe2ad), blocking the pre-push hook for everyone.packages/coreimports@opencode-ai/aiand@ff-labs/fff-bunas raw TypeScript sources (their package exports point atsrc/*.ts), so their files are compiled inside core's program under core's compiler options. WithmoduleResolution: NodeNext, their extensionless relative imports produce hundreds ofTS2835errors, which cascade intopackages/pluginandpackages/desktopasTS2305"has no exported member" failures forMessage,SystemPart,CommandInfo,ConnectionInfo, and others.After: Core resolves modules with the bundler settings from
@tsconfig/bunagain. The explicit.jsextensions in core sources remain valid (TypeScript maps./agent.jstoagent.tsin bundler resolution too), so none of the 300-file refactor is reverted. All 33 packages typecheck.How
packages/core/tsconfig.json: remove"module": "NodeNext","moduleResolution": "NodeNext", and"allowImportingTsExtensions": false.packages/core/script/migration.ts: emit.jsextensions from therenderMigration,renderSchema, andrenderRegistrytemplates. 4acdeff hand-updated the generatedschema.gen.ts,migration.gen.ts, and migration files but not the generator, so thedatabase-migrationfreshness check regenerated old-style imports and failed CI (Current database schema is stale). The templates now reproduce the checked-in files byte for byte.Scope
NodeNextis not currently feasible while the repo consumes raw-TS dependencies:@ff-labs/fff-bunships extensionless.tssources innode_modules, which cannot be edited. Enforcement would need a lint rule (e.g. ESLintimport/extensionsor a Biome rule) instead of compiler options, or built.d.tsboundaries for source-imported packages. Happy to follow up either way — flagging for @thdxr since 4acdeff landed directly onv2.Testing
bun typecheckat repo root: 33/33 packages pass (previously@opencode-ai/desktopand core itself failed)bun typecheckinpackages/coreincludingtsconfig.tests.jsonbun script/migration.ts --checkinpackages/corepasses with no changes to generated files (fails onv2HEAD and on the first commit of this branch)