Skip to content

chore(scripts): 删除死入口 start-app.mjs,并修正 MetadataLoader 的过期注释 - #3591

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-3579-remove-dead-start-app
Aug 7, 2026
Merged

chore(scripts): 删除死入口 start-app.mjs,并修正 MetadataLoader 的过期注释#3591
yinlianghui merged 1 commit into
mainfrom
claude/issue-3579-remove-dead-start-app

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#3579

按 issue 的 enforce-or-remove 裁定执行移除scripts/start-app.mjs 是一段任何人都跑不成功的工具代码:它把某个应用目录软链到 packages/runner/src/app-data,再起 runner 的 dev server —— 但四个环节全断。

删除前对 origin/main 复测的四重死证

issue 是线索不是规格,main 移动快,所以四条都在这个分支的基线(6d762da7a)上重新实测了一遍,全部仍然成立:

  1. 没有任何 npm script 接线。 全仓 rg 下来,start:app 这个字符串只在被删文件自己的第 12 行注释里出现过一次(它自称的调用方式)。根 package.json 的 55 个 script 里没有它,.github/turbo.json、文档里也没有任何地方引用 start-app。也就是说这个入口只在它自己的注释里存在。
  2. 默认目标不存在。args[0] || 'examples/dashboard',而 examples/ 下只有 byo-backend-consoleconsole-starterhello-worldschema-catalogREADME.md。不传参跑 → App directory not found
  3. 没有任何目录能当它的输入。 它期望 app.json + 页面 JSON 的形状。这次把搜索从 examples/放宽到全仓 tracked 文件:git ls-files 匹配 app.json 的结果是,匹配 pages/ 下 JSON 的结果也是。仓库里根本没有这个形状的目录。
  4. MetadataLoader.ts:18 指向另一个不存在的脚本。 原注释写 Used during local development via 'pnpm dev:crm',但本仓没有 dev:crm(全仓 package.json 里查无此 script,它是 objectstack 仓的)。

顺带确认:packages/runner/src/app-datapackages/runner/.gitignore 第 1 行被忽略,干净 checkout 下不存在 —— 这正是三个 glob 编译成空 map、runner 缺省模式加载不到任何东西的原因。

另外核查:scripts/__tests__/没有任何测试引用该脚本,所以没有测试需要一并处置。

改了什么

  • 删除scripts/start-app.mjs(48 行)。
  • 改写packages/runner/src/lib/MetadataLoader.ts 的类文档注释:把"通过某个不存在的脚本使用"换成如实描述 —— LocalBundleLoader 读的是构建期打包进来的 packages/runner/src/app-data/,而该目录被 gitignore 且缺省不存在,所以 glob 编译成空 map、每次 load 都返回 null,除非有人去填,而本仓现在没有任何脚本会去填;要从 API 取同样的元数据请用 NetworkLoader。纯注释,零行为变更。

注释里刻意没有写出带两个星号的 glob 字面量 —— 那个序列会在块注释里提前闭合注释(tsconfig.scripts.json 的抬头记过这个坑,它就是这么踩过一次的)。

验证(先预测,再运行)

删除类改动没有红转绿的方向可言 —— 证据就是上面四条复测的死证,加上删除后每一道 gate 依然全绿。所以每条都先写下预期再跑:

命令预测实测
pnpm exec vitest run scripts/ --maxWorkers=2与基线一致,delta 0(没有测试会随脚本一起死)删除前 16 passed / 275 passed,删除后 16 passed / 275 passed —— delta 0
pnpm type-check:scriptsexit 0(被删文件本就不在 program 里)exit 0 ✅
node scripts/check-control-bytes.mjsOKOK (scanned 3635 tracked text file(s))
pnpm --filter @object-ui/runner type-check绿(注释改动是惰性的)exit 0 ✅
pnpm --filter @object-ui/runner test绿(同上,额外佐证零行为变更)2 passed / 9 passed

delta 0 的预测有依据而非乐观:scripts-type-check.test.ts 走盘时按 /\.tsx?$/ 过滤,.mjs 根本不在它的计数里;scripts/__tests__/ 下也没有别的测试枚举 .mjs

一处需要说明的假红:runner 的 type-check 第一次跑出 17 个错(Cannot find module '@object-ui/types' 等,其中一条正好落在我改的 MetadataLoader.ts 第 9 行,看起来像是我改坏了 import)。那是新 worktree 里依赖没构建造成的,不是本次改动 —— 第 9 行的 import 我一个字没动。pnpm --filter '@object-ui/runner^...' build 之后重跑即 exit 0。

备注

  • 无 changeset:内部开发脚本,不是发布产物,对用户不可见。
  • 未改 content/docs/releases/
  • dev:crm 现在全仓只剩 AGENTS.md:248 一处,而那里明确写着"framework 仓:PORT=3000 pnpm dev:crm" —— 归属正确,不需要改。
  • 维护者若认为"本地跑一个 app-data"是要保留的工作流,否决成本就是 revert 这一个文件。

Generated by Claude Code

…omment
scripts/start-app.mjs could not be run successfully by anyone. Four
independent proofs, all re-measured against origin/main before deleting:
1. No npm script wires it. The only occurrence of "start:app" in the whole
repo is inside the file itself, line 12, in its own usage comment.
2. Its default target does not exist: examples/dashboard is absent
(examples/ holds byo-backend-console, console-starter, hello-world,
schema-catalog).
3. No directory in the repo has the shape it links in. It expects
app.json plus page JSON files; git ls-files finds no tracked app.json
anywhere, and no tracked pages JSON at all.
4. packages/runner/src/lib/MetadataLoader.ts cited 'pnpm dev:crm', which is
not a script in this repo (it belongs to the objectstack repo).
Per enforce-or-remove: an entry point that cannot work is a debugging tax on
every future agent. If a tool to populate src/app-data is wanted later, it is
cheaper written from the real requirement than repaired from this.
The MetadataLoader comment now describes what LocalBundleLoader actually
does - reads a gitignored, absent-by-default directory, so its globs compile
to an empty map - instead of naming a script that does not exist. Comment
only; zero behavior change.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
@vercel

vercelBot commented Aug 7, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredAug 7, 2026 2:56pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

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

📦 Bundle Size Report

PackageSizeGzipped
app-shell (index.js)8.66KB3.13KB
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)26.07KB7.56KB
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)6.05KB2.52KB
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)480.72KB105.64KB
core (index.js)2.96KB1.13KB
create-plugin (index.js)9.28KB2.98KB
data-objectstack (index.js)137.51KB35.11KB
fields (index.js)230.87KB56.83KB
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)4.52KB1.96KB
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.79KB57.42KB
plugin-editor (index.js)2.46KB1.10KB
plugin-form (index.js)112.10KB27.10KB
plugin-gantt (index.js)162.55KB39.57KB
plugin-grid (index.js)186.61KB49.34KB
plugin-kanban (index.js)48.30KB13.28KB
plugin-list (index.js)105.12KB25.48KB
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.71KB1.34KB
types (layout.js)0.20KB0.18KB
types (managed-by.js)0.19KB0.18KB
types (mobile.js)2.54KB1.30KB
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 7, 2026 14:58
@yinlianghui
yinlianghui added this pull request to the merge queueAug 7, 2026
Merged via the queue into main with commit 39477b0Aug 7, 2026
18 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-3579-remove-dead-start-app branch August 7, 2026 14:59
Sign up for freeto 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.

scripts/start-app.mjs 是死入口:没有 start:app 脚本、默认目标 examples/dashboard 不存在、没有任何 example 是 app-data 形状

2 participants

@yinlianghui@claude