Skip to content

Commit b9d0526

Browse files
xuyushun441-sysos-zhuangclaude
authored
fix(cli): drop stale ownership key from init scaffold object template (#1869)
* fix(cli): drop stale `ownership` key from init scaffold object template The `os init` scaffold emitted `ownership: 'own'` on the starter object in both the `app` and `plugin` templates. `ownership` is no longer a valid ObjectSchema field — it's removed from ObjectSchemaBase, and `ObjectSchema.create()` now rejects unknown top-level keys (ADR-0032 / #1535). A user copying the scaffolded object into `ObjectSchema.create({...})` would hit a validation error; the plain-literal form merely hid the problem while teaching a dead field. Remove the key from both templates. Rest of the scaffold output is unchanged; init.test.ts (28 tests) passes and end-to-end render of both templates confirms no `ownership` remains. Surfaced during the docs audit in #1866 (getting-started/quick-start.mdx). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: add changeset for init scaffold ownership fix Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7d94d2f commit b9d0526

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@objectstack/cli": patch
3+
---
4+
5+
fix(cli): drop stale `ownership` key from the `os init` scaffold object template
6+
7+
The `app` and `plugin` scaffold templates emitted `ownership: 'own'` on the starter object. `ownership` is no longer a valid `ObjectSchema` field (it's not in `ObjectSchemaBase`, and `ObjectSchema.create()` rejects unknown top-level keys per ADR-0032 / #1535), so a user migrating the scaffolded object into `ObjectSchema.create({...})` would hit a validation error. Removed the key from both templates; the rest of the scaffold output is unchanged.

packages/cli/src/commands/init.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export default defineStack({
150150
const ${toCamelCase(namespace)}Item: Data.Object = {
151151
name: '${namespace}_item',
152152
label: '${toTitleCase(namespace)} Item',
153-
ownership: 'own',
154153
fields: {
155154
name: {
156155
type: 'text',
@@ -223,7 +222,6 @@ export default defineStack({
223222
const ${toCamelCase(namespace)}Item: Data.Object = {
224223
name: '${namespace}_item',
225224
label: '${toTitleCase(namespace)} Item',
226-
ownership: 'own',
227225
fields: {
228226
name: {
229227
type: 'text',

0 commit comments

Comments
 (0)