Repository navigation
Commit 65d9617
feat(example-starter, create-objectstack): help articles in the Starter app and the blank template (#38435)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XDXvJPPtrTGfdDYhWWpihq5)_
Fixes #38372
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:新装基础模板应用的工作区,以及用命令行新建的项目,菜单里多一个「知识文章」入口,打开就有四篇示例帮助文章(笔记本设置、无线网络与打印常见问题、会议室参考表,以及一篇草稿);基础模板应用带中英文标签,新建项目暂时只有英文标签(中文标签另有一张卡跟进)。
-
为什么做:维护者要求模板应用自带知识文章,作为之后「知识检索」的内容基础;这次只加文章本身,不加知识源,等「未配置时不启用检索」那张卡落地后再接。
- 出错会怎样:只影响新装的模板和新建项目里多出的这一个对象和几条示例数据,已有环境不受影响;需要时整段改动可直接撤回。
- 要你做的:无。
## What changes
The Starter app (`examples/app-starter`, namespace `biz`, landed by
#38371) and the blank template that `npm create objectstack` scaffolds
(`packages/create-objectstack/src/templates/blank`, namespace `blank`)
both gain the same help-article slice:
- **Object** `biz_article` / `blank_article`
(`src/objects/article.object.ts`): `title` (text, required, the
`nameField`), `body` (markdown), `category` (select: `how_to`, `faq`,
`reference`), `status` (select: `draft` default, `published`); one field
group listing all four; `sharingModel: 'public_read_write'` like the
other two objects.
- **View** (`src/views/article.view.ts`): a grid of `title`, `category`,
`status`.
- **Menu**: an Articles entry between Contacts and Tasks.
- **Labels**: the Starter's bundle gains `en` and `zh-CN` for the
article's object, fields, options, view and section. The blank template
carries no translation bundle: its labels are the English ones in its
source, as for its companies and contacts today. This is the seat's
ruling (option A, record 7249604628): a zh-CN bundle covering the
article alone gives a fresh project i18n findings on `objectstack lint`
and breaks the on-ramp's zero-findings pins. The template's zh-CN labels
are split to #38456.
- **Seed** (`src/data/articles.ts`): four generic office-help articles:
setting up a laptop (how-to), a Wi-Fi and printing FAQ, a meeting rooms
reference with a table and a one-line note, and a draft on sharing
files. No policy or regulation text. The template gains `src/data/`, and
its config lists the seed by name (`data: [articles]`). Its `./src`
barrel imports stay exactly the ones `os init` wires, one per generator
directory, because a seed is not generator output.
- **No knowledge source** in either app, as ruled on the card. The
knowledge source over these articles is #38374, which waits on #38369.
- **READMEs** of both apps name the articles.
- **File surface, beyond the claim** (named in the dev report):
- `packages/cli/test/create-objectstack-wiring-parity.test.ts` (+1
line): the views vacuity guard names the article view's export line.
- `packages/cli/test/create-objectstack-stack-reach.test.ts` (+3 -2):
the on-ramp starter validates with three objects plus the generated one
(`Data: 4 Objects`).
- `packages/create-objectstack/src/templates/AGENTS.md`: an earlier
commit on this branch named `src/data/` and `src/translations/` in the
Project Structure tree; with the seed listed by name it went back to
main's text, so this file is net zero in the diff.
Changeset: `.changeset/38372-starter-help-articles.md` (patch for
`@objectstack/example-starter` and `create-objectstack`).
## Tests
- New `examples/app-starter/test/help-articles-38372.test.ts` holds
every seed article to one shape: first line `# TITLE` (the record's own
title), 3 to 6 `##` sections, no section without text, each section with
its heading under 800 characters, nothing between the title and the
first section; all three categories present; exactly one draft; one
reference article with a table followed by a one-line note. A CONTROL
case breaks each rule and sees it caught.
- `blank-template-starter-parity.test.ts`: `PAIRS` gains the article
object and the article views; a new case compares the whole
`defineSeed(Article, …)` call modulo the namespace (with its own
CONTROL); the menu case now expects five object entries.
- Starter `test/boot.test.ts`: the install seeds the four articles (one
draft), the menu lists `biz_article`, uninstall removes it.
- Template `starter.test.ts`: the seed loads and the menu lists
Articles.
- CLI pins that read the blank template: the #20333 wiring parity and
stack-reach (Test Core), and the nightly on-ramp e2e (#21325 zero
findings at every gate, #21370 field consumers) were run on a fresh
`create-objectstack` build.
## Acceptance notes
- Carrier #38483: the scaffolder's closing summary
(`packages/create-objectstack/src/index.ts`, "Your project starts
with:") still names only Companies and Contacts and Tasks and Notes.
This PR makes it incomplete (every new project now also starts with
Articles); fixed on #38483.
- Carrier #38483: the manifest descriptions (`manifest.description` in
both configs, the template's `objectstack.manifest.json`, the Starter's
`zh-CN` package description) still read "companies and contacts, with
tasks and notes"; updated on #38483.
- Carrier #38483: `platform-objects`'
`managed-api-method-affordance-sweep` and
`platform-admin-affordance-standing` exclude template object files by an
exact path list naming only company and contact, so the template's
`article.object.ts` is swept as if it were a booted definition. Their
tests are green, but the file is misclassified; corrected on #38483.
- The template's own `tsc` run (inside a scaffolded project) was not
measured locally: its dependencies resolve only in a scaffolded project.
`os validate` loads the template, and its `starter.test.ts` was run
against workspace source.
**Read first** (by risk):
`packages/create-objectstack/src/templates/blank/objectstack.config.ts`
(the `data: [articles]` key a new project starts with, beside barrel
imports equal to `os init`'s);
`packages/create-objectstack/src/blank-template-starter-parity.test.ts`
(the new seed pair);
`packages/cli/test/create-objectstack-stack-reach.test.ts` (the object
count).
**Two-minute check**: `pnpm --filter create-objectstack exec vitest run
src/blank-template-starter-parity.test.ts` shows 13 passed.
## Verification
All readings at head 7e469db (after merging `origin/main` at 16f132f),
on a fresh `create-objectstack` build (`dist` removed first: the on-ramp
e2e tests scaffold from the built `dist/templates`, and the build does
not delete directories removed from `src`).
<details><summary>Local runs</summary>
- `pnpm --filter @objectstack/example-starter validate`: Validation
passed (3 Objects, 3 Views, 1 Dashboard). `typecheck`: exit 0. `test`:
Test Files 2 passed, Tests 14 passed.
- `pnpm --filter create-objectstack typecheck`: exit 0. `test`: Test
Files 26 passed, Tests 408 passed.
- `objectstack validate` on the blank template: Validation passed (3
Objects, 3 Views).
- The template's `starter.test.ts` against workspace source (scratch
vitest config aliasing `@objectstack/verify` and `@objectstack/spec` to
`src`): Tests 4 passed.
- `pnpm --filter @objectstack/cli test` (the unit and integration tiers
PR CI runs): Test Files 680 passed, 2 skipped; Tests 8514 passed, 10
skipped.
- Nightly tier (`OS_TEST_TIERS=nightly`), every CLI e2e that scaffolds
through the on-ramp: `generate-scaffold-gates`,
`starter-field-consumers`, `serve-boot-diagnostics-noise-budget`,
`scaffold-emission-policy`: Test Files 4 passed, Tests 92 passed.
- `node scripts/pm/dispatch-gates.mjs --commands` derived 67 families;
all 67 exit 0 (`check:i18n-coverage`: OK, none new;
`check:dual-build-cjs-loads` and `check:type-check-debt` after building
their prerequisites). `--ran`: 67 derived, 67 run, 0 NOT-MEASURED, 0
UNRUN. Derived against merge base 16f132f with no staleness warning;
`origin/main` has since moved 8 commits (70d2d48), none touching this
PR's 26 files; CI reads the current one.
- `git grep -n "knowledge_source\|knowledgeSources"` over both apps
prints nothing.
- CI families: read from this PR's check-runs.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oQLfL8thb6wtUHnTb -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 91fc398 commit 65d9617
26 files changed
Lines changed: 797 additions & 62 deletions
File tree
- .changeset
- examples/app-starter
- src
- apps
- data
- objects
- translations
- views
- test
- packages
- cli/test
- create-objectstack/src
- templates/blank
- src
- apps
- data
- objects
- views
| 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 | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | | - | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
130 | 141 | | |
131 | 142 | | |
132 | 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 | + | |
133 | 175 | | |
134 | 176 | | |
135 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments