@firestartr/cli 1.42.1-snapshot-4 → 1.42.1-snapshot-5
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/build/index.js +20 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
@@ -285869,6 +285869,7 @@ function initVirtualClaims(org) {
|
|
285869
285869
|
PRECALCULATED_VIRTUAL_CLAIMS[`GroupClaim-${org}-all`] = FirestartrAllClaim;
|
285870
285870
|
}
|
285871
285871
|
function isVirtualClaim(kind, name) {
|
285872
|
+
console.log(`Checking ${kind}-${name} agains ${Object.keys(PRECALCULATED_VIRTUAL_CLAIMS)}`);
|
285872
285873
|
return (Object.keys(PRECALCULATED_VIRTUAL_CLAIMS).indexOf(`${kind}-${name}`) !== -1);
|
285873
285874
|
}
|
285874
285875
|
function getVirtualClaim(kind, name) {
|
@@ -287185,6 +287186,7 @@ function extractRefs(renderClaims, kind) {
|
|
287185
287186
|
function extractAllRefs(claimData) {
|
287186
287187
|
const refs = getClaimReferences(claimData);
|
287187
287188
|
const parsedClaim = yaml_dist.parse(claimData);
|
287189
|
+
refs.push(...extractVirtualRefs(parsedClaim));
|
287188
287190
|
switch (parsedClaim.kind) {
|
287189
287191
|
case 'TFWorkspaceClaim': {
|
287190
287192
|
const tfWorkspaceRefs = getTfWorkspacesRefs(parsedClaim.providers.terraform.values);
|
@@ -287205,6 +287207,20 @@ function extractAllRefs(claimData) {
|
|
287205
287207
|
}
|
287206
287208
|
return [...new Set(refs)];
|
287207
287209
|
}
|
287210
|
+
function extractVirtualRefs(parsedClaim) {
|
287211
|
+
const virtualRefs = [];
|
287212
|
+
switch (parsedClaim.kind) {
|
287213
|
+
case 'ComponentClaim': {
|
287214
|
+
if (parsedClaim.providers.github.orgPermissions === 'view' ||
|
287215
|
+
parsedClaim.providers.github.orgPermissions === 'maintain') {
|
287216
|
+
refsExtractor_log(`Adding virtual reference for ${parsedClaim.providers.github.org}-all`);
|
287217
|
+
virtualRefs.push(`GroupClaim-${parsedClaim.providers.github.org}-all`);
|
287218
|
+
}
|
287219
|
+
break;
|
287220
|
+
}
|
287221
|
+
}
|
287222
|
+
return virtualRefs;
|
287223
|
+
}
|
287208
287224
|
function getGroupParentRef(parent, references = []) {
|
287209
287225
|
if (!parent)
|
287210
287226
|
return [];
|
@@ -287315,7 +287331,9 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
287315
287331
|
const lazy_loader_log = src_default()('firestartr:renderer:lazy_loader');
|
287316
287332
|
async function loadClaim(claimRef, org, defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, existingRefs = {}) {
|
287317
287333
|
let result = existingRefs;
|
287334
|
+
lazy_loader_log(`Load reference ${claimRef}`);
|
287318
287335
|
initVirtualClaims(org);
|
287336
|
+
lazy_loader_log(`Load reference (parts) ${claimRef.split(/-/)[0]} ${claimRef.replace(/^[^-]+-/, '')}`);
|
287319
287337
|
// cargas datos con grep
|
287320
287338
|
const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
|
287321
287339
|
const claim = patchClaim(catalog_common.io.fromYaml(claimData), defaults);
|
@@ -287342,6 +287360,7 @@ const LoadedClaims = {};
|
|
287342
287360
|
const VisitedClaims = {};
|
287343
287361
|
async function lazyGetClaim(kind, name, org, cwd) {
|
287344
287362
|
const indice = `${kind}-${name}`;
|
287363
|
+
lazy_loader_log(`Lazy loading ${kind}-${name} with index ${indice}`);
|
287345
287364
|
if (indice in LoadedClaims)
|
287346
287365
|
return LoadedClaims[indice];
|
287347
287366
|
if (isVirtualClaim(kind, name)) {
|
@@ -287430,6 +287449,7 @@ async function setNonVirtualClaimAdditionalData(renderedData, claim, claimRef, l
|
|
287430
287449
|
async function loadVirtualClaim(kind, name, org) {
|
287431
287450
|
const virtualClaim = getVirtualClaim(kind, name);
|
287432
287451
|
const expandedClaim = await virtualClaim.expand({ org });
|
287452
|
+
lazy_loader_log(`Loading virtual claim ${kind} ${name} ${org}`);
|
287433
287453
|
LoadedClaims[`${kind}-${name}`] = catalog_common.io.toYaml(expandedClaim);
|
287434
287454
|
VisitedClaims[`${kind}-${name}`] = 'virtual';
|
287435
287455
|
}
|