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
51 changes: 31 additions & 20 deletions packages/drivers/driver-memory/vitest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,26 +9,37 @@ export default defineConfig({
environment: 'node',
},
resolve: {
alias: {
'@objectstack/core': path.resolve(__dirname, '../../core/src/index.ts'),
alias: [
{ find: '@objectstack/core', replacement: path.resolve(__dirname, '../../core/src/index.ts') },
// [ADR-0105 D1] `resolveTenancyPosture()`, read by the #6915 tenancy guard.
'@objectstack/types': path.resolve(__dirname, '../../types/src/index.ts'),
'@objectstack/spec/api': path.resolve(__dirname, '../../spec/src/api/index.ts'),
'@objectstack/spec/contracts': path.resolve(__dirname, '../../spec/src/contracts/index.ts'),
'@objectstack/spec/data': path.resolve(__dirname, '../../spec/src/data/index.ts'),
'@objectstack/spec/kernel': path.resolve(__dirname, '../../spec/src/kernel/index.ts'),
'@objectstack/spec/system': path.resolve(__dirname, '../../spec/src/system/index.ts'),
// [ADR-0105 D1] Reached transitively via `@objectstack/types` (tenancy posture).
'@objectstack/spec/security': path.resolve(__dirname, '../../spec/src/security/index.ts'),
// [#7378] Reached transitively: `@objectstack/core` (aliased to src above)
// resolves the metadata register contract's plural→singular fold from this
// subpath (`pluralToSingular`). An alias list matches by PREFIX, so without
// this entry the bare `@objectstack/spec` alias below wins and yields the
// nonsensical `spec/src/index.ts/shared` — ENOTDIR at import time for every
// test file that transitively loads `@objectstack/core`.
'@objectstack/spec/shared': path.resolve(__dirname, '../../spec/src/shared/index.ts'),
'@objectstack/spec/qa': path.resolve(__dirname, '../../spec/src/qa/index.ts'),
'@objectstack/spec': path.resolve(__dirname, '../../spec/src/index.ts'),
},
{ find: '@objectstack/types', replacement: path.resolve(__dirname, '../../types/src/index.ts') },
// #9457: ONE anchored rule for every `@objectstack/spec` namespace, in place
// of the hand-maintained list of the subpaths this package's tests happened
// to reach. A string `find` matches by PREFIX, so with a FILE replacement the
// bare `@objectstack/spec` entry also swallowed every published namespace the
// list had not reached — `cloud`, `integration` and `studio` among them — and
// resolved it to `…/spec/src/index.ts/<ns>`: `ENOTDIR`, at run time, from a
// config that reads as correct, naming whichever module performed the import
// rather than this table.
//
// spec's export map is UNIFORM — every published namespace is
// `src/<ns>/index.ts`, with no FILE-shaped subpath of the kind
// `@objectstack/platform-objects/plugin` is — so one rule covers all of them
// and cannot go stale as tests reach new namespaces. Same shape as
// `packages/qa/downstream-contract` (PR #8129), `service-knowledge`,
// `service-settings` and `plugin-audit`; `packages/runtime` carries the pin
// over the rule (`src/spec-subpath-alias-coverage.pin.test.ts`).
//
// Kept from the enumeration because the reasons outlive it: `security` is
// reached transitively via `@objectstack/types` ([ADR-0105 D1] tenancy
// posture) and `shared` via `@objectstack/core`'s plural→singular fold
// (`pluralToSingular`, #7378). Neither is a reason to keep listing
// namespaces by hand.
{
find: /^@objectstack\/spec\/([a-z-]+)$/,
replacement: path.join(path.resolve(__dirname, '../..'), 'spec/src/$1/index.ts'),
},
{ find: /^@objectstack\/spec$/, replacement: path.resolve(__dirname, '../../spec/src/index.ts') },
],
},
});
45 changes: 30 additions & 15 deletions packages/drivers/driver-sql/vitest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,20 +9,35 @@ export default defineConfig({
environment: 'node',
},
resolve: {
alias: {
'@objectstack/spec/contracts': path.resolve(__dirname, '../../spec/src/contracts/index.ts'),
'@objectstack/spec/data': path.resolve(__dirname, '../../spec/src/data/index.ts'),
'@objectstack/spec/shared': path.resolve(__dirname, '../../spec/src/shared/index.ts'),
'@objectstack/spec/system': path.resolve(__dirname, '../../spec/src/system/index.ts'),
// [ADR-0105 D1] Reached transitively via `@objectstack/types` (tenancy posture).
'@objectstack/spec/security': path.resolve(__dirname, '../../spec/src/security/index.ts'),
// Reached transitively via `@objectstack/core` (#3777's `nextUtcCalendarDay`
// import pulls core's src barrel in, which fans out to these subpaths).
'@objectstack/spec/api': path.resolve(__dirname, '../../spec/src/api/index.ts'),
'@objectstack/spec/kernel': path.resolve(__dirname, '../../spec/src/kernel/index.ts'),
'@objectstack/spec/qa': path.resolve(__dirname, '../../spec/src/qa/index.ts'),
'@objectstack/spec': path.resolve(__dirname, '../../spec/src/index.ts'),
'@objectstack/core': path.resolve(__dirname, '../../core/src/index.ts'),
},
alias: [
// #9457: ONE anchored rule for every `@objectstack/spec` namespace, in place
// of the hand-maintained list of the subpaths this package's tests happened
// to reach. A string `find` matches by PREFIX, so with a FILE replacement the
// bare `@objectstack/spec` entry also swallowed every published namespace the
// list had not reached — `cloud`, `integration` and `studio` among them — and
// resolved it to `…/spec/src/index.ts/<ns>`: `ENOTDIR`, at run time, from a
// config that reads as correct, naming whichever module performed the import
// rather than this table.
//
// spec's export map is UNIFORM — every published namespace is
// `src/<ns>/index.ts`, with no FILE-shaped subpath of the kind
// `@objectstack/platform-objects/plugin` is — so one rule covers all of them
// and cannot go stale as tests reach new namespaces. Same shape as
// `packages/qa/downstream-contract` (PR #8129), `service-knowledge`,
// `service-settings` and `plugin-audit`; `packages/runtime` carries the pin
// over the rule (`src/spec-subpath-alias-coverage.pin.test.ts`).
//
// Kept from the enumeration because the reasons outlive it: `security` is
// reached transitively via `@objectstack/types` ([ADR-0105 D1] tenancy
// posture), and `api` / `kernel` / `qa` through `@objectstack/core`'s src
// barrel, pulled in by #3777's `nextUtcCalendarDay` import. Neither is a
// reason to keep listing namespaces by hand.
{
find: /^@objectstack\/spec\/([a-z-]+)$/,
replacement: path.join(path.resolve(__dirname, '../..'), 'spec/src/$1/index.ts'),
},
{ find: /^@objectstack\/spec$/, replacement: path.resolve(__dirname, '../../spec/src/index.ts') },
{ find: '@objectstack/core', replacement: path.resolve(__dirname, '../../core/src/index.ts') },
],
},
});
49 changes: 34 additions & 15 deletions packages/metadata/vitest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,21 +5,40 @@ import path from 'node:path';

export default defineConfig({
resolve: {
alias: {
'@objectstack/core': path.resolve(__dirname, '../core/src/index.ts'),
'@objectstack/spec/api': path.resolve(__dirname, '../spec/src/api/index.ts'),
'@objectstack/spec/cloud': path.resolve(__dirname, '../spec/src/cloud/index.ts'),
'@objectstack/spec/contracts': path.resolve(__dirname, '../spec/src/contracts/index.ts'),
'@objectstack/spec/data': path.resolve(__dirname, '../spec/src/data/index.ts'),
'@objectstack/spec/kernel': path.resolve(__dirname, '../spec/src/kernel/index.ts'),
'@objectstack/spec/system': path.resolve(__dirname, '../spec/src/system/index.ts'),
'@objectstack/spec/shared': path.resolve(__dirname, '../spec/src/shared/index.ts'),
// [ADR-0105 D1] Reached transitively via `@objectstack/types` (tenancy posture).
'@objectstack/spec/security': path.resolve(__dirname, '../spec/src/security/index.ts'),
'@objectstack/spec/qa': path.resolve(__dirname, '../spec/src/qa/index.ts'),
'@objectstack/spec': path.resolve(__dirname, '../spec/src/index.ts'),
'@objectstack/types': path.resolve(__dirname, '../types/src/index.ts'),
},
alias: [
{ find: '@objectstack/core', replacement: path.resolve(__dirname, '../core/src/index.ts') },
// #9457: ONE anchored rule for every `@objectstack/spec` namespace, in place
// of the hand-maintained list of the subpaths this package's tests happened
// to reach. A string `find` matches by PREFIX, so with a FILE replacement the
// bare `@objectstack/spec` entry also swallowed every published namespace the
// list had not reached — `cloud`, `integration` and `studio` among them — and
// resolved it to `…/spec/src/index.ts/<ns>`: `ENOTDIR`, at run time, from a
// config that reads as correct, naming whichever module performed the import
// rather than this table.
//
// spec's export map is UNIFORM — every published namespace is
// `src/<ns>/index.ts`, with no FILE-shaped subpath of the kind
// `@objectstack/platform-objects/plugin` is — so one rule covers all of them
// and cannot go stale as tests reach new namespaces. Same shape as
// `packages/qa/downstream-contract` (PR #8129), `service-knowledge`,
// `service-settings` and `plugin-audit`; `packages/runtime` carries the pin
// over the rule (`src/spec-subpath-alias-coverage.pin.test.ts`).
//
// Kept from the enumeration because the reason outlives it: `security` is
// reached transitively via `@objectstack/types` ([ADR-0105 D1] tenancy
// posture). That is not a reason to keep listing namespaces by hand.
//
// This package is also where the missing-subpath cost was first measured:
// `MetadataPlugin._parseAndRegisterArtifact` does `await import(
// '@objectstack/spec/cloud')`, which is why `packages/runtime`'s tests died
// with an `ENOTDIR` naming this plugin rather than their own alias table.
{
find: /^@objectstack\/spec\/([a-z-]+)$/,
replacement: path.join(path.resolve(__dirname, '..'), 'spec/src/$1/index.ts'),
},
{ find: /^@objectstack\/spec$/, replacement: path.resolve(__dirname, '../spec/src/index.ts') },
{ find: '@objectstack/types', replacement: path.resolve(__dirname, '../types/src/index.ts') },
],
},
test: {
globals: true,
Expand Down
34 changes: 27 additions & 7 deletions packages/plugins/embedder-openai/vitest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,12 +9,32 @@ export default defineConfig({
environment: 'node',
},
resolve: {
alias: {
'@objectstack/spec/contracts': path.resolve(__dirname, '../../spec/src/contracts/index.ts'),
'@objectstack/spec/shared': path.resolve(__dirname, '../../spec/src/shared/index.ts'),
// [ADR-0105 D1] Reached transitively via `@objectstack/types` (tenancy posture).
'@objectstack/spec/security': path.resolve(__dirname, '../../spec/src/security/index.ts'),
'@objectstack/spec': path.resolve(__dirname, '../../spec/src/index.ts'),
},
alias: [
// #9457: ONE anchored rule for every `@objectstack/spec` namespace, in place
// of the hand-maintained list of the subpaths this package's tests happened
// to reach. A string `find` matches by PREFIX, so with a FILE replacement the
// bare `@objectstack/spec` entry also swallowed every published namespace the
// list had not reached — `cloud`, `integration` and `studio` among them — and
// resolved it to `…/spec/src/index.ts/<ns>`: `ENOTDIR`, at run time, from a
// config that reads as correct, naming whichever module performed the import
// rather than this table.
//
// spec's export map is UNIFORM — every published namespace is
// `src/<ns>/index.ts`, with no FILE-shaped subpath of the kind
// `@objectstack/platform-objects/plugin` is — so one rule covers all of them
// and cannot go stale as tests reach new namespaces. Same shape as
// `packages/qa/downstream-contract` (PR #8129), `service-knowledge`,
// `service-settings` and `plugin-audit`; `packages/runtime` carries the pin
// over the rule (`src/spec-subpath-alias-coverage.pin.test.ts`).
//
// Kept from the enumeration because the reason outlives it: `security` is
// reached transitively via `@objectstack/types` ([ADR-0105 D1] tenancy
// posture). That is not a reason to keep listing namespaces by hand.
{
find: /^@objectstack\/spec\/([a-z-]+)$/,
replacement: path.join(path.resolve(__dirname, '../..'), 'spec/src/$1/index.ts'),
},
{ find: /^@objectstack\/spec$/, replacement: path.resolve(__dirname, '../../spec/src/index.ts') },
],
},
});
55 changes: 34 additions & 21 deletions packages/plugins/knowledge-memory/vitest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,26 +9,39 @@ export default defineConfig({
environment: 'node',
},
resolve: {
alias: {
'@objectstack/core': path.resolve(__dirname, '../../core/src/index.ts'),
'@objectstack/service-knowledge': path.resolve(__dirname, '../../services/service-knowledge/src/index.ts'),
'@objectstack/spec/ai': path.resolve(__dirname, '../../spec/src/ai/index.ts'),
'@objectstack/spec/api': path.resolve(__dirname, '../../spec/src/api/index.ts'),
'@objectstack/spec/contracts': path.resolve(__dirname, '../../spec/src/contracts/index.ts'),
'@objectstack/spec/data': path.resolve(__dirname, '../../spec/src/data/index.ts'),
'@objectstack/spec/kernel': path.resolve(__dirname, '../../spec/src/kernel/index.ts'),
'@objectstack/spec/system': path.resolve(__dirname, '../../spec/src/system/index.ts'),
// [ADR-0105 D1] Reached transitively via `@objectstack/types` (tenancy posture).
'@objectstack/spec/security': path.resolve(__dirname, '../../spec/src/security/index.ts'),
// [#7378] Reached transitively: `@objectstack/core` (aliased to src above)
// resolves the metadata register contract's plural→singular fold from this
// subpath (`pluralToSingular`). An alias list matches by PREFIX, so without
// this entry the bare `@objectstack/spec` alias below wins and yields the
// nonsensical `spec/src/index.ts/shared` — ENOTDIR at import time for every
// test file that transitively loads `@objectstack/core`.
'@objectstack/spec/shared': path.resolve(__dirname, '../../spec/src/shared/index.ts'),
'@objectstack/spec/qa': path.resolve(__dirname, '../../spec/src/qa/index.ts'),
'@objectstack/spec': path.resolve(__dirname, '../../spec/src/index.ts'),
},
alias: [
{ find: '@objectstack/core', replacement: path.resolve(__dirname, '../../core/src/index.ts') },
{
find: '@objectstack/service-knowledge',
replacement: path.resolve(__dirname, '../../services/service-knowledge/src/index.ts'),
},
// #9457: ONE anchored rule for every `@objectstack/spec` namespace, in place
// of the hand-maintained list of the subpaths this package's tests happened
// to reach. A string `find` matches by PREFIX, so with a FILE replacement the
// bare `@objectstack/spec` entry also swallowed every published namespace the
// list had not reached — `cloud`, `integration` and `studio` among them — and
// resolved it to `…/spec/src/index.ts/<ns>`: `ENOTDIR`, at run time, from a
// config that reads as correct, naming whichever module performed the import
// rather than this table.
//
// spec's export map is UNIFORM — every published namespace is
// `src/<ns>/index.ts`, with no FILE-shaped subpath of the kind
// `@objectstack/platform-objects/plugin` is — so one rule covers all of them
// and cannot go stale as tests reach new namespaces. Same shape as
// `packages/qa/downstream-contract` (PR #8129), `service-knowledge`,
// `service-settings` and `plugin-audit`; `packages/runtime` carries the pin
// over the rule (`src/spec-subpath-alias-coverage.pin.test.ts`).
//
// Kept from the enumeration because the reasons outlive it: `security` is
// reached transitively via `@objectstack/types` ([ADR-0105 D1] tenancy
// posture) and `shared` via `@objectstack/core`'s plural→singular fold
// (`pluralToSingular`, #7378). Neither is a reason to keep listing
// namespaces by hand.
{
find: /^@objectstack\/spec\/([a-z-]+)$/,
replacement: path.join(path.resolve(__dirname, '../..'), 'spec/src/$1/index.ts'),
},
{ find: /^@objectstack\/spec$/, replacement: path.resolve(__dirname, '../../spec/src/index.ts') },
],
},
});
Loading
Loading