Skip to content

Commit 5ac6ed0

Browse files
committed
test: lint reads metadata-core from source; the rehearsal pays the metadata load at collection
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2dM9PvPPB9BMVdhf2R
1 parent b358e88 commit 5ac6ed0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎packages/lint/vitest.config.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

3-
// This config exists for exactly two settings; everything else stays on
3+
// This config exists for exactly three settings; everything else stays on
44
// vitest's defaults, deliberately — a key added here re-specifies behaviour
55
// for every test file in the package (packages/cli/vitest.config.ts's header
66
// records the incident that taught that). Both settings are package-wide on
77
// purpose: each removes a mechanism every file here is exposed to, rather
88
// than tuning one file.
99
import { defineConfig } from 'vitest/config';
10+
import path from 'path';
1011

1112
export default defineConfig({
13+
// `@objectstack/metadata-core` is read from source, never its dist/, so a
14+
// unit test here is a verdict about the checkout
15+
// (scripts/check-test-source-alias.mjs). It is the one workspace package
16+
// lint's source imports that is not spec: `appOf`, which the customization
17+
// namespace advisory asks. Anchored, so it cannot swallow a subpath.
18+
resolve: {
19+
alias: [
20+
{ find: /^@objectstack\/metadata-core$/, replacement: path.resolve(__dirname, '../metadata-core/src/index.ts') },
21+
],
22+
},
1223
test: {
1324
// A late console.* must not redden a green suite (#10374): vitest's worker
1425
// forwards console output over RPC and discards the promise, and a write

‎packages/runtime/src/domains/meta-object-extension-item.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protoco
3636
import { SysMetadata, SysMetadataHistoryObject, SysMetadataAuditObject } from '@objectstack/platform-objects/metadata';
3737
import { ObjectExtensionSchema } from '@objectstack/spec/data';
3838
import { HttpDispatcher } from '../http-dispatcher.js';
39+
// The [#29594] rehearsal boots the real dispatcher, whose package door reaches
40+
// `import('@objectstack/metadata')` in standalone-stack.ts; pay that load
41+
// during collection, never inside a clocked case (check:test-source-alias).
42+
import '@objectstack/metadata';
3943

4044
let home: string;
4145
let priorHome: string | undefined;

0 commit comments

Comments
 (0)