@firestartr/cli 1.43.1-snapshot-1 → 1.43.1-snapshot-2

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
@@ -289060,31 +289060,41 @@ mustache.Writer = Writer;
289060
289060
 
289061
289061
  /* harmony default export */ const mustache_mustache = (mustache);
289062
289062
 
289063
- ;// CONCATENATED MODULE: ../features_renderer/src/trazability.ts
289064
- const IS_WORKFLOW_REGEXP = new RegExp(/\.github\/workflows\/[^.]+.(yaml|yml)/);
289065
- function addTrazability(context, src, content) {
289063
+ ;// CONCATENATED MODULE: ../features_renderer/src/traceability.ts
289064
+ const IS_WORKFLOW_REGEXP = new RegExp(/\.github\/workflows\/.+\.(yaml|yml)$/);
289065
+ function addTraceability(context, src, content) {
289066
289066
  if (IS_WORKFLOW_REGEXP.test(src)) {
289067
- return addTrazabilityStamp(context, content);
289067
+ return addTraceabilityStamp(context, content);
289068
289068
  }
289069
289069
  else {
289070
289070
  return content;
289071
289071
  }
289072
289072
  }
289073
- function addTrazabilityStamp(context, content) {
289074
- const trazability = context.trazability || {};
289075
- const trace = `---
289076
- # FEATURE_NAME: ${context.config.feature_name}
289077
- # FEATURE_VERSION: ${trazability.version}
289078
- # FEATURE_URL: ${prepareURl(context)}
289073
+ function addTraceabilityStamp(context, content) {
289074
+ const traceability = context.traceability || {};
289075
+ const stamp = `---
289076
+ # FEATURE_NAME: ${traceability.name}
289077
+ # FEATURE_VERSION: ${traceability.version}
289078
+ # FEATURE_URL: ${traceability.url}
289079
289079
 
289080
289080
  `;
289081
- return trace + content;
289082
- }
289083
- function prepareURl(context) {
289084
- const trazability = context.trazability || {};
289085
- // format
289086
- // # FEATURE_URL: https://github.com/prefapp/features/tree/build_and_dispatch_docker_images-vX.Y.Z/packages/build_and_dispatch_docker_images
289087
- return `https://github.com/${trazability.owner}/${trazability.repo}/tree/${context.config.feature_name}-v${trazability.version}/packages/${context.config.feature_name}`;
289081
+ const output = [];
289082
+ let replaced = false;
289083
+ for (const line of content.split(/\n/)) {
289084
+ if (line === '---' && !replaced) {
289085
+ output.push(stamp);
289086
+ replaced = true;
289087
+ }
289088
+ else {
289089
+ output.push(line);
289090
+ }
289091
+ }
289092
+ if (replaced) {
289093
+ return output.join('\n');
289094
+ }
289095
+ else {
289096
+ return stamp + content;
289097
+ }
289088
289098
  }
289089
289099
 
289090
289100
  ;// CONCATENATED MODULE: ../features_renderer/src/render.ts
@@ -289108,7 +289118,7 @@ function render(featurePath, featureRenderPath, entity, firestartrConfig = {}, f
289108
289118
  const userManaged = file.user_managed ?? file.upgradeable ?? false;
289109
289119
  render_messageLog(`Rendering ${src} to ${dest}`);
289110
289120
  // render the content of the file
289111
- const content = addTrazability(context, src, renderContent(external_fs_default().readFileSync(external_path_default().join(featurePath, 'templates', src)).toString(), context));
289121
+ const content = addTraceability(context, src, renderContent(external_fs_default().readFileSync(external_path_default().join(featurePath, 'templates', src)).toString(), context));
289112
289122
  const destFilePath = external_path_default().join(`${featureRenderPath}`, dest);
289113
289123
  // write content to the destination file
289114
289124
  external_fs_default().mkdirSync(external_path_default().dirname(destFilePath), { recursive: true });
@@ -289152,7 +289162,7 @@ function buildContext(entity, args, firestartrConfig, featureArgs) {
289152
289162
  }
289153
289163
  });
289154
289164
  context.firestartrConfig = firestartrConfig;
289155
- context.trazability = featureArgs['trazability'] || {};
289165
+ context.traceability = featureArgs['traceability'] || {};
289156
289166
  return context;
289157
289167
  }
289158
289168
  function renderContent(template, ctx) {
@@ -289204,10 +289214,14 @@ async function listFeatures(repo = 'features', owner = 'prefapp') {
289204
289214
  async function getFeatureConfig(featureName, version, featureOwner, // -> cr
289205
289215
  featureArgs = {}, repo = 'features', owner = 'prefapp') {
289206
289216
  await downloadFeatureTarball(repo, featureName, version, owner);
289207
- featureArgs['trazability'] = {
289217
+ const ref = `${featureName}-v${version}`;
289218
+ featureArgs['traceability'] = {
289208
289219
  version,
289209
289220
  owner,
289210
289221
  repo,
289222
+ name: featureName,
289223
+ ref,
289224
+ url: `https://github.com/${owner}/${repo}/tree/${ref}/packages/${featureName}`,
289211
289225
  };
289212
289226
  return renderFeature(featureName, version, featureOwner, '/tmp', featureArgs);
289213
289227
  }
@@ -0,0 +1 @@
1
+ export declare function addTraceability(context: any, src: string, content: string): string;
@@ -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.43.1-snapshot-1",
3
+ "version": "1.43.1-snapshot-2",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",
@@ -1 +0,0 @@
1
- export declare function addTrazability(context: any, src: string, content: string): string;