docs: 删除 runner 不存在的环境变量配置面,修正前端示例的 process.env 读法 - #3538
Merged
Conversation
两处文档与实现不符,按 #3527/#3532 的口径处理。 1. `content/docs/utilities/runner.mdx` —— 整节删除 "Environment Variables"。 实测 `@object-ui/runner` 一个环境变量都不读(核查范围为整个包,不只是 `src`):`grep -rn "import.meta.env|process.env|loadEnv|VITE_" packages/runner` 无输出;`VITE_APP_TITLE` 全仓仅存在于这一行文档里。文档不许描述不存在的 能力,因此整节删除而不是换个变量名续命。 2. `content/docs/guide/objectos-integration.mdx` —— `process.env.VITE_API_URL` 改为 `import.meta.env.VITE_API_URL`。该示例注释明写是 `frontend/`, Vite 不向浏览器包注入 `process`,原样照抄会 `process is not defined` (或恒为 undefined 静默退回硬编码兜底)。变量名本身是读者自定义的, 不动;只改读取方式。 `content/docs/guide/building-crud-app.md:306` 经核定为正确示例(读者自定义 变量 + 正确的 `import.meta.env` 读法),未改动。 Fixes #3533 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Aug 7, 2026
文档站还有两处环境变量示例与实现不符:runner.mdx 教两个 runner 不读的变量,objectos-integration.mdx 在 Vite 前端用 process.env
#3533
Closed
yinlianghui
marked this pull request as ready for review
August 7, 2026 04:05
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.
Fixes #3533
两处文档教的环境变量用法与实现不符,按 #3527 / #3532 的口径处理。
一、
content/docs/utilities/runner.mdx—— 整节删除 "Environment Variables"前提已复核通过,且核查范围比原单更宽(整个包,不只是
src):@object-ui/runner一个环境变量都不读,所以「Configure the runner with environment variables」这一整节教的两个变量都不会生效。失败形态与 #3527 相同:读者照做、配了、没有任何报错、也没有任何效果。文档不许描述不存在的能力,因此整节删除,不换变量名续命。删除后衔接干净:
### pnpm test的代码块之后直接是## Package Information,没有孤立的引导语或空行。也没有任何锚点悬空 —— 全仓对#environment-variables的引用为零(grep -rn "#environment-variables" -I .无输出),content/docs/utilities/meta.json只列页面不列标题,不受影响。二、
content/docs/guide/objectos-integration.mdx:406——process.env改import.meta.env该示例注释明写是
frontend/src/config.ts,而 Vite 不向浏览器包注入process,原样照抄会直接process is not defined(或恒为 undefined,静默退回硬编码的兜底地址)。变量名
VITE_API_URL本身是读者自己应用里的自定义变量(不是 ObjectUI 的契约),是对的 —— 本 PR 只改读取方式,不动变量名。三、经核定「正确、未改动」的一处
content/docs/guide/building-crud-app.md:306用import.meta.env.VITE_API_URL读读者自定义变量,拼法正确,属正常示例,按分诊裁定未改动。验证
事前预测 → 实测,全部相符:
grep -rn "VITE_APP_TITLE" content/grep -rn "process\.env\.VITE" content/node scripts/check-doc-links.mjsDocs links are valid.exit 0node scripts/check-control-bytes.mjsOK (scanned 3695 tracked text file(s); skipped 85 binary)pnpm exec vitest run scripts/ --maxWorkers=2Test Files 14 passed (14) / Tests 216 passed (216)关于 vitest 这一项需要说明清楚:
scripts/__tests__/测的是各个检查脚本自身,没有任何一个文件引用runner.mdx/objectos-integration/VITE_(grep -rln "runner\.mdx|objectos-integration|VITE_" scripts/无输出)。所以这 216 个测试是回归兜底,并没有真正覆盖本 PR 改的内容;真正把本次改动跑过一遍的是check-doc-links.mjs与check-control-bytes.mjs(它们扫真实的content/树)。据实写明,不把它记成「测试验证了本改动」。另外对两个被改文件做了超出 gate 的控制字符自查(
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'),无命中。无 changeset:纯 content 文档改动,依 #3532 先例。
越界发现(已另立单,本 PR 不实现)
#3537 —— runner 真实的 API 基址配置面是 URL 查询参数
api(packages/runner/src/App.tsx:43-57:带api参数走NetworkLoader,缺省走LocalBundleLoader),而这个真实能力在全仓文档里零处记载。与本单互为镜像:本单是「文档教了实现里没有的东西」,#3537 是「实现里有的东西文档一个字没写」。删掉这节错误的环境变量说明之后,该页关于 API 基址的指引为零 —— 删除仍然是对的,但由此暴露的文档缺口另单处理。Generated by Claude Code