Skip to content

Commit cdac3cc

Browse files
殷亮辉claude
andauthored
chore(plugin-editor): 移除被跟踪的 Vite temp-config 冻结产物 (#5159)
`packages/plugin-editor/vite.config.ts.timestamp-1768467704562-21cdd04a7c5ed.mjs` 是 Vite 加载配置时写在配置旁的临时产物,于 39b03a1 被一次宽泛 `git add` 扫入仓库, 此后一直处于「已被 .gitignore 声明为生成物、却仍被 git 跟踪」的矛盾状态。 内容是七个月前的 CI runner 快照:内嵌 `/home/runner/work/objectui/objectui/...` 绝对路径,固定在 vite@5.4.21,而仓内现为 vite@8.2.1。Vite 不会加载它(配置解析只认 `vite.config.{js,mjs,cjs,ts,mts,cts}` 这几个 basename),它也不在 plugin-editor 的 `files` 里,因此不入 npm 包 —— 代价只是读者撞见一份陈旧的第二副本。 ignore 规则一半已由他人补齐(.gitignore:99 `*.timestamp-*.mjs`),但加规则不会把已在 索引里的文件移出去,故本次用 `git rm` 完成剩下的跟踪态清除。实测 vite 8 的写法为 `${basename}.timestamp-${Date.now()}-${hash}.mjs`,两个落点(`node_modules/.vite-temp/` 与配置旁)分别被 .gitignore:2 与 :99 覆盖,现有规则已闭合该类,故不再重复添加规则。 同时按 #4540 状态复核建议简化 #3943 门中点名此文件的注释;`BUNDLER_CONFIG_RE` 正则本体保留 —— 它防的是这一类而不只是这一个,且该门是按文件系统遍历的, 被 ignore 并不等于不可见。 Refs #4540 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9f23d2b commit cdac3cc

2 files changed

Lines changed: 7 additions & 47 deletions

File tree

‎packages/plugin-editor/vite.config.ts.timestamp-1768467704562-21cdd04a7c5ed.mjs‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎scripts/__tests__/side-effects-declaration-consistency.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,13 @@ interface AliasEntry {
247247
* Bundler configs, by strict basename.
248248
*
249249
* The strictness is load-bearing rather than tidy: a `vite.config.*` glob also
250-
* matches `packages/plugin-editor/vite.config.ts.timestamp-*.mjs`, a Vite
251-
* temp-config artifact that is git-tracked even though `.gitignore:99` names
252-
* the pattern (objectui#4540). It is a stale CI-runner snapshot pinned to vite
253-
* 5.4.21 and reading it would feed this guard a table from another era.
250+
* matches `vite.config.ts.timestamp-*.mjs`, the temp-config Vite writes beside a
251+
* config while loading it, and reading one would feed this guard an alias table
252+
* from whenever that snapshot was taken. Being git-ignored (`.gitignore:99`) does
253+
* not put it out of reach — `readAliasEntries` below walks the filesystem, so any
254+
* copy a crashed or killed Vite left behind is visible here whether or not git
255+
* tracks it. One such file was tracked in `packages/plugin-editor` until
256+
* objectui#4540 removed it.
254257
*/
255258
const BUNDLER_CONFIG_RE = /^vite\.config\.(ts|mts|cts|js|mjs|cjs)$/;
256259

0 commit comments

Comments
 (0)