Skip to content

Commit 1051118

Browse files
committed
test(create-objectstack): pin the Studio-customization disclosure; changeset
Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
1 parent ea4edc0 commit 1051118

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cli': patch
3+
'create-objectstack': patch
4+
---
5+
6+
feat(cli,create-objectstack): `os build` says when the local dev database holds Studio customizations the artifact leaves behind; the starter's `AGENTS.md` and README say a Studio change lives in the database and name `os package export`
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
- **`@objectstack/cli`: `os build`** ends, on its text face, with one notice when the SQLite database `os dev` opens for the project (the same resolution, over the project's development `.env*` files) holds items of a `<base>.custom` package: how many, in which pair, the database file, and that `os package export` takes them out while `os dev` runs. A change saved in Studio is such an item (ADR-0146 D2), never part of `src/`, so neither the artifact nor the starter's `Dockerfile` carries it. The read is local and read-only; a database that is not a local SQLite file is not probed and prints nothing, and a file that cannot be read is said to be unchecked, never empty. `os compile`, which `os dev` runs on every boot and rebuild, and `os build --json` print nothing new.
12+
- **`create-objectstack`: the generated `AGENTS.md` and the blank starter's README** say that Studio saves into the environment's database as an item of `<package id>.custom`, that `build` and the `Dockerfile` leave it behind, that app changes are made in `src/`, and how a customization moves as a package (`os login`, `os package export`, then `os package install` on the deployment, in the numbered order).
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (c) 2026 ObjectStack contributors. Apache-2.0 license.
2+
//
3+
// A change saved in Studio to an item the app ships is an item of the app's
4+
// paired `.custom` package, stored in the environment's database (ADR-0146
5+
// D2) — never in `src/`, so `build` and the Dockerfile leave it behind. The
6+
// scaffold's two docs a developer and their coding agent read first must say
7+
// so, name the command that takes it out (`os package export`), and tell the
8+
// agent to make app changes in `src/`. Both are static files `index.ts`
9+
// copies, so a source-text pin is what covers them.
10+
11+
import { describe, it, expect } from 'vitest';
12+
import fs from 'node:fs';
13+
import path from 'node:path';
14+
import { fileURLToPath } from 'node:url';
15+
16+
const templatesDir = path.join(path.dirname(fileURLToPath(import.meta.url)), 'templates');
17+
const AGENTS_MD = fs.readFileSync(path.join(templatesDir, 'AGENTS.md'), 'utf8');
18+
const README = fs.readFileSync(path.join(templatesDir, 'blank', 'README.md'), 'utf8');
19+
20+
/** The section under the heading that matches `heading`, up to the next heading of that level or higher. */
21+
function section(markdown: string, heading: RegExp, level: number): string {
22+
const lines = markdown.split('\n');
23+
const at = lines.findIndex((l) => heading.test(l));
24+
if (at === -1) return '';
25+
const stop = new RegExp(`^#{1,${level}} `);
26+
const end = lines.findIndex((l, i) => i > at && stop.test(l));
27+
return lines.slice(at, end === -1 ? undefined : end).join('\n');
28+
}
29+
30+
describe.each([
31+
['the scaffold AGENTS.md', section(AGENTS_MD, /^## .*Studio/, 2)],
32+
['the blank README', section(README, /^### .*Studio/, 3)],
33+
])('%s says a Studio change does not travel with the build', (_doc, text) => {
34+
it('has the section (vacuity guard)', () => {
35+
expect(text.length).toBeGreaterThan(200);
36+
});
37+
38+
it('says where the change lives and that the build leaves it behind', () => {
39+
expect(text).toContain('.custom');
40+
expect(text).toMatch(/database/);
41+
expect(text).toContain('src/');
42+
expect(text).toContain('Dockerfile');
43+
});
44+
45+
it('names the command that takes it out, and the install on the target', () => {
46+
expect(text).toContain('os package export');
47+
expect(text).toContain('os package install');
48+
});
49+
});
50+
51+
describe('the scaffold AGENTS.md tells the agent where app changes go', () => {
52+
it('makes app changes in src/, not through Studio', () => {
53+
const text = section(AGENTS_MD, /^## .*Studio/, 2);
54+
expect(text).toMatch(/\*\*Make every change to the app in `src\/`\*\*, never through Studio/);
55+
});
56+
});

0 commit comments

Comments
 (0)