Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/runner/vite.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,8 +21,6 @@ export default defineConfig({
"@/hooks": path.resolve(__dirname, "../../packages/components/src/hooks"),

"@": path.resolve(__dirname, "./src"),
// ⚡️ DX: App Data Symlink
"@app": path.resolve(__dirname, "./src/app-data"),

// ⚡️ DX: Map imports to source code for Hot Module Replacement
//
Expand Down
77 changes: 51 additions & 26 deletions scripts/__tests__/vitest-config-alias-targets-3944.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -788,32 +788,39 @@ function packageAliasTargetExists(abs: string): boolean {
}

/**
* objectui#5380 — one entry whose target does not exist and which this PR
* deliberately does NOT delete, for the same reason objectui#4820 was carved
* out of the `paths` half rather than fixed in it.
*
* `packages/runner`'s `"@app"` points at `packages/runner/src/app-data`, which
* is absent in every form (no directory, no `app-data.<ext>`). Its comment reads
* `DX: App Data Symlink`, and nothing in the repo imports `@app` — the
* declaration is the only occurrence. So the fix is either "drop the line" or
* "restore the symlink this DX affordance was written for", and which one is a
* maintainer call, not a rider on a gate that is only supposed to start looking.
* Filed as objectui#5380; this file's job here is to stop it being invisible.
*
* Note it is NOT an `@object-ui/*` key. The finding that opened objectui#5168
* counted 196 `@object-ui/*` entries, and a gate scoped to that prefix would
* have shipped green over this. That is the second time this exact config has
* outlived a target: its own comment records objectui#3593, where a
* `2>/dev/null` kept a dead `data-objectql` entry quiet.
*
* A shrink-only ratchet, not an exemption. The list may not grow — a NEW dead
* target is still red — and the pin below asserts the listed entry is still
* declared AND still missing, so resolving it either way turns this file red
* until the list is emptied with it.
* objectui#5380 — RESOLVED, and this ratchet is empty as a result.
*
* It briefly carved out `packages/runner`'s `"@app"`, which pointed at
* `packages/runner/src/app-data`. #5380 ruled direction A′: delete the alias
* line, on the measured ground that it had **zero importers** and that the
* documented App Data Symlink DX does not route through it —
* `packages/runner/src/lib/MetadataLoader.ts`'s `LocalBundleLoader` reads that
* directory through relative `import.meta.glob('../app-data/…')`, never through
* the alias. Deleting the line changed no behaviour.
*
* ⚠️ Read the ground carefully before carving out anything that looks like
* this again: `src/app-data/` is NOT a dead target. It is git-ignored
* (`packages/runner/.gitignore:1`) and **user-supplied** — the reader creates it
* by following `packages/runner/README.md` or `content/docs/utilities/runner.mdx`,
* and it is absent from a fresh checkout **by design**. What was dead was the
* unused alias, not the thing it named. An existence check reads a
* user-supplied directory as missing on CI and present on the machine of anyone
* who followed the docs; that checkout-state dependence is objectui#5968's
* subject, and this ratchet reaching empty is what removed its only instance
* here — not a fix for the class.
*
* Note the entry was NOT an `@object-ui/*` key. The finding that opened
* objectui#5168 counted 196 `@object-ui/*` entries, and a gate scoped to that
* prefix would have shipped green over it. That is why this half takes its
* scope from EVERY entry in every table, and why narrowing it to a prefix would
* silently shrink the surface.
*
* A shrink-only ratchet, not an exemption: it may not grow. Empty is its
* terminal state — every package alias entry is now guarded with no exemptions,
* and the pin below keeps it that way. A NEW dead target is meant to go red in
* the existence check above, not to be carved out.
*/
const KNOWN_MISSING_PACKAGE_ALIAS_TARGETS: readonly { config: string; specifier: string }[] = [
{ config: 'packages/runner/vite.config.ts', specifier: '@app' },
];
const KNOWN_MISSING_PACKAGE_ALIAS_TARGETS: readonly { config: string; specifier: string }[] = [];

const isCarvedOut = (entry: PackageAliasEntry): boolean =>
KNOWN_MISSING_PACKAGE_ALIAS_TARGETS.some(
Expand DownExpand Up@@ -884,7 +891,25 @@ describe('objectui#5168 — package-level vite.config.ts alias tables', () => {
}
);

it('the objectui#5168 carve-out still describes exactly the entries it was written for', () => {
it('the objectui#5168 carve-out is empty, so no package alias entry is exempt', () => {
// objectui#5380 was resolved by deleting the one carved-out line, so this
// list is empty and the existence check above now covers every entry.
//
// ⚠️ Asserted rather than left implicit. With an empty list BOTH
// expectations below are vacuous — each filters an empty list (or filters
// by `isCarvedOut`, which is false for everything) and compares [] with [],
// so neither can fail for ANY repo state. A silently vacuous pin is the
// exact trap the `toBeGreaterThanOrEqual` cases at the top of this block
// guard against, so the expectation that still bites at zero has to be
// written down: emptiness itself. This one goes red the moment the list is
// re-populated, which is the only way the two below become meaningful again.
expect(
KNOWN_MISSING_PACKAGE_ALIAS_TARGETS,
'KNOWN_MISSING_PACKAGE_ALIAS_TARGETS is a shrink-only ratchet that reached empty when ' +
'objectui#5380 landed. Re-populating it needs a card of its own — a new dead alias ' +
'target is meant to go red in the existence check above, not to be carved out.'
).toEqual([]);

const declared = KNOWN_MISSING_PACKAGE_ALIAS_TARGETS.filter((known) =>
packageAliasEntries.some((e) => e.config === known.config && e.specifier === known.specifier)
);
Expand Down
Loading