Skip to content

Commit

Permalink
release: 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Dec 9, 2017
1 parent 6ecad15 commit 91b8ad3
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 25 deletions.
2 changes: 0 additions & 2 deletions docs/010-020-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ type: Advance

本次的变化对项目的改动其实不是很大,在开始阅读指引之前我建议先阅读入门指南序列文章(至少阅读 [关于 Delon](/docs/delon) 文章),这样会更好的理解为何我要这么做。

当前 `0.2` 是以[独立分支](//github.com/cipchk/ng-alain/tree/0.2.0)在存在,而 [ng-alain](//cipchk.github.io/ng-alain/) github预览已经是 `0.2` 版本了。

## 一、主题系统、服务、业务组件的变化

将这些公共性质转变成:`@delon/theme``@delon/abc``@delon/acl` 三个独立类库,这三个类库将保存同步版本号的更新(不管类库是否实际发生改变)。
Expand Down
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ title:
type: Other
---

### 0.2.0

`2017-12-09`

- 脚手架
- 重构:统一的表单校验编码风格
- @delon/theme
- 修复 `preloader`、IE下侧边框菜单样式问题,[#67](https://github.com/cipchk/ng-alain/pull/67) [@icycore](https://github.com/icycore)

### 0.2.0-beta.2

`2017-12-06`
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ There are two ways to install:
### Clone the Git Repository

```bash
$ git clone -b 0.2.0 --depth=1 //github.com/cipchk/ng-alain.git my-project
$ git clone --depth=1 //github.com/cipchk/ng-alain.git my-project
$ cd my-project
```

### Download the Package

Download [//github.com/cipchk/ng-alain/archive/0.2.0.zip](//github.com/cipchk/ng-alain/archive/0.2.0.zip), and un-archive.
Download [//github.com/cipchk/ng-alain/archive/master.zip](//github.com/cipchk/ng-alain/archive/master.zip), and un-archive.

## Scaffolding

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ ng-alain 是一个基于 ng-zorro-antd 的企业级中后台前端脚手架,
### 直接 clone git 仓库

```bash
$ git clone -b 0.2.0 --depth=1 //github.com/cipchk/ng-alain.git my-project
$ git clone --depth=1 //github.com/cipchk/ng-alain.git my-project
$ cd my-project
```

### 下载压缩包

点击 [//github.com/cipchk/ng-alain/archive/0.2.0.zip](//github.com/cipchk/ng-alain/archive/0.2.0.zip) 下载到本地后解压。
点击 [//github.com/cipchk/ng-alain/archive/master.zip](//github.com/cipchk/ng-alain/archive/master.zip) 下载到本地后解压。

## 目录结构

Expand Down
2 changes: 1 addition & 1 deletion docs/how-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ng-alain 的目录非常简单,只有简单几个文件;默认情况下,

> 很多情况下,可能你不需要这些功能,上述每个链接中都包含着如何去删除它们的方法。
我们知道,项目从启动开始就需要从远程获取到一些配置信息(例如:菜单数据、用户数据等),ng-alain 的启动始于 [startup.service.ts](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/core/services/startup.service.ts);它返回的是一个 `Promise` 对象,因此你可以在这个方法体内做你想做的事,默认情况下做了很多有意思的事:
我们知道,项目从启动开始就需要从远程获取到一些配置信息(例如:菜单数据、用户数据等),ng-alain 的启动始于 [startup.service.ts](//github.com/cipchk/ng-alain/blob/master/src/app/core/services/startup.service.ts);它返回的是一个 `Promise` 对象,因此你可以在这个方法体内做你想做的事,默认情况下做了很多有意思的事:

```ts
// 应用信息:包括站点名、描述、年份
Expand Down
6 changes: 3 additions & 3 deletions docs/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ type: Basic

| 类型 | 位置 | 描述 |
| ---- | --- | ---- |
| 基础 | [LayoutComponent](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/layout/layout.component.ts) | - |
| 全屏 | [LayoutFullScreenComponent](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/layout/fullscreen/fullscreen.component.ts) | - |
| PRO用户授权 | [ProUserLayoutComponent](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/layout/pro/user/user.component.ts) |[pro](//cipchk.github.io/ng-alain/#/pro/user/login) 用户相关 |
| 基础 | [LayoutComponent](//github.com/cipchk/ng-alain/blob/master/src/app/layout/layout.component.ts) | - |
| 全屏 | [LayoutFullScreenComponent](//github.com/cipchk/ng-alain/blob/master/src/app/layout/fullscreen/fullscreen.component.ts) | - |
| PRO用户授权 | [ProUserLayoutComponent](//github.com/cipchk/ng-alain/blob/master/src/app/layout/pro/user/user.component.ts) |[pro](//cipchk.github.io/ng-alain/#/pro/user/login) 用户相关 |

## 如何使用

Expand Down
10 changes: 5 additions & 5 deletions docs/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: Theme

菜单服务的数据格式是一个 [Menu](//github.com/cipchk/delon/blob/master/src/core/theme/services/menu/menu.service.ts#L4) 数组,其中 `text` 属性表示菜单文本为必填项,而且本身并不受外部组件的影响(例如[sidebar-nav](/components/sidebar-nav)组件),这是因为菜单是贯穿整个项目必不可少的组成部分,而将其独立成一个服务可以更有效被使用,例如:动态生成导航、标题等。

**建议:** 在 Angular 启动服务([startup.service.ts](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/core/services/startup.service.ts))从远程获取到菜单数据后,调用 `add()` 方法。
**建议:** 在 Angular 启动服务([startup.service.ts](//github.com/cipchk/ng-alain/blob/master/src/app/core/services/startup.service.ts))从远程获取到菜单数据后,调用 `add()` 方法。

**API 接口**

Expand All @@ -33,17 +33,17 @@ type: Theme

项目配置项,包含应用[App](//github.com/cipchk/delon/blob/master/src/core/theme/services/settings/settings.service.ts#L13)、布局[Layout](//github.com/cipchk/delon/blob/master/src/core/theme/services/settings/settings.service.ts#L22)、用户信息[User](//github.com/cipchk/delon/blob/master/src/core/theme/services/settings/settings.service.ts#L6)三种类型。

**建议:** 在 Angular 启动服务([startup.service.ts](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/core/services/startup.service.ts))从远程获取到应用、用户数据后,调用 `setApp()``setUser()` 方法。
**建议:** 在 Angular 启动服务([startup.service.ts](//github.com/cipchk/ng-alain/blob/master/src/app/core/services/startup.service.ts))从远程获取到应用、用户数据后,调用 `setApp()``setUser()` 方法。

## TitleService

用于设置页面标题,一般需要配置路由变化一起使用,例如:[app.component.ts](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/app.component.ts#L29);而标题的数据来源于 `MenuService`
用于设置页面标题,一般需要配置路由变化一起使用,例如:[app.component.ts](//github.com/cipchk/ng-alain/blob/master/src/app/app.component.ts#L29);而标题的数据来源于 `MenuService`

**建议:** 在 Angular 启动服务([startup.service.ts](//github.com/cipchk/ng-alain/blob/0.2.0/src/app/core/services/startup.service.ts))从远程获取到应用数据后,设置 `prefix``suffix` 值来调整统一的标题前后缀。
**建议:** 在 Angular 启动服务([startup.service.ts](//github.com/cipchk/ng-alain/blob/master/src/app/core/services/startup.service.ts))从远程获取到应用数据后,设置 `prefix``suffix` 值来调整统一的标题前后缀。

## ThemesService

用于设置当前 ng-alain 主题颜色,默认提供 A-J 共十种颜色,除了调用 `setTheme()` 方法改变颜色系外,还要确保 [_alain-custom-variables.less](//github.com/cipchk/ng-alain/blob/0.2.0/src/styles/_alain-custom-variables.less) 中注册相应的颜色系样式。
用于设置当前 ng-alain 主题颜色,默认提供 A-J 共十种颜色,除了调用 `setTheme()` 方法改变颜色系外,还要确保 [_alain-custom-variables.less](//github.com/cipchk/ng-alain/blob/master/src/styles/_alain-custom-variables.less) 中注册相应的颜色系样式。

与之相对应的还有 `ColorsService` 用于获取这些颜色系。

Expand Down
2 changes: 1 addition & 1 deletion docs/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: Theme

## 如何覆盖参数

ng-alain 脚手架里有一个叫 [_alain-custom-variables.less](//github.com/cipchk/ng-alain/blob/0.2.0/src/styles/_alain-custom-variables.less) LESS文件,允许你在注册 ng-alain 主题样式**之前**重新覆盖参数数值,例如:开启强制所有 `ng-zorro-antd` 组件字号为 `14px`, 只需要前重新覆盖 `@focusing-enabled: true` 参数数值即可。
ng-alain 脚手架里有一个叫 [_alain-custom-variables.less](//github.com/cipchk/ng-alain/blob/master/src/styles/_alain-custom-variables.less) LESS文件,允许你在注册 ng-alain 主题样式**之前**重新覆盖参数数值,例如:开启强制所有 `ng-zorro-antd` 组件字号为 `14px`, 只需要前重新覆盖 `@focusing-enabled: true` 参数数值即可。

## 关于 ng-zorro-antd 字号问题

Expand Down
2 changes: 1 addition & 1 deletion docs/use-components-alone.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ import { AlainABCModule } from '@delon/abc';
组件会随着脚手架的更新而不断迭代,有任何问题和需求可以反馈到 [这里](//github.com/cipchk/ng-alain/issues)

- 最新版本:[![@delon/abc](//img.shields.io/npm/v/@delon/abc.svg?style=flat-square)](//www.npmjs.com/package/@delon/abc)
- [更新日志](//github.com/cipchk/ng-alain/releases)
- [更新日志](//ng-alain.com/docs/changelog)
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "delon",
"version": "0.2.0-beta.2",
"version": "0.2.0",
"typings": "index.d.ts",
"description": "Delon is a set of essential modules for ng-alain.",
"repository": {
Expand Down Expand Up @@ -80,8 +80,9 @@
"file-saver": "^1.3.3",
"marked": "^0.3.6",
"moment": "^2.19.2",
"ng-clipboard-antd": "^1.0.0",
"ng-tree-antd": "^2.0.2",
"ng-zorro-antd": "^0.6.1",
"ng-zorro-antd": "^0.6.3",
"ng-zorro-antd-extra": "^1.1.2",
"ngx-countdown": "^1.0.4",
"ngx-highlight-js": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion scaffold
7 changes: 7 additions & 0 deletions src/app/theme/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import { MenuService, ThemesService } from '@delon/theme';
@Component({
selector: 'app-theme',
template: `
<div class="aside">
<div class="aside-inner">
<div style="height: 1000px">
asdf
</div>
</div>
</div>
<nz-tree [nzNodes]="nodes" [nzCheckable]="true"></nz-tree>
`
})
Expand Down
2 changes: 1 addition & 1 deletion src/core/abc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@delon/abc",
"version": "0.2.0-beta.2",
"version": "0.2.0",
"description": "@delon/abc",
"main": "./bundles/abc.umd.js",
"module": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/core/acl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@delon/acl",
"version": "0.2.0-beta.2",
"version": "0.2.0",
"description": "@delon/acl",
"main": "./bundles/acl.umd.js",
"module": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/core/theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@delon/theme",
"version": "0.2.0-beta.2",
"version": "0.2.0",
"description": "@delon/theme",
"main": "./bundles/theme.umd.js",
"module": "./index.js",
Expand Down
5 changes: 3 additions & 2 deletions tools/gulp/utils/inline-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ function inlineStyle(content, urlResolver) {
const styleFile = urlResolver(styleUrl);
const styleContent = fs.readFileSync(styleFile, 'utf-8');
const shortenedStyle = styleContent
.replace(/([\n\r]\s*)+/gm, ' ')
.replace(/"/g, '\\"');
.replace(/([\n\r]\s*)+/gm, ' ')
.replace(/content: "([^"]+)"/g, 'content: "\\$1"')
.replace(/"/g, '\\"');
return `"${shortenedStyle}"`;
})
.join(',\n') +
Expand Down

0 comments on commit 91b8ad3

Please sign in to comment.