@azrico/azcli 1.2.1 → 1.2.3

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.
Files changed (89) hide show
  1. package/package.json +1 -1
  2. package/dist/cli/create-cli.js +0 -40
  3. package/dist/cli/create-cli.js.map +0 -1
  4. package/dist/cli/index.js +0 -20
  5. package/dist/cli/index.js.map +0 -1
  6. package/dist/cli/options.js +0 -17
  7. package/dist/cli/options.js.map +0 -1
  8. package/dist/core/files.js +0 -82
  9. package/dist/core/files.js.map +0 -1
  10. package/dist/core/json.js +0 -16
  11. package/dist/core/json.js.map +0 -1
  12. package/dist/core/logger.js +0 -26
  13. package/dist/core/logger.js.map +0 -1
  14. package/dist/core/process.js +0 -120
  15. package/dist/core/process.js.map +0 -1
  16. package/dist/core/project-type.js +0 -41
  17. package/dist/core/project-type.js.map +0 -1
  18. package/dist/core/strings.js +0 -20
  19. package/dist/core/strings.js.map +0 -1
  20. package/dist/features/build/build.js +0 -46
  21. package/dist/features/build/build.js.map +0 -1
  22. package/dist/features/build/command.js +0 -17
  23. package/dist/features/build/command.js.map +0 -1
  24. package/dist/features/build/wordpress.js +0 -135
  25. package/dist/features/build/wordpress.js.map +0 -1
  26. package/dist/features/clean/clean.js +0 -27
  27. package/dist/features/clean/clean.js.map +0 -1
  28. package/dist/features/clean/command.js +0 -13
  29. package/dist/features/clean/command.js.map +0 -1
  30. package/dist/features/optimize-transcripts/agent-runner.js +0 -40
  31. package/dist/features/optimize-transcripts/agent-runner.js.map +0 -1
  32. package/dist/features/optimize-transcripts/command.js +0 -24
  33. package/dist/features/optimize-transcripts/command.js.map +0 -1
  34. package/dist/features/optimize-transcripts/optimize.js +0 -72
  35. package/dist/features/optimize-transcripts/optimize.js.map +0 -1
  36. package/dist/features/optimize-transcripts/prompts.js +0 -39
  37. package/dist/features/optimize-transcripts/prompts.js.map +0 -1
  38. package/dist/features/optimize-transcripts/redact.js +0 -57
  39. package/dist/features/optimize-transcripts/redact.js.map +0 -1
  40. package/dist/features/optimize-transcripts/secret-remover.js +0 -85
  41. package/dist/features/optimize-transcripts/secret-remover.js.map +0 -1
  42. package/dist/features/package/command.js +0 -13
  43. package/dist/features/package/command.js.map +0 -1
  44. package/dist/features/package/packager.js +0 -132
  45. package/dist/features/package/packager.js.map +0 -1
  46. package/dist/features/publish/command.js +0 -13
  47. package/dist/features/publish/command.js.map +0 -1
  48. package/dist/features/publish/publish.js +0 -29
  49. package/dist/features/publish/publish.js.map +0 -1
  50. package/dist/features/transcripts/command.js +0 -27
  51. package/dist/features/transcripts/command.js.map +0 -1
  52. package/dist/features/transcripts/extract.js +0 -148
  53. package/dist/features/transcripts/extract.js.map +0 -1
  54. package/dist/features/transcripts/jsonl.js +0 -100
  55. package/dist/features/transcripts/jsonl.js.map +0 -1
  56. package/dist/features/transcripts/options.js +0 -53
  57. package/dist/features/transcripts/options.js.map +0 -1
  58. package/dist/features/transcripts/render-markdown.js +0 -105
  59. package/dist/features/transcripts/render-markdown.js.map +0 -1
  60. package/dist/features/transcripts/sources/claude.js +0 -150
  61. package/dist/features/transcripts/sources/claude.js.map +0 -1
  62. package/dist/features/transcripts/sources/codex.js +0 -171
  63. package/dist/features/transcripts/sources/codex.js.map +0 -1
  64. package/dist/features/transcripts/types.js +0 -5
  65. package/dist/features/transcripts/types.js.map +0 -1
  66. package/dist/features/update/command.js +0 -16
  67. package/dist/features/update/command.js.map +0 -1
  68. package/dist/features/update/composer.js +0 -35
  69. package/dist/features/update/composer.js.map +0 -1
  70. package/dist/features/update/filter-options.js +0 -23
  71. package/dist/features/update/filter-options.js.map +0 -1
  72. package/dist/features/update/update.js +0 -28
  73. package/dist/features/update/update.js.map +0 -1
  74. package/dist/features/update/yarn.js +0 -30
  75. package/dist/features/update/yarn.js.map +0 -1
  76. package/dist/features/verify-changes/changed-files.js +0 -36
  77. package/dist/features/verify-changes/changed-files.js.map +0 -1
  78. package/dist/features/verify-changes/command.js +0 -25
  79. package/dist/features/verify-changes/command.js.map +0 -1
  80. package/dist/features/verify-changes/config.js +0 -59
  81. package/dist/features/verify-changes/config.js.map +0 -1
  82. package/dist/features/verify-changes/report.js +0 -30
  83. package/dist/features/verify-changes/report.js.map +0 -1
  84. package/dist/features/verify-changes/select.js +0 -39
  85. package/dist/features/verify-changes/select.js.map +0 -1
  86. package/dist/features/verify-changes/verify.js +0 -54
  87. package/dist/features/verify-changes/verify.js.map +0 -1
  88. package/dist/features/yarn/commands.js +0 -18
  89. package/dist/features/yarn/commands.js.map +0 -1
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getChangedFiles = exports.resolveBase = void 0;
4
- const defaultBases = ['origin/main', 'origin/master', 'main', 'master'];
5
- const lines = (text) => text.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
6
- async function refExists(run, cwd, ref) {
7
- try {
8
- await run('git', ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`], { cwd, quiet: true });
9
- return true;
10
- }
11
- catch {
12
- return false;
13
- }
14
- }
15
- async function resolveBase(run, cwd, requested) {
16
- if (requested) {
17
- if (!(await refExists(run, cwd, requested)))
18
- throw new Error(`Base ref not found: ${requested}`);
19
- return requested;
20
- }
21
- for (const ref of defaultBases)
22
- if (await refExists(run, cwd, ref))
23
- return ref;
24
- return 'HEAD';
25
- }
26
- exports.resolveBase = resolveBase;
27
- /** Paths relative to `cwd` changed since the merge-base with `base`: committed, staged, unstaged, and untracked. */
28
- async function getChangedFiles(run, cwd, base) {
29
- const options = { cwd, quiet: true };
30
- const mergeBase = (await run('git', ['merge-base', base, 'HEAD'], options)).stdout.trim();
31
- const diff = await run('git', ['diff', '--name-only', '--no-renames', '--relative', mergeBase], options);
32
- const untracked = await run('git', ['ls-files', '--others', '--exclude-standard'], options);
33
- return [...new Set([...lines(diff.stdout), ...lines(untracked.stdout)])].sort();
34
- }
35
- exports.getChangedFiles = getChangedFiles;
36
- //# sourceMappingURL=changed-files.js.map
@@ -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AAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1F,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IACzG,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5F,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjF,CAAC;AAND,0CAMC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const logger_1 = require("../../core/logger");
4
- const report_1 = require("./report");
5
- const verify_1 = require("./verify");
6
- const command = {
7
- command: 'verify-changes',
8
- describe: 'Run the project checks that apply to the changed files',
9
- builder: (cli) => cli
10
- .option('path', { type: 'string', describe: 'Project directory' })
11
- .option('base', { type: 'string', describe: 'Compare against this ref (default: config base, else main/master)' })
12
- .option('profile', { type: 'string', array: true, describe: 'Profiles from .azcli/verify.json (default: all)' })
13
- .option('json', { type: 'boolean', describe: 'Print the full report as JSON' })
14
- .option('strict', { type: 'boolean', describe: 'Treat checks that were not run as failures' }),
15
- handler: async (args) => {
16
- const report = await (0, verify_1.verifyChanges)(args);
17
- if (args.json)
18
- console.log(JSON.stringify(report, null, 2));
19
- else
20
- (0, logger_1.showMessage)((0, report_1.formatReport)(report, args.strict), 'text', false);
21
- process.exitCode = (0, report_1.reportExitCode)(report, args.strict);
22
- },
23
- };
24
- exports.default = command;
25
- //# sourceMappingURL=command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/features/verify-changes/command.ts"],"names":[],"mappings":";;AACA,8CAAgD;AAChD,qCAAwD;AACxD,qCAAyC;AASzC,MAAM,OAAO,GAA4C;IACxD,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,wDAAwD;IAClE,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG;SACnB,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;SACjE,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,mEAAmE,EAAE,CAAC;SACjH,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,iDAAiD,EAAE,CAAC;SAC/G,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,+BAA+B,EAAE,CAAC;SAC9E,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,4CAA4C,EAAE,CAAC;IAC/F,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAa,EAAC,IAAI,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;;YACvD,IAAA,oBAAW,EAAC,IAAA,qBAAY,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACnE,OAAO,CAAC,QAAQ,GAAG,IAAA,uBAAc,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;CACD,CAAC;AACF,kBAAe,OAAO,CAAC"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.loadConfig = exports.parseConfig = exports.configFile = void 0;
7
- const node_fs_1 = __importDefault(require("node:fs"));
8
- const node_path_1 = __importDefault(require("node:path"));
9
- const json_1 = require("../../core/json");
10
- exports.configFile = node_path_1.default.join('.azcli', 'verify.json');
11
- function stringArray(value, label) {
12
- if (!Array.isArray(value) || value.some((item) => typeof item !== 'string'))
13
- throw new Error(`${label} must be an array of strings`);
14
- return value;
15
- }
16
- function parseConfig(value) {
17
- if (!(0, json_1.isRecord)(value) || !(0, json_1.isRecord)(value.profiles))
18
- throw new Error(`${exports.configFile} must contain a "profiles" object`);
19
- const profiles = {};
20
- for (const [profile, checks] of Object.entries(value.profiles)) {
21
- if (!Array.isArray(checks))
22
- throw new Error(`Profile "${profile}" must be an array of checks`);
23
- profiles[profile] = checks.map((check, index) => {
24
- const label = `Profile "${profile}" check ${index + 1}`;
25
- if (!(0, json_1.isRecord)(check))
26
- throw new Error(`${label} must be an object`);
27
- const name = (0, json_1.asString)(check.name);
28
- const command = (0, json_1.asString)(check.command);
29
- if (!name)
30
- throw new Error(`${label} needs a "name"`);
31
- if (!command)
32
- throw new Error(`${label} ("${name}") needs a "command"`);
33
- return {
34
- name,
35
- command,
36
- args: check.args === undefined ? [] : stringArray(check.args, `${label} "args"`),
37
- cwd: (0, json_1.asString)(check.cwd),
38
- paths: check.paths === undefined ? undefined : stringArray(check.paths, `${label} "paths"`),
39
- };
40
- });
41
- }
42
- return { base: (0, json_1.asString)(value.base), profiles };
43
- }
44
- exports.parseConfig = parseConfig;
45
- function loadConfig(root) {
46
- const file = node_path_1.default.join(root, exports.configFile);
47
- if (!node_fs_1.default.existsSync(file))
48
- throw new Error(`Missing ${exports.configFile} in ${root}`);
49
- let parsed;
50
- try {
51
- parsed = JSON.parse(node_fs_1.default.readFileSync(file, 'utf8'));
52
- }
53
- catch (error) {
54
- throw new Error(`Could not read ${exports.configFile}: ${error instanceof Error ? error.message : String(error)}`);
55
- }
56
- return parseConfig(parsed);
57
- }
58
- exports.loadConfig = loadConfig;
59
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/features/verify-changes/config.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAC7B,0CAAqD;AAExC,QAAA,UAAU,GAAG,mBAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAgB7D,SAAS,WAAW,CAAC,KAAc,EAAE,KAAa;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,8BAA8B,CAAC,CAAC;IACrI,OAAO,KAAiB,CAAC;AAC1B,CAAC;AAED,SAAgB,WAAW,CAAC,KAAc;IACzC,IAAI,CAAC,IAAA,eAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,IAAA,eAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,kBAAU,mCAAmC,CAAC,CAAC;IACrH,MAAM,QAAQ,GAA6B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;QAC/D,IAAI,CAAC,KAAK,CAAC,O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,EAAE,CAAC;AACjD,CAAC;AAtBD,kCAsBC;AAED,SAAgB,UAAU,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAU,CAAC,CAAC;IACzC,IAAI,CAAC,iBAAE,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,WAAW,kBAAU,OAAO,IAAI,EAAE,CAAC,CAAC;IAC9E,IAAI,MAAe,CAAC;IACpB,IAAI;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;KACnD;IAAC,OAAO,KAAK,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,kBAAU,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KAC3G;IACD,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAVD,gCAUC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.formatReport = exports.reportExitCode = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const colors = { passed: chalk_1.default.green, failed: chalk_1.default.red, 'not-run': chalk_1.default.yellow };
9
- /** Failed checks always fail; not-run checks fail only in strict mode. */
10
- function reportExitCode(report, strict = false) {
11
- return report.results.some((r) => r.status === 'failed' || (strict && r.status === 'not-run')) ? 1 : 0;
12
- }
13
- exports.reportExitCode = reportExitCode;
14
- function formatResult(result) {
15
- const detail = result.reason ? ` (${result.reason})` : '';
16
- const header = `${colors[result.status](result.status.padEnd(7))} ${result.profile}/${result.name}${detail}`;
17
- if (result.status !== 'failed')
18
- return header;
19
- return [header, result.stdout.trimEnd(), result.stderr.trimEnd()].filter(Boolean).join('\n');
20
- }
21
- function formatReport(report, strict = false) {
22
- const count = (status) => report.results.filter((r) => r.status === status).length;
23
- return [
24
- `Base ${report.base}, ${report.changed.length} changed file(s)`,
25
- ...report.results.map(formatResult),
26
- `${count('passed')} passed, ${count('failed')} failed, ${count('not-run')} not run${strict && count('not-run') ? ' (strict: not-run fails)' : ''}`,
27
- ].join('\n');
28
- }
29
- exports.formatReport = formatReport;
30
- //# sourceMappingURL=report.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"report.js","sourceRoot":"","sources":["../../../src/features/verify-changes/report.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,MAAM,MAAM,GAAkD,EAAE,MAAM,EAAE,eAAK,CAAC,KAAK,EAAE,MAAM,EAAE,eAAK,CAAC,GAAG,EAAE,SAAS,EAAE,eAAK,CAAC,MAAM,EAAE,CAAC;AAElI,0EAA0E;AAC1E,SAAgB,cAAc,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAClE,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAFD,wCAEC;AAED,SAAS,YAAY,CAAC,MAAmB;IACxC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC;IAC7G,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9F,CAAC;AAED,SAAgB,YAAY,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAChE,MAAM,KAAK,GAAG,CAAC,MAAmB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;IAChG,OAAO;QACN,QAAQ,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB;QAC/D,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACnC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,KAAK,CAAC,QAAQ,CAAC,YAAY,KAAK,CAAC,SAAS,CAAC,WAAW,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE;KAClJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC;AAPD,oCAOC"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.matchFiles = exports.globToRegExp = void 0;
4
- /** Convert a path glob (`*`, `**`, `?`) to a regular expression over forward-slash paths. */
5
- function globToRegExp(glob) {
6
- const pattern = glob.replace(/\\/g, '/').replace(/^\.\//, '');
7
- let source = '';
8
- for (let i = 0; i < pattern.length; i++) {
9
- const char = pattern[i];
10
- if (char === '*') {
11
- if (pattern[i + 1] === '*') {
12
- i++;
13
- if (pattern[i + 1] === '/') {
14
- i++;
15
- source += '(?:.*/)?';
16
- }
17
- else
18
- source += '.*';
19
- }
20
- else
21
- source += '[^/]*';
22
- }
23
- else if (char === '?')
24
- source += '[^/]';
25
- else
26
- source += char.replace(/[.+^${}()|[\]\\]/g, '\\$&');
27
- }
28
- return new RegExp(`^${source}$`);
29
- }
30
- exports.globToRegExp = globToRegExp;
31
- /** Files matching any glob; with no globs every file matches. */
32
- function matchFiles(files, globs) {
33
- if (!globs)
34
- return [...files];
35
- const patterns = globs.map(globToRegExp);
36
- return files.filter((file) => patterns.some((pattern) => pattern.test(file)));
37
- }
38
- exports.matchFiles = matchFiles;
39
- //# sourceMappingURL=select.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/features/verify-changes/select.ts"],"names":[],"mappings":";;;AAAA,6FAA6F;AAC7F,SAAgB,YAAY,CAAC,IAAY;IACxC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC9D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,IAAI,KAAK,GAAG,EAAE;YACjB,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;gBAC3B,CAAC,EAAE,CAAC;gBACJ,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;oBAC3B,CAAC,EAAE,CAAC;oBACJ,MAAM,IAAI,UAAU,CAAC;iBACrB;;oBAAM,MAAM,IAAI,IAAI,CAAC;aACtB;;gBAAM,MAAM,IAAI,OAAO,CAAC;SACzB;aAAM,IAAI,IAAI,KAAK,GAAG;YAAE,MAAM,IAAI,MAAM,CAAC;;YACrC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;KACzD;IACD,OAAO,IAAI,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;AAClC,CAAC;AAjBD,oCAiBC;AAED,iEAAiE;AACjE,SAAgB,UAAU,CAAC,KAAwB,EAAE,KAAyB;IAC7E,IAAI,CAAC,KAAK;QAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC;AAJD,gCAIC"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.verifyChanges = void 0;
7
- const node_path_1 = __importDefault(require("node:path"));
8
- const process_1 = require("../../core/process");
9
- const files_1 = require("../../core/files");
10
- const changed_files_1 = require("./changed-files");
11
- const config_1 = require("./config");
12
- const select_1 = require("./select");
13
- async function runCheck(run, root, profile, check) {
14
- const started = Date.now();
15
- const result = (fields) => ({
16
- profile, name: check.name, durationMs: Date.now() - started, stdout: '', stderr: '', ...fields,
17
- });
18
- try {
19
- const cwd = check.cwd ? (0, files_1.resolveInside)(root, check.cwd) : root;
20
- const { code, stdout, stderr } = await run(check.command, check.args, { cwd, quiet: true });
21
- return result({ status: 'passed', exitCode: code, stdout, stderr });
22
- }
23
- catch (error) {
24
- if (error instanceof process_1.CommandError) {
25
- const reason = error.signal ? `terminated by ${error.signal}` : `exit code ${error.code}`;
26
- return result({ status: 'failed', reason, exitCode: error.code, stdout: error.stdout, stderr: error.stderr });
27
- }
28
- // The command could not be started at all, so nothing was verified.
29
- return result({ status: 'not-run', reason: error instanceof Error ? error.message : String(error) });
30
- }
31
- }
32
- async function verifyChanges(options, run = process_1.runCommand) {
33
- const root = node_path_1.default.resolve(options.path ?? process.cwd());
34
- const config = (0, config_1.loadConfig)(root);
35
- const names = options.profile?.length ? options.profile : Object.keys(config.profiles);
36
- for (const name of names)
37
- if (!config.profiles[name])
38
- throw new Error(`Unknown profile "${name}". Available: ${Object.keys(config.profiles).join(', ') || 'none'}`);
39
- const base = await (0, changed_files_1.resolveBase)(run, root, options.base ?? config.base);
40
- const changed = await (0, changed_files_1.getChangedFiles)(run, root, base);
41
- const results = [];
42
- for (const profile of names) {
43
- for (const check of config.profiles[profile]) {
44
- if (!(0, select_1.matchFiles)(changed, check.paths).length) {
45
- results.push({ profile, name: check.name, status: 'not-run', reason: 'no matching changes', durationMs: 0, stdout: '', stderr: '' });
46
- }
47
- else
48
- results.push(await runCheck(run, root, profile, check));
49
- }
50
- }
51
- return { base, changed, results };
52
- }
53
- exports.verifyChanges = verifyChanges;
54
- //# sourceMappingURL=verify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../src/features/verify-changes/verify.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,gDAA6E;AAC7E,4CAAiD;AACjD,mDAA+D;AAC/D,qCAAmD;AACnD,qCAAsC;AAkBtC,KAAK,UAAU,QAAQ,CAAC,GAAkB,EAAE,IAAY,EAAE,OAAe,EAAE,KAAkB;IAC5F,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,CAAC,MAAsD,EAAe,EAAE,CAAC,CAAC;QACxF,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAA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AU,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;aACrI;;gBAAM,OAAO,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SAC/D;KACD;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACnC,CAAC;AAhBD,sCAgBC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.testCommand = exports.buildCommand = exports.installCommand = void 0;
4
- const process_1 = require("../../core/process");
5
- function yarnCommand(command, describe, args) {
6
- return {
7
- command,
8
- describe,
9
- builder: (cli) => cli.option('path', { type: 'string', describe: 'Project directory' }),
10
- handler: async (options) => {
11
- await (0, process_1.runCommand)('yarn', args, { cwd: options.path, quiet: options.quiet });
12
- },
13
- };
14
- }
15
- exports.installCommand = yarnCommand('yarni', 'Install Yarn dependencies', ['install']);
16
- exports.buildCommand = yarnCommand('yarnb', 'Run the Yarn build', ['run', 'build']);
17
- exports.testCommand = yarnCommand('yarnt', 'Run the Yarn tests', ['run', 'test']);
18
- //# sourceMappingURL=commands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/features/yarn/commands.ts"],"names":[],"mappings":";;;AACA,gDAAgD;AAGhD,SAAS,WAAW,CAAC,OAAe,EAAE,QAAgB,EAAE,IAAc;IACrE,OAAO;QACN,OAAO;QACP,QAAQ;QACR,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;QACvF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC1B,MAAM,IAAA,oBAAU,EAAC,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7E,CAAC;KACD,CAAC;AACH,CAAC;AAEY,QAAA,cAAc,GAAG,WAAW,CAAC,OAAO,EAAE,2BAA2B,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AAChF,QAAA,YAAY,GAAG,WAAW,CAAC,OAAO,EAAE,oBAAoB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5E,QAAA,WAAW,GAAG,WAAW,CAAC,OAAO,EAAE,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC"}