Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Oct 20, 2023
1 parent 4f3cd74 commit 984c9f8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
12 changes: 12 additions & 0 deletions docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ yarn start
# Or use HMR mode by: yarn run hmr
```

**Multiple projects**

```bash
yarn global add @angular/cli
ng new my-workspace --no-create-application --package-manager yarn
cd my-workspace
ng g application mgr --style less --routing
ng add ng-alain
yarn mgr:start
# Or use HMR mode by: yarn run mgr:hmr
```

> Please refer to [Schematics](/cli) for more details.
### Clone the Git Repository
Expand Down
8 changes: 7 additions & 1 deletion docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,23 @@ NG-ALAIN 必须先创建一个全新的 Angular 项目,可以通过终端窗

```bash
ng new my-project --style less --routing --package-manager yarn
cd my-project
# 或多重项目
ng new my-workspace --no-create-application --package-manager yarn
cd my-workspace
ng g application mgr --style less --routing
```

> 如果你想了解 `--style``--routing` 参数,请参考 [ng new](https://angular.io/cli/new#options) 文档。
接下来只需要将 NG-ALAIN 添加到 `my-project` 项目中即可,在 `my-project` 目录下通过终端窗口中运行:

```bash
cd my-project
ng add ng-alain
```

> 若多重项目时,需要提供具体的项目名称。
NG-ALAIN 会询问是否需要一些额外的插件,一开始完全可以一路回车,这些插件都是可插拔,后期可以自行添加与移除。

> 以上只会生成干净的项目,可以直接用于生产环境中。你可能在[预览](https://ng-alain.gitee.io/)上看到许多示例页,它们全都可以在 [Github](https://github.com/ng-alain/ng-alain) 查看到源代码,当然也可以通过 Git 克隆代码的形式获得:
Expand Down
5 changes: 0 additions & 5 deletions schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ export default function (options: NgAddOptions): Rule {
if (pkg.devDependencies['ng-alain']) {
throw new SchematicsException(`Already an NG-ALAIN project and can't be executed again: ng add ng-alain`);
}
if (!tree.exists('src/index.html')) {
throw new SchematicsException(
`NG-ALAIN must be attached to a new Angular project, so you need to use 'ng new projectName' to build a new Angular project, or specify the project name to be attached`
);
}
}

let ngCoreVersion = pkg.dependencies['@angular/core'] as string;
Expand Down

0 comments on commit 984c9f8

Please sign in to comment.