@metaobjectsdev/sdk 0.23.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-context/skills/metaobjects-audit/SKILL.md +20 -7
- package/agent-context/skills/metaobjects-audit/references/capability-checklist.md +64 -18
- package/agent-context/skills/metaobjects-audit/references/csharp.md +2 -1
- package/agent-context/skills/metaobjects-audit/references/java.md +3 -2
- package/agent-context/skills/metaobjects-audit/references/kotlin.md +2 -1
- package/agent-context/skills/metaobjects-audit/references/requirements.md +3 -4
- package/agent-context/skills/metaobjects-audit/references/typescript.md +1 -1
- package/agent-context/skills/metaobjects-authoring/SKILL.md +28 -3
- package/agent-context/skills/metaobjects-authoring/references/requirements.md +49 -23
- package/agent-context/skills/metaobjects-codegen/SKILL.md +4 -3
- package/agent-context/skills/metaobjects-codegen/references/csharp.md +2 -2
- package/agent-context/skills/metaobjects-codegen/references/java.md +3 -3
- package/agent-context/skills/metaobjects-codegen/references/kotlin.md +4 -4
- package/agent-context/skills/metaobjects-codegen/references/python.md +2 -2
- package/agent-context/skills/metaobjects-codegen/references/typescript.md +3 -3
- package/agent-context/skills/metaobjects-fit-assessment/SKILL.md +4 -4
- package/agent-context/skills/metaobjects-prompts/SKILL.md +53 -32
- package/agent-context/skills/metaobjects-prompts/references/csharp.md +26 -21
- package/agent-context/skills/metaobjects-prompts/references/java.md +24 -18
- package/agent-context/skills/metaobjects-prompts/references/kotlin.md +25 -20
- package/agent-context/skills/metaobjects-prompts/references/python.md +68 -26
- package/agent-context/skills/metaobjects-prompts/references/typescript.md +29 -23
- package/agent-context/skills/metaobjects-verify/references/migration.md +1 -1
- package/agent-context/skills/metaobjects-verify/references/requirements.md +36 -22
- package/agent-context/templates/always-on.md.mustache +3 -1
- package/dist/agent-docs/body.d.ts +1 -1
- package/dist/agent-docs/body.d.ts.map +1 -1
- package/dist/agent-docs/body.js +24 -2
- package/dist/agent-docs/body.js.map +1 -1
- package/dist/collection.d.ts +71 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/collection.js +121 -0
- package/dist/collection.js.map +1 -0
- package/dist/config.d.ts +51 -21
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +76 -10
- package/dist/config.js.map +1 -1
- package/dist/discovery.d.ts +43 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +100 -0
- package/dist/discovery.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/memory.d.ts +42 -19
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +38 -95
- package/dist/memory.js.map +1 -1
- package/dist/metadata-files.d.ts +67 -0
- package/dist/metadata-files.d.ts.map +1 -0
- package/dist/metadata-files.js +155 -0
- package/dist/metadata-files.js.map +1 -0
- package/dist/records/any.d.ts +8 -8
- package/dist/records/decision.d.ts +2 -2
- package/dist/records/glossary.d.ts +4 -4
- package/dist/records/principle.d.ts +2 -2
- package/dist/scope.d.ts +16 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +75 -0
- package/dist/scope.js.map +1 -0
- package/dist/sources.d.ts +86 -0
- package/dist/sources.d.ts.map +1 -0
- package/dist/sources.js +130 -0
- package/dist/sources.js.map +1 -0
- package/package.json +2 -2
- package/src/agent-docs/body.ts +24 -2
- package/src/collection.ts +183 -0
- package/src/config.ts +80 -12
- package/src/discovery.ts +110 -0
- package/src/index.ts +26 -9
- package/src/memory.ts +65 -99
- package/src/metadata-files.ts +158 -0
- package/src/scope.ts +95 -0
- package/src/sources.ts +160 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// server/typescript/packages/sdk/src/collection.ts
|
|
2
|
+
//
|
|
3
|
+
// Phase-1 metadata-source-resolution — the single authority.
|
|
4
|
+
//
|
|
5
|
+
// `resolveCollection()` composes discovery (`discovery.ts`), config
|
|
6
|
+
// (`config.ts`), source resolution (`sources.ts`) and the scope engine
|
|
7
|
+
// (`scope.ts`) into one function that decides where a project's metadata
|
|
8
|
+
// lives. `metaobjects/` is the DEFAULT value of `sources`, never a
|
|
9
|
+
// requirement — a project that declares nothing still resolves exactly as
|
|
10
|
+
// today (`DEFAULT_SOURCES` in `sources.ts`); a project that declares
|
|
11
|
+
// `sources` can point anywhere. No other call site may assume the directory
|
|
12
|
+
// name — this is where that assumption is allowed to live, exactly once.
|
|
13
|
+
import { join, resolve } from "node:path";
|
|
14
|
+
import { ParseError, codeSource } from "@metaobjectsdev/metadata";
|
|
15
|
+
import { CONFIG_FILE, loadConfig } from "./config.js";
|
|
16
|
+
import { discoverCollectionRoot, exists, isDir } from "./discovery.js";
|
|
17
|
+
import { compileScope, matchesScope } from "./scope.js";
|
|
18
|
+
import { DEFAULT_METADATA_DIR, DEFAULT_METAOBJECTS_DIR } from "./metadata-files.js";
|
|
19
|
+
import { DEFAULT_SOURCES, orderedPathSpecs, resolveSpecPath, resolveSources, } from "./sources.js";
|
|
20
|
+
/** Narrow the zod-inferred `Config["scope"]` (whose `.optional()` fields are
|
|
21
|
+
* typed `T | undefined` even when present) down to `Scope`'s
|
|
22
|
+
* exactOptionalPropertyTypes-safe shape — a key is omitted entirely rather
|
|
23
|
+
* than assigned `undefined`. */
|
|
24
|
+
function toScope(spec) {
|
|
25
|
+
return {
|
|
26
|
+
...(spec?.include !== undefined && { include: spec.include }),
|
|
27
|
+
...(spec?.exclude !== undefined && { exclude: spec.exclude }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* THE single authority on where metadata lives. Every read path routes
|
|
32
|
+
* through this — `metaobjects/` is the DEFAULT value of `sources`, never an
|
|
33
|
+
* assumption baked into a call site.
|
|
34
|
+
*
|
|
35
|
+
* Resolution order: an explicit `opts.explicitDir` wins outright; otherwise
|
|
36
|
+
* `discoverCollectionRoot` walks up from `startDir` for the nearest directory
|
|
37
|
+
* carrying `.metaobjects/config.json` — the ONLY project marker (`discovery.ts`
|
|
38
|
+
* says why a directory that merely holds metadata is not one) — falling back to
|
|
39
|
+
* `startDir` itself when none is found. When the resolved directory carries a
|
|
40
|
+
* config, its declared `sources`/`scope`/`migrate.scope` govern. Only a
|
|
41
|
+
* genuinely ABSENT `config.json` falls through to `DEFAULT_SOURCES` — the same
|
|
42
|
+
* directory the pre-source-resolution toolchain always read; a config.json
|
|
43
|
+
* that EXISTS but fails to load (malformed JSON, schema violation) is the
|
|
44
|
+
* author's error and propagates rather than silently degrading — a source
|
|
45
|
+
* that fails to resolve must never look like one that was never declared.
|
|
46
|
+
* Throws `ERR_COLLECTION_NOT_FOUND` only when BOTH have failed: no
|
|
47
|
+
* `sources` were declared AND the default source directory does not exist
|
|
48
|
+
* either.
|
|
49
|
+
*
|
|
50
|
+
* A declared source that fails to resolve is a different, louder failure —
|
|
51
|
+
* `resolveSources` throws `ERR_SOURCE_UNRESOLVED` for that case; only the
|
|
52
|
+
* DEFAULT is allowed to be silently absent.
|
|
53
|
+
*/
|
|
54
|
+
export async function resolveCollection(startDir, opts) {
|
|
55
|
+
const explicit = opts?.explicitDir;
|
|
56
|
+
// Whether `configDir` carries a `config.json` — threaded through rather
|
|
57
|
+
// than re-`stat`'d below. On the non-explicit path, `discoverCollectionRoot`
|
|
58
|
+
// already proved it either way: it reports `hasConfig` from the same
|
|
59
|
+
// `.metaobjects/config.json` probe that decided where to stop, and reports
|
|
60
|
+
// false only after confirming that file is absent at every directory it
|
|
61
|
+
// examined, `resolve(startDir)` included. A second `stat` of the identical
|
|
62
|
+
// file would just re-prove what discovery established. The check is only
|
|
63
|
+
// load-bearing on the `explicitDir` path, where discovery never runs at all.
|
|
64
|
+
let configDir;
|
|
65
|
+
let hasConfig;
|
|
66
|
+
if (explicit !== undefined) {
|
|
67
|
+
configDir = resolve(explicit);
|
|
68
|
+
hasConfig = await exists(join(configDir, DEFAULT_METAOBJECTS_DIR, CONFIG_FILE));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
({ dir: configDir, hasConfig } = await discoverCollectionRoot(startDir));
|
|
72
|
+
}
|
|
73
|
+
let specs = DEFAULT_SOURCES;
|
|
74
|
+
let scopeSpec;
|
|
75
|
+
let migrateSpec;
|
|
76
|
+
if (hasConfig) {
|
|
77
|
+
// No try/catch here: a config.json that EXISTS but fails to load
|
|
78
|
+
// (malformed JSON, a ConfigSchema violation) propagates. Swallowing it
|
|
79
|
+
// would make a typo'd config behave identically to no config at all —
|
|
80
|
+
// silently generating from a possibly-stale `metaobjects/` with no
|
|
81
|
+
// diagnostic, which is a worse failure than the one this design exists
|
|
82
|
+
// to remove.
|
|
83
|
+
const cfg = await loadConfig(join(configDir, DEFAULT_METAOBJECTS_DIR));
|
|
84
|
+
if (cfg.sources.length > 0)
|
|
85
|
+
specs = cfg.sources;
|
|
86
|
+
scopeSpec = cfg.scope;
|
|
87
|
+
migrateSpec = cfg.migrate?.scope;
|
|
88
|
+
}
|
|
89
|
+
// Only the DEFAULT is allowed to be absent — an explicitly declared source
|
|
90
|
+
// that does not resolve is `resolveSources`'s ERR_SOURCE_UNRESOLVED, not this.
|
|
91
|
+
//
|
|
92
|
+
// This re-`stat`s a directory the non-explicit discovery walk may already
|
|
93
|
+
// have probed, and that redundancy is intentional: it exists to produce the
|
|
94
|
+
// friendlier `ERR_COLLECTION_NOT_FOUND` diagnostic below rather than the raw
|
|
95
|
+
// `ERR_SOURCE_UNRESOLVED` `resolveSources` would throw on a genuinely missing
|
|
96
|
+
// default directory. Trading that clearer error for one syscall is a bad
|
|
97
|
+
// trade. It is also load-bearing outright on the `explicitDir` path and
|
|
98
|
+
// whenever a discovered config declares no `sources`, where nothing has
|
|
99
|
+
// probed it at all.
|
|
100
|
+
if (specs === DEFAULT_SOURCES && !(await isDir(join(configDir, DEFAULT_METADATA_DIR)))) {
|
|
101
|
+
throw new ParseError(`no metadata sources declared in ${configDir} and no default "${DEFAULT_METADATA_DIR}" directory found. ` +
|
|
102
|
+
`Declare "sources" in ${DEFAULT_METAOBJECTS_DIR}/config.json, or run 'meta init' to scaffold.`, { code: "ERR_COLLECTION_NOT_FOUND", source: codeSource("resolveCollection") });
|
|
103
|
+
}
|
|
104
|
+
const sources = await resolveSources(configDir, specs);
|
|
105
|
+
const scope = compileScope(toScope(scopeSpec));
|
|
106
|
+
const migrateScope = migrateSpec === undefined ? undefined : compileScope({ include: migrateSpec });
|
|
107
|
+
return {
|
|
108
|
+
configDir,
|
|
109
|
+
files: sources.map((s) => s.file),
|
|
110
|
+
sources,
|
|
111
|
+
// Canonical (content) order, from `resolveSources`'s own ordering — so this
|
|
112
|
+
// list is a pure function of the source SET, exactly like `files`.
|
|
113
|
+
sourceRoots: [
|
|
114
|
+
...new Set(orderedPathSpecs(specs).map((spec) => resolveSpecPath(configDir, spec))),
|
|
115
|
+
],
|
|
116
|
+
inScope: (fqn) => matchesScope(fqn, scope),
|
|
117
|
+
inMigrateScope: migrateScope === undefined ? undefined : (fqn) => matchesScope(fqn, migrateScope),
|
|
118
|
+
migrateScopePatterns: migrateSpec,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,yEAAyE;AACzE,mEAAmE;AACnE,0EAA0E;AAC1E,qEAAqE;AACrE,4EAA4E;AAC5E,yEAAyE;AACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO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K,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACjC,OAAO;QACP,4EAA4E;QAC5E,mEAAmE;QACnE,WAAW,EAAE;YACX,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;SACpF;QACD,OAAO,EAAE,CAAC,GAAW,EAAW,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;QAC3D,cAAc,EACZ,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAW,EAAW,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC;QACpG,oBAAoB,EAAE,WAAW;KAClC,CAAC;AACJ,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { z } from "zod";
|
|
|
11
11
|
* `adopt-view`/`drop-identity-default` were added to `cli` without a
|
|
12
12
|
* matching update here).
|
|
13
13
|
*/
|
|
14
|
-
export declare const AllowTokenEnum: z.ZodEnum<["drop-column", "drop-table", "type-change", "drop-index", "drop-fk", "drop-check", "drop-view", "drop-view-cascade", "adopt-view", "nullable-to-not-null", "drop-identity-default"]>;
|
|
14
|
+
export declare const AllowTokenEnum: z.ZodEnum<["drop-column", "drop-table", "type-change", "drop-index", "drop-fk", "drop-check", "drop-view", "drop-view-cascade", "adopt-view", "nullable-to-not-null", "drop-identity-default", "drop-unmanaged"]>;
|
|
15
15
|
export declare const ConfigSchema: z.ZodObject<{
|
|
16
16
|
schema_version: z.ZodLiteral<1>;
|
|
17
17
|
pending_in_git: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -26,24 +26,36 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
26
26
|
drift_warn?: number | undefined;
|
|
27
27
|
}>>;
|
|
28
28
|
sources: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
29
|
-
kind: z.ZodLiteral<"path">;
|
|
30
29
|
path: z.ZodString;
|
|
31
|
-
}, "
|
|
30
|
+
}, "strict", z.ZodTypeAny, {
|
|
32
31
|
path: string;
|
|
33
|
-
kind: "path";
|
|
34
32
|
}, {
|
|
35
33
|
path: string;
|
|
36
|
-
kind: "path";
|
|
37
34
|
}>, z.ZodObject<{
|
|
38
|
-
|
|
35
|
+
resource: z.ZodString;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
resource: string;
|
|
38
|
+
}, {
|
|
39
|
+
resource: string;
|
|
40
|
+
}>, z.ZodObject<{
|
|
39
41
|
package: z.ZodString;
|
|
40
|
-
}, "
|
|
41
|
-
kind: "package";
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
42
43
|
package: string;
|
|
43
44
|
}, {
|
|
44
|
-
kind: "package";
|
|
45
45
|
package: string;
|
|
46
46
|
}>]>, "many">>;
|
|
47
|
+
/** Output filter applied across every command — see `./scope.ts`. Absent
|
|
48
|
+
* means "everything" (no filtering), matching `Scope`'s own contract. */
|
|
49
|
+
scope: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
51
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
+
}, "strict", z.ZodTypeAny, {
|
|
53
|
+
include?: string[] | undefined;
|
|
54
|
+
exclude?: string[] | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
include?: string[] | undefined;
|
|
57
|
+
exclude?: string[] | undefined;
|
|
58
|
+
}>>;
|
|
47
59
|
extract: z.ZodDefault<z.ZodObject<{
|
|
48
60
|
metaignore: z.ZodOptional<z.ZodString>;
|
|
49
61
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -57,13 +69,13 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
57
69
|
dialect: z.ZodOptional<z.ZodEnum<["sqlite", "postgres", "d1"]>>;
|
|
58
70
|
format: z.ZodOptional<z.ZodEnum<["default", "flyway"]>>;
|
|
59
71
|
onAmbiguous: z.ZodOptional<z.ZodEnum<["abort", "rename", "drop-add"]>>;
|
|
60
|
-
allow: z.ZodOptional<z.ZodArray<z.ZodEnum<["drop-column", "drop-table", "type-change", "drop-index", "drop-fk", "drop-check", "drop-view", "drop-view-cascade", "adopt-view", "nullable-to-not-null", "drop-identity-default"]>, "many">>;
|
|
72
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodEnum<["drop-column", "drop-table", "type-change", "drop-index", "drop-fk", "drop-check", "drop-view", "drop-view-cascade", "adopt-view", "nullable-to-not-null", "drop-identity-default", "drop-unmanaged"]>, "many">>;
|
|
61
73
|
d1: z.ZodOptional<z.ZodObject<{
|
|
62
74
|
binding: z.ZodOptional<z.ZodString>;
|
|
63
75
|
remote: z.ZodOptional<z.ZodBoolean>;
|
|
64
76
|
autoApply: z.ZodOptional<z.ZodBoolean>;
|
|
65
77
|
wranglerConfigPath: z.ZodOptional<z.ZodString>;
|
|
66
|
-
}, "
|
|
78
|
+
}, "strict", z.ZodTypeAny, {
|
|
67
79
|
binding?: string | undefined;
|
|
68
80
|
remote?: boolean | undefined;
|
|
69
81
|
autoApply?: boolean | undefined;
|
|
@@ -74,7 +86,8 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
74
86
|
autoApply?: boolean | undefined;
|
|
75
87
|
wranglerConfigPath?: string | undefined;
|
|
76
88
|
}>>;
|
|
77
|
-
|
|
89
|
+
scope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
90
|
+
}, "strict", z.ZodTypeAny, {
|
|
78
91
|
d1?: {
|
|
79
92
|
binding?: string | undefined;
|
|
80
93
|
remote?: boolean | undefined;
|
|
@@ -86,7 +99,8 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
86
99
|
dialect?: "sqlite" | "postgres" | "d1" | undefined;
|
|
87
100
|
format?: "default" | "flyway" | undefined;
|
|
88
101
|
onAmbiguous?: "abort" | "rename" | "drop-add" | undefined;
|
|
89
|
-
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default")[] | undefined;
|
|
102
|
+
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default" | "drop-unmanaged")[] | undefined;
|
|
103
|
+
scope?: string[] | undefined;
|
|
90
104
|
}, {
|
|
91
105
|
d1?: {
|
|
92
106
|
binding?: string | undefined;
|
|
@@ -99,9 +113,10 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
99
113
|
dialect?: "sqlite" | "postgres" | "d1" | undefined;
|
|
100
114
|
format?: "default" | "flyway" | undefined;
|
|
101
115
|
onAmbiguous?: "abort" | "rename" | "drop-add" | undefined;
|
|
102
|
-
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default")[] | undefined;
|
|
116
|
+
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default" | "drop-unmanaged")[] | undefined;
|
|
117
|
+
scope?: string[] | undefined;
|
|
103
118
|
}>>;
|
|
104
|
-
}, "
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
105
120
|
schema_version: 1;
|
|
106
121
|
pending_in_git: boolean;
|
|
107
122
|
confidence_thresholds: {
|
|
@@ -110,14 +125,18 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
110
125
|
};
|
|
111
126
|
sources: ({
|
|
112
127
|
path: string;
|
|
113
|
-
kind: "path";
|
|
114
128
|
} | {
|
|
115
|
-
|
|
129
|
+
resource: string;
|
|
130
|
+
} | {
|
|
116
131
|
package: string;
|
|
117
132
|
})[];
|
|
118
133
|
extract: {
|
|
119
134
|
metaignore?: string | undefined;
|
|
120
135
|
};
|
|
136
|
+
scope?: {
|
|
137
|
+
include?: string[] | undefined;
|
|
138
|
+
exclude?: string[] | undefined;
|
|
139
|
+
} | undefined;
|
|
121
140
|
migrate?: {
|
|
122
141
|
d1?: {
|
|
123
142
|
binding?: string | undefined;
|
|
@@ -130,10 +149,15 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
130
149
|
dialect?: "sqlite" | "postgres" | "d1" | undefined;
|
|
131
150
|
format?: "default" | "flyway" | undefined;
|
|
132
151
|
onAmbiguous?: "abort" | "rename" | "drop-add" | undefined;
|
|
133
|
-
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default")[] | undefined;
|
|
152
|
+
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default" | "drop-unmanaged")[] | undefined;
|
|
153
|
+
scope?: string[] | undefined;
|
|
134
154
|
} | undefined;
|
|
135
155
|
}, {
|
|
136
156
|
schema_version: 1;
|
|
157
|
+
scope?: {
|
|
158
|
+
include?: string[] | undefined;
|
|
159
|
+
exclude?: string[] | undefined;
|
|
160
|
+
} | undefined;
|
|
137
161
|
pending_in_git?: boolean | undefined;
|
|
138
162
|
confidence_thresholds?: {
|
|
139
163
|
pending_promote?: number | undefined;
|
|
@@ -141,9 +165,9 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
141
165
|
} | undefined;
|
|
142
166
|
sources?: ({
|
|
143
167
|
path: string;
|
|
144
|
-
kind: "path";
|
|
145
168
|
} | {
|
|
146
|
-
|
|
169
|
+
resource: string;
|
|
170
|
+
} | {
|
|
147
171
|
package: string;
|
|
148
172
|
})[] | undefined;
|
|
149
173
|
extract?: {
|
|
@@ -161,11 +185,17 @@ export declare const ConfigSchema: z.ZodObject<{
|
|
|
161
185
|
dialect?: "sqlite" | "postgres" | "d1" | undefined;
|
|
162
186
|
format?: "default" | "flyway" | undefined;
|
|
163
187
|
onAmbiguous?: "abort" | "rename" | "drop-add" | undefined;
|
|
164
|
-
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default")[] | undefined;
|
|
188
|
+
allow?: ("drop-column" | "drop-table" | "type-change" | "drop-index" | "drop-fk" | "drop-check" | "drop-view" | "drop-view-cascade" | "adopt-view" | "nullable-to-not-null" | "drop-identity-default" | "drop-unmanaged")[] | undefined;
|
|
189
|
+
scope?: string[] | undefined;
|
|
165
190
|
} | undefined;
|
|
166
191
|
}>;
|
|
167
192
|
export type Config = z.infer<typeof ConfigSchema>;
|
|
168
193
|
export declare const DEFAULT_CONFIG: Config;
|
|
194
|
+
/** `config.json`'s basename — the single owner. `discovery.ts` and
|
|
195
|
+
* `collection.ts` import this rather than each keeping their own copy of
|
|
196
|
+
* the literal (a duplication that had drifted into three separate
|
|
197
|
+
* declarations of the same string). */
|
|
198
|
+
export declare const CONFIG_FILE = "config.json";
|
|
169
199
|
export declare function loadConfig(metaRoot: string): Promise<Config>;
|
|
170
200
|
export declare function saveConfig(metaRoot: string, config: Config): Promise<void>;
|
|
171
201
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,mNAazB,CAAC;AAwFH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUvB;8EAC0E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjE,CAAC;AAEZ,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAkD,CAAC;AAEhF;;;wCAGwC;AACxC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGlE;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhF"}
|
package/dist/config.js
CHANGED
|
@@ -27,13 +27,17 @@ export const AllowTokenEnum = z.enum([
|
|
|
27
27
|
"adopt-view",
|
|
28
28
|
"nullable-to-not-null",
|
|
29
29
|
"drop-identity-default",
|
|
30
|
+
"drop-unmanaged",
|
|
30
31
|
]);
|
|
32
|
+
// .strict(), like every other object in this schema: `.partial()` alone leaves
|
|
33
|
+
// zod's default STRIP policy in place, so a misspelled key is silently deleted
|
|
34
|
+
// and the block reads as if the author never wrote it.
|
|
31
35
|
const D1Block = z.object({
|
|
32
36
|
binding: z.string(),
|
|
33
37
|
remote: z.boolean(),
|
|
34
38
|
autoApply: z.boolean(),
|
|
35
39
|
wranglerConfigPath: z.string(),
|
|
36
|
-
}).partial();
|
|
40
|
+
}).partial().strict();
|
|
37
41
|
/** #192 — migration output-format adapters; orthogonal to dialect. */
|
|
38
42
|
const MigrateFormatEnum = z.enum(["default", "flyway"]);
|
|
39
43
|
const MigrateBlock = z.object({
|
|
@@ -44,7 +48,67 @@ const MigrateBlock = z.object({
|
|
|
44
48
|
onAmbiguous: OnAmbiguousEnum,
|
|
45
49
|
allow: z.array(AllowTokenEnum),
|
|
46
50
|
d1: D1Block,
|
|
47
|
-
|
|
51
|
+
/** Restricts a `meta migrate` run to a subset of the loaded metadata, by the
|
|
52
|
+
* same package-glob pattern grammar as top-level `scope` (see `scope.ts`).
|
|
53
|
+
* Include-only — there's no `migrate.scope.exclude`, since a migration run
|
|
54
|
+
* is scoped to what it's touching, not filtered down from "everything". */
|
|
55
|
+
scope: z.array(z.string().min(1)),
|
|
56
|
+
// .strict() for the same reason as the top level and the source arms below, and
|
|
57
|
+
// with sharper teeth here: `{ migrate: { scopee: [...], dialect: "postgres" } }`
|
|
58
|
+
// used to parse to `{ dialect: "postgres" }`, so a typo'd `scope` key meant
|
|
59
|
+
// "unscoped" — silently governing every table in the database, which is the
|
|
60
|
+
// hazard `migrate.scope` exists to remove.
|
|
61
|
+
}).partial().strict();
|
|
62
|
+
/**
|
|
63
|
+
* Mirrors the hand-written `SourceSpec` union in `./sources.ts` — a
|
|
64
|
+
* declared source kind, one of `path` (resolves today), `resource`, or
|
|
65
|
+
* `package` (both reserved, throw `ERR_SOURCE_KIND_UNSUPPORTED` until a
|
|
66
|
+
* later phase). `.strict()` on every arm: this project is fail-closed on
|
|
67
|
+
* undeclared keys everywhere else (ADR-0023 makes an unregistered metadata
|
|
68
|
+
* attribute a hard error for the same reason) — a config schema that
|
|
69
|
+
* silently strips an unknown key would let `{ path: "model", pathh: "typo"
|
|
70
|
+
* }` parse clean and resolve one source instead of erroring on the typo.
|
|
71
|
+
* The pre-phase-1 `{ kind: "path", path: "..." }` shape (the dead 2-arm
|
|
72
|
+
* discriminated union this replaces) never shipped to an adopter — `meta
|
|
73
|
+
* init` has only ever scaffolded `"sources": []`, and nothing under `src/`
|
|
74
|
+
* ever read the old shape — so there is no live config to be lenient for;
|
|
75
|
+
* it only ever existed in this package's own tests, updated alongside this
|
|
76
|
+
* schema.
|
|
77
|
+
*/
|
|
78
|
+
const SourceSpecSchema = z.union([
|
|
79
|
+
z.object({ path: z.string().min(1) }).strict(),
|
|
80
|
+
z.object({ resource: z.string().min(1) }).strict(),
|
|
81
|
+
z.object({ package: z.string().min(1) }).strict(),
|
|
82
|
+
]);
|
|
83
|
+
// Compile-time parity, BOTH directions: if SourceSpecSchema and the
|
|
84
|
+
// hand-written SourceSpec (./sources.ts) ever drift, one of these two
|
|
85
|
+
// assignments stops compiling. Each direction alone catches only HALF the
|
|
86
|
+
// drift — `z.infer<...>` assignable to `SourceSpec` catches an arm added to
|
|
87
|
+
// the schema but missing from SourceSpec, while `SourceSpec` assignable to
|
|
88
|
+
// `z.infer<...>` catches the opposite: an arm added to the hand-written
|
|
89
|
+
// SourceSpec that the schema never gained. A single one-directional
|
|
90
|
+
// assignment (the prior form of this guard) let a SourceSpec-only addition
|
|
91
|
+
// compile clean — proven by deliberately breaking each direction in
|
|
92
|
+
// isolation; see the quality-pass report for both failing `tsc` outputs. A
|
|
93
|
+
// conditional type (`X extends Y ? true : never`) would silently resolve to
|
|
94
|
+
// `never` instead of erroring — this direct-assignment form fails for real.
|
|
95
|
+
const _sourceSpecParityInferToSpec = {};
|
|
96
|
+
const _sourceSpecParitySpecToInfer = {};
|
|
97
|
+
void _sourceSpecParityInferToSpec;
|
|
98
|
+
void _sourceSpecParitySpecToInfer;
|
|
99
|
+
/** Mirrors the hand-written `Scope` interface in `./scope.ts`. An absent or
|
|
100
|
+
* empty `include` means "everything" — see `matchesScope`. */
|
|
101
|
+
const ScopeSchema = z
|
|
102
|
+
.object({
|
|
103
|
+
include: z.array(z.string().min(1)).optional(),
|
|
104
|
+
exclude: z.array(z.string().min(1)).optional(),
|
|
105
|
+
})
|
|
106
|
+
.strict();
|
|
107
|
+
// .strict() at the TOP level too, not just the source-spec arms and the
|
|
108
|
+
// scope block: without it, a misspelled top-level key (e.g. "scopes" for
|
|
109
|
+
// "scope") is silently stripped by zod and the collection resolves as
|
|
110
|
+
// "everything in scope" — the exact silent fail-open .strict() on the
|
|
111
|
+
// nested arms exists to prevent, one level up.
|
|
48
112
|
export const ConfigSchema = z.object({
|
|
49
113
|
schema_version: z.literal(1),
|
|
50
114
|
pending_in_git: z.boolean().default(true),
|
|
@@ -54,21 +118,23 @@ export const ConfigSchema = z.object({
|
|
|
54
118
|
drift_warn: z.number().min(0).max(1).default(0.7),
|
|
55
119
|
})
|
|
56
120
|
.default({}),
|
|
57
|
-
sources: z
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
]))
|
|
62
|
-
.default([]),
|
|
121
|
+
sources: z.array(SourceSpecSchema).default([]),
|
|
122
|
+
/** Output filter applied across every command — see `./scope.ts`. Absent
|
|
123
|
+
* means "everything" (no filtering), matching `Scope`'s own contract. */
|
|
124
|
+
scope: ScopeSchema.optional(),
|
|
63
125
|
extract: z
|
|
64
126
|
.object({
|
|
65
127
|
metaignore: z.string().optional(),
|
|
66
128
|
})
|
|
67
129
|
.default({}),
|
|
68
130
|
migrate: MigrateBlock.optional(),
|
|
69
|
-
});
|
|
131
|
+
}).strict();
|
|
70
132
|
export const DEFAULT_CONFIG = ConfigSchema.parse({ schema_version: 1 });
|
|
71
|
-
|
|
133
|
+
/** `config.json`'s basename — the single owner. `discovery.ts` and
|
|
134
|
+
* `collection.ts` import this rather than each keeping their own copy of
|
|
135
|
+
* the literal (a duplication that had drifted into three separate
|
|
136
|
+
* declarations of the same string). */
|
|
137
|
+
export const CONFIG_FILE = "config.json";
|
|
72
138
|
export async function loadConfig(metaRoot) {
|
|
73
139
|
const raw = await readFile(join(metaRoot, CONFIG_FILE), "utf8");
|
|
74
140
|
return ConfigSchema.parse(JSON.parse(raw));
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AAEzD,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,aAAa;IACb,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,WAAW;IACX,mBAAmB;IACnB,YAAY;IACZ,sBAAsB;IACtB,uBAAuB;IACvB,gBAAgB;CACjB,CAAC,CAAC;AAEH,+EAA+E;AAC/E,+EAA+E;AAC/E,uDAAuD;AACvD,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC;AAEtB,sEAAs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AAO,CAAC,EAAE,CAAC;IAC9C;8EAC0E;IAC1E,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAClC,CAAC;SACD,OAAO,CAAC,EAAE,CAAC;IACd,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC,MAAM,EAAE,CAAC;AAIZ,MAAM,CAAC,MAAM,cAAc,GAAW,YAAY,CAAC,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,CAAC;AAEhF;;;wCAGwC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IAChE,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,MAAc;IAC/D,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,0BAA0B;IACtD,MAAM,SAAS,CACb,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,EAC3B,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EACtC,MAAM,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Exported for reuse — `collection.ts` had its own byte-identical copy
|
|
2
|
+
* (`fileExists`); one definition, imported. */
|
|
3
|
+
export declare function exists(path: string): Promise<boolean>;
|
|
4
|
+
/** `exists`, narrowed to directories — `collection.ts`'s default-source probe
|
|
5
|
+
* needs that distinction to raise its friendlier `ERR_COLLECTION_NOT_FOUND`
|
|
6
|
+
* (a plain FILE where the default source directory should be is not a
|
|
7
|
+
* metadata home). Lives here beside `exists` so there is one filesystem
|
|
8
|
+
* predicate pair in the package rather than a copy per caller. */
|
|
9
|
+
export declare function isDir(path: string): Promise<boolean>;
|
|
10
|
+
/** Where the discovery walk stopped, and what it found there. */
|
|
11
|
+
export interface DiscoveredRoot {
|
|
12
|
+
/** The project root the walk settled on. Always absolute; falls back to the
|
|
13
|
+
* resolved start directory when the walk found no marker at all. */
|
|
14
|
+
readonly dir: string;
|
|
15
|
+
/** Whether `dir` carries `.metaobjects/config.json`. False only on the
|
|
16
|
+
* no-marker fallback, where the DEFAULT sources apply. */
|
|
17
|
+
readonly hasConfig: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Walk up from `startDir` for the nearest project root — a directory holding
|
|
21
|
+
* `.metaobjects/config.json`, and nothing else (see the file header). The walk
|
|
22
|
+
* stops after examining a directory that contains `.git`, so a monorepo can
|
|
23
|
+
* never silently adopt a parent checkout's configuration.
|
|
24
|
+
*
|
|
25
|
+
* Never fails: with no config anywhere below the boundary it reports the
|
|
26
|
+
* resolved `startDir` with `hasConfig: false`, which is what
|
|
27
|
+
* `resolveCollection` turns into either the default source or
|
|
28
|
+
* `ERR_COLLECTION_NOT_FOUND`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function discoverCollectionRoot(startDir: string): Promise<DiscoveredRoot>;
|
|
31
|
+
/**
|
|
32
|
+
* The directory whose configuration governs a run started in `startDir` — the
|
|
33
|
+
* `dir` half of {@link discoverCollectionRoot}.
|
|
34
|
+
*
|
|
35
|
+
* Exists as its own export for the callers that must NOT require metadata to
|
|
36
|
+
* exist: `meta migrate apply-pending` and `--rollback` replay committed SQL and
|
|
37
|
+
* load no model at all, so they resolve their `.metaobjects/` directory through
|
|
38
|
+
* this rather than through `resolveCollection`. Sharing the walk is the point —
|
|
39
|
+
* a second "find the project root" implementation is how the migrations
|
|
40
|
+
* directory and the metadata directory come to disagree.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveConfigDir(startDir: string): Promise<string>;
|
|
43
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAkCA;gDACgD;AAChD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO3D;AAED;;;;mEAImE;AACnE,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAM1D;AAED,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B;yEACqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;+DAC2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAetF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAExE"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// server/typescript/packages/sdk/src/discovery.ts
|
|
2
|
+
//
|
|
3
|
+
// Phase-1 metadata-source-resolution — nearest-ancestor collection discovery.
|
|
4
|
+
//
|
|
5
|
+
// Walks up from a starting directory to find the nearest directory that IS a
|
|
6
|
+
// project root. This is what makes a CLI *contextual*: run it inside an app in
|
|
7
|
+
// a monorepo and it finds that app's configuration rather than the repo root's.
|
|
8
|
+
//
|
|
9
|
+
// Three properties are load-bearing.
|
|
10
|
+
//
|
|
11
|
+
// 1. **One marker.** A directory is a project root when it carries
|
|
12
|
+
// `.metaobjects/config.json`, and on no other evidence. A directory that
|
|
13
|
+
// merely *holds* metadata is not a project boundary: where metadata lives is
|
|
14
|
+
// the `sources` key's answer, and `metaobjects/` is only that key's default
|
|
15
|
+
// value. Stopping on a bare `metaobjects/` directory would put a second
|
|
16
|
+
// definition of "where metadata lives" back into the walk — the exact
|
|
17
|
+
// duplication `resolveCollection` exists to be the only instance of — and it
|
|
18
|
+
// would ignore a project whose config points its `sources` somewhere else
|
|
19
|
+
// entirely. See design §4.6.1.
|
|
20
|
+
// 2. **Nearest wins** — the walk returns on the FIRST directory carrying the
|
|
21
|
+
// marker, so a config in a subdirectory beats one in an ancestor.
|
|
22
|
+
// 3. **The walk stops at a repository boundary** (`.git`), so a monorepo
|
|
23
|
+
// checkout can never silently adopt a *parent checkout's* configuration. The
|
|
24
|
+
// marker check runs BEFORE the `.git` check within each directory —
|
|
25
|
+
// reversed, a root-level project (where `.git` also lives) would be
|
|
26
|
+
// unreachable from any subdirectory, since the boundary would stop the walk
|
|
27
|
+
// one directory too early.
|
|
28
|
+
import { stat } from "node:fs/promises";
|
|
29
|
+
import { dirname, join, resolve } from "node:path";
|
|
30
|
+
import { CONFIG_FILE } from "./config.js";
|
|
31
|
+
import { DEFAULT_METAOBJECTS_DIR } from "./metadata-files.js";
|
|
32
|
+
const GIT_DIR = ".git";
|
|
33
|
+
/** Exported for reuse — `collection.ts` had its own byte-identical copy
|
|
34
|
+
* (`fileExists`); one definition, imported. */
|
|
35
|
+
export async function exists(path) {
|
|
36
|
+
try {
|
|
37
|
+
await stat(path);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** `exists`, narrowed to directories — `collection.ts`'s default-source probe
|
|
45
|
+
* needs that distinction to raise its friendlier `ERR_COLLECTION_NOT_FOUND`
|
|
46
|
+
* (a plain FILE where the default source directory should be is not a
|
|
47
|
+
* metadata home). Lives here beside `exists` so there is one filesystem
|
|
48
|
+
* predicate pair in the package rather than a copy per caller. */
|
|
49
|
+
export async function isDir(path) {
|
|
50
|
+
try {
|
|
51
|
+
return (await stat(path)).isDirectory();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Walk up from `startDir` for the nearest project root — a directory holding
|
|
59
|
+
* `.metaobjects/config.json`, and nothing else (see the file header). The walk
|
|
60
|
+
* stops after examining a directory that contains `.git`, so a monorepo can
|
|
61
|
+
* never silently adopt a parent checkout's configuration.
|
|
62
|
+
*
|
|
63
|
+
* Never fails: with no config anywhere below the boundary it reports the
|
|
64
|
+
* resolved `startDir` with `hasConfig: false`, which is what
|
|
65
|
+
* `resolveCollection` turns into either the default source or
|
|
66
|
+
* `ERR_COLLECTION_NOT_FOUND`.
|
|
67
|
+
*/
|
|
68
|
+
export async function discoverCollectionRoot(startDir) {
|
|
69
|
+
const start = resolve(startDir);
|
|
70
|
+
let dir = start;
|
|
71
|
+
for (;;) {
|
|
72
|
+
if (await exists(join(dir, DEFAULT_METAOBJECTS_DIR, CONFIG_FILE))) {
|
|
73
|
+
return { dir, hasConfig: true };
|
|
74
|
+
}
|
|
75
|
+
// Boundary check AFTER the marker check: a repo-root project (sharing its
|
|
76
|
+
// directory with `.git`) is still findable from any subdirectory.
|
|
77
|
+
if (await exists(join(dir, GIT_DIR)))
|
|
78
|
+
break;
|
|
79
|
+
const parent = dirname(dir);
|
|
80
|
+
if (parent === dir)
|
|
81
|
+
break;
|
|
82
|
+
dir = parent;
|
|
83
|
+
}
|
|
84
|
+
return { dir: start, hasConfig: false };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The directory whose configuration governs a run started in `startDir` — the
|
|
88
|
+
* `dir` half of {@link discoverCollectionRoot}.
|
|
89
|
+
*
|
|
90
|
+
* Exists as its own export for the callers that must NOT require metadata to
|
|
91
|
+
* exist: `meta migrate apply-pending` and `--rollback` replay committed SQL and
|
|
92
|
+
* load no model at all, so they resolve their `.metaobjects/` directory through
|
|
93
|
+
* this rather than through `resolveCollection`. Sharing the walk is the point —
|
|
94
|
+
* a second "find the project root" implementation is how the migrations
|
|
95
|
+
* directory and the metadata directory come to disagree.
|
|
96
|
+
*/
|
|
97
|
+
export async function resolveConfigDir(startDir) {
|
|
98
|
+
return (await discoverCollectionRoot(startDir)).dir;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,EAAE;AACF,qCAAqC;AACrC,EAAE;AACF,mEAAmE;AACnE,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,2EAA2E;AAC3E,yEAAyE;AACzE,gFAAgF;AAChF,6EAA6E;AAC7E,kCAAkC;AAClC,6EAA6E;AAC7E,qEAAqE;AACrE,yEAAyE;AACzE,gFAAgF;AAChF,uEAAuE;AACvE,uEAAuE;AACvE,+EAA+E;AAC/E,8BAA8B;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,OAAO,GAAG,MAAM,CAAC;AAEvB;gDACgD;AAChD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;mEAImE;AACnE,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAYD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,QAAgB;IAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,SAAS,CAAC;QACR,IAAI,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC;YAClE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAClC,CAAC;QACD,0EAA0E;QAC1E,kEAAkE;QAClE,IAAI,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAAE,MAAM;QAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,OAAO,CAAC,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;AACtD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,17 @@ export { ConfigSchema, DEFAULT_CONFIG, loadConfig, saveConfig, AllowTokenEnum }
|
|
|
12
12
|
export type { Config } from "./config.js";
|
|
13
13
|
export { FORGE_TYPE_DECISION, FORGE_TYPE_PRINCIPLE, FORGE_TYPE_CONVENTION, FORGE_TYPE_GLOSSARY, FORGE_TYPE_FAILURE, FORGE_TYPES, FORGE_DECISION_SUBTYPES, FORGE_PRINCIPLE_SUBTYPES, FORGE_CONVENTION_SUBTYPES, FORGE_GLOSSARY_SUBTYPES, FORGE_FAILURE_SUBTYPES, FORGE_ATTR_CONFIDENCE, FORGE_ATTR_SOURCE, FORGE_ATTR_CAPTURED_AT, FORGE_ATTR_LAST_VALIDATED_COMMIT, FORGE_ATTR_PRIMARY_LOCATION, FORGE_ATTR_OCCURRENCES, FORGE_ATTR_RATIONALE, FORGE_ATTR_ALTERNATIVES, FORGE_ATTR_SCOPE, FORGE_ATTR_STATEMENT, FORGE_ATTR_ENFORCEMENT, FORGE_ATTR_PATTERN_DESCRIPTION, FORGE_ATTR_EXAMPLES, FORGE_ATTR_COUNTER_EXAMPLES, FORGE_ATTR_APPLIES_TO, FORGE_ATTR_TERM, FORGE_ATTR_SYNONYMS, FORGE_ATTR_DEFINITION, FORGE_ATTR_CODE_ANCHORS, FORGE_ATTR_SEE_ALSO, FORGE_ATTR_WHAT_WAS_TRIED, FORGE_ATTR_WHY_IT_FAILED, FORGE_ATTRS, registerForgeTypes, forgeTypesProvider, } from "./forge-types.js";
|
|
14
14
|
export type { ForgeType, ForgeAttr } from "./forge-types.js";
|
|
15
|
-
export { loadMemory, defaultLoadMemoryProviders
|
|
15
|
+
export { loadMemory, defaultLoadMemoryProviders } from "./memory.js";
|
|
16
16
|
export type { LoadMemoryOptions } from "./memory.js";
|
|
17
|
+
export { DEFAULT_METADATA_DIR, DEFAULT_METAOBJECTS_DIR } from "./metadata-files.js";
|
|
18
|
+
export { compileScope, matchesScope } from "./scope.js";
|
|
19
|
+
export type { Scope, CompiledScope } from "./scope.js";
|
|
20
|
+
export { resolveSources, resolveSpecPath, orderedPathSpecs, DEFAULT_SOURCES } from "./sources.js";
|
|
21
|
+
export type { SourceSpec, ResolvedSource } from "./sources.js";
|
|
22
|
+
export { discoverCollectionRoot, resolveConfigDir } from "./discovery.js";
|
|
23
|
+
export type { DiscoveredRoot } from "./discovery.js";
|
|
24
|
+
export { resolveCollection } from "./collection.js";
|
|
25
|
+
export type { Collection } from "./collection.js";
|
|
17
26
|
export { discoverWorkspace, resolveExtendsOrder, packageLabel } from "./workspace.js";
|
|
18
27
|
export type { Workspace, WorkspacePackage } from "./workspace.js";
|
|
19
28
|
export { PackageManifestSchema, readPackageManifest, resolveMetaobjectsPackage, PACKAGE_MANIFEST_FILE, } from "./package.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAA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