edgeone 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -24
- package/edgeone-dist/cli.js +228 -228
- package/edgeone-dist/pages/dev/runner-worker.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ fetch('/api/my-functions', {
|
|
|
80
80
|
|
|
81
81
|
Note:
|
|
82
82
|
- The dev service will read `devCommand` from `edgeone.json` to start your dev server. If absent, it will read the `dev` script from your project's `package.json`.
|
|
83
|
-
- Edge Functions debug service has a start
|
|
83
|
+
- Edge Functions debug service has a limit on the number of times it can start up, so try to avoid frequently logging out and starting the dev service (hot updates within the dev service will not increase the startup count).
|
|
84
84
|
|
|
85
85
|
### 5. Associated Project
|
|
86
86
|
|
|
@@ -89,40 +89,35 @@ If you need to use the Key-Value Storage capability or synchronize the environme
|
|
|
89
89
|
```plaintext
|
|
90
90
|
edgeone pages link
|
|
91
91
|
```
|
|
92
|
+
If you need to link a project that does not exist, you can also create a new project directly under the CLI guide.
|
|
92
93
|
|
|
93
|
-
### 6. Deploy
|
|
94
|
-
|
|
95
|
-
After local development and debugging are completed, you can deploy your project directly using the deploy command:
|
|
96
94
|
|
|
97
|
-
|
|
98
|
-
edgeone pages deploy <directoryOrZip> -n <projectName>
|
|
99
|
-
```
|
|
95
|
+
### 6. Deploy
|
|
100
96
|
|
|
101
|
-
|
|
97
|
+
If your project is created via "direct upload", you can also deploy it directly to the Pages platform locally by executing the following command:
|
|
102
98
|
|
|
103
99
|
```plaintext
|
|
104
|
-
edgeone pages deploy -n <projectName>
|
|
100
|
+
edgeone pages deploy [<directoryOrZip>] [-n <projectName>] [-e <env>]
|
|
105
101
|
```
|
|
106
|
-
The CLI will automatically build and initiate deployment based on the project configuration.
|
|
107
102
|
|
|
108
103
|
#### Parameters
|
|
109
104
|
|
|
110
|
-
- `<directoryOrZip>`: Path of folder or ZIP package to deploy
|
|
111
|
-
- `-n, --name`: Project name for deployment (creates new or updates existing project)
|
|
105
|
+
- `<directoryOrZip>`: Path of folder or ZIP package to deploy
|
|
106
|
+
- `-n, --name`: Project name for deployment (creates new or updates existing project)
|
|
112
107
|
- `-e, --env`: Environment to deploy to, choices: 'production' or 'preview' (default: 'production')
|
|
113
108
|
|
|
114
109
|
Note:
|
|
115
|
-
-
|
|
116
|
-
- If you
|
|
110
|
+
- By default, when executing deploy, the CLI will automatically build and package frontend code, `node-functions`, and `edge-functions` into the `.edgeone` folder and deploy to Pages.
|
|
111
|
+
- If you choose to manually build the project, you need to copy the related folders of Pages Functions and the project's `package.json` file to dist (suppose the output directory is dist) after building, then rerun `edgeone pages deploy ./dist`.
|
|
117
112
|
|
|
118
113
|
#### Usage Examples
|
|
119
114
|
|
|
120
115
|
```plaintext
|
|
121
116
|
# Deploy build folder to production
|
|
122
|
-
edgeone pages deploy
|
|
117
|
+
edgeone pages deploy
|
|
123
118
|
|
|
124
119
|
# Deploy ZIP package to preview environment
|
|
125
|
-
edgeone pages deploy
|
|
120
|
+
edgeone pages deploy -e preview
|
|
126
121
|
```
|
|
127
122
|
|
|
128
123
|
**Alternative: Git-based Deployment**
|
|
@@ -148,28 +143,28 @@ This section provides guidance on integrating EdgeOne CLI into your CI/CD pipeli
|
|
|
148
143
|
For CI/CD pipelines, you can use the same deploy command with an API Token for authentication:
|
|
149
144
|
|
|
150
145
|
```plaintext
|
|
151
|
-
edgeone pages deploy <directoryOrZip> -n <projectName> -t <token> [-e <env>]
|
|
146
|
+
edgeone pages deploy [<directoryOrZip>] -n <projectName> -t <token> [-e <env>]
|
|
152
147
|
```
|
|
153
148
|
|
|
154
149
|
#### Parameters
|
|
155
150
|
|
|
156
|
-
- `<directoryOrZip>`: Path of folder or ZIP package to deploy
|
|
151
|
+
- `<directoryOrZip>`: Path of folder or ZIP package to deploy
|
|
157
152
|
- `-n, --name`: Project name for deployment (creates new or updates existing project) (required)
|
|
158
153
|
- `-e, --env`: Environment to deploy to, choices: 'production' or 'preview' (default: 'production')
|
|
159
154
|
- `-t, --token`: API Token for CI/CD pipelines (required for automated deployments)
|
|
160
155
|
|
|
161
156
|
Note:
|
|
162
|
-
-
|
|
163
|
-
- If you
|
|
157
|
+
- By default, when executing deploy, the CLI will automatically build and package frontend code, `node-functions`, and `edge-functions` into the `.edgeone` folder and deploy to Pages.
|
|
158
|
+
- If you choose to manually build the project, you need to copy the related folders of Pages Functions and the project's `package.json` file to dist (suppose the output directory is dist) after building, then rerun `edgeone pages deploy ./dist`.
|
|
164
159
|
|
|
165
160
|
#### CI/CD Pipeline Examples
|
|
166
161
|
|
|
167
162
|
```plaintext
|
|
168
163
|
# Basic CI deployment to production with API token
|
|
169
|
-
edgeone pages deploy
|
|
164
|
+
edgeone pages deploy -n edgeone-pages-project -t $EDGEONE_API_TOKEN
|
|
170
165
|
|
|
171
166
|
# CI deployment to preview environment with API token
|
|
172
|
-
edgeone pages deploy
|
|
167
|
+
edgeone pages deploy -n edgeone-pages-project -e preview -t $EDGEONE_API_TOKEN
|
|
173
168
|
```
|
|
174
169
|
|
|
175
170
|
#### Obtaining an API Token
|
|
@@ -182,13 +177,13 @@ How to create an API Token
|
|
|
182
177
|
4. Select "expiration time" to ensure your information security.
|
|
183
178
|
5. Click Submit.
|
|
184
179
|
|
|
185
|
-
For more information, please refer to https://edgeone.ai/document/
|
|
180
|
+
For more information, please refer to https://pages.edgeone.ai/document/api-token
|
|
186
181
|
|
|
187
182
|
<br/>
|
|
188
183
|
|
|
189
184
|
## References
|
|
190
185
|
|
|
191
|
-
[Pages Introduction](https://edgeone.ai/document/
|
|
186
|
+
[Pages Introduction](https://pages.edgeone.ai/document/product-introduction) | [Pages Functions](https://pages.edgeone.ai/document/pages-functions-overview)
|
|
192
187
|
|
|
193
188
|
_To access the China site documentation, please click [here](https://edgeone.cloud.tencent.com/pages/document/162936635171454976)._
|
|
194
189
|
|