Repository navigation
docs(quickstart): make "Add your own object" load on CLI 17.7.0 - #336
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
The published sample never reached the stack: the scaffold loads objects through src/objects/index.ts, and once exported the compile refused the bare name `task` (namespace prefix) and then the missing sharingModel. Rename it to my_app_task, add sharingModel, add the barrel line, state the namespace rule as the CLI prints it, and replace the four claims with what a 17.7.0 boot measured. Project layout now lists the scaffold's eight barrels. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXCwzqwMhkphKoBC11oPSz
The doc-samples gate evaluates every ts block as statements and refuses a bare re-export (`Unexpected token 'export'`). The barrel step is one line, so it reads as one inline line. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXCwzqwMhkphKoBC11oPSz
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXCwzqwMhkphKoBC11oPSz
席位核对ACCEPT: PR #336 for #327 · 2026-10-16T05:17Z · seat Shape.
Checks pinned to Card criteria, read against the diff and the dev's measurements on
Out-of-scope findings — two
The rest are Acceptance notes. Landing. Non-governed and well under the size line. The seat marks the PR ready. ❗ Merging to Generated by Claude Code |
Fixes #327
The quickstart's "Add your own object" did not produce an object on
@objectstack/cli17.7.0, the npmlatestat dispatch. This PR rewrites that section and "Project layout" incontent/docs/quickstart.mdx(the only file changed) so the page matches what 17.7.0 compiles and boots. Each claim the section now makes was measured on a 17.7.0 boot. The two claims that did not hold as written were rewritten from the measurement.What the published section did, reproduced
All runs used a fresh
os init my-app -t app --installfrom the 17.7.0 binary, with all 53@objectstack/*packages at 17.7.0. Boot 1's scaffold was installed on 2026-10-15. Boot 2's was installed withnpm_config_before=2026-10-15T14:00Zbecause the unbounded install now fails (Acceptance note 2).src/objects/task.tsas written,pnpm buildData: 1 Objects 3 Fields; the artifact holdsmy_app_itemonly. On a runningpnpm dev:GET /api/v1/data/taskreturns 404OBJECT_NOT_FOUNDexport { Task as task } from './task'insrc/objects/index.tsObject 'task' is missing the package namespace prefix. Rename it to 'my_app_task' (namespace = 'my_app').my_app_task, nosharingModelsecurity-owd-unset:custom object "my_app_task" declares no sharingModel (OWD)sharingModel: 'private'Data: 2 Objects 7 FieldsThe PM's unverified premise holds. Without
sharingModelthe compile refuses the object, so the corrected sample declares it.There was also no file to "edit". The 17.7.0 scaffold ships
src/objects/my_app_item.object.tsand notask.ts.objectstack generate object taskwritessrc/objects/task.object.tsand the barrel lineexport { default as task } from './task.object';, and the sample now uses the same file name and barrel line.The corrected section, followed literally
The blocks were extracted byte for byte from this PR's
quickstart.mdx(cmpequal) and applied to a runningpnpm devon a fresh scaffold:task.object.tson its own: the dev server recompiles and restarts, and the endpoint still answers 404, because the barrel does not export the file yet.✚ new object(s): my_app_task — table & seeds sync on restart, then✓ server restarted — the new build is live.pnpm buildthen reportsData: 2 Objects 7 Fields, andpnpm validatepasses.curlblock, run verbatim, exits 0: sign-in 200, create 201, list 200.UNAUTHENTICATED. The bullet now says so and the page shows the sign-in.How each bullet was measured, and what changed:
/api/v1/data/my_app_task, full CRUD with filter, sort and paginatewhere,orderBy,limitandoffsetfilter, sort and page as askedNewform (Subject, Done, Due, Assignee) and record page all render. The scaffold declares no app (UI: 0 Apps), so nothing links to them. They are reached at/_console/apps/setup/my_app_task. App-neutral spellings tried (/_console/my_app_task,/objects/…,/object/…,/data/…) redirect to homeTask (my_app_task)row with C/R/U/D toggles, in 3 of 3 sets opened (member_default, viewer_readonly, admin_full_access). The grants are per permission set. The Setup sidebar has no Roles entrysys_audit_logholds create, update and delete rows formy_app_task(boot 1: 3/1/1; boot 2: 2/1/1). Setup → Audit Logs lists them in the Console↻ restarting server to apply the new build)Changes besides the four bullets
Every object.name must be `${manifest.namespace}_${shortName}`., together with the refusal'sRename it to 'my_app_task'.✗ compile failed, runpnpm buildto see why. Measured on 2 of 2 boots: the dev watcher prints only✗ compile failed (2702ms)(and(2497ms)on the second boot) with no reason, whilepnpm buildon the same tree prints the refusal and exits 2. The upstream defect is listed under Acceptance notes.tsblock. The doc-samples gate evaluates everytsblock as statements and refused a bare re-export (FAIL quickstart.mdx:269 — evaluate as published: Unexpected token 'export').pnpm-workspace.yamland.objectstack/, the directorypnpm devcreates for the local SQLite databases. A note names what the tree leaves out:.gitignoreand the installer's lockfile (package-lock.jsonwhen the scaffold is created throughnpx).The section's boot banners were not re-transcribed (objectos#141 is on hold).
apps/docs/lib/positioning.tswas not touched. The page has no locale siblings.Verification on head
8cf78f7Every exit code was captured before any pipe. The heavy runs went through the shared verify lock with
--force(0 cached).pnpm turbo run type-check --continue --forcepnpm turbo run build --forcepnpm turbo run test --force✓ 11 self-test(s) passednode .github/scripts/check-doc-samples.mjsquickstart.mdx:244 PASS)node apps/docs/scripts/gen-zh-hant.mjs --checknode .github/scripts/check-locale-surface.mjsnode .github/scripts/check-positioning.mjsnode .github/scripts/check-search-locales.mjsnode .github/scripts/check-translations.mjscheck-translation-output.mjs --self-test/--filescheck-translation-ownership.mjs --files(M content/docs/quickstart.mdx)Other checks on the same head:
quickstart.mdxfound nothing (grep exit 1).en/docs/quickstart.htmlcontainsmy_app_task16 times andEvery object.name must be2 times. It contains noper role, noNo code generationand noname: 'task'.next startand rendered in Chromium at 1300 px and 390 px: no page errors and 0 px of horizontal page overflow.No ablation applies: this is a docs change with no code under test.
Acceptance notes
Two upstream defects found while measuring. Neither is fixed here:
objectstack devprints only✗ compile failed (…ms).objectstack compilewrites its refusal to stdout: measured, 10 stdout lines including the refusal, 0 stderr bytes. The watcher spawns the compile with stdout ignored (objectstack54770208packages/cli/src/commands/dev.ts:931-938, read from source). Main's print path for this refusal was not measured. The fix lands in objectstack.os init my-app -t app --install(npm, which the CLI auto-picks undernpx) fails 3 of 3 times withnpm error Cannot read properties of null (reading 'edgesOut'), and the CLI exits 2. That includes a run with an empty npm cache; npm is 10.9.4.npm_config_before, the install succeeds 2 of 2 times: at2026-10-15T14:00Zand at14:40Z.14:51Z), the newest match for@objectstack/metadata-core17.7.0's optional peervitest ^4.0.0, but it was not isolated further.Observations, not filed:
.gitignore(node_modules/,dist/,*.tsbuildinfo) does not ignore.objectstack/, wherepnpm devwrites its SQLite databases. objectstack main writes the same file (init.ts:1309).tsblock, so this page states the barrel line inline.No owner has been named for these: 承接者:无.
Generated by Claude Code