Skip to content

Commit

Permalink
release(2.0.0-rc.2): release 2.0.0-rc.2 (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Nov 1, 2018
1 parent c617c5f commit 9d82edf
Show file tree
Hide file tree
Showing 12 changed files with 137 additions and 53 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
<a name="2.0.0-rc.2"></a>
# [2.0.0-rc.2](https://github.com/ng-alain/delon/compare/2.0.0-rc.1...2.0.0-rc.2) (2018-11-01)


### Bug Fixes

* **module:*:** safe html ([#239](https://github.com/ng-alain/delon/issues/239)) ([0298665](https://github.com/ng-alain/delon/commit/0298665))
* **module:form:** fix attempt to use a destroyed error ([#248](https://github.com/ng-alain/delon/issues/248)) ([3e470e7](https://github.com/ng-alain/delon/commit/3e470e7))
* **module:sf:** fix button spanLabelFixed is zero value ([#242](https://github.com/ng-alain/delon/issues/242)) ([1f601e2](https://github.com/ng-alain/delon/commit/1f601e2))
* **module:theme:** fix grey color values ([#249](https://github.com/ng-alain/delon/issues/249)) ([6234538](https://github.com/ng-alain/delon/commit/6234538))
* **module:theme:** fix ng-invalid style ([#243](https://github.com/ng-alain/delon/issues/243)) ([fe6d104](https://github.com/ng-alain/delon/commit/fe6d104))
* **schematics:** fix repeat alias name ([#247](https://github.com/ng-alain/delon/issues/247)) ([4f744fa](https://github.com/ng-alain/delon/commit/4f744fa))


### Features

* **module:mock:** support array params of queryString ([#246](https://github.com/ng-alain/delon/issues/246)) ([f0135ce](https://github.com/ng-alain/delon/commit/f0135ce))
* **module:st:** add icon of button ([#240](https://github.com/ng-alain/delon/issues/240)) ([1145d47](https://github.com/ng-alain/delon/commit/1145d47))
* **module:theme:** add recursive upward find in menu service ([#244](https://github.com/ng-alain/delon/issues/244)) ([c391d3a](https://github.com/ng-alain/delon/commit/c391d3a))
* **module:theme:i18n:** add i18n pipe ([#238](https://github.com/ng-alain/delon/issues/238)) ([423c9c3](https://github.com/ng-alain/delon/commit/423c9c3))



<a name="2.0.0-rc.1"></a>
# [2.0.0-rc.1](https://github.com/ng-alain/delon/compare/2.0.0-beta.5...2.0.0-rc.1) (2018-10-25)

Expand Down
20 changes: 20 additions & 0 deletions docs/changelog.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ title: Change Log
type: Other
---

## 2.0.0-rc.2

`2018-11-01`

### Bug Fixes

* **module:sf:** 修复 `attempt to use a destroyed` 异常 ([#248](https://github.com/ng-alain/delon/issues/248)) ([3e470e7](https://github.com/ng-alain/delon/commit/3e470e7))
* **module:sf:** 修复按钮 `spanLabelFixed``0` 时无效问题 ([#242](https://github.com/ng-alain/delon/issues/242)) ([1f601e2](https://github.com/ng-alain/delon/commit/1f601e2))
* **module:theme:** 修复错误的灰色系代码 ([#249](https://github.com/ng-alain/delon/issues/249)) ([6234538](https://github.com/ng-alain/delon/commit/6234538))
* **module:theme:** 修复 `ng-invalid` 样式风格 ([#243](https://github.com/ng-alain/delon/issues/243)) ([fe6d104](https://github.com/ng-alain/delon/commit/fe6d104))
* **schematics:** 修复 `-t` 重复别名导致无效问题 ([#247](https://github.com/ng-alain/delon/issues/247)) ([4f744fa](https://github.com/ng-alain/delon/commit/4f744fa))

### Features

* **module:mock:** QueryString 支持数组类型 ([#246](https://github.com/ng-alain/delon/issues/246)) ([f0135ce](https://github.com/ng-alain/delon/commit/f0135ce))
* **module:st:** 增加按钮 Icon ([#240](https://github.com/ng-alain/delon/issues/240)) ([1145d47](https://github.com/ng-alain/delon/commit/1145d47))
* **module:theme:MenuService** 增加向上查找能力 ([#244](https://github.com/ng-alain/delon/issues/244)) ([c391d3a](https://github.com/ng-alain/delon/commit/c391d3a))
* **module:theme:html:** 安全HTML,增加 `| html` 管道 ([#239](https://github.com/ng-alain/delon/issues/239)) ([0298665](https://github.com/ng-alain/delon/commit/0298665))
* **module:theme:i18n:** 增加 `| i18n` 管道 ([#238](https://github.com/ng-alain/delon/issues/238)) ([423c9c3](https://github.com/ng-alain/delon/commit/423c9c3))

## 2.0.0-rc.1

`2018-10-25`
Expand Down
21 changes: 21 additions & 0 deletions docs/changelog.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ title: 更新日志
type: Other
---

## 2.0.0-rc.2

`2018-11-01`

### Bug Fixes

* **module:sf:** fix attempt to use a destroyed error ([#248](https://github.com/ng-alain/delon/issues/248)) ([3e470e7](https://github.com/ng-alain/delon/commit/3e470e7))
* **module:sf:** fix button spanLabelFixed is zero value ([#242](https://github.com/ng-alain/delon/issues/242)) ([1f601e2](https://github.com/ng-alain/delon/commit/1f601e2))
* **module:theme:** fix grey color values ([#249](https://github.com/ng-alain/delon/issues/249)) ([6234538](https://github.com/ng-alain/delon/commit/6234538))
* **module:theme:** fix ng-invalid style ([#243](https://github.com/ng-alain/delon/issues/243)) ([fe6d104](https://github.com/ng-alain/delon/commit/fe6d104))
* **schematics:** fix repeat alias name ([#247](https://github.com/ng-alain/delon/issues/247)) ([4f744fa](https://github.com/ng-alain/delon/commit/4f744fa))

### Features

* **module:mock:** support array params of queryString ([#246](https://github.com/ng-alain/delon/issues/246)) ([f0135ce](https://github.com/ng-alain/delon/commit/f0135ce))
* **module:st:** add icon of button ([#240](https://github.com/ng-alain/delon/issues/240)) ([1145d47](https://github.com/ng-alain/delon/commit/1145d47))
* **module:theme:MenuService:** add recursive upward find in menu service ([#244](https://github.com/ng-alain/delon/issues/244)) ([c391d3a](https://github.com/ng-alain/delon/commit/c391d3a))
* **module:theme:html:** safe html, add `| html` pipe ([#239](https://github.com/ng-alain/delon/issues/239)) ([0298665](https://github.com/ng-alain/delon/commit/0298665))
* **module:theme:i18n:** add i18n pipe ([#238](https://github.com/ng-alain/delon/issues/238)) ([423c9c3](https://github.com/ng-alain/delon/commit/423c9c3))


## 2.0.0-rc.1

`2018-10-25`
Expand Down
32 changes: 15 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "delon",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"typings": "index.d.ts",
"description": "Delon is a set of essential modules for ng-alain.",
"repository": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"@antv/data-set": "^0.9.5",
"@antv/g2": "^3.2.7",
"@antv/g2-plugin-slider": "^2.0.2",
"@ngx-translate/core": "^10.0.1",
"@ngx-translate/core": "^11.0.0",
"@stackblitz/sdk": "^1.2.0",
"ajv": "^6.4.0",
"core-js": "^2.5.4",
Expand All @@ -58,7 +58,7 @@
"ng-github-button": "^1.0.0",
"ng-zorro-antd": "^1.8.0",
"ng2-ace-editor": "^0.3.8",
"ngx-color": "^1.3.1",
"ngx-color": "^2.0.5",
"ngx-countdown": "^3.0.0",
"ngx-highlight-js": "^2.0.0",
"ngx-simplemde": "^1.1.1",
Expand All @@ -76,9 +76,7 @@
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@angularclass/hmr": "^2.1.3",
"@bazel/ibazel": "^0.5.0",
"@schematics/schematics": "~0.8.0",
"@types/chalk": "^0.4.31",
"@types/deep-extend": "^0.4.31",
"@types/extend": "^3.0.0",
"@types/fs-extra": "^5.0.1",
Expand All @@ -90,41 +88,41 @@
"@types/node": "~8.9.4",
"@types/parse5": "^5.0.0",
"antd-theme-generator": "^1.1.3",
"chalk": "^1.1.3",
"chalk": "^2.4.1",
"codecov": "^3.1.0",
"codelyzer": "~4.3.0",
"codelyzer": "^4.5.0",
"conventional-changelog-cli": "^2.0.5",
"domhandler": "^2.4.2",
"editorconfig-tools": "^0.1.1",
"fs-extra": "^7.0.0",
"gh-pages": "^1.2.0",
"gh-pages": "^2.0.1",
"htmlparser2": "^3.9.2",
"husky": "^1.1.0",
"jasmine-core": "~2.99.1",
"jasmine-core": "~3.3.0",
"jasmine-spec-reporter": "~4.2.1",
"jsonml.js": "^0.1.0",
"karma": "~3.0.0",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"klaw-sync": "^5.0.0",
"karma-jasmine-html-reporter": "^1.4.0",
"klaw-sync": "^6.0.0",
"less-plugin-clean-css": "^1.5.1",
"lint-staged": "^7.1.0",
"lint-staged": "^8.0.4",
"mark-twain": "^2.0.3",
"mockjs": "^1.0.1-beta3",
"mustache": "^2.3.0",
"mustache": "^3.0.0",
"ng-packagr": "^4.1.1",
"parse5": "^5.0.0",
"prettier": "^1.14.1",
"prettier-stylelint": "^0.4.2",
"protractor": "~5.4.0",
"readline-sync": "^1.4.9",
"rollup": "^0.58.2",
"rollup": "^0.66.6",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^5.0.0",
"rollup-plugin-uglify": "^6.0.0",
"stream": "0.0.2",
"stylelint": "^9.2.0",
"stylelint-config-standard": "^18.2.0",
Expand All @@ -133,7 +131,7 @@
"tslint-config-prettier": "^1.12.0",
"tslint-language-service": "^0.9.9",
"typescript": "~2.9.2",
"webpack-bundle-analyzer": "^2.13.0",
"webpack-bundle-analyzer": "^3.0.3",
"xlsx": "^0.14.0"
},
"husky": {
Expand Down
1 change: 1 addition & 0 deletions packages/abc/lodop/lodop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ describe('abc: lodop', () => {
const code = `LODOP.PRINT_INITA(0, 0, 100, 100, 'test');`;
let isPrintError = false;
beforeEach(() => {
isPrintError = false;
genModule(cog);
mockLodop = {
SET_LICENSES: jasmine.createSpy('SET_LICENSES'),
Expand Down
8 changes: 5 additions & 3 deletions packages/abc/xlsx/xlsx.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { LazyService } from '@delon/util';
import { LazyService, deepCopy } from '@delon/util';
import { HttpClient } from '@angular/common/http';
import { of, throwError } from 'rxjs';
import { Component, DebugElement } from '@angular/core';
Expand All @@ -8,9 +8,11 @@ import * as fs from 'file-saver';
import { XlsxModule } from './xlsx.module';
import { XlsxService } from './xlsx.service';
import { XlsxExportOptions } from './xlsx.types';
import { HttpClientTestingModule } from '@angular/common/http/testing';

class MockLazyService {
load() {
(window as any).XLSX = deepCopy(DEFAULTMOCKXLSX);
return Promise.resolve();
}
}
Expand Down Expand Up @@ -43,7 +45,6 @@ const DEFAULTMOCKXLSX = {
let isErrorRequest = false;
class MockHttpClient {
request() {
(window as any).XLSX = DEFAULTMOCKXLSX;
return isErrorRequest ? throwError(null) : of(null);
}
}
Expand All @@ -52,7 +53,7 @@ describe('abc: xlsx', () => {
let srv: XlsxService;
function genModule() {
const injector = TestBed.configureTestingModule({
imports: [XlsxModule.forRoot()],
imports: [XlsxModule.forRoot(), HttpClientTestingModule],
declarations: [TestComponent],
providers: [
{ provide: HttpClient, useClass: MockHttpClient },
Expand Down Expand Up @@ -114,6 +115,7 @@ describe('abc: xlsx', () => {
describe('[#export]', () => {
beforeEach(() => {
spyOn(fs.default, 'saveAs');
genModule();
});
it('should be export xlsx via array', (done: () => void) => {
srv
Expand Down
1 change: 1 addition & 0 deletions packages/mock/src/mock.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ describe('mock: service', () => {
});

it('#clearCache', () => {
genModule({ data: DATA });
srv.clearCache();
const rule = srv.getRule('POST', '/users/1');
expect(rule).toBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {green, red} from 'chalk';
import {RuleFailure, Rules, RuleWalker} from 'tslint';
import chalk from 'chalk';
import { RuleFailure, Rules, RuleWalker } from 'tslint';
import * as ts from 'typescript';
import {
isExportSpecifierNode,
Expand All @@ -18,21 +18,19 @@ import {
isDelonExportDeclaration,
isDelonImportDeclaration,
} from '../../typescript/module-specifiers';
import {getUpgradeDataFromWalker} from '../../upgrade-data';
import { getUpgradeDataFromWalker } from '../../upgrade-data';

/**
* Rule that walks through every identifier that is part of Angular Material or thr CDK
* and replaces the outdated name with the new one if specified in the upgrade data.
*/
export class Rule extends Rules.AbstractRule {

apply(sourceFile: ts.SourceFile): RuleFailure[] {
return this.applyWithWalker(new Walker(sourceFile, this.getOptions()));
}
}

export class Walker extends RuleWalker {

/** Change data that upgrades to the specified target version. */
data = getUpgradeDataFromWalker(this, 'classNames');

Expand All @@ -56,22 +54,31 @@ export class Walker extends RuleWalker {
// For namespace imports that are referring to`@delon/*`, we store the
// namespace name in order to be able to safely find identifiers that don't belong to the
// developer's application.
if (isNamespaceImportNode(identifier) && isDelonImportDeclaration(identifier)) {
if (
isNamespaceImportNode(identifier) &&
isDelonImportDeclaration(identifier)
) {
this.trustedNamespaces.add(identifier.text);

return this._createFailureWithReplacement(identifier);
}

// For export declarations that are referring to`@delon/*`, the identifier
// can be immediately updated to the new name.
if (isExportSpecifierNode(identifier) && isDelonExportDeclaration(identifier)) {
if (
isExportSpecifierNode(identifier) &&
isDelonExportDeclaration(identifier)
) {
return this._createFailureWithReplacement(identifier);
}

// For import declarations that are referring to`@delon/*`, the name of
// the import identifiers. This allows us to identify identifiers that belong to Material and
// the CDK, and we won't accidentally touch a developer's identifier.
if (isImportSpecifierNode(identifier) && isDelonImportDeclaration(identifier)) {
if (
isImportSpecifierNode(identifier) &&
isDelonImportDeclaration(identifier)
) {
this.trustedIdentifiers.add(identifier.text);

return this._createFailureWithReplacement(identifier);
Expand All @@ -82,7 +89,10 @@ export class Walker extends RuleWalker {
if (ts.isPropertyAccessExpression(identifier.parent)) {
const expression = identifier.parent.expression;

if (ts.isIdentifier(expression) && this.trustedNamespaces.has(expression.text)) {
if (
ts.isIdentifier(expression) &&
this.trustedNamespaces.has(expression.text)
) {
return this._createFailureWithReplacement(identifier);
}
} else if (this.trustedIdentifiers.has(identifier.text)) {
Expand All @@ -95,18 +105,26 @@ export class Walker extends RuleWalker {
const classData = this.data.find(data => data.replace === identifier.text);

if (!classData) {
console.error(`Could not find updated name for identifier "${identifier.text}" in ` +
` in file ${this.getSourceFile().fileName}.`);
console.error(
`Could not find updated name for identifier "${identifier.text}" in ` +
` in file ${this.getSourceFile().fileName}.`,
);
return;
}

const replacement = this.createReplacement(
identifier.getStart(), identifier.getWidth(), classData.replaceWith);
identifier.getStart(),
identifier.getWidth(),
classData.replaceWith,
);

this.addFailureAtNode(
identifier,
`Found deprecated identifier "${red(classData.replace)}" which has been renamed to` +
` "${green(classData.replaceWith)}"`,
replacement);
`Found deprecated identifier "${chalk.red(
classData.replace,
)}" which has been renamed to` +
` "${chalk.green(classData.replaceWith)}"`,
replacement,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {green, red} from 'chalk';
import chalk from 'chalk';
import {Replacement, RuleFailure, Rules, RuleWalker} from 'tslint';
import * as ts from 'typescript';
import {CssSelectorUpgradeData} from '../../data/css-selectors';
Expand Down Expand Up @@ -50,7 +50,7 @@ export class Walker extends RuleWalker {
/** Adds a css selector failure with the given replacement at the specified node. */
private _addFailureWithReplacement(node: ts.Node, replacement: Replacement,
data: CssSelectorUpgradeData) {
this.addFailureAtNode(node, `Found deprecated CSS selector "${red(data.replace)}" which has ` +
`been renamed to "${green(data.replaceWith)}"`, replacement);
this.addFailureAtNode(node, `Found deprecated CSS selector "${chalk.red(data.replace)}" which has ` +
`been renamed to "${chalk.green(data.replaceWith)}"`, replacement);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {green, red} from 'chalk';
import chalk from 'chalk';
import {IOptions, Replacement, RuleFailure, Rules} from 'tslint';
import * as ts from 'typescript';
import {ExternalResource} from '../../tslint/component-file';
Expand Down Expand Up @@ -58,8 +58,8 @@ export class Walker extends ComponentWalker {
return;
}

const failureMessage = `Found deprecated CSS selector "${red(data.replace)}" ` +
`which has been renamed to "${green(data.replaceWith)}"`;
const failureMessage = `Found deprecated CSS selector "${chalk.red(data.replace)}" ` +
`which has been renamed to "${chalk.green(data.replaceWith)}"`;

findAllSubstringIndices(stylesheetContent, data.replace)
.map(offset => node.getStart() + offset)
Expand Down
Loading

0 comments on commit 9d82edf

Please sign in to comment.