zephyr-cli 0.0.3 → 0.1.3-next.7
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/.eslintignore +3 -0
- package/.eslintrc.json +22 -0
- package/LICENSE +40 -21
- package/README.md +90 -17
- package/dist/cli.d.ts +25 -0
- package/dist/cli.js +141 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/deploy.d.ts +12 -0
- package/dist/commands/deploy.js +60 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/run.d.ts +9 -0
- package/dist/commands/run.js +161 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/index.js +48 -60
- package/dist/index.js.map +1 -0
- package/dist/lib/build-stats.d.ts +7 -0
- package/dist/lib/build-stats.js +12 -0
- package/dist/lib/build-stats.js.map +1 -0
- package/dist/lib/command-detector.d.ts +38 -0
- package/dist/lib/command-detector.js +453 -0
- package/dist/lib/command-detector.js.map +1 -0
- package/dist/lib/config-readers.d.ts +37 -0
- package/dist/lib/config-readers.js +239 -0
- package/dist/lib/config-readers.js.map +1 -0
- package/dist/lib/extract-assets.d.ts +6 -0
- package/dist/lib/extract-assets.js +95 -0
- package/dist/lib/extract-assets.js.map +1 -0
- package/dist/lib/shell-parser.d.ts +40 -0
- package/dist/lib/shell-parser.js +190 -0
- package/dist/lib/shell-parser.js.map +1 -0
- package/dist/lib/spawn-helper.d.ts +14 -0
- package/dist/lib/spawn-helper.js +36 -0
- package/dist/lib/spawn-helper.js.map +1 -0
- package/dist/lib/upload.d.ts +14 -0
- package/dist/lib/upload.js +32 -0
- package/dist/lib/upload.js.map +1 -0
- package/dist/package.json +48 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/jest.config.ts +10 -0
- package/package.json +38 -21
- package/project.json +34 -0
- package/src/cli.ts +150 -0
- package/src/commands/deploy.ts +74 -0
- package/src/commands/run.ts +196 -0
- package/src/index.ts +58 -0
- package/src/lib/build-stats.ts +13 -0
- package/src/lib/command-detector.ts +600 -0
- package/src/lib/config-readers.ts +269 -0
- package/src/lib/extract-assets.ts +111 -0
- package/src/lib/shell-parser.ts +229 -0
- package/src/lib/spawn-helper.ts +49 -0
- package/src/lib/upload.ts +39 -0
- package/tsconfig.json +22 -0
- package/tsconfig.lib.json +10 -0
- package/tsconfig.spec.json +14 -0
package/dist/index.js
CHANGED
|
@@ -1,68 +1,56 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
-
};
|
|
29
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
function main() {
|
|
36
|
-
const args = process.argv.slice(2);
|
|
37
|
-
if (args.length >= 2 && args[0] === 'clean' && args[1] === 'cache') {
|
|
38
|
-
cleanCache();
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
printUsage();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function cleanCache() {
|
|
45
|
-
const homeDir = os.homedir();
|
|
46
|
-
const cacheDir = (0, path_1.join)(homeDir, '.zephyr');
|
|
47
|
-
console.log(chalk_1.default.blue('🧹 Cleaning Zephyr cache...'));
|
|
48
|
-
if (!(0, fs_1.existsSync)(cacheDir)) {
|
|
49
|
-
console.log(chalk_1.default.yellow("Cache directory doesn't exist. Nothing to clean."));
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
|
+
const zephyr_agent_1 = require("zephyr-agent");
|
|
6
|
+
const cli_1 = require("./cli");
|
|
7
|
+
const deploy_1 = require("./commands/deploy");
|
|
8
|
+
const run_1 = require("./commands/run");
|
|
9
|
+
async function main() {
|
|
52
10
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
11
|
+
// Parse command line arguments
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const options = (0, cli_1.parseArgs)(args);
|
|
14
|
+
// Get current working directory
|
|
15
|
+
const workingDir = (0, node_process_1.cwd)();
|
|
16
|
+
// Dispatch to the appropriate command
|
|
17
|
+
if (options.command === 'deploy') {
|
|
18
|
+
if (!options.directory) {
|
|
19
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
20
|
+
message: 'Directory is required for deploy command',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
await (0, deploy_1.deployCommand)({
|
|
24
|
+
directory: options.directory,
|
|
25
|
+
target: options.target,
|
|
26
|
+
verbose: options.verbose,
|
|
27
|
+
ssr: options.ssr,
|
|
28
|
+
cwd: workingDir,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else if (options.command === 'run') {
|
|
32
|
+
if (!options.commandLine) {
|
|
33
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
34
|
+
message: 'Command line is required for run command',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
await (0, run_1.runCommand)({
|
|
38
|
+
commandLine: options.commandLine,
|
|
39
|
+
target: options.target,
|
|
40
|
+
verbose: options.verbose,
|
|
41
|
+
ssr: options.ssr,
|
|
42
|
+
cwd: workingDir,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
58
45
|
}
|
|
59
46
|
catch (error) {
|
|
60
|
-
console.error(
|
|
47
|
+
console.error('[ze-cli] Error:', zephyr_agent_1.ZephyrError.format(error));
|
|
48
|
+
process.exit(1);
|
|
61
49
|
}
|
|
62
50
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
console.
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
51
|
+
// Run the CLI
|
|
52
|
+
main().catch((error) => {
|
|
53
|
+
console.error('[ze-cli] Fatal error:', zephyr_agent_1.ZephyrError.format(error));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,+CAAmC;AACnC,+CAAqD;AACrD,+BAAkC;AAClC,8CAAkD;AAClD,wCAA4C;AAE5C,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,+BAA+B;QAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,OAA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,CAAC;AAED,cAAc;AACd,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,0BAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ZephyrBuildStats } from 'zephyr-edge-contract';
|
|
2
|
+
import type { ZephyrEngine } from 'zephyr-agent';
|
|
3
|
+
/**
|
|
4
|
+
* Generate build stats from ZephyrEngine. This is a simple wrapper around zeBuildDashData
|
|
5
|
+
* for consistency.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getBuildStats(zephyr_engine: ZephyrEngine): Promise<ZephyrBuildStats>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBuildStats = getBuildStats;
|
|
4
|
+
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
+
/**
|
|
6
|
+
* Generate build stats from ZephyrEngine. This is a simple wrapper around zeBuildDashData
|
|
7
|
+
* for consistency.
|
|
8
|
+
*/
|
|
9
|
+
async function getBuildStats(zephyr_engine) {
|
|
10
|
+
return await (0, zephyr_agent_1.zeBuildDashData)(zephyr_engine);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=build-stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-stats.js","sourceRoot":"","sources":["../../src/lib/build-stats.ts"],"names":[],"mappings":";;AAQA,sCAIC;AAVD,+CAA+C;AAE/C;;;GAGG;AACI,KAAK,UAAU,aAAa,CACjC,aAA2B;IAE3B,OAAO,MAAM,IAAA,8BAAe,EAAC,aAAa,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ParsedCommand } from './shell-parser';
|
|
2
|
+
export interface DetectedCommand {
|
|
3
|
+
/** The build tool detected (e.g., 'tsc', 'webpack', 'npm') */
|
|
4
|
+
tool: string;
|
|
5
|
+
/** The configuration file path, if detected */
|
|
6
|
+
configFile: string | null;
|
|
7
|
+
/** Whether the config file is JavaScript (dynamic config) */
|
|
8
|
+
isDynamicConfig: boolean;
|
|
9
|
+
/** The inferred output directory, if detectable */
|
|
10
|
+
outputDir: string | null;
|
|
11
|
+
/** Warnings to display to the user */
|
|
12
|
+
warnings: string[];
|
|
13
|
+
/**
|
|
14
|
+
* Sub-commands detected when a command expands to multiple commands (e.g., npm script
|
|
15
|
+
* with &&)
|
|
16
|
+
*/
|
|
17
|
+
subCommands?: DetectedCommand[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Find the common ancestor directory of multiple paths, bounded by the project root.
|
|
21
|
+
*
|
|
22
|
+
* @param paths - Array of absolute paths
|
|
23
|
+
* @param projectRoot - The project root directory (boundary)
|
|
24
|
+
* @returns The common ancestor path, or null if paths are empty or no common ancestor
|
|
25
|
+
* within project root
|
|
26
|
+
*/
|
|
27
|
+
export declare function findCommonAncestor(paths: string[], projectRoot: string): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Detect multiple commands from a command line that may contain shell operators (;, &&).
|
|
30
|
+
* Returns output directories from all detected commands.
|
|
31
|
+
*/
|
|
32
|
+
export declare function detectMultipleCommands(commandLine: string, cwd: string): Promise<{
|
|
33
|
+
commands: DetectedCommand[];
|
|
34
|
+
outputDirs: string[];
|
|
35
|
+
commonOutputDir: string | null;
|
|
36
|
+
}>;
|
|
37
|
+
/** Detect the build tool and its configuration from a parsed command */
|
|
38
|
+
export declare function detectCommand(parsed: ParsedCommand, cwd: string, depth?: number): Promise<DetectedCommand>;
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findCommonAncestor = findCommonAncestor;
|
|
4
|
+
exports.detectMultipleCommands = detectMultipleCommands;
|
|
5
|
+
exports.detectCommand = detectCommand;
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const config_readers_1 = require("./config-readers");
|
|
9
|
+
const shell_parser_1 = require("./shell-parser");
|
|
10
|
+
/**
|
|
11
|
+
* Find the value of a command-line argument, supporting both formats:
|
|
12
|
+
*
|
|
13
|
+
* - `--flag value` (space-separated)
|
|
14
|
+
* - `--flag=value` (equals-separated)
|
|
15
|
+
* - `-f value` (short flag with space)
|
|
16
|
+
* - `-f=value` (short flag with equals)
|
|
17
|
+
*/
|
|
18
|
+
function findArgValue(args, ...flags) {
|
|
19
|
+
for (const flag of flags) {
|
|
20
|
+
// Look for space-separated format: --flag value
|
|
21
|
+
const index = args.indexOf(flag);
|
|
22
|
+
if (index !== -1 && index + 1 < args.length) {
|
|
23
|
+
return args[index + 1];
|
|
24
|
+
}
|
|
25
|
+
// Look for equals format: --flag=value
|
|
26
|
+
const prefix = `${flag}=`;
|
|
27
|
+
for (const arg of args) {
|
|
28
|
+
if (arg.startsWith(prefix)) {
|
|
29
|
+
return arg.substring(prefix.length);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Find the common ancestor directory of multiple paths, bounded by the project root.
|
|
37
|
+
*
|
|
38
|
+
* @param paths - Array of absolute paths
|
|
39
|
+
* @param projectRoot - The project root directory (boundary)
|
|
40
|
+
* @returns The common ancestor path, or null if paths are empty or no common ancestor
|
|
41
|
+
* within project root
|
|
42
|
+
*/
|
|
43
|
+
function findCommonAncestor(paths, projectRoot) {
|
|
44
|
+
if (paths.length === 0) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (paths.length === 1) {
|
|
48
|
+
return paths[0];
|
|
49
|
+
}
|
|
50
|
+
// Normalize all paths to absolute
|
|
51
|
+
const normalizedPaths = paths.map((p) => (0, node_path_1.resolve)(p));
|
|
52
|
+
const normalizedRoot = (0, node_path_1.resolve)(projectRoot);
|
|
53
|
+
// Split each path into segments
|
|
54
|
+
const pathSegments = normalizedPaths.map((p) => p.split(node_path_1.sep));
|
|
55
|
+
const rootSegments = normalizedRoot.split(node_path_1.sep);
|
|
56
|
+
// Find the common prefix across all paths
|
|
57
|
+
const commonSegments = [];
|
|
58
|
+
const minLength = Math.min(...pathSegments.map((p) => p.length));
|
|
59
|
+
for (let i = 0; i < minLength; i++) {
|
|
60
|
+
const segment = pathSegments[0][i];
|
|
61
|
+
// Check if all paths have the same segment at this position
|
|
62
|
+
if (pathSegments.every((p) => p[i] === segment)) {
|
|
63
|
+
commonSegments.push(segment);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Ensure the common ancestor is within or equal to the project root
|
|
70
|
+
const commonPath = commonSegments.join(node_path_1.sep) || node_path_1.sep;
|
|
71
|
+
// Check if common path is within project root
|
|
72
|
+
const relativeToRoot = (0, node_path_1.relative)(normalizedRoot, commonPath);
|
|
73
|
+
// If relative path starts with '..' or is absolute, it's outside project root
|
|
74
|
+
if (relativeToRoot.startsWith('..') || (0, node_path_1.resolve)(commonPath) !== commonPath) {
|
|
75
|
+
return normalizedRoot;
|
|
76
|
+
}
|
|
77
|
+
// If common path is shallower than project root, use project root
|
|
78
|
+
if (commonSegments.length < rootSegments.length) {
|
|
79
|
+
return normalizedRoot;
|
|
80
|
+
}
|
|
81
|
+
return commonPath;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Detect multiple commands from a command line that may contain shell operators (;, &&).
|
|
85
|
+
* Returns output directories from all detected commands.
|
|
86
|
+
*/
|
|
87
|
+
async function detectMultipleCommands(commandLine, cwd) {
|
|
88
|
+
const individualCommands = (0, shell_parser_1.splitCommands)(commandLine);
|
|
89
|
+
const detectedCommands = [];
|
|
90
|
+
const outputDirs = [];
|
|
91
|
+
for (const cmd of individualCommands) {
|
|
92
|
+
try {
|
|
93
|
+
const parsed = (0, shell_parser_1.parseShellCommand)(cmd);
|
|
94
|
+
const detected = await detectCommand(parsed, cwd);
|
|
95
|
+
detectedCommands.push(detected);
|
|
96
|
+
if (detected.outputDir) {
|
|
97
|
+
const absoluteOutputDir = (0, node_path_1.resolve)(cwd, detected.outputDir);
|
|
98
|
+
outputDirs.push(absoluteOutputDir);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (_a) {
|
|
102
|
+
// Skip commands that fail to parse
|
|
103
|
+
console.error(`[ze-cli] Warning: Failed to parse command: ${cmd}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Find common ancestor of all output directories
|
|
107
|
+
const commonOutputDir = outputDirs.length > 0 ? findCommonAncestor(outputDirs, cwd) : null;
|
|
108
|
+
return {
|
|
109
|
+
commands: detectedCommands,
|
|
110
|
+
outputDirs,
|
|
111
|
+
commonOutputDir,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** Detect the build tool and its configuration from a parsed command */
|
|
115
|
+
async function detectCommand(parsed, cwd, depth = 0) {
|
|
116
|
+
const { command, args } = parsed;
|
|
117
|
+
const warnings = [];
|
|
118
|
+
// Prevent infinite recursion
|
|
119
|
+
if (depth > 3) {
|
|
120
|
+
warnings.push('Max recursion depth reached while parsing scripts');
|
|
121
|
+
return {
|
|
122
|
+
tool: command,
|
|
123
|
+
configFile: null,
|
|
124
|
+
isDynamicConfig: false,
|
|
125
|
+
outputDir: null,
|
|
126
|
+
warnings,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
// Detect npm/yarn/pnpm commands
|
|
130
|
+
if (['npm', 'yarn', 'pnpm'].includes(command)) {
|
|
131
|
+
return await detectPackageManagerCommand(command, args, cwd, warnings, depth);
|
|
132
|
+
}
|
|
133
|
+
// Detect tsc (TypeScript compiler)
|
|
134
|
+
if (command === 'tsc') {
|
|
135
|
+
return detectTscCommand(args, cwd, warnings);
|
|
136
|
+
}
|
|
137
|
+
// Detect webpack
|
|
138
|
+
if (command === 'webpack' || command === 'webpack-cli') {
|
|
139
|
+
return await detectWebpackCommand(cwd, warnings);
|
|
140
|
+
}
|
|
141
|
+
// Detect rollup
|
|
142
|
+
if (command === 'rollup') {
|
|
143
|
+
return await detectRollupCommand(cwd, warnings);
|
|
144
|
+
}
|
|
145
|
+
// Detect esbuild
|
|
146
|
+
if (command === 'esbuild') {
|
|
147
|
+
return detectEsbuildCommand(args, warnings);
|
|
148
|
+
}
|
|
149
|
+
// Detect vite
|
|
150
|
+
if (command === 'vite') {
|
|
151
|
+
return await detectViteCommand(cwd, warnings);
|
|
152
|
+
}
|
|
153
|
+
// Detect swc
|
|
154
|
+
if (command === 'swc') {
|
|
155
|
+
return await detectSwcCommand(cwd, warnings);
|
|
156
|
+
}
|
|
157
|
+
// Unknown command
|
|
158
|
+
return {
|
|
159
|
+
tool: command,
|
|
160
|
+
configFile: null,
|
|
161
|
+
isDynamicConfig: false,
|
|
162
|
+
outputDir: null,
|
|
163
|
+
warnings: [
|
|
164
|
+
`Unknown build tool: ${command}`,
|
|
165
|
+
'Output directory detection may not work correctly.',
|
|
166
|
+
],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
async function detectPackageManagerCommand(command, args, cwd, warnings, depth) {
|
|
170
|
+
var _a;
|
|
171
|
+
const packageJson = (0, config_readers_1.readPackageJson)(cwd);
|
|
172
|
+
if (!packageJson) {
|
|
173
|
+
warnings.push('package.json not found');
|
|
174
|
+
return {
|
|
175
|
+
tool: command,
|
|
176
|
+
configFile: null,
|
|
177
|
+
isDynamicConfig: false,
|
|
178
|
+
outputDir: null,
|
|
179
|
+
warnings,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// Find the script name
|
|
183
|
+
let scriptName = null;
|
|
184
|
+
if (command === 'npm' && args[0] === 'run' && args[1]) {
|
|
185
|
+
scriptName = args[1];
|
|
186
|
+
}
|
|
187
|
+
else if ((command === 'yarn' || command === 'pnpm') && args[0]) {
|
|
188
|
+
scriptName = args[0];
|
|
189
|
+
}
|
|
190
|
+
if (!scriptName || !((_a = packageJson.scripts) === null || _a === void 0 ? void 0 : _a[scriptName])) {
|
|
191
|
+
warnings.push(`Script "${scriptName || 'unknown'}" not found in package.json`);
|
|
192
|
+
return {
|
|
193
|
+
tool: command,
|
|
194
|
+
configFile: (0, node_path_1.join)(cwd, 'package.json'),
|
|
195
|
+
isDynamicConfig: false,
|
|
196
|
+
outputDir: null,
|
|
197
|
+
warnings,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const script = packageJson.scripts[scriptName];
|
|
201
|
+
// Parse the script command - check if there are multiple commands with shell operators
|
|
202
|
+
try {
|
|
203
|
+
const individualCommands = (0, shell_parser_1.splitCommands)(script);
|
|
204
|
+
// If there are multiple commands in the script, detect each one
|
|
205
|
+
if (individualCommands.length > 1) {
|
|
206
|
+
const detectedCommands = [];
|
|
207
|
+
const allWarnings = [...warnings];
|
|
208
|
+
const outputDirs = [];
|
|
209
|
+
for (const cmd of individualCommands) {
|
|
210
|
+
try {
|
|
211
|
+
const parsedScript = (0, shell_parser_1.parseShellCommand)(cmd);
|
|
212
|
+
const detected = await detectCommand(parsedScript, cwd, depth + 1);
|
|
213
|
+
detectedCommands.push(detected);
|
|
214
|
+
if (detected.outputDir) {
|
|
215
|
+
outputDirs.push((0, node_path_1.resolve)(cwd, detected.outputDir));
|
|
216
|
+
}
|
|
217
|
+
allWarnings.push(...detected.warnings);
|
|
218
|
+
}
|
|
219
|
+
catch (_b) {
|
|
220
|
+
// Skip commands that fail to parse
|
|
221
|
+
allWarnings.push(`Failed to parse sub-command: ${cmd}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Find the last command that produces output
|
|
225
|
+
let primaryDetected = detectedCommands.find((d) => d.outputDir) ||
|
|
226
|
+
detectedCommands[detectedCommands.length - 1];
|
|
227
|
+
// If multiple output directories, use common ancestor
|
|
228
|
+
if (outputDirs.length > 1) {
|
|
229
|
+
const commonOutputDir = findCommonAncestor(outputDirs, cwd);
|
|
230
|
+
if (commonOutputDir) {
|
|
231
|
+
primaryDetected = Object.assign(Object.assign({}, primaryDetected), { outputDir: (0, node_path_1.relative)(cwd, commonOutputDir) || '.' });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
else if (outputDirs.length === 1) {
|
|
235
|
+
primaryDetected = Object.assign(Object.assign({}, primaryDetected), { outputDir: (0, node_path_1.relative)(cwd, outputDirs[0]) || '.' });
|
|
236
|
+
}
|
|
237
|
+
// Preserve the package.json reference
|
|
238
|
+
if (!primaryDetected.configFile) {
|
|
239
|
+
primaryDetected.configFile = (0, node_path_1.join)(cwd, 'package.json');
|
|
240
|
+
}
|
|
241
|
+
primaryDetected.warnings = allWarnings;
|
|
242
|
+
// Store sub-commands for logging purposes
|
|
243
|
+
primaryDetected.subCommands = detectedCommands;
|
|
244
|
+
return primaryDetected;
|
|
245
|
+
}
|
|
246
|
+
// Single command - parse normally
|
|
247
|
+
const parsedScript = (0, shell_parser_1.parseShellCommand)(script);
|
|
248
|
+
// Recursively detect the actual build tool
|
|
249
|
+
const detected = await detectCommand(parsedScript, cwd, depth + 1);
|
|
250
|
+
// Preserve the package.json reference
|
|
251
|
+
if (!detected.configFile) {
|
|
252
|
+
detected.configFile = (0, node_path_1.join)(cwd, 'package.json');
|
|
253
|
+
}
|
|
254
|
+
return detected;
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
warnings.push(`Failed to parse package.json script "${scriptName}": ${script}`);
|
|
258
|
+
warnings.push(`Parse error: ${error.message}`);
|
|
259
|
+
return {
|
|
260
|
+
tool: command,
|
|
261
|
+
configFile: (0, node_path_1.join)(cwd, 'package.json'),
|
|
262
|
+
isDynamicConfig: false,
|
|
263
|
+
outputDir: null,
|
|
264
|
+
warnings,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function detectTscCommand(args, cwd, warnings) {
|
|
269
|
+
var _a;
|
|
270
|
+
// Look for -p or --project flag
|
|
271
|
+
const configPath = findArgValue(args, '-p', '--project') || 'tsconfig.json';
|
|
272
|
+
const fullConfigPath = (0, node_path_1.join)(cwd, configPath);
|
|
273
|
+
const configExists = (0, node_fs_1.existsSync)(fullConfigPath);
|
|
274
|
+
if (!configExists) {
|
|
275
|
+
warnings.push(`TypeScript config not found: ${configPath}`);
|
|
276
|
+
return {
|
|
277
|
+
tool: 'tsc',
|
|
278
|
+
configFile: null,
|
|
279
|
+
isDynamicConfig: false,
|
|
280
|
+
outputDir: null,
|
|
281
|
+
warnings,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
// Try to read outDir from tsconfig
|
|
285
|
+
const tsConfig = (0, config_readers_1.readTsConfig)(cwd, configPath);
|
|
286
|
+
const outDir = ((_a = tsConfig === null || tsConfig === void 0 ? void 0 : tsConfig.compilerOptions) === null || _a === void 0 ? void 0 : _a.outDir) || null;
|
|
287
|
+
return {
|
|
288
|
+
tool: 'tsc',
|
|
289
|
+
configFile: fullConfigPath,
|
|
290
|
+
isDynamicConfig: false,
|
|
291
|
+
outputDir: outDir,
|
|
292
|
+
warnings,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
async function detectWebpackCommand(cwd, warnings) {
|
|
296
|
+
const configFile = (0, config_readers_1.configFileExists)(cwd, 'webpack.config');
|
|
297
|
+
const isDynamicConfig = (0, config_readers_1.isJavaScriptConfig)(cwd, 'webpack.config');
|
|
298
|
+
// Try to load the config using cosmiconfig if it's a JS config
|
|
299
|
+
if (isDynamicConfig) {
|
|
300
|
+
try {
|
|
301
|
+
const loadedConfig = await (0, config_readers_1.loadWebpackConfig)(cwd);
|
|
302
|
+
if (loadedConfig && loadedConfig.outputDir) {
|
|
303
|
+
// Successfully loaded and extracted output directory
|
|
304
|
+
return {
|
|
305
|
+
tool: 'webpack',
|
|
306
|
+
configFile: loadedConfig.filepath,
|
|
307
|
+
isDynamicConfig: true,
|
|
308
|
+
outputDir: loadedConfig.outputDir,
|
|
309
|
+
warnings,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
// Config loaded but couldn't extract output directory
|
|
313
|
+
warnings.push('Webpack configuration loaded but output directory could not be determined.', 'Consider using @zephyrcloud/webpack-plugin or ze-cli deploy after building.');
|
|
314
|
+
}
|
|
315
|
+
catch (_a) {
|
|
316
|
+
warnings.push('Failed to load Webpack configuration.', 'Consider using @zephyrcloud/webpack-plugin or ze-cli deploy after building.');
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
tool: 'webpack',
|
|
321
|
+
configFile,
|
|
322
|
+
isDynamicConfig,
|
|
323
|
+
outputDir: isDynamicConfig ? null : 'dist',
|
|
324
|
+
warnings,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
async function detectRollupCommand(cwd, warnings) {
|
|
328
|
+
const configFile = (0, config_readers_1.configFileExists)(cwd, 'rollup.config');
|
|
329
|
+
const isDynamicConfig = (0, config_readers_1.isJavaScriptConfig)(cwd, 'rollup.config');
|
|
330
|
+
// Try to load the config using cosmiconfig if it's a JS config
|
|
331
|
+
if (isDynamicConfig) {
|
|
332
|
+
try {
|
|
333
|
+
const loadedConfig = await (0, config_readers_1.loadRollupConfig)(cwd);
|
|
334
|
+
if (loadedConfig && loadedConfig.outputDir) {
|
|
335
|
+
// Successfully loaded and extracted output directory
|
|
336
|
+
return {
|
|
337
|
+
tool: 'rollup',
|
|
338
|
+
configFile: loadedConfig.filepath,
|
|
339
|
+
isDynamicConfig: true,
|
|
340
|
+
outputDir: loadedConfig.outputDir,
|
|
341
|
+
warnings,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
// Config loaded but couldn't extract output directory
|
|
345
|
+
warnings.push('Rollup configuration loaded but output directory could not be determined.', 'Consider using @zephyrcloud/rollup-plugin or ze-cli deploy after building.');
|
|
346
|
+
}
|
|
347
|
+
catch (_a) {
|
|
348
|
+
warnings.push('Failed to load Rollup configuration.', 'Consider using @zephyrcloud/rollup-plugin or ze-cli deploy after building.');
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return {
|
|
352
|
+
tool: 'rollup',
|
|
353
|
+
configFile,
|
|
354
|
+
isDynamicConfig,
|
|
355
|
+
outputDir: isDynamicConfig ? null : 'dist',
|
|
356
|
+
warnings,
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function detectEsbuildCommand(args, warnings) {
|
|
360
|
+
// Look for --outdir or --outfile in args
|
|
361
|
+
let outputDir = null;
|
|
362
|
+
const outdir = findArgValue(args, '--outdir');
|
|
363
|
+
const outfile = findArgValue(args, '--outfile');
|
|
364
|
+
if (outdir) {
|
|
365
|
+
outputDir = outdir;
|
|
366
|
+
}
|
|
367
|
+
else if (outfile) {
|
|
368
|
+
// Extract directory from outfile
|
|
369
|
+
const lastSlash = Math.max(outfile.lastIndexOf('/'), outfile.lastIndexOf('\\'));
|
|
370
|
+
outputDir = lastSlash !== -1 ? outfile.substring(0, lastSlash) : '.';
|
|
371
|
+
}
|
|
372
|
+
if (!outputDir) {
|
|
373
|
+
warnings.push('Could not detect esbuild output directory from arguments');
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
tool: 'esbuild',
|
|
377
|
+
configFile: null,
|
|
378
|
+
isDynamicConfig: false,
|
|
379
|
+
outputDir,
|
|
380
|
+
warnings,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
async function detectViteCommand(cwd, warnings) {
|
|
384
|
+
const configFile = (0, config_readers_1.configFileExists)(cwd, 'vite.config');
|
|
385
|
+
const isDynamicConfig = (0, config_readers_1.isJavaScriptConfig)(cwd, 'vite.config');
|
|
386
|
+
// Try to load the config using cosmiconfig if it's a JS config
|
|
387
|
+
if (isDynamicConfig) {
|
|
388
|
+
try {
|
|
389
|
+
const loadedConfig = await (0, config_readers_1.loadViteConfig)(cwd);
|
|
390
|
+
if (loadedConfig && loadedConfig.outputDir) {
|
|
391
|
+
// Successfully loaded and extracted output directory
|
|
392
|
+
return {
|
|
393
|
+
tool: 'vite',
|
|
394
|
+
configFile: loadedConfig.filepath,
|
|
395
|
+
isDynamicConfig: true,
|
|
396
|
+
outputDir: loadedConfig.outputDir,
|
|
397
|
+
warnings,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
// Config loaded but couldn't extract output directory (fallback to default)
|
|
401
|
+
if (loadedConfig) {
|
|
402
|
+
return {
|
|
403
|
+
tool: 'vite',
|
|
404
|
+
configFile: loadedConfig.filepath,
|
|
405
|
+
isDynamicConfig: true,
|
|
406
|
+
outputDir: 'dist', // Vite default
|
|
407
|
+
warnings,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
warnings.push('Failed to load Vite configuration.', 'Consider using @zephyrcloud/vite-plugin or ze-cli deploy after building.');
|
|
411
|
+
}
|
|
412
|
+
catch (_a) {
|
|
413
|
+
warnings.push('Failed to load Vite configuration.', 'Consider using @zephyrcloud/vite-plugin or ze-cli deploy after building.');
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return {
|
|
417
|
+
tool: 'vite',
|
|
418
|
+
configFile,
|
|
419
|
+
isDynamicConfig,
|
|
420
|
+
outputDir: isDynamicConfig ? null : 'dist',
|
|
421
|
+
warnings,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
async function detectSwcCommand(cwd, warnings) {
|
|
425
|
+
const configFile = (0, config_readers_1.configFileExists)(cwd, '.swcrc');
|
|
426
|
+
const isDynamicConfig = (0, config_readers_1.isJavaScriptConfig)(cwd, '.swcrc');
|
|
427
|
+
// Try to load the config using cosmiconfig if it's a JS config
|
|
428
|
+
if (isDynamicConfig) {
|
|
429
|
+
try {
|
|
430
|
+
const loadedConfig = await (0, config_readers_1.loadSwcConfig)(cwd);
|
|
431
|
+
if (loadedConfig) {
|
|
432
|
+
return {
|
|
433
|
+
tool: 'swc',
|
|
434
|
+
configFile: loadedConfig.filepath,
|
|
435
|
+
isDynamicConfig: true,
|
|
436
|
+
outputDir: 'dist', // SWC doesn't have standard output config
|
|
437
|
+
warnings,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
catch (_a) {
|
|
442
|
+
warnings.push('Failed to load SWC configuration.');
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
tool: 'swc',
|
|
447
|
+
configFile,
|
|
448
|
+
isDynamicConfig,
|
|
449
|
+
outputDir: 'dist', // Common default
|
|
450
|
+
warnings,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
//# sourceMappingURL=command-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-detector.js","sourceRoot":"","sources":["../../src/lib/command-detector.ts"],"names":[],"mappings":";;AAqEA,gDAiDC;AAMD,wDAqCC;AAGD,sCAkEC;AAtOD,qCAAqC;AACrC,yCAAyD;AACzD,qDAS0B;AAE1B,iDAAkE;AAoBlE;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,IAAc,EAAE,GAAG,KAAe;IACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,gDAAgD;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACzB,CAAC;QAED,uCAAuC;QACvC,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC;QAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,OAAO,GAAG,CAAC,SAAS,CAAC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