@dsillman2000/yaml-reference-ts 1.3.5 → 1.4.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 CHANGED
@@ -40,6 +40,14 @@ database: !reference
40
40
 
41
41
  # Inline mapping syntax
42
42
  settings: !reference {path: ./settings/production.yaml}
43
+
44
+ # Extract a specific anchor from the referenced file
45
+ db_host: !reference {path: ./config/database.yaml, anchor: host}
46
+
47
+ # Block style with anchor
48
+ db_config: !reference
49
+ path: ./config/database.yaml
50
+ anchor: cfg
43
51
  ```
44
52
 
45
53
  ### Multiple File Reference
@@ -51,6 +59,9 @@ configs: !reference-all
51
59
 
52
60
  # Inline mapping syntax
53
61
  files: !reference-all {glob: ./data/*.yaml}
62
+
63
+ # Extract a specific anchor from each matched file
64
+ ports: !reference-all {glob: ./services/*.yaml, anchor: port}
54
65
  ```
55
66
 
56
67
  ### Sequence Flattening
@@ -84,7 +95,7 @@ merged: !merge
84
95
  - {override: true}
85
96
  ```
86
97
 
87
- **Note**: For `!reference` and `!reference-all` tags, only mapping syntax is supported. Be sure to conform to the API (`!reference {path: <path>}` or `!reference-all {glob: <glob>}`). For `!flatten` and `!merge` tags, only sequence syntax is supported.
98
+ **Note**: For `!reference` and `!reference-all` tags, only mapping syntax is supported. Be sure to conform to the API (`!reference {path: <path>, anchor: <anchor>}` or `!reference-all {glob: <glob>, anchor: <anchor>}`, where `anchor` is optional). For `!flatten` and `!merge` tags, only sequence syntax is supported.
88
99
 
89
100
  **Deterministic Ordering**: The `!reference-all` tag resolves files in alphabetical order to ensure consistent, predictable results across different systems and runs.
90
101
 
@@ -110,24 +121,26 @@ async function loadConfig() {
110
121
  #### `loadYamlWithReferences(filePath: string, allowPaths?: string[]): Promise<any>`
111
122
  Loads a YAML file and resolves all `!reference`, `!reference-all`, `!flatten`, and `!merge` tags, returning the fully resolved object. The optional `allowPaths` parameter restricts which directories can be referenced (see Path Restrictions section).
112
123
 
113
- #### `parseYamlWithReferences(content: string, filePath: string): Promise<any>`
114
- Parses YAML content with custom tags, setting `_location` on Reference and parsing Flatten objects.
124
+ #### `parseYamlWithReferences(filePath: string, options?: ParseOptions): Promise<any>`
125
+ Parses a YAML file with custom tags, setting `location` on Reference and ReferenceAll instances. The optional `options.extractAnchor` specifies a YAML anchor name to extract from the document instead of returning the whole file.
115
126
 
116
127
  #### `loadYamlWithReferencesSync(filePath: string, allowPaths?: string[]): any`
117
128
  Loads a YAML file and resolves all `!reference`, `!reference-all`, `!flatten`, and `!merge` tags, returning the fully resolved object synchronously. The optional `allowPaths` parameter restricts which directories can be referenced (see Path Restrictions section).
118
129
 
119
- #### `parseYamlWithReferencesSync(content: string, filePath: string): any`
120
- Parses YAML content with custom tags, setting `_location` on Reference and parsing Flatten objects synchronously.
130
+ #### `parseYamlWithReferencesSync(filePath: string, options?: ParseOptions): any`
131
+ Parses a YAML file with custom tags, setting `location` on Reference and ReferenceAll instances synchronously. The optional `options.extractAnchor` specifies a YAML anchor name to extract from the document instead of returning the whole file.
121
132
 
122
133
  #### `Reference` Class
123
134
  Represents a `!reference` tag with properties:
124
- - `_location`: Absolute path to the file containing the reference
135
+ - `location`: Absolute path to the file containing the reference
125
136
  - `path`: Relative path to the referenced YAML file
137
+ - `anchor` (optional): Name of an anchor defined in the target file to extract instead of the whole document. Raises an error if the anchor does not exist.
126
138
 
127
139
  #### `ReferenceAll` Class
128
140
  Represents a `!reference-all` tag with properties:
129
- - `_location`: Absolute path to the file containing the reference
141
+ - `location`: Absolute path to the file containing the reference
130
142
  - `glob`: Glob pattern to match YAML files
143
+ - `anchor` (optional): Name of an anchor defined in each matched file to extract instead of the whole document. Raises an error if the anchor does not exist in any matched file.
131
144
 
132
145
  #### `Flatten` Class
133
146
  Represents a `!flatten` tag with properties:
@@ -260,23 +273,27 @@ const resolved = await loadYamlWithReferences('./config/main.yaml', [
260
273
 
261
274
  ### For `!reference` tags:
262
275
  1. The `path` property is parsed from the YAML mapping (must be a relative path)
263
- 2. `_location` is automatically set to the absolute path of the containing file
264
- 3. The referenced YAML file is read and parsed relative to `_location`
265
- 4. The target path is checked against allowed paths (see Path Restrictions)
266
- 5. Any references within the referenced file are recursively resolved
267
- 6. The `Reference` object is replaced with the resolved content
276
+ 2. The optional `anchor` property specifies a YAML anchor (`&name`) to extract from the target file
277
+ 3. `location` is automatically set to the absolute path of the containing file
278
+ 4. The referenced YAML file is read and parsed relative to `location`
279
+ 5. The target path is checked against allowed paths (see Path Restrictions)
280
+ 6. If `anchor` is specified, only the value attached to that anchor is extracted (after resolving aliases and tags like `!merge` within the target file). An error is raised if the anchor does not exist.
281
+ 7. Any references within the resolved content are recursively resolved
282
+ 8. The `Reference` object is replaced with the resolved content
268
283
 
269
284
  ### For `!reference-all` tags:
270
285
  1. The `glob` property is parsed from the YAML mapping (must be a relative glob pattern)
271
- 2. `_location` is automatically set to the absolute path of the containing file
272
- 3. The glob pattern is evaluated relative to `_location`
273
- 4. Matching files are filtered based on allowed paths (see Path Restrictions)
274
- 5. For each matching YAML file:
286
+ 2. The optional `anchor` property specifies a YAML anchor (`&name`) to extract from each matched file
287
+ 3. `location` is automatically set to the absolute path of the containing file
288
+ 4. The glob pattern is evaluated relative to `location`
289
+ 5. Matching files are filtered based on allowed paths (see Path Restrictions)
290
+ 6. For each matching YAML file:
275
291
  - The file is read and parsed
292
+ - If `anchor` is specified, only the value attached to that anchor is extracted. An error is raised if the anchor does not exist in any matched file.
276
293
  - Any references are recursively resolved
277
- 6. The `ReferenceAll` object is replaced with an array of resolved contents
278
- 7. Files are sorted and resolved in deterministic alphabetical order for consistent results across systems
279
- 8. If no files match, an error is thrown
294
+ 7. The `ReferenceAll` object is replaced with an array of resolved contents
295
+ 8. Files are sorted and resolved in deterministic alphabetical order for consistent results across systems
296
+ 9. If no files match, an error is thrown
280
297
 
281
298
  ### For `!flatten` tags:
282
299
  1. The sequence is parsed from the YAML (must be a sequence/array)
@@ -312,6 +329,7 @@ The library throws descriptive errors for:
312
329
  - Missing required properties (`path` for `!reference`, `glob` for `!reference-all`)
313
330
  - Absolute paths in `!reference` or `!reference-all` tags (only relative paths are allowed)
314
331
  - References to files outside allowed paths
332
+ - Non-existent `anchor` in a referenced file (or in any file matched by `!reference-all`)
315
333
  - `!flatten` tag applied to non-sequence values
316
334
  - `!merge` tag applied to a sequence of values that are not mappings
317
335
 
@@ -9,7 +9,14 @@ export declare class Reference {
9
9
  * Absolute path to the YAML file where this !reference tag was found
10
10
  * This is automatically set by the library during parsing
11
11
  */
12
- _location: string;
12
+ location: string;
13
+ /**
14
+ * Anchor to import from the referenced YAML file
15
+ * Optional, provided by the user in the YAML document
16
+ * If not provided, the entire YAML file will be imported
17
+ * If provided, only the specified anchor will be imported from the referenced file
18
+ */
19
+ anchor?: string;
13
20
  /**
14
21
  * Relative path to another YAML file
15
22
  * Required, explicitly provided by the user in the YAML document
@@ -18,9 +25,13 @@ export declare class Reference {
18
25
  /**
19
26
  * Creates a new Reference instance
20
27
  * @param path - Relative path to another YAML file
21
- * @param location - Absolute path to the file containing this reference (optional, will be set later)
28
+ * @param options.location - Absolute path to the file containing this reference (optional, will be set later)
29
+ * @param options.anchor - Anchor to import from the referenced YAML file (optional)
22
30
  */
23
- constructor(path: string, location?: string);
31
+ constructor(path: string, options?: {
32
+ location?: string;
33
+ anchor?: string;
34
+ });
24
35
  /**
25
36
  * Returns a string representation of the Reference
26
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../src/Reference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,qBAAa,SAAS;IACpB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAiB3C;;OAEG;IACH,QAAQ,IAAI,MAAM;CAUnB;AAED,eAAO,MAAM,mBAAmB,eAAwB,CAAC;AAEzD,eAAO,MAAM,uBAAuB,GAClC,OAAO,OAAO,KACb,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAIzB,CAAC;AAEF,qBAAa,aAAc,SAAQ,OAAO;IACxC,GAAG,SAAgB;IACnB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW;CAgBpC"}
1
+ {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../src/Reference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,qBAAa,SAAS;IACpB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAkB1E;;OAEG;IACH,QAAQ,IAAI,MAAM;CAUnB;AAED,eAAO,MAAM,mBAAmB,eAAwB,CAAC;AAEzD,eAAO,MAAM,uBAAuB,GAClC,OAAO,OAAO,KACb,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAIzB,CAAC;AAEF,qBAAa,aAAc,SAAQ,OAAO;IACxC,GAAG,SAAgB;IACnB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW;CA0BpC"}
package/dist/Reference.js CHANGED
@@ -44,9 +44,10 @@ class Reference {
44
44
  /**
45
45
  * Creates a new Reference instance
46
46
  * @param path - Relative path to another YAML file
47
- * @param location - Absolute path to the file containing this reference (optional, will be set later)
47
+ * @param options.location - Absolute path to the file containing this reference (optional, will be set later)
48
+ * @param options.anchor - Anchor to import from the referenced YAML file (optional)
48
49
  */
49
- constructor(path, location) {
50
+ constructor(path, options) {
50
51
  // Ensure path is not empty
51
52
  if (!path || path.length === 0) {
52
53
  throw new Error("Reference path must not be empty");
@@ -56,13 +57,14 @@ class Reference {
56
57
  throw new Error(`Reference path must be relative, not absolute: "${path}"`);
57
58
  }
58
59
  this.path = path;
59
- this._location = location || "";
60
+ this.location = options?.location || "";
61
+ this.anchor = options?.anchor ?? undefined;
60
62
  }
61
63
  /**
62
64
  * Returns a string representation of the Reference
63
65
  */
64
66
  toString() {
65
- return `Reference { path: "${this.path}", _location: "${this._location}" }`;
67
+ return `Reference { path: "${this.path}", location: "${this.location}", anchor: "${this.anchor}" }`;
66
68
  }
67
69
  /**
68
70
  * Custom inspection method for Node.js console
@@ -92,6 +94,15 @@ class ReferenceNode extends yaml_1.YAMLMap {
92
94
  if (typeof pathValue !== "string") {
93
95
  throw new Error('!reference "path" property must be a string');
94
96
  }
97
+ // Coerce anchor to string if present (e.g. anchor: 1 is valid YAML
98
+ // but parsed as a number)
99
+ if ("anchor" in value && value.anchor !== undefined) {
100
+ if (typeof value.anchor === "object") {
101
+ throw new Error('!reference "anchor" property must be a scalar value');
102
+ }
103
+ const anchorVal = value.anchor;
104
+ value.anchor = String(anchorVal);
105
+ }
95
106
  Object.assign(value, { [exports.REFERENCE_NODE_FLAG]: true });
96
107
  return value;
97
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Reference.js","sourceRoot":"","sources":["../src/Reference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,+BAA+B;AAG/B;;;GAGG;AACH,MAAa,SAAS;IAapB;;;;OAIG;IACH,YAAY,IAAY,EAAE,QAAiB;QACzC,2BAA2B;QAC3B,IAAI,CAAC,IAA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AAS,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,2BAAmB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA5BD,sCA4BC"}
@@ -9,7 +9,14 @@ export declare class ReferenceAll {
9
9
  * Absolute path to the YAML file where this !reference-all tag was found
10
10
  * This is automatically set by the library during parsing
11
11
  */
12
- _location: string;
12
+ location: string;
13
+ /**
14
+ * Anchor to import from the referenced YAML file
15
+ * Optional, provided by the user in the YAML document
16
+ * If not provided, the entire YAML file will be imported
17
+ * If provided, only the specified anchor will be imported from the referenced file
18
+ */
19
+ anchor?: string;
13
20
  /**
14
21
  * Glob pattern to match YAML files
15
22
  * Required, explicitly provided by the user in the YAML document
@@ -18,9 +25,13 @@ export declare class ReferenceAll {
18
25
  /**
19
26
  * Creates a new ReferenceAll instance
20
27
  * @param glob - Glob pattern to match YAML files
21
- * @param location - Absolute path to the file containing this reference (optional, will be set later)
28
+ * @param options.location - Absolute path to the file containing this reference (optional, will be set later)
29
+ * @param options.anchor - Anchor to import from the referenced YAML file (optional)
22
30
  */
23
- constructor(glob: string, location?: string);
31
+ constructor(glob: string, options?: {
32
+ location?: string;
33
+ anchor?: string;
34
+ });
24
35
  /**
25
36
  * Returns a string representation of the ReferenceAll
26
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceAll.d.ts","sourceRoot":"","sources":["../src/ReferenceAll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;gBACS,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAiB3C;;OAEG;IACH,QAAQ,IAAI,MAAM;CAUnB;AAED,eAAO,MAAM,uBAAuB,eAA2B,CAAC;AAEhE,eAAO,MAAM,0BAA0B,GACrC,OAAO,OAAO,KACb,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAMzB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,OAAO;IAC3C,GAAG,SAAoB;IACvB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW;CAgBpC"}
1
+ {"version":3,"file":"ReferenceAll.d.ts","sourceRoot":"","sources":["../src/ReferenceAll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAkB1E;;OAEG;IACH,QAAQ,IAAI,MAAM;CAUnB;AAED,eAAO,MAAM,uBAAuB,eAA2B,CAAC;AAEhE,eAAO,MAAM,0BAA0B,GACrC,OAAO,OAAO,KACb,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAMzB,CAAC;AAEF,qBAAa,gBAAiB,SAAQ,OAAO;IAC3C,GAAG,SAAoB;IACvB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW;CA4BpC"}
@@ -44,9 +44,10 @@ class ReferenceAll {
44
44
  /**
45
45
  * Creates a new ReferenceAll instance
46
46
  * @param glob - Glob pattern to match YAML files
47
- * @param location - Absolute path to the file containing this reference (optional, will be set later)
47
+ * @param options.location - Absolute path to the file containing this reference (optional, will be set later)
48
+ * @param options.anchor - Anchor to import from the referenced YAML file (optional)
48
49
  */
49
- constructor(glob, location) {
50
+ constructor(glob, options) {
50
51
  // Ensure glob is not empty
51
52
  if (!glob || glob.length === 0) {
52
53
  throw new Error("ReferenceAll glob must not be empty");
@@ -56,13 +57,14 @@ class ReferenceAll {
56
57
  throw new Error(`ReferenceAll glob must be relative, not absolute: "${glob}"`);
57
58
  }
58
59
  this.glob = glob;
59
- this._location = location || "";
60
+ this.location = options?.location || "";
61
+ this.anchor = options?.anchor ?? undefined;
60
62
  }
61
63
  /**
62
64
  * Returns a string representation of the ReferenceAll
63
65
  */
64
66
  toString() {
65
- return `ReferenceAll { glob: "${this.glob}", _location: "${this._location}" }`;
67
+ return `ReferenceAll { glob: "${this.glob}", location: "${this.location}", anchor: "${this.anchor}" }`;
66
68
  }
67
69
  /**
68
70
  * Custom inspection method for Node.js console
@@ -94,6 +96,15 @@ class ReferenceAllNode extends yaml_1.YAMLMap {
94
96
  if (typeof globValue !== "string") {
95
97
  throw new Error('!reference-all "glob" property must be a string');
96
98
  }
99
+ // Coerce anchor to string if present (e.g. anchor: 1 is valid YAML
100
+ // but parsed as a number)
101
+ if ("anchor" in value && value.anchor !== undefined) {
102
+ if (typeof value.anchor === "object") {
103
+ throw new Error('!reference-all "anchor" property must be a scalar value');
104
+ }
105
+ const anchorVal = value.anchor;
106
+ value.anchor = String(anchorVal);
107
+ }
97
108
  Object.assign(value, { [exports.REFERENCE_ALL_NODE_FLAG]: true });
98
109
  return value;
99
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceAll.js","sourceRoot":"","sources":["../src/ReferenceAll.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,+BAA+B;AAG/B;;;GAGG;AACH,MAAa,YAAY;IAavB;;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C;YACD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAmC,CAAC;YAC5D,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,+BAAuB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA9BD,4CA8BC"}
package/dist/parser.d.ts CHANGED
@@ -2,16 +2,25 @@
2
2
  * Parser module for handling YAML with custom !reference and !reference-all tags
3
3
  * Uses the eemeli/yaml package to parse YAML with custom tags
4
4
  */
5
+ export interface ParseOptions {
6
+ extractAnchor?: string;
7
+ }
5
8
  /**
6
9
  * Parse YAML content with custom !reference and !reference-all tags
7
- * @param filePath - Path to the YAML file to be parsed (used for setting _location)
10
+ * @param filePath - Path to the YAML file to be parsed (used for setting
11
+ * location)
12
+ * @param options - Optional parsing options (e.g. extractAnchor to specify an
13
+ * anchor to extract as root)
8
14
  * @returns Parsed object with Reference and ReferenceAll instances
9
15
  */
10
- export declare function parseYamlWithReferencesSync(filePath: string): unknown;
16
+ export declare function parseYamlWithReferencesSync(filePath: string, options?: ParseOptions): unknown;
11
17
  /**
12
18
  * Parse YAML content with custom !reference and !reference-all tags (async).
13
- * @param filePath - Path to the YAML file to be parsed (used for setting _location)
19
+ * @param filePath - Path to the YAML file to be parsed (used for setting
20
+ * location)
21
+ * @param options - Optional parsing options (e.g. extractAnchor to specify an
22
+ * anchor to extract as root)
14
23
  * @returns Parsed object with Reference and ReferenceAll instances
15
24
  */
16
- export declare function parseYamlWithReferences(filePath: string): Promise<unknown>;
25
+ export declare function parseYamlWithReferences(filePath: string, options?: ParseOptions): Promise<unknown>;
17
26
  //# sourceMappingURL=parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyFH;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAkBrE;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAkBlB"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyFH,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAuDD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAaT;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,OAAO,CAAC,CAalB"}
package/dist/parser.js CHANGED
@@ -114,21 +114,60 @@ const customTags = [
114
114
  mergeTag,
115
115
  illegalMergeOnMapping,
116
116
  ];
117
+ function extractAnchorFromDocument(doc, anchor) {
118
+ const anchors = new Map();
119
+ (0, yaml_1.visit)(doc, {
120
+ // record all anchors in the map
121
+ Node(_, node) {
122
+ if (node.anchor) {
123
+ anchors.set(node.anchor, node);
124
+ }
125
+ },
126
+ // Replace all aliases with their corresponding anchor(s)
127
+ // Note: YAML forbids forward-referencing aliases, so we can be sure that
128
+ // the anchor will have been visited before any alias that references it
129
+ Alias(_, node) {
130
+ if (!anchors.has(node.source)) {
131
+ throw new Error(`Anchor "${node.source}" not found in the YAML document`);
132
+ }
133
+ // Note: this node will get re-visited by the main visitor, so we don't
134
+ // need to recursively resolve nested aliases here
135
+ return anchors.get(node.source);
136
+ },
137
+ });
138
+ if (!anchors.has(anchor)) {
139
+ throw new Error(`Anchor "${anchor}" not found in the YAML document`);
140
+ }
141
+ return anchors.get(anchor);
142
+ }
143
+ function parseYamlWithReferencesFromString(content, filePath, options) {
144
+ const doc = (0, yaml_1.parseDocument)(content, { customTags });
145
+ if (doc.errors.length > 0) {
146
+ throw doc.errors[0];
147
+ }
148
+ if (!doc.contents) {
149
+ return null;
150
+ }
151
+ let root = doc.contents;
152
+ if (options?.extractAnchor !== undefined) {
153
+ root = extractAnchorFromDocument(doc, options.extractAnchor);
154
+ }
155
+ const parsed = root.toJS(doc);
156
+ return processParsedDocument(parsed, filePath);
157
+ }
117
158
  /**
118
159
  * Parse YAML content with custom !reference and !reference-all tags
119
- * @param filePath - Path to the YAML file to be parsed (used for setting _location)
160
+ * @param filePath - Path to the YAML file to be parsed (used for setting
161
+ * location)
162
+ * @param options - Optional parsing options (e.g. extractAnchor to specify an
163
+ * anchor to extract as root)
120
164
  * @returns Parsed object with Reference and ReferenceAll instances
121
165
  */
122
- function parseYamlWithReferencesSync(filePath) {
166
+ function parseYamlWithReferencesSync(filePath, options) {
123
167
  try {
124
168
  const absolutePath = path.resolve(filePath);
125
169
  const content = fsSync.readFileSync(absolutePath, "utf8");
126
- const doc = (0, yaml_1.parseDocument)(content, { customTags });
127
- if (doc.errors.length > 0) {
128
- throw doc.errors[0];
129
- }
130
- const parsed = doc.toJS();
131
- return processParsedDocument(parsed, filePath);
170
+ return parseYamlWithReferencesFromString(content, absolutePath, options);
132
171
  }
133
172
  catch (error) {
134
173
  // Re-throw the error with context about which file failed to parse
@@ -137,19 +176,17 @@ function parseYamlWithReferencesSync(filePath) {
137
176
  }
138
177
  /**
139
178
  * Parse YAML content with custom !reference and !reference-all tags (async).
140
- * @param filePath - Path to the YAML file to be parsed (used for setting _location)
179
+ * @param filePath - Path to the YAML file to be parsed (used for setting
180
+ * location)
181
+ * @param options - Optional parsing options (e.g. extractAnchor to specify an
182
+ * anchor to extract as root)
141
183
  * @returns Parsed object with Reference and ReferenceAll instances
142
184
  */
143
- async function parseYamlWithReferences(filePath) {
185
+ async function parseYamlWithReferences(filePath, options) {
144
186
  try {
145
187
  const absolutePath = path.resolve(filePath);
146
188
  const content = await fs.readFile(absolutePath, "utf8");
147
- const doc = (0, yaml_1.parseDocument)(content, { customTags });
148
- if (doc.errors.length > 0) {
149
- throw doc.errors[0];
150
- }
151
- const parsed = doc.toJS();
152
- return processParsedDocument(parsed, filePath);
189
+ return parseYamlWithReferencesFromString(content, absolutePath, options);
153
190
  }
154
191
  catch (error) {
155
192
  // Re-throw the error with context about which file failed to parse
@@ -168,17 +205,29 @@ async function parseYamlWithReferences(filePath) {
168
205
  * custom nodes) so that they are present on the final JS objects we get here.
169
206
  *
170
207
  * @param obj - The parsed YAML document (or sub-object) to process
171
- * @param filePath - The file path to set as _location on Reference and
208
+ * @param filePath - The file path to set as location on Reference and
172
209
  * ReferenceAll instances
173
210
  * @returns The processed object with Reference, ReferenceAll, Flatten, and
174
211
  * Merge instances
175
212
  */
176
213
  function processParsedDocument(obj, filePath) {
177
214
  if ((0, Reference_1.isResolvedReferenceNode)(obj)) {
178
- return new Reference_1.Reference(obj.path, filePath);
215
+ const anchor = "anchor" in obj && typeof obj.anchor === "string"
216
+ ? obj.anchor
217
+ : undefined;
218
+ return new Reference_1.Reference(obj.path, {
219
+ location: filePath,
220
+ anchor,
221
+ });
179
222
  }
180
223
  if ((0, ReferenceAll_1.isResolvedReferenceAllNode)(obj)) {
181
- return new ReferenceAll_1.ReferenceAll(obj.glob, filePath);
224
+ const anchor = "anchor" in obj && typeof obj.anchor === "string"
225
+ ? obj.anchor
226
+ : undefined;
227
+ return new ReferenceAll_1.ReferenceAll(obj.glob, {
228
+ location: filePath,
229
+ anchor,
230
+ });
182
231
  }
183
232
  if ((0, Flatten_1.isResolvedFlattenNode)(obj)) {
184
233
  const processed = obj.map((item) => processParsedDocument(item, filePath));
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FH,kEAkBC;AAOD,0DAoBC;AAzID,+BAA2C;AAC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AAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC3E,OAAO,IAAI,iBAAO,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,IAAA,2BAAmB,EAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC3E,OAAO,IAAI,aAAK,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/resolver.js CHANGED
@@ -298,17 +298,17 @@ function _recursivelyResolveReferencesSync(obj, visitedPaths = new Set(), allowP
298
298
  * @throws Error if circular reference is detected, or if a reference cannot be resolved
299
299
  */
300
300
  async function resolveReference(ref, visitedPaths, allowPaths) {
301
- if (!ref._location) {
302
- throw new Error(`Reference missing _location: ${ref.toString()}`);
301
+ if (!ref.location) {
302
+ throw new Error(`Reference missing location: ${ref.toString()}`);
303
303
  }
304
- const refDir = path.dirname(ref._location);
304
+ const refDir = path.dirname(ref.location);
305
305
  const targetPath = path.resolve(refDir, ref.path);
306
306
  let realTargetPath;
307
307
  try {
308
308
  realTargetPath = await fs.realpath(targetPath);
309
309
  }
310
310
  catch {
311
- throw new Error(`Referenced file not found: ${targetPath} (from ${ref._location})`);
311
+ throw new Error(`Referenced file not found: ${targetPath} (from ${ref.location})`);
312
312
  }
313
313
  // Check if path is allowed
314
314
  if (allowPaths && allowPaths.length > 0) {
@@ -324,7 +324,9 @@ async function resolveReference(ref, visitedPaths, allowPaths) {
324
324
  throw new Error(`Circular reference detected: ${realTargetPath} (visited: ${Array.from(visitedPaths).join(" -> ")})`);
325
325
  }
326
326
  visitedPaths.add(realTargetPath);
327
- const parsed = await (0, parser_1.parseYamlWithReferences)(realTargetPath);
327
+ const parsed = await (0, parser_1.parseYamlWithReferences)(realTargetPath, {
328
+ extractAnchor: ref.anchor,
329
+ });
328
330
  const resolved = await _recursivelyResolveReferences(parsed, visitedPaths, allowPaths);
329
331
  visitedPaths.delete(realTargetPath);
330
332
  return resolved;
@@ -338,17 +340,17 @@ async function resolveReference(ref, visitedPaths, allowPaths) {
338
340
  * @throws Error if circular reference is detected, or if a reference cannot be resolved
339
341
  */
340
342
  function resolveReferenceSync(ref, visitedPaths, allowPaths) {
341
- if (!ref._location) {
342
- throw new Error(`Reference missing _location: ${ref.toString()}`);
343
+ if (!ref.location) {
344
+ throw new Error(`Reference missing location: ${ref.toString()}`);
343
345
  }
344
- const refDir = path.dirname(ref._location);
346
+ const refDir = path.dirname(ref.location);
345
347
  const targetPath = path.resolve(refDir, ref.path);
346
348
  let realTargetPath;
347
349
  try {
348
350
  realTargetPath = fsSync.realpathSync(targetPath);
349
351
  }
350
352
  catch {
351
- throw new Error(`Referenced file not found: ${targetPath} (from ${ref._location})`);
353
+ throw new Error(`Referenced file not found: ${targetPath} (from ${ref.location})`);
352
354
  }
353
355
  // Check if path is allowed
354
356
  if (allowPaths && allowPaths.length > 0) {
@@ -364,7 +366,9 @@ function resolveReferenceSync(ref, visitedPaths, allowPaths) {
364
366
  throw new Error(`Circular reference detected: ${realTargetPath} (visited: ${Array.from(visitedPaths).join(" -> ")})`);
365
367
  }
366
368
  visitedPaths.add(realTargetPath);
367
- const parsed = (0, parser_1.parseYamlWithReferencesSync)(realTargetPath);
369
+ const parsed = (0, parser_1.parseYamlWithReferencesSync)(realTargetPath, {
370
+ extractAnchor: ref.anchor,
371
+ });
368
372
  const resolved = _recursivelyResolveReferencesSync(parsed, visitedPaths, allowPaths);
369
373
  visitedPaths.delete(realTargetPath);
370
374
  return resolved;
@@ -375,13 +379,13 @@ function resolveReferenceSync(ref, visitedPaths, allowPaths) {
375
379
  * @param visitedPaths Set of visited paths to detect circular references
376
380
  * @param allowPaths Optional list of allowed paths for references
377
381
  * @returns Resolved array of objects. Will not contain any references.
378
- * @throws Error if the ReferenceAll object is missing _location or if the glob pattern is invalid.
382
+ * @throws Error if the ReferenceAll object is missing location or if the glob pattern is invalid.
379
383
  */
380
384
  async function resolveReferenceAll(refAll, visitedPaths, allowPaths) {
381
- if (!refAll._location) {
382
- throw new Error(`ReferenceAll missing _location: ${refAll.toString()}`);
385
+ if (!refAll.location) {
386
+ throw new Error(`ReferenceAll missing location: ${refAll.toString()}`);
383
387
  }
384
- const refDir = path.dirname(refAll._location);
388
+ const refDir = path.dirname(refAll.location);
385
389
  const globPattern = path.resolve(refDir, refAll.glob);
386
390
  // Find files matching the glob pattern
387
391
  let matchingFiles;
@@ -389,7 +393,7 @@ async function resolveReferenceAll(refAll, visitedPaths, allowPaths) {
389
393
  matchingFiles = await (0, glob_1.glob)(globPattern, { absolute: true });
390
394
  }
391
395
  catch {
392
- throw new Error(`Invalid glob pattern: ${globPattern} (from ${refAll._location})`);
396
+ throw new Error(`Invalid glob pattern: ${globPattern} (from ${refAll.location})`);
393
397
  }
394
398
  // Filter to only include YAML files
395
399
  matchingFiles = matchingFiles.filter((file) => file.endsWith(".yaml") || file.endsWith(".yml"));
@@ -410,7 +414,7 @@ async function resolveReferenceAll(refAll, visitedPaths, allowPaths) {
410
414
  });
411
415
  }
412
416
  if (filteredFiles.length === 0) {
413
- throw new Error(`No YAML files found matching glob pattern: ${globPattern} (from ${refAll._location})`);
417
+ throw new Error(`No YAML files found matching glob pattern: ${globPattern} (from ${refAll.location})`);
414
418
  }
415
419
  // Sort files alphabetically for consistent ordering
416
420
  filteredFiles.sort();
@@ -422,7 +426,9 @@ async function resolveReferenceAll(refAll, visitedPaths, allowPaths) {
422
426
  }
423
427
  visitedPaths.add(filePath);
424
428
  try {
425
- const parsed = await (0, parser_1.parseYamlWithReferences)(filePath);
429
+ const parsed = await (0, parser_1.parseYamlWithReferences)(filePath, {
430
+ extractAnchor: refAll.anchor,
431
+ });
426
432
  const resolved = await _recursivelyResolveReferences(parsed, visitedPaths, allowPaths);
427
433
  resolvedContents.push(resolved);
428
434
  }
@@ -440,13 +446,13 @@ async function resolveReferenceAll(refAll, visitedPaths, allowPaths) {
440
446
  * @param visitedPaths Set of visited paths to detect circular references
441
447
  * @param allowPaths Optional list of allowed paths for references
442
448
  * @returns Resolved array of objects. Will not contain any references.
443
- * @throws Error if the ReferenceAll object is missing _location or if the glob pattern is invalid.
449
+ * @throws Error if the ReferenceAll object is missing location or if the glob pattern is invalid.
444
450
  */
445
451
  function resolveReferenceAllSync(refAll, visitedPaths, allowPaths) {
446
- if (!refAll._location) {
447
- throw new Error(`ReferenceAll missing _location: ${refAll.toString()}`);
452
+ if (!refAll.location) {
453
+ throw new Error(`ReferenceAll missing location: ${refAll.toString()}`);
448
454
  }
449
- const refDir = path.dirname(refAll._location);
455
+ const refDir = path.dirname(refAll.location);
450
456
  const globPattern = path.resolve(refDir, refAll.glob);
451
457
  // Find files matching the glob pattern
452
458
  let matchingFiles;
@@ -454,7 +460,7 @@ function resolveReferenceAllSync(refAll, visitedPaths, allowPaths) {
454
460
  matchingFiles = (0, glob_1.globSync)(globPattern, { absolute: true });
455
461
  }
456
462
  catch {
457
- throw new Error(`Invalid glob pattern: ${globPattern} (from ${refAll._location})`);
463
+ throw new Error(`Invalid glob pattern: ${globPattern} (from ${refAll.location})`);
458
464
  }
459
465
  // Filter to only include YAML files
460
466
  matchingFiles = matchingFiles.filter((file) => file.endsWith(".yaml") || file.endsWith(".yml"));
@@ -477,7 +483,7 @@ function resolveReferenceAllSync(refAll, visitedPaths, allowPaths) {
477
483
  });
478
484
  }
479
485
  if (filteredFiles.length === 0) {
480
- throw new Error(`No YAML files found matching glob pattern: ${globPattern} (from ${refAll._location})`);
486
+ throw new Error(`No YAML files found matching glob pattern: ${globPattern} (from ${refAll.location})`);
481
487
  }
482
488
  // Sort files alphabetically for consistent ordering
483
489
  filteredFiles.sort();
@@ -489,7 +495,9 @@ function resolveReferenceAllSync(refAll, visitedPaths, allowPaths) {
489
495
  }
490
496
  visitedPaths.add(filePath);
491
497
  try {
492
- const parsed = (0, parser_1.parseYamlWithReferencesSync)(filePath);
498
+ const parsed = (0, parser_1.parseYamlWithReferencesSync)(filePath, {
499
+ extractAnchor: refAll.anchor,
500
+ });
493
501
  const resolved = _recursivelyResolveReferencesSync(parsed, visitedPaths, allowPaths);
494
502
  resolvedContents.push(resolved);
495
503
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.js","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+HH,sEAwBC;AAQD,wCAYC;AAQD,gDAYC;AASD,sEA0DC;AASD,8EA0DC;AAnUD,2CAA6B;AAC7B,gDAAkC;AAClC,2CAA6B;AAC7B,+BAAsC;AACtC,2CAAwC;AACxC,iDAA8C;AAC9C,uCAAoC;AACpC,mCAAgC;AAChC,qCAAgF;AAEhF;;;GAGG;AACH,SAAS,SAAS,CAAC,SAAiB,EAAE,UAAkB;IACtD,OAAO,CACL,SAAS,KAAK,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CACxE,CAAC;AACJ,CAA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,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsillman2000/yaml-reference-ts",
3
- "version": "1.3.5",
3
+ "version": "1.4.0",
4
4
  "description": "A Node.js TypeScript library for resolving YAML documents containing !reference and !reference-all tags",
5
5
  "repository": {
6
6
  "type": "git",