Skip to content
This repository was archived by the owner on Apr 15, 2021. It is now read-only.

Commit 036afec

Browse files
committed
Replace CLI command
1 parent fcf7d53 commit 036afec

30 files changed

+143
-143
lines changed

guides/angular.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ npm install -g {{ PACKAGE_NAME }}/cli
6060
#### 2. Run the following in the root folder of your project. This will configure your project for {{ PRODUCT_NAME }}.
6161

6262
```bash
63-
xdn init
63+
{{ CLI_NAME }} init
6464
```
6565

6666
This will automatically add all of the required dependencies and files to your project. These include:
@@ -73,14 +73,14 @@ This will automatically add all of the required dependencies and files to your p
7373

7474
#### 3. Use the right angular project
7575

76-
If you have several projects and the `defaultProject` as specified in `angular.json` is not the project with the SSR build, specify the correct project with the `ANGULAR_PROJECT` environment variable. For example: `ANGULAR_PROJECT=my-ssr-project xdn build`.
76+
If you have several projects and the `defaultProject` as specified in `angular.json` is not the project with the SSR build, specify the correct project with the `ANGULAR_PROJECT` environment variable. For example: `ANGULAR_PROJECT=my-ssr-project {{ CLI_NAME }} build`.
7777

7878
## Routing
7979

80-
The default `routes.js` file created by `xdn init` sends all requests to Angular server via a fallback route.
80+
The default `routes.js` file created by `{{ CLI_NAME }} init` sends all requests to Angular server via a fallback route.
8181

8282
```js
83-
// This file was automatically added by xdn deploy.
83+
// This file was automatically added by {{ CLI_NAME }} deploy.
8484
// You should commit this file to source control.
8585

8686
const { Router } = require('{{ PACKAGE_NAME }}/core/router')
@@ -116,39 +116,39 @@ new Router()
116116
To test your app locally, run:
117117

118118
```bash
119-
xdn run
119+
{{ CLI_NAME }} run
120120
```
121121

122122
You can do a production build of your app and test it locally using:
123123

124124
```bash
125-
xdn build && xdn run --production
125+
{{ CLI_NAME }} build && {{ CLI_NAME }} run --production
126126
```
127127

128128
Setting `--production` runs your app exactly as it will be when deployed to the Moovweb cloud.
129129

130-
If you have several projects and the `defaultProject` in `angular.json` is not the project you would like to deploy, specify the correct project by setting the `ANGULAR_PROJECT` environment variable when running `xdn run`.
130+
If you have several projects and the `defaultProject` in `angular.json` is not the project you would like to deploy, specify the correct project by setting the `ANGULAR_PROJECT` environment variable when running `{{ CLI_NAME }} run`.
131131

132132
For example:
133133

134134
```
135-
ANGULAR_PROJECT=my-project xdn run
135+
ANGULAR_PROJECT=my-project {{ CLI_NAME }} run
136136
```
137137

138138
## Deploying
139139

140140
Deploying requires an account on {{ PRODUCT_NAME }}. [Sign up here for free.](https://moovweb.app/signup) Once you have an account, you can deploy to {{ PRODUCT_NAME }} by running the following in the root folder of your project:
141141

142142
```bash
143-
xdn deploy
143+
{{ CLI_NAME }} deploy
144144
```
145145

146-
If you have several projects and the `defaultProject` in `angular.json` is not the project you would like to deploy, specify the correct project by setting the `ANGULAR_PROJECT` environment variable when running `xdn deploy`.
146+
If you have several projects and the `defaultProject` in `angular.json` is not the project you would like to deploy, specify the correct project by setting the `ANGULAR_PROJECT` environment variable when running `{{ CLI_NAME }} deploy`.
147147

148148
For example:
149149

150150
```
151-
ANGULAR_PROJECT=my-project xdn deploy
151+
ANGULAR_PROJECT=my-project {{ CLI_NAME }} deploy
152152
```
153153

154154
See [deploying](deploying) for more information.

guides/caching.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The response was not cached because it was received during the brief time (less
271271
By default, caching is turned off during development. This is done to ensure that developers don't see stale responses after making changes to their code or other upstream APIs. You can enable caching during development by running your app with:
272272

273273
```bash
274-
xdn dev --cache
274+
{{ CLI_NAME }} dev --cache
275275
```
276276

277277
The cache will automatically be cleared when you make changes to your router. A few aspects of caching are not yet supported during local development:
@@ -288,14 +288,14 @@ The cache is automatically cleared when you deploy to an environment. You can al
288288
The cache can be [cleared via the CLI](/guides/cli#section_cache_clear):
289289

290290
```bash
291-
$ xdn cache-clear --team=my-team --site=my-site --environment=production --path=/p/*
291+
$ {{ CLI_NAME }} cache-clear --team=my-team --site=my-site --environment=production --path=/p/*
292292
```
293293

294294
The cache can also be [cleared via the REST API](/guides/rest_api#section_clear_cache).
295295

296296
## Static prerendering after clearing the cache
297297

298-
If you have [static prerendering] enabled, the cache will automatically be repopulated when you clear all entries from the cache (when you select "Purge all entries" in {{ PRODUCT_NAME }} Developer Console or run `xdn cache-clear` without providing `--path` or `--surrogate-key`). You can view the prerendering progress by clicking on the active deployment for the environment that was cleared.
298+
If you have [static prerendering] enabled, the cache will automatically be repopulated when you clear all entries from the cache (when you select "Purge all entries" in {{ PRODUCT_NAME }} Developer Console or run `{{ CLI_NAME }} cache-clear` without providing `--path` or `--surrogate-key`). You can view the prerendering progress by clicking on the active deployment for the environment that was cleared.
299299

300300
## Preserving the cache when deploying a new version of your site
301301

@@ -343,11 +343,11 @@ These scripts assume that you have created environments called "production", "st
343343
```js
344344
"scripts": {
345345
...
346-
"clearcache:dev": "xdn cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=development --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
347-
"clearcache:stage": "xdn cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=staging --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
348-
"clearcache:prod": "xdn cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=production --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
349-
"clearcache:prod:pdps": "xdn cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=production --surrogate-key=pdp --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
350-
"clearcache:prod:plps": "xdn cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=production --surrogate-key=plp --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
346+
"clearcache:dev": "{{ CLI_NAME }} cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=development --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
347+
"clearcache:stage": "{{ CLI_NAME }} cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=staging --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
348+
"clearcache:prod": "{{ CLI_NAME }} cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=production --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
349+
"clearcache:prod:pdps": "{{ CLI_NAME }} cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=production --surrogate-key=pdp --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
350+
"clearcache:prod:plps": "{{ CLI_NAME }} cache-clear --team=myTeam --site=my{{ PRODUCT_NAME }}App --environment=production --surrogate-key=plp --token=${{ PRODUCT_NAME_LOWER }}_deploy_token",
351351
...
352352
},
353353
```

guides/cli.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Creates a build of your app optimized for production
3333
#### Example
3434

3535
```bash
36-
xdn build
36+
{{ CLI_NAME }} build
3737
```
3838

3939
### cache-clear
@@ -54,7 +54,7 @@ specified environment will be cleared.
5454
#### Example
5555

5656
```bash
57-
xdn cache-clear --team=my-team --site=my-site --environment=production --path=/p/*
57+
{{ CLI_NAME }} cache-clear --team=my-team --site=my-site --environment=production --path=/p/*
5858
```
5959

6060
### completion
@@ -64,19 +64,19 @@ Creates a script that provides autocompletion for {{ PRODUCT_NAME }} CLI command
6464
#### Example
6565

6666
```bash
67-
xdn completion
67+
{{ CLI_NAME }} completion
6868
```
6969

7070
#### Using ZSH
7171

7272
```bash
73-
xdn completion >> ~/.zshrc
73+
{{ CLI_NAME }} completion >> ~/.zshrc
7474
```
7575

7676
#### Using BASH
7777

7878
```bash
79-
xdn completion >> ~/.bashrc
79+
{{ CLI_NAME }} completion >> ~/.bashrc
8080
```
8181

8282
### deploy
@@ -105,7 +105,7 @@ Builds and deploys your site on {{ PRODUCT_NAME }}.
105105
#### Example
106106

107107
```bash
108-
xdn deploy my-team --environment=production
108+
{{ CLI_NAME }} deploy my-team --environment=production
109109
```
110110

111111
### docs
@@ -115,12 +115,12 @@ Open the {{ PRODUCT_NAME }} documentation in your browser.
115115
#### Example
116116

117117
```bash
118-
xdn docs
118+
{{ CLI_NAME }} docs
119119
```
120120

121121
### dev
122122

123-
Runs your project in development mode, simulating the {{ PRODUCT_NAME }} cloud environment. This command is a simplified version of `xdn run`, with only the --cache option being supported.
123+
Runs your project in development mode, simulating the {{ PRODUCT_NAME }} cloud environment. This command is a simplified version of `{{ CLI_NAME }} run`, with only the --cache option being supported.
124124

125125
#### Options
126126

@@ -131,7 +131,7 @@ Runs your project in development mode, simulating the {{ PRODUCT_NAME }} cloud e
131131
#### Example
132132

133133
```bash
134-
xdn dev
134+
{{ CLI_NAME }} dev
135135
```
136136

137137
### init
@@ -141,7 +141,7 @@ Run in an existing app to add all required packages and files need to publish yo
141141
#### Example
142142

143143
```bash
144-
xdn init
144+
{{ CLI_NAME }} init
145145
```
146146

147147
#### Options
@@ -157,7 +157,7 @@ Logs into {{ PRODUCT_NAME }} via the developer console.
157157
#### Example
158158

159159
```bash
160-
xdn login
160+
{{ CLI_NAME }} login
161161
```
162162

163163
### logout
@@ -167,30 +167,30 @@ Logs out of {{ PRODUCT_NAME }}
167167
#### Example
168168

169169
```bash
170-
xdn logout
170+
{{ CLI_NAME }} logout
171171
```
172172

173173
### run
174174

175-
Runs your app locally. Uses port 3000 by default. You can change this by setting the `PORT` environment variable. For example: `PORT=5000 xdn run`.
175+
Runs your app locally. Uses port 3000 by default. You can change this by setting the `PORT` environment variable. For example: `PORT=5000 {{ CLI_NAME }} run`.
176176

177177
#### Options
178178

179179
| Name | Description |
180180
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
181-
| `--production` | Runs a production build of your app, simulating the cloud environment. This can also be achieved by setting the NODE_ENV environment variable to `true`. You need to run `xdn build` first. |
181+
| `--production` | Runs a production build of your app, simulating the cloud environment. This can also be achieved by setting the NODE_ENV environment variable to `true`. You need to run `{{ CLI_NAME }} build` first. |
182182
| `--cache` | Enables caching during local development so that you can test the caching logic in your router. By default caching is turned off in local development to ensure you don't see stale responses as you make changes to your code. |
183183

184184
#### Example
185185

186186
```bash
187-
xdn run --production
187+
{{ CLI_NAME }} run --production
188188
```
189189

190190
Or to run a deployment bundle downloaded from {{ PRODUCT_NAME }} Developer Console, use:
191191

192192
```bash
193-
xdn run /path/to/bundle.zip
193+
{{ CLI_NAME }} run /path/to/bundle.zip
194194
```
195195

196196
Production mode is always used whe running downloaded bundles.
@@ -204,17 +204,17 @@ Switches the version of all {{ PACKAGE_NAME }}/\* packages in your project.
204204
To install a particular version:
205205

206206
```bash
207-
xdn use 1.45.0
207+
{{ CLI_NAME }} use 1.45.0
208208
```
209209

210210
To install the latest stable:
211211

212212
```bash
213-
xdn use latest
213+
{{ CLI_NAME }} use latest
214214
```
215215

216216
To install the latest preview:
217217

218218
```bash
219-
xdn use next
219+
{{ CLI_NAME }} use next
220220
```

guides/connectors.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# Connectors
22

3-
Connector packages help build and run your app within {{ PRODUCT_NAME }}. When you run `xdn init`, {{ PRODUCT_NAME }} CLI detects the framework used by your app and installs the corresponding connector package. For example, if you use Next.js, `{{ PACKAGE_NAME }}/next` will be installed. If no connector package exists for the framework that you use, you can still deploy to {{ PRODUCT_NAME }} by implementing the connector interface directly in your app.
3+
Connector packages help build and run your app within {{ PRODUCT_NAME }}. When you run `{{ CLI_NAME }} init`, {{ PRODUCT_NAME }} CLI detects the framework used by your app and installs the corresponding connector package. For example, if you use Next.js, `{{ PACKAGE_NAME }}/next` will be installed. If no connector package exists for the framework that you use, you can still deploy to {{ PRODUCT_NAME }} by implementing the connector interface directly in your app.
44

55
## Writing a connector
66

77
A {{ PRODUCT_NAME }} connector consists of four entry points:
88

9-
- `init.js` - Called when the user runs `xdn init`, adding resources to the project necessary for deploying on {{ PRODUCT_NAME }}. May also modify existing files with the project.
10-
- `dev.js` - Called when the user runs `xdn dev` to run their app in development mode.
11-
- `build.js` - Called when the user runs `xdn build` or `xdn deploy`. Builds the application, copying resources into the `.{{ PRODUCT_NAME_LOWER }}` directory, which is ultimately zipped and uploaded to {{ PRODUCT_NAME }}.
9+
- `init.js` - Called when the user runs `{{ CLI_NAME }} init`, adding resources to the project necessary for deploying on {{ PRODUCT_NAME }}. May also modify existing files with the project.
10+
- `dev.js` - Called when the user runs `{{ CLI_NAME }} dev` to run their app in development mode.
11+
- `build.js` - Called when the user runs `{{ CLI_NAME }} build` or `{{ CLI_NAME }} deploy`. Builds the application, copying resources into the `.{{ PRODUCT_NAME_LOWER }}` directory, which is ultimately zipped and uploaded to {{ PRODUCT_NAME }}.
1212
- `prod.js` - Starts the application server in {{ PRODUCT_NAME }} cloud's serverless environment.
1313

1414
These files should be placed in the root directory of your connector package.
1515

1616
## init.js
1717

18-
Called when the user runs `xdn init`. This entry point adds resources to the project necessary for deploying on {{ PRODUCT_NAME }}. It may also modify existing files within the project.
18+
Called when the user runs `{{ CLI_NAME }} init`. This entry point adds resources to the project necessary for deploying on {{ PRODUCT_NAME }}. It may also modify existing files within the project.
1919

20-
_Optional, if not provided, xdn init will add a default router and {{ CONFIG_FILE }} to the user's project._
20+
_Optional, if not provided, {{ CLI_NAME }} init will add a default router and {{ CONFIG_FILE }} to the user's project._
2121

2222
Example:
2323

@@ -27,7 +27,7 @@ const { join } = require('path')
2727
const { DeploymentBuilder } = require('{{ PACKAGE_NAME }}/core/deploy')
2828

2929
/**
30-
* Called when the user runs xdn init.
30+
* Called when the user runs {{ CLI_NAME }} init.
3131
*/
3232
export default async function init() {
3333
new DeploymentBuilder(process.cwd())
@@ -57,9 +57,9 @@ Additional files can be added beyond the ones listed above. They will be copied
5757

5858
## dev.js
5959

60-
Called when the user runs `xdn dev`. This entry point is responsible for starting the user's application in development mode. The `{{ PACKAGE_NAME }}/core` library provides a `createDevServer` function to help with this.
60+
Called when the user runs `{{ CLI_NAME }} dev`. This entry point is responsible for starting the user's application in development mode. The `{{ PACKAGE_NAME }}/core` library provides a `createDevServer` function to help with this.
6161

62-
_Optional, if not provided, xdn dev will simply start {{ PRODUCT_NAME }} in local development mode, but will not start a framework application server._
62+
_Optional, if not provided, {{ CLI_NAME }} dev will simply start {{ PRODUCT_NAME }} in local development mode, but will not start a framework application server._
6363

6464
Example:
6565

@@ -87,9 +87,9 @@ module.exports = function() {
8787

8888
## build.js
8989

90-
Exports a function that is called when you run `xdn build`. It is responsible for constructing the bundle that is deployed to the {{ PRODUCT_NAME }} cloud. This function typically uses `{{ PACKAGE_NAME }}/core/deploy/DeploymentBuilder` to stage the exploded bundle in the `.xdn` directory.
90+
Exports a function that is called when you run `{{ CLI_NAME }} build`. It is responsible for constructing the bundle that is deployed to the {{ PRODUCT_NAME }} cloud. This function typically uses `{{ PACKAGE_NAME }}/core/deploy/DeploymentBuilder` to stage the exploded bundle in the `.xdn` directory.
9191

92-
_Optional, and not needed in most cases. The xdn build command automatically creates a bundle that includes all static assets referenced in your routes file as well as the `prod` entry point mentioned above._
92+
_Optional, and not needed in most cases. The {{ CLI_NAME }} build command automatically creates a bundle that includes all static assets referenced in your routes file as well as the `prod` entry point mentioned above._
9393

9494
Example:
9595

@@ -170,7 +170,7 @@ To test your connector locally without publishing it to NPM:
170170
2. Create an `{{ CONFIG_FILE }}` file in the root directory of your project.
171171
3. Set the `connector` property to name of the connector package.
172172

173-
Now `xdn init`, `xdn dev`, `xdn build`, and `xdn deploy` commands will use the entry points in the connector, and your `prod.js` entrypoint will be used to serve requests in the {{ PRODUCT_NAME }} cloud.
173+
Now `{{ CLI_NAME }} init`, `{{ CLI_NAME }} dev`, `{{ CLI_NAME }} build`, and `{{ CLI_NAME }} deploy` commands will use the entry points in the connector, and your `prod.js` entrypoint will be used to serve requests in the {{ PRODUCT_NAME }} cloud.
174174

175175
## Implementing a connector directly within your project
176176

@@ -201,4 +201,4 @@ module.exports = {
201201
}
202202
```
203203

204-
Once the connector is in place, `xdn dev`, `xdn build`, and `xdn deploy` commands will use the entry points in the connector, and your `prod.js` entrypoint will be used to serve requests in the {{ PRODUCT_NAME }} cloud.
204+
Once the connector is in place, `{{ CLI_NAME }} dev`, `{{ CLI_NAME }} build`, and `{{ CLI_NAME }} deploy` commands will use the entry points in the connector, and your `prod.js` entrypoint will be used to serve requests in the {{ PRODUCT_NAME }} cloud.

0 commit comments

Comments
 (0)