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

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
@@ -262837,7 +262837,7 @@ const TFWorkspaceRefRegex = new RegExp(`\\$\\{\\{\\s*tfworkspace\\:(${regModuleN
262837
262837
  const SecretRefRegex = new RegExp(`\\$\\{\\{\\s*secret\\:(${regModuleName.source})\\.(${regModuleName.source})\\s*\\}\\}`, 'ig');
262838
262838
  const GroupRefRegex = new RegExp(`group\\:(${regModuleName.source})`, 'ig');
262839
262839
  const TFWorkspaceRefCR = new RegExp(`\\$\\{\\{\\s*references\\.(${regModuleName.source})\\s*\\}\\}`, 'i');
262840
- const GenericRefRegex = new RegExp(`user:${regModuleName.source}|group:${regModuleName.source}|system:${regModuleName.source}`, 'gm');
262840
+ const GenericRefRegex = new RegExp(`^["']?(user:${regModuleName.source}|group:${regModuleName.source}|system:${regModuleName.source})["']?$`, 'gm');
262841
262841
  const YAMLHeaderRegex = new RegExp(/^\s*(\w+:\s?)/);
262842
262842
  const YAMLListItemRegex = new RegExp(/^\s*(-\s)/);
262843
262843
  const YAMLInlineListRegex = new RegExp(/^\s*(\[.+\])/);
@@ -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) {
263051
- const featureDownloadPath = `/tmp/${featureName}-${version}-zipball.zip`;
263050
+ function getFeatureZipDownloadPath(featureName, version, owner, repo) {
263051
+ const featureDownloadPath = `/tmp/${basicFeaturePath(featureName, version, owner, repo)}-zipball.zip`;
263052
263052
  tarballs_messageLog('Feature tarball download path %s', featureDownloadPath);
263053
263053
  return featureDownloadPath;
263054
263054
  }
263055
- function removeFeatureTarball(featureName, version) {
263056
- const featurePath = getFeatureZipDownloadPath(featureName, version);
263055
+ function removeFeatureTarball(featureName, version, owner, repo) {
263056
+ const featurePath = getFeatureZipDownloadPath(featureName, version, owner, repo);
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) {
263062
- const featurePath = getFeatureZipDownloadPath(featureName, version);
263061
+ function featureTarballExists(featureName, version, owner, repo) {
263062
+ const featurePath = getFeatureZipDownloadPath(featureName, version, owner, repo);
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, options = {}) {
263067
+ function getFeaturesExtractPath(featureName, version, owner, repo, options = {}) {
263068
263068
  const { createIfNotExists } = options;
263069
- const extractPath = `/tmp/${featureName}-${version}-extract`;
263069
+ const extractPath = `/tmp/${basicFeaturePath(featureName, version, owner, repo)}-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,6 +263074,13 @@ function getFeaturesExtractPath(featureName, version, 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
+ }
263077
263084
 
263078
263085
  ;// CONCATENATED MODULE: ../catalog_common/src/features/features_io.ts
263079
263086
 
@@ -263081,7 +263088,7 @@ function getFeaturesExtractPath(featureName, version, options = {}) {
263081
263088
 
263082
263089
  const features_io_messageLog = src_default()('firestartr:catalog_common:features:features_io');
263083
263090
  function getFeatureRenderedPathForEntity(entity, featureName, basePath = '/tmp') {
263084
- const entityFolderName = `${entity.kind}-${entity.metadata.name}`.toLowerCase();
263091
+ const entityFolderName = `${entity.metadata.name}`.toLowerCase();
263085
263092
  return external_path_default().join(basePath, entityFolderName, featureName);
263086
263093
  }
263087
263094
  function getFeatureRenderedConfigForComponent(entity, featureName, basePath = '/tmp/features') {
@@ -272917,6 +272924,7 @@ class FirestartrAllClaim {
272917
272924
  },
272918
272925
  ref: {
272919
272926
  type: 'string',
272927
+ pattern: '^[a-zA-Z0-9-._@/]+$',
272920
272928
  description: 'A github reference (commit, tag, branch)',
272921
272929
  },
272922
272930
  args: {
@@ -275769,8 +275777,8 @@ function updateFileContent(featureRenderPath, filePath, content) {
275769
275777
 
275770
275778
 
275771
275779
  const renderer_messageLog = src_default()('firestartr:features_preparer:renderer');
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
+ function renderFeature(featureName, version, owner, repo, featureOwner, renderPath = '/tmp', featureArgs = {}) {
275781
+ const extractPath = external_path_default().join(catalog_common.features.tarballs.getFeaturesExtractPath(featureName, version, owner, repo), 'packages', featureName);
275774
275782
  const renderedPath = catalog_common.features.features.getFeatureRenderedPathForEntity(featureOwner, featureName, renderPath);
275775
275783
  renderer_messageLog(`Rendering feature ${featureName} to ${renderedPath} with component ${JSON.stringify(featureOwner)}`);
275776
275784
  return features_renderer.render(extractPath, renderedPath, featureOwner, {}, featureArgs);
@@ -275810,6 +275818,8 @@ async function downloadZipBall(url, filePath) {
275810
275818
 
275811
275819
 
275812
275820
 
275821
+
275822
+ const installer_log = src_default()('firestartr:features_preparer:installer');
275813
275823
  async function getFeatureConfigFromRef(featureName, featureRef, featureOwner, // -> cr
275814
275824
  featureArgs = {}, repo = 'features', owner = 'prefapp') {
275815
275825
  // reference is the featureRef directly
@@ -275832,19 +275842,20 @@ featureArgs = {}, repo = 'features', owner = 'prefapp') {
275832
275842
  ref: reference,
275833
275843
  url: `https://github.com/${owner}/${repo}/tree/${reference}/packages/${featureName}`,
275834
275844
  };
275835
- return renderFeature(featureName, reference, featureOwner, '/tmp', featureArgs);
275845
+ return renderFeature(featureName, reference, owner, repo, featureOwner, '/tmp', featureArgs);
275836
275846
  }
275837
275847
  async function prepareFeature(featureName, version, repo = 'features', owner = 'prefapp') {
275838
275848
  await downloadFeatureZip(repo, featureName, version, owner);
275839
275849
  }
275840
275850
  async function downloadFeatureZip(repo, featureName, reference, owner = 'prefapp') {
275841
275851
  try {
275842
- const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference);
275852
+ const zipballExtractPath = catalog_common.features.tarballs.getFeaturesExtractPath(featureName, reference, owner, repo, { createIfNotExists: false });
275843
275853
  console.log(`Zipball extract path: ${zipballExtractPath}`);
275844
275854
  if (external_fs_.existsSync(zipballExtractPath)) {
275845
275855
  console.log(`Zipball extract path ${zipballExtractPath} already exists, reusing it.`);
275846
275856
  return zipballExtractPath;
275847
275857
  }
275858
+ installer_log(`Feature ${[featureName, reference, owner, repo].join('-')} has not been downloaded yet, downloading`);
275848
275859
  const octokit = await github_0.getOctokitForOrg(owner);
275849
275860
  const response = await octokit.request('GET /repos/{owner}/{repo}/zipball/{reference}', {
275850
275861
  request: {
@@ -1,4 +1,4 @@
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;
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;
@@ -374,6 +374,7 @@ declare const schemas: {
374
374
  };
375
375
  ref: {
376
376
  type: string;
377
+ pattern: string;
377
378
  description: string;
378
379
  };
379
380
  args: {
@@ -16,6 +16,7 @@ declare const _default: {
16
16
  };
17
17
  ref: {
18
18
  type: string;
19
+ pattern: string;
19
20
  description: string;
20
21
  };
21
22
  args: {
@@ -77,6 +77,7 @@ export declare const GithubSchemas: ({
77
77
  };
78
78
  ref: {
79
79
  type: string;
80
+ pattern: string;
80
81
  description: string;
81
82
  };
82
83
  args: {
@@ -1 +1 @@
1
- export declare function renderFeature(featureName: string, version: string, featureOwner: any, renderPath?: string, featureArgs?: any): any;
1
+ export declare function renderFeature(featureName: string, version: string, owner: any, repo: any, 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: {
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
- } | Record<string, never>;
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
- } | Record<string, never>;
478
+ };
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-10",
3
+ "version": "1.45.0-snapshot-12",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",