Repository navigation
Commit ebbb5b8
docs(spec): email.defaultTemplateContext names baseUrl beside appName as a resolved key (#29539)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8CSZ7Bi88n61fRQQZfZQA16)_
Fixes #29485
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`email.defaultTemplateContext` 的 `.describe()` 与 TSDoc 把
`baseUrl` 和 `appName` 并列为运行时自行解析的键,并写出 `baseUrl` 的解析链;重新生成
`email-config.mdx`。
- 为什么改:#29478 已让邮件插件解析 `baseUrl`,规范文字仍说只有 `appName` 例外,读 `/meta/types`
或参考页的作者会被误导。
- 风险与回滚:只改文字,无 schema 变化,键仍是自由 record;回滚即 revert 本 PR。
-
先看:`packages/spec/src/system/email-config.zod.ts`(`defaultTemplateContext`
的文档块与 describe)。
- 两分钟验证:`pnpm --filter @objectstack/spec build && pnpm --filter
@objectstack/spec check:generated`,预期 14 个产物全部最新。
- 需要你做的:无,席位落地。
## What changes
- `packages/spec/src/system/email-config.zod.ts`: the
`defaultTemplateContext` docblock and `.describe()` now name `baseUrl`
beside `appName` as the two keys the runtime resolves itself. The
`baseUrl` chain is read from the merged plugin code
(`resolveDeploymentBaseUrl` in
`packages/plugins/plugin-email/src/capability-arg.ts`, landed by #29478
at `73c24394e2`): `OS_AUTH_URL` (legacy `BETTER_AUTH_URL`), then
`OS_BASE_URL`, then `defaultTemplateContext.baseUrl`, then
`http://localhost:` plus the serve port (`OS_PORT`, legacy `PORT`, else
`3000`), with any trailing slash trimmed. The docblock also records that
a send's own `data` wins over both keys (`EmailService` spreads the
send's data over this context).
- `content/docs/references/system/email-config.mdx`: regenerated with
`pnpm --filter @objectstack/spec gen:docs` (two table rows: the service
schema and the stack `email` schema).
- `.changeset/29485-email-template-baseurl-describe.md`:
`@objectstack/spec` patch. `packages/spec` ships `src/**/*.zod.ts` as
source, so the docblock publishes.
No schema change: the key stays `z.record(z.string(),
z.unknown()).optional()`, as the card requires.
## Why
Ruling A on #29095 kept the spec out of that card and left this text to
the spec lane. The describe still read "Passed through unchanged except
appName", which is now incomplete.
## Tests
No test pinned the old wording (`git grep` over the tree for the old
describe and docblock sentences: only the generated mdx hit). Local runs
on head `cc250df8`:
- `pnpm --filter @objectstack/spec typecheck`: exit 0.
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
src/system`: 66 files, 2096 tests passed.
- `pnpm --filter @objectstack/spec check:generated`: all 14 generated
artifacts up to date after `gen:docs`.
## Acceptance notes
- The file-top docblock of `email-config.zod.ts` still says "`appName`
is the one key whose env layer is not `OS_EMAIL_*`". That sentence is
about the schema's own keys, and `baseUrl` is a key inside
`defaultTemplateContext`, not a schema key, so it stays true and is
outside the claimed file surface. Noted, not filed.
## Verification
`node scripts/pm/dispatch-gates.mjs --commands` derived 97 gates for
this diff on `cc250df8`; all were run and reconciled with `--ran`: 96
exit 0, 1 NOT MEASURED.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: exit 3, it
needs every package built; left to CI.
- `node scripts/check-plugin-teardown-shape.mjs --self-test` first
exited 3 (pinned fixture commit not in the shallow clone); after
fetching that commit it exited 0 (48 cases).
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [ ] 3. No formatter ran; `pnpm lint` passes. Not run locally: the
repo-wide lint run is CI's.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbafZoFFmxkFb9fzVPa)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ff827bc commit ebbb5b8
3 files changed
Lines changed: 45 additions & 23 deletions
File tree
- .changeset
- content/docs/references/system
- packages/spec/src/system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
220 | 228 | | |
221 | 229 | | |
222 | 230 | | |
223 | 231 | | |
224 | | - | |
225 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
226 | 236 | | |
227 | 237 | | |
228 | 238 | | |
| |||
0 commit comments