Repository navigation
Commit 75108ea
fix(create-objectstack): name the help articles in the scaffold summary and descriptions (#38584)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Jianguo** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbPPu147GzH57yhYgxsQmVGS)_
Fixes #38483
Clause-②: no
Metadata-protocol: none
Supersedes #38568 (same commits, continued on this branch: seat 5's dev
ran out of tokens, and seat 1 took the card over in claim 7255582169 and
its amendment 7255673725). #38568 is closed (7256137004).
## 维护者速读
-
用户能看到什么变化:新建项目的人在创建开始时看到的模板说明、创建完成时看到的「项目一开始包含什么」清单都写上了帮助文章;空白模板、入门示例应用、说明文档和入门教程里的简介也同步更新,入门示例的中文简介一并改好;入门教程里校验结果的对象数、字段数和视图数,以及脚手架说明里的目录树,也按带帮助文章的新模板改对了。
- 为什么做:上一轮给新项目和入门示例加入帮助文章(该卡已关闭)时,这些描述没有跟着改,审核要求用一张卡收口。
- 出错会怎样:只涉及提示文字、简介和两个内部检查的范围,出错时用户看到的清单或简介不准,不影响数据和启动,可以直接撤回。
- 要你做什么:无
## What changes
All three places were re-read on `main` at 4a43d6c first; none was
already fixed.
1. **Scaffolder summary.** `npm create objectstack` now prints an
`Articles` line in "Your project starts with:", between Companies and
Contacts and Tasks and Notes, pointing at `src/objects/` and
`src/views/` and at the sample help articles in `src/data/`
(`packages/create-objectstack/src/index.ts`, the summary block only).
2. **Descriptions.** The blank template's `manifest.description` (in
`objectstack.config.ts` and `objectstack.manifest.json`) and the
Starter's `manifest.description` now name the help articles in English.
The Starter's zh-CN package description now reads
公司、联系人与知识文章,菜单中附带平台的任务和备注。, using the article object's existing zh-CN
label. The blank template stays English-only, per the seat's rulings
7249604628 and 7251614638. A scaffolded project still drops the
template's description from its own files, so this text reaches only the
template's own readers.
3. **platform-objects template sweeps.**
`managed-api-method-affordance-sweep.test.ts` and
`platform-admin-affordance-standing.test.ts` now exclude the
scaffolder's template directory
(`packages/create-objectstack/src/templates/`). They no longer use a
path list that named only company and contact. The next template object
is excluded with no edit. The control in the managed-api sweep is kept
and widened. It checks four things: the directory matches at least one
walked file; every match is an object file in a template's own
`src/objects/`; the matches equal the template object files read off
disk without the walk, with `article.object.ts` named; and the filter
removes nothing outside the directory.
4. **The Template line and its mirrors** (claim amendment 7254402109).
The scaffolder prints the blank template's registry description as
`Template: blank — …` on every run. That description now reads
`Companies, contacts and help articles, with tasks and notes from the
platform in the menu — ready to extend`, the same phrase as the manifest
and config (`packages/create-objectstack/src/template-registry.ts`). It
is mirrored in the package README's template table and in the two
getting-started pages that quote it (`your-first-project.mdx`,
`build-with-claude-code.mdx`). Also updated: the Starter's English app
description (`Companies, contacts and help articles, with tasks and
notes`), the `examples/app-starter/package.json` description, and the
two `index.ts` comments that quote the template's own description.
5. **The tutorial's counts and the README tree** (seat L1 REWORK
7255063318, commit 3df792a).
`content/docs/getting-started/build-with-claude-code.mdx` said the blank
template scaffolded only the companies and contacts, so the validate
output read three objects and eighteen fields. The prose now names the
help articles (`article.object.ts`, four fields, with its view and
sample articles) and reads **four** objects and **twenty-two** fields;
the validate block reads `Data: 4 Objects 22 Fields` and `UI: 1 Apps 4
Views 1 Actions`. Those numbers are measured, not summed: a fresh
`--template blank` scaffold plus the page's own ticket files, through
`os validate` (see Verification). The "What you get" tree in
`packages/create-objectstack/README.md` now lists `article.object.ts`, a
grid for articles beside the companies' and contacts' grid and board, a
`data/` entry for the seed, and articles in the menu.
Changeset `.changeset/38483-scaffold-names-articles.md`: patch on
`create-objectstack` and `@objectstack/example-starter` (the latter is
private and versioned only, the same pair the help-articles changeset
used). It now also names the README tree.
`@objectstack/platform-objects` gets no changeset: only its test files
change.
**Read first (by risk):**
1.
`packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts`,
the `isScaffoldingTemplate` predicate and the "skips only scaffolding
templates" control. A predicate that is too wide would silently stop
sweeping real objects.
2. `packages/create-objectstack/src/scaffold-description.test.ts`, the
new derived summary pin and the Template line pin.
3. `packages/create-objectstack/src/index.ts`, the summary block.
## Tests
- New `describe` in `scaffold-description.test.ts` (the file's existing
real-CLI harness, now capturing stdout). It derives the expected entries
from the template: every `src/objects/*.object.ts` must be named in the
printed block by its `pluralLabel`, and the block must point at
`src/data/` while the template's `src/data/index.ts` exports a seed. A
file with no `pluralLabel` fails loudly. Control: the derived list
contains Companies, Contacts and Articles, so a moved directory cannot
pass vacuously.
- The same `describe` also holds the printed `Template: blank — …` line
to the template: each object's plural label must appear in it
(case-insensitive). So the registry description cannot drift from the
tree either.
- The template exclusion control in the managed-api sweep is described
above. The standing test uses the same predicate.
- Item 5 is prose and a docs code block with no pin; no ablation (no
tested behaviour moved).
<details><summary>Ablations (prior rounds, at 9f2a6cf and 80f23ea;
each restored; restore proved by blob equal to HEAD and an empty git
diff HEAD)</summary>
- Deleted the `Articles` summary line in `index.ts` (anchor 1 to 0):
`scaffold-description.test.ts` went red, 2 failed / 4 passed. Message:
"the summary does not name Articles, an object the template ships", and
the `src/data/` case failed too.
- Added a temporary `invoice.object.ts` with `pluralLabel: 'Invoices'`
to the template's `src/objects/` (the "next object" case): red, 1 failed
/ 5 passed. Message: "the summary does not name Invoices, an object the
template ships". File removed, status clean.
- Renamed the article's `pluralLabel` to `Invoices`: red on the control
(1 failed / 5 passed).
- At 80f23ea, reverted the registry description to `Companies and
contacts, with …`: red, 1 failed / 6 passed. Message: "the Template line
does not name Articles, an object the template ships".
- Narrowed `isScaffoldingTemplate` in the managed-api sweep back to
company and contact only: "skips only scaffolding templates, and those
still exist" went red, expected 2 entries to equal 3.
</details>
<details><summary>Suites (re-run at head 3df792a, after merging
origin/main 3014176 in 08bb2af)</summary>
- After a turbo build of the `@objectstack/cli`, `create-objectstack`,
`@objectstack/example-starter` and `@objectstack/platform-objects`
closures (71 tasks successful), under `os-verify-lock`:
- `create-objectstack` test: Test Files 26 passed (26), Tests 411 passed
(411); typecheck exit 0.
- `@objectstack/example-starter` test (the boot test): Test Files 2
passed (2), Tests 14 passed (14); typecheck exit 0.
- `@objectstack/platform-objects` test: Test Files 130 passed (130),
Tests 2218 passed (2218); typecheck exit 0.
- The merge of origin/main touched none of this PR's files; the delta
against main is the same 14 files.
</details>
## Acceptance notes
- The claim was widened (amendment 7254402109) to fold in the Template
line and its mirrors. That remainder was first reported here as
same-family and is now item 4 above.
- The Starter's zh-CN **app** description in `starter.translation.ts`
now reads `公司、联系人与知识文章,菜单中附带平台的任务和备注。`, the same wording as its zh-CN
package description (second claim amendment).
- With the path list gone, the cross-package input gate needs a quoted
path to keep the platform-objects `packages/**/*.object.ts` glob held.
The old two-path list was that witness. The control's named
`article.object.ts` literal now holds it, and
`check:cross-package-test-inputs` is green.
- `overlap-check` names the bot-generated Version Packages PR #38192,
which bumps `examples/app-starter/package.json`'s version on the line
next to its description. That PR is regenerated from `main`, so the text
conflict resolves on its next refresh. It also names #38568, which this
PR supersedes; both merge cleanly with main.
- Item 5 touches `build-with-claude-code.mdx` beyond the lines that
quote the template description, as seat L1 7255063318 asked. Measuring
it showed two things on that page this PR does not change: the page's
own `src/apps/support.app.ts` beside the template's `main.app.ts` fails
`os validate` ("An 'app' package must define at most one app", ADR-0019
D3), and the validate block's `Runtime: 3 plugins` line reads `0
plugins` in an uninstalled scaffold. The counts above were taken with
the template's single app. Both are older than the help articles and are
left to the seat.
- Not changed, per the seat's L1 nit: the Starter's English app
description has no full stop while its zh-CN twin has one.
## Verification
Two-minute check: `pnpm --filter create-objectstack exec vitest run
--maxWorkers=2 src/scaffold-description.test.ts` should show 7 passed,
including "names each template object by its plural label" and "names
each template object in the printed Template line too".
<details><summary>How the tutorial's counts were measured (item
5)</summary>
At 08bb2af (built): `node packages/create-objectstack/dist/index.js
support-desk --template blank --skip-install --skip-skills` in a scratch
directory whose `node_modules/@objectstack/spec` links to this tree's
`packages/spec`, then `node packages/cli/bin/run.js validate` there.
- Fresh scaffold: `✓ Validation passed`, `Data: 3 Objects 18 Fields`,
`UI: 1 Apps 3 Views` (company 7 + contact 7 + article 4 fields).
- Plus the page's four `title=` code blocks written verbatim (ticket
object, Resolve action, ticket view, support app) and one export line
each in the barrels, minus the support app's export (see the acceptance
notes): `✓ Validation passed`, `Data: 4 Objects 22 Fields`, `UI: 1 Apps
4 Views 1 Actions`.
</details>
<details><summary>Gates</summary>
- At 3df792a, `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 117 commands (the docs families
included). All 117 were run, each exit captured before any pipe; `--ran`
reconciliation reads "117 derived famil(ies) accounted for — 117 run, 0
NOT-MEASURED (a DERIVED zero — all 117 recorded an exit code and none of
them is 3)".
- 113 exited 0 on the first pass. Four exited 3 with PREREQUISITE NOT
MET in the fresh worktree, and each exits 0 once its prerequisite is
met: `check-plugin-teardown-shape --self-test` after fetching its pinned
fixture commit ("48 cases pass"); `check:skill-examples`,
`check:dual-build-cjs-loads` and `check:i18n-coverage` after a full
turbo build ("352 prose examples type-check"; "126 published require
entry point(s) across 74 package(s) load"; "OK (15 config(s), 577
baselined untranslated string(s), none new)").
- `overlap-check --branch=HEAD` before the push of 3df792a:
"origin/main: merges cleanly"; #38568 merges cleanly; #38192 (Version
Packages) conflicts on `examples/app-starter/package.json`, see the
acceptance notes.
- CI-run families are read from this PR's check-runs, not re-run
locally.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jSh8tZmU5uBqzpvg3o
<!-- signed: repo:objectstack#1 · zhuangjianguo ·
session_01QsR2jSh8tZmU5uBqzpvg3o -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent bcb7e7f commit 75108ea
14 files changed
Lines changed: 178 additions & 56 deletions
File tree
- .changeset
- content/docs/getting-started
- examples/app-starter
- src/translations
- packages
- create-objectstack
- src
- templates/blank
- platform-objects/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| |||
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
350 | | - | |
351 | | - | |
| 352 | + | |
| 353 | + | |
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
685 | 688 | | |
686 | 689 | | |
| 690 | + | |
687 | 691 | | |
688 | 692 | | |
689 | 693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | | - | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments