@github-actions-workflow-ts/cli 2.4.0-beta.1 → 2.4.0-beta.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/dist/commands/build.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ import type { WacConfig } from './types/index.js';
|
|
|
4
4
|
* Default output path for workflow files.
|
|
5
5
|
*/
|
|
6
6
|
export declare const DEFAULT_OUTPUT_PATH: string;
|
|
7
|
+
/**
|
|
8
|
+
* Finds the project root directory by looking for markers like .git or package.json.
|
|
9
|
+
* Walks up the directory tree from the current working directory.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} [startDir] - The directory to start searching from. Defaults to cwd.
|
|
12
|
+
* @returns {string} - The project root directory, or cwd if no markers found.
|
|
13
|
+
*/
|
|
14
|
+
export declare const findProjectRoot: (startDir?: string) => string;
|
|
7
15
|
/**
|
|
8
16
|
* Comment indicating the file should not be modified.
|
|
9
17
|
* @type {string}
|
|
@@ -16,6 +24,14 @@ export declare const DEFAULT_HEADER_TEXT: string[];
|
|
|
16
24
|
* @returns {string} - Relative path from the current working directory.
|
|
17
25
|
*/
|
|
18
26
|
export declare const relativePath: (p: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolves the root directory for output paths.
|
|
29
|
+
* Priority: config.rootDir > auto-detected project root > cwd
|
|
30
|
+
*
|
|
31
|
+
* @param {WacConfig} config - The configuration object.
|
|
32
|
+
* @returns {string} - The resolved root directory (absolute path).
|
|
33
|
+
*/
|
|
34
|
+
export declare const resolveRootDir: (config: WacConfig) => string;
|
|
19
35
|
/**
|
|
20
36
|
* Resolves the output path for a workflow file.
|
|
21
37
|
*
|
|
@@ -25,12 +41,15 @@ export declare const relativePath: (p: string) => string;
|
|
|
25
41
|
* 3. config.outputPaths.workflows.default
|
|
26
42
|
* 4. DEFAULT_OUTPUT_PATH (.github/workflows)
|
|
27
43
|
*
|
|
44
|
+
* Output paths are resolved relative to the root directory (see resolveRootDir).
|
|
45
|
+
*
|
|
28
46
|
* @param {Workflow} workflow - The workflow instance.
|
|
29
47
|
* @param {string} workflowFilePath - The source file path (e.g., "my-workflow.wac.ts").
|
|
30
48
|
* @param {WacConfig} config - The configuration object.
|
|
31
|
-
* @
|
|
49
|
+
* @param {string} rootDir - The root directory for resolving output paths.
|
|
50
|
+
* @returns {string} - The resolved output directory path (absolute).
|
|
32
51
|
*/
|
|
33
|
-
export declare const resolveOutputPath: (workflow: Workflow, workflowFilePath: string, config: WacConfig) => string;
|
|
52
|
+
export declare const resolveOutputPath: (workflow: Workflow, workflowFilePath: string, config: WacConfig, rootDir: string) => string;
|
|
34
53
|
/**
|
|
35
54
|
* Supported config file names in order of priority.
|
|
36
55
|
* TypeScript config takes precedence over JSON config.
|
|
@@ -69,10 +88,11 @@ export declare const importWorkflowFile: (filePath: string) => Promise<Record<st
|
|
|
69
88
|
* @param {Record<string, Workflow>} workflowJSON - The workflow data in JSON format.
|
|
70
89
|
* @param {string} workflowFilePath - The path to the workflow file.
|
|
71
90
|
* @param {WacConfig} config - Command line arguments.
|
|
91
|
+
* @param {string} rootDir - The root directory for resolving output paths.
|
|
72
92
|
* @param {Set<string>} [createdDirectories] - Optional set to track directories that have been created.
|
|
73
93
|
* @returns {number} - The number of workflows written.
|
|
74
94
|
*/
|
|
75
|
-
export declare const writeWorkflowJSONToYamlFiles: (workflowJSON: Record<string, Workflow>, workflowFilePath: string, config: WacConfig, createdDirectories?: Set<string>) => number;
|
|
95
|
+
export declare const writeWorkflowJSONToYamlFiles: (workflowJSON: Record<string, Workflow>, workflowFilePath: string, config: WacConfig, rootDir: string, createdDirectories?: Set<string>) => number;
|
|
76
96
|
/**
|
|
77
97
|
* Creates the workflow output directory if it doesn't exist.
|
|
78
98
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM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A;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,KACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAQlC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,GACvC,cAAc,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EACtC,kBAAkB,MAAM,EACxB,QAAQ,SAAS,EACjB,SAAS,MAAM,EACf,qBAAqB,GAAG,CAAC,MAAM,CAAC,KAC/B,MA8CF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAY,MAA4B,KACvC,IASF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,IAAI,CAsCd,CAAA"}
|
package/dist/commands/build.js
CHANGED
|
@@ -11,6 +11,41 @@ import { ConsoleDiagnosticsReporter } from './diagnostics.js';
|
|
|
11
11
|
* Default output path for workflow files.
|
|
12
12
|
*/
|
|
13
13
|
export const DEFAULT_OUTPUT_PATH = path.join('.github', 'workflows');
|
|
14
|
+
/**
|
|
15
|
+
* Finds the project root directory by looking for markers like .git or package.json.
|
|
16
|
+
* Walks up the directory tree from the current working directory.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} [startDir] - The directory to start searching from. Defaults to cwd.
|
|
19
|
+
* @returns {string} - The project root directory, or cwd if no markers found.
|
|
20
|
+
*/
|
|
21
|
+
export const findProjectRoot = (startDir) => {
|
|
22
|
+
let currentDir = startDir || process.cwd();
|
|
23
|
+
const root = path.parse(currentDir).root;
|
|
24
|
+
while (currentDir !== root) {
|
|
25
|
+
// Check for .git directory (most reliable indicator of project root)
|
|
26
|
+
if (fs.existsSync(path.join(currentDir, '.git'))) {
|
|
27
|
+
return currentDir;
|
|
28
|
+
}
|
|
29
|
+
// Check for package.json as fallback (could be in a workspace package)
|
|
30
|
+
// Only use if it has workspaces defined (indicating it's the root)
|
|
31
|
+
const packageJsonPath = path.join(currentDir, 'package.json');
|
|
32
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
33
|
+
try {
|
|
34
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
35
|
+
// If it has workspaces, it's likely the monorepo root
|
|
36
|
+
if (packageJson.workspaces) {
|
|
37
|
+
return currentDir;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Ignore parse errors
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
currentDir = path.dirname(currentDir);
|
|
45
|
+
}
|
|
46
|
+
// No project root found, return cwd
|
|
47
|
+
return process.cwd();
|
|
48
|
+
};
|
|
14
49
|
/**
|
|
15
50
|
* Comment indicating the file should not be modified.
|
|
16
51
|
* @type {string}
|
|
@@ -28,6 +63,21 @@ export const DEFAULT_HEADER_TEXT = [
|
|
|
28
63
|
* @returns {string} - Relative path from the current working directory.
|
|
29
64
|
*/
|
|
30
65
|
export const relativePath = (p) => path.relative(process.cwd(), p);
|
|
66
|
+
/**
|
|
67
|
+
* Resolves the root directory for output paths.
|
|
68
|
+
* Priority: config.rootDir > auto-detected project root > cwd
|
|
69
|
+
*
|
|
70
|
+
* @param {WacConfig} config - The configuration object.
|
|
71
|
+
* @returns {string} - The resolved root directory (absolute path).
|
|
72
|
+
*/
|
|
73
|
+
export const resolveRootDir = (config) => {
|
|
74
|
+
if (config.rootDir) {
|
|
75
|
+
// If rootDir is relative, resolve it from cwd
|
|
76
|
+
return path.resolve(process.cwd(), config.rootDir);
|
|
77
|
+
}
|
|
78
|
+
// Auto-detect project root
|
|
79
|
+
return findProjectRoot();
|
|
80
|
+
};
|
|
31
81
|
/**
|
|
32
82
|
* Resolves the output path for a workflow file.
|
|
33
83
|
*
|
|
@@ -37,35 +87,51 @@ export const relativePath = (p) => path.relative(process.cwd(), p);
|
|
|
37
87
|
* 3. config.outputPaths.workflows.default
|
|
38
88
|
* 4. DEFAULT_OUTPUT_PATH (.github/workflows)
|
|
39
89
|
*
|
|
90
|
+
* Output paths are resolved relative to the root directory (see resolveRootDir).
|
|
91
|
+
*
|
|
40
92
|
* @param {Workflow} workflow - The workflow instance.
|
|
41
93
|
* @param {string} workflowFilePath - The source file path (e.g., "my-workflow.wac.ts").
|
|
42
94
|
* @param {WacConfig} config - The configuration object.
|
|
43
|
-
* @
|
|
95
|
+
* @param {string} rootDir - The root directory for resolving output paths.
|
|
96
|
+
* @returns {string} - The resolved output directory path (absolute).
|
|
44
97
|
*/
|
|
45
|
-
export const resolveOutputPath = (workflow, workflowFilePath, config) => {
|
|
98
|
+
export const resolveOutputPath = (workflow, workflowFilePath, config, rootDir) => {
|
|
99
|
+
let outputPath;
|
|
46
100
|
// 1. Check workflow-level outputPath (highest priority)
|
|
47
101
|
if (workflow.outputPath) {
|
|
48
|
-
|
|
102
|
+
outputPath = workflow.outputPath;
|
|
49
103
|
}
|
|
50
104
|
// 2. Check config overrides
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
105
|
+
else {
|
|
106
|
+
const outputPathsConfig = config.outputPaths?.workflows;
|
|
107
|
+
if (outputPathsConfig?.overrides) {
|
|
108
|
+
const filename = path.basename(workflowFilePath);
|
|
109
|
+
let matched = false;
|
|
110
|
+
for (const override of outputPathsConfig.overrides) {
|
|
111
|
+
// Match against both the full relative path and just the filename
|
|
112
|
+
// This allows patterns like "packages/app-a/**/*.wac.ts" or "deploy.wac.ts"
|
|
113
|
+
if (micromatch.isMatch(workflowFilePath, override.match) ||
|
|
114
|
+
micromatch.isMatch(filename, override.match)) {
|
|
115
|
+
outputPath = override.path;
|
|
116
|
+
matched = true;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (!matched) {
|
|
121
|
+
// 3. Check config default
|
|
122
|
+
outputPath = outputPathsConfig?.default || DEFAULT_OUTPUT_PATH;
|
|
60
123
|
}
|
|
61
124
|
}
|
|
125
|
+
else {
|
|
126
|
+
// 3. Check config default
|
|
127
|
+
outputPath = outputPathsConfig?.default || DEFAULT_OUTPUT_PATH;
|
|
128
|
+
}
|
|
62
129
|
}
|
|
63
|
-
//
|
|
64
|
-
if (
|
|
65
|
-
return
|
|
130
|
+
// Resolve relative paths from rootDir, absolute paths stay as-is
|
|
131
|
+
if (path.isAbsolute(outputPath)) {
|
|
132
|
+
return outputPath;
|
|
66
133
|
}
|
|
67
|
-
|
|
68
|
-
return DEFAULT_OUTPUT_PATH;
|
|
134
|
+
return path.join(rootDir, outputPath);
|
|
69
135
|
};
|
|
70
136
|
/**
|
|
71
137
|
* Supported config file names in order of priority.
|
|
@@ -154,10 +220,11 @@ export const importWorkflowFile = async (filePath) => {
|
|
|
154
220
|
* @param {Record<string, Workflow>} workflowJSON - The workflow data in JSON format.
|
|
155
221
|
* @param {string} workflowFilePath - The path to the workflow file.
|
|
156
222
|
* @param {WacConfig} config - Command line arguments.
|
|
223
|
+
* @param {string} rootDir - The root directory for resolving output paths.
|
|
157
224
|
* @param {Set<string>} [createdDirectories] - Optional set to track directories that have been created.
|
|
158
225
|
* @returns {number} - The number of workflows written.
|
|
159
226
|
*/
|
|
160
|
-
export const writeWorkflowJSONToYamlFiles = (workflowJSON, workflowFilePath, config, createdDirectories) => {
|
|
227
|
+
export const writeWorkflowJSONToYamlFiles = (workflowJSON, workflowFilePath, config, rootDir, createdDirectories) => {
|
|
161
228
|
let workflowCount = 0;
|
|
162
229
|
for (const workflowName in workflowJSON) {
|
|
163
230
|
const workflow = workflowJSON[workflowName];
|
|
@@ -170,7 +237,7 @@ export const writeWorkflowJSONToYamlFiles = (workflowJSON, workflowFilePath, con
|
|
|
170
237
|
...(config.dumpOptions || {}),
|
|
171
238
|
});
|
|
172
239
|
// Resolve the output path for this workflow
|
|
173
|
-
const outputDir = resolveOutputPath(workflow, workflowFilePath, config);
|
|
240
|
+
const outputDir = resolveOutputPath(workflow, workflowFilePath, config, rootDir);
|
|
174
241
|
// Create directory if not already created
|
|
175
242
|
if (createdDirectories && !createdDirectories.has(outputDir)) {
|
|
176
243
|
createWorkflowDirectory(outputDir);
|
|
@@ -208,6 +275,12 @@ export const generateWorkflowFiles = async (argv) => {
|
|
|
208
275
|
const config = (await getConfigAsync()) || {};
|
|
209
276
|
const workflowFilePaths = getWorkflowFilePaths() || [];
|
|
210
277
|
let workflowCount = 0;
|
|
278
|
+
// Resolve the root directory for output paths
|
|
279
|
+
const rootDir = resolveRootDir(config);
|
|
280
|
+
const cwd = process.cwd();
|
|
281
|
+
if (rootDir !== cwd) {
|
|
282
|
+
console.log(`[github-actions-workflow-ts] Using project root: ${rootDir}`);
|
|
283
|
+
}
|
|
211
284
|
// Track created directories to avoid duplicate creation attempts
|
|
212
285
|
const createdDirectories = new Set();
|
|
213
286
|
Context.__internalSetGlobalContext({
|
|
@@ -219,7 +292,7 @@ export const generateWorkflowFiles = async (argv) => {
|
|
|
219
292
|
workflowCount += writeWorkflowJSONToYamlFiles(workflows, relativePath(filePath), {
|
|
220
293
|
...argv,
|
|
221
294
|
...config,
|
|
222
|
-
}, createdDirectories);
|
|
295
|
+
}, rootDir, createdDirectories);
|
|
223
296
|
}
|
|
224
297
|
console.log(`[github-actions-workflow-ts] Successfully generated ${workflowCount} workflow file(s)`);
|
|
225
298
|
};
|
|
@@ -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,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE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AoB,EAAE,IAAI,EAAE,CAAA;IACtD,IAAI,aAAa,GAAG,CAAC,CAAA;IAErB,8CAA8C;IAC9C,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IACtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAEzB,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,oDAAoD,OAAO,EAAE,CAAC,CAAA;IAC5E,CAAC;IAED,iEAAiE;IACjE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAA;IAE5C,OAAO,CAAC,0BAA0B,CAAC;QACjC,WAAW,EAAE,IAAI,0BAA0B,EAAE;QAC7C,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,KAAK;KAC3C,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,EACd,OAAO,EACP,kBAAkB,CACnB,CAAA;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CACT,uDAAuD,aAAa,mBAAmB,CACxF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -78,5 +78,17 @@ export type WacConfig = {
|
|
|
78
78
|
* Allows workflows to be written to different directories based on filename patterns.
|
|
79
79
|
*/
|
|
80
80
|
outputPaths?: OutputPathsConfig;
|
|
81
|
+
/**
|
|
82
|
+
* Root directory for resolving output paths.
|
|
83
|
+
* If not specified, automatically detected by finding the nearest .git directory
|
|
84
|
+
* or package.json with workspaces.
|
|
85
|
+
*
|
|
86
|
+
* This is useful when running gwf from a subdirectory (e.g., scripts/) but
|
|
87
|
+
* wanting output paths to be relative to the project root.
|
|
88
|
+
*
|
|
89
|
+
* @example "../../" - Go up two directories from cwd
|
|
90
|
+
* @example "/absolute/path/to/project" - Use an absolute path
|
|
91
|
+
*/
|
|
92
|
+
rootDir?: string;
|
|
81
93
|
};
|
|
82
94
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/types/build.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;AAEzD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B,kBAAkB,GAClB;IACE,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB,CAAA;AAEL;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;CAC7C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB;;;WAGG;QACH,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAA;KACjC,CAAA;CACF,CAAA;AAED,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;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,iB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EAAE,MAAM,CAAA;CACjB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github-actions-workflow-ts/cli",
|
|
3
|
-
"version": "2.4.0-beta.
|
|
3
|
+
"version": "2.4.0-beta.2",
|
|
4
4
|
"description": "CLI to generate GitHub Actions YAML from TypeScript workflow files",
|
|
5
5
|
"author": "Emmanuel N Kyeyune",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"micromatch": "^4.0.8",
|
|
36
36
|
"tsx": "^4.19.3",
|
|
37
37
|
"yargs": "^17.7.2",
|
|
38
|
-
"@github-actions-workflow-ts/lib": "2.4.0-beta.
|
|
38
|
+
"@github-actions-workflow-ts/lib": "2.4.0-beta.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@jest/globals": "^29.7.0",
|