zephyr-cli 0.0.2 → 0.1.3-next.6
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 +91 -18
- 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 +39 -22
- 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/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"sourceType": "module",
|
|
6
|
+
"ecmaVersion": 2020
|
|
7
|
+
},
|
|
8
|
+
"overrides": [
|
|
9
|
+
{
|
|
10
|
+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
11
|
+
"rules": {}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"files": ["*.ts", "*.tsx"],
|
|
15
|
+
"rules": {}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"files": ["*.js", "*.jsx"],
|
|
19
|
+
"rules": {}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
...
|
|
13
|
+
|
|
14
|
+
END OF TERMS AND CONDITIONS
|
|
15
|
+
|
|
16
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
17
|
+
|
|
18
|
+
To apply the Apache License to your work, attach the following
|
|
19
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
20
|
+
replaced with your own identifying information. (Don't include
|
|
21
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
22
|
+
comment syntax for the file format. We also recommend that a
|
|
23
|
+
file or class name and description of purpose be included on the
|
|
24
|
+
same line as the copyright notice for each file. The "copyright"
|
|
25
|
+
word should be left as is (without quotes).
|
|
26
|
+
|
|
27
|
+
Copyright [2023] [Zephyr Cloud]
|
|
28
|
+
|
|
29
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
30
|
+
you may not use this file except in compliance with the License.
|
|
31
|
+
You may obtain a copy of the License at
|
|
32
|
+
|
|
33
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
34
|
+
|
|
35
|
+
Unless required by applicable law or agreed to in writing, software
|
|
36
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
37
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
38
|
+
See the License for the specific language governing permissions and
|
|
39
|
+
limitations under the License.
|
|
40
|
+
|
package/README.md
CHANGED
|
@@ -1,40 +1,113 @@
|
|
|
1
|
-
#
|
|
1
|
+
# zephyr-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI tool for running build commands and automatically uploading assets to Zephyr.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
### Global Installation
|
|
8
|
-
|
|
9
7
|
```bash
|
|
10
|
-
npm install -
|
|
8
|
+
npm install zephyr-cli
|
|
9
|
+
# or
|
|
10
|
+
pnpm add zephyr-cli
|
|
11
|
+
# or
|
|
12
|
+
yarn add zephyr-cli
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Run Command (Default)
|
|
18
|
+
|
|
19
|
+
Run any build command and automatically upload the resulting assets:
|
|
14
20
|
|
|
15
21
|
```bash
|
|
16
|
-
|
|
22
|
+
ze-cli [options] <command>
|
|
17
23
|
```
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
#### Examples
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Run npm scripts
|
|
29
|
+
ze-cli pnpm build
|
|
30
|
+
ze-cli yarn build
|
|
31
|
+
ze-cli npm run build
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
# Run build tools directly
|
|
34
|
+
ze-cli tsc
|
|
35
|
+
ze-cli swc
|
|
36
|
+
ze-cli esbuild --bundle
|
|
22
37
|
|
|
23
|
-
|
|
38
|
+
# With environment variables
|
|
39
|
+
ze-cli NODE_ENV=production webpack
|
|
24
40
|
|
|
25
|
-
|
|
26
|
-
|
|
41
|
+
# Mark as SSR build
|
|
42
|
+
ze-cli --ssr pnpm build
|
|
27
43
|
```
|
|
28
44
|
|
|
29
|
-
|
|
45
|
+
### Deploy Command
|
|
46
|
+
|
|
47
|
+
Upload pre-built assets from a directory:
|
|
30
48
|
|
|
31
49
|
```bash
|
|
32
|
-
|
|
50
|
+
ze-cli deploy <directory> [options]
|
|
33
51
|
```
|
|
34
52
|
|
|
35
|
-
|
|
53
|
+
#### Examples
|
|
36
54
|
|
|
37
55
|
```bash
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
56
|
+
# Upload from ./dist directory
|
|
57
|
+
ze-cli deploy ./dist
|
|
58
|
+
|
|
59
|
+
# Upload with specific target
|
|
60
|
+
ze-cli deploy ./dist --target ios
|
|
61
|
+
|
|
62
|
+
# Mark as SSR
|
|
63
|
+
ze-cli deploy ./dist --ssr
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Options
|
|
67
|
+
|
|
68
|
+
- `--ssr` - Mark this snapshot as server-side rendered
|
|
69
|
+
- `--target, -t <target>` - Build target: `web`, `ios`, or `android` (default: `web`)
|
|
70
|
+
- `--verbose, -v` - Enable verbose output
|
|
71
|
+
- `--help, -h` - Show help message
|
|
72
|
+
|
|
73
|
+
## How It Works
|
|
74
|
+
|
|
75
|
+
### Run Command
|
|
76
|
+
|
|
77
|
+
1. **Parses the shell command** to detect the build tool and configuration files
|
|
78
|
+
2. **Detects configuration files** (e.g., `package.json`, `tsconfig.json`, etc.)
|
|
79
|
+
3. **Warns about dynamic configs** (e.g., JavaScript config files) and suggests alternatives
|
|
80
|
+
4. **Runs the command** with full stdio passthrough
|
|
81
|
+
5. **Infers the output directory** from the configuration
|
|
82
|
+
6. **Uploads assets** to Zephyr automatically
|
|
83
|
+
|
|
84
|
+
### Deploy Command
|
|
85
|
+
|
|
86
|
+
1. **Extracts assets** from the specified directory
|
|
87
|
+
2. **Uploads assets** to Zephyr's edge network
|
|
88
|
+
|
|
89
|
+
## Build Tool Detection
|
|
90
|
+
|
|
91
|
+
The CLI automatically detects configuration files for:
|
|
92
|
+
|
|
93
|
+
- **npm/yarn/pnpm**: Reads `package.json` for scripts
|
|
94
|
+
- **TypeScript (tsc)**: Reads `tsconfig.json` or the file specified with `-p` flag
|
|
95
|
+
- **Other tools**: Basic detection and suggestions
|
|
96
|
+
|
|
97
|
+
## Dynamic Configuration Warning
|
|
98
|
+
|
|
99
|
+
If your build tool uses a JavaScript configuration file (e.g., `webpack.config.js`, `rollup.config.js`), the CLI will warn you that the configuration is too dynamic to analyze and suggest:
|
|
100
|
+
|
|
101
|
+
- Using one of the Zephyr bundler plugins from `@libs/`
|
|
102
|
+
- Using `ze-cli deploy <dir>` after building
|
|
103
|
+
|
|
104
|
+
## Requirements
|
|
105
|
+
|
|
106
|
+
- Node.js 18+ or 20+
|
|
107
|
+
- A valid Zephyr authentication token (run `zephyr login` if needed)
|
|
108
|
+
- A git repository (for application identification)
|
|
109
|
+
- A `package.json` file (for application metadata)
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
Apache-2.0
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface CliOptions {
|
|
2
|
+
command: 'run' | 'deploy';
|
|
3
|
+
commandLine?: string;
|
|
4
|
+
directory?: string;
|
|
5
|
+
target?: 'web' | 'ios' | 'android';
|
|
6
|
+
verbose?: boolean;
|
|
7
|
+
ssr?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Parse command line arguments.
|
|
11
|
+
*
|
|
12
|
+
* Syntax:
|
|
13
|
+
*
|
|
14
|
+
* - Ze-cli [options] <command> [args...] - run command (default)
|
|
15
|
+
* - Ze-cli deploy <directory> [options] - deploy command
|
|
16
|
+
*
|
|
17
|
+
* Examples:
|
|
18
|
+
*
|
|
19
|
+
* - Ze-cli --ssr pnpm build
|
|
20
|
+
* - Ze-cli tsc
|
|
21
|
+
* - Ze-cli NODE_ENV=production webpack
|
|
22
|
+
* - Ze-cli deploy ./dist
|
|
23
|
+
* - Ze-cli deploy ./dist --ssr
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseArgs(args: string[]): CliOptions;
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseArgs = parseArgs;
|
|
4
|
+
/**
|
|
5
|
+
* Parse command line arguments.
|
|
6
|
+
*
|
|
7
|
+
* Syntax:
|
|
8
|
+
*
|
|
9
|
+
* - Ze-cli [options] <command> [args...] - run command (default)
|
|
10
|
+
* - Ze-cli deploy <directory> [options] - deploy command
|
|
11
|
+
*
|
|
12
|
+
* Examples:
|
|
13
|
+
*
|
|
14
|
+
* - Ze-cli --ssr pnpm build
|
|
15
|
+
* - Ze-cli tsc
|
|
16
|
+
* - Ze-cli NODE_ENV=production webpack
|
|
17
|
+
* - Ze-cli deploy ./dist
|
|
18
|
+
* - Ze-cli deploy ./dist --ssr
|
|
19
|
+
*/
|
|
20
|
+
function parseArgs(args) {
|
|
21
|
+
const options = {
|
|
22
|
+
command: 'run', // Default to 'run'
|
|
23
|
+
};
|
|
24
|
+
// Find where flags end and the command/subcommand begins
|
|
25
|
+
let commandStartIndex = -1;
|
|
26
|
+
const flags = [];
|
|
27
|
+
for (let i = 0; i < args.length; i++) {
|
|
28
|
+
const arg = args[i];
|
|
29
|
+
if (arg === '--help' || arg === '-h') {
|
|
30
|
+
printHelp();
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
else if (arg === '--version' || arg === '-v') {
|
|
34
|
+
// Version is handled by the caller
|
|
35
|
+
options.verbose = true;
|
|
36
|
+
}
|
|
37
|
+
else if (arg === '--ssr') {
|
|
38
|
+
options.ssr = true;
|
|
39
|
+
flags.push(arg);
|
|
40
|
+
}
|
|
41
|
+
else if (arg === '--target' || arg === '-t') {
|
|
42
|
+
const value = args[++i];
|
|
43
|
+
if (value && ['web', 'ios', 'android'].includes(value)) {
|
|
44
|
+
options.target = value;
|
|
45
|
+
}
|
|
46
|
+
flags.push(arg, value);
|
|
47
|
+
}
|
|
48
|
+
else if (arg === '--verbose') {
|
|
49
|
+
options.verbose = true;
|
|
50
|
+
flags.push(arg);
|
|
51
|
+
}
|
|
52
|
+
else if (!arg.startsWith('-')) {
|
|
53
|
+
// First non-flag argument
|
|
54
|
+
commandStartIndex = i;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (commandStartIndex === -1) {
|
|
59
|
+
printHelp();
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
const firstArg = args[commandStartIndex];
|
|
63
|
+
// Check if it's a subcommand
|
|
64
|
+
if (firstArg === 'deploy') {
|
|
65
|
+
options.command = 'deploy';
|
|
66
|
+
const directory = args[commandStartIndex + 1];
|
|
67
|
+
if (!directory) {
|
|
68
|
+
console.error('Error: deploy command requires a directory argument');
|
|
69
|
+
console.error('Usage: ze-cli deploy <directory> [options]');
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
options.directory = directory;
|
|
73
|
+
// Parse any additional flags after the directory
|
|
74
|
+
for (let i = commandStartIndex + 2; i < args.length; i++) {
|
|
75
|
+
const arg = args[i];
|
|
76
|
+
if (arg === '--ssr') {
|
|
77
|
+
options.ssr = true;
|
|
78
|
+
}
|
|
79
|
+
else if (arg === '--target' || arg === '-t') {
|
|
80
|
+
const value = args[++i];
|
|
81
|
+
if (value && ['web', 'ios', 'android'].includes(value)) {
|
|
82
|
+
options.target = value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (arg === '--verbose') {
|
|
86
|
+
options.verbose = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// It's a run command - everything from commandStartIndex onwards is the command
|
|
92
|
+
options.command = 'run';
|
|
93
|
+
options.commandLine = args.slice(commandStartIndex).join(' ');
|
|
94
|
+
}
|
|
95
|
+
return options;
|
|
96
|
+
}
|
|
97
|
+
function printHelp() {
|
|
98
|
+
console.log(`
|
|
99
|
+
Usage: ze-cli [options] <command> [args...]
|
|
100
|
+
ze-cli deploy <directory> [options]
|
|
101
|
+
|
|
102
|
+
Run a build command and automatically upload assets to Zephyr, or deploy
|
|
103
|
+
pre-built assets from a directory.
|
|
104
|
+
|
|
105
|
+
Commands:
|
|
106
|
+
<command> [args...] Run a build command and upload (default)
|
|
107
|
+
deploy <directory> Upload pre-built assets from a directory
|
|
108
|
+
|
|
109
|
+
Options:
|
|
110
|
+
--ssr Mark this snapshot as server-side rendered
|
|
111
|
+
--target, -t <target> Build target: web, ios, or android (default: web)
|
|
112
|
+
--verbose Enable verbose output
|
|
113
|
+
--help, -h Show this help message
|
|
114
|
+
|
|
115
|
+
Examples:
|
|
116
|
+
# Run build commands
|
|
117
|
+
ze-cli pnpm build
|
|
118
|
+
ze-cli yarn build
|
|
119
|
+
ze-cli tsc
|
|
120
|
+
ze-cli NODE_ENV=production webpack
|
|
121
|
+
ze-cli --ssr pnpm build
|
|
122
|
+
|
|
123
|
+
# Deploy pre-built assets
|
|
124
|
+
ze-cli deploy ./dist
|
|
125
|
+
ze-cli deploy ./dist --ssr
|
|
126
|
+
ze-cli deploy ./build --target ios
|
|
127
|
+
|
|
128
|
+
How it works:
|
|
129
|
+
- For run commands, ze-cli executes your build command and automatically
|
|
130
|
+
detects the output directory to upload assets.
|
|
131
|
+
- For deploy commands, ze-cli uploads assets from the specified directory.
|
|
132
|
+
- All stdout/stderr from build commands are passed through.
|
|
133
|
+
- ze-cli logs are written to stderr only.
|
|
134
|
+
|
|
135
|
+
Note: No configuration file is needed. Zephyr will automatically detect
|
|
136
|
+
application information from your package.json and git repository.
|
|
137
|
+
|
|
138
|
+
For more information: https://docs.zephyr-cloud.io/cli
|
|
139
|
+
`);
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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,QAA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,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCb,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DeployOptions {
|
|
2
|
+
directory: string;
|
|
3
|
+
target?: 'web' | 'ios' | 'android';
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
ssr?: boolean;
|
|
6
|
+
cwd: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Deploy command: Upload pre-built assets from a directory to Zephyr. This is similar to
|
|
10
|
+
* the standalone zephyr-cli tool.
|
|
11
|
+
*/
|
|
12
|
+
export declare function deployCommand(options: DeployOptions): Promise<void>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployCommand = deployCommand;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
|
+
const extract_assets_1 = require("../lib/extract-assets");
|
|
8
|
+
const upload_1 = require("../lib/upload");
|
|
9
|
+
/**
|
|
10
|
+
* Deploy command: Upload pre-built assets from a directory to Zephyr. This is similar to
|
|
11
|
+
* the standalone zephyr-cli tool.
|
|
12
|
+
*/
|
|
13
|
+
async function deployCommand(options) {
|
|
14
|
+
const { directory, target, verbose, ssr, cwd } = options;
|
|
15
|
+
// Resolve the directory path
|
|
16
|
+
const directoryPath = (0, node_path_1.resolve)(cwd, directory);
|
|
17
|
+
// Check if directory exists
|
|
18
|
+
try {
|
|
19
|
+
await (0, promises_1.access)(directoryPath, promises_1.constants.F_OK);
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
23
|
+
message: `Directory does not exist: ${directoryPath}`,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (verbose) {
|
|
27
|
+
(0, zephyr_agent_1.logFn)('info', `Uploading assets from: ${directoryPath}`);
|
|
28
|
+
}
|
|
29
|
+
// Initialize ZephyrEngine with project root context
|
|
30
|
+
const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create({
|
|
31
|
+
builder: 'unknown',
|
|
32
|
+
context: cwd,
|
|
33
|
+
});
|
|
34
|
+
// Set build target if specified
|
|
35
|
+
if (target) {
|
|
36
|
+
zephyr_engine.env.target = target;
|
|
37
|
+
}
|
|
38
|
+
// Set SSR flag if specified
|
|
39
|
+
if (ssr) {
|
|
40
|
+
zephyr_engine.env.ssr = true;
|
|
41
|
+
}
|
|
42
|
+
// Extract assets from the directory
|
|
43
|
+
if (verbose) {
|
|
44
|
+
(0, zephyr_agent_1.logFn)('info', 'Extracting assets from directory...');
|
|
45
|
+
}
|
|
46
|
+
const assetsMap = await (0, extract_assets_1.extractAssetsFromDirectory)(directoryPath);
|
|
47
|
+
if (verbose) {
|
|
48
|
+
const assetCount = Object.keys(assetsMap).length;
|
|
49
|
+
(0, zephyr_agent_1.logFn)('info', `Found ${assetCount} assets to upload`);
|
|
50
|
+
}
|
|
51
|
+
// Upload assets
|
|
52
|
+
await (0, upload_1.uploadAssets)({
|
|
53
|
+
zephyr_engine,
|
|
54
|
+
assetsMap,
|
|
55
|
+
});
|
|
56
|
+
if (verbose) {
|
|
57
|
+
(0, zephyr_agent_1.logFn)('info', 'Upload completed successfully');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot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AG,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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface RunOptions {
|
|
2
|
+
commandLine: string;
|
|
3
|
+
target?: 'web' | 'ios' | 'android';
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
ssr?: boolean;
|
|
6
|
+
cwd: string;
|
|
7
|
+
}
|
|
8
|
+
/** Run command: Execute a build command and automatically upload the resulting assets. */
|
|
9
|
+
export declare function runCommand(options: RunOptions): Promise<void>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runCommand = runCommand;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const zephyr_agent_1 = require("zephyr-agent");
|
|
7
|
+
const command_detector_1 = require("../lib/command-detector");
|
|
8
|
+
const extract_assets_1 = require("../lib/extract-assets");
|
|
9
|
+
const shell_parser_1 = require("../lib/shell-parser");
|
|
10
|
+
const spawn_helper_1 = require("../lib/spawn-helper");
|
|
11
|
+
const upload_1 = require("../lib/upload");
|
|
12
|
+
/** Run command: Execute a build command and automatically upload the resulting assets. */
|
|
13
|
+
async function runCommand(options) {
|
|
14
|
+
var _a;
|
|
15
|
+
const { commandLine, target, verbose, ssr, cwd } = options;
|
|
16
|
+
// Log to stderr so it doesn't interfere with command output
|
|
17
|
+
const log = (level, message) => {
|
|
18
|
+
if (level === 'info' && !verbose) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// All ze-cli logs go to stderr
|
|
22
|
+
console.error(`[ze-cli] ${message}`);
|
|
23
|
+
};
|
|
24
|
+
// Parse the shell command - check if there are multiple commands
|
|
25
|
+
log('info', `Parsing command: ${commandLine}`);
|
|
26
|
+
const individualCommands = (0, shell_parser_1.splitCommands)(commandLine);
|
|
27
|
+
if (individualCommands.length > 1) {
|
|
28
|
+
log('info', `Detected ${individualCommands.length} commands to execute`);
|
|
29
|
+
}
|
|
30
|
+
// Detect multiple commands and their output directories
|
|
31
|
+
const multiDetection = await (0, command_detector_1.detectMultipleCommands)(commandLine, cwd);
|
|
32
|
+
const { commands: detectedCommands, outputDirs, commonOutputDir } = multiDetection;
|
|
33
|
+
// Log detected tools
|
|
34
|
+
// Flatten commands if there are sub-commands
|
|
35
|
+
const allCommands = [];
|
|
36
|
+
for (const detected of detectedCommands) {
|
|
37
|
+
if (detected.subCommands && detected.subCommands.length > 0) {
|
|
38
|
+
// If there are sub-commands, log them instead of the parent
|
|
39
|
+
allCommands.push(...detected.subCommands);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
allCommands.push(detected);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (let i = 0; i < allCommands.length; i++) {
|
|
46
|
+
const detected = allCommands[i];
|
|
47
|
+
log('info', `Command ${i + 1}: ${detected.tool}`);
|
|
48
|
+
if (detected.configFile) {
|
|
49
|
+
log('info', ` Config file: ${detected.configFile}`);
|
|
50
|
+
}
|
|
51
|
+
if (detected.outputDir) {
|
|
52
|
+
const absoluteOutputDir = (0, node_path_1.resolve)(cwd, detected.outputDir);
|
|
53
|
+
log('info', ` Output directory: ${(0, node_path_1.relative)(cwd, absoluteOutputDir) || '.'}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// If multiple output directories detected, show common ancestor
|
|
57
|
+
if (outputDirs.length > 1 && commonOutputDir) {
|
|
58
|
+
log('info', `Multiple output directories detected, using common ancestor: ${(0, node_path_1.relative)(cwd, commonOutputDir) || '.'}`);
|
|
59
|
+
}
|
|
60
|
+
// Warn about dynamic configs
|
|
61
|
+
if (!outputDirs.length) {
|
|
62
|
+
console.error('[ze-cli] WARNING: Configuration is too dynamic to analyze!');
|
|
63
|
+
console.error('[ze-cli] ');
|
|
64
|
+
console.error('[ze-cli] Your build tool uses a JavaScript configuration file that cannot be');
|
|
65
|
+
console.error('[ze-cli] statically analyzed. This means ze-cli cannot automatically');
|
|
66
|
+
console.error('[ze-cli] detect the output directory.');
|
|
67
|
+
console.error('[ze-cli] ');
|
|
68
|
+
console.error('[ze-cli] Recommendations:');
|
|
69
|
+
console.error('[ze-cli] 1. Use a Zephyr bundler plugin:');
|
|
70
|
+
console.error('[ze-cli] - @zephyrcloud/webpack-plugin');
|
|
71
|
+
console.error('[ze-cli] - @zephyrcloud/rollup-plugin');
|
|
72
|
+
console.error('[ze-cli] - @zephyrcloud/vite-plugin');
|
|
73
|
+
console.error('[ze-cli] - etc.');
|
|
74
|
+
console.error('[ze-cli] 2. Or use "ze-cli deploy <dir>" after building');
|
|
75
|
+
console.error('[ze-cli] ');
|
|
76
|
+
console.error('[ze-cli] For more info: https://docs.zephyr-cloud.io/integrations');
|
|
77
|
+
console.error('[ze-cli] ');
|
|
78
|
+
}
|
|
79
|
+
// Display warnings from all commands
|
|
80
|
+
for (const detected of detectedCommands) {
|
|
81
|
+
if (detected.warnings.length > 0 && !detected.isDynamicConfig) {
|
|
82
|
+
for (const warning of detected.warnings) {
|
|
83
|
+
console.error(`[ze-cli] Warning: ${warning}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Execute all build commands sequentially
|
|
88
|
+
for (let i = 0; i < individualCommands.length; i++) {
|
|
89
|
+
const cmd = individualCommands[i];
|
|
90
|
+
log('info', `Executing command ${i + 1}/${individualCommands.length}: ${cmd}`);
|
|
91
|
+
try {
|
|
92
|
+
const parsed = (0, shell_parser_1.parseShellCommand)(cmd);
|
|
93
|
+
const result = await (0, spawn_helper_1.executeCommand)(parsed, cwd);
|
|
94
|
+
if (result.exitCode !== 0) {
|
|
95
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
96
|
+
message: `Build command failed with exit code ${result.exitCode}`,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
log('info', `Command ${i + 1} completed successfully`);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
103
|
+
message: `Failed to execute command: ${cmd}\n${error.message}`,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
log('info', 'All build commands completed successfully');
|
|
108
|
+
// Determine which output directory to use
|
|
109
|
+
let outputDir = null;
|
|
110
|
+
if (commonOutputDir) {
|
|
111
|
+
outputDir = commonOutputDir;
|
|
112
|
+
}
|
|
113
|
+
else if (detectedCommands.length === 1 && detectedCommands[0].outputDir) {
|
|
114
|
+
outputDir = (0, node_path_1.resolve)(cwd, detectedCommands[0].outputDir);
|
|
115
|
+
}
|
|
116
|
+
// If we couldn't detect the output directory, stop here
|
|
117
|
+
if (!outputDir) {
|
|
118
|
+
console.error('[ze-cli] ');
|
|
119
|
+
console.error('[ze-cli] Could not detect output directory. Skipping upload.');
|
|
120
|
+
console.error('[ze-cli] Please use "ze-cli deploy <dir>" to upload manually.');
|
|
121
|
+
console.error('[ze-cli] ');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
log('info', `Using output directory: ${(0, node_path_1.relative)(cwd, outputDir) || '.'}`);
|
|
125
|
+
// Check if output directory exists
|
|
126
|
+
if (!(0, node_fs_1.existsSync)(outputDir)) {
|
|
127
|
+
throw new zephyr_agent_1.ZephyrError(zephyr_agent_1.ZeErrors.ERR_UNKNOWN, {
|
|
128
|
+
message: `Output directory does not exist: ${outputDir}`,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
// Determine the primary build tool for ZephyrEngine
|
|
132
|
+
const primaryTool = ((_a = detectedCommands[0]) === null || _a === void 0 ? void 0 : _a.tool) || 'unknown';
|
|
133
|
+
// Initialize ZephyrEngine with project root context
|
|
134
|
+
log('info', 'Initializing Zephyr Engine...');
|
|
135
|
+
const zephyr_engine = await zephyr_agent_1.ZephyrEngine.create({
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
137
|
+
builder: primaryTool,
|
|
138
|
+
context: cwd,
|
|
139
|
+
});
|
|
140
|
+
// Set build target if specified
|
|
141
|
+
if (target) {
|
|
142
|
+
zephyr_engine.env.target = target;
|
|
143
|
+
}
|
|
144
|
+
// Set SSR flag if specified
|
|
145
|
+
if (ssr) {
|
|
146
|
+
zephyr_engine.env.ssr = true;
|
|
147
|
+
}
|
|
148
|
+
// Extract assets from the output directory
|
|
149
|
+
log('info', 'Extracting assets from output directory...');
|
|
150
|
+
const assetsMap = await (0, extract_assets_1.extractAssetsFromDirectory)(outputDir);
|
|
151
|
+
const assetCount = Object.keys(assetsMap).length;
|
|
152
|
+
log('info', `Found ${assetCount} assets to upload`);
|
|
153
|
+
// Upload assets
|
|
154
|
+
log('info', 'Uploading assets to Zephyr...');
|
|
155
|
+
await (0, upload_1.uploadAssets)({
|
|
156
|
+
zephyr_engine,
|
|
157
|
+
assetsMap,
|
|
158
|
+
});
|
|
159
|
+
log('info', 'Upload completed successfully');
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":";;AAkBA,gCAiLC;AAnMD,qCAAqC;AACrC,yCAA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