@firestartr/cli 1.44.0-snapshot-2 → 1.44.1-snapshot-3
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
@@ -282301,37 +282301,47 @@ async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchCla
|
|
282301
282301
|
initVirtualClaims(org);
|
282302
282302
|
lazy_loader_log(`Load reference (parts) ${claimRef.split(/-/)[0]} ${claimRef.replace(/^[^-]+-/, '')}`);
|
282303
282303
|
// cargas datos con grep
|
282304
|
-
const claimData = await lazyGetClaim(claimRef.split(/-/)[0], claimRef.replace(/^[^-]+-/, ''), org, cwd);
|
282305
|
-
const claim = patchClaim(catalog_common.io.fromYaml(claimData), defaults);
|
282306
|
-
//const claim: any = common.io.fromYaml(claimData);
|
282307
282304
|
try {
|
282308
|
-
|
282309
|
-
|
282310
|
-
|
282311
|
-
|
282312
|
-
|
282313
|
-
|
282314
|
-
|
282315
|
-
|
282316
|
-
|
282317
|
-
|
282318
|
-
|
282319
|
-
|
282320
|
-
|
282321
|
-
|
282322
|
-
|
282323
|
-
|
282324
|
-
|
282325
|
-
|
282326
|
-
|
282327
|
-
|
282328
|
-
|
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
|
+
}
|
282329
282335
|
}
|
282330
282336
|
}
|
282337
|
+
catch (err) {
|
282338
|
+
throw `Lazy Loading: ${err}`;
|
282339
|
+
}
|
282331
282340
|
return result;
|
282332
282341
|
}
|
282333
282342
|
const LoadedClaims = {};
|
282334
282343
|
const VisitedClaims = {};
|
282344
|
+
const DuplicatedClaims = {};
|
282335
282345
|
async function lazyGetClaim(kind, name, org, cwd) {
|
282336
282346
|
const indice = `${kind}-${name}`;
|
282337
282347
|
lazy_loader_log(`Lazy loading ${kind}-${name} with index ${indice}`);
|
@@ -282374,14 +282384,14 @@ async function getClaimsByName(name, cwd = '.') {
|
|
282374
282384
|
}
|
282375
282385
|
});
|
282376
282386
|
handler.on('close', () => {
|
282377
|
-
Promise.all(entradas.map((entrada) => {
|
282387
|
+
return Promise.all(entradas.map((entrada) => {
|
282378
282388
|
return loadRawClaim(entrada);
|
282379
282389
|
}))
|
282380
282390
|
.then(() => {
|
282381
282391
|
ok();
|
282382
282392
|
})
|
282383
|
-
.catch(() => {
|
282384
|
-
ko();
|
282393
|
+
.catch((err) => {
|
282394
|
+
ko(err);
|
282385
282395
|
});
|
282386
282396
|
});
|
282387
282397
|
});
|
@@ -282395,9 +282405,17 @@ async function loadRawClaim(entry) {
|
|
282395
282405
|
if (!('kind' in claim && 'name' in claim)) {
|
282396
282406
|
lazy_loader_log(`Invalid claim file ${entry}`);
|
282397
282407
|
}
|
282398
|
-
|
282399
|
-
|
282400
|
-
|
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
|
+
}
|
282401
282419
|
});
|
282402
282420
|
});
|
282403
282421
|
}
|
@@ -284380,7 +284398,7 @@ class FeaturesOverrider extends OverriderPatches {
|
|
284380
284398
|
}
|
284381
284399
|
async __patches(claim, _previousCR) {
|
284382
284400
|
const featureName = this.featureName;
|
284383
|
-
const featureVersion = this.featureVersion;
|
284401
|
+
const featureVersion = this.featureVersion || this.featureRef;
|
284384
284402
|
const featureArgs = this.featureArgs;
|
284385
284403
|
const fSetUpAndRunRenderer = function (cr) {
|
284386
284404
|
return this.setUpAndRunRenderer(cr);
|
@@ -286926,7 +286944,7 @@ class FeatureRepoChart extends BaseGithubChart {
|
|
286926
286944
|
spec: {
|
286927
286945
|
context: claim.context,
|
286928
286946
|
type: claim.name,
|
286929
|
-
version: claim.feature.version,
|
286947
|
+
version: claim.feature.version || claim.feature.ref,
|
286930
286948
|
org: claim.org,
|
286931
286949
|
repositoryTarget,
|
286932
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;
|