From 5084dbadd8ea80d4d696fda0b7d7f42e9d36b88b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 09:15:02 +0000 Subject: [PATCH 1/5] fix(create-objectstack): name the help articles in the scaffold summary and descriptions The "Your project starts with:" summary gains an Articles line, pinned against the template's object files so the next object fails the pin until the summary names it. The blank template's and the Starter's descriptions name the help articles (zh-CN in the Starter only). The platform-objects sweeps exclude the scaffolder's template directory instead of a two-file path list, with the control kept. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb --- .changeset/38483-scaffold-names-articles.md | 11 ++++ examples/app-starter/objectstack.config.ts | 2 +- .../src/translations/starter.translation.ts | 2 +- packages/create-objectstack/src/index.ts | 12 ++-- .../src/scaffold-description.test.ts | 60 +++++++++++++++++-- .../src/templates/blank/objectstack.config.ts | 2 +- .../templates/blank/objectstack.manifest.json | 2 +- ...anaged-api-method-affordance-sweep.test.ts | 60 ++++++++++++++----- ...platform-admin-affordance-standing.test.ts | 20 ++++--- 9 files changed, 137 insertions(+), 34 deletions(-) create mode 100644 .changeset/38483-scaffold-names-articles.md diff --git a/.changeset/38483-scaffold-names-articles.md b/.changeset/38483-scaffold-names-articles.md new file mode 100644 index 00000000000..d3087c1ac06 --- /dev/null +++ b/.changeset/38483-scaffold-names-articles.md @@ -0,0 +1,11 @@ +--- +'create-objectstack': patch +'@objectstack/example-starter': patch +--- + +fix(create-objectstack, example-starter): the scaffold summary and the descriptions name the help articles + +Clause-②: no +Metadata-protocol: none + +`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The blank template's description, in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter app's description, in English and in Simplified Chinese, now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. diff --git a/examples/app-starter/objectstack.config.ts b/examples/app-starter/objectstack.config.ts index ce00c48d4ea..10718aa1362 100644 --- a/examples/app-starter/objectstack.config.ts +++ b/examples/app-starter/objectstack.config.ts @@ -28,7 +28,7 @@ export default defineStack({ version: '0.1.0', type: 'app', name: 'Starter', - description: 'Companies and contacts, with the platform\'s tasks and notes in the menu.', + description: 'Companies, contacts and help articles, with the platform\'s tasks and notes in the menu.', // Protocol major this package is authored against (ADR-0087). engines: { protocol: '^19' }, // A starter is taken over by the organization that installs it: an diff --git a/examples/app-starter/src/translations/starter.translation.ts b/examples/app-starter/src/translations/starter.translation.ts index d56bebc1843..026b8705583 100644 --- a/examples/app-starter/src/translations/starter.translation.ts +++ b/examples/app-starter/src/translations/starter.translation.ts @@ -62,7 +62,7 @@ export const StarterTranslationBundle = defineTranslationBundle({ 'zh-CN': { // The package's own name, keyed by its manifest id (objectstack#35513). packages: { - 'com.example.starter': { name: '入门示例', description: '公司与联系人,菜单中附带平台的任务和备注。' }, + 'com.example.starter': { name: '入门示例', description: '公司、联系人与知识文章,菜单中附带平台的任务和备注。' }, }, objects: { biz_company: { diff --git a/packages/create-objectstack/src/index.ts b/packages/create-objectstack/src/index.ts index 50a2ea22552..d3b7cc4c0d2 100644 --- a/packages/create-objectstack/src/index.ts +++ b/packages/create-objectstack/src/index.ts @@ -678,12 +678,16 @@ const program = new Command() console.log(''); // What the project holds on day one, so the first `dev` run is not a - // surprise: the bundled template's companies and contacts (the - // platform's Starter app, as source), and the platform's tasks and notes - // in its menu. `blank-template-starter-parity.test.ts` holds these lines - // to the template's tree. + // surprise: the bundled template's companies, contacts and help articles + // (the platform's Starter app, as source) with the sample articles it + // seeds, and the platform's tasks and notes in its menu. + // `blank-template-starter-parity.test.ts` holds these lines to the + // template's tree, and `scaffold-description.test.ts` holds the printed + // block to the template's object files: an object added there fails it + // until a line here names it. console.log(chalk.bold(' Your project starts with:')); console.log(chalk.dim(' Companies and Contacts src/objects/, with their lists in src/views/')); + console.log(chalk.dim(' Articles src/objects/ and src/views/, with sample help articles in src/data/')); console.log(chalk.dim(" Tasks and Notes the platform's own, in the menu of src/apps/main.app.ts")); console.log(''); diff --git a/packages/create-objectstack/src/scaffold-description.test.ts b/packages/create-objectstack/src/scaffold-description.test.ts index dd3ed9a0325..15b62152a15 100644 --- a/packages/create-objectstack/src/scaffold-description.test.ts +++ b/packages/create-objectstack/src/scaffold-description.test.ts @@ -30,20 +30,22 @@ const TSX = path.join(REPO_ROOT, 'node_modules', '.bin', 'tsx'); const INDEX_TS = path.join(PKG_ROOT, 'src', 'index.ts'); const TEMPLATE_DESCRIPTION_CONFIG = - 'Companies and contacts, with tasks and notes from the platform in the menu.'; + 'Companies, contacts and help articles, with tasks and notes from the platform in the menu.'; const TEMPLATE_DESCRIPTION_MANIFEST = - 'ObjectStack environment that starts with companies and contacts, with tasks and notes from the platform in the menu.'; + 'ObjectStack environment that starts with companies, contacts and help articles, with tasks and notes from the platform in the menu.'; let tmp: string; let projectDir: string; +/** What the scaffolder printed, colour codes stripped. */ +let printed: string; beforeEach(() => { tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'create-objectstack-desc-')); - execFileSync( + printed = execFileSync( TSX, [INDEX_TS, 'support-desk', '--template', 'blank', '--skip-install', '--skip-skills'], - { cwd: tmp, stdio: 'pipe' }, - ); + { cwd: tmp, stdio: 'pipe', encoding: 'utf8' }, + ).replace(/\u001b\[[0-9;]*m/g, ''); projectDir = path.join(tmp, 'support-desk'); }, 30_000); @@ -120,3 +122,51 @@ describe('scaffolded project description (#9263)', () => { expect(messages).toEqual([]); }); }); + +// The closing "Your project starts with:" block lists what a new project holds +// on day one. Its expected entries are derived from the template, not listed +// here: every object file under the template's `src/objects/` must be named by +// its plural label, and a template that seeds sample data must point at +// `src/data/`. So the next object added to the template fails this until the +// summary in index.ts names it. +describe('the scaffolder\'s closing summary names every object the template ships', () => { + const OBJECTS_DIR = path.join(PKG_ROOT, 'src', 'templates', 'blank', 'src', 'objects'); + const DATA_INDEX = path.join(PKG_ROOT, 'src', 'templates', 'blank', 'src', 'data', 'index.ts'); + + /** The printed block: the lines after the heading, up to the first blank line. */ + function summaryBlock(): string { + const lines = printed.split('\n'); + const start = lines.findIndex((l) => l.trim() === 'Your project starts with:'); + expect(start, 'the scaffolder no longer prints "Your project starts with:"').toBeGreaterThanOrEqual(0); + const end = lines.findIndex((l, i) => i > start && l.trim() === ''); + return lines.slice(start + 1, end).join('\n'); + } + + /** Each template object file's `pluralLabel`, one per file. */ + function templateObjectLabels(): string[] { + const files = fs.readdirSync(OBJECTS_DIR).filter((f) => f.endsWith('.object.ts')); + return files.map((f) => { + const label = /\bpluralLabel:\s*'([^']+)'/.exec(fs.readFileSync(path.join(OBJECTS_DIR, f), 'utf8'))?.[1]; + expect(label, `${f} declares no pluralLabel, so the summary cannot be checked against it`).toBeTruthy(); + return label as string; + }); + } + + it('names each template object by its plural label', () => { + const block = summaryBlock(); + const labels = templateObjectLabels(); + // Control: the derivation read real files, so a moved directory cannot pass vacuously. + expect(labels).toEqual(expect.arrayContaining(['Companies', 'Contacts', 'Articles'])); + for (const label of labels) { + expect(block, `the summary does not name ${label}, an object the template ships`).toMatch( + new RegExp(`\\b${label}\\b`), + ); + } + }); + + it('points at src/data/ while the template seeds sample data', () => { + const seeds = /^export\s/m.test(fs.readFileSync(DATA_INDEX, 'utf8')); + expect(seeds, 'control: the template seeds sample data').toBe(true); + expect(summaryBlock()).toContain('src/data/'); + }); +}); diff --git a/packages/create-objectstack/src/templates/blank/objectstack.config.ts b/packages/create-objectstack/src/templates/blank/objectstack.config.ts index 1675497bb7c..503967d712b 100644 --- a/packages/create-objectstack/src/templates/blank/objectstack.config.ts +++ b/packages/create-objectstack/src/templates/blank/objectstack.config.ts @@ -28,7 +28,7 @@ export default defineStack({ version: '0.1.0', type: 'app', name: 'Blank Starter', - description: 'Companies and contacts, with tasks and notes from the platform in the menu.', + description: 'Companies, contacts and help articles, with tasks and notes from the platform in the menu.', // Protocol compatibility range: the metadata-protocol major this app is // authored against. The runtime checks it before it loads anything, so a // runtime outside the range refuses this app at the boundary with the exact diff --git a/packages/create-objectstack/src/templates/blank/objectstack.manifest.json b/packages/create-objectstack/src/templates/blank/objectstack.manifest.json index ef71e1d6d32..ef04be3821c 100644 --- a/packages/create-objectstack/src/templates/blank/objectstack.manifest.json +++ b/packages/create-objectstack/src/templates/blank/objectstack.manifest.json @@ -2,6 +2,6 @@ "$schema": "https://schemas.objectstack.dev/template-manifest.json", "namespace": "blank", "displayName": "Blank Starter", - "description": "ObjectStack environment that starts with companies and contacts, with tasks and notes from the platform in the menu.", + "description": "ObjectStack environment that starts with companies, contacts and help articles, with tasks and notes from the platform in the menu.", "readmePath": "README.md" } diff --git a/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts b/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts index f3ed1028dba..b554054c7f6 100644 --- a/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts +++ b/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts @@ -87,7 +87,7 @@ */ import { readdirSync, statSync } from 'node:fs'; -import { join, relative, resolve } from 'node:path'; +import { join, relative, resolve, sep } from 'node:path'; import { beforeAll, describe, expect, it } from 'vitest'; import { MANAGED_API_METHOD_UNAFFORDABLE, @@ -137,15 +137,23 @@ const PACKAGES_DIR = join(REPO_ROOT, 'packages'); * be imported here: a template's `@objectstack/spec` import resolves only inside * the generated project, which has its own install. * - * Declared as an exact path list, not a `templates/` pattern, and pinned as - * still-existing below. Every OTHER file is imported without a try/catch, so a - * file this sweep cannot load fails the run instead of being silently dropped — - * a silent skip is how a sweep keeps passing over the objects it stopped seeing. + * Declared as the scaffolder's template directory, not a list of its files: an + * object file anywhere under it is payload copied into a new project, so the + * next object a template gains is excluded with no edit here (a path list + * naming company and contact went on sweeping the template's later + * `article.object.ts` as a booted definition). The exclusion is held from both + * sides below: it must match at least one walked file, every match must sit in + * a template's own `src/objects/`, and it must remove nothing outside the + * directory. Every OTHER file is imported without a try/catch, so a file this + * sweep cannot load fails the run instead of being silently dropped — a silent + * skip is how a sweep keeps passing over the objects it stopped seeing. */ -const SCAFFOLDING_TEMPLATES: readonly string[] = [ - 'packages/create-objectstack/src/templates/blank/src/objects/company.object.ts', - 'packages/create-objectstack/src/templates/blank/src/objects/contact.object.ts', -]; +const SCAFFOLDING_TEMPLATES_DIR = 'packages/create-objectstack/src/templates/'; + +/** Whether a repo-relative path is a scaffolding template's file. */ +function isScaffoldingTemplate(repoRelative: string): boolean { + return repoRelative.split(sep).join('/').startsWith(SCAFFOLDING_TEMPLATES_DIR); +} /** Every `*.object.ts` under `packages/`, skipping build output, deps and tests. */ function walkObjectFiles(dir: string, out: string[] = []): string[] { @@ -173,7 +181,7 @@ function walkObjectFiles(dir: string, out: string[] = []): string[] { /** The files this sweep judges: every walked object file bar the templates. */ function sweptFiles(): string[] { return walkObjectFiles(PACKAGES_DIR).filter( - (f) => !SCAFFOLDING_TEMPLATES.includes(relative(REPO_ROOT, f)), + (f) => !isScaffoldingTemplate(relative(REPO_ROOT, f)), ); } @@ -311,11 +319,35 @@ describe('#7934 — code-shipped managed objects declare only apiMethods their o it('skips only scaffolding templates, and those still exist', () => { // A stale exemption is documentation of nothing; an exemption that quietly // grew is a hole. Both directions, on the SINGLE_RECORD_WRITE_ONLY pattern. - const walked = walkObjectFiles(PACKAGES_DIR).map((f) => relative(REPO_ROOT, f)); - for (const template of SCAFFOLDING_TEMPLATES) { - expect(walked, `${template} is no longer a real object file — drop the exemption`).toContain(template); + const walked = walkObjectFiles(PACKAGES_DIR).map((f) => relative(REPO_ROOT, f).split(sep).join('/')); + const templates = walked.filter(isScaffoldingTemplate); + // Not empty: the directory still holds template object files. + expect(templates.length, `${SCAFFOLDING_TEMPLATES_DIR} holds no object file any more — drop the exemption`) + .toBeGreaterThan(0); + // Not over-wide: each match is an object file in a template's own src/objects/. + for (const template of templates) { + expect(template, `${template} is excluded but is not a template's object file`).toMatch( + /^packages\/create-objectstack\/src\/templates\/[^/]+\/src\/objects\/[^/]+\.object\.ts$/, + ); } - expect(walked.length - sweptFiles().length).toBe(SCAFFOLDING_TEMPLATES.length); + // Exactly the templates' object files, read off each template's src/objects/ + // independently of the walk — today's blank template's article.object.ts among them. + const templatesRoot = join(REPO_ROOT, SCAFFOLDING_TEMPLATES_DIR); + const listed = readdirSync(templatesRoot).flatMap((t) => { + const objectsDir = join(templatesRoot, t, 'src', 'objects'); + let entries: string[]; + try { + entries = readdirSync(objectsDir); + } catch { + return []; + } + return entries + .filter((f) => f.endsWith('.object.ts')) + .map((f) => `${SCAFFOLDING_TEMPLATES_DIR}${t}/src/objects/${f}`); + }); + expect([...templates].sort()).toEqual([...listed].sort()); + // And the filter removes nothing outside the directory. + expect(walked.length - sweptFiles().length).toBe(templates.length); }); // ── the verdict ─────────────────────────────────────────────────────────── diff --git a/packages/platform-objects/src/platform-admin-affordance-standing.test.ts b/packages/platform-objects/src/platform-admin-affordance-standing.test.ts index 6b6fceeb218..7b6ee99c3da 100644 --- a/packages/platform-objects/src/platform-admin-affordance-standing.test.ts +++ b/packages/platform-objects/src/platform-admin-affordance-standing.test.ts @@ -62,7 +62,7 @@ */ import { readdirSync, statSync } from 'node:fs'; -import { join, relative, resolve } from 'node:path'; +import { join, relative, resolve, sep } from 'node:path'; import { beforeAll, describe, expect, it } from 'vitest'; import { celEngine } from '@objectstack/formula'; import { ADMIN_FULL_ACCESS_CAPABILITIES } from '@objectstack/spec/identity'; @@ -77,11 +77,17 @@ const HERE = __dirname; const REPO_ROOT = resolve(HERE, '../../..'); const PACKAGES_DIR = join(REPO_ROOT, 'packages'); -/** Object files that are templates for a generated project, not definitions this repo boots. */ -const SCAFFOLDING_TEMPLATES: readonly string[] = [ - 'packages/create-objectstack/src/templates/blank/src/objects/company.object.ts', - 'packages/create-objectstack/src/templates/blank/src/objects/contact.object.ts', -]; +/** + * The scaffolder's template directory: an object file under it is payload for a + * generated project, not a definition this repo boots. The same exclusion, and + * its control, as `managed-api-method-affordance-sweep.test.ts`. + */ +const SCAFFOLDING_TEMPLATES_DIR = 'packages/create-objectstack/src/templates/'; + +/** Whether a repo-relative path is a scaffolding template's file. */ +function isScaffoldingTemplate(repoRelative: string): boolean { + return repoRelative.split(sep).join('/').startsWith(SCAFFOLDING_TEMPLATES_DIR); +} const ADMIN_NAMESPACE = '/api/v1/auth/admin/'; @@ -145,7 +151,7 @@ function sourceOf(raw: unknown): string | undefined { async function loadActions(): Promise<{ files: number; actions: FirstPartyAction[] }> { const files = walkObjectFiles(PACKAGES_DIR).filter( - (f) => !SCAFFOLDING_TEMPLATES.includes(relative(REPO_ROOT, f)), + (f) => !isScaffoldingTemplate(relative(REPO_ROOT, f)), ); const actions: FirstPartyAction[] = []; for (const file of files) { From 9f2a6cf9d53445ad0338d4584b0aff44f45a8875 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 09:47:03 +0000 Subject: [PATCH 2/5] test(platform-objects): name the template object the path list missed The literal keeps the package's declared object-file glob held for the cross-package input gate and pins the exclusion's coverage of it. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb --- .../src/managed-api-method-affordance-sweep.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts b/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts index b554054c7f6..bf4cf2eeb86 100644 --- a/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts +++ b/packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts @@ -346,6 +346,8 @@ describe('#7934 — code-shipped managed objects declare only apiMethods their o .map((f) => `${SCAFFOLDING_TEMPLATES_DIR}${t}/src/objects/${f}`); }); expect([...templates].sort()).toEqual([...listed].sort()); + // The template object a path list once missed, named so a regression to one is red here. + expect(templates).toContain('packages/create-objectstack/src/templates/blank/src/objects/article.object.ts'); // And the filter removes nothing outside the directory. expect(walked.length - sweptFiles().length).toBe(templates.length); }); From 80f23ea9893e0bc55115e1871b05b8399ad86bc5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 10:25:03 +0000 Subject: [PATCH 3/5] fix(create-objectstack): name the help articles in the Template line and its mirrors The blank template's registry description (printed as the Template line on every run), the package README and the two getting-started pages that quote it, the Starter's English app description, its package.json description and the two index.ts comments quoting the template's own description now name the help articles. The summary pin also holds the printed Template line to the template's object files. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb --- .changeset/38483-scaffold-names-articles.md | 2 +- .../docs/getting-started/build-with-claude-code.mdx | 2 +- content/docs/getting-started/your-first-project.mdx | 2 +- examples/app-starter/package.json | 2 +- .../src/translations/starter.translation.ts | 2 +- packages/create-objectstack/README.md | 2 +- packages/create-objectstack/src/index.ts | 6 +++--- .../src/scaffold-description.test.ts | 12 ++++++++++++ packages/create-objectstack/src/template-registry.ts | 2 +- 9 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.changeset/38483-scaffold-names-articles.md b/.changeset/38483-scaffold-names-articles.md index d3087c1ac06..f5c9d725f6c 100644 --- a/.changeset/38483-scaffold-names-articles.md +++ b/.changeset/38483-scaffold-names-articles.md @@ -8,4 +8,4 @@ fix(create-objectstack, example-starter): the scaffold summary and the descripti Clause-②: no Metadata-protocol: none -`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The blank template's description, in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter app's description, in English and in Simplified Chinese, now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. +`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The `Template: blank — …` line it prints first, the template table in this package's README, the blank template's description in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter's package description (in English and in Simplified Chinese), its English app description and its `package.json` description now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. diff --git a/content/docs/getting-started/build-with-claude-code.mdx b/content/docs/getting-started/build-with-claude-code.mdx index 5e8bde2e429..7cfc2ee7e8e 100644 --- a/content/docs/getting-started/build-with-claude-code.mdx +++ b/content/docs/getting-started/build-with-claude-code.mdx @@ -79,7 +79,7 @@ The scaffolder does more than copy files. It: ──────────────────────────────────────── Environment: support-desk Namespace: support_desk - Template: blank — Companies and contacts, with platform tasks and notes in the menu — ready to extend + Template: blank — Companies, contacts and help articles, with tasks and notes from the platform in the menu — ready to extend … → Installing AI skills for your coding agent from @objectstack/skills@... … diff --git a/content/docs/getting-started/your-first-project.mdx b/content/docs/getting-started/your-first-project.mdx index 1f2cf294ea5..5ae784f09f6 100644 --- a/content/docs/getting-started/your-first-project.mdx +++ b/content/docs/getting-started/your-first-project.mdx @@ -83,7 +83,7 @@ bundle) with `--skip-skills` if you prefer — `AGENTS.md` is always written. | Template | Source | Description | |:---|:---|:---| -| `blank` *(default)* | bundled, works offline | Companies and contacts, with platform tasks and notes in the menu — ready to extend | +| `blank` *(default)* | bundled, works offline | Companies, contacts and help articles, with tasks and notes from the platform in the menu — ready to extend | ```bash npm create objectstack@latest my-app -- --template blank diff --git a/examples/app-starter/package.json b/examples/app-starter/package.json index abc31f02b34..a2f32b952f5 100644 --- a/examples/app-starter/package.json +++ b/examples/app-starter/package.json @@ -1,7 +1,7 @@ { "name": "@objectstack/example-starter", "version": "0.1.1-next.2", - "description": "Starter app: companies and their contacts, with the platform's tasks and notes in the menu", + "description": "Starter app: companies, contacts and help articles, with the platform's tasks and notes in the menu", "license": "Apache-2.0", "private": true, "main": "./objectstack.config.ts", diff --git a/examples/app-starter/src/translations/starter.translation.ts b/examples/app-starter/src/translations/starter.translation.ts index 026b8705583..91e98b842db 100644 --- a/examples/app-starter/src/translations/starter.translation.ts +++ b/examples/app-starter/src/translations/starter.translation.ts @@ -54,7 +54,7 @@ export const StarterTranslationBundle = defineTranslationBundle({ apps: { biz_app: { label: 'Starter', - description: 'Companies and contacts, with tasks and notes', + description: 'Companies, contacts and help articles, with tasks and notes', }, }, }, diff --git a/packages/create-objectstack/README.md b/packages/create-objectstack/README.md index f16311575f3..600ce052950 100644 --- a/packages/create-objectstack/README.md +++ b/packages/create-objectstack/README.md @@ -28,7 +28,7 @@ npx create-objectstack my-app --skip-install | Template | Source | Description | | --- | --- | --- | -| `blank` *(default)* | bundled (offline) | Companies and contacts, with platform tasks and notes in the menu — ready to extend | +| `blank` *(default)* | bundled (offline) | Companies, contacts and help articles, with tasks and notes from the platform in the menu — ready to extend | `blank` is bundled inside the npm package, so scaffolding never needs network access. diff --git a/packages/create-objectstack/src/index.ts b/packages/create-objectstack/src/index.ts index d3b7cc4c0d2..5163e677023 100644 --- a/packages/create-objectstack/src/index.ts +++ b/packages/create-objectstack/src/index.ts @@ -31,8 +31,8 @@ * * The template's own `manifest.description` is DROPPED from both * objectstack.manifest.json and objectstack.config.ts rather than carried - * over unrewritten (#9263): it describes the bundled template ("Companies - * and contacts, with tasks and notes from the platform in the menu."), not the project + * over unrewritten (#9263): it describes the bundled template ("Companies, + * contacts and help articles, with tasks and notes from the platform in the menu."), not the project * being scaffolded, and there is nothing but the project name to derive a * replacement from — which would only restate `name`/`displayName`. `os * validate` already omits the description line entirely when the field is @@ -194,7 +194,7 @@ function rewriteProjectIdentity( // file refuses each, and publish refuses `category` and `visibility` — the // list is RETIRED_TEMPLATE_MANIFEST_KEYS in rewrite-identity.ts), and DROP // .description (#9263). The template ships a generic line describing - // ITSELF ("Companies and contacts, with tasks and notes from the platform in the menu."), + // ITSELF ("Companies, contacts and help articles, with tasks and notes from the platform in the menu."), // not the project being scaffolded, and there is nothing but the project // name to derive a replacement from — a name-derived sentence would be a // bare restatement of `name`/`displayName` (e.g. "Support Desk — an diff --git a/packages/create-objectstack/src/scaffold-description.test.ts b/packages/create-objectstack/src/scaffold-description.test.ts index 15b62152a15..a64c7e7c1f4 100644 --- a/packages/create-objectstack/src/scaffold-description.test.ts +++ b/packages/create-objectstack/src/scaffold-description.test.ts @@ -164,6 +164,18 @@ describe('the scaffolder\'s closing summary names every object the template ship } }); + it('names each template object in the printed Template line too', () => { + // The line comes from the template registry's description, printed before + // the files are written; it describes the same tree, so it is held to it. + const line = printed.split('\n').find((l) => l.trim().startsWith('Template: blank')); + expect(line, 'the scaffolder no longer prints "Template: blank — …"').toBeDefined(); + for (const label of templateObjectLabels()) { + expect(line, `the Template line does not name ${label}, an object the template ships`).toMatch( + new RegExp(`\\b${label}\\b`, 'i'), + ); + } + }); + it('points at src/data/ while the template seeds sample data', () => { const seeds = /^export\s/m.test(fs.readFileSync(DATA_INDEX, 'utf8')); expect(seeds, 'control: the template seeds sample data').toBe(true); diff --git a/packages/create-objectstack/src/template-registry.ts b/packages/create-objectstack/src/template-registry.ts index 4c909abe933..d460120e9a5 100644 --- a/packages/create-objectstack/src/template-registry.ts +++ b/packages/create-objectstack/src/template-registry.ts @@ -24,7 +24,7 @@ export interface TemplateInfo { */ export const TEMPLATES: Record = { blank: { - description: 'Companies and contacts, with platform tasks and notes in the menu — ready to extend', + description: 'Companies, contacts and help articles, with tasks and notes from the platform in the menu — ready to extend', source: { kind: 'bundled', dir: 'blank' }, }, }; From 3febf445f7b35c6f7f1d0d72f4e142d6a79d7e18 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 11:12:59 +0000 Subject: [PATCH 4/5] fix(example-starter): name the help articles in the zh-CN app description Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb --- .changeset/38483-scaffold-names-articles.md | 2 +- examples/app-starter/src/translations/starter.translation.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/38483-scaffold-names-articles.md b/.changeset/38483-scaffold-names-articles.md index f5c9d725f6c..7939dfa9c36 100644 --- a/.changeset/38483-scaffold-names-articles.md +++ b/.changeset/38483-scaffold-names-articles.md @@ -8,4 +8,4 @@ fix(create-objectstack, example-starter): the scaffold summary and the descripti Clause-②: no Metadata-protocol: none -`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The `Template: blank — …` line it prints first, the template table in this package's README, the blank template's description in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter's package description (in English and in Simplified Chinese), its English app description and its `package.json` description now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. +`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The `Template: blank — …` line it prints first, the template table in this package's README, the blank template's description in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter's package description (in English and in Simplified Chinese), its app description (in English and in Simplified Chinese) and its `package.json` description now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. diff --git a/examples/app-starter/src/translations/starter.translation.ts b/examples/app-starter/src/translations/starter.translation.ts index 91e98b842db..097cf689bb2 100644 --- a/examples/app-starter/src/translations/starter.translation.ts +++ b/examples/app-starter/src/translations/starter.translation.ts @@ -176,7 +176,7 @@ export const StarterTranslationBundle = defineTranslationBundle({ apps: { biz_app: { label: '起步应用', - description: '公司和联系人,以及任务和备忘', + description: '公司、联系人与知识文章,菜单中附带平台的任务和备注。', }, }, datasets: { From 3df792a9f513218b9aec728f0222cb9fe2bf5b51 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 12:15:26 +0000 Subject: [PATCH 5/5] docs(create-objectstack): count the help articles in the tutorial and the README tree The getting-started tutorial's validate output and its prose now read four objects and twenty-two fields with four views (measured: a fresh blank scaffold plus the page's ticket files), and name the help articles among what the blank template scaffolded. The package README's "What you get" tree lists article.object.ts and the src/data/ seed. Claude-Session: https://claude.ai/code/session_01QsR2jSh8tZmU5uBqzpvg3o Co-authored-by: Claude --- .changeset/38483-scaffold-names-articles.md | 2 +- .../getting-started/build-with-claude-code.mdx | 14 ++++++++------ packages/create-objectstack/README.md | 15 +++++++++------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.changeset/38483-scaffold-names-articles.md b/.changeset/38483-scaffold-names-articles.md index 7939dfa9c36..609b6e845cc 100644 --- a/.changeset/38483-scaffold-names-articles.md +++ b/.changeset/38483-scaffold-names-articles.md @@ -8,4 +8,4 @@ fix(create-objectstack, example-starter): the scaffold summary and the descripti Clause-②: no Metadata-protocol: none -`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The `Template: blank — …` line it prints first, the template table in this package's README, the blank template's description in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter's package description (in English and in Simplified Chinese), its app description (in English and in Simplified Chinese) and its `package.json` description now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. +`npm create objectstack` now lists the help articles in the "Your project starts with:" block it prints after creating a project: an Articles line beside Companies and Contacts, pointing at `src/objects/` and `src/views/` and at the sample articles in `src/data/`. The `Template: blank — …` line it prints first, the template table and the "What you get" tree in this package's README (the tree now lists `article.object.ts` and the `src/data/` seed), the blank template's description in `objectstack.config.ts` and in `objectstack.manifest.json`, and the Starter's package description (in English and in Simplified Chinese), its app description (in English and in Simplified Chinese) and its `package.json` description now read companies, contacts and help articles, with tasks and notes from the platform in the menu. A scaffolded project still drops the template's description from its own files. diff --git a/content/docs/getting-started/build-with-claude-code.mdx b/content/docs/getting-started/build-with-claude-code.mdx index 7cfc2ee7e8e..a56c3124b91 100644 --- a/content/docs/getting-started/build-with-claude-code.mdx +++ b/content/docs/getting-started/build-with-claude-code.mdx @@ -282,10 +282,12 @@ thing to check. What it does **not** touch is what the `blank` template scaffolded in step 1: the companies and contacts (`src/objects/company.object.ts` and -`contact.object.ts`, seven fields each). Nothing asked for them to go, so they -stay in the project — which is why the counts below read **three** objects and -**eighteen** fields, not one and four. Delete them once the ticket object has -replaced them and the same run reports `1 Objects 4 Fields`. +`contact.object.ts`, seven fields each) and the help articles +(`article.object.ts`, four fields, with its view and sample articles). Nothing +asked for them to go, so they stay in the project — which is why the counts +below read **four** objects and **twenty-two** fields, not one and four. Delete +them once the ticket object has replaced them and the same run reports +`1 Objects 4 Fields`. This is the same metadata that powers the REST API, the Console UI, **and the MCP tools exposed to AI** — define it once, and ObjectStack derives the rest. @@ -347,8 +349,8 @@ Once it's clean: Support Desk v0.1.0 - Data: 3 Objects 18 Fields - UI: 1 Apps 3 Views 1 Actions + Data: 4 Objects 22 Fields + UI: 1 Apps 4 Views 1 Actions Logic: 0 Flows Security: 0 Positions 0 Permissions Runtime: 3 plugins diff --git a/packages/create-objectstack/README.md b/packages/create-objectstack/README.md index 600ce052950..d22886eba09 100644 --- a/packages/create-objectstack/README.md +++ b/packages/create-objectstack/README.md @@ -85,13 +85,16 @@ my-app/ ├── README.md ├── AGENTS.md # conventions for coding agents └── src/ - ├── objects/ # companies and contacts: the platform's - │ ├── index.ts # Starter app, as source + ├── objects/ # companies, contacts and help articles: + │ ├── index.ts # the platform's Starter app, as source │ ├── company.object.ts - │ └── contact.object.ts - ├── views/ # a grid and a board for each - ├── apps/main.app.ts # the menu: companies, contacts, and the - │ # platform's tasks and notes + │ ├── contact.object.ts + │ └── article.object.ts + ├── views/ # a grid and a board for companies and + │ # contacts, a grid for articles + ├── data/ # the seed: sample help articles + ├── apps/main.app.ts # the menu: companies, contacts, articles, + │ # and the platform's tasks and notes ├── actions/index.ts # an empty barrel for each directory ├── flows/index.ts # `objectstack generate` writes into, ├── dashboards/index.ts # already wired into objectstack.config.ts