@firestartr/cli 1.44.0-snapshot-1 → 1.44.1-snapshot-1
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
CHANGED
@@ -282293,44 +282293,55 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
282293
282293
|
|
282294
282294
|
|
282295
282295
|
|
282296
|
+
|
282296
282297
|
const lazy_loader_log = src_default()('firestartr:renderer:lazy_loader');
|
282297
|
-
async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, existingRefs = {}) {
|
282298
|
+
async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchClaim = loader_patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, existingRefs = {}) {
|
282298
282299
|
let result = existingRefs;
|
282299
282300
|
lazy_loader_log(`Load reference ${claimRef}`);
|
282300
282301
|
initVirtualClaims(org);
|
282301
282302
|
lazy_loader_log(`Load reference (parts) ${claimRef.split(/-/)[0]} ${claimRef.replace(/^[^-]+-/, '')}`);
|
282302
282303
|
// cargas datos con grep
|
282303
|
-
const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
|
282304
|
-
const claim = patchClaim(catalog_common.io.fromYaml(claimData), defaults);
|
282305
|
-
//const claim: any = common.io.fromYaml(claimData);
|
282306
282304
|
try {
|
282307
|
-
|
282308
|
-
|
282309
|
-
|
282310
|
-
|
282311
|
-
|
282312
|
-
|
282313
|
-
|
282314
|
-
|
282315
|
-
|
282316
|
-
|
282317
|
-
|
282318
|
-
|
282319
|
-
|
282320
|
-
|
282321
|
-
|
282322
|
-
|
282323
|
-
|
282324
|
-
|
282325
|
-
|
282326
|
-
|
282327
|
-
|
282305
|
+
const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
|
282306
|
+
const claim = patchClaim(catalog_common.io.fromYaml(claimData), defaults);
|
282307
|
+
try {
|
282308
|
+
validateClaim(claim, base[`${claim.kind}Schema`]);
|
282309
|
+
await optionalValidation(claim);
|
282310
|
+
}
|
282311
|
+
catch (error) {
|
282312
|
+
let errorMsg = '';
|
282313
|
+
for (const data of error) {
|
282314
|
+
errorMsg = `${errorMsg}
|
282315
|
+
- ${data.dataPath}: ${data.message}`;
|
282316
|
+
}
|
282317
|
+
throw new Error(`Error when validating claim ${claimRef}: ${errorMsg}`);
|
282318
|
+
}
|
282319
|
+
result[claimRef] = {};
|
282320
|
+
result[claimRef]['claim'] = claim;
|
282321
|
+
result[claimRef]['claimPath'] = VisitedClaims[claimRef];
|
282322
|
+
if (VisitedClaims[claimRef] === 'virtual') {
|
282323
|
+
result = await setVirtualClaimAdditionalData(result, claim, claimRef);
|
282324
|
+
}
|
282325
|
+
else {
|
282326
|
+
result = await setNonVirtualClaimAdditionalData(result, claim, claimRef, loadInitializers, loadGlobals, loadOverrides, loadNormalizers);
|
282327
|
+
}
|
282328
|
+
const claimKind = claim.kind;
|
282329
|
+
const references = extractAllRefs(catalog_common.io.toYaml(claim));
|
282330
|
+
for (const ref of references) {
|
282331
|
+
if (!result[ref]) {
|
282332
|
+
const resolvedReferences = await loadClaim(ref, org, defaults, patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, cwd, result);
|
282333
|
+
result = lodash_default().merge(result, resolvedReferences);
|
282334
|
+
}
|
282328
282335
|
}
|
282329
282336
|
}
|
282337
|
+
catch (err) {
|
282338
|
+
throw `Lazy Loading: ${err}`;
|
282339
|
+
}
|
282330
282340
|
return result;
|
282331
282341
|
}
|
282332
282342
|
const LoadedClaims = {};
|
282333
282343
|
const VisitedClaims = {};
|
282344
|
+
const DuplicatedClaims = {};
|
282334
282345
|
async function lazyGetClaim(kind, name, org, cwd) {
|
282335
282346
|
const indice = `${kind}-${name}`;
|
282336
282347
|
lazy_loader_log(`Lazy loading ${kind}-${name} with index ${indice}`);
|
@@ -282373,14 +282384,14 @@ async function getClaimsByName(name, cwd = '.') {
|
|
282373
282384
|
}
|
282374
282385
|
});
|
282375
282386
|
handler.on('close', () => {
|
282376
|
-
Promise.all(entradas.map((entrada) => {
|
282387
|
+
return Promise.all(entradas.map((entrada) => {
|
282377
282388
|
return loadRawClaim(entrada);
|
282378
282389
|
}))
|
282379
282390
|
.then(() => {
|
282380
282391
|
ok();
|
282381
282392
|
})
|
282382
|
-
.catch(() => {
|
282383
|
-
ko();
|
282393
|
+
.catch((err) => {
|
282394
|
+
ko(err);
|
282384
282395
|
});
|
282385
282396
|
});
|
282386
282397
|
});
|
@@ -282394,9 +282405,17 @@ async function loadRawClaim(entry) {
|
|
282394
282405
|
if (!('kind' in claim && 'name' in claim)) {
|
282395
282406
|
lazy_loader_log(`Invalid claim file ${entry}`);
|
282396
282407
|
}
|
282397
|
-
|
282398
|
-
|
282399
|
-
|
282408
|
+
else {
|
282409
|
+
const claimKey = `${claim.kind}-${claim.name}`;
|
282410
|
+
if (Object.keys(DuplicatedClaims).includes(claimKey) &&
|
282411
|
+
DuplicatedClaims[claimKey] !== entry) {
|
282412
|
+
return ko(`Duplicated claim ${claimKey} found files: ${DuplicatedClaims[claimKey]} and ${entry}`);
|
282413
|
+
}
|
282414
|
+
LoadedClaims[claimKey] = data;
|
282415
|
+
VisitedClaims[claimKey] = entry;
|
282416
|
+
DuplicatedClaims[claimKey] = entry;
|
282417
|
+
ok();
|
282418
|
+
}
|
282400
282419
|
});
|
282401
282420
|
});
|
282402
282421
|
}
|
@@ -282618,7 +282637,7 @@ async function loadClaims(claimsPath = config_getPath('claims')) {
|
|
282618
282637
|
await crawler_crawl(claimsPath, (entry) => {
|
282619
282638
|
return isYamlFile.test(entry);
|
282620
282639
|
}, async (entry, data) => {
|
282621
|
-
const claim =
|
282640
|
+
const claim = loader_patchClaim(catalog_common.io.fromYaml(data), defaultsClaims);
|
282622
282641
|
if (!('kind' in claim && 'name' in claim)) {
|
282623
282642
|
throw new Error(`Invalid claim file ${entry}`);
|
282624
282643
|
}
|
@@ -282655,7 +282674,7 @@ function loadClaimDefaults() {
|
|
282655
282674
|
* - The patched claim
|
282656
282675
|
*
|
282657
282676
|
*/
|
282658
|
-
function
|
282677
|
+
function loader_patchClaim(claim, defaultsClaims) {
|
282659
282678
|
if (defaultsClaims[claim.kind]) {
|
282660
282679
|
const jsonPatchOps = fast_json_patch.compare(claim, defaultsClaims[claim.kind])
|
282661
282680
|
.filter((jp) => {
|
@@ -282799,7 +282818,7 @@ async function loadClaimsList(claimRefList, claimsPath = config_getPath('claims'
|
|
282799
282818
|
};
|
282800
282819
|
const defaults = loadClaimDefaults();
|
282801
282820
|
for (const claimRef of claimRefList) {
|
282802
|
-
const renderedClaimData = await loadClaim(claimRef, getOrg(), defaults,
|
282821
|
+
const renderedClaimData = await loadClaim(claimRef, getOrg(), defaults, loader_patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, claimsPath);
|
282803
282822
|
data.renderClaims = lodash_default().merge(data.renderClaims, renderedClaimData);
|
282804
282823
|
}
|
282805
282824
|
const crClaimReferences = [];
|
@@ -286925,7 +286944,7 @@ class FeatureRepoChart extends BaseGithubChart {
|
|
286925
286944
|
spec: {
|
286926
286945
|
context: claim.context,
|
286927
286946
|
type: claim.name,
|
286928
|
-
version: claim.feature.version,
|
286947
|
+
version: claim.feature.version || claim.feature.ref,
|
286929
286948
|
org: claim.org,
|
286930
286949
|
repositoryTarget,
|
286931
286950
|
files: claim.files,
|
@@ -428,7 +428,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
428
428
|
verified_at: string;
|
429
429
|
};
|
430
430
|
};
|
431
|
-
author: {
|
431
|
+
author: Record<string, never> | {
|
432
432
|
name?: string;
|
433
433
|
email?: string;
|
434
434
|
login: string;
|
@@ -451,8 +451,8 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
451
451
|
site_admin: boolean;
|
452
452
|
starred_at?: string;
|
453
453
|
user_view_type?: string;
|
454
|
-
}
|
455
|
-
committer: {
|
454
|
+
};
|
455
|
+
committer: Record<string, never> | {
|
456
456
|
name?: string;
|
457
457
|
email?: string;
|
458
458
|
login: string;
|
@@ -475,7 +475,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
475
475
|
site_admin: boolean;
|
476
476
|
starred_at?: string;
|
477
477
|
user_view_type?: string;
|
478
|
-
}
|
478
|
+
};
|
479
479
|
parents: {
|
480
480
|
sha: string;
|
481
481
|
url: string;
|