Skip to content

feat(app-tools): export setupTsRuntime from the public entry#8761

Open
deepcoldy wants to merge 1 commit into
mainfrom
feat/export-setup-ts-runtime
Open

feat(app-tools): export setupTsRuntime from the public entry#8761
deepcoldy wants to merge 1 commit into
mainfrom
feat/export-setup-ts-runtime

Conversation

@deepcoldy

Copy link
Copy Markdown
Contributor

Summary

Exports setupTsRuntime / resolveTsRuntimeRegisterMode (and the TsRuntimeRegisterMode / TsRuntimeSetupOptions types) from @modern-js/app-tools' public entry.

The server TypeScript runtime setup that app-tools' own dev/build command 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 compose appTools() 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 export keywords added on the existing type/interface, plus the entry re-export).

Related Links

  • Follow-up to the removal of the default server ts register (fix: unify register in app-tools #5621): this exposes the current, supported runtime-setup path as API instead of frameworks re-implementing it.

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes. (export-only change; covered by the existing app-tools suite — 89/89 locally, build + dist d.ts verified)

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-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 147480d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 117 packages
Name Type
@modern-js/app-tools Patch
@modern-js/adapter-rstest Patch
@modern-js/plugin-bff Patch
@modern-js/plugin-ssg Patch
@modern-js/plugin-styled-components Patch
@modern-js/plugin-i18n Patch
@modern-js/image Patch
@modern-js/runtime Patch
@modern-js/plugin-polyfill Patch
@integration-test/alias-set Patch
app-document Patch
async-entry-test Patch
tmp Patch
bff-api-app Patch
bff-client-app Patch
bff-indep-client-app Patch
bff-hono Patch
integration-clean-dist-path Patch
integration-compatibility Patch
integration-custom-dist-path Patch
custom-file-system-entry Patch
integration-custom-template Patch
deploy Patch
deploy-server Patch
dev-server Patch
integration-disable-html Patch
entries-app-builder Patch
app-custom-entries Patch
app-custom-routes-runtime Patch
app-custom Patch
app-entry Patch
app-route Patch
app-entry-server Patch
i18n-app-csr-html-lang Patch
i18n-app Patch
i18n-app-ssr-html-lang Patch
i18n-app-ssr Patch
i18n-custom-i18n-wrapper Patch
i18n-mf-app-provider Patch
i18n-mf-component-provider Patch
i18n-mf-consumer Patch
i18n-routes Patch
i18n-routes-ssr Patch
@integration-test/image-component Patch
main-entry-name Patch
nonce Patch
pure-esm-project Patch
routes-match Patch
routes Patch
app-rsbuild-hooks Patch
rsc-csr-app Patch
rsc-csr-routes Patch
rsc-ssr-app Patch
rsc-ssr-routes Patch
basic-app-rstest-browser Patch
basic-app-rstest Patch
runtime-custom-plugin Patch
runtime-custom-config-plugin Patch
select-mul-entry-test Patch
select-one-entry-test Patch
server-config Patch
server-json-script Patch
server-monitors Patch
server-prod Patch
server-routes Patch
@source-code-build/app Patch
ssg-fixtures-mega-list-routes Patch
ssg-fixtures-nested-routes Patch
ssg-fixtures-simple Patch
ssg-fixtures-web-server Patch
ssr-base-async-entry-test Patch
ssr-base-async-pre-entry-test Patch
ssr-base-json-test Patch
ssr-base-test Patch
ssr-base-fallback-test Patch
init Patch
ssr-base-loadable Patch
ssr-partial-test Patch
rsc-closing-tags-test Patch
ssr-script-loading Patch
ssr-useid-test Patch
ssr-streaming-inline-test Patch
ssr-streaming-lazy-test Patch
ssr-streaming-test Patch
styled-components-stream Patch
styled-components-string Patch
integration-tailwindcss-v2 Patch
integration-tailwindcss-v3 Patch
integration-tailwindcss-v4-tools Patch
integration-tailwindcss-v4 Patch
tmp-dir Patch
write-to-dist Patch
@modern-js/bundle-diff-benchmark Patch
@modern-js/main-doc Patch
@modern-js/tsconfig Patch
@modern-js/builder Patch
@modern-js/plugin-data-loader Patch
@modern-js/render Patch
@modern-js/bff-core Patch
@modern-js/bff-runtime Patch
@modern-js/server-core Patch
@modern-js/create-request Patch
@modern-js/prod-server Patch
@modern-js/server-runtime Patch
@modern-js/server Patch
@modern-js/server-utils Patch
@modern-js/create Patch
@modern-js/i18n-utils Patch
@modern-js/plugin Patch
@modern-js/runtime-utils Patch
@modern-js/sandpack-react Patch
@modern-js/types Patch
@modern-js/utils Patch
@modern-js/rslib Patch
@scripts/prebundle Patch
@scripts/rstest-config Patch
@scripts/release-node Patch

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

@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit 147480d
🔍 Latest deploy log https://app.netlify.com/projects/modernjs-byted/deploys/6a4fc9b297718d00082f3b14
😎 Deploy Preview https://deploy-preview-8761--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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