@tech4good/angular-schematics 0.0.0 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -46
- package/package.json +27 -27
- package/src/collection.json +25 -25
- package/src/component/index.d.ts +2 -2
- package/src/component/index.js +102 -102
- package/src/component/index.js.map +1 -1
- package/src/component/index_spec.d.ts +1 -1
- package/src/component/index_spec.js +22 -22
- package/src/component/schema.json +33 -33
- package/src/container/index.d.ts +2 -2
- package/src/container/index.js +282 -282
- package/src/container/index.js.map +1 -1
- package/src/container/index_spec.d.ts +1 -1
- package/src/container/index_spec.js +22 -22
- package/src/container/schema.json +28 -28
- package/src/entity/index.d.ts +2 -2
- package/src/entity/index.js +524 -524
- package/src/entity/index.js.map +1 -1
- package/src/entity/index_spec.d.ts +1 -1
- package/src/entity/index_spec.js +22 -22
- package/src/entity/schema.json +23 -23
- package/src/module/index.d.ts +2 -2
- package/src/module/index.js +87 -87
- package/src/module/index.js.map +1 -1
- package/src/module/index_spec.d.ts +1 -1
- package/src/module/index_spec.js +22 -22
- package/src/module/schema.json +23 -23
- package/src/shared/camelcase-formatter.d.ts +1 -1
- package/src/shared/camelcase-formatter.js +18 -18
- package/src/shared/statements-adder.d.ts +5 -5
- package/src/shared/statements-adder.js +31 -31
- package/tsconfig.json +34 -34
package/README.md
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
# Angular Schematics
|
|
2
|
-
|
|
3
|
-
This repository is used to generate modules, containers, components, and entities for Angular projects.
|
|
4
|
-
|
|
5
|
-
### Usage
|
|
6
|
-
|
|
7
|
-
1. Run `npm i @tech4good/angular-schematics`.
|
|
8
|
-
2. Run `ng generate @tech4good/angular-schematics:<schematic>` to generate files (`schematic` = module, container, component, or entity)
|
|
9
|
-
3. Complete the following prompts to finish generating files.
|
|
10
|
-
|
|
11
|
-
### Important Notes
|
|
12
|
-
|
|
13
|
-
When generating **components** or **containers**: If the project has an import error for `waitForAsync` in `<component-name>.component.spec.ts`, update all instances to `async`.
|
|
14
|
-
### Developing
|
|
15
|
-
|
|
16
|
-
1. Clone this repository.
|
|
17
|
-
2. Run `npm install -g @angular-devkit/schematics-cli` to install globally
|
|
18
|
-
3. Run `npm install`, `npm run build` & `npm link`
|
|
19
|
-
4. Run `npm link @tech4good/angular-schematics` in the Angular project directory
|
|
20
|
-
5. Run `ng generate @tech4good/angular-schematics:<schematic>` to generate files (`schematic` = module, container, component, or entity)
|
|
21
|
-
6. To test/debug new changes, run `npm run build` again before `ng generate ...`
|
|
22
|
-
|
|
23
|
-
### Testing
|
|
24
|
-
|
|
25
|
-
To test locally, install `@angular-devkit/schematics-cli` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode.
|
|
26
|
-
|
|
27
|
-
Check the documentation with
|
|
28
|
-
```bash
|
|
29
|
-
schematics --help
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Unit Testing
|
|
33
|
-
|
|
34
|
-
`npm run test` will run the unit tests, using Jasmine as a runner and test framework.
|
|
35
|
-
|
|
36
|
-
### Publishing
|
|
37
|
-
|
|
38
|
-
To publish, simply do:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm run build
|
|
42
|
-
npm publish
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
That's it!
|
|
46
|
-
|
|
1
|
+
# Angular Schematics
|
|
2
|
+
|
|
3
|
+
This repository is used to generate modules, containers, components, and entities for Angular projects.
|
|
4
|
+
|
|
5
|
+
### Usage
|
|
6
|
+
|
|
7
|
+
1. Run `npm i @tech4good/angular-schematics`.
|
|
8
|
+
2. Run `ng generate @tech4good/angular-schematics:<schematic>` to generate files (`schematic` = module, container, component, or entity)
|
|
9
|
+
3. Complete the following prompts to finish generating files.
|
|
10
|
+
|
|
11
|
+
### Important Notes
|
|
12
|
+
|
|
13
|
+
When generating **components** or **containers**: If the project has an import error for `waitForAsync` in `<component-name>.component.spec.ts`, update all instances to `async`.
|
|
14
|
+
### Developing
|
|
15
|
+
|
|
16
|
+
1. Clone this repository.
|
|
17
|
+
2. Run `npm install -g @angular-devkit/schematics-cli` to install globally
|
|
18
|
+
3. Run `npm install`, `npm run build` & `npm link`
|
|
19
|
+
4. Run `npm link @tech4good/angular-schematics` in the Angular project directory
|
|
20
|
+
5. Run `ng generate @tech4good/angular-schematics:<schematic>` to generate files (`schematic` = module, container, component, or entity)
|
|
21
|
+
6. To test/debug new changes, run `npm run build` again before `ng generate ...`
|
|
22
|
+
|
|
23
|
+
### Testing
|
|
24
|
+
|
|
25
|
+
To test locally, install `@angular-devkit/schematics-cli` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode. For example, in the root directory, you can use `schematics .:component` to run the component schematic.
|
|
26
|
+
|
|
27
|
+
Check the documentation with
|
|
28
|
+
```bash
|
|
29
|
+
schematics --help
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Unit Testing
|
|
33
|
+
|
|
34
|
+
`npm run test` will run the unit tests, using Jasmine as a runner and test framework.
|
|
35
|
+
|
|
36
|
+
### Publishing
|
|
37
|
+
|
|
38
|
+
To publish, simply do:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm run build
|
|
42
|
+
npm publish
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
That's it!
|
|
46
|
+
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tech4good/angular-schematics",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A set of schematics for generating modules, containers, components, and entities",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "tsc -p tsconfig.json",
|
|
7
|
-
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"schematics"
|
|
11
|
-
],
|
|
12
|
-
"author": "",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"schematics": "./src/collection.json",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@angular-devkit/core": "^
|
|
17
|
-
"@angular-devkit/schematics": "^
|
|
18
|
-
"@angular-devkit/schematics-cli": "^
|
|
19
|
-
"@schematics/angular": "^
|
|
20
|
-
"typescript": "~4.
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/node": "^12.11.1",
|
|
24
|
-
"@types/jasmine": "~3.
|
|
25
|
-
"jasmine": "^3.5.0"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tech4good/angular-schematics",
|
|
3
|
+
"version": "13.0.1",
|
|
4
|
+
"description": "A set of schematics for generating modules, containers, components, and entities",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc -p tsconfig.json",
|
|
7
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"schematics"
|
|
11
|
+
],
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"schematics": "./src/collection.json",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@angular-devkit/core": "^13.2.5",
|
|
17
|
+
"@angular-devkit/schematics": "^13.2.5",
|
|
18
|
+
"@angular-devkit/schematics-cli": "^13.2.5",
|
|
19
|
+
"@schematics/angular": "^13.2.5",
|
|
20
|
+
"typescript": "~4.5.5"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^12.11.1",
|
|
24
|
+
"@types/jasmine": "~3.6.0",
|
|
25
|
+
"jasmine": "^3.5.0"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/collection.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
-
"schematics": {
|
|
4
|
-
"module": {
|
|
5
|
-
"description": "A blank schematic.",
|
|
6
|
-
"factory": "./module/index#module",
|
|
7
|
-
"schema": "./module/schema.json"
|
|
8
|
-
},
|
|
9
|
-
"container": {
|
|
10
|
-
"description": "A blank schematic.",
|
|
11
|
-
"factory": "./container/index#container",
|
|
12
|
-
"schema": "./container/schema.json"
|
|
13
|
-
},
|
|
14
|
-
"component": {
|
|
15
|
-
"description": "A blank schematic.",
|
|
16
|
-
"factory": "./component/index#component",
|
|
17
|
-
"schema": "./component/schema.json"
|
|
18
|
-
},
|
|
19
|
-
"entity": {
|
|
20
|
-
"description": "A blank schematic.",
|
|
21
|
-
"factory": "./entity/index#entity",
|
|
22
|
-
"schema": "./entity/schema.json"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"module": {
|
|
5
|
+
"description": "A blank schematic.",
|
|
6
|
+
"factory": "./module/index#module",
|
|
7
|
+
"schema": "./module/schema.json"
|
|
8
|
+
},
|
|
9
|
+
"container": {
|
|
10
|
+
"description": "A blank schematic.",
|
|
11
|
+
"factory": "./container/index#container",
|
|
12
|
+
"schema": "./container/schema.json"
|
|
13
|
+
},
|
|
14
|
+
"component": {
|
|
15
|
+
"description": "A blank schematic.",
|
|
16
|
+
"factory": "./component/index#component",
|
|
17
|
+
"schema": "./component/schema.json"
|
|
18
|
+
},
|
|
19
|
+
"entity": {
|
|
20
|
+
"description": "A blank schematic.",
|
|
21
|
+
"factory": "./entity/index#entity",
|
|
22
|
+
"schema": "./entity/schema.json"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/component/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function component(_options: any): Rule;
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare function component(_options: any): Rule;
|
package/src/component/index.js
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.component = void 0;
|
|
4
|
-
const camelcase_formatter_1 = require("../shared/camelcase-formatter");
|
|
5
|
-
const statements_adder_1 = require("../shared/statements-adder");
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
// You don't have to export the function as default. You can also have more than one rule factory
|
|
8
|
-
// per file.
|
|
9
|
-
function component(_options) {
|
|
10
|
-
return (tree, _context) => {
|
|
11
|
-
const { name, module, container, description } = _options;
|
|
12
|
-
const camelName = camelcase_formatter_1.CamelCaseFormatter(name, false);
|
|
13
|
-
const AnimationsFile = `import { trigger, group, query, animateChild, state, style, animate, transition } from '@angular/animations';
|
|
14
|
-
|
|
15
|
-
export const ${camelName}Animations = [
|
|
16
|
-
];
|
|
17
|
-
`;
|
|
18
|
-
const CSSFile = `.${name}-container {
|
|
19
|
-
// REMOVE WHEN FINISHING LAYOUT STYLES
|
|
20
|
-
border: 1px solid black;
|
|
21
|
-
}`;
|
|
22
|
-
const HTMLFile = `<div class="${name}-container">
|
|
23
|
-
${name} works!
|
|
24
|
-
</div>`;
|
|
25
|
-
const ComponentFile = `import { Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter } from '@angular/core';
|
|
26
|
-
import { ${camelName}Animations } from './${name}.animations';
|
|
27
|
-
|
|
28
|
-
/** ${description} */
|
|
29
|
-
@Component({
|
|
30
|
-
selector: 'app-${name}',
|
|
31
|
-
templateUrl: './${name}.component.html',
|
|
32
|
-
styleUrls: ['./${name}.component.scss'],
|
|
33
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
-
animations: ${camelName}Animations,
|
|
35
|
-
})
|
|
36
|
-
export class ${camelName}Component implements OnInit {
|
|
37
|
-
|
|
38
|
-
// --------------- INPUTS AND OUTPUTS ---------
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// --------------- LOCAL UI STATE ----------------------
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
constructor() { }
|
|
45
|
-
|
|
46
|
-
ngOnInit() {
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// --------------- DATA BINDING FUNCTIONS ----------------
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// --------------- EVENT BINDING FUNCTIONS ---------------
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// --------------- OTHER -------------------------------
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const SpecFile = `import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
60
|
-
|
|
61
|
-
import { ${camelName}Component } from './${name}.component';
|
|
62
|
-
|
|
63
|
-
describe('${camelName}Component', () => {
|
|
64
|
-
let component: ${camelName}Component;
|
|
65
|
-
let fixture: ComponentFixture<${camelName}Component>;
|
|
66
|
-
|
|
67
|
-
beforeEach(waitForAsync(() => {
|
|
68
|
-
TestBed.configureTestingModule({
|
|
69
|
-
declarations: [ ${camelName}Component ],
|
|
70
|
-
})
|
|
71
|
-
.compileComponents();
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
beforeEach(() => {
|
|
75
|
-
fixture = TestBed.createComponent(${camelName}Component);
|
|
76
|
-
component = fixture.componentInstance;
|
|
77
|
-
fixture.detectChanges();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should create', () => {
|
|
81
|
-
expect(component).toBeTruthy();
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
`;
|
|
85
|
-
const filePath = `./src/app/${module}/${module}.module.ts`;
|
|
86
|
-
const labels = ['// Components', '// Components'];
|
|
87
|
-
const statements = [`import { ${camelName}Component } from './${container}/${name}/${name}.component';`, ` ${camelName}Component,`];
|
|
88
|
-
statements_adder_1.AddStatements(filePath, labels, statements, tree);
|
|
89
|
-
// create directories before adding files
|
|
90
|
-
const dir = `./src/app/${module}/${container}/${name}`;
|
|
91
|
-
if (!fs.existsSync(dir)) {
|
|
92
|
-
fs.mkdirSync(dir);
|
|
93
|
-
}
|
|
94
|
-
tree.create(`${dir}/${name}.animations.ts`, AnimationsFile);
|
|
95
|
-
tree.create(`${dir}/${name}.component.html`, HTMLFile);
|
|
96
|
-
tree.create(`${dir}/${name}.component.scss`, CSSFile);
|
|
97
|
-
tree.create(`${dir}/${name}.component.spec.ts`, SpecFile);
|
|
98
|
-
tree.create(`${dir}/${name}.component.ts`, ComponentFile);
|
|
99
|
-
return tree;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
exports.component = component;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.component = void 0;
|
|
4
|
+
const camelcase_formatter_1 = require("../shared/camelcase-formatter");
|
|
5
|
+
const statements_adder_1 = require("../shared/statements-adder");
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
// You don't have to export the function as default. You can also have more than one rule factory
|
|
8
|
+
// per file.
|
|
9
|
+
function component(_options) {
|
|
10
|
+
return (tree, _context) => {
|
|
11
|
+
const { name, module, container, description } = _options;
|
|
12
|
+
const camelName = (0, camelcase_formatter_1.CamelCaseFormatter)(name, false);
|
|
13
|
+
const AnimationsFile = `import { trigger, group, query, animateChild, state, style, animate, transition } from '@angular/animations';
|
|
14
|
+
|
|
15
|
+
export const ${camelName}Animations = [
|
|
16
|
+
];
|
|
17
|
+
`;
|
|
18
|
+
const CSSFile = `.${name}-container {
|
|
19
|
+
// REMOVE WHEN FINISHING LAYOUT STYLES
|
|
20
|
+
border: 1px solid black;
|
|
21
|
+
}`;
|
|
22
|
+
const HTMLFile = `<div class="${name}-container">
|
|
23
|
+
${name} works!
|
|
24
|
+
</div>`;
|
|
25
|
+
const ComponentFile = `import { Component, OnInit, ChangeDetectionStrategy, Input, Output, EventEmitter } from '@angular/core';
|
|
26
|
+
import { ${camelName}Animations } from './${name}.animations';
|
|
27
|
+
|
|
28
|
+
/** ${description} */
|
|
29
|
+
@Component({
|
|
30
|
+
selector: 'app-${name}',
|
|
31
|
+
templateUrl: './${name}.component.html',
|
|
32
|
+
styleUrls: ['./${name}.component.scss'],
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
animations: ${camelName}Animations,
|
|
35
|
+
})
|
|
36
|
+
export class ${camelName}Component implements OnInit {
|
|
37
|
+
|
|
38
|
+
// --------------- INPUTS AND OUTPUTS ---------
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// --------------- LOCAL UI STATE ----------------------
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
constructor() { }
|
|
45
|
+
|
|
46
|
+
ngOnInit() {
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --------------- DATA BINDING FUNCTIONS ----------------
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// --------------- EVENT BINDING FUNCTIONS ---------------
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// --------------- OTHER -------------------------------
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const SpecFile = `import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
60
|
+
|
|
61
|
+
import { ${camelName}Component } from './${name}.component';
|
|
62
|
+
|
|
63
|
+
describe('${camelName}Component', () => {
|
|
64
|
+
let component: ${camelName}Component;
|
|
65
|
+
let fixture: ComponentFixture<${camelName}Component>;
|
|
66
|
+
|
|
67
|
+
beforeEach(waitForAsync(() => {
|
|
68
|
+
TestBed.configureTestingModule({
|
|
69
|
+
declarations: [ ${camelName}Component ],
|
|
70
|
+
})
|
|
71
|
+
.compileComponents();
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
beforeEach(() => {
|
|
75
|
+
fixture = TestBed.createComponent(${camelName}Component);
|
|
76
|
+
component = fixture.componentInstance;
|
|
77
|
+
fixture.detectChanges();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should create', () => {
|
|
81
|
+
expect(component).toBeTruthy();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
`;
|
|
85
|
+
const filePath = `./src/app/${module}/${module}.module.ts`;
|
|
86
|
+
const labels = ['// Components', '// Components'];
|
|
87
|
+
const statements = [`import { ${camelName}Component } from './${container}/${name}/${name}.component';`, ` ${camelName}Component,`];
|
|
88
|
+
(0, statements_adder_1.AddStatements)(filePath, labels, statements, tree);
|
|
89
|
+
// create directories before adding files
|
|
90
|
+
const dir = `./src/app/${module}/${container}/${name}`;
|
|
91
|
+
if (!fs.existsSync(dir)) {
|
|
92
|
+
fs.mkdirSync(dir);
|
|
93
|
+
}
|
|
94
|
+
tree.create(`${dir}/${name}.animations.ts`, AnimationsFile);
|
|
95
|
+
tree.create(`${dir}/${name}.component.html`, HTMLFile);
|
|
96
|
+
tree.create(`${dir}/${name}.component.scss`, CSSFile);
|
|
97
|
+
tree.create(`${dir}/${name}.component.spec.ts`, SpecFile);
|
|
98
|
+
tree.create(`${dir}/${name}.component.ts`, ComponentFile);
|
|
99
|
+
return tree;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
exports.component = component;
|
|
103
103
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAEA,uEAAmE;AACnE,iEAA2D;AAE3D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,iGAAiG;AACjG,YAAY;AACZ,SAAgB,SAAS,CAAC,QAAa;IACrC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;QAC1D,MAAM,SAAS,GAAG,wCAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAEA,uEAAmE;AACnE,iEAA2D;AAE3D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,iGAAiG;AACjG,YAAY;AACZ,SAAgB,SAAS,CAAC,QAAa;IACrC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC;QAC1D,MAAM,SAAS,GAAG,IAAA,wCAAkB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAElD,MAAM,cAAc,GAAG;;eAEZ,SAAS;;CAEvB,CAAC;QAEE,MAAM,OAAO,GAAG,IAAI,IAAI;;;EAG1B,CAAC;QAEC,MAAM,QAAQ,GAAG,eAAe,IAAI;MAClC,IAAI;OACH,CAAC;QAEJ,MAAM,aAAa,GAAG;WACf,SAAS,wBAAwB,IAAI;;MAE1C,WAAW;;mBAEE,IAAI;oBACH,IAAI;mBACL,IAAI;;gBAEP,SAAS;;eAEV,SAAS;;;;;;;;;;;;;;;;;;;;;;CAsBvB,CAAC;QAEE,MAAM,QAAQ,GAAG;;WAEV,SAAS,uBAAuB,IAAI;;YAEnC,SAAS;mBACF,SAAS;kCACM,SAAS;;;;wBAInB,SAAS;;;;;;wCAMO,SAAS;;;;;;;;;CAShD,CAAC;QAEE,MAAM,QAAQ,GAAG,aAAa,MAAM,IAAI,MAAM,YAAY,CAAC;QAC3D,MAAM,MAAM,GAAG,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;QAClD,MAAM,UAAU,GAAG,CAAC,YAAY,SAAS,uBAAuB,SAAS,IAAI,IAAI,IAAI,IAAI,cAAc,EAAE,OAAO,SAAS,YAAY,CAAC,CAAC;QACvI,IAAA,gCAAa,EAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAElD,yCAAyC;QACzC,MAAM,GAAG,GAAG,aAAa,MAAM,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACvD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAC;YACpB,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SACrB;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC1D,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,eAAe,EAAE,aAAa,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AArGD,8BAqGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
-
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
14
|
-
const path = require("path");
|
|
15
|
-
const collectionPath = path.join(__dirname, '../collection.json');
|
|
16
|
-
describe('component', () => {
|
|
17
|
-
it('works', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
19
|
-
const tree = yield runner.runSchematicAsync('component', {}, schematics_1.Tree.empty()).toPromise();
|
|
20
|
-
expect(tree.files).toEqual([]);
|
|
21
|
-
}));
|
|
22
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
+
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
14
|
+
const path = require("path");
|
|
15
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
16
|
+
describe('component', () => {
|
|
17
|
+
it('works', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
19
|
+
const tree = yield runner.runSchematicAsync('component', {}, schematics_1.Tree.empty()).toPromise();
|
|
20
|
+
expect(tree.files).toEqual([]);
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
23
23
|
//# sourceMappingURL=index_spec.js.map
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"id": "MyFullSchematicsSchema",
|
|
4
|
-
"title": "My Full Schematics Schema",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"index": {
|
|
8
|
-
"type": "number",
|
|
9
|
-
"default": 1
|
|
10
|
-
},
|
|
11
|
-
"name": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"x-prompt": "What should we name the files?"
|
|
14
|
-
},
|
|
15
|
-
"container": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"x-prompt": "Which container should we generate the component in?"
|
|
18
|
-
},
|
|
19
|
-
"module": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"x-prompt": "Which module is the container in?"
|
|
22
|
-
},
|
|
23
|
-
"description": {
|
|
24
|
-
"type": "string",
|
|
25
|
-
"x-prompt": "Short description of the module (inserted as a comment):"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"required": [
|
|
29
|
-
"name",
|
|
30
|
-
"module",
|
|
31
|
-
"container"
|
|
32
|
-
]
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "MyFullSchematicsSchema",
|
|
4
|
+
"title": "My Full Schematics Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"index": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"default": 1
|
|
10
|
+
},
|
|
11
|
+
"name": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"x-prompt": "What should we name the files?"
|
|
14
|
+
},
|
|
15
|
+
"container": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"x-prompt": "Which container should we generate the component in?"
|
|
18
|
+
},
|
|
19
|
+
"module": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"x-prompt": "Which module is the container in?"
|
|
22
|
+
},
|
|
23
|
+
"description": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"x-prompt": "Short description of the module (inserted as a comment):"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"name",
|
|
30
|
+
"module",
|
|
31
|
+
"container"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/src/container/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function container(_options: any): Rule;
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare function container(_options: any): Rule;
|