Skip to content

Commit

Permalink
build: update to 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie committed Jan 22, 2021
1 parent 61ca6e2 commit 6a0cf82
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 26 deletions.
6 changes: 3 additions & 3 deletions components/cascader/cascader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2097,23 +2097,23 @@ export class NzDemoCascaderLoadDataComponent {
label: 'Zhejiang'
}
];
resolve();
resolve(null);
} else if (index === 0) {
node.children = [
{
value: 'hangzhou',
label: 'Hangzhou'
}
];
resolve();
resolve(null);
} else if (index === 1) {
node.children = [
{
value: 'xihu',
label: 'West Lake'
}
];
resolve();
resolve(null);
} else {
reject();
}
Expand Down
4 changes: 2 additions & 2 deletions components/modal/modal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ describe('NzModal', () => {
onClick: () => {
return new Promise(resolve => {
setTimeout(() => {
resolve();
resolve(null);
}, 200);
});
}
Expand All @@ -1182,7 +1182,7 @@ describe('NzModal', () => {
onClick: () => {
return new Promise(resolve => {
setTimeout(() => {
resolve();
resolve(null);
}, 200);
});
}
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@
"resize-observer-polyfill": "^1.5.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.5",
"@angular-devkit/core": "^11.0.5",
"@angular-devkit/schematics": "^11.0.5",
"@angular/animations": "^11.0.5",
"@angular/cli": "~11.0.5",
"@angular/common": "^11.0.5",
"@angular/compiler": "^11.0.5",
"@angular/compiler-cli": "~11.0.5",
"@angular/core": "^11.0.5",
"@angular/forms": "^11.0.5",
"@angular/language-service": "^11.0.5",
"@angular/platform-browser": "^11.0.5",
"@angular/platform-browser-dynamic": "^11.0.5",
"@angular/platform-server": "^11.0.5",
"@angular/router": "^11.0.5",
"@angular/service-worker": "^11.0.5",
"@angular-devkit/build-angular": "~0.1101.0",
"@angular-devkit/core": "^11.1.0",
"@angular-devkit/schematics": "^11.1.0",
"@angular/animations": "^11.1.0",
"@angular/cli": "~11.1.0",
"@angular/common": "^11.1.0",
"@angular/compiler": "^11.1.0",
"@angular/compiler-cli": "~11.1.0",
"@angular/core": "^11.1.0",
"@angular/forms": "^11.1.0",
"@angular/language-service": "^11.1.0",
"@angular/platform-browser": "^11.1.0",
"@angular/platform-browser-dynamic": "^11.1.0",
"@angular/platform-server": "^11.1.0",
"@angular/router": "^11.1.0",
"@angular/service-worker": "^11.1.0",
"@ant-design/dark-theme": "^2.0.2",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-angular": "^11.0.0",
Expand Down Expand Up @@ -100,7 +100,7 @@
"marked": "^1.2.7",
"minimist": "^1.2.5",
"monaco-editor": "^0.21.2",
"ng-packagr": "^11.0.3",
"ng-packagr": "^11.1.2",
"ngx-color": "^6.2.0",
"node-prismjs": "^0.1.2",
"parse5": "^6.0.1",
Expand All @@ -119,7 +119,7 @@
"ts-node": "~9.1.1",
"tslib": "^2.0.3",
"tslint": "~6.1.3",
"typescript": "~4.0.2",
"typescript": "~4.1.2",
"yaml-front-matter": "^4.1.1",
"zone.js": "~0.11.3"
},
Expand Down
32 changes: 29 additions & 3 deletions schematics/utils/build-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { strings, template as interpolateTemplate } from '@angular-devkit/core';
import { ProjectDefinition, WorkspaceDefinition } from '@angular-devkit/core/src/workspace';
import { ProjectDefinition } from '@angular-devkit/core/src/workspace';
import {
apply,
applyTemplates,
Expand All @@ -25,11 +25,12 @@ import {
import { FileSystemSchematicContext } from '@angular-devkit/schematics/tools';
import { getDefaultComponentOptions, getProjectFromWorkspace } from '@angular/cdk/schematics';
import { Schema as ComponentOptions, Style } from '@schematics/angular/component/schema';
import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
import {
addDeclarationToModule,
addEntryComponentToModule,
addExportToModule,
getFirstNgModuleName
getDecoratorMetadata
} from '@schematics/angular/utility/ast-utils';
import { InsertChange } from '@schematics/angular/utility/change';
import { buildRelativePath, findModuleFromOptions } from '@schematics/angular/utility/find-module';
Expand All @@ -39,7 +40,32 @@ import { getWorkspace } from '@schematics/angular/utility/workspace';
import { ProjectType } from '@schematics/angular/utility/workspace-models';
import { readFileSync, statSync } from 'fs';
import { dirname, join, resolve } from 'path';
import * as ts from 'typescript';

function findClassDeclarationParent(node: ts.Node): ts.ClassDeclaration|undefined {
if (ts.isClassDeclaration(node)) {
return node;
}

return node.parent && findClassDeclarationParent(node.parent);
}

function getFirstNgModuleName(source: ts.SourceFile): string|undefined {
// First, find the @NgModule decorators.
const ngModulesMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core');
if (ngModulesMetadata.length === 0) {
return undefined;
}

// Then walk parent pointers up the AST, looking for the ClassDeclaration parent of the NgModule
// metadata.
const moduleClass = findClassDeclarationParent(ngModulesMetadata[0]);
if (!moduleClass || !moduleClass.name) {
return undefined;
}

// Get the class name of the module ClassDeclaration.
return moduleClass.name.text;
}

export interface ZorroComponentOptions extends ComponentOptions {
classnameWithModule: boolean;
Expand Down

0 comments on commit 6a0cf82

Please sign in to comment.