esa-cli 0.0.5 → 1.0.0
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/README.md +32 -149
- package/dist/commands/commit/index.js +49 -104
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/constant.js +4 -4
- package/dist/commands/common/utils.js +419 -0
- package/dist/commands/config.js +2 -2
- package/dist/commands/deploy/helper.js +43 -49
- package/dist/commands/deploy/index.js +51 -174
- package/dist/commands/deployments/delete.js +32 -22
- package/dist/commands/deployments/index.js +4 -4
- package/dist/commands/deployments/list.js +21 -34
- package/dist/commands/dev/build.js +3 -3
- package/dist/commands/dev/doProcess.js +5 -5
- package/dist/commands/dev/ew2/cacheService.js +33 -0
- package/dist/commands/dev/ew2/devEntry.js +2 -1
- package/dist/commands/dev/ew2/devPack.js +31 -20
- package/dist/commands/dev/ew2/kvService.js +50 -0
- package/dist/commands/dev/ew2/mock/cache.js +99 -15
- package/dist/commands/dev/ew2/mock/kv.js +142 -21
- package/dist/commands/dev/ew2/server.js +163 -28
- package/dist/commands/dev/index.js +17 -18
- package/dist/commands/dev/mockWorker/devPack.js +19 -10
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +4 -4
- package/dist/commands/domain/delete.js +3 -3
- package/dist/commands/domain/index.js +4 -4
- package/dist/commands/domain/list.js +7 -7
- package/dist/commands/init/helper.js +654 -21
- package/dist/commands/init/index.js +88 -152
- package/dist/commands/init/snippets/nextjs/next.config.mjs +6 -0
- package/dist/commands/init/snippets/nextjs/next.config.ts +7 -0
- package/dist/commands/init/snippets/react-router/react-router.config.ts +7 -0
- package/dist/commands/init/template.jsonc +84 -0
- package/dist/commands/init/types.js +1 -0
- package/dist/commands/lang.js +2 -2
- package/dist/commands/login/index.js +74 -34
- package/dist/commands/logout.js +6 -6
- package/dist/commands/route/add.js +101 -43
- package/dist/commands/route/delete.js +6 -6
- package/dist/commands/route/helper.js +9 -10
- package/dist/commands/route/index.js +4 -4
- package/dist/commands/route/list.js +4 -4
- package/dist/commands/routine/delete.js +9 -8
- package/dist/commands/routine/index.js +6 -5
- package/dist/commands/routine/list.js +45 -39
- package/dist/commands/site/index.js +3 -3
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +61 -25
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/filterSelector.js +1 -1
- package/dist/components/mutiLevelSelect.js +19 -20
- package/dist/components/mutiSelectTable.js +1 -1
- package/dist/components/routeBuilder.js +68 -0
- package/dist/components/selectInput.js +2 -3
- package/dist/components/selectItem.js +1 -1
- package/dist/docs/Commands_en.md +164 -117
- package/dist/docs/Commands_zh_CN.md +155 -107
- package/dist/docs/Config_en.md +70 -0
- package/dist/docs/Config_zh_CN.md +68 -0
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +414 -82
- package/dist/index.js +28 -13
- package/dist/libs/api.js +3 -6
- package/dist/libs/apiService.js +192 -69
- package/dist/libs/git/index.js +86 -9
- package/dist/libs/interface.js +0 -1
- package/dist/libs/logger.js +162 -10
- package/dist/libs/service.js +2 -2
- package/dist/libs/templates/index.js +1 -1
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +5 -19
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +27 -21
- package/dist/utils/checkVersion.js +119 -1
- package/dist/utils/command.js +149 -0
- package/dist/utils/compress.js +142 -0
- package/dist/utils/download.js +8 -8
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/index.js +136 -45
- package/dist/utils/installDeno.js +4 -4
- package/dist/utils/installEw2.js +9 -9
- package/dist/utils/openInBrowser.js +1 -1
- package/dist/utils/prompt.js +97 -0
- package/package.json +23 -12
- package/zh_CN.md +29 -154
package/README.md
CHANGED
|
@@ -1,173 +1,56 @@
|
|
|
1
|
-
# ESA CLI
|
|
1
|
+
# Install/Update ESA CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ESA CLI is a command-line tool for building with Alibaba Cloud ESA Functions and Pages.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://discord.gg/xygV6MYx">
|
|
7
|
+
<img alt="Discord CN" src="https://img.shields.io/badge/Discord-中文-5865F2?logo=discord&logoColor=white" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://discord.gg/YeFg4yUA" style="margin-left:8px;">
|
|
10
|
+
<img alt="Discord EN" src="https://img.shields.io/badge/Discord-English-5865F2?logo=discord&logoColor=white" />
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
## Install ESA CLI
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
- [What is EdgeRoutine?](https://help.aliyun.com/document_detail/2710021.html)
|
|
16
|
+
### Prerequisites
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
- Node.js: 18.x or higher (supports 18.x, 20.x, 22.x)
|
|
19
|
+
- OS: macOS (x86, Apple Silicon), Linux
|
|
20
|
+
- Recommended to use a Node version manager like Volta or nvm to avoid permission issues and easily switch Node.js versions.
|
|
15
21
|
|
|
16
22
|
## Installation
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
To ensure consistent collaboration across your team, we recommend installing `esa-cli` as a dev dependency in your project. This helps everyone use the same version.
|
|
19
25
|
|
|
20
26
|
```bash
|
|
21
|
-
|
|
22
|
-
$ esa -v # Check the version
|
|
27
|
+
npm i -D esa-cli@latest
|
|
23
28
|
```
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### 1. Initialize Routine Project
|
|
30
|
+
> [!TIP]
|
|
31
|
+
> When `esa-cli` is not previously installed, `npx` will fetch and run the latest version from the registry.
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
& esa init
|
|
31
|
-
```
|
|
33
|
+
## Check your ESA CLI version
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### 2. Start a local server for developing your routine
|
|
36
|
-
|
|
37
|
-
Local dev is the core feature of the CLI, offering a more convenient debugging experience compared to the Alibaba Cloud ESA console.
|
|
35
|
+
**To check your ESA CLI version, run:**
|
|
38
36
|
|
|
39
37
|
```bash
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
npx esa-cli --version
|
|
39
|
+
# or
|
|
40
|
+
npx esa-cli -v
|
|
42
41
|
```
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
In an EdgeRoutine project, the entry file is `src/index.js`, and the basic structure is as follows:
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
const html = `<!DOCTYPE html>
|
|
50
|
-
<body>
|
|
51
|
-
<h1>Hello World!</h1>
|
|
52
|
-
</body>`;
|
|
53
|
-
|
|
54
|
-
async function handleRequest(request) {
|
|
55
|
-
return new Response(html, {
|
|
56
|
-
headers: {
|
|
57
|
-
'content-type': 'text/html;charset=UTF-8'
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default {
|
|
63
|
-
async fetch(event) {
|
|
64
|
-
return event.respondWith(handleRequest(event));
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
For more EdgeRoutine APIs and syntax, please refer to the [API Reference](https://help.aliyun.com/document_detail/2710024.html)
|
|
70
|
-
|
|
71
|
-
#### Local Debugging
|
|
72
|
-
|
|
73
|
-
After executing `esa dev`, the entry file will be automatically packaged and a local debugging service will be started. The interface looks like this:
|
|
74
|
-
|
|
75
|
-

|
|
76
|
-
|
|
77
|
-
- Press `b` to open the debugging page in the browser.
|
|
78
|
-
- Press `c` to clear the panel.
|
|
79
|
-
- Press `x` to exit debugging.
|
|
80
|
-
- You can use `esa dev --port <port>` to temporarily specify the port or use `esa config -l` to set the port by project configuration.
|
|
81
|
-
|
|
82
|
-
### 3. Log in to Alibaba Cloud Account
|
|
83
|
-
|
|
84
|
-
You need to log in to your Alibaba Cloud account to perform remote management operations.
|
|
85
|
-
|
|
86
|
-
First, visit the [Alibaba Cloud RAM Console](https://ram.console.aliyun.com/manage/ak) to get your AccessKey ID and AccessKey Secret, then execute `esa login` and follow the prompts to enter them.
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
& esa login
|
|
90
|
-
& esa logout
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### 4. Create a Version
|
|
94
|
-
|
|
95
|
-
After local debugging is complete, you need to create a code version for deployment.
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
& esa commit # Create a Version
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 5. Deploy to Environment & Manage Versions and Deployments
|
|
102
|
-
|
|
103
|
-
After the code version is created, it needs to be deployed to edge nodes.
|
|
43
|
+
## Update ESA CLI
|
|
104
44
|
|
|
105
|
-
|
|
45
|
+
**To update ESA CLI to the latest version, run:**
|
|
106
46
|
|
|
107
47
|
```bash
|
|
108
|
-
|
|
109
|
-
& esa deployments list # View deployments
|
|
110
|
-
& esa deployments delete <versionId> # Delete a version
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
_Note: Deployed versions cannot be deleted._
|
|
114
|
-
|
|
115
|
-
### 6. Manage Triggers
|
|
116
|
-
|
|
117
|
-
Once deployed to the nodes, you can configure triggers to access your edge functions. There are two types of triggers:
|
|
118
|
-
|
|
119
|
-
- Domain: After you associate the routine with a domain name, you can use the domain name to access the routine.
|
|
120
|
-
- Route: After you add a route for requested URLs, the routine is called from the edge to respond to the request.
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
& esa domain list
|
|
124
|
-
& esa domain add <domainName>
|
|
125
|
-
& esa domain delete <domainName>
|
|
126
|
-
|
|
127
|
-
& esa route list
|
|
128
|
-
& esa route add [route] [site]
|
|
129
|
-
& esa route delete <route>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### 7. Manage Functions
|
|
133
|
-
|
|
134
|
-
You can view and delete Routine functions through the CLI.
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
& esa routine list
|
|
138
|
-
& esa routine delete <routineName>
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## Commands
|
|
142
|
-
|
|
143
|
-
see [Commands](./docs/Commands_en.md)
|
|
144
|
-
|
|
145
|
-
## Config files
|
|
146
|
-
|
|
147
|
-
### Global config file
|
|
148
|
-
|
|
149
|
-
```toml
|
|
150
|
-
endpoint = "" # ESA API Endpoint
|
|
151
|
-
lang = "zh_CN" # language
|
|
152
|
-
|
|
153
|
-
[auth]
|
|
154
|
-
accessKeyId = "" # AccessKey ID
|
|
155
|
-
accessKeySecret = "" # AccessKey Secret
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Project config file
|
|
159
|
-
|
|
160
|
-
```toml
|
|
161
|
-
name = "Hello World" # Project name
|
|
162
|
-
description = "Hello World" # Project description
|
|
163
|
-
entry = "src/index.js" # Entry file
|
|
164
|
-
codeVersions = [ ] # Code version
|
|
165
|
-
|
|
166
|
-
[dev]
|
|
167
|
-
port = 18080 # Debug port
|
|
168
|
-
localUpstream = '' # When debugging locally, the upstream source site will replace the current origin when returning to the source
|
|
48
|
+
npm i -D esa-cli@latest
|
|
169
49
|
```
|
|
170
50
|
|
|
171
|
-
##
|
|
51
|
+
## Related Documentation
|
|
172
52
|
|
|
173
|
-
[
|
|
53
|
+
- [esa-cli command](./docs/Commands_en.md)
|
|
54
|
+
- [ESA Configuration Guide](./docs/Config_en.md)
|
|
55
|
+
- [Alibaba Cloud ESA Documentation](https://www.alibabacloud.com/help/en/edge-security-acceleration/esa/user-guide/what-is-er/)
|
|
56
|
+
- [Functions and Pages API Reference](https://www.alibabacloud.com/help/en/edge-security-acceleration/esa/user-guide/api-documentation/)
|
|
@@ -7,16 +7,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import { ApiService } from '../../libs/apiService.js';
|
|
14
|
-
import prodBuild from './prodBuild.js';
|
|
15
|
-
import logger from '../../libs/logger.js';
|
|
10
|
+
import { exit } from 'process';
|
|
11
|
+
import { intro, outro } from '@clack/prompts';
|
|
12
|
+
import chalk from 'chalk';
|
|
16
13
|
import t from '../../i18n/index.js';
|
|
14
|
+
import logger from '../../libs/logger.js';
|
|
15
|
+
import promptParameter from '../../utils/prompt.js';
|
|
16
|
+
import { validateAndInitializeProject, generateCodeVersion } from '../common/utils.js';
|
|
17
17
|
const commit = {
|
|
18
18
|
command: 'commit [entry]',
|
|
19
|
-
describe:
|
|
19
|
+
describe: `📦 ${t('commit_describe').d('Commit your code, save as a new version')}`,
|
|
20
20
|
builder: (yargs) => {
|
|
21
21
|
return yargs
|
|
22
22
|
.option('minify', {
|
|
@@ -25,116 +25,61 @@ const commit = {
|
|
|
25
25
|
type: 'boolean',
|
|
26
26
|
default: false
|
|
27
27
|
})
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
.option('assets', {
|
|
29
|
+
alias: 'a',
|
|
30
|
+
describe: t('commit_option_assets').d('Assets directory'),
|
|
31
|
+
type: 'string'
|
|
32
|
+
})
|
|
33
|
+
.option('description', {
|
|
34
|
+
alias: 'd',
|
|
35
|
+
describe: t('commit_option_description').d('Description for Functions& Pages/version (skip interactive input)'),
|
|
36
|
+
type: 'string'
|
|
37
|
+
})
|
|
38
|
+
.option('name', {
|
|
39
|
+
alias: 'n',
|
|
40
|
+
describe: t('commit_option_name').d('Functions& Pages name'),
|
|
41
|
+
type: 'string'
|
|
32
42
|
});
|
|
33
43
|
},
|
|
34
44
|
handler: (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
handleCommit(argv);
|
|
45
|
+
yield handleCommit(argv);
|
|
46
|
+
exit();
|
|
36
47
|
})
|
|
37
48
|
};
|
|
38
49
|
export default commit;
|
|
39
50
|
export function handleCommit(argv) {
|
|
40
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
45
|
-
return logger.notInProject();
|
|
46
|
-
if (!(yield checkIsLoginSuccess()))
|
|
52
|
+
var _a, _b;
|
|
53
|
+
intro(`Commit an application with ESA`);
|
|
54
|
+
const projectInfo = yield validateAndInitializeProject(argv === null || argv === void 0 ? void 0 : argv.name);
|
|
55
|
+
if (!projectInfo)
|
|
47
56
|
return;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const response = yield server.getRoutine(req, false);
|
|
53
|
-
let action = 'Creating';
|
|
54
|
-
let description;
|
|
55
|
-
if (!response) {
|
|
56
|
-
logger.log(`🙅 ${t('commit_er_not_exist').d('No routine found, creating a new one')}`);
|
|
57
|
-
description = yield descriptionInput(`🖊️ ${t('commit_er_description').d('Enter a description for the routine')}:`, false);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
logger.log(`🔄 ${t('commit_er_exist').d('Routine exists, updating the code')}`);
|
|
61
|
-
description = yield descriptionInput(`🖊️ ${t('commit_version_description').d('Enter a description for the version')}:`, false);
|
|
62
|
-
action = 'Updating';
|
|
63
|
-
}
|
|
64
|
-
const code = readEdgeRoutineFile() || '';
|
|
65
|
-
const edgeRoutine = {
|
|
66
|
-
name: projectConfig.name,
|
|
67
|
-
code,
|
|
68
|
-
description
|
|
69
|
-
};
|
|
70
|
-
if (action === 'Creating') {
|
|
71
|
-
yield createEdgeRoutine(edgeRoutine);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
if (!(yield uploadEdgeRoutineCode(edgeRoutine)))
|
|
75
|
-
return;
|
|
76
|
-
yield releaseOfficialVersion(edgeRoutine);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
logger.error(`${t('common_error_occurred').d('An error occurred:')} ${error}`);
|
|
57
|
+
const { projectName } = projectInfo;
|
|
58
|
+
let description;
|
|
59
|
+
if (argv.description) {
|
|
60
|
+
description = argv.description;
|
|
81
61
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const createResult = (res === null || res === void 0 ? void 0 : res.data.Status) === 'OK';
|
|
90
|
-
if (!createResult) {
|
|
91
|
-
logger.error(t('commit_create_er_fail').d('An error occurred while trying to create a routine'));
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
logger.success(t('commit_create_er_success').d('Routine created successfully.'));
|
|
95
|
-
return yield uploadEdgeRoutineCode(edgeRoutine);
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
logger.error(`${t('common_error_occurred').d('An error occurred:')} ${error}`);
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
export function uploadEdgeRoutineCode(edgeRoutine) {
|
|
104
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
try {
|
|
106
|
-
const server = yield ApiService.getInstance();
|
|
107
|
-
const uploadResult = yield server.getRoutineStagingCodeUploadInfo(edgeRoutine);
|
|
108
|
-
if (!uploadResult) {
|
|
109
|
-
logger.error(t('commit_upload_fail').d('An error occurred while trying to upload your code'));
|
|
110
|
-
process.exit(0);
|
|
111
|
-
}
|
|
112
|
-
logger.success(t('commit_upload_success').d('Code uploaded successfully.'));
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
logger.error('123');
|
|
117
|
-
logger.error(`${t('common_error_occurred').d('An error occurred:')} ${error}`);
|
|
118
|
-
process.exit(0);
|
|
62
|
+
else {
|
|
63
|
+
description = (yield promptParameter({
|
|
64
|
+
type: 'text',
|
|
65
|
+
question: t('commit_version_description').d('Enter a description for the version'),
|
|
66
|
+
label: 'Description',
|
|
67
|
+
defaultValue: ''
|
|
68
|
+
}));
|
|
119
69
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Name: edgeRoutine.name,
|
|
127
|
-
CodeDescription: (_a = edgeRoutine.description) !== null && _a !== void 0 ? _a : ''
|
|
128
|
-
};
|
|
129
|
-
const server = yield ApiService.getInstance();
|
|
130
|
-
const commitResult = yield server.commitRoutineStagingCode(param);
|
|
131
|
-
if (commitResult) {
|
|
132
|
-
logger.success(t('commit_success').d('Code version committed successfully.'));
|
|
133
|
-
return true;
|
|
70
|
+
logger.startSubStep('Generating code version');
|
|
71
|
+
const res = yield generateCodeVersion(projectName, description, argv === null || argv === void 0 ? void 0 : argv.entry, argv === null || argv === void 0 ? void 0 : argv.assets, argv === null || argv === void 0 ? void 0 : argv.minify);
|
|
72
|
+
const { isSuccess } = res || {};
|
|
73
|
+
if (!isSuccess) {
|
|
74
|
+
logger.endSubStep('Generate version failed');
|
|
75
|
+
exit(1);
|
|
134
76
|
}
|
|
135
|
-
|
|
136
|
-
|
|
77
|
+
const codeVersion = (_b = (_a = res === null || res === void 0 ? void 0 : res.res) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.CodeVersion;
|
|
78
|
+
if (!codeVersion) {
|
|
79
|
+
logger.endSubStep('Missing CodeVersion in response');
|
|
137
80
|
return false;
|
|
138
81
|
}
|
|
82
|
+
logger.endSubStep(`Version generated: ${codeVersion}`);
|
|
83
|
+
outro(`Code version ${chalk.bold(codeVersion)} generated successfully`);
|
|
139
84
|
});
|
|
140
85
|
}
|
|
@@ -7,15 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
import path from 'path';
|
|
10
12
|
import esbuild from 'esbuild';
|
|
11
13
|
import { lessLoader } from 'esbuild-plugin-less';
|
|
12
|
-
import path from 'path';
|
|
13
|
-
import fs from 'fs';
|
|
14
14
|
import { getRoot } from '../../utils/fileUtils/base.js';
|
|
15
15
|
import { NODE_EXTERNALS } from '../common/constant.js';
|
|
16
16
|
const userRoot = getRoot();
|
|
17
17
|
const entry = path.resolve(userRoot, 'src/index.js');
|
|
18
|
-
const outfile = path.resolve(userRoot, '.dev/pub.js');
|
|
19
18
|
export default function () {
|
|
20
19
|
return __awaiter(this, arguments, void 0, function* (minify = false, customEntry, outputPath) {
|
|
21
20
|
const entryPoint = customEntry
|
|
@@ -2,21 +2,21 @@ import t from '../../i18n/index.js';
|
|
|
2
2
|
export const getSummary = (routineName) => {
|
|
3
3
|
return [
|
|
4
4
|
{
|
|
5
|
-
title: t('summery_cd').d('Enter your
|
|
5
|
+
title: t('summery_cd').d('Enter your project folder'),
|
|
6
6
|
command: `💡 cd ${routineName}`
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
title: t('summery_dev').d('Start a local development server for your project'),
|
|
10
|
-
command: '💡 esa dev'
|
|
10
|
+
command: '💡 esa-cli dev'
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
title: t('summery_commit').d('Save a new version of code'),
|
|
14
|
-
command: '💡 esa commit'
|
|
14
|
+
command: '💡 esa-cli commit'
|
|
15
15
|
},
|
|
16
16
|
// Use Deploy or Release?
|
|
17
17
|
{
|
|
18
18
|
title: t('summery_deploy').d('Deploy your project to different environments'),
|
|
19
|
-
command: '💡 esa deploy'
|
|
19
|
+
command: '💡 esa-cli deploy'
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
22
|
};
|