cistack 3.0.0 → 3.0.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/bin/ciflow.js +3 -1
- package/package.json +1 -1
- package/src/generators/workflow.js +7 -5
- package/src/utils/helpers.js +4 -10
package/bin/ciflow.js
CHANGED
|
@@ -6,10 +6,12 @@ const { program } = require('commander');
|
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const CIFlow = require('../src/index');
|
|
8
8
|
|
|
9
|
+
const { version } = require('../package.json');
|
|
10
|
+
|
|
9
11
|
program
|
|
10
12
|
.name('cistack')
|
|
11
13
|
.description('Generate GitHub Actions CI/CD pipelines by analysing your codebase')
|
|
12
|
-
.version(
|
|
14
|
+
.version(version);
|
|
13
15
|
|
|
14
16
|
program
|
|
15
17
|
.command('generate', { isDefault: true })
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const yaml = require('js-yaml');
|
|
4
|
+
const { version } = require('../../package.json');
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Takes all detected signals and produces one or more complete GitHub Actions workflow YAML files.
|
|
@@ -190,7 +192,7 @@ class WorkflowGenerator {
|
|
|
190
192
|
|
|
191
193
|
const envComment = this._envComment();
|
|
192
194
|
const header =
|
|
193
|
-
`# Generated by cistack
|
|
195
|
+
`# Generated by cistack v${version} — https://github.com/cistack\n` +
|
|
194
196
|
`# CI Pipeline: lint → test → build${this.e2eTests.length > 0 ? ' → e2e' : ''}\n` +
|
|
195
197
|
envComment +
|
|
196
198
|
`\n`;
|
|
@@ -266,7 +268,7 @@ class WorkflowGenerator {
|
|
|
266
268
|
|
|
267
269
|
return this._toYaml(
|
|
268
270
|
workflow,
|
|
269
|
-
|
|
271
|
+
`# Generated by cistack v${version} — https://github.com/cistack\n# Monorepo CI — matrix over all workspaces\n\n`
|
|
270
272
|
);
|
|
271
273
|
}
|
|
272
274
|
|
|
@@ -333,7 +335,7 @@ class WorkflowGenerator {
|
|
|
333
335
|
|
|
334
336
|
return this._toYaml(
|
|
335
337
|
workflow,
|
|
336
|
-
`# Generated by cistack
|
|
338
|
+
`# Generated by cistack v${version}\n# Deploy Pipeline → ${h.name}\n${secretsDoc}${envComment}\n`
|
|
337
339
|
);
|
|
338
340
|
}
|
|
339
341
|
|
|
@@ -411,7 +413,7 @@ class WorkflowGenerator {
|
|
|
411
413
|
},
|
|
412
414
|
};
|
|
413
415
|
|
|
414
|
-
return this._toYaml(workflow,
|
|
416
|
+
return this._toYaml(workflow, `# Generated by cistack v${version}\n# Docker image build and push to GHCR\n\n`);
|
|
415
417
|
}
|
|
416
418
|
|
|
417
419
|
// ══════════════════════════════════════════════════════════════════════════
|
|
@@ -483,7 +485,7 @@ class WorkflowGenerator {
|
|
|
483
485
|
},
|
|
484
486
|
};
|
|
485
487
|
|
|
486
|
-
return this._toYaml(workflow,
|
|
488
|
+
return this._toYaml(workflow, `# Generated by cistack v${version}\n# Security: dependency audit + CodeQL analysis (runs weekly)\n\n`);
|
|
487
489
|
}
|
|
488
490
|
|
|
489
491
|
// ══════════════════════════════════════════════════════════════════════════
|
package/src/utils/helpers.js
CHANGED
|
@@ -5,6 +5,8 @@ const path = require('path');
|
|
|
5
5
|
const chalk = require('chalk');
|
|
6
6
|
const yaml = require('js-yaml');
|
|
7
7
|
|
|
8
|
+
const { version } = require('../../package.json');
|
|
9
|
+
|
|
8
10
|
function ensureDir(dirPath) {
|
|
9
11
|
if (!fs.existsSync(dirPath)) {
|
|
10
12
|
fs.mkdirSync(dirPath, { recursive: true });
|
|
@@ -17,16 +19,8 @@ function writeFile(filePath, content) {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
function banner() {
|
|
20
|
-
console.log('\n' + chalk.bold.cyan('
|
|
21
|
-
console.log(chalk.
|
|
22
|
-
console.log(chalk.bold.cyan(' ██║ ██║███████╗ ██║ ███████║██║ █████╔╝ '));
|
|
23
|
-
console.log(chalk.bold.cyan(' ██║ ██║╚════██║ ██║ ██╔══██║██║ ██╔═██╗ '));
|
|
24
|
-
console.log(chalk.bold.cyan(' ╚██████╗██║███████║ ██║ ██║ ██║╚██████╗██║ ██╗'));
|
|
25
|
-
console.log(chalk.bold.cyan(' ╚═════╝╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝'));
|
|
26
|
-
console.log('');
|
|
27
|
-
console.log(' ' + chalk.dim('GitHub Actions pipeline generator ') + chalk.bold.cyan('v2.0.0'));
|
|
28
|
-
console.log(' ' + chalk.dim('─'.repeat(52)));
|
|
29
|
-
console.log('');
|
|
22
|
+
console.log('\n' + chalk.bold.cyan(' cistack ') + chalk.dim('v' + version));
|
|
23
|
+
console.log(chalk.dim(' ' + '─'.repeat(24)) + '\n');
|
|
30
24
|
}
|
|
31
25
|
|
|
32
26
|
/**
|