zephyr-cli 0.0.0-canary.49 → 0.0.0-canary.51
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/cli.d.ts +1 -2
- package/dist/cli.js +0 -13
- package/dist/cli.js.map +1 -1
- package/dist/commands/deploy.js.map +1 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/dist/lib/extract-assets.js +14 -34
- package/dist/lib/extract-assets.js.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +3 -3
- package/src/cli.ts +1 -16
- package/src/commands/deploy.ts +1 -0
- package/src/index.ts +0 -11
- package/src/lib/extract-assets.ts +21 -37
- package/dist/commands/deploy-status.d.ts +0 -4
- package/dist/commands/deploy-status.js +0 -12
- package/dist/commands/deploy-status.js.map +0 -1
- package/src/commands/deploy-status.ts +0 -15
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -87,16 +87,6 @@ function parseArgs(args) {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
else if (firstArg === 'deploy-status') {
|
|
91
|
-
options.command = 'deploy-status';
|
|
92
|
-
const buildId = args[commandStartIndex + 1];
|
|
93
|
-
if (!buildId) {
|
|
94
|
-
console.error('Error: deploy-status command requires a buildId argument');
|
|
95
|
-
console.error('Usage: ze-cli deploy-status <buildId>');
|
|
96
|
-
process.exit(1);
|
|
97
|
-
}
|
|
98
|
-
options.buildId = buildId;
|
|
99
|
-
}
|
|
100
90
|
else {
|
|
101
91
|
// It's a run command - everything from commandStartIndex onwards is the command
|
|
102
92
|
options.command = 'run';
|
|
@@ -108,7 +98,6 @@ function printHelp() {
|
|
|
108
98
|
console.log(`
|
|
109
99
|
Usage: ze-cli [options] <command> [args...]
|
|
110
100
|
ze-cli deploy <directory> [options]
|
|
111
|
-
ze-cli deploy-status <buildId>
|
|
112
101
|
|
|
113
102
|
Run a build command and automatically upload assets to Zephyr, or deploy
|
|
114
103
|
pre-built assets from a directory.
|
|
@@ -116,7 +105,6 @@ pre-built assets from a directory.
|
|
|
116
105
|
Commands:
|
|
117
106
|
<command> [args...] Run a build command and upload (default)
|
|
118
107
|
deploy <directory> Upload pre-built assets from a directory
|
|
119
|
-
deploy-status <buildId> Wait for terminal deployment status
|
|
120
108
|
|
|
121
109
|
Options:
|
|
122
110
|
--ssr Mark this snapshot as server-side rendered
|
|
@@ -136,7 +124,6 @@ Examples:
|
|
|
136
124
|
ze-cli deploy ./dist
|
|
137
125
|
ze-cli deploy ./dist --ssr
|
|
138
126
|
ze-cli deploy ./build --target ios
|
|
139
|
-
ze-cli deploy-status 1f0d4ec8-6d68-4a5f-8acb-2d86174b1e54
|
|
140
127
|
|
|
141
128
|
How it works:
|
|
142
129
|
- For run commands, ze-cli executes your build command and automatically
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAyBA,8BA+EC;AA/FD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,SAAS,CAAC,IAAc;IACtC,MAAM,OAAO,GAAe;QAC1B,OAAO,EAAE,KAAK,EAAE,mBAAmB;KACpC,CAAC;IAEF,yDAAyD;IACzD,IAAI,iBAAiB,GAAG,CAAC,CAAC,CAAC;IAC3B,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACrC,SAAS,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,CAAC,C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AAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCb,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;AAkBA,sCAuDC;AAzED,+CAAqD;AACrD,yCAAoC;AACpC,+CAA0E;AAC1E,0DAAmE;AACnE,0CAA6C;AAU7C;;;GAGG;AACI,KAAK,UAAU,aAAa,CAAC,OAAsB;IACxD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAEzD,6BAA6B;IAC7B,MAAM,aAAa,GAAG,IAAA,mBAAO,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE9C,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,IAAA,iBAAM,EAAC,aAAa,EAAE,oBAAS,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAAC,WAAM,CAAC;QACP,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,WAAW,EAAE;YAC1C,OAAO,EAAE,6BAA6B,aAAa,EAAE;SACtD,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,IAAA,oBAAK,EAAC,MAAM,EAAE,0BAA0B,aAAa,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,oDAAoD;IACpD,MAAM,aAAa,GAAG,MAAM,2BAAY,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IAEH,gCAAgC;IAChC,IAAI,MAAM,EAAE,CAAC;QACX,aAAa,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;IACpC,CAAC;IAED,4BAA4B;IAC5B,IAAI,GAAG,EAAE,CAAC;QACR,aAAa,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,oCAAoC;IACpC,IAAI,OAAO,EAAE,CAAC;QACZ,IAAA,oBAAK,EAAC,MAAM,EAAE,qCAAqC,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,IAAA,2CAA0B,EAAC,aAAa,CAAC,CAAC;IAElE,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;QACjD,IAAA,oBAAK,EAAC,MAAM,EAAE,SAAS,UAAU,mBAAmB,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;IAChB,MAAM,IAAA,qBAAY,EAAC;QACjB,aAAa;QACb,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,OAAO,EAAE,CAAC;QACZ,IAAA,oBAAK,EAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ const node_process_1 = require("node:process");
|
|
|
5
5
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
6
6
|
const cli_1 = require("./cli");
|
|
7
7
|
const deploy_1 = require("./commands/deploy");
|
|
8
|
-
const deploy_status_1 = require("./commands/deploy-status");
|
|
9
8
|
const run_1 = require("./commands/run");
|
|
10
9
|
async function main() {
|
|
11
10
|
try {
|
|
@@ -29,16 +28,6 @@ async function main() {
|
|
|
29
28
|
cwd: workingDir,
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
|
-
else if (options.command === 'deploy-status') {
|
|
33
|
-
if (!options.buildId) {
|
|
34
|
-
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
35
|
-
message: 'Build ID is required for deploy-status command',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
await (0, deploy_status_1.deployStatusCommand)({
|
|
39
|
-
buildId: options.buildId,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
31
|
else if (options.command === 'run') {
|
|
43
32
|
if (!options.commandLine) {
|
|
44
33
|
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,+CAAmC;AACnC,+CAAqD;AACrD,+BAAkC;AAClC,8CAAkD;AAClD,
|
|
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,OAAO,GAAG,IAAA,eAAS,EAAC,IAAI,CAAC,CAAC;QAEhC,gCAAgC;QAChC,MAAM,UAAU,GAAG,IAAA,kBAAG,GAAE,CAAC;QAEzB,sCAAsC;QACtC,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBACvB,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,WAAW,EAAE;oBAC1C,OAAO,EAAE,0CAA0C;iBACpD,CAAC,CAAC;YACL,CAAC;YAED,MAAM,IAAA,sBAAa,EAAC;gBAClB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,GAAG,EAAE,UAAU;aAChB,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;YACrC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBACzB,MAAM,IAAI,0BAAW,CAAC,uBAAQ,CAAC,WAAW,EAAE;oBAC1C,OAAO,EAAE,0CAA0C;iBACpD,CAAC,CAAC;YACL,CAAC;YAED,MAAM,IAAA,gBAAU,EAAC;gBACf,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,GAAG,EAAE,UAAU;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,0BAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,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"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractAssetsFromDirectory = extractAssetsFromDirectory;
|
|
4
|
-
const promises_1 = require("node:fs/promises");
|
|
5
4
|
const node_path_1 = require("node:path");
|
|
6
5
|
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
6
|
function extractBuffer(asset) {
|
|
@@ -20,42 +19,23 @@ function normalizePath(filePath) {
|
|
|
20
19
|
*/
|
|
21
20
|
async function extractAssetsFromDirectory(buildDir) {
|
|
22
21
|
const assets = {};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const fullPath = (0, node_path_1.join)(dirPath, entry.name);
|
|
30
|
-
if (entry.isDirectory()) {
|
|
31
|
-
await walkDir(fullPath);
|
|
32
|
-
}
|
|
33
|
-
else if (entry.isFile()) {
|
|
34
|
-
// Get relative path from build directory
|
|
35
|
-
const relativePath = normalizePath((0, node_path_1.relative)(buildDir, fullPath));
|
|
36
|
-
// Skip certain files that shouldn't be uploaded
|
|
37
|
-
if (shouldSkipFile(relativePath)) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const content = await (0, promises_1.readFile)(fullPath);
|
|
42
|
-
const fileType = getFileType(relativePath);
|
|
43
|
-
assets[relativePath] = {
|
|
44
|
-
content,
|
|
45
|
-
type: fileType,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
catch (readError) {
|
|
49
|
-
(0, zephyr_agent_1.logFn)('warn', `Failed to read file ${fullPath}: ${readError}`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
22
|
+
try {
|
|
23
|
+
const files = await (0, zephyr_agent_1.readDirRecursiveWithContents)(buildDir);
|
|
24
|
+
for (const file of files) {
|
|
25
|
+
const relativePath = normalizePath(file.relativePath);
|
|
26
|
+
if (shouldSkipFile(relativePath)) {
|
|
27
|
+
continue;
|
|
52
28
|
}
|
|
29
|
+
const fileType = getFileType(relativePath);
|
|
30
|
+
assets[relativePath] = {
|
|
31
|
+
content: file.content,
|
|
32
|
+
type: fileType,
|
|
33
|
+
};
|
|
53
34
|
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
(0, zephyr_agent_1.logFn)('warn', `Failed to walk directory ${dirPath}: ${error}`);
|
|
56
|
-
}
|
|
57
35
|
}
|
|
58
|
-
|
|
36
|
+
catch (error) {
|
|
37
|
+
(0, zephyr_agent_1.logFn)('warn', `Failed to read build directory ${buildDir}: ${error}`);
|
|
38
|
+
}
|
|
59
39
|
return (0, zephyr_agent_1.buildAssetsMap)(assets, extractBuffer, getAssetType);
|
|
60
40
|
}
|
|
61
41
|
function shouldSkipFile(filePath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-assets.js","sourceRoot":"","sources":["../../src/lib/extract-assets.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"extract-assets.js","sourceRoot":"","sources":["../../src/lib/extract-assets.ts"],"names":[],"mappings":";;AA8BA,gEA0BC;AAxDD,yCAAgC;AAChC,+CAKsB;AAOtB,SAAS,aAAa,CAAC,KAAqB;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC;AAED,SAAS,YAAY,CAAC,KAAqB;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,kFAAkF;AAClF,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,QAAQ,CAAC,KAAK,CAAC,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,0BAA0B,CAC9C,QAAgB;IAEhB,MAAM,MAAM,GAAmC,EAAE,CAAC;IAElD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,IAAA,2CAA4B,EAAC,QAAQ,CAAC,CAAC;QAE3D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAEtD,IAAI,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;gBACjC,SAAS;YACX,CAAC;YAED,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;Y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+B;QACpC,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,YAAY;KAClB,CAAC;IAEF,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,0BAA0B,CAAC;AAC1D,CAAC"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-cli",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.51",
|
|
4
4
|
"description": "CLI tool for running build commands and uploading assets to Zephyr",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zephyr",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"cosmiconfig": "^9.0.0",
|
|
30
30
|
"jsonc-parser": "^3.3.1",
|
|
31
31
|
"tslib": "^2.8.1",
|
|
32
|
-
"zephyr-agent": "0.0.0-canary.
|
|
32
|
+
"zephyr-agent": "0.0.0-canary.51"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "29.5.14",
|
|
36
|
-
"@types/node": "22.
|
|
36
|
+
"@types/node": "22.19.13",
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
38
38
|
"ts-jest": "^29.2.6"
|
|
39
39
|
},
|
package/src/cli.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export interface CliOptions {
|
|
2
|
-
command: 'run' | 'deploy'
|
|
2
|
+
command: 'run' | 'deploy';
|
|
3
3
|
commandLine?: string; // For 'run' command
|
|
4
4
|
directory?: string; // For 'deploy' command
|
|
5
|
-
buildId?: string; // For 'deploy-status' command
|
|
6
5
|
target?: 'web' | 'ios' | 'android';
|
|
7
6
|
verbose?: boolean;
|
|
8
7
|
ssr?: boolean;
|
|
@@ -96,17 +95,6 @@ export function parseArgs(args: string[]): CliOptions {
|
|
|
96
95
|
options.verbose = true;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
} else if (firstArg === 'deploy-status') {
|
|
100
|
-
options.command = 'deploy-status';
|
|
101
|
-
const buildId = args[commandStartIndex + 1];
|
|
102
|
-
|
|
103
|
-
if (!buildId) {
|
|
104
|
-
console.error('Error: deploy-status command requires a buildId argument');
|
|
105
|
-
console.error('Usage: ze-cli deploy-status <buildId>');
|
|
106
|
-
process.exit(1);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
options.buildId = buildId;
|
|
110
98
|
} else {
|
|
111
99
|
// It's a run command - everything from commandStartIndex onwards is the command
|
|
112
100
|
options.command = 'run';
|
|
@@ -120,7 +108,6 @@ function printHelp(): void {
|
|
|
120
108
|
console.log(`
|
|
121
109
|
Usage: ze-cli [options] <command> [args...]
|
|
122
110
|
ze-cli deploy <directory> [options]
|
|
123
|
-
ze-cli deploy-status <buildId>
|
|
124
111
|
|
|
125
112
|
Run a build command and automatically upload assets to Zephyr, or deploy
|
|
126
113
|
pre-built assets from a directory.
|
|
@@ -128,7 +115,6 @@ pre-built assets from a directory.
|
|
|
128
115
|
Commands:
|
|
129
116
|
<command> [args...] Run a build command and upload (default)
|
|
130
117
|
deploy <directory> Upload pre-built assets from a directory
|
|
131
|
-
deploy-status <buildId> Wait for terminal deployment status
|
|
132
118
|
|
|
133
119
|
Options:
|
|
134
120
|
--ssr Mark this snapshot as server-side rendered
|
|
@@ -148,7 +134,6 @@ Examples:
|
|
|
148
134
|
ze-cli deploy ./dist
|
|
149
135
|
ze-cli deploy ./dist --ssr
|
|
150
136
|
ze-cli deploy ./build --target ios
|
|
151
|
-
ze-cli deploy-status 1f0d4ec8-6d68-4a5f-8acb-2d86174b1e54
|
|
152
137
|
|
|
153
138
|
How it works:
|
|
154
139
|
- For run commands, ze-cli executes your build command and automatically
|
package/src/commands/deploy.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { cwd } from 'node:process';
|
|
|
4
4
|
import { ZeErrors, ZephyrError } from 'zephyr-agent';
|
|
5
5
|
import { parseArgs } from './cli';
|
|
6
6
|
import { deployCommand } from './commands/deploy';
|
|
7
|
-
import { deployStatusCommand } from './commands/deploy-status';
|
|
8
7
|
import { runCommand } from './commands/run';
|
|
9
8
|
|
|
10
9
|
async function main(): Promise<void> {
|
|
@@ -31,16 +30,6 @@ async function main(): Promise<void> {
|
|
|
31
30
|
ssr: options.ssr,
|
|
32
31
|
cwd: workingDir,
|
|
33
32
|
});
|
|
34
|
-
} else if (options.command === 'deploy-status') {
|
|
35
|
-
if (!options.buildId) {
|
|
36
|
-
throw new ZephyrError(ZeErrors.ERR_UNKNOWN, {
|
|
37
|
-
message: 'Build ID is required for deploy-status command',
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
await deployStatusCommand({
|
|
42
|
-
buildId: options.buildId,
|
|
43
|
-
});
|
|
44
33
|
} else if (options.command === 'run') {
|
|
45
34
|
if (!options.commandLine) {
|
|
46
35
|
throw new ZephyrError(ZeErrors.ERR_UNKNOWN, {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { sep } from 'node:path';
|
|
2
|
+
import {
|
|
3
|
+
buildAssetsMap,
|
|
4
|
+
logFn,
|
|
5
|
+
readDirRecursiveWithContents,
|
|
6
|
+
type ZeBuildAssetsMap,
|
|
7
|
+
} from 'zephyr-agent';
|
|
4
8
|
|
|
5
9
|
interface DirectoryAsset {
|
|
6
10
|
content: Buffer | string;
|
|
@@ -29,46 +33,26 @@ export async function extractAssetsFromDirectory(
|
|
|
29
33
|
): Promise<ZeBuildAssetsMap> {
|
|
30
34
|
const assets: Record<string, DirectoryAsset> = {};
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
async function walkDir(dirPath: string): Promise<void> {
|
|
35
|
-
try {
|
|
36
|
-
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
36
|
+
try {
|
|
37
|
+
const files = await readDirRecursiveWithContents(buildDir);
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
for (const file of files) {
|
|
40
|
+
const relativePath = normalizePath(file.relativePath);
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} else if (entry.isFile()) {
|
|
44
|
-
// Get relative path from build directory
|
|
45
|
-
const relativePath = normalizePath(relative(buildDir, fullPath));
|
|
46
|
-
|
|
47
|
-
// Skip certain files that shouldn't be uploaded
|
|
48
|
-
if (shouldSkipFile(relativePath)) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
const content = await readFile(fullPath);
|
|
54
|
-
const fileType = getFileType(relativePath);
|
|
55
|
-
|
|
56
|
-
assets[relativePath] = {
|
|
57
|
-
content,
|
|
58
|
-
type: fileType,
|
|
59
|
-
};
|
|
60
|
-
} catch (readError) {
|
|
61
|
-
logFn('warn', `Failed to read file ${fullPath}: ${readError}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
42
|
+
if (shouldSkipFile(relativePath)) {
|
|
43
|
+
continue;
|
|
64
44
|
}
|
|
65
|
-
|
|
66
|
-
|
|
45
|
+
|
|
46
|
+
const fileType = getFileType(relativePath);
|
|
47
|
+
assets[relativePath] = {
|
|
48
|
+
content: file.content,
|
|
49
|
+
type: fileType,
|
|
50
|
+
};
|
|
67
51
|
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
logFn('warn', `Failed to read build directory ${buildDir}: ${error}`);
|
|
68
54
|
}
|
|
69
55
|
|
|
70
|
-
await walkDir(buildDir);
|
|
71
|
-
|
|
72
56
|
return buildAssetsMap(assets, extractBuffer, getAssetType);
|
|
73
57
|
}
|
|
74
58
|
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deployStatusCommand = deployStatusCommand;
|
|
4
|
-
const zephyr_agent_1 = require("zephyr-agent");
|
|
5
|
-
async function deployStatusCommand(options) {
|
|
6
|
-
const { buildId } = options;
|
|
7
|
-
const payload = await (0, zephyr_agent_1.waitForDeploymentStatus)({
|
|
8
|
-
applicationVersionId: buildId,
|
|
9
|
-
});
|
|
10
|
-
(0, zephyr_agent_1.logFn)('info', `Deployment ${buildId} finished with status ${payload.status}`);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=deploy-status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-status.js","sourceRoot":"","sources":["../../src/commands/deploy-status.ts"],"names":[],"mappings":";;AAMA,kDAQC;AAdD,+CAA8D;AAMvD,KAAK,UAAU,mBAAmB,CAAC,OAA4B;IACpE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,MAAM,OAAO,GAAG,MAAM,IAAA,sCAAuB,EAAC;QAC5C,oBAAoB,EAAE,OAAO;KAC9B,CAAC,CAAC;IAEH,IAAA,oBAAK,EAAC,MAAM,EAAE,cAAc,OAAO,yBAAyB,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { logFn, waitForDeploymentStatus } from 'zephyr-agent';
|
|
2
|
-
|
|
3
|
-
export interface DeployStatusOptions {
|
|
4
|
-
buildId: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export async function deployStatusCommand(options: DeployStatusOptions): Promise<void> {
|
|
8
|
-
const { buildId } = options;
|
|
9
|
-
|
|
10
|
-
const payload = await waitForDeploymentStatus({
|
|
11
|
-
applicationVersionId: buildId,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
logFn('info', `Deployment ${buildId} finished with status ${payload.status}`);
|
|
15
|
-
}
|