@firestartr/cli 1.45.0-snapshot-9 → 1.45.0-snapshot-10

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
@@ -263047,26 +263047,26 @@ const fullMembersTeam = getFromEnvironmentWithDefault(envVars.fullOrgGroup, `${o
263047
263047
 
263048
263048
 
263049
263049
  const tarballs_messageLog = src_default()('firestartr:catalog_common:features:tarballs');
263050
- function getFeatureZipDownloadPath(featureName, version, owner, repo) {
263051
- const featureDownloadPath = `/tmp/${basicFeaturePath(featureName, version, owner, repo)}-zipball.zip`;
263050
+ function getFeatureZipDownloadPath(featureName, version) {
263051
+ const featureDownloadPath = `/tmp/${featureName}-${version}-zipball.zip`;
263052
263052
  tarballs_messageLog('Feature tarball download path %s', featureDownloadPath);
263053
263053
  return featureDownloadPath;
263054
263054
  }
263055
- function removeFeatureTarball(featureName, version, owner, repo) {
263056
- const featurePath = getFeatureZipDownloadPath(featureName, version, owner, repo);
263055
+ function removeFeatureTarball(featureName, version) {
263056
+ const featurePath = getFeatureZipDownloadPath(featureName, version);
263057
263057
  tarballs_messageLog('Removing feature tarball %s', featurePath);
263058
263058
  external_fs_.unlinkSync(featurePath);
263059
263059
  tarballs_messageLog(`Removed tarball for feature ${featureName} and version ${version}: ${featurePath}`);
263060
263060
  }
263061
- function featureTarballExists(featureName, version, owner, repo) {
263062
- const featurePath = getFeatureZipDownloadPath(featureName, version, owner, repo);
263061
+ function featureTarballExists(featureName, version) {
263062
+ const featurePath = getFeatureZipDownloadPath(featureName, version);
263063
263063
  const exists = external_fs_.existsSync(featurePath);
263064
263064
  tarballs_messageLog(`Tarball ${featurePath} exists? ${exists}`);
263065
263065
  return exists;
263066
263066
  }
263067
- function getFeaturesExtractPath(featureName, version, owner, repo, options = {}) {
263067
+ function getFeaturesExtractPath(featureName, version, options = {}) {
263068
263068
  const { createIfNotExists } = options;
263069
- const extractPath = `/tmp/${basicFeaturePath(featureName, version, owner, repo)}-extract`;
263069
+ const extractPath = `/tmp/${featureName}-${version}-extract`;
263070
263070
  tarballs_messageLog('Extract path %s', extractPath);
263071
263071
  if (createIfNotExists && !external_fs_.existsSync(extractPath)) {
263072
263072
  tarballs_messageLog('Extract path %s does not exist, creating', extractPath);
@@ -263074,13 +263074,6 @@ function getFeaturesExtractPath(featureName, version, owner, repo, options = {})
263074
263074
  }
263075
263075
  return extractPath;
263076
263076
  }
263077
- function basicFeaturePath(featureName, version, owner, repo) {
263078
- const legs = [owner, repo, featureName, version].map((leg) => trasformLeg(leg));
263079
- return legs.join('-');
263080
- }
263081
- function trasformLeg(leg) {
263082
- return leg.replace(/\//g, '___');
263083
- }
263084
263077
 
263085
263078
  ;// CONCATENATED MODULE: ../catalog_common/src/features/features_io.ts
263086
263079
 
@@ -263088,7 +263081,7 @@ function trasformLeg(leg) {
263088
263081
 
263089
263082
  const features_io_messageLog = src_default()('firestartr:catalog_common:features:features_io');
263090
263083
  function getFeatureRenderedPathForEntity(entity, featureName, basePath = '/tmp') {
263091
- const entityFolderName = `${entity.metadata.name}`.toLowerCase();
263084
+ const entityFolderName = `${entity.kind}-${entity.metadata.name}`.toLowerCase();
263092
263085
  return external_path_default().join(basePath, entityFolderName, featureName);
263093
263086
  }
263094
263087
  function getFeatureRenderedConfigForComponent(entity, featureName, basePath = '/tmp/features') {
@@ -271648,7 +271641,6 @@ async function crawlWithExclusions(dir, filter, exec, excludedPaths = []) {
271648
271641
  }, exec);
271649
271642
  }
271650
271643
  catch (err) {
271651
- console.log(err);
271652
271644
  throw `Crawling with exclusions: ${dir}: ${err}`;
271653
271645
  }
271654
271646
  }
@@ -271674,7 +271666,6 @@ async function crawler_crawl(dir, filter, exec) {
271674
271666
  });
271675
271667
  }
271676
271668
  catch (err) {
271677
- console.log(err);
271678
271669
  throw `Crawling ${dir}: ${err}`;
271679
271670
  }
271680
271671
  }
@@ -271735,14 +271726,13 @@ async function crawlDirectory(dirEnt, exec) {
271735
271726
  for (const entry of entries) {
271736
271727
  const testDir = await isDir(entry);
271737
271728
  if (testDir) {
271738
- slurps.push(crawlDirectory(entry, exec));
271729
+ slurps.push(() => crawlDirectory(entry, exec));
271739
271730
  }
271740
271731
  else {
271741
- slurps.push(slurpFile(entry, exec));
271732
+ slurps.push(() => slurpFile(entry, exec));
271742
271733
  }
271743
271734
  }
271744
- return Promise.all(slurps).catch((err) => {
271745
- console.error(err);
271735
+ return Promise.all(slurps.map((f) => f())).catch((err) => {
271746
271736
  throw `crawlDirectory: ${err} on ${dirEnt}`;
271747
271737
  });
271748
271738
  }
@@ -272927,7 +272917,6 @@ class FirestartrAllClaim {
272927
272917
  },
272928
272918
  ref: {
272929
272919
  type: 'string',
272930
- pattern: '^[a-zA-Z0-9-._@/]+$',
272931
272920
  description: 'A github reference (commit, tag, branch)',
272932
272921
  },
272933
272922
  args: {
@@ -274231,8 +274220,13 @@ async function loadClaims(claimsPath = config_getPath('claims')) {
274231
274220
  if (!('kind' in claim && 'name' in claim)) {
274232
274221
  throw new Error(`Invalid claim file ${entry}`);
274233
274222
  }
274234
- validateClaim(claim, base[`${claim.kind}Schema`]);
274235
- await optionalValidation(claim);
274223
+ try {
274224
+ validateClaim(claim, base[`${claim.kind}Schema`]);
274225
+ await optionalValidation(claim);
274226
+ }
274227
+ catch (err) {
274228
+ throw new Error(`Validating ${claim.kind + '-' + claim.name}: ${JSON.stringify(err, null, 2)}`);
274229
+ }
274236
274230
  if (result[`${claim.kind}-${claim.name}`]) {
274237
274231
  throw new Error(`Duplicate claim ${claim.kind}-${claim.name}`);
274238
274232
  }
@@ -275775,8 +275769,8 @@ function updateFileContent(featureRenderPath, filePath, content) {
275775
275769
 
275776
275770
 
275777
275771
  const renderer_messageLog = src_default()('firestartr:features_preparer:renderer');
275778
- function renderFeature(featureName, version, owner, repo, featureOwner, renderPath = '/tmp', featureArgs = {}) {
275779
- const extractPath = external_path_default().join(catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version, owner, repo), 'packages', featureName);
275772
+ function renderFeature(featureName, version, featureOwner, renderPath = '/tmp', featureArgs = {}) {
275773
+ const extractPath = external_path_default().join(catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version), 'packages', featureName);
275780
275774
  const renderedPath = catalog_common.features.features.getFeatureRenderedPathForEntity(featureOwner, featureName, renderPath);
275781
275775
  renderer_messageLog(`Rendering feature ${featureName} to ${renderedPath} with component ${JSON.stringify(featureOwner)}`);
275782
275776
  return features_renderer.render(extractPath, renderedPath, featureOwner, {}, featureArgs);
@@ -275816,8 +275810,6 @@ async function downloadZipBall(url, filePath) {
275816
275810
 
275817
275811
 
275818
275812
 
275819
-
275820
- const installer_log = src_default()('firestartr:features_preparer:installer');
275821
275813
  async function getFeatureConfigFromRef(featureName, featureRef, featureOwner, // -> cr
275822
275814
  featureArgs = {}, repo = 'features', owner = 'prefapp') {
275823
275815
  // reference is the featureRef directly
@@ -275840,20 +275832,19 @@ featureArgs = {}, repo = 'features', owner = 'prefapp') {
275840
275832
  ref: reference,
275841
275833
  url: `https://github.com/${owner}/${repo}/tree/${reference}/packages/${featureName}`,
275842
275834
  };
275843
- return renderFeature(featureName, reference, owner, repo, featureOwner, '/tmp', featureArgs);
275835
+ return renderFeature(featureName, reference, featureOwner, '/tmp', featureArgs);
275844
275836
  }
275845
275837
  async function prepareFeature(featureName, version, repo = 'features', owner = 'prefapp') {
275846
275838
  await downloadFeatureZip(repo, featureName, version, owner);
275847
275839
  }
275848
275840
  async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp') {
275849
275841
  try {
275850
- const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference, owner, repo, { createIfNotExists: false });
275842
+ const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference);
275851
275843
  console.log(`Zipball extract path: ${zipballExtractPath}`);
275852
275844
  if (external_fs_.existsSync(zipballExtractPath)) {
275853
275845
  console.log(`Zipball extract path ${zipballExtractPath} already exists, reusing it.`);
275854
275846
  return zipballExtractPath;
275855
275847
  }
275856
- installer_log(`Feature ${[featureName, reference, owner, repo].join('-')} has not been downloaded yet, downloading`);
275857
275848
  const octokit = await github_0.getOctokitForOrg(owner);
275858
275849
  const response = await octokit.request('GET /repos/{owner}/{repo}/zipball/{reference}', {
275859
275850
  request: {
@@ -279986,7 +279977,13 @@ async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, c
279986
279977
  if (claimRefs) {
279987
279978
  claimRefsList = claimRefs.replace(/\s/g, '').split(',');
279988
279979
  }
279989
- await renderer_render(catalogApp, firestartrApp, validateReferentialIntegrity === 'enabled' ? true : false, claimRefsList);
279980
+ try {
279981
+ await renderer_render(catalogApp, firestartrApp, validateReferentialIntegrity === 'enabled' ? true : false, claimRefsList);
279982
+ }
279983
+ catch (error) {
279984
+ console.log(`Rendering the system: \n ${error}`);
279985
+ process.exit(1);
279986
+ }
279990
279987
  catalogApp.synth();
279991
279988
  firestartrApp.synth();
279992
279989
  }
@@ -1,4 +1,4 @@
1
- export declare function getFeatureZipDownloadPath(featureName: string, version: string, owner: string, repo: string): string;
2
- export declare function removeFeatureTarball(featureName: string, version: string, owner: string, repo: string): void;
3
- export declare function featureTarballExists(featureName: string, version: string, owner: string, repo: string): boolean;
4
- export declare function getFeaturesExtractPath(featureName: string, version: string, owner: string, repo: string, options?: any): string;
1
+ export declare function getFeatureZipDownloadPath(featureName: string, version: string): string;
2
+ export declare function removeFeatureTarball(featureName: string, version: string): void;
3
+ export declare function featureTarballExists(featureName: string, version: string): boolean;
4
+ export declare function getFeaturesExtractPath(featureName: string, version: string, options?: any): string;
@@ -374,7 +374,6 @@ declare const schemas: {
374
374
  };
375
375
  ref: {
376
376
  type: string;
377
- pattern: string;
378
377
  description: string;
379
378
  };
380
379
  args: {
@@ -16,7 +16,6 @@ declare const _default: {
16
16
  };
17
17
  ref: {
18
18
  type: string;
19
- pattern: string;
20
19
  description: string;
21
20
  };
22
21
  args: {
@@ -77,7 +77,6 @@ export declare const GithubSchemas: ({
77
77
  };
78
78
  ref: {
79
79
  type: string;
80
- pattern: string;
81
80
  description: string;
82
81
  };
83
82
  args: {
@@ -1 +1 @@
1
- export declare function renderFeature(featureName: string, version: string, owner: any, repo: any, featureOwner: any, renderPath?: string, featureArgs?: any): any;
1
+ export declare function renderFeature(featureName: string, version: string, featureOwner: any, renderPath?: string, featureArgs?: any): any;
@@ -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: Record<string, never> | {
431
+ author: {
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: Record<string, never> | {
454
+ } | Record<string, never>;
455
+ committer: {
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
+ } | Record<string, never>;
479
479
  parents: {
480
480
  sha: string;
481
481
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.45.0-snapshot-9",
3
+ "version": "1.45.0-snapshot-10",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",