Skip to content

Commit 160fe48

Browse files
committed
test(ui): forced follow-ups to the two deleted examples and the now-private app-shell
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADHkmQmtHYkx1Ve9ob2ikN
1 parent fc00a52 commit 160fe48

14 files changed

Lines changed: 78 additions & 47 deletions

‎turbo.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"$TURBO_ROOT$/ui/scripts/vite-*.ts",
4444
"$TURBO_ROOT$/ui/vitest.config.mts",
4545
"$TURBO_ROOT$/ui/tsconfig.json",
46-
"$TURBO_ROOT$/ui/tsconfig.tier-base.json",
4746
"$TURBO_ROOT$/ui/apps/console/src/lib/auth-preflight.ts",
4847
"$TURBO_ROOT$/ui/eslint-rules/no-unprefixed-query-params.js",
4948
"$TURBO_ROOT$/ui/packages/cli/src/commands/generate.ts",

‎ui/QUICK_REFERENCE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pnpm changeset publish # Publish to npm (CI only)
8282

8383
| Path | Purpose |
8484
| --- | --- |
85-
| `packages/*` | 36 published packages (`@object-ui/*`), plus the private `vscode-extension`, `test-support` (test-only, never released) and `runner` (workspace demo app, never released) |
85+
| `packages/*` | 35 published packages (`@object-ui/*`), plus the private `vscode-extension`, `test-support` (test-only, never released), `runner` (workspace demo app, never released) and `app-shell` (the Console's shell and views, no longer published since 18.2) |
8686
| `apps/console` | Full ObjectUI console app (Vite + React) |
8787
| `apps/site` | Public docs site at <https://www.objectui.org> (fumadocs) |
8888
| `examples/*` | Runnable examples and the schema catalog — see [`examples/README.md`](./examples/README.md) |

‎ui/scripts/__tests__/check-changeset-fixed.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ describe('analyze', () => {
118118
expect(result.privateInFixed).toEqual([]);
119119
});
120120

121+
it('classifies a private package outside both lists only while private packages are versioned', () => {
122+
// `@object-ui/app-shell` since it left npm: versioned on its own, published
123+
// nowhere. Under `version: false` the same package would be treated as
124+
// ignored, so it stays unclassified there.
125+
const outside = [...manifests, pkg('@object-ui/private-shell', true)];
126+
expect(analyze({ ...config, privatePackages: { version: true, tag: false } }, outside).unclassified).toEqual([]);
127+
expect(
128+
analyze({ ...config, privatePackages: { version: false, tag: false } }, outside).unclassified.map((p) => p.name)
129+
).toEqual(['@object-ui/private-shell']);
130+
});
131+
121132
it('reports a package that is in neither `fixed` nor `ignore`', () => {
122133
const result = analyze({ ...config, privatePackages: { version: true, tag: false } }, [
123134
...manifests,

‎ui/scripts/__tests__/check-doc-fence-languages.test.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, expect, it } from 'vitest';
22
import { execFileSync } from 'node:child_process';
33
import fs from 'node:fs';
4+
import os from 'node:os';
45
import path from 'node:path';
56
import { fileURLToPath } from 'node:url';
67
import { parse as parseYaml } from 'yaml';
@@ -215,9 +216,18 @@ describe('check-doc-fence-languages: the scan surface is check-doc-snippet-types
215216

216217
it('…and that subtraction is non-empty, so it is not silently subtracting nothing', () => {
217218
// Each leg separately: a union that is non-empty overall would stay green
218-
// with one of its four members returning nothing at all.
219+
// with one of its four members returning nothing at all. The root `docs/*.md`
220+
// leg is read on a fixture page: the tree's one root page, the app-shell
221+
// extraction guide, was retired with the package's publishing (#25922).
222+
const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'check-doc-fence-languages-rootdocs-'));
223+
try {
224+
fs.mkdirSync(path.join(fixture, 'docs'));
225+
fs.writeFileSync(path.join(fixture, 'docs', 'PAGE.md'), '# top level\n');
226+
expect(snippetRootDocsPages(fixture)).toEqual(['docs/PAGE.md']);
227+
} finally {
228+
fs.rmSync(fixture, { recursive: true, force: true });
229+
}
219230
for (const leg of [
220-
snippetRootDocsPages(ROOT),
221231
snippetAdrDocsPages(ROOT),
222232
snippetAuditDocsPages(ROOT),
223233
snippetNestedPackageReadmes(ROOT),

‎ui/scripts/__tests__/check-doc-links.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ describe('the repo it guards', () => {
514514
expect(scanned['README.md']).toBe(1);
515515
expect(scanned['CONTRIBUTING.md']).toBe(1);
516516
expect(scanned['ROADMAP.md']).toBe(1);
517-
expect(scanned['examples']).toBeGreaterThanOrEqual(4);
517+
// Three READMEs since the two host-console examples were deleted (#25922):
518+
// the index, hello-world and schema-catalog.
519+
expect(scanned['examples']).toBeGreaterThanOrEqual(3);
518520
expect(scanned['docs']).toBeGreaterThanOrEqual(15);
519521
expect(scanned['content/docs']).toBeGreaterThanOrEqual(100);
520522
// objectui#3622. 38 of the 39 package directories carry a README today

‎ui/scripts/__tests__/check-type-check-coverage.test.ts‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -769,20 +769,13 @@ describe('examples/schema-catalog is wired up, in this repository', () => {
769769
// layout is fine — but it must arrive wired up, and this list is where the
770770
// next reader finds out.
771771
//
772-
// `@object-ui/example-console-starter` is that second package
773-
// (objectui#3528). Its vite-alias closure test lives in `test/` for the same
774-
// structural reason schema-catalog's do: that example's `tsconfig.json` IS
775-
// the app build (`tsc && vite build`, `include: ["src"]`), and a fork-ready
776-
// template should not hand the customer a test file inside the `src/` they
777-
// are meant to edit.
772+
// `@object-ui/example-console-starter` was the second (objectui#3528), until
773+
// that example was deleted with the host-console posture (#25922).
778774
const outsideSrc = packages
779775
.filter((p) => p.testFilePaths.some((rel: string) => !rel.startsWith('src/')))
780776
.map((p) => p.name)
781777
.sort();
782-
expect(outsideSrc).toEqual([
783-
'@object-ui/example-console-starter',
784-
'@object-ui/example-schema-catalog',
785-
]);
778+
expect(outsideSrc).toEqual(['@object-ui/example-schema-catalog']);
786779

787780
// "It must arrive wired up" is now enforced here rather than left to the
788781
// reader: appending a name above is not enough on its own, because a package

‎ui/scripts/__tests__/package-files-exist.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ describe('published packages that declare a license ship its text (objectui#3696
445445
// flipped — would otherwise report success over an empty set. Lowered by
446446
// one when `@object-ui/sdui-parser` was retired for the root
447447
// `@objectstack/sdui-parser` (objectstack#25712 item 3): 37 measured then.
448-
expect(owingPackages.length).toBeGreaterThanOrEqual(37);
448+
// Lowered by one again when `@object-ui/app-shell` went private
449+
// (objectstack#25922): 36 measured then.
450+
expect(owingPackages.length).toBeGreaterThanOrEqual(36);
449451

450452
// The package objectui#3696 fixed must be in scope BY NAME. If it drops
451453
// out of the population, this guard has stopped watching the exact spot

‎ui/scripts/__tests__/quick-reference-commands-4149.test.ts‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ describe('QUICK_REFERENCE.md — every documented `pnpm` command exists', () =>
234234
});
235235
});
236236

237-
describe('QUICK_REFERENCE.md — the "Run Examples" section covers the examples that run', () => {
237+
describe('QUICK_REFERENCE.md — the "Examples" section covers the examples that run', () => {
238238
/**
239239
* The reverse direction, and the one that would have caught this card before it was
240240
* filed. The forward test above only says the documented examples exist; it stays
@@ -245,16 +245,25 @@ describe('QUICK_REFERENCE.md — the "Run Examples" section covers the examples
245245
* when its manifest declares a `dev` script. `hello-world` (a snippet) and
246246
* `schema-catalog` (a data package) declare none, so they are correctly absent from
247247
* the command block — and the day either grows one, this goes red.
248+
*
249+
* Since the two host-console examples were deleted (#25922) no `examples/*` package
250+
* is a dev server, and the section says so in words instead of listing commands. That
251+
* sentence is pinned for as long as it is true, so neither half can go stale alone:
252+
* an example that grows a `dev` script reds the sentence, and the command check
253+
* below takes over.
248254
*/
249255
it('documents a dev command for every `examples/*` package that declares one', () => {
250256
const runnable = workspacePackages.filter((p) => p.dir.startsWith('examples/') && p.scripts.has('dev'));
251-
expect(
252-
runnable.length,
253-
'no `examples/*` package declares a `dev` script any more — the "Run Examples" section ' +
254-
'is now describing something that does not exist and needs rewriting, not re-pinning',
255-
).toBeGreaterThan(0);
256-
257-
const block = section('### Run Examples');
257+
const block = section('### Examples');
258+
const noneRuns = 'No directory under `examples/` is a dev server';
259+
if (runnable.length === 0) {
260+
expect(block, `${docRel}'s "Examples" section must say that no example is a dev server`).toContain(noneRuns);
261+
expect(block, `${docRel}'s "Examples" section documents a dev command for an example that has none`).not.toMatch(
262+
/--filter @object-ui\/example-[\w-]+ dev/,
263+
);
264+
return;
265+
}
266+
expect(block, `${docRel} says no example is a dev server, but ${JSON.stringify(runnable.map((p) => p.dir))} declare one`).not.toContain(noneRuns);
258267
const missing = runnable.filter((p) => !block.includes(`--filter ${p.name} dev`));
259268

260269
expect(

‎ui/scripts/__tests__/side-effects-declaration-consistency.test.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,10 +1172,7 @@ describe('`sideEffects` declarations match load-time behaviour (objectui#3943)',
11721172
// the entry form that made the console's bundle 0 bytes while every
11731173
// published path was declared.
11741174
const layoutAliases = aliasEntries.filter((a) => a.specifier === '@object-ui/layout');
1175-
expect(layoutAliases.map((a) => a.config).sort()).toEqual([
1176-
'apps/console/vite.config.ts',
1177-
'examples/console-starter/vite.config.ts',
1178-
]);
1175+
expect(layoutAliases.map((a) => a.config).sort()).toEqual(['apps/console/vite.config.ts']);
11791176
for (const alias of layoutAliases) {
11801177
expect(alias.target).toBe(path.join(repoRoot, 'packages/layout/src'));
11811178
}

‎ui/scripts/__tests__/zero-test-member-exclusion-9106.test.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { fileURLToPath } from 'node:url';
1818
* other. It then landed NOTHING that records the derivation — measured on
1919
* `1e0e46af9`, `git grep -ln 8991 -- scripts packages apps examples` returns two
2020
* incidental files, a vector fixture and a screenshot. So the next person to
21-
* derive this population re-discovers these three and re-asks the same question,
21+
* derive this population re-discovers these members and re-asks the same question,
2222
* which is exactly what produced objectui#9106.
2323
*
2424
* A prose exclusion is the thing this repo has already proved does not hold, in
@@ -44,7 +44,7 @@ import { fileURLToPath } from 'node:url';
4444
* `passWithNoTests` to a constant, it sets it to the negation of whether the CLI
4545
* named test filters, so a positional filter collecting nothing is precisely the
4646
* case it rejects loudly. That premise is pinned below, because the whole reason
47-
* these three get no `test` script depends on it.
47+
* these members get no `test` script depends on it.
4848
*
4949
* ⇒ giving them a `test` script would need `--passWithNoTests`, which would make
5050
* the package entry exit 0 while the root-config comparison exits 1 —
@@ -92,11 +92,6 @@ const ZERO_TEST_MEMBERS = [
9292
// construction and could never notice a test file appearing.
9393
why: 'the docs site; no test files, and no vitest project covers apps/site',
9494
},
95-
{
96-
dir: 'examples/byo-backend-console',
97-
pkgName: '@object-ui/example-byo-backend-console',
98-
why: 'a runnable example app; no test files',
99-
},
10095
{
10196
dir: 'examples/hello-world',
10297
pkgName: '@object-ui/example-hello-world',
@@ -298,7 +293,7 @@ describe('objectui#9106 — the two buckets either side of the exclusion', () =>
298293
describe('objectui#9106 — the premises the exclusion rests on', () => {
299294
it('the root config still derives passWithNoTests from the CLI, so a named path that collects nothing is loud', () => {
300295
// If this ever becomes a constant `true`, the measured exit 1 above stops
301-
// being true and the reason these three have no `test` script needs
296+
// being true and the reason these members have no `test` script needs
302297
// re-reading rather than re-spelling.
303298
expect(rootConfigText).toMatch(/passWithNoTests:\s*!cliHasTestFilters\(process\.argv\)/);
304299
});

0 commit comments

Comments
 (0)