Skip to content

Commit

Permalink
build: remove networkEnv plugin instead of nnrm
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Nov 1, 2023
1 parent b904b9a commit e917656
Show file tree
Hide file tree
Showing 39 changed files with 71 additions and 247 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/dist/*/**": true,
"**/coverage/*/**": true
"**/coverage/*/**": true,
"**/.yarn/**": true
},
"editor.codeActionsOnSave": {
// For ESLint
Expand Down
19 changes: 8 additions & 11 deletions docs/faq.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ Two situations:
- Using `cnpm` to install dependencies, you will not be able to find style files. This is because `cnpm` is in the form of a soft link path, which causes the `ng-zorro-antd` folder name to change, so it is recommended to use the `yarn` install dependency package instead.
- The `ng-zorro-antd` version is too old to cause some components to fail to load into the appropriate style

### How to use Taobao source correctly?
### How to use other mirror?

The simplest is to use the [networkEnv](/cli/plugin#networkEnv) plugin.

Or manually repair:
Install the [nnrm](https://github.com/YunYouJun/nnrm/blob/main/README.zh-CN.md) plugin.

```bash
yarn config set registry https://registry.npmmirror.com
yarn config set sass_binary_site https://npmmirror.com/mirrors/node-sass
# restore
yarn config delete registry
yarn config delete sass_binary_site
# Install nnrm
npm install -g nnrm
# Switch Npm to Taobao mirror
nnrm use taobao
```

## Configuration
Expand Down Expand Up @@ -100,8 +97,8 @@ Online documents will only retain the data of the last three major version numbe
```bash
git clone --depth 1 -b full https://github.com/ng-alain/archive-docs.git ng-alain-doc
cd ng-alain-doc
yarn
yarn start
npm install
npm start
```

### Fix the abnormal display of the lower part of the 360 browser
Expand Down
19 changes: 8 additions & 11 deletions docs/faq.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ bash delon.sh
- 使用 `cnpm` 安装依赖包,会遇到无法找到样式文件。这是由于 `cnpm` 采用的是软链接路径形式,导致 `ng-zorro-antd` 文件夹名有所变动,因此建议改用 `yarn` 安装依赖包,如果是网络因素,请参考下方的如何正确使用淘宝源。
- `ng-zorro-antd` 版本过旧导致部分组件无法加载到相应样式

### 如何正确使用淘宝源
### 如何使用其他镜像源

最简单是使用 [networkEnv](/cli/plugin#networkEnv) 插件。

或手动修复:
安装 [nnrm](https://github.com/YunYouJun/nnrm/blob/main/README.zh-CN.md) 插件。

```bash
yarn config set registry https://registry.npmmirror.com
yarn config set sass_binary_site https://npmmirror.com/mirrors/node-sass
# 恢复
yarn config delete registry
yarn config delete sass_binary_site
# 安装 nnrm
npm install -g nnrm
# 将Npm切换至淘宝源(不同 npm 源管理器命令有点不一样,更多细节请参考 nnrm 文档)
nnrm use taobao
```

## 配置
Expand Down Expand Up @@ -100,8 +97,8 @@ yarn config delete sass_binary_site
```bash
git clone --depth 1 -b full https://github.com/ng-alain/archive-docs.git ng-alain-doc
cd ng-alain-doc
yarn
yarn start
npm install
npm start
```

### 修复360浏览器下部分显示异常
Expand Down
16 changes: 8 additions & 8 deletions docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ You will need [node](http://nodejs.org/) and [git](https://git-scm.com/). The pr
Please make sure global Angular Cli is latest version via `ng version` command, please refer to [CLI Command Reference](https://angular.io/cli) for how to upgrade.

```bash
yarn global add @angular/cli
ng new my-project --style less --routing --package-manager yarn
npm install -g @angular/cli
ng new my-project --style less --routing
cd my-project
ng add ng-alain
yarn start
# Or use HMR mode by: yarn run hmr
npm start
# Or use HMR mode by: npm run hmr
```

> Please refer to [Schematics](/cli) for more details.
Expand All @@ -46,9 +46,9 @@ yarn start
```bash
git clone --depth=1 https://github.com/ng-alain/ng-alain.git my-project
cd my-project
yarn
yarn start
# Or use HMR mode by: yarn run hmr
npm install
npm start
# Or use HMR mode by: npm run hmr
```

> Note: Installing with the CLI is a clean scaffolding; using clone the git repository include all example pages.
Expand Down Expand Up @@ -89,7 +89,7 @@ NG-ALAIN is a standard Angular CLI project that includes common routes for admin
## Development

```bash
yarn start
npm start
```

This will automatically open [http://localhost:4200](http://localhost:4200). If you see the following page then you have succeeded.
Expand Down
25 changes: 11 additions & 14 deletions docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,38 @@ NG-ALAIN 是一个企业级中后台前端/设计解决方案脚手架,我们

## 环境搭建

Angular 开发环境至少需要安装 [Node.js](https://nodejs.org/en/download/)(Node.js 内置了 [npm](https://www.npmjs.com/get-npm) 无须单独安装,但**推荐使用** [Yarn](https://yarnpkg.com/) 但你需要单独额外安装)、[VSCode编辑器](https://code.visualstudio.com/),其中 Node.js 建议安装 **LTS** 版本,安装完成后可以通过终端窗口中运行:
Angular 开发环境至少需要安装 [Node.js](https://nodejs.org/en/download/)(Node.js 内置了 [npm](https://www.npmjs.com/get-npm) 无须单独安装)、[VSCode编辑器](https://code.visualstudio.com/),其中 Node.js 建议安装 **LTS** 版本,安装完成后可以通过终端窗口中运行:

```bash
node -v # 查看 Node.js 当前版本
yarn -v # 查看 Yarn 当前版本
npm -v # 查看 Npm 当前版本
```

Yarn 默认从国外源来下载包信息,鉴于国内环境因素,在开始下一步前先设定淘宝提供镜像
Npm 默认从国外源来下载包信息,鉴于国内环境因素,在开始下一步前先安装 [nnrm](https://github.com/YunYouJun/nnrm/blob/main/README.zh-CN.md) 并切换至淘宝镜像

```bash
yarn config set registry https://registry.npmmirror.com
yarn config set sass_binary_site https://npmmirror.com/mirrors/node-sass
# restore
yarn config delete registry
yarn config delete sass_binary_site
# 安装 nnrm
npm install -g nnrm
# 将Npm切换至淘宝源(不同 npm 源管理器命令有点不一样,更多细节请参考 nnrm 文档)
nnrm use taobao
```

> 也可以使用 [nrm](https://www.npmjs.com/package/nrm) 包,可以快速切换不同国内镜像源。
## 安装

### 全局 Angular Cli

安装之前请先确保本地已经安装全局 Angular Cli,只有这样才能随时随地在终端使用 `ng` 命令,可以通过终端窗口中运行:

```bash
yarn global add @angular/cli
npm install -g @angular/cli
```

### 创建NG-ALAIN项目

NG-ALAIN 必须先创建一个全新的 Angular 项目,可以通过终端窗口中运行:

```bash
ng new my-project --style less --routing --package-manager yarn
ng new my-project --style less --routing
```

> 如果你想了解 `--style``--routing` 参数,请参考 [ng new](https://angular.io/cli/new#options) 文档。
Expand All @@ -63,13 +60,13 @@ NG-ALAIN 会询问是否需要一些额外的插件,一开始完全可以一
> ```bash
> git clone --depth=1 https://github.com/ng-alain/ng-alain.git my-project
> cd my-project
> yarn install
> npm install
> ```
### 运行
```bash
yarn start
npm start
```
启动完成后会打开浏览器访问 [http://localhost:4200](http://localhost:4200),若你看到如下页面则代表成功了。
Expand Down
4 changes: 2 additions & 2 deletions docs/import.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In addition to the NG-ALAIN base component and the @delon business component, so
### Installing dependencies

```bash
yarn add ngx-tinymce
npm i -S ngx-tinymce
```

### Import module
Expand Down Expand Up @@ -55,7 +55,7 @@ Referencing a non-Angular component is actually loading a JavaScript class libra
### Installing dependencies

```bash
yarn add qrious
npm i -S qrious
```

### Import Scripts
Expand Down
4 changes: 2 additions & 2 deletions docs/import.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type: Dev
### 安装依赖包

```bash
yarn add ngx-tinymce
npm i -S ngx-tinymce
```

### 注册
Expand Down Expand Up @@ -55,7 +55,7 @@ export class AppModule { }
### 安装依赖包

```bash
yarn add qrious
npm i -S qrious
```

### 导入脚本
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/count-down/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The countdown component depends on [ngx-countdown](https://github.com/cipchk/ngx
## Dependencies

```
yarn add ngx-countdown
npm i -S ngx-countdown
```

## API
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/count-down/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module: import { CountDownModule } from '@delon/abc/count-down';
## 依赖

```
yarn add ngx-countdown
npm i -S ngx-countdown
```

## API
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/pdf/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pdf.js libary is lazy loading by default,you can change the default root CDN p
**Use local path**

```bash
yarn add pdfjs-dist
npm i -S pdfjs-dist
```

```json
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/pdf/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module: import { PdfModule } from '@delon/abc/pdf';
**使用本地路径**

```bash
yarn add pdfjs-dist
npm i -S pdfjs-dist
```

```json
Expand Down
2 changes: 1 addition & 1 deletion packages/acl/docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `ACLService` service class contains a set of methods based on role permissio
Install `@delon/acl`:

```bash
yarn add @delon/acl
npm i -S @delon/acl
```

Import `DelonACLModule` module:
Expand Down
2 changes: 1 addition & 1 deletion packages/acl/docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ACL 全称叫访问控制列表(Access Control List),是一种非常简单
安装 `@delon/acl` 依赖包:

```bash
yarn add @delon/acl
npm i -S @delon/acl
```

导入 `DelonACLModule` 模块:
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ There are currently two styles: Simple Web Token (using `SimpleTokenModel`) and
Install `@delon/auth`:

```bash
yarn add @delon/auth
npm i -S @delon/auth
```

Import `DelonAuthModule` to your AppModule.
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type: Documents
安装 `@delon/auth` 依赖包:

```bash
yarn add @delon/auth
npm i -S @delon/auth
```

导入 `DelonAuthModule` 模块:
Expand Down
2 changes: 1 addition & 1 deletion packages/cache/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cacheService.set('/data/unit', [ '个', '件' ]);
**安装**

```bash
yarn add @delon/cache
npm i -S @delon/cache
```

**注册**
Expand Down
2 changes: 1 addition & 1 deletion packages/form/docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This document uses the following conventions:
Install `@delon/form` from `yarn`.

```bash
yarn add @delon/form
npm i -S @delon/form
```

Import `DelonFormModule` in to your root `AppModule`.
Expand Down
2 changes: 1 addition & 1 deletion packages/form/docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type: Documents
安装 `@delon/form` 依赖包:

```bash
yarn add @delon/form
npm i -S @delon/form
```

导入 `DelonFormModule` 模块:
Expand Down
2 changes: 1 addition & 1 deletion packages/form/widgets-third/markdown/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Markdown Editor

Since the Markdown editor relies on a third-party plug-in [ngx-simplemde](https://github.com/cipchk/ngx-simplemde), the dependency should be installed first when using it

`yarn add ngx-simplemde`
`npm i -S ngx-simplemde`


**Import module**
Expand Down
2 changes: 1 addition & 1 deletion packages/form/widgets-third/markdown/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Markdown编辑器。

由于Markdown编辑器依赖第三方插件[ngx-simplemde](https://github.com/cipchk/ngx-simplemde),所以使用时应首先安装依赖

`yarn add ngx-simplemde`
`npm i -S ngx-simplemde`

**导入模块**

Expand Down
2 changes: 1 addition & 1 deletion packages/form/widgets-third/tinymce/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Tinymce rich text

Since the Tinymce editor relies on a third-party plug-in [ngx-tinymce](https://github.com/cipchk/ngx-tinymce), the dependency should be installed first when using it

`yarn add ngx-tinymce`
`npm i -S ngx-tinymce`


**Import module**
Expand Down
2 changes: 1 addition & 1 deletion packages/form/widgets-third/tinymce/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Tinymce富文本。

由于Tinymce编辑器依赖第三方插件[ngx-tinymce](https://github.com/cipchk/ngx-tinymce),所以使用时应首先安装依赖

`yarn add ngx-tinymce`
`npm i -S ngx-tinymce`

**导入模块**

Expand Down
2 changes: 1 addition & 1 deletion packages/mock/docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type: Documents
Install `@delon/mock` from `yarn`.

```bash
yarn add @delon/mock -D
npm i --save-dev @delon/mock
```

Please refer to [global-config.module.ts](https://github.com/ng-alain/ng-alain/blob/master/src/app/global-config.module.ts#L26-L30) import the [Mock Rule data](/mock/rule).
Expand Down
2 changes: 1 addition & 1 deletion packages/mock/docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Mock 是指通过生成模拟数据让前端开发人员独立于后端进行开
安装 `@delon/mock` 依赖包:

```bash
yarn add @delon/mock -D
npm i --save-dev @delon/mock
```

参考 [global-config.module.ts](https://github.com/ng-alain/ng-alain/blob/master/src/app/global-config.module.ts#L26-L30) 导入[Mock 规则数据](/mock/rule)
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/docs/customize-theme.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Note: Make sure theme variables exist in global styles, not in component scope s
1. Install Dependencies

```bash
yarn add ng-alain-plugin-theme -D
npm i --save-dev ng-alain-plugin-theme
```

> [ng-alain-plugin-theme](https://github.com/ng-alain/plugin-theme) is to generate `color.less` and theme CSS files for NG-ALAIN.
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/docs/customize-theme.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Ant Design 的样式使用了 [Less](http://lesscss.org/) 作为开发语言,
1. 安装依赖

```bash
yarn add ng-alain-plugin-theme -D
npm i --save-dev ng-alain-plugin-theme
```

> [ng-alain-plugin-theme](https://github.com/ng-alain/plugin-theme) 是专门针对 NG-ALAIN 生成 `color.less` 及主题CSS文件。
Expand Down
Loading

0 comments on commit e917656

Please sign in to comment.