configorama 0.11.0 → 0.11.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "configorama",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Variable support for configuration files",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",
package/src/main.js CHANGED
@@ -372,7 +372,12 @@ class Configorama {
372
372
  description: `Resolves values from files. Supports sub-properties via :key or .key lookup.`,
373
373
  match: fileRefSyntax,
374
374
  resolver: (varString, o, x, pathValue) => {
375
- return this.getValueFromFile(varString, { context: pathValue })
375
+ // Inside ignore-path contexts (e.g. Fn::Sub) inline the file as raw text so
376
+ // embedded CloudFormation refs survive and the body stays a string. Skip
377
+ // raw mode when a :key/.key accessor is present — that needs a parsed value.
378
+ const hasAccessor = /\)\s*[:.]/.test(varString)
379
+ const asRawText = !!(pathValue && this.isIgnorePath(pathValue.path)) && !hasAccessor
380
+ return this.getValueFromFile(varString, { asRawText, context: pathValue })
376
381
  },
377
382
  },
378
383
 
@@ -484,6 +489,16 @@ class Configorama {
484
489
  )
485
490
  this.variablesKnownTypes = variablesKnownTypes
486
491
 
492
+ // Explicit configorama types that should still resolve inside ignore-path
493
+ // contexts like Fn::Sub (file, text, env, opt, cron, git, user sources, ...).
494
+ // Excludes self/dot.prop refs — those are left verbatim for CloudFormation /
495
+ // downstream Serverless resolution.
496
+ this.subResolvableTypes = combineRegexes(
497
+ /** @type {RegExp[]} */ (this.variableTypes
498
+ .filter((v) => v.type !== 'string' && v.type !== 'self' && v.type !== 'dot.prop' && v.match instanceof RegExp)
499
+ .map((v) => v.match))
500
+ )
501
+
487
502
  // Build prefix lookup map for O(1) type detection (perf optimization)
488
503
  this._resolverByPrefix = new Map()
489
504
  for (const r of this.variableTypes) {
@@ -1111,9 +1126,23 @@ class Configorama {
1111
1126
  // #######################
1112
1127
  // ## PROPERTY HANDLING ##
1113
1128
  // #######################
1114
- shouldSkipResolution(pathValue) {
1129
+ isIgnorePath(pathValue) {
1115
1130
  return shouldIgnorePath(pathValue, this.ignorePathPatterns)
1116
1131
  }
1132
+ // True when the value has a configorama-typed token that resolves even inside an
1133
+ // ignore-path (file/text/env/opt/cron/git/custom) — i.e. not just self/CFN refs.
1134
+ hasSubResolvableToken(value) {
1135
+ if (typeof value !== 'string') return false
1136
+ const matches = this.getMatches(value)
1137
+ if (!isArray(matches)) return false
1138
+ return matches.some((m) => this.subResolvableTypes.test(m.variable))
1139
+ }
1140
+ shouldSkipResolution(pathValue, value) {
1141
+ if (!this.isIgnorePath(pathValue)) return false
1142
+ // Under an ignore path (Fn::Sub etc.) keep resolving configorama's own typed
1143
+ // refs; only skip when nothing but self/CFN refs remain.
1144
+ return !this.hasSubResolvableToken(value)
1145
+ }
1117
1146
 
1118
1147
  /**
1119
1148
  * The declaration of a terminal property. This declaration includes the path and value of the
@@ -1275,7 +1304,7 @@ class Configorama {
1275
1304
  /* Leave opaque paths verbatim. These often contain non-configorama
1276
1305
  `${...}` syntax from CloudFormation, JavaScript, shell, VTL, etc. */
1277
1306
  variables = variables.filter((property) => {
1278
- return !this.shouldSkipResolution(property.path)
1307
+ return !this.shouldSkipResolution(property.path, property.value)
1279
1308
  })
1280
1309
  /*
1281
1310
  console.log(`variables at call count ${this.callCount}`, variables)
@@ -1563,7 +1592,7 @@ class Configorama {
1563
1592
  console.log(valueObject)
1564
1593
  }
1565
1594
  const property = valueObject.value
1566
- if (this.shouldSkipResolution(valueObject.path)) {
1595
+ if (this.shouldSkipResolution(valueObject.path, property)) {
1567
1596
  return Promise.resolve(property)
1568
1597
  }
1569
1598
  const matches = this.getMatches(property)
@@ -2166,6 +2195,7 @@ Missing Value ${missingValue} - ${matchedString}
2166
2195
  // Cache joined path to avoid repeated array.join('.') calls
2167
2196
  const pathJoined = pathValue && pathValue.length ? pathValue.join('.') : null
2168
2197
 
2198
+
2169
2199
  // Track every call to getValueFromSource for metadata
2170
2200
  if (this._trackCalls && pathJoined) {
2171
2201
  const pathKey = pathJoined
@@ -2318,6 +2348,14 @@ Missing Value ${missingValue} - ${matchedString}
2318
2348
  // console.log('resolverFunction', resolverFunction)
2319
2349
  /** */
2320
2350
 
2351
+ // Inside ignore-path contexts (Fn::Sub, inline code, VTL templates, ...) leave
2352
+ // self refs, bare config refs, and CloudFormation refs verbatim for CloudFormation
2353
+ // / downstream Serverless to resolve. Everything configorama can resolve on its own
2354
+ // (file/text/env/opt/cron/eval/git/custom/string/number) still resolves.
2355
+ if (this.isIgnorePath(pathValue) && (!found || resolverType === 'self' || resolverType === 'dot.prop')) {
2356
+ return Promise.resolve(encodeUnknown(this.varPrefix + variableString + this.varSuffix))
2357
+ }
2358
+
2321
2359
  if (found && resolverFunction) {
2322
2360
  /*
2323
2361
  console.log(`----------Resolver [${resolverType}]----------------------`)
@@ -7,22 +7,7 @@ const path = require('path')
7
7
  * @returns {Promise<*>} The result of executing the ESM file
8
8
  */
9
9
  async function executeESMFile(filePath, opts = {}) {
10
- try {
11
- // Use require for now since ESM dynamic import in async context is complex
12
- // We'll use jiti to handle ESM syntax
13
- const { createJiti } = require('jiti')
14
- const jiti = createJiti(__filename, {
15
- interopDefault: true
16
- })
17
-
18
- // Load the ESM file - resolve to absolute path first
19
- const resolvedPath = path.resolve(filePath)
20
- let esmModule = jiti(resolvedPath)
21
-
22
- return esmModule
23
- } catch (err) {
24
- throw new Error(`Failed to load ESM file ${filePath}: ${err.message}`)
25
- }
10
+ return executeESMFileSync(filePath, opts)
26
11
  }
27
12
 
28
13
  /**
@@ -8,54 +8,7 @@ const fs = require('fs')
8
8
  * @returns {Promise<*>} The exported module from the TypeScript file
9
9
  */
10
10
  async function executeTypeScriptFile(filePath, opts = {}) {
11
- // Check if tsx is available first (preferred)
12
- let useTsx = false
13
- try {
14
- require.resolve('tsx/cjs/api')
15
- useTsx = true
16
- } catch (err) {
17
- // Fallback to ts-node if tsx is not available
18
- try {
19
- require.resolve('ts-node/register')
20
- } catch (tsNodeErr) {
21
- throw new Error(
22
- 'TypeScript support requires either "tsx" or "ts-node" to be installed. ' +
23
- 'Please install one of them:\n' +
24
- ' npm install tsx --save-dev (recommended)\n' +
25
- ' npm install ts-node typescript --save-dev'
26
- )
27
- }
28
- }
29
-
30
- // Clear require cache to ensure fresh execution
31
- const resolvedPath = require.resolve(filePath)
32
- delete require.cache[resolvedPath]
33
-
34
- let tsFile
35
- if (useTsx) {
36
- // Use tsx for modern, fast TypeScript execution
37
- // @ts-ignore - tsx doesn't have type declarations
38
- const { register } = require('tsx/cjs/api')
39
- const restore = register()
40
- try {
41
- tsFile = require(filePath)
42
- } catch (err) {
43
- throw new Error(`Failed to load TypeScript file: ${err.message}`)
44
- } finally {
45
- restore()
46
- }
47
- } else {
48
- // Fallback to ts-node
49
- try {
50
- // @ts-ignore - ts-node is optional peer dependency
51
- require('ts-node/register')
52
- tsFile = require(filePath)
53
- } catch (err) {
54
- throw new Error(`Failed to load TypeScript file with ts-node: ${err.message}`)
55
- }
56
- }
57
-
58
- return tsFile
11
+ return executeTypeScriptFileSync(filePath, opts)
59
12
  }
60
13
 
61
14
  /**
@@ -91,34 +91,13 @@ function parseCronExpression(input) {
91
91
  return `${minute} ${hour} * * *`
92
92
  }
93
93
 
94
- // Parse "every X minutes/hours/days" patterns
95
- const everyMatch = normalizedInput.match(/^every (\d+) (minute|minutes|hour|hours|day|days|week|weeks|month|months)s?$/i)
96
- if (everyMatch) {
97
- const interval = parseInt(everyMatch[1])
98
- const unit = everyMatch[2].toLowerCase().replace(/s$/, '') // Remove trailing 's' if present
99
-
100
- switch (unit) {
101
- case 'minute':
102
- return `*/${interval} * * * *`
103
- case 'hour':
104
- return `0 */${interval} * * *`
105
- case 'day':
106
- return `0 0 */${interval} * *`
107
- case 'week':
108
- return `0 0 * * 0/${interval}`
109
- case 'month':
110
- return `0 0 1 */${interval} *`
111
- default:
112
- throw new Error(`Unsupported interval unit: ${unit}`)
113
- }
114
- }
115
-
116
- // Parse "X minute(s)/hour(s)/day(s)" patterns (e.g., "1 minute", "5 minutes", "1 hour")
117
- const intervalMatch = normalizedInput.match(/^(\d+) (minute|minutes|hour|hours|day|days|week|weeks|month|months)s?$/i)
94
+ // Parse "every X minutes/hours/days" and bare "X minute(s)/hour(s)/day(s)" patterns
95
+ // (e.g., "every 5 minutes", "1 minute", "5 minutes", "1 hour")
96
+ const intervalMatch = normalizedInput.match(/^(?:every )?(\d+) (minute|minutes|hour|hours|day|days|week|weeks|month|months)s?$/i)
118
97
  if (intervalMatch) {
119
98
  const interval = parseInt(intervalMatch[1])
120
99
  const unit = intervalMatch[2].toLowerCase().replace(/s$/, '') // Remove trailing 's' if present
121
-
100
+
122
101
  switch (unit) {
123
102
  case 'minute':
124
103
  return `*/${interval} * * * *`
@@ -115,7 +115,9 @@ function parseFileContents(content, filePath) {
115
115
  */
116
116
  async function getValueFromFile(ctx, variableString, options) {
117
117
  const opts = options || {}
118
- const syntax = opts.asRawText ? ctx.textRefSyntax : ctx.fileRefSyntax
118
+ // Pick syntax from the ref keyword, not the raw-text flag, so a file() ref can
119
+ // also be inlined as raw text (e.g. inside an Fn::Sub) without losing its match.
120
+ const syntax = /^\s*text\(/.test(variableString) ? ctx.textRefSyntax : ctx.fileRefSyntax
119
121
  // console.log('From file', `"${variableString}"`)
120
122
  let matchedFileString = variableString.match(syntax)[0]
121
123
  // console.log('matchedFileString', matchedFileString)
@@ -1,5 +1,6 @@
1
1
  const DEFAULT_IGNORE_PATHS = [
2
2
  '**.Fn::Sub',
3
+ '**.Fn::Sub.0',
3
4
  '**.Properties.Code.ZipFile',
4
5
  '**.Properties.FunctionCode',
5
6
  '**.Properties.UserData',
@@ -49,18 +49,6 @@ type ConfigoramaSettings = {
49
49
  * - allow undefined values to pass through without throwing errors
50
50
  */
51
51
  allowUndefinedValues?: boolean;
52
- /**
53
- * - glob-like config paths whose values should be left verbatim
54
- */
55
- ignorePaths?: string[];
56
- /**
57
- * - alias for ignorePaths
58
- */
59
- skipResolutionPaths?: string[];
60
- /**
61
- * - disable built-in CloudFormation and embedded-code ignore paths
62
- */
63
- disableDefaultIgnorePaths?: boolean;
64
52
  /**
65
53
  * - values passed into .js config files if user using javascript config
66
54
  */
@@ -69,14 +57,6 @@ type ConfigoramaSettings = {
69
57
  * - return both config and metadata about variables found
70
58
  */
71
59
  returnMetadata?: boolean;
72
- /**
73
- * - suppress env-stage-loader logs when useDotenv/useDotEnv is enabled
74
- */
75
- dotEnvSilent?: boolean;
76
- /**
77
- * - enable env-stage-loader debug logs when useDotenv/useDotEnv is enabled
78
- */
79
- dotEnvDebug?: boolean;
80
60
  /**
81
61
  * - keys to merge in arrays of objects
82
62
  */
@@ -87,10 +67,6 @@ type ConfigoramaSettings = {
87
67
  filePathOverrides?: {
88
68
  [x: string]: string;
89
69
  };
90
- /**
91
- * - install Configorama CLI signal handlers. Defaults to false for library calls.
92
- */
93
- handleSignalEvents?: boolean;
94
70
  };
95
71
  type ConfigoramaResult<T = any> = {
96
72
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;AA6CiB,0BALH,CAAC,4BACJ,MAAM,MAAO,aACb,mBAAmB,GACjB,OAAO,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAiD7C;;IASqB,qBALR,CAAC,4BACJ,MAAM,MAAO,aACb,mBAAmB,GACjB,CAAC,CAgBb;IAQwB,4CAJb,MAAM,GAAC,MAAM,aACd,MAAM,gBAUhB;;;;;;;;;;;;;;;;aA1Ha,MAAM;;;;gBACN,MAAM;;;;;;;;;;;;;;;;;;;;uBAIN,OAAO;;;;2BACP,OAAO;;;;kBACP,MAAM,EAAE;;;;0BACR,MAAM,EAAE;;;;gCACR,OAAO;;;;kBACP,cAAe;;;;qBACf,OAAO;;;;mBACP,OAAO;;;;kBACP,OAAO;;;;gBACP,MAAM,EAAE;;;;;;;;;;yBAER,OAAO;;uBAIP,CAAC;;;;oBAED,MAAM;;;;;;;;;;YAEN,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;AAuCiB,0BALH,CAAC,4BACJ,MAAM,MAAO,aACb,mBAAmB,GACjB,OAAO,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAiD7C;;IASqB,qBALR,CAAC,4BACJ,MAAM,MAAO,aACb,mBAAmB,GACjB,CAAC,CAgBb;IAQwB,4CAJb,MAAM,GAAC,MAAM,aACd,MAAM,gBAUhB;;;;;;;;;;;;;;;;aApHa,MAAM;;;;gBACN,MAAM;;;;;;;;;;;;;;;;;;;;uBAIN,OAAO;;;;2BACP,OAAO;;;;kBACP,cAAe;;;;qBACf,OAAO;;;;gBACP,MAAM,EAAE;;;;;;;;uBAKR,CAAC;;;;oBAED,MAAM;;;;;;;;;;YAEN,CAAC"}
@@ -4,21 +4,15 @@ declare class Configorama {
4
4
  settings: any;
5
5
  filterCache: {};
6
6
  _originalValueCache: Map<any, any>;
7
- _resolvedPaths: Set<any>;
8
- _fileContentCache: Map<any, any>;
9
- _needsRawClone: boolean;
10
7
  foundVariables: any[];
11
8
  fileRefsFound: any[];
12
9
  resolutionTracking: {};
13
- _trackCalls: boolean;
14
10
  variableSyntax: RegExp;
15
- variableSyntaxTest: RegExp;
16
11
  varPrefix: string;
17
12
  varSuffix: string;
18
13
  varPrefixPattern: RegExp;
19
14
  varSuffixPattern: RegExp;
20
15
  varSuffixWithSpacePattern: RegExp;
21
- ignorePathPatterns: string[][];
22
16
  rawOriginalConfig: any;
23
17
  config: any;
24
18
  originalConfig: any;
@@ -70,7 +64,22 @@ declare class Configorama {
70
64
  * @returns {object} Metadata object containing variables, fileRefs, and summary
71
65
  */
72
66
  collectVariableMetadata(): object;
73
- _cachedMetadata: any;
67
+ _cachedMetadata: {
68
+ variables: {};
69
+ uniqueVariables: {};
70
+ fileDependencies: {
71
+ globPatterns: any[];
72
+ dynamicPaths: any[];
73
+ resolvedPaths: any[];
74
+ byConfigPath: any[];
75
+ references: any[];
76
+ };
77
+ summary: {
78
+ totalVariables: number;
79
+ requiredVariables: number;
80
+ variablesWithDefaults: number;
81
+ };
82
+ };
74
83
  /**
75
84
  * Populate the variables in the given object.
76
85
  * @param objectToPopulate The object to populate variables within.
@@ -78,7 +87,6 @@ declare class Configorama {
78
87
  */
79
88
  populateObject(objectToPopulate: any): Promise<any>;
80
89
  populateObjectImpl(objectToPopulate: any): any;
81
- shouldSkipResolution(pathValue: any): any;
82
90
  /**
83
91
  * The declaration of a terminal property. This declaration includes the path and value of the
84
92
  * property.
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.js"],"names":[],"mappings":";AA0IA;IACE,0CA8fC;IAtfC,cAuBW;IAuBX,gBAAqB;IAErB,mCAAoC;IAGpC,yBAA+B;IAG/B,iCAAkC;IAMlC,wBAIC;IAED,sBAAwB;IACxB,qBAAuB;IAGvB,uBAA4B;IAE5B,qBAAmD;IAuBnD,uBAAoC;IAIpC,2BAAkG;IAIlG,kBAAqC;IACrC,kBAAqC;IAErC,yBAA+F;IAC/F,yBAAuD;IACvD,kCAAyE;IACzE,+BAAiF;IAM7E,uBAAgD;IAMlD,YAAuB;IAEvB,oBAA0C;IAE1C,gBAAoD;IAOpD,uBAAkC;IAElC,uBAA8B;IAE9B,uBAAkC;IASpC,wBAAmC;IAGnC,mBAqHC;IAwED,4BAA8C;IAG9C,iCAAkC;IAalC,aA2EC;IAUD,oBAEC;IAGD,eAiDC;IAOD,YAAc;IACd,cAAgB;IAChB,kBAAkB;IAGpB;;;;OAIG;IACH,0BAHW,MAAM,GACJ,OAAO,CAQnB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CAOvB;IAED;;;;OAIG;IACH,gCAHW,MAAM,GACJ,OAAO,CA2BnB;IAKD;;;;;OAKG;IACH,oBAFa,OAA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;;OAaG;IACH,wEAoDC;IAKD,4BAOC;IACD,sCAqEC;CACF"}
@@ -14,7 +14,6 @@
14
14
  * @param {RegExp} ctx.textRefSyntax - Regex for text() syntax
15
15
  * @param {string} ctx.varPrefix - Variable prefix (e.g., '${')
16
16
  * @param {string} ctx.varSuffix - Variable suffix (e.g., '}')
17
- * @param {Map<string, string>} [ctx.fileContentCache] - Optional per-instance read cache keyed by absolute file path
18
17
  * @param {string} variableString - The variable string to resolve
19
18
  * @param {object} options - Resolution options
20
19
  * @returns {Promise<any>}
@@ -33,7 +32,6 @@ export function getValueFromFile(ctx: {
33
32
  textRefSyntax: RegExp;
34
33
  varPrefix: string;
35
34
  varSuffix: string;
36
- fileContentCache?: Map<string, string>;
37
35
  }, variableString: string, options: object): Promise<any>;
38
36
  /**
39
37
  * Parse file contents based on file extension
@@ -1 +1 @@
1
- {"version":3,"file":"valueFromFile.d.ts","sourceRoot":"","sources":["../../../src/resolvers/valueFromFile.js"],"names":[],"mappings":"AA8FA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,sCAlBG;IAAoB,UAAU,EAAtB,MAAM;IACK,aAAa;IACZ,cAAc,EAA1B,MAAM;IACM,mBAAmB,EAA/B,MAAM;IACM,aAAa,EAAzB,MAAM;IACM,IAAI,EAAhB,MAAM;IACM,cAAc,EAA1B,MAAM;IACM,MAAM,EAAlB,MAAM;IACQ,cAAc;IAChB,aAAa,EAAzB,MAAM;IACM,aAAa,EAAzB,MAAM;IACM,SAAS,EAArB,MAAM;IACM,SAAS,EAArB,MAAM;IACoB,gBAAgB,GAA1C,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B,kBAAQ,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CA+VxB;AA5YD;;;;;GAKG;AACH,2CAJW,MAAM,YACN,MAAM,GACJ,GAAC,CAoBb;AAsXD;;;;;;GAMG;AACH,qDAJW,MAAM,qBACN,MAAM,GACJ;IAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,GAAC,IAAI,CAAA;CAAE,CAkBhE;AAED;;;;;;GAMG;AACH,sDALW,MAAM,qBACN,MAAM,yBACN,OAAO,GACL,MAAM,EAAE,CAcpB"}
1
+ {"version":3,"file":"valueFromFile.d.ts","sourceRoot":"","sources":["../../../src/resolvers/valueFromFile.js"],"names":[],"mappings":"AA8FA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sCAjBG;IAAoB,UAAU,EAAtB,MAAM;IACK,aAAa;IACZ,cAAc,EAA1B,MAAM;IACM,mBAAmB,EAA/B,MAAM;IACM,aAAa,EAAzB,MAAM;IACM,IAAI,EAAhB,MAAM;IACM,cAAc,EAA1B,MAAM;IACM,MAAM,EAAlB,MAAM;IACQ,cAAc;IAChB,aAAa,EAAzB,MAAM;IACM,aAAa,EAAzB,MAAM;IACM,SAAS,EAArB,MAAM;IACM,SAAS,EAArB,MAAM;CACd,kBAAQ,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAwVxB;AApYD;;;;;GAKG;AACH,2CAJW,MAAM,YACN,MAAM,GACJ,GAAC,CAoBb;AA8WD;;;;;;GAMG;AACH,qDAJW,MAAM,qBACN,MAAM,GACJ;IAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,GAAC,IAAI,CAAA;CAAE,CAkBhE;AAED;;;;;;GAMG;AACH,sDALW,MAAM,qBACN,MAAM,yBACN,OAAO,GACL,MAAM,EAAE,CAcpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"valueFromGit.d.ts","sourceRoot":"","sources":["../../../src/resolvers/valueFromGit.js"],"names":[],"mappings":"AA4XiB;;;;;;;;EAUhB"}
1
+ {"version":3,"file":"valueFromGit.d.ts","sourceRoot":"","sources":["../../../src/resolvers/valueFromGit.js"],"names":[],"mappings":"AA2XiB;;;;;;;;EAUhB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=valueFromSelf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueFromSelf.d.ts","sourceRoot":"","sources":["../../../src/resolvers/valueFromSelf.js"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/parse.js"],"names":[],"mappings":";;;;cA4Dc,MAAM;;;;cACN,MAAM;;;;eACN,MAAM;;;;kBACN,cAAe;;;;;;eAyIf,MAAM;;;;kBACN,cAAe;;AA/I7B;;;;;;GAMG;AAEH;;;;GAIG;AACH,iFAHW,YAAY,OAgItB;AAED;;;;GAIG;AAEH;;;;;GAKG;AACH,oCAJW,MAAM,SACN,gBAAgB,OAW1B"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/parse.js"],"names":[],"mappings":";;;;cAgBc,MAAM;;;;cACN,MAAM;;;;eACN,MAAM;;;;kBACN,cAAe;;;;;;eAmIf,MAAM;;;;kBACN,cAAe;;AAzI7B;;;;;;GAMG;AAEH;;;;GAIG;AACH,iFAHW,YAAY,OA0HtB;AAED;;;;GAIG;AAEH;;;;;GAKG;AACH,oCAJW,MAAM,SACN,gBAAgB,OAW1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"preProcess.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/preProcess.js"],"names":[],"mappings":";AASA;;;;;;;;GAQG;AACH,+DANW,MAAM,mCAGd;IAA0B,eAAe,GAAjC,OAAO;CACf,OA4XF"}
1
+ {"version":3,"file":"preProcess.d.ts","sourceRoot":"","sources":["../../../../src/utils/parsing/preProcess.js"],"names":[],"mappings":";AASA;;;;;;;;GAQG;AACH,+DANW,MAAM,mCAGd;IAA0B,eAAe,GAAjC,OAAO;CACf,OAgYF"}
@@ -9,13 +9,4 @@
9
9
  * @returns {number} Line number (1-indexed) or 0 if not found
10
10
  */
11
11
  export function findLineForKey(keyToFind: string, lines: string[], fileType: string): number;
12
- /**
13
- * Walk a dot-separated config path through raw file lines to find the exact line.
14
- * YAML uses indentation-based nesting, JSON uses brace-based nesting.
15
- * @param {string} configPath - Dot-separated path (e.g. 'resources.Parameters.Description')
16
- * @param {string[]} lines - Array of file lines
17
- * @param {string} fileType - File extension (e.g., '.yml', '.json')
18
- * @returns {number} Line number (1-indexed) or 0 if not found
19
- */
20
- export function findLineByPath(configPath: string, lines: string[], fileType: string): number;
21
12
  //# sourceMappingURL=findLineForKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"findLineForKey.d.ts","sourceRoot":"","sources":["../../../../src/utils/paths/findLineForKey.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,0CALW,MAAM,SACN,MAAM,EAAE,YACR,MAAM,GACJ,MAAM,CAiClB;AAED;;;;;;;GAOG;AACH,2CALW,MAAM,SACN,MAAM,EAAE,YACR,MAAM,GACJ,MAAM,CAYlB"}
1
+ {"version":3,"file":"findLineForKey.d.ts","sourceRoot":"","sources":["../../../../src/utils/paths/findLineForKey.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,0CALW,MAAM,SACN,MAAM,EAAE,YACR,MAAM,GACJ,MAAM,CAiClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"replaceAll.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/replaceAll.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wCALW,MAAM,YACN,MAAM,UACN,MAAM,GACJ,MAAM,CAelB"}
1
+ {"version":3,"file":"replaceAll.d.ts","sourceRoot":"","sources":["../../../../src/utils/strings/replaceAll.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wCALW,MAAM,YACN,MAAM,UACN,MAAM,GACJ,MAAM,CAelB"}
@@ -23,7 +23,7 @@ export function verifyVariable(variableString: any, valueObject: any, variableTy
23
23
  * Excludes suffix characters from the allowed set to prevent parsing issues
24
24
  * @param {string} [prefix='${'] - Variable prefix
25
25
  * @param {string} [suffix='}'] - Variable suffix
26
- * @param {string[]} [excludePatterns=['AWS', 'aws:', 'stageVariables']] - Patterns to exclude via negative lookahead
26
+ * @param {string[]} [excludePatterns=['AWS', 'stageVariables']] - Patterns to exclude via negative lookahead
27
27
  * @returns {string} Regex source string
28
28
  */
29
29
  export function buildVariableSyntax(prefix?: string, suffix?: string, excludePatterns?: string[]): string;
@@ -1,62 +0,0 @@
1
- /**
2
- * Display "No Variables Found" message
3
- * @param {string} configFilePath
4
- * @param {RegExp} variableSyntax
5
- * @param {Object} variableTypes
6
- */
7
- export function displayNoVariablesFound(configFilePath: string, variableSyntax: RegExp, variableTypes: any): void;
8
- /**
9
- * Display variable details in stacked box format
10
- * @param {Object} params
11
- * @param {string[]} params.varKeys
12
- * @param {Object} params.variableData
13
- * @param {Object} params.uniqueVariables
14
- * @param {RegExp} params.varPrefixPattern
15
- * @param {RegExp} params.varSuffixPattern
16
- * @param {string[]} params.lines
17
- * @param {string} params.fileType
18
- * @param {string} params.configFilePath
19
- */
20
- export function displayVariableDetails({ varKeys, variableData, uniqueVariables, varPrefixPattern, varSuffixPattern, lines, fileType, configFilePath }: {
21
- varKeys: string[];
22
- variableData: any;
23
- uniqueVariables: any;
24
- varPrefixPattern: RegExp;
25
- varSuffixPattern: RegExp;
26
- lines: string[];
27
- fileType: string;
28
- configFilePath: string;
29
- }): void;
30
- /**
31
- * Display unique variables in stacked box format
32
- * @param {Object} params
33
- * @param {string[]} params.uniqueVarKeys
34
- * @param {Object} params.uniqueVariables
35
- * @param {string[]} params.lines
36
- * @param {string} params.fileType
37
- * @param {string} params.configFilePath
38
- */
39
- export function displayUniqueVariables({ uniqueVarKeys, uniqueVariables, lines, fileType, configFilePath }: {
40
- uniqueVarKeys: string[];
41
- uniqueVariables: any;
42
- lines: string[];
43
- fileType: string;
44
- configFilePath: string;
45
- }): void;
46
- /**
47
- * Display configurable variables grouped by source type
48
- * @param {Object} params
49
- * @param {string[]} params.uniqueVarKeys
50
- * @param {Object} params.uniqueVariables
51
- * @param {string[]} params.lines
52
- * @param {string} params.fileType
53
- * @param {string} params.configFilePath
54
- */
55
- export function displayConfigurableVariables({ uniqueVarKeys, uniqueVariables, lines, fileType, configFilePath }: {
56
- uniqueVarKeys: string[];
57
- uniqueVariables: any;
58
- lines: string[];
59
- fileType: string;
60
- configFilePath: string;
61
- }): void;
62
- //# sourceMappingURL=display.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/display.js"],"names":[],"mappings":"AAcA;;;;;GAKG;AACH,wDAJW,MAAM,kBACN,MAAM,4BAwBhB;AAED;;;;;;;;;;;GAWG;AACH,wJATG;IAAyB,OAAO,EAAxB,MAAM,EAAE;IACO,YAAY;IACZ,eAAe;IACf,gBAAgB,EAA/B,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACW,KAAK,EAAtB,MAAM,EAAE;IACO,QAAQ,EAAvB,MAAM;IACS,cAAc,EAA7B,MAAM;CAChB,QAyJA;AAED;;;;;;;;GAQG;AACH,4GANG;IAAyB,aAAa,EAA9B,MAAM,EAAE;IACO,eAAe;IACb,KAAK,EAAtB,MAAM,EAAE;IACO,QAAQ,EAAvB,MAAM;IACS,cAAc,EAA7B,MAAM;CAChB,QAiHA;AAED;;;;;;;;GAQG;AACH,kHANG;IAAyB,aAAa,EAA9B,MAAM,EAAE;IACO,eAAe;IACb,KAAK,EAAtB,MAAM,EAAE;IACO,QAAQ,EAAvB,MAAM;IACS,cAAc,EAA7B,MAAM;CAChB,QAyIA"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Collect metadata about all variables found in the configuration
3
- * @param {Object} params
4
- * @param {RegExp} params.variableSyntax
5
- * @param {Object} params.variablesKnownTypes
6
- * @param {Object} params.variableTypes
7
- * @param {RegExp|null} params.filterMatch
8
- * @param {string} params.configFilePath
9
- * @param {Object} params.displayConfig - rawOriginalConfig || originalConfig, used for traversal
10
- * @param {Object} params.originalConfig - this.originalConfig, used for dotProp.get checks
11
- * @param {string} params.varSuffix
12
- * @param {RegExp} params.varSuffixWithSpacePattern
13
- * @param {string[][]} [params.ignorePathPatterns]
14
- * @returns {Object} Metadata object containing variables, fileDependencies, and summary
15
- */
16
- export function collectVariableMetadata({ variableSyntax, variablesKnownTypes, variableTypes, filterMatch, configFilePath, displayConfig, originalConfig, varSuffix, varSuffixWithSpacePattern, ignorePathPatterns, }: {
17
- variableSyntax: RegExp;
18
- variablesKnownTypes: any;
19
- variableTypes: any;
20
- filterMatch: RegExp | null;
21
- configFilePath: string;
22
- displayConfig: any;
23
- originalConfig: any;
24
- varSuffix: string;
25
- varSuffixWithSpacePattern: RegExp;
26
- ignorePathPatterns?: string[][];
27
- }): any;
28
- //# sourceMappingURL=metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/metadata.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;GAcG;AACH,uNAZG;IAAuB,cAAc,EAA7B,MAAM;IACS,mBAAmB;IACnB,aAAa;IACR,WAAW,EAA/B,MAAM,GAAC,IAAI;IACI,cAAc,EAA7B,MAAM;IACS,aAAa;IACb,cAAc;IACd,SAAS,EAAxB,MAAM;IACS,yBAAyB,EAAxC,MAAM;IACc,kBAAkB,GAAtC,MAAM,EAAE,EAAE;CAClB,OA0aF"}
@@ -1,10 +0,0 @@
1
- export = BoundedMap;
2
- declare class BoundedMap {
3
- constructor(maxSize?: number);
4
- _map: Map<any, any>;
5
- _maxSize: number;
6
- get(key: any): any;
7
- has(key: any): boolean;
8
- set(key: any, value: any): this;
9
- }
10
- //# sourceMappingURL=BoundedMap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BoundedMap.d.ts","sourceRoot":"","sources":["../../../src/utils/BoundedMap.js"],"names":[],"mappings":";AAGA;IACE,8BAGC;IAFC,oBAAqB;IACrB,iBAAuB;IAEzB,mBAEC;IACD,uBAEC;IACD,gCAOC;CACF"}
@@ -1,5 +0,0 @@
1
- export const DEFAULT_IGNORE_PATHS: string[];
2
- export function normalizeIgnorePaths(options?: {}): any[];
3
- export function compileIgnorePaths(patterns: any): string[][];
4
- export function shouldIgnorePath(pathValue: any, compiledPatterns: any): any;
5
- //# sourceMappingURL=ignorePaths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ignorePaths.d.ts","sourceRoot":"","sources":["../../../../src/utils/paths/ignorePaths.js"],"names":[],"mappings":"AAAA,4CAcC;AA8BD,0DAOC;AAED,8DAEC;AAED,6EAIC"}