feat(app-tools): export setupTsRuntime from the public entry#8761
Open
deepcoldy wants to merge 1 commit into
Open
feat(app-tools): export setupTsRuntime from the public entry#8761deepcoldy wants to merge 1 commit into
deepcoldy wants to merge 1 commit into
Conversation
The server TS runtime setup app-tools' own dev/build commands use (ts-node when the project depends on it, Node.js native TypeScript as fallback, plus tsconfig-paths/alias registration) becomes public API: frameworks that compose app-tools in-process and run their own command actions need to register the same runtime without keeping a private copy of the logic. Exports setupTsRuntime, resolveTsRuntimeRegisterMode and the TsRuntimeRegisterMode / TsRuntimeSetupOptions types; no behavior change. Co-authored-by: 张翔 <zhangxiang.01@bytedance.com> Co-authored-by: 孔嘉聪 <kongjiacong@bytedance.com> Co-authored-by: 谢奇璇 <xieqixuan.xx@bytedance.com>
🦋 Changeset detectedLatest commit: 147480d The changes in this PR will be included in the next version bump. This PR includes changesets to release 117 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for modernjs-byted ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.

Summary
Exports
setupTsRuntime/resolveTsRuntimeRegisterMode(and theTsRuntimeRegisterMode/TsRuntimeSetupOptionstypes) from@modern-js/app-tools' public entry.The server TypeScript runtime setup that app-tools' own
dev/buildcommand actions already use — ts-node when the project depends on it, Node.js native TypeScript support as the fallback, plus tsconfig-paths/alias registration — was internal (src/utils/register.ts). Frameworks that composeappTools()in-process but register their own command actions (so app-tools' command layer never runs) currently have to keep a private copy of this logic to load user server-side TS (BFF handlers,config/mock, server hooks) in dev. Making the existing helper public lets them call the exact same battle-tested path with(appDir, distDir, alias?, options?)and delete their copies.No behavior change — export surface only (two
exportkeywords added on the existing type/interface, plus the entry re-export).Related Links
Checklist
pnpm run change.