@tech4good/angular-schematics 0.0.2 → 13.1.0

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.
Files changed (57) hide show
  1. package/README.md +46 -46
  2. package/package.json +27 -27
  3. package/src/collection.json +25 -25
  4. package/src/component/files/__name@dasherize__/__name@dasherize__.animations.ts.template +4 -0
  5. package/src/component/files/__name@dasherize__/__name@dasherize__.component.html.template +3 -0
  6. package/src/component/files/__name@dasherize__/__name@dasherize__.component.scss.template +7 -0
  7. package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +25 -0
  8. package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +30 -0
  9. package/src/component/index.d.ts +2 -2
  10. package/src/component/index.js +93 -102
  11. package/src/component/index.js.map +1 -1
  12. package/src/component/index_spec.d.ts +1 -1
  13. package/src/component/index_spec.js +22 -22
  14. package/src/component/schema.json +47 -29
  15. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.actions.ts.template +27 -0
  16. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.effects.ts.template +47 -0
  17. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.model.ts.template +0 -0
  18. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.selectors.ts.template +20 -0
  19. package/src/container/files/__name@dasherize__/+state/__name@dasherize__.state.ts.template +13 -0
  20. package/src/container/files/__name@dasherize__/__name@dasherize__.animations.ts.template +4 -0
  21. package/src/container/files/__name@dasherize__/__name@dasherize__.component.html.template +3 -0
  22. package/src/container/files/__name@dasherize__/__name@dasherize__.component.scss.template +5 -0
  23. package/src/container/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +25 -0
  24. package/src/container/files/__name@dasherize__/__name@dasherize__.component.ts.template +81 -0
  25. package/src/container/index.d.ts +2 -2
  26. package/src/container/index.js +115 -282
  27. package/src/container/index.js.map +1 -1
  28. package/src/container/index_spec.d.ts +1 -1
  29. package/src/container/index_spec.js +22 -22
  30. package/src/container/schema.json +47 -24
  31. package/src/entity/files/__name@dasherize__/__name@dasherize__.actions.ts.template +270 -0
  32. package/src/entity/files/__name@dasherize__/__name@dasherize__.effects.ts.template +131 -0
  33. package/src/entity/files/__name@dasherize__/__name@dasherize__.model.ts.template +7 -0
  34. package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.spec.ts.template +13 -0
  35. package/src/entity/files/__name@dasherize__/__name@dasherize__.reducer.ts.template +51 -0
  36. package/src/entity/files/__name@dasherize__/__name@dasherize__.service.ts.template +50 -0
  37. package/src/entity/index.d.ts +2 -2
  38. package/src/entity/index.js +123 -524
  39. package/src/entity/index.js.map +1 -1
  40. package/src/entity/index_spec.d.ts +1 -1
  41. package/src/entity/index_spec.js +22 -22
  42. package/src/entity/schema.json +42 -19
  43. package/src/module/files/__name@dasherize__/__name@dasherize__-routing.module.ts.template +13 -0
  44. package/src/module/files/__name@dasherize__/__name@dasherize__.module.spec.ts.template +13 -0
  45. package/src/module/files/__name@dasherize__/__name@dasherize__.module.ts.template +24 -0
  46. package/src/module/index.d.ts +2 -2
  47. package/src/module/index.js +96 -87
  48. package/src/module/index.js.map +1 -1
  49. package/src/module/index_spec.d.ts +1 -1
  50. package/src/module/index_spec.js +22 -22
  51. package/src/module/schema.json +38 -19
  52. package/src/shared/camelcase-formatter.d.ts +1 -1
  53. package/src/shared/camelcase-formatter.js +18 -18
  54. package/src/shared/statements-adder.d.ts +8 -5
  55. package/src/shared/statements-adder.js +52 -31
  56. package/src/shared/statements-adder.js.map +1 -1
  57. package/tsconfig.json +34 -34
@@ -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,MAAM,CAAC,QAAa;IAClC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;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QAE/B,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,kCACT,cAAO,GACP,OAAO,EACV;YACF,IAAA,iBAAI,EAAC,UAAU,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,UAAU,CAAC,OAAO,CAAC;YACnB,IAAA,sBAAS,EAAC,cAAc,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AAvCD,wBAuCC"}
@@ -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('entity', () => {
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('entity', {}, 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('entity', () => {
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('entity', {}, schematics_1.Tree.empty()).toPromise();
20
+ expect(tree.files).toEqual([]);
21
+ }));
22
+ });
23
23
  //# sourceMappingURL=index_spec.js.map
@@ -1,19 +1,42 @@
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 entity?"
14
- }
15
- },
16
- "required": [
17
- "name"
18
- ]
19
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "EntitySchema",
4
+ "title": "Entity Schema",
5
+ "type": "object",
6
+ "description": "Creates a new entity in the default project.",
7
+ "properties": {
8
+ "index": {
9
+ "type": "number",
10
+ "default": 1
11
+ },
12
+ "path": {
13
+ "type": "string",
14
+ "format": "path",
15
+ "description": "The path at which to create the entity file, relative to the current workspace. Should typically be within /src/app/core/store.",
16
+ "visible": false
17
+ },
18
+ "project": {
19
+ "type": "string",
20
+ "description": "The name of the project.",
21
+ "$default": {
22
+ "$source": "projectName"
23
+ }
24
+ },
25
+ "name": {
26
+ "type": "string",
27
+ "description": "The name of the entity.",
28
+ "$default": {
29
+ "$source": "argv",
30
+ "index": 0
31
+ },
32
+ "x-prompt": "What name would you like to use for the entity?"
33
+ },
34
+ "inDirectory": {
35
+ "type": "boolean",
36
+ "x-prompt": "Are you currently in the directory where you want to generate the entity? (typically directly in src/app/core/store)"
37
+ }
38
+ },
39
+ "required": [
40
+ "name"
41
+ ]
42
+ }
@@ -0,0 +1,13 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { Routes, RouterModule } from '@angular/router';
3
+
4
+ // Containers
5
+
6
+ const routes: Routes = [
7
+ ];
8
+
9
+ @NgModule({
10
+ imports: [RouterModule.forChild(routes)],
11
+ exports: [RouterModule],
12
+ })
13
+ export class <%= classify(name) %>RoutingModule { }
@@ -0,0 +1,13 @@
1
+ import { <%= classify(name) %>Module } from './<%= dasherize(name) %>.module';
2
+
3
+ describe('<%= classify(name) %>Module', () => {
4
+ let <%= camelize(name) %>Module: <%= classify(name) %>Module;
5
+
6
+ beforeEach(() => {
7
+ <%= camelize(name) %>Module = new <%= classify(name) %>Module();
8
+ });
9
+
10
+ it('should create an instance', () => {
11
+ expect(<%= camelize(name) %>Module).toBeTruthy();
12
+ });
13
+ });
@@ -0,0 +1,24 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { EffectsModule } from '@ngrx/effects';
4
+ import { SharedModule } from '../shared/shared.module';
5
+ import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';
6
+
7
+ // Containers
8
+
9
+ // Components
10
+
11
+ @NgModule({
12
+ imports: [
13
+ CommonModule,
14
+ SharedModule,
15
+ <%= classify(name) %>RoutingModule,
16
+ EffectsModule.forFeature([
17
+ ]),
18
+ ],
19
+ declarations: [
20
+ // Containers
21
+ // Components
22
+ ],
23
+ })
24
+ export class <%= classify(name) %>Module { }
@@ -1,2 +1,2 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare function module(_options: any): Rule;
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function module(options: any): Rule;
@@ -1,88 +1,97 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.module = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const camelcase_formatter_1 = require("../shared/camelcase-formatter");
6
- const statements_adder_1 = require("../shared/statements-adder");
7
- const fs = require('fs');
8
- // You don't have to export the function as default. You can also have more than one rule factory
9
- // per file.
10
- function module(_options) {
11
- return (tree, _context) => {
12
- const angularConfig = 'angular.json';
13
- // Let's make sure we're in an angular workspace
14
- if (!tree.exists(angularConfig))
15
- throw new schematics_1.SchematicsException('???This is not an Angular worksapce! Try again in an Angular project.');
16
- const { name } = _options;
17
- const camelName = camelcase_formatter_1.CamelCaseFormatter(name, false);
18
- const lowerCamelName = camelcase_formatter_1.CamelCaseFormatter(name, true);
19
- const ModuleRoutingFile = `import { NgModule } from '@angular/core';
20
- import { Routes, RouterModule } from '@angular/router';
21
-
22
- // Containers
23
-
24
- const routes: Routes = [
25
- ];
26
-
27
- @NgModule({
28
- imports: [RouterModule.forChild(routes)],
29
- exports: [RouterModule],
30
- })
31
- export class ${camelName}RoutingModule { }
32
- `;
33
- const ModuleSpecFile = `import { ${camelName}Module } from './${name}.module';
34
-
35
- describe('${camelName}Module', () => {
36
- let ${lowerCamelName}Module: ${camelName}Module;
37
-
38
- beforeEach(() => {
39
- ${lowerCamelName}Module = new ${camelName}Module();
40
- });
41
-
42
- it('should create an instance', () => {
43
- expect(${lowerCamelName}Module).toBeTruthy();
44
- });
45
- });
46
- `;
47
- const ModuleFile = `import { NgModule } from '@angular/core';
48
- import { CommonModule } from '@angular/common';
49
- import { EffectsModule } from '@ngrx/effects';
50
- import { SharedModule } from '../shared/shared.module';
51
- import { ${camelName}RoutingModule } from './${name}-routing.module';
52
-
53
- // Containers
54
-
55
- // Components
56
-
57
- /** undefined */
58
- @NgModule({
59
- imports: [
60
- CommonModule,
61
- SharedModule,
62
- ${camelName}RoutingModule,
63
- EffectsModule.forFeature([
64
- ]),
65
- ],
66
- declarations: [
67
- // Containers
68
- // Components
69
- ],
70
- })
71
- export class ${camelName}Module { }`;
72
- const filePath = 'src/app/app.module.ts';
73
- const labels = ['// Feature Modules', '// Feature Modules'];
74
- const statements = [`import { ${camelName}Module } from './${name}/${name}.module';`, ` ${camelName}Module,`];
75
- statements_adder_1.AddStatements(filePath, labels, statements, tree);
76
- // create directory before adding files
77
- const dir = `./src/app/${name}`;
78
- if (!fs.existsSync(dir)) {
79
- fs.mkdirSync(dir);
80
- }
81
- tree.create(`${dir}/${name}-routing.module.ts`, ModuleRoutingFile);
82
- tree.create(`${dir}/${name}.module.spec.ts`, ModuleSpecFile);
83
- tree.create(`${dir}/${name}.module.ts`, ModuleFile);
84
- return tree;
85
- };
86
- }
87
- exports.module = module;
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
+ exports.module = void 0;
13
+ const schematics_1 = require("@angular-devkit/schematics");
14
+ const change_1 = require("@schematics/angular/utility/change");
15
+ const find_module_1 = require("@schematics/angular/utility/find-module");
16
+ const parse_name_1 = require("@schematics/angular/utility/parse-name");
17
+ const workspace_1 = require("@schematics/angular/utility/workspace");
18
+ const core_1 = require("@angular-devkit/core");
19
+ const statements_adder_1 = require("../shared/statements-adder");
20
+ function addInserts(options) {
21
+ return (host, context) => {
22
+ const classifiedName = core_1.strings.classify(options.name);
23
+ const dasherizedName = core_1.strings.dasherize(options.name);
24
+ const modulePath = '//src/app/' +
25
+ core_1.strings.dasherize(options.name) + '/' +
26
+ core_1.strings.dasherize(options.name) + '.module';
27
+ context.logger.info(`modulePath: ${modulePath}`);
28
+ if (!options.lazyLoading) {
29
+ // Add app module changes if not lazy loaded
30
+ const appModulePath = '//src/app/app.module.ts';
31
+ const appModuleText = (0, statements_adder_1.getSourceText)(host, appModulePath);
32
+ context.logger.info(`appModulePath: ${appModulePath}`);
33
+ const appModuleToModulePath = (0, find_module_1.buildRelativePath)(appModulePath, modulePath);
34
+ let insertChanges = (0, statements_adder_1.simpleInsert)(appModuleText, appModulePath, [
35
+ '// Feature Modules',
36
+ '// Feature Modules'
37
+ ], [
38
+ `import { ${classifiedName}Module } from '${appModuleToModulePath}';`,
39
+ ` ${classifiedName}Module,`
40
+ ]);
41
+ const declarationRecorder = host.beginUpdate(appModulePath);
42
+ for (const change of insertChanges) {
43
+ if (change instanceof change_1.InsertChange) {
44
+ declarationRecorder.insertLeft(change.pos, change.toAdd);
45
+ }
46
+ }
47
+ host.commitUpdate(declarationRecorder);
48
+ }
49
+ else {
50
+ // Add app-routing module changes if lazy loaded
51
+ const appRoutingModulePath = '//src/app/app-routing.module.ts';
52
+ const appRoutingModuleText = (0, statements_adder_1.getSourceText)(host, appRoutingModulePath);
53
+ const appRoutingModuleToModulePath = (0, find_module_1.buildRelativePath)(appRoutingModulePath, modulePath);
54
+ context.logger.info(`appRoutingModuleToModulePath: ${appRoutingModuleToModulePath}`);
55
+ let insertChanges = (0, statements_adder_1.simpleInsert)(appRoutingModuleText, appRoutingModulePath, [
56
+ 'const appRoutes: Routes = ['
57
+ ], [
58
+ ` { path: '${dasherizedName}', loadChildren: () => import('${appRoutingModuleToModulePath}').then((mod) => mod.${classifiedName}Module) },`
59
+ ]);
60
+ context.logger.info(`insertChanges: ${insertChanges}`);
61
+ const declarationRecorder = host.beginUpdate(appRoutingModulePath);
62
+ for (const change of insertChanges) {
63
+ if (change instanceof change_1.InsertChange) {
64
+ declarationRecorder.insertLeft(change.pos, change.toAdd);
65
+ }
66
+ }
67
+ host.commitUpdate(declarationRecorder);
68
+ }
69
+ return host;
70
+ };
71
+ }
72
+ function module(options) {
73
+ return (tree, context) => __awaiter(this, void 0, void 0, function* () {
74
+ context.logger.info("Starting module generation");
75
+ const workspace = yield (0, workspace_1.getWorkspace)(tree);
76
+ const project = workspace.projects.get(options.project);
77
+ if (!project) {
78
+ throw new schematics_1.SchematicsException(`Project "${options.project}" does not exist.`);
79
+ }
80
+ if (options.path === undefined) {
81
+ options.path = (0, workspace_1.buildDefaultPath)(project);
82
+ }
83
+ const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
84
+ options.name = parsedPath.name;
85
+ options.path = parsedPath.path;
86
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
87
+ (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
88
+ (0, schematics_1.move)(parsedPath.path),
89
+ ]);
90
+ return (0, schematics_1.chain)([
91
+ addInserts(options),
92
+ (0, schematics_1.mergeWith)(templateSource)
93
+ ]);
94
+ });
95
+ }
96
+ exports.module = module;
88
97
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2DAA+F;AAC/F,uEAAmE;AACnE,iEAA2D;AAE3D,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB,iGAAiG;AACjG,YAAY;AACZ,SAAgB,MAAM,CAAC,QAAa;IAClC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,MAAM,aAAa,GAAG,cAAc,CAAC;QAErC,gDAAgD;QAChD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;YAC3B,MAAM,IAAI,gCAAmB,CAAC,uEAAuE,CAAC,CAAC;QAE3G,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAA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AAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QAErD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAiB,CAAC,CAAC;QAElE,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,IAAI,gCAAmB,CAAC,YAAY,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;SAC/E;QAED,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;YAC9B,OAAO,CAAC,IAAI,GAAG,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;SAC1C;QAED,MAAM,UAAU,GAAG,IAAA,sBAAS,EAAC,OAAO,CAAC,IAAc,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC/B,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAE/B,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,kCACT,cAAO,GACP,OAAO,EACV;YACF,IAAA,iBAAI,EAAC,UAAU,CAAC,IAAI,CAAC;SACtB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,UAAU,CAAC,OAAO,CAAC;YACnB,IAAA,sBAAS,EAAC,cAAc,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AAhCD,wBAgCC"}
@@ -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('module', () => {
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('module', {}, 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('module', () => {
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('module', {}, schematics_1.Tree.empty()).toPromise();
20
+ expect(tree.files).toEqual([]);
21
+ }));
22
+ });
23
23
  //# sourceMappingURL=index_spec.js.map
@@ -1,19 +1,38 @@
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
- },
16
- "required": [
17
- "name"
18
- ]
19
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "ModuleSchema",
4
+ "title": "Module Schema",
5
+ "type": "object",
6
+ "description": "Creates a new module in the default project.",
7
+ "properties": {
8
+ "index": {
9
+ "type": "number",
10
+ "default": 1
11
+ },
12
+ "project": {
13
+ "type": "string",
14
+ "description": "The name of the project.",
15
+ "$default": {
16
+ "$source": "projectName"
17
+ }
18
+ },
19
+ "name": {
20
+ "type": "string",
21
+ "description": "The name of the module.",
22
+ "$default": {
23
+ "$source": "argv",
24
+ "index": 0
25
+ },
26
+ "x-prompt": "What name would you like to use for the module?"
27
+ },
28
+ "lazyLoading": {
29
+ "type": "boolean",
30
+ "description": "Have it lazy loaded.",
31
+ "default": false,
32
+ "x-prompt": "Would you like the module to be lazy loaded?"
33
+ }
34
+ },
35
+ "required": [
36
+ "name"
37
+ ]
38
+ }
@@ -1 +1 @@
1
- export declare function CamelCaseFormatter(name: string, lower: boolean): string;
1
+ export declare function CamelCaseFormatter(name: string, lower: boolean): string;
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CamelCaseFormatter = void 0;
4
- function CamelCaseFormatter(name, lower) {
5
- // e.g. list-style-image to ListStyleImage
6
- let camelName = name.charAt(0).toUpperCase() + name.substr(1);
7
- if (name.indexOf('-') != -1) {
8
- const names = name.split('-');
9
- for (var i = 0; i < names.length; i++) {
10
- names[i] = names[i].charAt(0).toUpperCase() + names[i].substr(1);
11
- }
12
- camelName = names.join("");
13
- }
14
- if (lower)
15
- camelName = camelName.charAt(0).toLowerCase() + camelName.substr(1);
16
- return camelName;
17
- }
18
- exports.CamelCaseFormatter = CamelCaseFormatter;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CamelCaseFormatter = void 0;
4
+ function CamelCaseFormatter(name, lower) {
5
+ // e.g. list-style-image to ListStyleImage
6
+ let camelName = name.charAt(0).toUpperCase() + name.substr(1);
7
+ if (name.indexOf('-') != -1) {
8
+ const names = name.split('-');
9
+ for (var i = 0; i < names.length; i++) {
10
+ names[i] = names[i].charAt(0).toUpperCase() + names[i].substr(1);
11
+ }
12
+ camelName = names.join("");
13
+ }
14
+ if (lower)
15
+ camelName = camelName.charAt(0).toLowerCase() + camelName.substr(1);
16
+ return camelName;
17
+ }
18
+ exports.CamelCaseFormatter = CamelCaseFormatter;
19
19
  //# sourceMappingURL=camelcase-formatter.js.map
@@ -1,5 +1,8 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export interface IHash {
3
- [details: string]: number;
4
- }
5
- export declare function AddStatements(filePath: string, labels: string[], statements: string[], tree: Tree): void;
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ import { Change } from '@schematics/angular/utility/change';
3
+ export interface IHash {
4
+ [details: string]: number;
5
+ }
6
+ export declare function getSourceText(host: Tree, filePath: string): string;
7
+ export declare function simpleInsert(sourceText: string, fileToEdit: string, labels: string[], statements: string[]): Change[];
8
+ export declare function AddStatements(filePath: string, labels: string[], statements: string[], tree: Tree): void;