From feec9db66d2fa625c264c6374824d89e9143d7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A1=E8=89=B2?= Date: Fri, 16 Jul 2021 16:37:06 +0800 Subject: [PATCH] release(12.0.0): release 12.0.0 (#1286) --- .github/workflows/deploy-site.yml | 3 +- .github/workflows/ssr.yml | 12 ++--- CHANGELOG.md | 23 +++++++++ Dockerfile.docs | 25 ++++++++-- docs/changelog.en-US.md | 50 ++++++++++++++++++- docs/changelog.zh-CN.md | 50 ++++++++++++++++++- docs/deploy.en-US.md | 6 +-- docs/deploy.zh-CN.md | 6 +-- docs/ie11.en-US.md | 2 +- docs/ie11.zh-CN.md | 2 +- package.json | 5 +- ...ts-site-ssr.sh => build-artifacts-site.sh} | 20 ++++++-- src/app/layout/header/header.component.ts | 2 +- 13 files changed, 177 insertions(+), 29 deletions(-) rename scripts/ci/{build-artifacts-site-ssr.sh => build-artifacts-site.sh} (91%) diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 75e6021e3..1a6f9c53e 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -17,8 +17,9 @@ jobs: # Copy dockerfile.docs & _nginx just only for ng-alain.com run: | npm run site:gen - node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod --base-href /delon/ + node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --base-href /delon/ npm run site:helper + npm run site:minify 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 diff --git a/.github/workflows/ssr.yml b/.github/workflows/ssr.yml index 34795563d..7a12417e2 100644 --- a/.github/workflows/ssr.yml +++ b/.github/workflows/ssr.yml @@ -4,6 +4,7 @@ on: push jobs: website: + if: "startsWith(github.event.commits[0].message, 'release')" runs-on: ubuntu-latest steps: - name: checkout @@ -16,9 +17,8 @@ jobs: run: | npm run ssr:build - - name: to-delon-builds - if: "startsWith(github.event.commits[0].message, 'release')" - run: | - bash ./scripts/ci/build-artifacts-site-ssr.sh - env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + # - name: to-delon-builds + # run: | + # bash ./scripts/ci/build-artifacts-site.sh -ssr + # env: + # ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb..3e1192d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +# [12.0.0](https://github.com/ng-alain/delon/compare/11.10.4...12.0.0) (2021-07-16) + + +### Features + +* **abc:notice-icon:** add `emptyText`, `title`, `description` support TemplateRef ([#1256](https://github.com/ng-alain/delon/issues/1256)) ([596ca40](https://github.com/ng-alain/delon/commit/596ca40c254e619dc868deced7d4f105fac2d797)) +* **abc:se,sv:** add `nz-divider` support ([#1283](https://github.com/ng-alain/delon/issues/1283)) ([46d6e3d](https://github.com/ng-alain/delon/commit/46d6e3d60a8903c4a71fc64efc5e8b2d596c3742)) +* **abc:st:** add autocomplete index ([#1284](https://github.com/ng-alain/delon/issues/1284)) ([5d8c017](https://github.com/ng-alain/delon/commit/5d8c01788e6f23853d83a67593b87ffee86bd2d4)) +* **cache:** add custom request ([#1253](https://github.com/ng-alain/delon/issues/1253)) ([084037e](https://github.com/ng-alain/delon/commit/084037e73c094636eb510565863e403259f264d1)) +* **chart:bar,mini-area,mini-bar:** add `color` in data ([#1279](https://github.com/ng-alain/delon/issues/1279)) ([1ea098d](https://github.com/ng-alain/delon/commit/1ea098daaeca6eedfb07f5f342052b1c3e3ffb6a)) +* **chart:echarts:** support resize ([#1263](https://github.com/ng-alain/delon/issues/1263)) ([9ac3a99](https://github.com/ng-alain/delon/commit/9ac3a99c85f773e63232b2723201b8888fbe5cf0)) +* **form:** add `property` property of `visibleIf` function ([#1281](https://github.com/ng-alain/delon/issues/1281)) ([980b8a5](https://github.com/ng-alain/delon/commit/980b8a528bbf59f474984994f6a7271a89cf70b6)) +* **theme:theme-btn:** add `deployUrl` property ([#1264](https://github.com/ng-alain/delon/issues/1264)) ([05ce8f2](https://github.com/ng-alain/delon/commit/05ce8f20f7c4b62d75c23e3b1013c8e9951034ff)) +* **theme:** add enabled of util classes ([#1280](https://github.com/ng-alain/delon/issues/1280)) ([273aeed](https://github.com/ng-alain/delon/commit/273aeedeb748f97163cd0282288a9947dc93d605)) +* **util:** add mobile number format starting with `16` ([#1282](https://github.com/ng-alain/delon/issues/1282)) ([cd98359](https://github.com/ng-alain/delon/commit/cd983593e05fbdcdb83cb155d6b5f7fbba435702)) + + +### Performance Improvements + +* use build-in `i18n` instead of `@ngx-translate/core` ([#1276](https://github.com/ng-alain/delon/issues/1276)) ([ba48cc3](https://github.com/ng-alain/delon/commit/ba48cc3f574837064940f720323351172dd4e3df)) + + + diff --git a/Dockerfile.docs b/Dockerfile.docs index 79aeeb1f6..d57bb0349 100644 --- a/Dockerfile.docs +++ b/Dockerfile.docs @@ -1,8 +1,25 @@ +# # SSR +# FROM node:lts as dist +# MAINTAINER authors="cipchk " + +# WORKDIR /usr/src/app +# RUN git clone --depth 1 --branch site https://github.com/ng-alain/delon-builds.git . + +# EXPOSE 80 +# CMD [ "node", "server/main.js" ] + + FROM node:lts as dist MAINTAINER authors="cipchk " +WORKDIR /dist +RUN git clone --depth 1 --branch gh-pages https://github.com/ng-alain/delon.git . \ + && sed -i 's/\/delon\//\//g' /dist/index.html \ + && sed -i 's/\/delon\//\//g' /dist/404.html +COPY _nginx _nginx -WORKDIR /usr/src/app -RUN git clone --depth 1 --branch site-ssr https://github.com/ng-alain/delon-builds.git . +FROM nginx:stable-alpine +RUN rm -rf /usr/share/nginx/html/* +COPY --from=dist /dist /usr/share/nginx/html +COPY --from=dist /dist/_nginx/default.conf /etc/nginx/conf.d/ -EXPOSE 80 -CMD [ "node", "server/main.js" ] +CMD ["nginx", "-g", "daemon off;"] diff --git a/docs/changelog.en-US.md b/docs/changelog.en-US.md index cd1f0b75f..81d4f09d0 100644 --- a/docs/changelog.en-US.md +++ b/docs/changelog.en-US.md @@ -14,6 +14,52 @@ NG-ALAIN strictly follows [Semantic Versioning 2.0.0](http://semver.org/lang/zh- --- -## Old Version +# [12.0.0](https://github.com/ng-alain/delon/compare/11.10.4...12.0.0) (2021-07-16) -All releases notes can be found [here](https://github.com/ng-alain/ng-alain/releases) +### Features + +* **abc:st:** add intellisense for `index` ([#1284](https://github.com/ng-alain/delon/issues/1284)) ([5d8c017](https://github.com/ng-alain/delon/commit/5d8c01788e6f23853d83a67593b87ffee86bd2d4)) +* **abc:notice-icon:** add `emptyText`, `title`, `description` support TemplateRef ([#1256](https://github.com/ng-alain/delon/issues/1256)) ([596ca40](https://github.com/ng-alain/delon/commit/596ca40c254e619dc868deced7d4f105fac2d797)) +* **abc:se,sv:** add `nz-divider` support ([#1283](https://github.com/ng-alain/delon/issues/1283)) ([46d6e3d](https://github.com/ng-alain/delon/commit/46d6e3d60a8903c4a71fc64efc5e8b2d596c3742)) +* **cache:** add custom request ([#1253](https://github.com/ng-alain/delon/issues/1253)) ([084037e](https://github.com/ng-alain/delon/commit/084037e73c094636eb510565863e403259f264d1)) +* **chart:bar,mini-area,mini-bar:** add `color` in data ([#1279](https://github.com/ng-alain/delon/issues/1279)) ([1ea098d](https://github.com/ng-alain/delon/commit/1ea098daaeca6eedfb07f5f342052b1c3e3ffb6a)) +* **chart:echarts:** support resize ([#1263](https://github.com/ng-alain/delon/issues/1263)) ([9ac3a99](https://github.com/ng-alain/delon/commit/9ac3a99c85f773e63232b2723201b8888fbe5cf0)) +* **form:** add `property` property of `visibleIf` function ([#1281](https://github.com/ng-alain/delon/issues/1281)) ([980b8a5](https://github.com/ng-alain/delon/commit/980b8a528bbf59f474984994f6a7271a89cf70b6)) +* **theme:theme-btn:** add `deployUrl` property ([#1264](https://github.com/ng-alain/delon/issues/1264)) ([05ce8f2](https://github.com/ng-alain/delon/commit/05ce8f20f7c4b62d75c23e3b1013c8e9951034ff)) +* **theme:** add enabled of util classes ([#1280](https://github.com/ng-alain/delon/issues/1280)) ([273aeed](https://github.com/ng-alain/delon/commit/273aeedeb748f97163cd0282288a9947dc93d605)) +* **util:** add mobile number format starting with `16` ([#1282](https://github.com/ng-alain/delon/issues/1282)) ([cd98359](https://github.com/ng-alain/delon/commit/cd983593e05fbdcdb83cb155d6b5f7fbba435702)) + +### Performance Improvements + +* use build-in `i18n` instead of `@ngx-translate/core` ([#1276](https://github.com/ng-alain/delon/issues/1276)) ([ba48cc3](https://github.com/ng-alain/delon/commit/ba48cc3f574837064940f720323351172dd4e3df)) + +### BREAKING CHANGES + +**DelonChartModule** +- Removed + +**WINDOW** +- Used `import { WINDOW } from '@delon/util/token';` instead + +**_currency** +- Used [price](https://ng-alain.com/util/pipes-currency/en?#price) pipe instead + +**_HttpClient.end** +- Used `cleanLoading` instead + +**ModalHelper.open, static** +- `open` used `create` instead +- `static` used `createStatic` instead + +**ScrollService** +- Used `import { ScrollService } from '{AT}delon/util/browser';` instead + +**Badges Class** +- Used `nz-tag` instead + +**AlainMockConfig.data** +- Used `DelonMockModule.forRoot({ data: {} })` instead + +## Old Versions + +All releases notes can be found [here](https://github.com/ng-alain/ng-alain/releases). diff --git a/docs/changelog.zh-CN.md b/docs/changelog.zh-CN.md index 62e90e883..9ed66597c 100644 --- a/docs/changelog.zh-CN.md +++ b/docs/changelog.zh-CN.md @@ -14,6 +14,52 @@ NG-ALAIN 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) --- -## 旧版本 +# [12.0.0](https://github.com/ng-alain/delon/compare/11.10.4...12.0.0) (2021-07-16) -旧版本的更新记录可以在 [Github](https://github.com/ng-alain/ng-alain/releases) 查看 +### Features + +* **abc:st:** 新增 `index` 支持智能代码补全 ([#1284](https://github.com/ng-alain/delon/issues/1284)) ([5d8c017](https://github.com/ng-alain/delon/commit/5d8c01788e6f23853d83a67593b87ffee86bd2d4)) +* **abc:notice-icon:** 新增 `emptyText`, `title`, `description` 支持 `TemplateRef` ([#1256](https://github.com/ng-alain/delon/issues/1256)) ([596ca40](https://github.com/ng-alain/delon/commit/596ca40c254e619dc868deced7d4f105fac2d797)) +* **abc:se,sv:** 新增对 `nz-divider` 支持,显示分隔线 ([#1283](https://github.com/ng-alain/delon/issues/1283)) ([46d6e3d](https://github.com/ng-alain/delon/commit/46d6e3d60a8903c4a71fc64efc5e8b2d596c3742)) +* **cache:** 新增自定义请求接口 ([#1253](https://github.com/ng-alain/delon/issues/1253)) ([084037e](https://github.com/ng-alain/delon/commit/084037e73c094636eb510565863e403259f264d1)) +* **chart:bar,mini-area,mini-bar:** 数据内新增 `color` 参数 ([#1279](https://github.com/ng-alain/delon/issues/1279)) ([1ea098d](https://github.com/ng-alain/delon/commit/1ea098daaeca6eedfb07f5f342052b1c3e3ffb6a)) +* **chart:echarts:** 支持跟随浏览器调整 ([#1263](https://github.com/ng-alain/delon/issues/1263)) ([9ac3a99](https://github.com/ng-alain/delon/commit/9ac3a99c85f773e63232b2723201b8888fbe5cf0)) +* **form:** `visibleIf` 参数增加 `property` 属性 ([#1281](https://github.com/ng-alain/delon/issues/1281)) ([980b8a5](https://github.com/ng-alain/delon/commit/980b8a528bbf59f474984994f6a7271a89cf70b6)) +* **theme:theme-btn:** 增加 `deployUrl` 属性 ([#1264](https://github.com/ng-alain/delon/issues/1264)) ([05ce8f2](https://github.com/ng-alain/delon/commit/05ce8f20f7c4b62d75c23e3b1013c8e9951034ff)) +* **theme:** 增加工具类开关 ([#1280](https://github.com/ng-alain/delon/issues/1280)) ([273aeed](https://github.com/ng-alain/delon/commit/273aeedeb748f97163cd0282288a9947dc93d605)) +* **util:** 增加手机号 `16` 开头格式 ([#1282](https://github.com/ng-alain/delon/issues/1282)) ([cd98359](https://github.com/ng-alain/delon/commit/cd983593e05fbdcdb83cb155d6b5f7fbba435702)) + +### Performance Improvements + +* 使用内置简易 `i18n` 替代 `@ngx-translate/core` ([#1276](https://github.com/ng-alain/delon/issues/1276)) ([ba48cc3](https://github.com/ng-alain/delon/commit/ba48cc3f574837064940f720323351172dd4e3df)) + +### BREAKING CHANGES + +**DelonChartModule** +- 已移除 + +**WINDOW** +- 使用 `import { WINDOW } from '@delon/util/token';` 替代 + +**_currency** +- 使用 [price](https://ng-alain.com/util/pipes-currency/en?#price) 管道替代 + +**_HttpClient.end** +- 使用 `cleanLoading` 替代 + +**ModalHelper.open, static** +- `open` 使用 `create` 替代 +- `static` 使用 `createStatic` 替代 + +**ScrollService** +- 使用 `import { ScrollService } from '{AT}delon/util/browser';` 替代 + +**Badges Class** +- 使用 `nz-tag` 替代 + +**AlainMockConfig.data** +- 使用 `DelonMockModule.forRoot({ data: {} })` 替代 + +## 历史版本 + +历史版本的更新记录可以在 [Github](https://github.com/ng-alain/ng-alain/releases) 查看。 diff --git a/docs/deploy.en-US.md b/docs/deploy.en-US.md index bd44b7f13..785a72e97 100644 --- a/docs/deploy.en-US.md +++ b/docs/deploy.en-US.md @@ -23,7 +23,7 @@ Avoid executing `ng build` when throw error **JavaScript heap out of memory**: ```json { "scripts": { - "build": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod" + "build": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build" } } ``` @@ -57,7 +57,7 @@ The default static resource reference path directly points to the directory wher If your static resource is deployed to another domain name (such as a separate CDN address), you can specify a CDN address with the `--deployUrl` parameter. ```bash -ng build --prod -deployUrl=//cdn.ng-alain.com/ +ng build -deployUrl=//cdn.ng-alain.com/ ``` The generated `index.html` with its `*.js`, `*.css` files will automatically refer to `//cdn.ng-alain.com/*.js`, `//cdn.ng-alain.com/*css`, respectively. @@ -140,4 +140,4 @@ Finally, add the `ports` node of `docker-compose.yml`: ### Container deployment -Refer to [Angular Container Deployment](https://zhuanlan.zhihu.com/p/35688938). \ No newline at end of file +Refer to [Angular Container Deployment](https://zhuanlan.zhihu.com/p/35688938). diff --git a/docs/deploy.zh-CN.md b/docs/deploy.zh-CN.md index 1c617319b..b1f4f2ffa 100644 --- a/docs/deploy.zh-CN.md +++ b/docs/deploy.zh-CN.md @@ -23,7 +23,7 @@ NG-ALAIN 本身是一个 Angular CLI 项目,因此也可以参照 [Build](http ```json { "scripts": { - "build": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod" + "build": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build" } } ``` @@ -57,7 +57,7 @@ npm run analyze:view 如果你的静态资源是部署到其他域名(例如独立的 cdn 地址),你可以透过 `-d` 参数指定一个 cdn 地址。 ```bash -ng build --prod -d=//cdn.ng-alain.com/ +ng build -d=//cdn.ng-alain.com/ ``` 这样生成的 `index.html` 内 `*.js`、`*.css` 会自动加上 `//cdn.ng-alain.com/*.js`。 @@ -140,4 +140,4 @@ NG-ALAIN 提供的 Dockerfile 文件相对于比较简单,而实际项目中 ### 容器部署 -参考 [Angular 容器部署](https://zhuanlan.zhihu.com/p/35688938)。 \ No newline at end of file +参考 [Angular 容器部署](https://zhuanlan.zhihu.com/p/35688938)。 diff --git a/docs/ie11.en-US.md b/docs/ie11.en-US.md index b1efe03e5..4b3511f75 100644 --- a/docs/ie11.en-US.md +++ b/docs/ie11.en-US.md @@ -13,7 +13,7 @@ Differential loading has been supported since Angular8, when differential loadin **And IE11 only supports the second bundle.** -By default, Angular will only generate this kind of differentiated build when `ng build --prod`. If the project needs deep support for IE, then additional configuration is required; for more details, please refer to the official website [Differential Loading](https://angular.io/guide/deployment#differential-loading). +By default, Angular will only generate this kind of differentiated build when `ng build`. If the project needs deep support for IE, then additional configuration is required; for more details, please refer to the official website [Differential Loading](https://angular.io/guide/deployment#differential-loading). At the same time, NG-ALAIN also provides a [plug-in IE](/cli/plugin#ie), so that the project supports the development of IE11. diff --git a/docs/ie11.zh-CN.md b/docs/ie11.zh-CN.md index d5036fc78..04686de15 100644 --- a/docs/ie11.zh-CN.md +++ b/docs/ie11.zh-CN.md @@ -13,7 +13,7 @@ type: Dev **而 IE11 只支持第二种。** -Angular 默认只会在 `ng build --prod` 时才会产生这种差异化构建,如果项目需要对IE深度的支持,那么需要额外的配置;有关更多细节请参考官网[差异加载](https://angular.cn/guide/deployment#differential-loading)章节。 +Angular 默认只会在 `ng build` 时才会产生这种差异化构建,如果项目需要对IE深度的支持,那么需要额外的配置;有关更多细节请参考官网[差异加载](https://angular.cn/guide/deployment#differential-loading)章节。 同时,NG-ALAIN 也提供一个快捷 [插件IE](/cli/plugin#ie),使项目支持IE11的开发。 diff --git a/package.json b/package.json index e4c3fea44..d40916254 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "delon", - "version": "12.0.0-beta.0", + "version": "12.0.0", "description": "Delon is a set of essential modules for NG-ALAIN.", "keywords": [ "delon", @@ -38,8 +38,9 @@ "analyze": "npm run ng-high-memory build -- --source-map", "analyze:view": "source-map-explorer src/dist/browser/*.js", "site:gen": "node scripts/site/main init && ng-alain-plugin-theme -t=themeCss && ng-alain-plugin-theme -t=colorLess", - "site:build": "npm run site:gen && npm run ng-high-memory build && npm run site:helper && node scripts/build/minify.js", + "site:build": "npm run site:gen && npm run ng-high-memory build && npm run site:helper && npm run site:minify", "site:helper": "bash scripts/ci/helper.sh", + "site:minify": "node scripts/build/minify.js", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --pkg package.json", "pre-publish": "node scripts/publish/publish.js && node scripts/publish/publish-scaffold.js", "publish:next": "bash scripts/publish/publish.sh -next", diff --git a/scripts/ci/build-artifacts-site-ssr.sh b/scripts/ci/build-artifacts-site.sh similarity index 91% rename from scripts/ci/build-artifacts-site-ssr.sh rename to scripts/ci/build-artifacts-site.sh index 8082af108..009de17a6 100755 --- a/scripts/ci/build-artifacts-site-ssr.sh +++ b/scripts/ci/build-artifacts-site.sh @@ -6,6 +6,15 @@ readonly thisDir=$(cd $(dirname $0); pwd) cd $(dirname $0)/../.. +SSR=false +for ARG in "$@"; do + case "$ARG" in + -ssr) + SSR=true + ;; + esac +done + commitSha=$(git rev-parse --short HEAD) commitAuthorName=$(git --no-pager show -s --format='%an' HEAD) commitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD) @@ -32,13 +41,18 @@ cp ${DIST}/browser/index.html ${DIST}/browser/404.html buildDir=${DIST}/publish rm -rf ${buildDir} mkdir -p ${buildDir} -cp -r ${DIST}/browser ${buildDir}/browser -cp -r ${DIST}/server ${buildDir}/server + +if [[ ${SSR} == true ]]; then + cp -r ${DIST}/browser ${buildDir}/browser + cp -r ${DIST}/server ${buildDir}/server +else + cp -r ${DIST}/browser ${buildDir} +fi cp ./Dockerfile.docs ${buildDir}/Dockerfile.docs packageRepo=delon-builds buildVersion=$(node -pe "require('./package.json').version") -branchName=${TRAVIS_BRANCH:-'site-ssr'} +branchName=${TRAVIS_BRANCH:-'site'} buildVersionName="${buildVersion}-${commitSha}" buildTagName="${branchName}-${commitSha}" diff --git a/src/app/layout/header/header.component.ts b/src/app/layout/header/header.component.ts index 07bc99aed..8b752235c 100644 --- a/src/app/layout/header/header.component.ts +++ b/src/app/layout/header/header.component.ts @@ -27,7 +27,7 @@ const pkg = require('../../../../package.json'); export class HeaderComponent implements AfterViewInit { private inited = false; isMobile: boolean; - oldVersionList = [`10.x`, `9.x`, `8.x`, `1.x`]; + oldVersionList = [`11.x`, `10.x`, `9.x`, `8.x`, `1.x`]; currentVersion = pkg.version; delonLibs: Array<{ name: string; default?: string }> = [ { name: 'theme' },