@github-actions-workflow-ts/cli 2.2.0-beta.1 → 2.2.0-beta.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.
- package/bin/gwf.js +6 -4
- package/dist/commands/build.d.ts +2 -37
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +7 -183
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/diagnostics.d.ts +5 -0
- package/dist/commands/diagnostics.d.ts.map +1 -0
- package/dist/commands/diagnostics.js +16 -0
- package/dist/commands/diagnostics.js.map +1 -0
- package/dist/commands/types/build.d.ts +0 -8
- package/dist/commands/types/build.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js +0 -2
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/version-warning.d.ts +0 -67
- package/dist/validation/version-warning.d.ts.map +0 -1
- package/dist/validation/version-warning.js +0 -132
- package/dist/validation/version-warning.js.map +0 -1
package/bin/gwf.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { spawn } from 'child_process'
|
|
3
3
|
import { fileURLToPath } from 'url'
|
|
4
4
|
import { dirname, join } from 'path'
|
|
5
|
+
import { createRequire } from 'module'
|
|
5
6
|
|
|
6
7
|
const __filename = fileURLToPath(import.meta.url)
|
|
7
8
|
const __dirname = dirname(__filename)
|
|
@@ -9,11 +10,12 @@ const __dirname = dirname(__filename)
|
|
|
9
10
|
// Path to the actual CLI entry point
|
|
10
11
|
const cliPath = join(__dirname, '..', 'dist', 'bin.js')
|
|
11
12
|
|
|
12
|
-
//
|
|
13
|
-
const
|
|
13
|
+
// Use Node's module resolution to find tsx, which handles hoisted dependencies correctly
|
|
14
|
+
const require = createRequire(import.meta.url)
|
|
15
|
+
const tsxPath = require.resolve('tsx/cli')
|
|
14
16
|
|
|
15
|
-
// Spawn
|
|
16
|
-
const child = spawn(tsxPath,
|
|
17
|
+
// Spawn node with tsx CLI to run the script and pass through all arguments
|
|
18
|
+
const child = spawn(process.execPath, [tsxPath, cliPath, ...process.argv.slice(2)], {
|
|
17
19
|
stdio: 'inherit',
|
|
18
20
|
shell: process.platform === 'win32',
|
|
19
21
|
})
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Workflow } from '@github-actions-workflow-ts/lib';
|
|
2
2
|
import type { WacConfig } from './types/index.js';
|
|
3
|
-
import { type VersionWarning, type ActionVersionRegistry } from '../validation/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Strip internal metadata properties (prefixed with _) from workflow object.
|
|
6
|
-
* This removes properties like _sourceVersion and _defaultUses that are used
|
|
7
|
-
* for validation but shouldn't appear in the final YAML.
|
|
8
|
-
*/
|
|
9
|
-
export declare const stripInternalMetadata: (obj: any) => any;
|
|
10
3
|
/**
|
|
11
4
|
* Comment indicating the file should not be modified.
|
|
5
|
+
* @type {string}
|
|
12
6
|
*/
|
|
13
7
|
export declare const DEFAULT_HEADER_TEXT: string[];
|
|
14
8
|
/**
|
|
@@ -46,35 +40,6 @@ export declare const importWorkflowFile: (filePath: string) => Promise<Record<st
|
|
|
46
40
|
* @returns {number} - The number of workflows written.
|
|
47
41
|
*/
|
|
48
42
|
export declare const writeWorkflowJSONToYamlFiles: (workflowJSON: Record<string, Workflow>, workflowFilePath: string, config: WacConfig) => number;
|
|
49
|
-
/**
|
|
50
|
-
* Information about an action step including its uses string and source version if available.
|
|
51
|
-
*/
|
|
52
|
-
export interface ActionStepInfo {
|
|
53
|
-
uses: string;
|
|
54
|
-
sourceVersion?: string;
|
|
55
|
-
defaultUses?: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Extract all 'uses' values from a workflow's steps, along with source version info if available.
|
|
59
|
-
*/
|
|
60
|
-
export declare const extractUsesFromWorkflow: (workflow: any) => ActionStepInfo[];
|
|
61
|
-
/**
|
|
62
|
-
* Build a registry of action source versions from an imported workflow module.
|
|
63
|
-
* Scans the module for SourceVersion exports that were re-exported from the actions package.
|
|
64
|
-
* Maps action patterns (e.g., 'actions/checkout@v6') to their source versions (e.g., 'v6.2.0').
|
|
65
|
-
*/
|
|
66
|
-
export declare const buildActionVersionRegistryFromModule: (workflowModule: any) => ActionVersionRegistry;
|
|
67
|
-
/**
|
|
68
|
-
* Build a registry of action source versions from the actions package.
|
|
69
|
-
* Maps action patterns (e.g., 'actions/checkout@v6') to their source versions (e.g., 'v6.2.0').
|
|
70
|
-
*/
|
|
71
|
-
export declare const buildActionVersionRegistry: () => Promise<ActionVersionRegistry>;
|
|
72
|
-
/**
|
|
73
|
-
* Validate action versions in a workflow against known source versions.
|
|
74
|
-
* Uses source version info embedded in the step by typed action classes,
|
|
75
|
-
* falling back to a registry lookup if not available.
|
|
76
|
-
*/
|
|
77
|
-
export declare const validateWorkflowVersions: (workflow: any, registry: ActionVersionRegistry) => VersionWarning[];
|
|
78
43
|
/**
|
|
79
44
|
* Creates the .github/workflows directory if it doesn't exist.
|
|
80
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAGjD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,UAK/B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MACR,CAAA;AAEjC;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAO,SAAS,GAAG,SAgBxC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAO,MAAM,EAAE,GAAG,SA0BlD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,KACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAQlC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,cAAc,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EACtC,kBAAkB,MAAM,EACxB,QAAQ,SAAS,KAChB,MAoCF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,IAS1C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,IAAI,CA0Bd,CAAA"}
|
package/dist/commands/build.js
CHANGED
|
@@ -4,32 +4,11 @@ import * as path from 'path';
|
|
|
4
4
|
import * as jsYaml from 'js-yaml';
|
|
5
5
|
import fg from 'fast-glob';
|
|
6
6
|
import { pathToFileURL } from 'url';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
* Strip internal metadata properties (prefixed with _) from workflow object.
|
|
10
|
-
* This removes properties like _sourceVersion and _defaultUses that are used
|
|
11
|
-
* for validation but shouldn't appear in the final YAML.
|
|
12
|
-
*/
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
-
export const stripInternalMetadata = (obj) => {
|
|
15
|
-
if (obj === null || typeof obj !== 'object') {
|
|
16
|
-
return obj;
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(obj)) {
|
|
19
|
-
return obj.map(stripInternalMetadata);
|
|
20
|
-
}
|
|
21
|
-
const result = {};
|
|
22
|
-
for (const key in obj) {
|
|
23
|
-
// Skip properties starting with underscore
|
|
24
|
-
if (key.startsWith('_')) {
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
result[key] = stripInternalMetadata(obj[key]);
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
7
|
+
import { Context } from '@github-actions-workflow-ts/lib';
|
|
8
|
+
import { ConsoleDiagnosticsReporter } from './diagnostics.js';
|
|
31
9
|
/**
|
|
32
10
|
* Comment indicating the file should not be modified.
|
|
11
|
+
* @type {string}
|
|
33
12
|
*/
|
|
34
13
|
export const DEFAULT_HEADER_TEXT = [
|
|
35
14
|
'# ------------DO-NOT-MODIFY-THIS-FILE------------',
|
|
@@ -107,9 +86,7 @@ export const writeWorkflowJSONToYamlFiles = (workflowJSON, workflowFilePath, con
|
|
|
107
86
|
if (!workflow || !workflow.workflow || !workflow.filename) {
|
|
108
87
|
continue;
|
|
109
88
|
}
|
|
110
|
-
|
|
111
|
-
const cleanedWorkflow = stripInternalMetadata(workflow.workflow);
|
|
112
|
-
const workflowYaml = jsYaml.dump(cleanedWorkflow, {
|
|
89
|
+
const workflowYaml = jsYaml.dump(workflow.workflow, {
|
|
113
90
|
noRefs: !config.refs,
|
|
114
91
|
...(config.dumpOptions || {}),
|
|
115
92
|
});
|
|
@@ -123,142 +100,6 @@ export const writeWorkflowJSONToYamlFiles = (workflowJSON, workflowFilePath, con
|
|
|
123
100
|
}
|
|
124
101
|
return workflowCount;
|
|
125
102
|
};
|
|
126
|
-
/**
|
|
127
|
-
* Extract all 'uses' values from a workflow's steps, along with source version info if available.
|
|
128
|
-
*/
|
|
129
|
-
export const extractUsesFromWorkflow = (
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
|
-
workflow) => {
|
|
132
|
-
const actions = [];
|
|
133
|
-
if (!workflow?.jobs)
|
|
134
|
-
return actions;
|
|
135
|
-
for (const jobName in workflow.jobs) {
|
|
136
|
-
const job = workflow.jobs[jobName];
|
|
137
|
-
if (!job?.steps || !Array.isArray(job.steps))
|
|
138
|
-
continue;
|
|
139
|
-
for (const step of job.steps) {
|
|
140
|
-
if (step?.uses && typeof step.uses === 'string') {
|
|
141
|
-
actions.push({
|
|
142
|
-
uses: step.uses,
|
|
143
|
-
sourceVersion: step._sourceVersion,
|
|
144
|
-
defaultUses: step._defaultUses,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return actions;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* Build a registry of action source versions from an imported workflow module.
|
|
153
|
-
* Scans the module for SourceVersion exports that were re-exported from the actions package.
|
|
154
|
-
* Maps action patterns (e.g., 'actions/checkout@v6') to their source versions (e.g., 'v6.2.0').
|
|
155
|
-
*/
|
|
156
|
-
export const buildActionVersionRegistryFromModule = (
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
|
-
workflowModule) => {
|
|
159
|
-
const registry = new Map();
|
|
160
|
-
// The workflow module may have imported action classes from @github-actions-workflow-ts/actions
|
|
161
|
-
// We need to find any SourceVersion constants that were imported alongside them
|
|
162
|
-
// This is tricky because we don't have direct access to the actions package exports
|
|
163
|
-
// Instead, scan for any exported values that look like SourceVersion constants
|
|
164
|
-
for (const key in workflowModule) {
|
|
165
|
-
if (key.endsWith('SourceVersion')) {
|
|
166
|
-
const value = workflowModule[key];
|
|
167
|
-
if (typeof value === 'string') {
|
|
168
|
-
const className = key.replace('SourceVersion', '');
|
|
169
|
-
const actionClass = workflowModule[className];
|
|
170
|
-
if (typeof actionClass === 'function') {
|
|
171
|
-
try {
|
|
172
|
-
const instance = new actionClass();
|
|
173
|
-
if (instance.step?.uses) {
|
|
174
|
-
registry.set(instance.step.uses, value);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
catch {
|
|
178
|
-
// Skip if constructor fails
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return registry;
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* Build a registry of action source versions from the actions package.
|
|
188
|
-
* Maps action patterns (e.g., 'actions/checkout@v6') to their source versions (e.g., 'v6.2.0').
|
|
189
|
-
*/
|
|
190
|
-
export const buildActionVersionRegistry = async () => {
|
|
191
|
-
const registry = new Map();
|
|
192
|
-
try {
|
|
193
|
-
// Try to import the actions package dynamically
|
|
194
|
-
// Using a variable to prevent static analysis from failing the build
|
|
195
|
-
const packageName = '@github-actions-workflow-ts/actions';
|
|
196
|
-
const actionsModule = (await import(packageName));
|
|
197
|
-
// Look for exports ending in 'SourceVersion' and their corresponding action metadata
|
|
198
|
-
for (const key in actionsModule) {
|
|
199
|
-
if (key.endsWith('SourceVersion')) {
|
|
200
|
-
const value = actionsModule[key];
|
|
201
|
-
if (typeof value === 'string') {
|
|
202
|
-
// The key format is like 'ActionsCheckoutV6SourceVersion'
|
|
203
|
-
// We need to map this to 'actions/checkout@v6'
|
|
204
|
-
const className = key.replace('SourceVersion', '');
|
|
205
|
-
// Try to find the corresponding class and get its default uses value
|
|
206
|
-
const actionClass = actionsModule[className];
|
|
207
|
-
if (typeof actionClass === 'function' &&
|
|
208
|
-
'prototype' in actionClass) {
|
|
209
|
-
try {
|
|
210
|
-
// Create a temporary instance to get the default uses value
|
|
211
|
-
const instance = new actionClass();
|
|
212
|
-
if (instance.step?.uses) {
|
|
213
|
-
// Extract the action pattern (e.g., 'actions/checkout@v6')
|
|
214
|
-
registry.set(instance.step.uses, value);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
catch {
|
|
218
|
-
// Constructor might require arguments, skip this action
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
// Package not installed or not available, skip version validation
|
|
227
|
-
}
|
|
228
|
-
return registry;
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* Validate action versions in a workflow against known source versions.
|
|
232
|
-
* Uses source version info embedded in the step by typed action classes,
|
|
233
|
-
* falling back to a registry lookup if not available.
|
|
234
|
-
*/
|
|
235
|
-
export const validateWorkflowVersions = (
|
|
236
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
237
|
-
workflow, registry) => {
|
|
238
|
-
const warnings = [];
|
|
239
|
-
const actionSteps = extractUsesFromWorkflow(workflow);
|
|
240
|
-
for (const actionStep of actionSteps) {
|
|
241
|
-
// Prefer embedded source version from typed action class
|
|
242
|
-
let sourceVersion = actionStep.sourceVersion;
|
|
243
|
-
const defaultUses = actionStep.defaultUses;
|
|
244
|
-
// Fall back to registry lookup if no embedded version
|
|
245
|
-
if (!sourceVersion && registry.size > 0) {
|
|
246
|
-
const pattern = getActionPattern(actionStep.uses);
|
|
247
|
-
sourceVersion = registry.get(pattern);
|
|
248
|
-
}
|
|
249
|
-
// Also try matching against defaultUses if available
|
|
250
|
-
if (!sourceVersion && defaultUses && registry.size > 0) {
|
|
251
|
-
sourceVersion = registry.get(defaultUses);
|
|
252
|
-
}
|
|
253
|
-
if (sourceVersion) {
|
|
254
|
-
const warning = validateActionVersion(actionStep.uses, sourceVersion);
|
|
255
|
-
if (warning) {
|
|
256
|
-
warnings.push(warning);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return warnings;
|
|
261
|
-
};
|
|
262
103
|
/**
|
|
263
104
|
* Creates the .github/workflows directory if it doesn't exist.
|
|
264
105
|
*/
|
|
@@ -279,34 +120,17 @@ export const generateWorkflowFiles = async (argv) => {
|
|
|
279
120
|
const config = getConfig() || {};
|
|
280
121
|
const workflowFilePaths = getWorkflowFilePaths() || [];
|
|
281
122
|
let workflowCount = 0;
|
|
282
|
-
const allWarnings = [];
|
|
283
|
-
// Build version registry for validation (if warnings are enabled)
|
|
284
|
-
const versionWarningsEnabled = config.actionsPackageOutdatedVersionWarnings !== false;
|
|
285
|
-
const registry = versionWarningsEnabled
|
|
286
|
-
? await buildActionVersionRegistry()
|
|
287
|
-
: new Map();
|
|
288
123
|
createWorkflowDirectory();
|
|
124
|
+
Context.__internalSetGlobalContext({
|
|
125
|
+
diagnostics: new ConsoleDiagnosticsReporter(),
|
|
126
|
+
});
|
|
289
127
|
for (const filePath of workflowFilePaths) {
|
|
290
128
|
const workflows = await importWorkflowFile(filePath);
|
|
291
|
-
// Validate versions if enabled
|
|
292
|
-
if (versionWarningsEnabled) {
|
|
293
|
-
for (const workflowName in workflows) {
|
|
294
|
-
const workflow = workflows[workflowName];
|
|
295
|
-
if (workflow?.workflow) {
|
|
296
|
-
const warnings = validateWorkflowVersions(workflow.workflow, registry);
|
|
297
|
-
allWarnings.push(...warnings);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
129
|
workflowCount += writeWorkflowJSONToYamlFiles(workflows, relativePath(filePath), {
|
|
302
130
|
...argv,
|
|
303
131
|
...config,
|
|
304
132
|
});
|
|
305
133
|
}
|
|
306
134
|
console.log(`[github-actions-workflow-ts] Successfully generated ${workflowCount} workflow file(s)`);
|
|
307
|
-
// Log version warnings at the end
|
|
308
|
-
if (versionWarningsEnabled) {
|
|
309
|
-
logVersionWarnings(allWarnings);
|
|
310
|
-
}
|
|
311
135
|
};
|
|
312
136
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,MAAM,WAAW,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,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AAC,CAAA;IAErB,uBAAuB,EAAE,CAAA;IAEzB,OAAO,CAAC,0BAA0B,CAAC;QACjC,WAAW,EAAE,IAAI,0BAA0B,EAAE;KAC9C,CAAC,CAAA;IAEF,KAAK,MAAM,QAAQ,IAAI,iBAAiB,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAA;QACpD,aAAa,IAAI,4BAA4B,CAC3C,SAAS,EACT,YAAY,CAAC,QAAQ,CAAC,EACtB;YACE,GAAG,IAAI;YACP,GAAG,MAAM;SACG,CACf,CAAA;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,uDAAuD,aAAa,mBAAmB,CACxF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/commands/diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAE7D,qBAAa,0BACX,YAAW,WAAW,CAAC,mBAAmB;IAE1C,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,UAAU,GAAG,IAAI;CAWtC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { Diagnostics } from '@github-actions-workflow-ts/lib';
|
|
3
|
+
export class ConsoleDiagnosticsReporter {
|
|
4
|
+
emit(d) {
|
|
5
|
+
console.log(d);
|
|
6
|
+
let message = `[github-actions-workflow-ts] ${d.severity}: ${d.message} (${d.code})`;
|
|
7
|
+
if (d.stack) {
|
|
8
|
+
message += `\n${d.stack}`;
|
|
9
|
+
}
|
|
10
|
+
if (d.cause) {
|
|
11
|
+
message += `\n[cause]: ${d.cause}`;
|
|
12
|
+
}
|
|
13
|
+
console.error(message);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/commands/diagnostics.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAE7D,MAAM,OAAO,0BAA0B;IAGrC,IAAI,CAAC,CAAyB;QAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACd,IAAI,OAAO,GAAG,gCAAgC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,IAAI,GAAG,CAAA;QACpF,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;YACZ,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,CAAA;QAC3B,CAAC;QACD,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;YACZ,OAAO,IAAI,cAAc,CAAC,CAAC,KAAK,EAAE,CAAA;QACpC,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;CACF"}
|
|
@@ -2,13 +2,5 @@ export type WacConfig = {
|
|
|
2
2
|
refs?: boolean;
|
|
3
3
|
headerText?: string[];
|
|
4
4
|
dumpOptions?: Record<string, unknown>;
|
|
5
|
-
/**
|
|
6
|
-
* Enable/disable version mismatch warnings for actions package.
|
|
7
|
-
* When true (default), warns when:
|
|
8
|
-
* - A pinned version is older than the version types were generated from
|
|
9
|
-
* - A non-semver ref (commit SHA, branch) is used
|
|
10
|
-
* Set to false to suppress these warnings.
|
|
11
|
-
*/
|
|
12
|
-
actionsPackageOutdatedVersionWarnings?: boolean;
|
|
13
5
|
};
|
|
14
6
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/types/build.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/types/build.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACtC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github-actions-workflow-ts/cli",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.3",
|
|
4
4
|
"description": "CLI to generate GitHub Actions YAML from TypeScript workflow files",
|
|
5
5
|
"author": "Emmanuel N Kyeyune",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"js-yaml": "^4.1.0",
|
|
35
35
|
"tsx": "^4.19.3",
|
|
36
36
|
"yargs": "^17.7.2",
|
|
37
|
-
"@github-actions-workflow-ts/lib": "2.
|
|
37
|
+
"@github-actions-workflow-ts/lib": "2.2.0-beta.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@jest/globals": "^29.7.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
package/dist/validation/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse a semver-like version string into its components.
|
|
3
|
-
* Returns null if the version doesn't match semver patterns.
|
|
4
|
-
*/
|
|
5
|
-
export declare function parseVersion(version: string): {
|
|
6
|
-
major: number;
|
|
7
|
-
minor: number;
|
|
8
|
-
patch: number;
|
|
9
|
-
} | null;
|
|
10
|
-
/**
|
|
11
|
-
* Compare two semver versions.
|
|
12
|
-
* Returns: positive if a > b, negative if a < b, 0 if equal
|
|
13
|
-
*/
|
|
14
|
-
export declare function compareSemver(a: {
|
|
15
|
-
major: number;
|
|
16
|
-
minor: number;
|
|
17
|
-
patch: number;
|
|
18
|
-
}, b: {
|
|
19
|
-
major: number;
|
|
20
|
-
minor: number;
|
|
21
|
-
patch: number;
|
|
22
|
-
}): number;
|
|
23
|
-
/**
|
|
24
|
-
* Extract the version part from a uses string.
|
|
25
|
-
* e.g., "actions/checkout@v6.0.1" -> "v6.0.1"
|
|
26
|
-
* "actions/checkout@abc123" -> "abc123"
|
|
27
|
-
*/
|
|
28
|
-
export declare function extractVersionFromUses(uses: string): string | null;
|
|
29
|
-
/**
|
|
30
|
-
* Check if a version string looks like a semver (vX, vX.Y, or vX.Y.Z).
|
|
31
|
-
*/
|
|
32
|
-
export declare function isSemverLike(version: string): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Result of version validation.
|
|
35
|
-
*/
|
|
36
|
-
export interface VersionWarning {
|
|
37
|
-
uses: string;
|
|
38
|
-
usedVersion: string;
|
|
39
|
-
sourceVersion: string;
|
|
40
|
-
message: string;
|
|
41
|
-
type: 'older-version' | 'non-semver-ref';
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Check if a version string is a major-only version (e.g., "v4" not "v4.1.0").
|
|
45
|
-
*/
|
|
46
|
-
export declare function isMajorOnly(version: string): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Validate a uses string against a source version.
|
|
49
|
-
* Returns a warning object if there's a potential issue, null otherwise.
|
|
50
|
-
*/
|
|
51
|
-
export declare function validateActionVersion(uses: string, sourceVersion: string): VersionWarning | null;
|
|
52
|
-
/**
|
|
53
|
-
* Log version warnings to console.
|
|
54
|
-
*/
|
|
55
|
-
export declare function logVersionWarnings(warnings: VersionWarning[]): void;
|
|
56
|
-
/**
|
|
57
|
-
* Known action source versions registry.
|
|
58
|
-
* Maps action patterns to their source versions.
|
|
59
|
-
* This is populated by importing from @github-actions-workflow-ts/actions.
|
|
60
|
-
*/
|
|
61
|
-
export type ActionVersionRegistry = Map<string, string>;
|
|
62
|
-
/**
|
|
63
|
-
* Create an action pattern from owner/repo for lookup.
|
|
64
|
-
* e.g., "actions/checkout@v6" -> "actions/checkout@v6"
|
|
65
|
-
*/
|
|
66
|
-
export declare function getActionPattern(uses: string): string;
|
|
67
|
-
//# sourceMappingURL=version-warning.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version-warning.d.ts","sourceRoot":"","sources":["../../src/validation/version-warning.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUxD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAClD,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD,MAAM,CAIR;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGlE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,eAAe,GAAG,gBAAgB,CAAA;CACzC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GACpB,cAAc,GAAG,IAAI,CAoDvB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAYnE;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAerD"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
/**
|
|
3
|
-
* Parse a semver-like version string into its components.
|
|
4
|
-
* Returns null if the version doesn't match semver patterns.
|
|
5
|
-
*/
|
|
6
|
-
export function parseVersion(version) {
|
|
7
|
-
// Match patterns like v1, v1.0, v1.0.0, 1, 1.0, 1.0.0
|
|
8
|
-
const match = version.match(/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$/);
|
|
9
|
-
if (!match)
|
|
10
|
-
return null;
|
|
11
|
-
return {
|
|
12
|
-
major: parseInt(match[1], 10),
|
|
13
|
-
minor: match[2] !== undefined ? parseInt(match[2], 10) : 0,
|
|
14
|
-
patch: match[3] !== undefined ? parseInt(match[3], 10) : 0,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Compare two semver versions.
|
|
19
|
-
* Returns: positive if a > b, negative if a < b, 0 if equal
|
|
20
|
-
*/
|
|
21
|
-
export function compareSemver(a, b) {
|
|
22
|
-
if (a.major !== b.major)
|
|
23
|
-
return a.major - b.major;
|
|
24
|
-
if (a.minor !== b.minor)
|
|
25
|
-
return a.minor - b.minor;
|
|
26
|
-
return a.patch - b.patch;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Extract the version part from a uses string.
|
|
30
|
-
* e.g., "actions/checkout@v6.0.1" -> "v6.0.1"
|
|
31
|
-
* "actions/checkout@abc123" -> "abc123"
|
|
32
|
-
*/
|
|
33
|
-
export function extractVersionFromUses(uses) {
|
|
34
|
-
const match = uses.match(/@(.+)$/);
|
|
35
|
-
return match ? match[1] : null;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Check if a version string looks like a semver (vX, vX.Y, or vX.Y.Z).
|
|
39
|
-
*/
|
|
40
|
-
export function isSemverLike(version) {
|
|
41
|
-
return parseVersion(version) !== null;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Check if a version string is a major-only version (e.g., "v4" not "v4.1.0").
|
|
45
|
-
*/
|
|
46
|
-
export function isMajorOnly(version) {
|
|
47
|
-
// Match patterns like v1 or 1 (without minor/patch)
|
|
48
|
-
return /^v?\d+$/.test(version);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Validate a uses string against a source version.
|
|
52
|
-
* Returns a warning object if there's a potential issue, null otherwise.
|
|
53
|
-
*/
|
|
54
|
-
export function validateActionVersion(uses, sourceVersion) {
|
|
55
|
-
const usedVersion = extractVersionFromUses(uses);
|
|
56
|
-
if (!usedVersion)
|
|
57
|
-
return null;
|
|
58
|
-
// Check if used version is semver-like
|
|
59
|
-
const usedParsed = parseVersion(usedVersion);
|
|
60
|
-
if (!usedParsed) {
|
|
61
|
-
// Non-semver ref (commit SHA, branch name, etc.)
|
|
62
|
-
return {
|
|
63
|
-
uses,
|
|
64
|
-
usedVersion,
|
|
65
|
-
sourceVersion,
|
|
66
|
-
message: `Using non-semver ref "${usedVersion}". Types were generated from ${sourceVersion} and may not match.`,
|
|
67
|
-
type: 'non-semver-ref',
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
// Compare with source version
|
|
71
|
-
const sourceParsed = parseVersion(sourceVersion);
|
|
72
|
-
if (!sourceParsed)
|
|
73
|
-
return null;
|
|
74
|
-
// If using major-only version (e.g., @v4), it resolves to latest, so no warning needed
|
|
75
|
-
// as long as it's the same major version
|
|
76
|
-
if (isMajorOnly(usedVersion) && usedParsed.major === sourceParsed.major) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
// Only compare if same major version
|
|
80
|
-
if (usedParsed.major !== sourceParsed.major) {
|
|
81
|
-
// Different major version - types were generated for a different major
|
|
82
|
-
return {
|
|
83
|
-
uses,
|
|
84
|
-
usedVersion,
|
|
85
|
-
sourceVersion,
|
|
86
|
-
message: `Using ${usedVersion} but types were generated from ${sourceVersion} (different major version). Types may not match.`,
|
|
87
|
-
type: 'older-version',
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
// Check if used version is older than source
|
|
91
|
-
if (compareSemver(usedParsed, sourceParsed) < 0) {
|
|
92
|
-
return {
|
|
93
|
-
uses,
|
|
94
|
-
usedVersion,
|
|
95
|
-
sourceVersion,
|
|
96
|
-
message: `Pinned to ${usedVersion} which is older than ${sourceVersion} (types source). Some inputs/outputs may not exist in ${usedVersion}.`,
|
|
97
|
-
type: 'older-version',
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Log version warnings to console.
|
|
104
|
-
*/
|
|
105
|
-
export function logVersionWarnings(warnings) {
|
|
106
|
-
if (warnings.length === 0)
|
|
107
|
-
return;
|
|
108
|
-
console.log('\n[github-actions-workflow-ts] ⚠️ Version warnings detected:');
|
|
109
|
-
for (const warning of warnings) {
|
|
110
|
-
console.log(` • ${warning.uses}: ${warning.message}`);
|
|
111
|
-
}
|
|
112
|
-
console.log(' To suppress these warnings, set "actionsPackageOutdatedVersionWarnings": false in wac.config.json\n');
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Create an action pattern from owner/repo for lookup.
|
|
116
|
-
* e.g., "actions/checkout@v6" -> "actions/checkout@v6"
|
|
117
|
-
*/
|
|
118
|
-
export function getActionPattern(uses) {
|
|
119
|
-
// Extract owner/repo@version pattern
|
|
120
|
-
const match = uses.match(/^([^@]+)@(.+)$/);
|
|
121
|
-
if (!match)
|
|
122
|
-
return uses;
|
|
123
|
-
const [, actionPath, version] = match;
|
|
124
|
-
const versionParsed = parseVersion(version);
|
|
125
|
-
if (versionParsed) {
|
|
126
|
-
// For semver, match against major version pattern
|
|
127
|
-
return `${actionPath}@v${versionParsed.major}`;
|
|
128
|
-
}
|
|
129
|
-
// For non-semver, return as-is (won't match registry)
|
|
130
|
-
return uses;
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=version-warning.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version-warning.js","sourceRoot":"","sources":["../../src/validation/version-warning.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAe;IAEf,sDAAsD;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAA;IAChE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC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