Skip to content

Commit a4a7c85

Browse files
committed
build: add schematics to @angular/material package
This also fixes a handful of minor issues with the blueprints
1 parent 6273d6a commit a4a7c85

File tree

15 files changed

+1300
-591
lines changed

15 files changed

+1300
-591
lines changed

package-lock.json

Lines changed: 1229 additions & 287 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
"zone.js": "^0.8.12"
4141
},
4242
"devDependencies": {
43+
"@angular-devkit/core": "^0.4.5",
44+
"@angular-devkit/schematics": "^0.4.5",
4345
"@angular/bazel": ">=6.0.0-beta.7 <7.0.0",
4446
"@angular/compiler-cli": ">=6.0.0-beta.7 <7.0.0",
4547
"@angular/http": ">=6.0.0-beta.7 <7.0.0",
@@ -49,6 +51,7 @@
4951
"@angular/upgrade": "^5.0.1",
5052
"@bazel/ibazel": "0.3.1",
5153
"@google-cloud/storage": "^1.1.1",
54+
"@schematics/angular": "^0.4.5",
5255
"@types/chalk": "^0.4.31",
5356
"@types/fs-extra": "^4.0.3",
5457
"@types/glob": "^5.0.33",

schematics/collection.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22
{
33
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
44
"schematics": {
5+
// Adds Angular Material to an application without changing any templates
6+
"ng-add": {
7+
"description": "Adds Angular Material to the application without affecting any templates",
8+
"factory": "./shell",
9+
"schema": "./shell/schema.json",
10+
"aliases": ["material-shell"]
11+
},
512
// Create a dashboard component
613
"materialDashboard": {
7-
"description": "Create a dashboard component",
14+
"description": "Create a card-based dashboard component",
815
"factory": "./dashboard/index",
916
"schema": "./dashboard/schema.json",
1017
"aliases": [ "material-dashboard" ]
1118
},
1219
// Creates a table component
1320
"materialTable": {
14-
"description": "Create a table component",
21+
"description": "Create a component that displays data with a data-table",
1522
"factory": "./table/index",
1623
"schema": "./table/schema.json",
1724
"aliases": [ "material-table" ]
1825
},
1926
// Creates toolbar and navigation components
2027
"materialNav": {
21-
"description": "Create a responsive navigation component",
28+
"description": "Create a component with a responsive sidenav for navigation",
2229
"factory": "./nav/index",
2330
"schema": "./nav/schema.json",
2431
"aliases": [ "material-nav" ]
25-
},
26-
// Adds Angular Material to an application without changing any templates
27-
"materialShell": {
28-
"description": "Create a Material shell",
29-
"factory": "./shell",
30-
"schema": "./shell/schema.json",
31-
"aliases": ["material-shell"]
3232
}
3333
}
3434
}

schematics/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, <% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
1+
import { Component<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
22

33
@Component({
44
selector: '<%= selector %>',<% if(inlineTemplate) { %>

schematics/nav/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, <% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
1+
import { Component<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
22
import { BreakpointObserver, Breakpoints, BreakpointState } from '@angular/cdk/layout';
33
import { Observable } from 'rxjs/Observable';
44

schematics/package-lock.json

Lines changed: 0 additions & 219 deletions
This file was deleted.

schematics/package.json

Lines changed: 0 additions & 39 deletions
This file was deleted.

schematics/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__-datasource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface <%= classify(name) %>Item {
1212
}
1313

1414
// TODO: replace this with real data from your application
15-
const EXAMPLE_DATA = <%= classify(name) %>Item[] = [
15+
const EXAMPLE_DATA: <%= classify(name) %>Item[] = [
1616
{id: 1, name: 'Hydrogen'},
1717
{id: 2, name: 'Helium'},
1818
{id: 3, name: 'Lithium'},

schematics/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('<%= classify(name) %>Component', () => {
1616
fixture = TestBed.createComponent(<%= classify(name) %>Component);
1717
component = fixture.componentInstance;
1818
fixture.detectChanges();
19-
});
19+
}));
2020

2121
it('should compile', () => {
2222
expect(component).toBeTruthy();

schematics/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Component, OnInit, ViewChild, <% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
2-
import { Observable } from 'rxjs/Observable';
1+
import { Component, OnInit, ViewChild<% if(!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if(changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
32
import { MatPaginator, MatSort } from '@angular/material';
4-
import { <%= classify(name) %>DataSource } from '<%= dasherize(name) %>-datasource';
3+
import { <%= classify(name) %>DataSource } from './<%= dasherize(name) %>-datasource';
54

65
@Component({
76
selector: '<%= selector %>',<% if(inlineTemplate) { %>

schematics/tsconfig.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"compilerOptions": {
3-
"lib": [
4-
"es2017",
5-
"dom"
6-
],
3+
"lib": ["es2017", "dom"],
74
"module": "commonjs",
85
"moduleResolution": "node",
6+
"outDir": "../dist/schematics",
97
"noEmitOnError": false,
108
"skipDefaultLibCheck": true,
119
"skipLibCheck": true,
@@ -17,6 +15,7 @@
1715
]
1816
},
1917
"exclude": [
20-
"*/files/**/*"
18+
"*/files/**/*",
19+
"**/*spec*"
2120
]
2221
}

0 commit comments

Comments
 (0)