@metaobjectsdev/metadata 1.0.13 → 1.1.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/README.md +2 -0
- package/dist/attr-schema-validate.d.ts.map +1 -1
- package/dist/attr-schema-validate.js +9 -12
- package/dist/attr-schema-validate.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/core/attr/meta-attr-filter.d.ts.map +1 -1
- package/dist/core/attr/meta-attr-filter.js +8 -2
- package/dist/core/attr/meta-attr-filter.js.map +1 -1
- package/dist/core/attr/meta-attr.d.ts +14 -0
- package/dist/core/attr/meta-attr.d.ts.map +1 -1
- package/dist/core/attr/meta-attr.js +23 -1
- package/dist/core/attr/meta-attr.js.map +1 -1
- package/dist/core/field/shared-enum.d.ts +21 -0
- package/dist/core/field/shared-enum.d.ts.map +1 -0
- package/dist/core/field/shared-enum.js +49 -0
- package/dist/core/field/shared-enum.js.map +1 -0
- package/dist/core/identity/meta-identity.d.ts +1 -1
- package/dist/core/identity/meta-identity.d.ts.map +1 -1
- package/dist/core/identity/meta-identity.js +8 -13
- package/dist/core/identity/meta-identity.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/object/object-constants.d.ts +14 -1
- package/dist/core/object/object-constants.d.ts.map +1 -1
- package/dist/core/object/object-constants.js +18 -0
- package/dist/core/object/object-constants.js.map +1 -1
- package/dist/core/object/object-definition.embedded.d.ts.map +1 -1
- package/dist/core/object/object-definition.embedded.js +80 -0
- package/dist/core/object/object-definition.embedded.js.map +1 -1
- package/dist/core/relationship/derive-m2m-fields.d.ts +1 -1
- package/dist/core/relationship/derive-m2m-fields.d.ts.map +1 -1
- package/dist/core/relationship/derive-m2m-fields.js +15 -44
- package/dist/core/relationship/derive-m2m-fields.js.map +1 -1
- package/dist/core/relationship/find-reference.d.ts.map +1 -1
- package/dist/core/relationship/find-reference.js +4 -2
- package/dist/core/relationship/find-reference.js.map +1 -1
- package/dist/core/relationship/resolve-relationship-reference.d.ts +6 -5
- package/dist/core/relationship/resolve-relationship-reference.d.ts.map +1 -1
- package/dist/core/relationship/resolve-relationship-reference.js +9 -7
- package/dist/core/relationship/resolve-relationship-reference.js.map +1 -1
- package/dist/core/reporting/meta-dimension.d.ts +13 -0
- package/dist/core/reporting/meta-dimension.d.ts.map +1 -0
- package/dist/core/reporting/meta-dimension.js +30 -0
- package/dist/core/reporting/meta-dimension.js.map +1 -0
- package/dist/core/reporting/meta-measure.d.ts +24 -0
- package/dist/core/reporting/meta-measure.d.ts.map +1 -0
- package/dist/core/reporting/meta-measure.js +54 -0
- package/dist/core/reporting/meta-measure.js.map +1 -0
- package/dist/core/reporting/meta-segment.d.ts +6 -0
- package/dist/core/reporting/meta-segment.d.ts.map +1 -0
- package/dist/core/reporting/meta-segment.js +13 -0
- package/dist/core/reporting/meta-segment.js.map +1 -0
- package/dist/core/reporting/report-accessors.d.ts +27 -0
- package/dist/core/reporting/report-accessors.d.ts.map +1 -0
- package/dist/core/reporting/report-accessors.js +56 -0
- package/dist/core/reporting/report-accessors.js.map +1 -0
- package/dist/core/reporting/report-describe.d.ts +59 -0
- package/dist/core/reporting/report-describe.d.ts.map +1 -0
- package/dist/core/reporting/report-describe.js +182 -0
- package/dist/core/reporting/report-describe.js.map +1 -0
- package/dist/core/reporting/report-read-model.d.ts +34 -0
- package/dist/core/reporting/report-read-model.d.ts.map +1 -0
- package/dist/core/reporting/report-read-model.js +165 -0
- package/dist/core/reporting/report-read-model.js.map +1 -0
- package/dist/core/reporting/report-shape.d.ts +103 -0
- package/dist/core/reporting/report-shape.d.ts.map +1 -0
- package/dist/core/reporting/report-shape.js +398 -0
- package/dist/core/reporting/report-shape.js.map +1 -0
- package/dist/core/reporting/reporting-constants.d.ts +65 -0
- package/dist/core/reporting/reporting-constants.d.ts.map +1 -0
- package/dist/core/reporting/reporting-constants.js +84 -0
- package/dist/core/reporting/reporting-constants.js.map +1 -0
- package/dist/core/reporting/reporting-definition.embedded.d.ts +3 -0
- package/dist/core/reporting/reporting-definition.embedded.d.ts.map +1 -0
- package/dist/core/reporting/reporting-definition.embedded.js +185 -0
- package/dist/core/reporting/reporting-definition.embedded.js.map +1 -0
- package/dist/core/requirement/resolve-claim.d.ts +8 -0
- package/dist/core/requirement/resolve-claim.d.ts.map +1 -1
- package/dist/core/requirement/resolve-claim.js +21 -0
- package/dist/core/requirement/resolve-claim.js.map +1 -1
- package/dist/core/yaml-desugar.d.ts.map +1 -1
- package/dist/core/yaml-desugar.js +12 -82
- package/dist/core/yaml-desugar.js.map +1 -1
- package/dist/core-types.d.ts.map +1 -1
- package/dist/core-types.js +28 -1
- package/dist/core-types.js.map +1 -1
- package/dist/docs-ref.d.ts +19 -0
- package/dist/docs-ref.d.ts.map +1 -0
- package/dist/docs-ref.js +37 -0
- package/dist/docs-ref.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +17 -6
- package/dist/errors.js.map +1 -1
- package/dist/fmt.d.ts.map +1 -1
- package/dist/fmt.js +3 -1
- package/dist/fmt.js.map +1 -1
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/loader/declared-duplicate-fields.d.ts +19 -0
- package/dist/loader/declared-duplicate-fields.d.ts.map +1 -0
- package/dist/loader/declared-duplicate-fields.js +97 -0
- package/dist/loader/declared-duplicate-fields.js.map +1 -0
- package/dist/loader/meta-data-loader.d.ts.map +1 -1
- package/dist/loader/meta-data-loader.js +18 -1
- package/dist/loader/meta-data-loader.js.map +1 -1
- package/dist/loader/reporting-validation.d.ts +11 -0
- package/dist/loader/reporting-validation.d.ts.map +1 -0
- package/dist/loader/reporting-validation.js +883 -0
- package/dist/loader/reporting-validation.js.map +1 -0
- package/dist/loader/resolve-references.d.ts +8 -0
- package/dist/loader/resolve-references.d.ts.map +1 -0
- package/dist/loader/resolve-references.js +132 -0
- package/dist/loader/resolve-references.js.map +1 -0
- package/dist/loader/validation-passes.d.ts.map +1 -1
- package/dist/loader/validation-passes.js +14 -9
- package/dist/loader/validation-passes.js.map +1 -1
- package/dist/loader/validation-registry.d.ts.map +1 -1
- package/dist/loader/validation-registry.js +33 -10
- package/dist/loader/validation-registry.js.map +1 -1
- package/dist/metamodel-docs/index.js +3 -3
- package/dist/metamodel-docs/index.js.map +1 -1
- package/dist/metamodel-docs/render.js +4 -4
- package/dist/metamodel-docs/render.js.map +1 -1
- package/dist/naming-refs.d.ts +102 -50
- package/dist/naming-refs.d.ts.map +1 -1
- package/dist/naming-refs.js +223 -97
- package/dist/naming-refs.js.map +1 -1
- package/dist/naming.d.ts +42 -7
- package/dist/naming.d.ts.map +1 -1
- package/dist/naming.js +43 -5
- package/dist/naming.js.map +1 -1
- package/dist/object-serializer.d.ts.map +1 -1
- package/dist/object-serializer.js +6 -9
- package/dist/object-serializer.js.map +1 -1
- package/dist/parser-core.d.ts.map +1 -1
- package/dist/parser-core.js +18 -48
- package/dist/parser-core.js.map +1 -1
- package/dist/persistence/db/db-definition.embedded.js +2 -2
- package/dist/persistence/db/db-definition.embedded.js.map +1 -1
- package/dist/persistence/source/meta-source.d.ts +5 -3
- package/dist/persistence/source/meta-source.d.ts.map +1 -1
- package/dist/persistence/source/meta-source.js +8 -6
- package/dist/persistence/source/meta-source.js.map +1 -1
- package/dist/registry-manifest-exclusions.js +2 -2
- package/dist/registry-manifest-exclusions.js.map +1 -1
- package/dist/registry-manifest.d.ts +1 -1
- package/dist/registry-manifest.js +1 -1
- package/dist/release-docs.d.ts +11 -0
- package/dist/release-docs.d.ts.map +1 -0
- package/dist/release-docs.js +48 -0
- package/dist/release-docs.js.map +1 -0
- package/dist/serializer-json.d.ts +15 -1
- package/dist/serializer-json.d.ts.map +1 -1
- package/dist/serializer-json.js +55 -17
- package/dist/serializer-json.js.map +1 -1
- package/dist/shared/base-types.d.ts +7 -1
- package/dist/shared/base-types.d.ts.map +1 -1
- package/dist/shared/base-types.js +9 -0
- package/dist/shared/base-types.js.map +1 -1
- package/dist/shared/meta-data.d.ts +10 -0
- package/dist/shared/meta-data.d.ts.map +1 -1
- package/dist/shared/meta-data.js +22 -1
- package/dist/shared/meta-data.js.map +1 -1
- package/dist/shared/meta-root.d.ts +13 -1
- package/dist/shared/meta-root.d.ts.map +1 -1
- package/dist/shared/meta-root.js +19 -1
- package/dist/shared/meta-root.js.map +1 -1
- package/dist/super-resolve.d.ts +4 -1
- package/dist/super-resolve.d.ts.map +1 -1
- package/dist/super-resolve.js +44 -65
- package/dist/super-resolve.js.map +1 -1
- package/dist/vocabulary-catalog.js +2 -2
- package/dist/vocabulary-catalog.js.map +1 -1
- package/package.json +6 -1
- package/src/attr-schema-validate.ts +9 -13
- package/src/constants.ts +1 -0
- package/src/core/attr/meta-attr-filter.ts +8 -1
- package/src/core/attr/meta-attr.ts +24 -1
- package/src/core/field/shared-enum.ts +53 -0
- package/src/core/identity/meta-identity.ts +9 -12
- package/src/core/index.ts +5 -0
- package/src/core/object/object-constants.ts +19 -0
- package/src/core/object/object-definition.embedded.ts +80 -0
- package/src/core/relationship/derive-m2m-fields.ts +15 -48
- package/src/core/relationship/find-reference.ts +4 -2
- package/src/core/relationship/resolve-relationship-reference.ts +11 -9
- package/src/core/reporting/meta-dimension.ts +41 -0
- package/src/core/reporting/meta-measure.ts +75 -0
- package/src/core/reporting/meta-segment.ts +14 -0
- package/src/core/reporting/report-accessors.ts +73 -0
- package/src/core/reporting/report-describe.ts +206 -0
- package/src/core/reporting/report-read-model.ts +177 -0
- package/src/core/reporting/report-shape.ts +493 -0
- package/src/core/reporting/reporting-constants.ts +104 -0
- package/src/core/reporting/reporting-definition.embedded.ts +192 -0
- package/src/core/requirement/resolve-claim.ts +20 -0
- package/src/core/yaml-desugar.ts +9 -89
- package/src/core-types.ts +41 -0
- package/src/docs-ref.ts +41 -0
- package/src/errors.ts +17 -6
- package/src/fmt.ts +3 -1
- package/src/index.ts +72 -4
- package/src/loader/declared-duplicate-fields.ts +114 -0
- package/src/loader/meta-data-loader.ts +25 -1
- package/src/loader/reporting-validation.ts +1137 -0
- package/src/loader/resolve-references.ts +144 -0
- package/src/loader/validation-passes.ts +13 -9
- package/src/loader/validation-registry.ts +37 -9
- package/src/metamodel-docs/index.ts +3 -3
- package/src/metamodel-docs/render.ts +4 -4
- package/src/naming-refs.ts +237 -94
- package/src/naming.ts +75 -11
- package/src/object-serializer.ts +7 -9
- package/src/parser-core.ts +19 -56
- package/src/persistence/db/db-definition.embedded.ts +2 -2
- package/src/persistence/source/meta-source.ts +8 -6
- package/src/registry-manifest-exclusions.ts +2 -2
- package/src/registry-manifest.ts +1 -1
- package/src/release-docs.ts +48 -0
- package/src/serializer-json.ts +79 -12
- package/src/shared/base-types.ts +9 -0
- package/src/shared/meta-data.ts +22 -1
- package/src/shared/meta-root.ts +20 -1
- package/src/super-resolve.ts +49 -63
- package/src/vocabulary-catalog.ts +2 -2
package/dist/naming-refs.d.ts
CHANGED
|
@@ -1,69 +1,104 @@
|
|
|
1
1
|
import type { MetaData } from "./shared/meta-data.js";
|
|
2
2
|
/**
|
|
3
|
-
* The inline (`@`-prefixed) attribute names whose VALUE is a metadata
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* ADR-0042 §4 — it desugars to FQN and resolves package-local like every other
|
|
12
|
-
* object ref. `@sourceRefField` (a FK FIELD name, not an object ref) is NOT in
|
|
13
|
-
* the set.
|
|
3
|
+
* The inline (`@`-prefixed) attribute names whose VALUE is a metadata object
|
|
4
|
+
* reference (ADR-0059 R4). The structural `extends` key is handled separately (it is
|
|
5
|
+
* not `@`-prefixed). `@objectRef`/`@references`/`@through` are pure object refs;
|
|
6
|
+
* `@from`/`@of`/`@via`/`@spine` carry an entity HEAD with a dotted
|
|
7
|
+
* relationship/field tail; `@parameterRef`/`@payloadRef`/`@responseRef` name
|
|
8
|
+
* value-objects. The same set is used in every port. `@sourceRefField` (a FK FIELD
|
|
9
|
+
* name) and `@implementedBy` (which may name a template as well as an object) are
|
|
10
|
+
* NOT in the set.
|
|
14
11
|
*/
|
|
15
12
|
export declare const REF_BEARING_ATTR_NAMES: ReadonlySet<string>;
|
|
13
|
+
/** True when `raw` is a relative reference form (`::Rest` or `..::Rest`). */
|
|
14
|
+
export declare function isRelativeRef(raw: string): boolean;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* Split a ref into its owner part (the object reference) and any FR-024 dotted
|
|
17
|
+
* child tail. The `.` that marks a child can only appear in the FINAL
|
|
18
|
+
* `::`-segment (package separators never follow a child dot), so the owner ends
|
|
19
|
+
* at the first `.` AFTER the last `::`. Returns `{ owner, tail }` where `tail`
|
|
20
|
+
* includes the leading `.` (or is "" when there is no child suffix).
|
|
20
21
|
*/
|
|
21
|
-
export declare function
|
|
22
|
+
export declare function splitChildTail(raw: string): {
|
|
23
|
+
owner: string;
|
|
24
|
+
tail: string;
|
|
25
|
+
};
|
|
22
26
|
/**
|
|
23
|
-
* Expand an authored reference
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* file-default). Throws on parent-relative over-drop — the caller emits an error.
|
|
27
|
+
* Expand an authored reference against a package context, preserving any FR-024
|
|
28
|
+
* dotted child suffix. Throws on parent-relative over-drop — the caller emits an
|
|
29
|
+
* error.
|
|
27
30
|
*/
|
|
28
31
|
export declare function expandRef(raw: string, packageContext: string): string;
|
|
32
|
+
/** A parent-relative reference with more `..::` than its referrer's package has segments. */
|
|
33
|
+
export declare class RefOverDropError extends Error {
|
|
34
|
+
readonly code: "ERR_BAD_ATTR_VALUE";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The resolution keys an OWNER reference (no child tail) may bind, in the order to
|
|
38
|
+
* try them (ADR-0059 R2). Every form but bare is one exact key; bare is the
|
|
39
|
+
* referrer's own package, then root-level. Throws RefOverDropError on over-drop.
|
|
40
|
+
*/
|
|
41
|
+
export declare function ownerCandidateKeys(owner: string, referrerPkg: string): readonly string[];
|
|
29
42
|
/**
|
|
30
|
-
*
|
|
31
|
-
* declared by a node whose effective package is `referrerPkg`?
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* bare-tail fallback, so an FQN pointing at one package never binds a
|
|
35
|
-
* same-named object in another.
|
|
36
|
-
* - **bare** `ref` (no `::`) → the referrer's OWN package
|
|
37
|
-
* (`<referrerPkg>::<ref>`), else a **root-level** (empty-package) object
|
|
38
|
-
* whose resolution key IS `ref`. No cross-package bare resolution, no
|
|
39
|
-
* globally-unique scan.
|
|
40
|
-
*
|
|
41
|
-
* Objects keep a BARE `fqn()` per the FR5d cross-port contract, so the canonical
|
|
42
|
-
* FQN accessor is `resolutionKey()` (`<package | fileDefaultPackage>::<name>`) —
|
|
43
|
-
* this mirrors `super-resolve`'s `findInTree`. This is the single matcher the
|
|
44
|
-
* non-super resolvers (origin `@from`/`@of`/`@via` heads, template
|
|
45
|
-
* `@payloadRef`/`@responseRef`, source `@parameterRef`, relationship `@through`)
|
|
46
|
-
* share, so resolution behaves identically everywhere a ref resolves.
|
|
47
|
-
*
|
|
48
|
-
* `referrerPkg` defaults to `""` — the fail-closed FQN-exact-plus-root-level
|
|
49
|
-
* behavior. The LOADER always passes the real referrer package (bare refs there
|
|
50
|
-
* must resolve package-locally); downstream CODEGEN resolvers, which run on
|
|
51
|
-
* already-validated metadata whose refs are FQN, may omit it. An empty
|
|
52
|
-
* `referrerPkg` never binds a bare ref across a package boundary (fail-closed),
|
|
53
|
-
* so omission can only fail to resolve — never mis-resolve.
|
|
43
|
+
* Does root-level object `node` satisfy object reference `ref` (no child tail),
|
|
44
|
+
* declared by a node whose effective package is `referrerPkg`? True when the node's
|
|
45
|
+
* resolution key is the FIRST candidate key that any object could bind — so it
|
|
46
|
+
* agrees with `resolveObjectRef`. Never matches on a short name.
|
|
54
47
|
*/
|
|
55
|
-
export declare function refMatchesObject(node: MetaData, ref: string, referrerPkg
|
|
48
|
+
export declare function refMatchesObject(node: MetaData, ref: string, referrerPkg: string): boolean;
|
|
56
49
|
/**
|
|
57
|
-
* Resolve a metadata OBJECT reference under
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* (bare = package-local, so ambiguity is unreachable). The SINGLE resolver every
|
|
62
|
-
* object-ref site shares so the contract is uniform.
|
|
50
|
+
* Resolve a metadata OBJECT reference (no child tail) under ADR-0059 R2.
|
|
51
|
+
* `referrerPkg` is the referrer's package (R3). Returns `{ node }` on resolution,
|
|
52
|
+
* `{ error }` for a parent-relative over-drop, or `{}` when nothing matches. The
|
|
53
|
+
* single object resolver every object-ref site shares.
|
|
63
54
|
*/
|
|
64
55
|
export declare function resolveObjectRef(root: MetaData, ref: string, referrerPkg: string): {
|
|
65
56
|
node?: MetaData | undefined;
|
|
57
|
+
error?: string | undefined;
|
|
66
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Resolve a reference that may carry a dotted child tail (ADR-0059 R2): bind the
|
|
61
|
+
* owner among the root's top-level nodes (of `ownerType` when given), then walk the
|
|
62
|
+
* tail by child name. Intermediate segments must be unique among the current node's
|
|
63
|
+
* effective children; the last segment is scoped to `lastType` when given. Returns
|
|
64
|
+
* the owner as well as the target, so a caller can spell the owner and keep the tail.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveRef(root: MetaData, ref: string, referrerPkg: string, opts?: {
|
|
67
|
+
ownerType?: string;
|
|
68
|
+
lastType?: string;
|
|
69
|
+
}): {
|
|
70
|
+
node?: MetaData | undefined;
|
|
71
|
+
owner?: MetaData | undefined;
|
|
72
|
+
error?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* ADR-0059 R7 — resolve a CANONICAL reference with no referrer: strip one leading
|
|
76
|
+
* `::`, match a top-level node's resolution key exactly, then walk any dotted tail.
|
|
77
|
+
* For consumers that hold a resolved model and no referrer context. Never matches
|
|
78
|
+
* on a short name.
|
|
79
|
+
*/
|
|
80
|
+
export declare function lookupCanonical(root: MetaData, value: string, opts?: {
|
|
81
|
+
ownerType?: string;
|
|
82
|
+
lastType?: string;
|
|
83
|
+
}): MetaData | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* ADR-0059 R6 — the canonical spelling of a resolved owner, as written from a
|
|
86
|
+
* referrer in package `referrerPkg`: `pkg::Name` for a packaged target, `::Name` for
|
|
87
|
+
* a root-level target from a packaged referrer, `Name` from a root-level referrer.
|
|
88
|
+
* Every spelling resolves to the same node with or without a referrer.
|
|
89
|
+
*/
|
|
90
|
+
export declare function spellRef(target: MetaData, referrerPkg: string, tail?: string): string;
|
|
91
|
+
/** Effective package of a node: its own `package`, else its file's (ADR-0059 R10). */
|
|
92
|
+
export declare function effectivePackageOf(node: MetaData): string;
|
|
93
|
+
/** The top-level node (a direct child of the root) that physically contains `node`. */
|
|
94
|
+
export declare function topLevelNodeOf(node: MetaData): MetaData;
|
|
95
|
+
/**
|
|
96
|
+
* ADR-0059 R3 default — the package a reference attribute resolves in: the effective
|
|
97
|
+
* package of the top-level node that PHYSICALLY declares the attribute. For an
|
|
98
|
+
* attribute `node` inherits through `extends`, that is the ancestor that wrote it,
|
|
99
|
+
* so an inherited reference means what it meant where it was written.
|
|
100
|
+
*/
|
|
101
|
+
export declare function referrerPackageFor(node: MetaData, attrName: string): string;
|
|
67
102
|
/**
|
|
68
103
|
* ADR-0042 §5 — a did-you-mean suffix for an UNRESOLVED object reference: the
|
|
69
104
|
* FQNs of same-short-name objects that DO exist (typically in other packages),
|
|
@@ -72,4 +107,21 @@ export declare function resolveObjectRef(root: MetaData, ref: string, referrerPk
|
|
|
72
107
|
* suggest). Appended to the per-attr unresolved-ref error message.
|
|
73
108
|
*/
|
|
74
109
|
export declare function didYouMeanHint(root: MetaData, ref: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* The did-you-mean suffix for an UNRESOLVED `extends` ref: the same candidate list
|
|
112
|
+
* as {@link didYouMeanHint}, plus the exact spelling to write. A bare `extends`
|
|
113
|
+
* resolves in the referrer's own package (ADR-0042/0059), so a base declared in
|
|
114
|
+
* another package must be named by its FQN. Returns "" when nothing is named alike.
|
|
115
|
+
*/
|
|
116
|
+
export declare function didYouMeanSuperHint(root: MetaData, ref: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* ADR-0059 R7 — the object a reference attribute on `node` names: the owner the loader
|
|
119
|
+
* bound once (`MetaAttr.resolvedTarget`), read RESOLVING so an inherited attribute
|
|
120
|
+
* works (ADR-0039). For a dotted ref (`Week.id`, `Program.weeks`) it is the owner
|
|
121
|
+
* object, not the tail. A tree built without the loader has no recorded target, so the
|
|
122
|
+
* value is resolved here from the package of the node that declared it. Undefined when
|
|
123
|
+
* the attribute is absent, is a list, or names nothing. Consumers use this instead of
|
|
124
|
+
* comparing a reference value to a short name.
|
|
125
|
+
*/
|
|
126
|
+
export declare function refTarget(node: MetaData, attrName: string): MetaData | undefined;
|
|
75
127
|
//# sourceMappingURL=naming-refs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-refs.d.ts","sourceRoot":"","sources":["../src/naming-refs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"naming-refs.d.ts","sourceRoot":"","sources":["../src/naming-refs.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkBtD;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAcrD,CAAC;AAEH,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,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d,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,QAAQ,GAAG,SAAS,CAItB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,SAAK,GAAG,MAAM,CAIjF;AAED,sFAAsF;AACtF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEzD;AAED,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAIvD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS3E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAIvE;AAgBD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAehF"}
|
package/dist/naming-refs.js
CHANGED
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
//
|
|
1
|
+
// References: the one resolver every reference form goes through (ADR-0059).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Sources do not interpret references: YAML, canonical JSON and any future source
|
|
4
|
+
// build the tree with every reference string exactly as authored. This module
|
|
5
|
+
// gives each form its meaning, once, against the built tree:
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// `..::Rest` (one or more leading `..::`) → drop one package segment from P
|
|
16
|
-
// per `..::`, then resolve Rest
|
|
17
|
-
// (itself bare/qualified) against the
|
|
18
|
-
// reduced package. Over-drop (more
|
|
19
|
-
// `..::` than P has segments) throws.
|
|
7
|
+
// `::Rest` root-absolute — the node whose resolution key is exactly `Rest`
|
|
8
|
+
// (`::Apple` is the root-level Apple; `::a::b::C` is `a::b::C`).
|
|
9
|
+
// `..::Rest` parent-relative — drop one segment of the referrer's package per
|
|
10
|
+
// `..::`, then the exact key `<remaining>::Rest`. More `..::` than
|
|
11
|
+
// the package has segments is ERR_BAD_ATTR_VALUE.
|
|
12
|
+
// `pkg::Name` exact.
|
|
13
|
+
// `Name` the referrer's own package (`<referrerPkg>::Name`), else the
|
|
14
|
+
// root-level `Name` (ADR-0042 §2). Never another package.
|
|
20
15
|
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// the
|
|
16
|
+
// No form falls back to another: `::Apple` never binds a local `acme::Apple`.
|
|
17
|
+
// A FR-024 dotted child tail (`Owner.child.grand`) starts at the first `.` after the
|
|
18
|
+
// last `::`; only the owner part is resolved by form, and the tail is kept as written.
|
|
24
19
|
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
20
|
+
// `spellRef` is the inverse: the one canonical spelling of a resolved target that
|
|
21
|
+
// resolves to the same node with or without a referrer. The `resolveReferences`
|
|
22
|
+
// loader pass rewrites every reference to it, so consumers read canonical values.
|
|
28
23
|
import { PACKAGE_SEPARATOR, PACKAGE_PARENT, CHILD_REF_SEPARATOR } from "./shared/structural.js";
|
|
29
24
|
import { TYPE_OBJECT } from "./shared/base-types.js";
|
|
30
25
|
import { RELATIONSHIP_ATTR_OBJECT_REF, RELATIONSHIP_ATTR_THROUGH } from "./core/relationship/relationship-constants.js";
|
|
@@ -32,20 +27,18 @@ import { FIELD_ATTR_OBJECT_REF } from "./core/field/field-constants.js";
|
|
|
32
27
|
import { IDENTITY_REFERENCE_ATTR_REFERENCES } from "./core/identity/identity-constants.js";
|
|
33
28
|
import { ORIGIN_PASSTHROUGH_ATTR_FROM, ORIGIN_PASSTHROUGH_ATTR_VIA, ORIGIN_AGGREGATE_ATTR_OF, ORIGIN_AGGREGATE_ATTR_VIA, } from "./persistence/origin/origin-constants.js";
|
|
34
29
|
import { SOURCE_ATTR_PARAMETER_REF } from "./persistence/source/source-constants.js";
|
|
30
|
+
import { OBJECT_REPORT_ATTR_FROM, OBJECT_REPORT_ATTR_SPINE } from "./core/object/object-constants.js";
|
|
35
31
|
import { TEMPLATE_ATTR_PAYLOAD_REF, TEMPLATE_ATTR_RESPONSE_REF } from "./template/template-constants.js";
|
|
36
32
|
const PARENT_PREFIX = PACKAGE_PARENT + PACKAGE_SEPARATOR; // "..::"
|
|
37
33
|
/**
|
|
38
|
-
* The inline (`@`-prefixed) attribute names whose VALUE is a metadata
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* ADR-0042 §4 — it desugars to FQN and resolves package-local like every other
|
|
47
|
-
* object ref. `@sourceRefField` (a FK FIELD name, not an object ref) is NOT in
|
|
48
|
-
* the set.
|
|
34
|
+
* The inline (`@`-prefixed) attribute names whose VALUE is a metadata object
|
|
35
|
+
* reference (ADR-0059 R4). The structural `extends` key is handled separately (it is
|
|
36
|
+
* not `@`-prefixed). `@objectRef`/`@references`/`@through` are pure object refs;
|
|
37
|
+
* `@from`/`@of`/`@via`/`@spine` carry an entity HEAD with a dotted
|
|
38
|
+
* relationship/field tail; `@parameterRef`/`@payloadRef`/`@responseRef` name
|
|
39
|
+
* value-objects. The same set is used in every port. `@sourceRefField` (a FK FIELD
|
|
40
|
+
* name) and `@implementedBy` (which may name a template as well as an object) are
|
|
41
|
+
* NOT in the set.
|
|
49
42
|
*/
|
|
50
43
|
export const REF_BEARING_ATTR_NAMES = new Set([
|
|
51
44
|
RELATIONSHIP_ATTR_OBJECT_REF, // = FIELD_ATTR_OBJECT_REF (same spelling "objectRef")
|
|
@@ -59,12 +52,10 @@ export const REF_BEARING_ATTR_NAMES = new Set([
|
|
|
59
52
|
SOURCE_ATTR_PARAMETER_REF,
|
|
60
53
|
TEMPLATE_ATTR_PAYLOAD_REF,
|
|
61
54
|
TEMPLATE_ATTR_RESPONSE_REF,
|
|
55
|
+
OBJECT_REPORT_ATTR_FROM, // = ORIGIN_PASSTHROUGH_ATTR_FROM ("from")
|
|
56
|
+
OBJECT_REPORT_ATTR_SPINE,
|
|
62
57
|
]);
|
|
63
|
-
/**
|
|
64
|
-
* True when `raw` is a relative reference form (`::Rest` or `..::Rest`) that the
|
|
65
|
-
* YAML desugar must expand before canonical JSON. Canonical JSON must be FQN; a
|
|
66
|
-
* relative ref surviving into it is `ERR_RELATIVE_REF_IN_CANONICAL`.
|
|
67
|
-
*/
|
|
58
|
+
/** True when `raw` is a relative reference form (`::Rest` or `..::Rest`). */
|
|
68
59
|
export function isRelativeRef(raw) {
|
|
69
60
|
return raw.startsWith(PACKAGE_SEPARATOR) || raw.startsWith(PARENT_PREFIX);
|
|
70
61
|
}
|
|
@@ -75,7 +66,7 @@ export function isRelativeRef(raw) {
|
|
|
75
66
|
* at the first `.` AFTER the last `::`. Returns `{ owner, tail }` where `tail`
|
|
76
67
|
* includes the leading `.` (or is "" when there is no child suffix).
|
|
77
68
|
*/
|
|
78
|
-
function splitChildTail(raw) {
|
|
69
|
+
export function splitChildTail(raw) {
|
|
79
70
|
const lastSep = raw.lastIndexOf(PACKAGE_SEPARATOR);
|
|
80
71
|
const segStart = lastSep === -1 ? 0 : lastSep + PACKAGE_SEPARATOR.length;
|
|
81
72
|
const dotInSeg = raw.indexOf(CHILD_REF_SEPARATOR, segStart);
|
|
@@ -84,8 +75,11 @@ function splitChildTail(raw) {
|
|
|
84
75
|
return { owner: raw.slice(0, dotInSeg), tail: raw.slice(dotInSeg) };
|
|
85
76
|
}
|
|
86
77
|
/**
|
|
87
|
-
* Expand an authored reference's OWNER part (no child tail)
|
|
88
|
-
*
|
|
78
|
+
* Expand an authored reference's OWNER part (no child tail) against a package
|
|
79
|
+
* context: `::Rest` → `Rest`, `..::Rest` → the reduced package `::Rest`,
|
|
80
|
+
* `pkg::Name` unchanged, bare `Name` → `<P>::Name`. Throws on parent-relative
|
|
81
|
+
* over-drop. The resolver uses it for the two relative forms only; a bare name is
|
|
82
|
+
* resolved own-package-then-root (see `ownerCandidateKeys`).
|
|
89
83
|
*/
|
|
90
84
|
function expandOwner(owner, packageContext) {
|
|
91
85
|
// root-absolute: leading "::" → strip; the remainder is absolute from root.
|
|
@@ -119,70 +113,158 @@ function expandOwner(owner, packageContext) {
|
|
|
119
113
|
return packageContext !== "" ? `${packageContext}${PACKAGE_SEPARATOR}${owner}` : owner;
|
|
120
114
|
}
|
|
121
115
|
/**
|
|
122
|
-
* Expand an authored reference
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* file-default). Throws on parent-relative over-drop — the caller emits an error.
|
|
116
|
+
* Expand an authored reference against a package context, preserving any FR-024
|
|
117
|
+
* dotted child suffix. Throws on parent-relative over-drop — the caller emits an
|
|
118
|
+
* error.
|
|
126
119
|
*/
|
|
127
120
|
export function expandRef(raw, packageContext) {
|
|
128
121
|
const { owner, tail } = splitChildTail(raw);
|
|
129
122
|
return expandOwner(owner, packageContext) + tail;
|
|
130
123
|
}
|
|
124
|
+
/** A parent-relative reference with more `..::` than its referrer's package has segments. */
|
|
125
|
+
export class RefOverDropError extends Error {
|
|
126
|
+
code = "ERR_BAD_ATTR_VALUE";
|
|
127
|
+
}
|
|
131
128
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* package-
|
|
135
|
-
* - **FQN** `ref` (contains `::`) → EXACT match on `resolutionKey()`. No
|
|
136
|
-
* bare-tail fallback, so an FQN pointing at one package never binds a
|
|
137
|
-
* same-named object in another.
|
|
138
|
-
* - **bare** `ref` (no `::`) → the referrer's OWN package
|
|
139
|
-
* (`<referrerPkg>::<ref>`), else a **root-level** (empty-package) object
|
|
140
|
-
* whose resolution key IS `ref`. No cross-package bare resolution, no
|
|
141
|
-
* globally-unique scan.
|
|
142
|
-
*
|
|
143
|
-
* Objects keep a BARE `fqn()` per the FR5d cross-port contract, so the canonical
|
|
144
|
-
* FQN accessor is `resolutionKey()` (`<package | fileDefaultPackage>::<name>`) —
|
|
145
|
-
* this mirrors `super-resolve`'s `findInTree`. This is the single matcher the
|
|
146
|
-
* non-super resolvers (origin `@from`/`@of`/`@via` heads, template
|
|
147
|
-
* `@payloadRef`/`@responseRef`, source `@parameterRef`, relationship `@through`)
|
|
148
|
-
* share, so resolution behaves identically everywhere a ref resolves.
|
|
149
|
-
*
|
|
150
|
-
* `referrerPkg` defaults to `""` — the fail-closed FQN-exact-plus-root-level
|
|
151
|
-
* behavior. The LOADER always passes the real referrer package (bare refs there
|
|
152
|
-
* must resolve package-locally); downstream CODEGEN resolvers, which run on
|
|
153
|
-
* already-validated metadata whose refs are FQN, may omit it. An empty
|
|
154
|
-
* `referrerPkg` never binds a bare ref across a package boundary (fail-closed),
|
|
155
|
-
* so omission can only fail to resolve — never mis-resolve.
|
|
129
|
+
* The resolution keys an OWNER reference (no child tail) may bind, in the order to
|
|
130
|
+
* try them (ADR-0059 R2). Every form but bare is one exact key; bare is the
|
|
131
|
+
* referrer's own package, then root-level. Throws RefOverDropError on over-drop.
|
|
156
132
|
*/
|
|
157
|
-
export function
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
133
|
+
export function ownerCandidateKeys(owner, referrerPkg) {
|
|
134
|
+
if (owner.startsWith(PACKAGE_SEPARATOR))
|
|
135
|
+
return [owner.slice(PACKAGE_SEPARATOR.length)];
|
|
136
|
+
if (owner.startsWith(PARENT_PREFIX)) {
|
|
137
|
+
try {
|
|
138
|
+
return [expandOwner(owner, referrerPkg)];
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
throw new RefOverDropError(err.message);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (owner.includes(PACKAGE_SEPARATOR))
|
|
145
|
+
return [owner];
|
|
146
|
+
return referrerPkg !== "" ? [`${referrerPkg}${PACKAGE_SEPARATOR}${owner}`, owner] : [owner];
|
|
164
147
|
}
|
|
165
148
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
|
|
171
|
-
|
|
149
|
+
* Does root-level object `node` satisfy object reference `ref` (no child tail),
|
|
150
|
+
* declared by a node whose effective package is `referrerPkg`? True when the node's
|
|
151
|
+
* resolution key is the FIRST candidate key that any object could bind — so it
|
|
152
|
+
* agrees with `resolveObjectRef`. Never matches on a short name.
|
|
153
|
+
*/
|
|
154
|
+
export function refMatchesObject(node, ref, referrerPkg) {
|
|
155
|
+
const resolved = resolveObjectRef(node.parent ?? node, ref, referrerPkg).node;
|
|
156
|
+
if (resolved !== undefined)
|
|
157
|
+
return resolved === node;
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
/** The root's direct children of `type` (ADR-0039: root has no super). */
|
|
161
|
+
function topLevelOfType(root, type) {
|
|
162
|
+
const all = root.children();
|
|
163
|
+
return type === undefined ? all : all.filter((c) => c.type === type);
|
|
164
|
+
}
|
|
165
|
+
/** Bind an owner reference among `candidates` by exact resolution key (R2). */
|
|
166
|
+
function bindOwner(candidates, owner, referrerPkg) {
|
|
167
|
+
let keys;
|
|
168
|
+
try {
|
|
169
|
+
keys = ownerCandidateKeys(owner, referrerPkg);
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
return { error: err.message };
|
|
173
|
+
}
|
|
174
|
+
for (const key of keys) {
|
|
175
|
+
const node = candidates.find((c) => c.resolutionKey() === key);
|
|
176
|
+
if (node !== undefined)
|
|
177
|
+
return { node };
|
|
178
|
+
}
|
|
179
|
+
return {};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Resolve a metadata OBJECT reference (no child tail) under ADR-0059 R2.
|
|
183
|
+
* `referrerPkg` is the referrer's package (R3). Returns `{ node }` on resolution,
|
|
184
|
+
* `{ error }` for a parent-relative over-drop, or `{}` when nothing matches. The
|
|
185
|
+
* single object resolver every object-ref site shares.
|
|
172
186
|
*/
|
|
173
187
|
export function resolveObjectRef(root, ref, referrerPkg) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
188
|
+
return bindOwner(topLevelOfType(root, TYPE_OBJECT), ref, referrerPkg);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Resolve a reference that may carry a dotted child tail (ADR-0059 R2): bind the
|
|
192
|
+
* owner among the root's top-level nodes (of `ownerType` when given), then walk the
|
|
193
|
+
* tail by child name. Intermediate segments must be unique among the current node's
|
|
194
|
+
* effective children; the last segment is scoped to `lastType` when given. Returns
|
|
195
|
+
* the owner as well as the target, so a caller can spell the owner and keep the tail.
|
|
196
|
+
*/
|
|
197
|
+
export function resolveRef(root, ref, referrerPkg, opts) {
|
|
198
|
+
const { owner, tail } = splitChildTail(ref);
|
|
199
|
+
const bound = bindOwner(topLevelOfType(root, opts?.ownerType), owner, referrerPkg);
|
|
200
|
+
if (bound.node === undefined)
|
|
201
|
+
return bound;
|
|
202
|
+
if (tail === "")
|
|
203
|
+
return { node: bound.node, owner: bound.node };
|
|
204
|
+
const path = tail.slice(CHILD_REF_SEPARATOR.length).split(CHILD_REF_SEPARATOR);
|
|
205
|
+
if (path.some((p) => p === ""))
|
|
206
|
+
return {};
|
|
207
|
+
let current = bound.node;
|
|
208
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
209
|
+
const matches = current.children().filter((c) => c.name === path[i]);
|
|
210
|
+
if (matches.length !== 1)
|
|
211
|
+
return { owner: bound.node };
|
|
212
|
+
current = matches[0];
|
|
213
|
+
}
|
|
214
|
+
const last = path[path.length - 1];
|
|
215
|
+
const target = current
|
|
216
|
+
.children()
|
|
217
|
+
.find((c) => c.name === last && (opts?.lastType === undefined || c.type === opts.lastType));
|
|
218
|
+
return { node: target, owner: bound.node };
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* ADR-0059 R7 — resolve a CANONICAL reference with no referrer: strip one leading
|
|
222
|
+
* `::`, match a top-level node's resolution key exactly, then walk any dotted tail.
|
|
223
|
+
* For consumers that hold a resolved model and no referrer context. Never matches
|
|
224
|
+
* on a short name.
|
|
225
|
+
*/
|
|
226
|
+
export function lookupCanonical(root, value, opts) {
|
|
227
|
+
const { owner, tail } = splitChildTail(value);
|
|
228
|
+
const exact = owner.startsWith(PACKAGE_SEPARATOR) ? owner : `${PACKAGE_SEPARATOR}${owner}`;
|
|
229
|
+
return resolveRef(root, exact + tail, "", opts).node;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* ADR-0059 R6 — the canonical spelling of a resolved owner, as written from a
|
|
233
|
+
* referrer in package `referrerPkg`: `pkg::Name` for a packaged target, `::Name` for
|
|
234
|
+
* a root-level target from a packaged referrer, `Name` from a root-level referrer.
|
|
235
|
+
* Every spelling resolves to the same node with or without a referrer.
|
|
236
|
+
*/
|
|
237
|
+
export function spellRef(target, referrerPkg, tail = "") {
|
|
238
|
+
const key = target.resolutionKey();
|
|
239
|
+
const rootLevel = !key.includes(PACKAGE_SEPARATOR);
|
|
240
|
+
return (rootLevel && referrerPkg !== "" ? `${PACKAGE_SEPARATOR}${key}` : key) + tail;
|
|
241
|
+
}
|
|
242
|
+
/** Effective package of a node: its own `package`, else its file's (ADR-0059 R10). */
|
|
243
|
+
export function effectivePackageOf(node) {
|
|
244
|
+
return node.package ?? node.fileDefaultPackage ?? "";
|
|
245
|
+
}
|
|
246
|
+
/** The top-level node (a direct child of the root) that physically contains `node`. */
|
|
247
|
+
export function topLevelNodeOf(node) {
|
|
248
|
+
let current = node;
|
|
249
|
+
while (current.parent !== undefined && current.parent.parent !== undefined)
|
|
250
|
+
current = current.parent;
|
|
251
|
+
return current;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* ADR-0059 R3 default — the package a reference attribute resolves in: the effective
|
|
255
|
+
* package of the top-level node that PHYSICALLY declares the attribute. For an
|
|
256
|
+
* attribute `node` inherits through `extends`, that is the ancestor that wrote it,
|
|
257
|
+
* so an inherited reference means what it meant where it was written.
|
|
258
|
+
*/
|
|
259
|
+
export function referrerPackageFor(node, attrName) {
|
|
260
|
+
let declarer = node;
|
|
261
|
+
const seen = new Set();
|
|
262
|
+
// ADR-0039: own — locating the layer that physically declares the attr.
|
|
263
|
+
while (declarer !== undefined && !declarer.ownHasAttr(attrName) && !seen.has(declarer)) {
|
|
264
|
+
seen.add(declarer);
|
|
265
|
+
declarer = declarer.superResolved;
|
|
177
266
|
}
|
|
178
|
-
|
|
179
|
-
// object — mirroring the loader symbol table's `byKey.get(localKey) ?? get(ref)`
|
|
180
|
-
// so both resolvers agree when a root-level object shares the bare name.
|
|
181
|
-
const localKey = referrerPkg !== "" ? `${referrerPkg}${PACKAGE_SEPARATOR}${ref}` : ref;
|
|
182
|
-
const own = objects.find((c) => c.resolutionKey() === localKey);
|
|
183
|
-
if (own !== undefined)
|
|
184
|
-
return { node: own };
|
|
185
|
-
return { node: localKey !== ref ? objects.find((c) => c.resolutionKey() === ref) : undefined };
|
|
267
|
+
return effectivePackageOf(topLevelNodeOf(declarer ?? node));
|
|
186
268
|
}
|
|
187
269
|
/**
|
|
188
270
|
* ADR-0042 §5 — a did-you-mean suffix for an UNRESOLVED object reference: the
|
|
@@ -192,6 +274,24 @@ export function resolveObjectRef(root, ref, referrerPkg) {
|
|
|
192
274
|
* suggest). Appended to the per-attr unresolved-ref error message.
|
|
193
275
|
*/
|
|
194
276
|
export function didYouMeanHint(root, ref) {
|
|
277
|
+
const found = sameNamedObjects(root, ref);
|
|
278
|
+
if (found === undefined)
|
|
279
|
+
return "";
|
|
280
|
+
return ` An object named "${found.shortName}" exists in: ${found.candidates.join(", ")}. Qualify it with its package (FQN).`;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* The did-you-mean suffix for an UNRESOLVED `extends` ref: the same candidate list
|
|
284
|
+
* as {@link didYouMeanHint}, plus the exact spelling to write. A bare `extends`
|
|
285
|
+
* resolves in the referrer's own package (ADR-0042/0059), so a base declared in
|
|
286
|
+
* another package must be named by its FQN. Returns "" when nothing is named alike.
|
|
287
|
+
*/
|
|
288
|
+
export function didYouMeanSuperHint(root, ref) {
|
|
289
|
+
const found = sameNamedObjects(root, ref);
|
|
290
|
+
if (found === undefined)
|
|
291
|
+
return "";
|
|
292
|
+
return ` An object named "${found.shortName}" exists in: ${found.candidates.join(", ")}. Qualify it with its package (FQN): write extends: "${found.candidates[0]}".`;
|
|
293
|
+
}
|
|
294
|
+
function sameNamedObjects(root, ref) {
|
|
195
295
|
const { owner } = splitChildTail(ref);
|
|
196
296
|
const sep = owner.lastIndexOf(PACKAGE_SEPARATOR);
|
|
197
297
|
const shortName = sep === -1 ? owner : owner.slice(sep + PACKAGE_SEPARATOR.length);
|
|
@@ -199,8 +299,34 @@ export function didYouMeanHint(root, ref) {
|
|
|
199
299
|
.children()
|
|
200
300
|
.filter((c) => c.type === TYPE_OBJECT && c.name === shortName)
|
|
201
301
|
.map((c) => c.resolutionKey());
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
302
|
+
return candidates.length === 0 ? undefined : { shortName, candidates };
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* ADR-0059 R7 — the object a reference attribute on `node` names: the owner the loader
|
|
306
|
+
* bound once (`MetaAttr.resolvedTarget`), read RESOLVING so an inherited attribute
|
|
307
|
+
* works (ADR-0039). For a dotted ref (`Week.id`, `Program.weeks`) it is the owner
|
|
308
|
+
* object, not the tail. A tree built without the loader has no recorded target, so the
|
|
309
|
+
* value is resolved here from the package of the node that declared it. Undefined when
|
|
310
|
+
* the attribute is absent, is a list, or names nothing. Consumers use this instead of
|
|
311
|
+
* comparing a reference value to a short name.
|
|
312
|
+
*/
|
|
313
|
+
export function refTarget(node, attrName) {
|
|
314
|
+
const seen = new Set();
|
|
315
|
+
for (let n = node; n !== undefined && !seen.has(n); n = n.superResolved) {
|
|
316
|
+
seen.add(n);
|
|
317
|
+
// ADR-0039: own — locating the layer that declares the attr, walking the super chain.
|
|
318
|
+
const attr = n.ownMetaAttr(attrName);
|
|
319
|
+
if (attr === undefined)
|
|
320
|
+
continue;
|
|
321
|
+
const recorded = attr.resolvedTarget;
|
|
322
|
+
if (recorded !== undefined)
|
|
323
|
+
return Array.isArray(recorded) ? undefined : recorded;
|
|
324
|
+
const value = attr.value;
|
|
325
|
+
if (typeof value !== "string" || value === "")
|
|
326
|
+
return undefined;
|
|
327
|
+
const { owner } = splitChildTail(value);
|
|
328
|
+
return resolveObjectRef(node.root(), owner, effectivePackageOf(topLevelNodeOf(n))).node;
|
|
329
|
+
}
|
|
330
|
+
return undefined;
|
|
205
331
|
}
|
|
206
332
|
//# sourceMappingURL=naming-refs.js.map
|
package/dist/naming-refs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-refs.js","sourceRoot":"","sources":["../src/naming-refs.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"naming-refs.js","sourceRoot":"","sources":["../src/naming-refs.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,kFAAkF;AAClF,8EAA8E;AAC9E,6DAA6D;AAC7D,EAAE;AACF,kFAAkF;AAClF,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,kEAAkE;AAClE,yBAAyB;AACzB,+EAA+E;AAC/E,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,qFAAqF;AACrF,uFAAuF;AACvF,EAAE;AACF,kFAAkF;AAClF,gFAAgF;AAChF,kFAAkF;AAGlF,OAAO,EAA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