Skip to content

Commit 7c21afd

Browse files
hotlongclaude
andcommitted
chore(changeset): the JSX page gate reads the project manifest beside the config
Claude-Session: https://claude.ai/code/session_local_1d2a197c-c20e-4e90-9be8-413d4d432289 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8a85dbb commit 7c21afd

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
'@objectstack/cli': minor
3+
---
4+
5+
fix(cli)!: `objectstack validate`, `objectstack build` and `objectstack lint` read the project's `sdui.manifest.json` beside the config they were given, not in the directory they were run from (#20166)
6+
7+
Clause-②: no (narrowing)
8+
9+
<!-- adr-0087: not-required (no-migration-prescription) No metadata changes shape and nothing an author wrote is renamed or removed, so `objectstack migrate meta` has nothing to rewrite. What moves is which manifest file judges a run whose config path names another directory. -->
10+
11+
**BREAKING for runs given a config path in another directory.**
12+
13+
**What changed.** These commands check the `source` of each `kind: 'html'` page
14+
against an SDUI component manifest: the project's own `sdui.manifest.json` first,
15+
then the copy `@objectstack/console` ships. They located everything else about a
16+
project from the directory of its config, but looked for the project's own
17+
manifest in the directory the command was run from. So
18+
`objectstack validate path/to/app/objectstack.config.ts`, run from anywhere else,
19+
never read `path/to/app/sdui.manifest.json`, and a manifest that happened to sit in
20+
the directory it was run from judged a project it does not belong to. They now read
21+
the manifest beside the config.
22+
23+
## Which manifest each run reads
24+
25+
| the run | the project manifest it read | the project manifest it reads now |
26+
|:--|:--|:--|
27+
| `objectstack validate` / `build` / `lint` with no config path, in the project's directory | `./sdui.manifest.json` | `./sdui.manifest.json` (unchanged) |
28+
| the same commands given `path/to/app/objectstack.config.ts`, run from another directory | that other directory's `sdui.manifest.json` | `path/to/app/sdui.manifest.json` |
29+
30+
When the project carries no manifest of its own, both rows then fall back to the
31+
copy `@objectstack/console` ships, as before.
32+
33+
**Which runs change, and which way.** Only runs whose config path names a directory
34+
other than the one they run in. For those, the verdict can move in both directions:
35+
36+
- A page the project's own manifest does not declare is now refused
37+
(`jsx-forbidden-tag`, `jsx-unknown-component`, `jsx-unknown-prop`, exit 1), where
38+
the other directory's manifest, or the console's copy, used to admit it.
39+
- A project manifest that is present but not usable is now refused (exit 1), naming
40+
that file, where the run used to read some other file.
41+
- A project with no manifest of its own is now checked against the console's copy,
42+
where the other directory's manifest used to decide.
43+
- In the other direction, a page the other directory's manifest refused, and that
44+
the project's own manifest (or the console's copy) declares, is now admitted.
45+
46+
If such a run now fails, the manifest that belongs to the project is the one to
47+
keep beside its config.
48+
49+
**What is not affected.** A run in the project's own directory, with or without a
50+
config path, reads the same file as before. `objectstack init`'s check of a freshly
51+
generated scaffold keeps reading the directory it was run from.
52+
53+
**A correction to this release's console-fallback entry.** That entry says these
54+
commands "look first for the `sdui.manifest.json` in the directory the command runs
55+
in". From this release they look first beside the config the command was given,
56+
which is the same directory whenever the command runs in the project.

0 commit comments

Comments
 (0)