@firestartr/cli 1.42.1 → 1.43.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
@@ -289060,6 +289060,33 @@ 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) {
|
289066
|
+
if (IS_WORKFLOW_REGEXP.test(src)) {
|
289067
|
+
return addTrazabilityStamp(context, content);
|
289068
|
+
}
|
289069
|
+
else {
|
289070
|
+
return content;
|
289071
|
+
}
|
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)}
|
289079
|
+
|
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}`;
|
289088
|
+
}
|
289089
|
+
|
289063
289090
|
;// CONCATENATED MODULE: ../features_renderer/src/render.ts
|
289064
289091
|
|
289065
289092
|
|
@@ -289067,6 +289094,7 @@ mustache.Writer = Writer;
|
|
289067
289094
|
|
289068
289095
|
|
289069
289096
|
|
289097
|
+
|
289070
289098
|
const render_messageLog = src_default()('firestartr:features_renderer');
|
289071
289099
|
function render(featurePath, featureRenderPath, entity, firestartrConfig = {}, featureArgs = {}) {
|
289072
289100
|
const configData = validate_validate(featurePath);
|
@@ -289080,7 +289108,7 @@ function render(featurePath, featureRenderPath, entity, firestartrConfig = {}, f
|
|
289080
289108
|
const userManaged = file.user_managed ?? file.upgradeable ?? false;
|
289081
289109
|
render_messageLog(`Rendering ${src} to ${dest}`);
|
289082
289110
|
// render the content of the file
|
289083
|
-
const content = renderContent(external_fs_default().readFileSync(external_path_default().join(featurePath, 'templates', src)).toString(), context);
|
289111
|
+
const content = addTrazability(context, src, renderContent(external_fs_default().readFileSync(external_path_default().join(featurePath, 'templates', src)).toString(), context));
|
289084
289112
|
const destFilePath = external_path_default().join(`${featureRenderPath}`, dest);
|
289085
289113
|
// write content to the destination file
|
289086
289114
|
external_fs_default().mkdirSync(external_path_default().dirname(destFilePath), { recursive: true });
|
@@ -289124,6 +289152,7 @@ function buildContext(entity, args, firestartrConfig, featureArgs) {
|
|
289124
289152
|
}
|
289125
289153
|
});
|
289126
289154
|
context.firestartrConfig = firestartrConfig;
|
289155
|
+
context.trazability = featureArgs['trazability'] || {};
|
289127
289156
|
return context;
|
289128
289157
|
}
|
289129
289158
|
function renderContent(template, ctx) {
|
@@ -289175,6 +289204,11 @@ async function listFeatures(repo = 'features', owner = 'prefapp') {
|
|
289175
289204
|
async function getFeatureConfig(featureName, version, featureOwner, // -> cr
|
289176
289205
|
featureArgs = {}, repo = 'features', owner = 'prefapp') {
|
289177
289206
|
await downloadFeatureTarball(repo, featureName, version, owner);
|
289207
|
+
featureArgs['trazability'] = {
|
289208
|
+
version,
|
289209
|
+
owner,
|
289210
|
+
repo,
|
289211
|
+
};
|
289178
289212
|
return renderFeature(featureName, version, featureOwner, '/tmp', featureArgs);
|
289179
289213
|
}
|
289180
289214
|
async function prepareFeature(featureName, version, repo = 'features', owner = 'prefapp') {
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function addTrazability(context: any, src: string, content: string): string;
|