@firestartr/cli 1.59.0-snapshot-12 → 1.59.0-snapshot-14

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.
Files changed (2) hide show
  1. package/build/index.js +18 -8
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -366097,8 +366097,8 @@ async function renderTfWorkspace(claim, firestartrId, resolveRef, namespace) {
366097
366097
 
366098
366098
 
366099
366099
  // ref must match type-imported-ref where type can be group|user and:<value>
366100
- // example: user-importer-ref:My Group
366101
- const REGEX_IMPORTED_REF = /(?<type>user|group)-imported-ref:(?<value>.+)/;
366100
+ // example: user-imported-ref:My Group
366101
+ const REGEX_IMPORTED_REF = /^(?<type>user|group)-imported-ref:(?<value>.+)$/;
366102
366102
  function importedsRefsWalker(renderClaim) {
366103
366103
  // cr is an object, we want to walk through all its properties recursively
366104
366104
  // the property can be another object, an array, or a primitive value
@@ -366139,7 +366139,10 @@ function walkObject(obj, symbolsToResolve, renderClaim) {
366139
366139
  const resolvedValue = await solver(type, match.groups?.value);
366140
366140
  cdk8s_renderer_src_logger.info(`Resolved imported-ref with key ${key} and value ${value} to ${resolvedValue} in path ${renderClaim.claimPath}`);
366141
366141
  obj[catchedKey] = resolvedValue;
366142
- await catalog_common.io.writeClaim(renderClaim.claim, renderClaim.claimPath || '');
366142
+ if (!renderClaim.claimPath) {
366143
+ throw new Error('claimPath is required to write the claim after resolving imported refs in ${catchedKey}');
366144
+ }
366145
+ await catalog_common.io.writeClaim(renderClaim.claim, renderClaim.claimPath);
366143
366146
  });
366144
366147
  }
366145
366148
  }
@@ -366178,6 +366181,7 @@ function walkArray(arr, symbolsToResolve, renderClaim) {
366178
366181
 
366179
366182
 
366180
366183
 
366184
+
366181
366185
  /*
366182
366186
  * Function called when rendering from the importer class.
366183
366187
  *
@@ -366196,10 +366200,16 @@ async function renderFromImports(rClaims, crs = {}, catalogOutputDir = '/tmp/.ca
366196
366200
  const fSolver = (type, value) => {
366197
366201
  return solver(type, value, rClaims);
366198
366202
  };
366199
- // we need to expand the imported-refs
366200
- for (const renderClaim of Object.values(rClaims)) {
366201
- const symbolsToResolve = importedsRefsWalker(renderClaim);
366202
- await Promise.all(symbolsToResolve.map((s) => s(fSolver)));
366203
+ try {
366204
+ // we need to expand the imported-refs
366205
+ for (const renderClaim of Object.values(rClaims)) {
366206
+ const symbolsToResolve = importedsRefsWalker(renderClaim);
366207
+ await Promise.all(symbolsToResolve.map((s) => s(fSolver)));
366208
+ }
366209
+ }
366210
+ catch (e) {
366211
+ cdk8s_renderer_src_logger.error(`Error while resolving imported-refs: ${e.message}`);
366212
+ throw new Error(`Error while resolving imported-refs: ${e.message}`);
366203
366213
  }
366204
366214
  const catalogScope = new lib.App({
366205
366215
  outdir: catalogOutputDir,
@@ -376739,7 +376749,7 @@ const crs_analyzerSubcommand = {
376739
376749
  };
376740
376750
 
376741
376751
  ;// CONCATENATED MODULE: ./package.json
376742
- const package_namespaceObject = JSON.parse('{"i8":"1.59.0-snapshot-12"}');
376752
+ const package_namespaceObject = JSON.parse('{"i8":"1.59.0-snapshot-14"}');
376743
376753
  ;// CONCATENATED MODULE: ../../package.json
376744
376754
  const package_namespaceObject_1 = {"i8":"1.58.0"};
376745
376755
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.59.0-snapshot-12",
3
+ "version": "1.59.0-snapshot-14",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",