Skip to content

fix(console): make vite/vitest configs loadable by configLoader: 'native' - #3475

Merged
yinlianghui merged 2 commits into
mainfrom
claude/issue-3384-console-config-native
Aug 6, 2026
Merged

fix(console): make vite/vitest configs loadable by configLoader: 'native'#3475
yinlianghui merged 2 commits into
mainfrom
claude/issue-3384-console-config-native

Conversation

@yinlianghui

@yinlianghuiyinlianghui commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes#3384

背景

Vite 8 每次加载 console 配置都会打印同一个 5 行告警块:两个配置文件用到了 configLoader: 'native' 不支持的特性。今天只是告警(默认的 bundle loader 替它们做了补丁),但 Vite 把默认值翻过去的那一天,console 的 dev / build / vitest 会同时在「加载配置」这一步挂掉 —— 而且扣扳机的会是一次毫不相关的依赖升级。

改动

三个文件,两个提交:

apps/console/vite.config.ts / apps/console/vitest.config.ts

  1. __dirnameimport.meta.dirname:36 处(vite.config.ts)+ 1 处(vitest.config.ts)。
  2. 三个相对 specifier 补上真实扩展名 .ts:./vite.config../../scripts/vite-crypto-stub../../scripts/vite-maplibre-worker。Node 的 ESM 解析器不做扩展名猜测。

scripts/vite-*.ts 本身没有改动 —— 扩展名只写在导入方

apps/console/tsconfig.node.json(两行,见下方「type-check 门」一节)

  1. allowImportingTsExtensions + emitDeclarationOnly —— 让 apps/console/tsconfig.node.json never type-checks — 5 standing errors, including two that say the compression options are typed wrong #3305 那道门接受显式 .ts specifier。

告警只报了 5 条,真实站点是 39 个

Vite 对同一文件的同一类问题只报第一处。「5 个告警」严重低估了工作量:vite.config.ts 里有 36 处 __dirname,告警只点名了第 56 行那一处。这不是洁癖,反向验证在下面。

验证

告警块前后对照(同一条命令 pnpm exec vitest list apps/console/)

改动前:

(!) Your Vite config uses features that are unsupported by `configLoader: 'native'`, which is planned to become the default in a future major version of Vite:
- `__dirname` (vitest.config.ts:13:33). Use `import.meta.dirname` instead
- import "./vite.config" without a file extension (vitest.config.ts:4:24). Add the file extension
- `__dirname` (vite.config.ts:56:35). Use `import.meta.dirname` instead
- import "../../scripts/vite-crypto-stub" without a file extension (vite.config.ts:10:32). Add the file extension
- import "../../scripts/vite-maplibre-worker" without a file extension (vite.config.ts:11:36). Add the file extension

改动后:告警块消失,输出直接从测试清单开始。vitest run 的完整输出里同样一条都没有。

两个 loader 下配置解析完全一致(resolveConfig,command 为 build)

bundle -> root: /apps/console | plugins: 46 | alias@object-ui/core: /packages/core/src
native -> root: /apps/console | plugins: 46 | alias@object-ui/core: /packages/core/src

说明 import.meta.dirname 算出的绝对路径与原来的 __dirname 一致。

反向验证(预测方向:改前红 / 改后绿 —— 结果符合)

把两个文件退回 origin/main,再用 configLoader: 'native' 加载:

NATIVE FAILED: ERR_MODULE_NOT_FOUND | Cannot find module '.../scripts/vite-crypto-stub' imported from .../apps/console/vite.config.ts
NATIVE FAILED: ERR_MODULE_NOT_FOUND | Cannot find module '.../apps/console/vite.config' imported from .../apps/console/vitest.config.ts

注意:模块解析先失败,把 __dirname 那一半掩盖掉了。于是单独隔离 —— 扩展名保持修好,只把 36 处里的 1 处改回 __dirname:

NATIVE FAILED: ReferenceError | __dirname is not defined in ES module scope

漏掉任意一处 __dirname 都足以让整个配置加载失败,所以必须全改。

测试

  • pnpm exec vitest run apps/console/ --maxWorkers=2(仓库根):Test Files 23 passed (23) / Tests 211 passed (211)
  • tsc -b apps/console/tsconfig.node.json --force:exit 0,工作树零 litter,产物仍全部落在原有的 outDir(node_modules/.cache/tsc/console-node),且只有 .d.ts、没有 .js
  • eslint vite.config.ts vitest.config.ts:干净
  • 控制字符自检 grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]':干净

type-check 门:为什么要动 tsconfig.node.json

.ts 扩展名会让 #3305 那道门(apps/consoletsc -b tsconfig.node.json --force,CI 的 type-check job 会跑到)报错,而且报这两条:

vite.config.ts(16,32): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
vite.config.ts(17,36): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.

issue 正文里「moduleResolution: bundler accepts both spellings」这一句不成立:bundler 接受 ./x./x.js,但 ./x.ts 必须开 allowImportingTsExtensions。而 .ts 是唯一能被 Node 原生 ESM 解析的写法(./x.js 在磁盘上不存在),所以绕不过去。

补丁就是两行:

 "moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
+ "allowImportingTsExtensions": true,+ "emitDeclarationOnly": true,
"strict": true

emitDeclarationOnly 这个搭档不是随便挑的,三个候选实测过:

  • noEmit —— 不行。allowImportingTsExtensions 必须搭配 noEmit / emitDeclarationOnly / rewriteRelativeImportExtensions 之一(否则 TS5096),但 noEmit 会让 type-check 的前半段 tsc --noEmit 挂掉:tsconfig.json(28,18): error TS6310: Referenced project '.../tsconfig.node.json' may not disable emit. —— 正是 tsconfig.node.json 自己注释里写明的那条约束。
  • rewriteRelativeImportExtensions —— 能过,但它给一份反正要丢掉的产物加上了 .ts.js 改写语义,没有意义。
  • emitDeclarationOnly —— 选它。composite 工程本来就需要声明产物,而那份 .js 从来没人用;它满足 TS6310(没有禁用 emit),又把丢弃的输出减到最小,和该文件「存在只为被类型检查」的既有设计一致。

更正:本 PR 首版正文里贴过一份错误的 tsconfig 补丁(重写整个文件、删掉 outDir/rootDir、并加 noEmit)。那是照着一份 stale 的工作副本(共享 checkout 停在 68b6a28)推出来的,套用会重新引入 #3305 修掉的产物 litter 并触发 TS6310。已作废,以最终落地的这两行为准。

为什么没有显式钉 configLoader: 'native'

issue 里那条 optional 建议做不到 —— 不是版本兼容问题,是结构问题:configLoaderInlineConfig 的字段,不在 UserConfig 上。它是 loadConfigFromFile(...)入参 —— 「用哪种方式读这个配置文件」,在配置文件被读出来之前就已经消费掉了。写在 vite.config.ts 里的键不可能影响读它自己的那一步。Vitest 侧同样:它的 configLoader 类型注释原文是 "Override vite config's configLoader from CLI"。

因此钉死只能落在调用处(apps/console/package.jsondev/buildvite --configLoader native;或根 test 脚本加 vitest run --configLoader native —— 后者会把 native 强加给所有 project 配置,波及面远超本 issue)。两者都超出本 issue 范围,PM 已据此撤回该要求。

兼容性本身是验证过的、绿的:本 PR 之后 apps/console/vite.config.tsapps/console/vitest.config.ts、根 vitest.config.mts 三者在 configLoader: 'native' 下都能正常加载 —— 真要钉,随时可以钉,只是得换个文件落地。

另外:告警块清零本身就是回归绊线 —— 之前 5 条常驻噪音里再多一条没人看得见,现在任何新引入的不兼容写法都是干净输出里唯一的那条告警。

Changeset

没加。@object-ui/console 确实是发布包(在 fixed 组内,非 private),但本次只改开发期配置文件,不进 dist/,对使用者零可见变化 —— 按 AGENTS.md「纯 bug 修复不需要 changeset」处理。

顺手记录的 finding

#3476(observation 类,未排期):apps/console/vitest.config.ts 不在任何 tsc program 里(两个 console tsconfig 的 include 都没覆盖它),以及 tsconfig.node.jsoninclude 列了一个不存在的 vitest.setup.ts。与本 PR 独立成立。

…tive'`
Vite 8 warns that both console configs use features its native config loader
drops. Today the warnings are cosmetic (the default `bundle` loader shims
them); the day Vite flips the default, console dev/build/vitest all fail to
load their config at once, on an unrelated dependency bump.
- `__dirname` -> `import.meta.dirname` (36 sites in vite.config.ts, 1 in
vitest.config.ts). Vite reports only the FIRST occurrence per file, so the
5-warning block understated the work: a single surviving `__dirname` still
throws `ReferenceError: __dirname is not defined in ES module scope` under
the native loader.
- Explicit `.ts` extensions on the three relative specifiers
(`./vite.config`, `../../scripts/vite-crypto-stub`,
`../../scripts/vite-maplibre-worker`) — Node's ESM resolver does no
extension guessing.
Verified: the 5-warning block is gone from `vitest list apps/console/`, and
`resolveConfig(..., 'build')` yields an identical result (46 plugins, same
resolved aliases) under both `configLoader: 'bundle'` and `'native'`.
Refs objectui#3384
@vercel

vercelBot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredAug 6, 2026 9:19am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

MetricValueBudget
Main entry (gzip)28.1 KB350 KB
Entry fileindex-D_L7OkcS.js
StatusPASS

📦 Bundle Size Report

PackageSizeGzipped
app-shell (index.js)8.47KB3.09KB
app-shell (runtime-config.js)7.42KB2.32KB
app-shell (types.js)0.01KB0.04KB
app-shell (urlParams.js)7.57KB2.97KB
auth (AuthContext.js)0.31KB0.24KB
auth (AuthGuard.js)1.17KB0.53KB
auth (AuthProvider.js)22.10KB4.37KB
auth (AuthShell.js)3.49KB1.40KB
auth (ForgotPasswordForm.js)12.21KB3.45KB
auth (LoginForm.js)18.13KB5.39KB
auth (PreviewBanner.js)0.90KB0.50KB
auth (RegisterForm.js)6.64KB2.21KB
auth (SocialSignInButtons.js)9.60KB3.89KB
auth (UserMenu.js)3.40KB1.22KB
auth (auth-gate-events.js)1.29KB0.66KB
auth (authStyles.js)5.04KB1.72KB
auth (createAuthClient.js)35.76KB9.11KB
auth (createAuthenticatedFetch.js)4.37KB1.69KB
auth (index.js)2.35KB1.07KB
auth (org-roles.js)6.66KB2.78KB
auth (phone-identifier.js)1.11KB0.66KB
auth (types.js)0.59KB0.35KB
auth (useAuth.js)4.91KB0.87KB
auth (useIsWorkspaceAdmin.js)1.61KB0.85KB
collaboration (CommentThread.js)21.35KB5.70KB
collaboration (LiveCursors.js)3.17KB1.27KB
collaboration (PresenceAvatars.js)6.49KB2.64KB
collaboration (PresenceProvider.js)2.79KB1.13KB
collaboration (index.js)1.65KB0.73KB
collaboration (useCollaborationTranslation.js)5.30KB2.24KB
collaboration (useCommentSearch.js)1.98KB0.88KB
collaboration (useConflictResolution.js)7.75KB1.86KB
collaboration (useMentionNotifications.js)1.81KB0.68KB
collaboration (usePresence.js)6.33KB1.84KB
collaboration (useRealtimeSubscription.js)7.91KB2.01KB
components (index.js)479.63KB105.43KB
core (index.js)2.47KB0.91KB
create-plugin (index.js)9.28KB2.98KB
data-objectstack (index.js)136.30KB34.76KB
fields (index.js)229.92KB56.48KB
i18n (LocalizationContext.js)1.76KB0.96KB
i18n (currency.js)1.22KB0.64KB
i18n (i18n.js)4.32KB1.77KB
i18n (index.js)2.65KB1.06KB
i18n (pickLocalized.js)1.70KB0.83KB
i18n (provider.js)9.48KB3.27KB
i18n (useObjectLabel.js)26.14KB6.07KB
i18n (useSafeTranslation.js)3.26KB1.44KB
layout (index.js)38.53KB10.71KB
mobile (MobileProvider.js)0.92KB0.49KB
mobile (ResponsiveContainer.js)0.94KB0.38KB
mobile (breakpoints.js)1.51KB0.70KB
mobile (createOfflineDataSource.js)5.61KB1.74KB
mobile (index.js)1.50KB0.62KB
mobile (offlineQueue.js)3.91KB1.35KB
mobile (pwa.js)0.97KB0.49KB
mobile (serviceWorker.js)1.48KB0.62KB
mobile (serviceWorkerSource.js)3.41KB1.48KB
mobile (useBreakpoint.js)1.54KB0.65KB
mobile (useGesture.js)6.96KB1.98KB
mobile (useOfflineSync.js)1.99KB0.72KB
mobile (usePullToRefresh.js)2.53KB0.85KB
mobile (useResponsive.js)0.71KB0.42KB
mobile (useResponsiveConfig.js)1.36KB0.63KB
mobile (useSpecGesture.js)4.05KB1.53KB
mobile (useTouchTarget.js)1.01KB0.54KB
permissions (MePermissionsProvider.js)8.75KB3.06KB
permissions (PermissionContext.js)0.31KB0.25KB
permissions (PermissionGuard.js)0.89KB0.45KB
permissions (PermissionProvider.js)3.67KB1.12KB
permissions (evaluator.js)4.41KB1.44KB
permissions (index.js)0.91KB0.41KB
permissions (store.js)0.91KB0.42KB
permissions (useFieldPermissions.js)1.28KB0.52KB
permissions (usePermissions.js)1.55KB0.71KB
plugin-ai (index.js)15.71KB3.79KB
plugin-calendar (index.js)44.98KB12.37KB
plugin-charts (index.js)61.04KB17.31KB
plugin-chatbot (index.js)180.09KB42.72KB
plugin-dashboard (index.js)112.03KB28.88KB
plugin-designer (index.js)210.51KB42.51KB
plugin-detail (index.js)232.53KB57.37KB
plugin-editor (index.js)2.46KB1.10KB
plugin-form (index.js)111.54KB26.97KB
plugin-gantt (index.js)162.55KB39.57KB
plugin-grid (index.js)185.25KB49.08KB
plugin-kanban (index.js)48.03KB13.22KB
plugin-list (index.js)105.19KB25.39KB
plugin-map (index.js)16.81KB5.24KB
plugin-markdown (index.js)13.72KB4.69KB
plugin-report (index.js)40.58KB10.58KB
plugin-timeline (index.js)25.76KB7.33KB
plugin-tree (index.js)8.50KB2.88KB
plugin-view (index.js)84.03KB20.55KB
providers (DataSourceProvider.js)0.75KB0.39KB
providers (MetadataProvider.js)1.37KB0.59KB
providers (ThemeProvider.js)1.90KB0.85KB
providers (UploadProvider.js)11.71KB3.53KB
providers (index.js)0.44KB0.22KB
providers (types.js)0.01KB0.04KB
react-runtime (index.js)5.67KB2.37KB
react (LazyPluginLoader.js)3.77KB1.33KB
react (SchemaRenderer.js)19.28KB6.38KB
react (data-invalidation.js)5.05KB2.08KB
react (index.js)1.02KB0.55KB
react (spec-input.js)0.20KB0.18KB
sdui-parser (codegen.js)4.09KB1.74KB
sdui-parser (index.js)4.47KB2.03KB
sdui-parser (parse.js)10.04KB2.82KB
sdui-parser (types.js)0.29KB0.24KB
sdui-parser (validate.js)4.69KB1.48KB
types (ai.js)0.20KB0.17KB
types (api-types.js)0.20KB0.18KB
types (app.js)2.87KB0.99KB
types (base.js)0.20KB0.18KB
types (blocks.js)0.20KB0.18KB
types (complex.js)0.20KB0.18KB
types (crud.js)0.20KB0.18KB
types (data-display.js)0.20KB0.18KB
types (data-protocol.js)0.20KB0.19KB
types (data.js)0.20KB0.18KB
types (designer.js)1.87KB0.85KB
types (disclosure.js)0.20KB0.18KB
types (error-code.js)1.54KB0.88KB
types (feedback.js)0.20KB0.18KB
types (field-types.js)0.20KB0.18KB
types (form.js)0.20KB0.18KB
types (http-retry.js)4.32KB2.02KB
types (index.js)2.46KB1.21KB
types (layout.js)0.20KB0.18KB
types (managed-by.js)0.19KB0.18KB
types (mobile.js)0.20KB0.18KB
types (navigation.js)0.20KB0.18KB
types (objectql.js)0.20KB0.18KB
types (overlay.js)0.20KB0.18KB
types (permissions.js)0.20KB0.18KB
types (plugin-scope.js)0.20KB0.18KB
types (record-components.js)0.20KB0.19KB
types (record-semantics.js)1.28KB0.67KB
types (registry.js)0.20KB0.18KB
types (reports.js)0.20KB0.18KB
types (spec-report.js)5.05KB1.93KB
types (system-fields.js)3.33KB1.54KB
types (theme.js)0.20KB0.18KB
types (ui-action.js)3.40KB1.71KB
types (views.js)0.20KB0.18KB
types (widget.js)0.20KB0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

…ecifiers
The `.ts` extensions the previous commit added (required by Vite's native
config loader — Node's ESM resolver does no extension guessing) are rejected
by `tsc` with TS5097: `moduleResolution: bundler` accepts `./x` and `./x.js`,
but an explicit `./x.ts` needs `allowImportingTsExtensions`.
That option requires one of `noEmit` / `emitDeclarationOnly` /
`rewriteRelativeImportExtensions`. `noEmit` is unavailable here — `tsconfig.json`
references this project, so disabling emit is TS6310, the constraint this file
already documents. `rewriteRelativeImportExtensions` would add `.ts` -> `.js`
rewriting to output nobody reads. So: declarations only. They keep landing in
the existing cache `outDir`; the `.js` half was never consumed.
`tsc -b apps/console/tsconfig.node.json --force` now exits 0 with no litter in
the working tree.
Refs objectui#3384
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

MetricValueBudget
Main entry (gzip)28.1 KB350 KB
Entry fileindex-D_L7OkcS.js
StatusPASS

📦 Bundle Size Report

PackageSizeGzipped
app-shell (index.js)8.47KB3.09KB
app-shell (runtime-config.js)7.42KB2.32KB
app-shell (types.js)0.01KB0.04KB
app-shell (urlParams.js)7.57KB2.97KB
auth (AuthContext.js)0.31KB0.24KB
auth (AuthGuard.js)1.17KB0.53KB
auth (AuthProvider.js)22.10KB4.37KB
auth (AuthShell.js)3.49KB1.40KB
auth (ForgotPasswordForm.js)12.21KB3.45KB
auth (LoginForm.js)18.13KB5.39KB
auth (PreviewBanner.js)0.90KB0.50KB
auth (RegisterForm.js)6.64KB2.21KB
auth (SocialSignInButtons.js)9.60KB3.89KB
auth (UserMenu.js)3.40KB1.22KB
auth (auth-gate-events.js)1.29KB0.66KB
auth (authStyles.js)5.04KB1.72KB
auth (createAuthClient.js)35.76KB9.11KB
auth (createAuthenticatedFetch.js)4.37KB1.69KB
auth (index.js)2.35KB1.07KB
auth (org-roles.js)6.66KB2.78KB
auth (phone-identifier.js)1.11KB0.66KB
auth (types.js)0.59KB0.35KB
auth (useAuth.js)4.91KB0.87KB
auth (useIsWorkspaceAdmin.js)1.61KB0.85KB
collaboration (CommentThread.js)21.35KB5.70KB
collaboration (LiveCursors.js)3.17KB1.27KB
collaboration (PresenceAvatars.js)6.49KB2.64KB
collaboration (PresenceProvider.js)2.79KB1.13KB
collaboration (index.js)1.65KB0.73KB
collaboration (useCollaborationTranslation.js)5.30KB2.24KB
collaboration (useCommentSearch.js)1.98KB0.88KB
collaboration (useConflictResolution.js)7.75KB1.86KB
collaboration (useMentionNotifications.js)1.81KB0.68KB
collaboration (usePresence.js)6.33KB1.84KB
collaboration (useRealtimeSubscription.js)7.91KB2.01KB
components (index.js)479.63KB105.43KB
core (index.js)2.47KB0.91KB
create-plugin (index.js)9.28KB2.98KB
data-objectstack (index.js)136.30KB34.76KB
fields (index.js)229.92KB56.48KB
i18n (LocalizationContext.js)1.76KB0.96KB
i18n (currency.js)1.22KB0.64KB
i18n (i18n.js)4.32KB1.77KB
i18n (index.js)2.65KB1.06KB
i18n (pickLocalized.js)1.70KB0.83KB
i18n (provider.js)9.48KB3.27KB
i18n (useObjectLabel.js)26.14KB6.07KB
i18n (useSafeTranslation.js)3.26KB1.44KB
layout (index.js)38.53KB10.71KB
mobile (MobileProvider.js)0.92KB0.49KB
mobile (ResponsiveContainer.js)0.94KB0.38KB
mobile (breakpoints.js)1.51KB0.70KB
mobile (createOfflineDataSource.js)5.61KB1.74KB
mobile (index.js)1.50KB0.62KB
mobile (offlineQueue.js)3.91KB1.35KB
mobile (pwa.js)0.97KB0.49KB
mobile (serviceWorker.js)1.48KB0.62KB
mobile (serviceWorkerSource.js)3.41KB1.48KB
mobile (useBreakpoint.js)1.54KB0.65KB
mobile (useGesture.js)6.96KB1.98KB
mobile (useOfflineSync.js)1.99KB0.72KB
mobile (usePullToRefresh.js)2.53KB0.85KB
mobile (useResponsive.js)0.71KB0.42KB
mobile (useResponsiveConfig.js)1.36KB0.63KB
mobile (useSpecGesture.js)4.05KB1.53KB
mobile (useTouchTarget.js)1.01KB0.54KB
permissions (MePermissionsProvider.js)8.75KB3.06KB
permissions (PermissionContext.js)0.31KB0.25KB
permissions (PermissionGuard.js)0.89KB0.45KB
permissions (PermissionProvider.js)3.67KB1.12KB
permissions (evaluator.js)4.41KB1.44KB
permissions (index.js)0.91KB0.41KB
permissions (store.js)0.91KB0.42KB
permissions (useFieldPermissions.js)1.28KB0.52KB
permissions (usePermissions.js)1.55KB0.71KB
plugin-ai (index.js)15.71KB3.79KB
plugin-calendar (index.js)44.98KB12.37KB
plugin-charts (index.js)61.04KB17.31KB
plugin-chatbot (index.js)180.09KB42.72KB
plugin-dashboard (index.js)112.03KB28.88KB
plugin-designer (index.js)210.51KB42.51KB
plugin-detail (index.js)232.53KB57.37KB
plugin-editor (index.js)2.46KB1.10KB
plugin-form (index.js)111.54KB26.97KB
plugin-gantt (index.js)162.55KB39.57KB
plugin-grid (index.js)185.25KB49.08KB
plugin-kanban (index.js)48.03KB13.22KB
plugin-list (index.js)105.19KB25.39KB
plugin-map (index.js)16.81KB5.24KB
plugin-markdown (index.js)13.72KB4.69KB
plugin-report (index.js)40.58KB10.58KB
plugin-timeline (index.js)25.76KB7.33KB
plugin-tree (index.js)8.50KB2.88KB
plugin-view (index.js)84.03KB20.55KB
providers (DataSourceProvider.js)0.75KB0.39KB
providers (MetadataProvider.js)1.37KB0.59KB
providers (ThemeProvider.js)1.90KB0.85KB
providers (UploadProvider.js)11.71KB3.53KB
providers (index.js)0.44KB0.22KB
providers (types.js)0.01KB0.04KB
react-runtime (index.js)5.67KB2.37KB
react (LazyPluginLoader.js)3.77KB1.33KB
react (SchemaRenderer.js)19.28KB6.38KB
react (data-invalidation.js)5.05KB2.08KB
react (index.js)1.02KB0.55KB
react (spec-input.js)0.20KB0.18KB
sdui-parser (codegen.js)4.09KB1.74KB
sdui-parser (index.js)4.47KB2.03KB
sdui-parser (parse.js)10.04KB2.82KB
sdui-parser (types.js)0.29KB0.24KB
sdui-parser (validate.js)4.69KB1.48KB
types (ai.js)0.20KB0.17KB
types (api-types.js)0.20KB0.18KB
types (app.js)2.87KB0.99KB
types (base.js)0.20KB0.18KB
types (blocks.js)0.20KB0.18KB
types (complex.js)0.20KB0.18KB
types (crud.js)0.20KB0.18KB
types (data-display.js)0.20KB0.18KB
types (data-protocol.js)0.20KB0.19KB
types (data.js)0.20KB0.18KB
types (designer.js)1.87KB0.85KB
types (disclosure.js)0.20KB0.18KB
types (error-code.js)1.54KB0.88KB
types (feedback.js)0.20KB0.18KB
types (field-types.js)0.20KB0.18KB
types (form.js)0.20KB0.18KB
types (http-retry.js)4.32KB2.02KB
types (index.js)2.46KB1.21KB
types (layout.js)0.20KB0.18KB
types (managed-by.js)0.19KB0.18KB
types (mobile.js)0.20KB0.18KB
types (navigation.js)0.20KB0.18KB
types (objectql.js)0.20KB0.18KB
types (overlay.js)0.20KB0.18KB
types (permissions.js)0.20KB0.18KB
types (plugin-scope.js)0.20KB0.18KB
types (record-components.js)0.20KB0.19KB
types (record-semantics.js)1.28KB0.67KB
types (registry.js)0.20KB0.18KB
types (reports.js)0.20KB0.18KB
types (spec-report.js)5.05KB1.93KB
types (system-fields.js)3.33KB1.54KB
types (theme.js)0.20KB0.18KB
types (ui-action.js)3.40KB1.71KB
types (views.js)0.20KB0.18KB
types (widget.js)0.20KB0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@yinlianghui
yinlianghui marked this pull request as ready for review August 6, 2026 13:51
@yinlianghui
yinlianghui added this pull request to the merge queueAug 6, 2026
Merged via the queue into main with commit 8d17a18Aug 6, 2026
18 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-3384-console-config-native branch August 6, 2026 13:52
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Aug 10, 2026
…的 cache key (objectstack-ai#3513)
* ci(console): put vitest.config.ts in a tsc program and drop the ghost include entry
`apps/console/vitest.config.ts` was in ZERO tsc programs. CI runs
`turbo run type-check` — per package — and neither console tsconfig
reached the file: `tsconfig.json` includes only `src`/`dev`/
`objectstack.config.ts`, and `tsconfig.node.json` listed only
`vite.config.ts` and a `vitest.setup.ts` that does not exist.
Add `vitest.config.ts` to `tsconfig.node.json`'s include. Its import of
`../../vitest.config.mts` has to be listed too — a composite project must
list every file in its program (TS6307) — which incidentally gives the
root Vitest config the gate it also lacked.
Drop the `vitest.setup.ts` entry rather than repoint it. A literal,
glob-less include entry matching nothing is silently ignored by tsc, so
it read as coverage that was never there. The setup file `vitest.config.ts`
really uses (repo-root `vitest.setup.dom.tsx`) is passed to Vitest as a
runtime path string, never imported, so this program has no type edge to
it; naming it here was measured red (one TS6307 + four TS2882).
No flag changes were needed: `allowImportingTsExtensions` +
`emitDeclarationOnly` from objectstack-ai#3475 already cover the `.ts`/`.mts` spellings.
Refs objectstack-ai#3476
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
* ci(turbo): hash the root vitest config into the type-check cache key
The previous commit makes apps/console's type-check program span a second
repo-root file (`vitest.config.mts`, pulled in because
`apps/console/vitest.config.ts` imports it and a composite project must
list every file in its program). turbo's `type-check` inputs did not hash
it: `$TURBO_DEFAULT$` only covers files inside the package directory, and
`globalDependencies` is unset.
Measured A/B on this branch, same tree, same plant (a real type error in
the root `vitest.config.mts`):
old inputs -> cache hit, replaying logs 4214aa6ab3df0f18 -> exit 0
(a green replayed over a program that does not compile)
new inputs -> cache miss, executing 648e8a0633f2bff7 -> exit 1
../../vitest.config.mts(114,5): error TS2769
Not local-only: ci.yml persists .turbo/cache via actions/cache, and in
this container turbo resolves its cache to the shared checkout's .turbo,
so a stale green survives across worktrees too.
Symmetric with the `$TURBO_ROOT$/scripts/vite-*.ts` entry already present,
which exists for exactly this reason for the other root-level file in the
same program.
Refs objectstack-ai#3476, objectstack-ai#3514
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
---------
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console vite/vitest configs rely on features configLoader: 'native' drops — a future Vite major turns 5 warnings into a broken config load

2 participants

@yinlianghui@claude