Skip to content

Commit

Permalink
chore: merge branch 'master' into feat-g2-5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Nov 29, 2023
2 parents b6d996e + 49a84a1 commit 87fbf0e
Show file tree
Hide file tree
Showing 665 changed files with 9,685 additions and 6,897 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ node_modules/

# yarn v2
.yarn

**/src/index.html
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = {
],
rules: {
'prettier/prettier': ['error', prettierConfig],
'jsdoc/newline-after-description': 1,
'@angular-eslint/component-selector': [
'off',
{
Expand Down Expand Up @@ -171,8 +170,7 @@ module.exports = {
'@angular-eslint/no-input-rename': 'off',
'prefer-const': 'off',
'max-len': 'off',
'deprecation/deprecation': 'warn',
'jsdoc/newline-after-description': 'off'
'deprecation/deprecation': 'warn'
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: build
run: |
yarn run site:build:ssr
yarn run site:build
cp ./src/dist/browser/index.html ./src/dist/browser/404.html
cp ./Dockerfile.docs ./src/dist/browser/Dockerfile.docs
cp -r ./_nginx/ ./src/dist/browser/_nginx
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.12.0
18.13.0
178 changes: 53 additions & 125 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Delon

<div align="center">

Delon is a set of essential modules for [ng-alain](https://ng-alain.com).
Delon is a set of essential modules for [NG-ALAIN](https://ng-alain.com).

[![Build Status](https://dev.azure.com/ng-alain/delon/_apis/build/status/delon-CI?branchName=master)](https://dev.azure.com/ng-alain/delon/_build/latest?definitionId=1&branchName=master)
[![Codecov](https://img.shields.io/codecov/c/github/ng-alain/delon.svg?style=flat-square)](https://codecov.io/gh/ng-alain/delon)
Expand Down
4 changes: 1 addition & 3 deletions _mock/user.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { MockStatusError, MockRequest } from '@delon/mock';
import { MockStatusError, MockRequest, r } from '@delon/mock';
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
// import * as Mock from 'mockjs';

const r = (min: number, max: number): number => Math.floor(Math.random() * (max - min + 1) + min);

export const USERS = {
// 支持值为 Object 和 Array
'GET /users': (req: MockRequest) => {
Expand Down
Binary file added _screenshot/data.webp
Binary file not shown.
80 changes: 21 additions & 59 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "src/dist/browser",
"outputPath": "src/dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.json",
"polyfills": "src/polyfills.ts",
"browser": "src/main.ts",
"tsConfig": "src/tsconfig.site.json",
"polyfills": [
"@webcomponents/custom-elements",
"@webcomponents/custom-elements/src/native-shim",
"zone.js"
],
"assets": [
"src/assets",
"src/manifest.json",
Expand Down Expand Up @@ -78,7 +82,14 @@
"date-fns",
"extend",
"aos"
]
],
"server": "src/main.server.ts",
"prerender": {
"routesFile": "scripts/site/route-paths.txt"
},
"ssr": {
"entry": "src/server.ts"
}
},
"configurations": {
"production": {
Expand All @@ -89,16 +100,12 @@
}
],
"outputHashing": "all",
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
"serviceWorker": "ngsw-config.json"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
"sourceMap": true
}
},
"defaultConfiguration": "production"
Expand All @@ -107,58 +114,13 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "site:build:production"
"buildTarget": "site:build:production"
},
"development": {
"browserTarget": "site:build:development"
"buildTarget": "site:build:development"
}
},
"defaultConfiguration": "development"
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "src/dist/server",
"main": "./src/server.ts",
"tsConfig": "src/tsconfig.server.json"
},
"configurations": {
"production": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"sourceMap": false,
"optimization": true
}
}
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "site:build",
"serverTarget": "site:server"
},
"configurations": {
"production": {
"browserTarget": "site:build:production",
"serverTarget": "site:server:production"
}
}
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"browserTarget": "site:build:production",
"serverTarget": "site:server:production",
"routesFile": "scripts/site/route-paths.txt"
},
"configurations": {
"production": {}
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ stages:
ACCESS_REPO: $(ACCESS_REPO)
ACCESS_TOKEN: $(ACCESS_TOKEN)
- script: |
yarn run site:build:ssr
yarn run site:build
displayName: 'Build site'
- script: |
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ng-alain-delon.surge.sh
Expand Down
29 changes: 13 additions & 16 deletions docs/architecture.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,22 @@ Schematic diagram of directory structure:
├── _mock # Mock Data rule
├── src
│   ├── app
│   │   ├── core # Core module
│   │   ├── core # Core
│   │   │   ├── i18n
│   │   │   ├── net
│   │   │   │   └── default.interceptor.ts # Default HTTP interceptor
│   │   │   ├── services
│   │   │   │   └── startup.service.ts # Initialize project configuration
│   │   │   └── core.module.ts # Core module file
│   │   │   └── index.ts # Core index.ts
│   │   ├── layout # Core layout
│   │   ├── routes
│   │   │   ├── ** # Business directory
│   │   │   ├── routes.module.ts # Service routing module
│   │   │   └── routes-routing.module.ts # Service routes registration
│   │   │   └── routes.ts # Service routes registration
│   │   ├── shared # Shared module
│   │   │   ├── shared-delon.module.ts # @Delon/* import of secondary shared modules
│   │   │   ├── shared-zorro.module.ts # NG-ZORRO import of secondary shared modules
│   │   │   └── shared.module.ts # Shared module file
│   │   │   ├── shared-imports.ts # A collection of frequently shared components
│   │   │   └── index.ts # Shared index.ts
│   │   ├── app.component.ts # Root component
│   │   └── app.module.ts # Root module
│   │   └── global-config.module.ts # @delon & ng-zorro global config
│   │   └── app.config.ts # Global config
│   ├── assets # Local static resource
│   ├── environments # Environment variable configuration
│   ├── styles # Style directory
Expand All @@ -96,9 +93,9 @@ The following is a description and use of each directory and file.

The Mock data rules directory, if you create a project via [Command Line Tools](/cli), you can specify the `--mock` parameter to determine if the Mock function is required.

**src/app/core/core.module.ts**
**src/app/core/index.ts**

The core module will only be imported once. Therefore, core service classes (eg, messages, data access, etc.) that are required for the entire ** business module should exist here.
Some core business services (for example: messaging, data access, etc.)

**src/app/core/i18n**

Expand All @@ -108,7 +105,7 @@ The core module will only be imported once. Therefore, core service classes (eg,

The default interceptor, where you can handle request parameters, request exceptions, business exceptions, and so on.

**src/app/core/services/startup.service.ts**
**src/app/core/startup/startup.service.ts**

Useful when you need to execute some remote data (eg application information, user information, etc.) before Angular launches.

Expand All @@ -122,13 +119,13 @@ Layout file code, refer to the page structure section.

Business module, all your business code will be here.

**src/app/shared/shared.module.ts**
**src/app/shared/index.ts**

The shared module means that some third-party modules, custom components, and custom instructions that you need to use for the entire business module should exist here. In addition, for @delon & NG-ZORRO, two shared secondary module imports, `shared-delon.module.ts` and` shared-zorro.module.ts`.
A collection of some frequently shared components, The means that some third-party modules, custom components, and custom instructions that you need to use for the entire business module should exist here. In addition, for @delon & NG-ZORRO, two shared secondary module imports, `shared-delon.module.ts` and` shared-zorro.module.ts`.

**src/app/global-config.module.ts**
**src/app/app.config.ts**

Global configuration for @delon & NG-ZORRO.
Global configuration for project.

**src/environments**

Expand Down
25 changes: 11 additions & 14 deletions docs/architecture.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,22 @@ NG-ALAIN 目标是提供更多通用性业务模块,让开发者更加专注
├── angular.json # Angular 项目配置文件
├── src
│   ├── app
│   │   ├── core # 核心模块
│   │   ├── core # 核心
│   │   │   ├── i18n
│   │   │   ├── net
│   │   │   │   └── default.interceptor.ts # 默认HTTP拦截器
│   │   │   ├── services
│   │   │   │   └── startup.service.ts # 初始化项目配置
│   │   │   └── core.module.ts # 核心模块文件
│   │   │   └── index.ts # 核心导出
│   │   ├── layout # 通用布局
│   │   ├── routes
│   │   │   ├── ** # 业务目录
│   │   │   ├── routes.module.ts # 业务路由模块
│   │   │   └── routes-routing.module.ts # 业务路由注册口
│   │   ├── shared # 共享模块
│   │   │   ├── shared-delon.module.ts # @Delon/* 次级共享模块导入
│   │   │   ├── shared-zorro.module.ts # NG-ZORRO 次级共享模块导入
│   │   │   └── shared.module.ts # 共享模块文件
│   │   │   └── routes.ts # 业务路由
│   │   ├── shared # 共享
│   │   │   ├── shared-imports.ts # 一些高频率共享组件的集合
│   │   │   └── index.ts # 共享导出
│   │   ├── app.component.ts # 根组件
│   │   └── app.module.ts # 根模块
│   │   └── global-config.module.ts # @delon & ng-zorro 全局配置项
│   │   └── app.config.ts # 全局配置项
│   ├── assets # 本地静态资源
│   ├── environments # 环境变量配置
│   ├── styles # 样式目录
Expand All @@ -65,12 +62,12 @@ NG-ALAIN 目标是提供更多通用性业务模块,让开发者更加专注
|----|----|
| **angular.json** | Angular 工作区及项目的配置文件,参考[Angular文档](https://angular.cn/guide/workspace-config) |
| **_mock** | Mock 数据规则目录,若你通过 [命令行工具](/cli) 创建项目时可以指定 `--mock` 参数决定是否需要 Mock 功能 |
| **src/app/core/core.module.ts** | 核心模块,只会导入一次。因此,针对整个**业务模块都需要**使用的纯服务类(例如:消息、数据访问等) |
| **src/app/core/index.ts** | 一些核心业务服务(例如:消息、数据访问等) |
| **src/app/core/i18n** | [国际化](/docs/i18n)数据加载及处理相关类,若你通过 [命令行工具](/cli) 创建项目时可以指定 `-di` 参数决定是否需要国际化支持 |
| **src/app/core/net** | 默认拦截器,你可以在这里统一处理请求参数、请求异常、业务异常等动作 |
| **src/app/core/services/startup.service.ts** | 当你需要在 Angular 启动前执行一些远程数据(例如:应用信息、用户信息等)时非常有用 |
| **src/app/core/startup/startup.service.ts** | 当你需要在 Angular 启动前执行一些远程数据(例如:应用信息、用户信息等)时非常有用 |
| **src/app/layout** | 布局目录,包含基础布局、空白布局、用户登录布局 |
| **src/app/routes** | 业务模块,你的所有业务代码都将在这里 |
| **src/app/shared/shared.module.ts** | 共享模块,指当你需要针对整个**业务模块都需要**使用的一些第三方模块、自定义组件、自定义指令,都应该存在这里。除此之外,针对 @delon & NG-ZORRO 分别构建了 `shared-delon.module.ts``shared-zorro.module.ts` 两种次级共享模块的导入。 |
| **src/app/global-config.module.ts** | 针对 @delon & NG-ZORRO 的全局配置项 |
| **src/app/shared/index.ts** | 一些高频率共享组件的集合,指当你需要针对整个**业务模块都需要**使用的一些第三方模块、自定义组件、自定义指令,都应该存在这里。除此之外,针对 @delon & NG-ZORRO 分别构建了 `shared-delon.module.ts``shared-zorro.module.ts` 两种次级共享模块的导入。 |
| **src/app/app.config.ts** | 项目全局配置项 |
| **src/environments** | 应用环境变量,包含以下值:`SERVER_URL` 所有HTTP请求的前缀;`production` 是否生产环境;`useHash` 路由是否useHash模式 |
Loading

0 comments on commit 87fbf0e

Please sign in to comment.