ngrx-entity-crud 19.2.1-beta.5 → 19.2.1-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngrx-entity-crud",
3
- "version": "19.2.1-beta.5",
3
+ "version": "19.2.1-beta.7",
4
4
  "repository": "https://github.com/jucasoft/ngrx-entity-crud",
5
5
  "license": "MIT",
6
6
  "schematics": "./schematics/collection.json",
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function makeAuth(options: Auth): Rule;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeAuth = makeAuth;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const my_utility_1 = require("../my-utility");
6
+ const core_1 = require("@angular-devkit/core");
7
+ function makeAuth(options) {
8
+ return (tree, _context) => {
9
+ const workspaceConfig = tree.read('/angular.json');
10
+ if (!workspaceConfig) {
11
+ throw new schematics_1.SchematicsException('Could not find Angular workspace configuration');
12
+ }
13
+ // convert workspace to string
14
+ const workspaceContent = workspaceConfig.toString();
15
+ // parse workspace string into JSON object
16
+ const workspace = JSON.parse(workspaceContent);
17
+ if (!options.project) {
18
+ options.project = workspace.defaultProject;
19
+ }
20
+ const projectName = options.project;
21
+ const project = workspace.projects[projectName];
22
+ const projectType = project.projectType === 'application' ? 'app' : 'lib';
23
+ options.path = `${project.sourceRoot}/${projectType}`;
24
+ options.clazz = 'Auth';
25
+ options.name = 'auth';
26
+ let pathApp = 'src/app';
27
+ let pathStore = 'src/app/root-store';
28
+ let pathView = 'src/app/main/views';
29
+ let pathService = 'src/app/main/services';
30
+ let pathVo = 'src/app/main/models/vo/';
31
+ const conf = tree.read('/ngrx-entity-crud.conf.json');
32
+ if (conf) {
33
+ const confData = JSON.parse(conf.toString());
34
+ pathView = confData.pathView;
35
+ pathStore = confData.pathStore;
36
+ pathApp = confData.pathApp;
37
+ pathService = confData.pathService;
38
+ pathVo = confData.pathVo;
39
+ }
40
+ console.log('pathView', pathView);
41
+ console.log('pathStore', pathStore);
42
+ console.log('pathApp', pathApp);
43
+ console.log('pathService', pathService);
44
+ console.log('pathVo', pathVo);
45
+ const view = getView(options, pathView, pathApp);
46
+ const store = getStore(options, pathStore, pathVo);
47
+ return (0, schematics_1.chain)([...view, ...store]);
48
+ };
49
+ }
50
+ function getView(options, pathView, pathApp) {
51
+ const result = [
52
+ (0, my_utility_1.render)(options, './files/views', pathView),
53
+ (0, my_utility_1.addRouteDeclarationToNgModule)({
54
+ module: `${pathApp}/app-routing.module.ts`,
55
+ routeLiteral: '{path: \'login\', loadChildren: () => import(\'./main/views/login/login.module\').then(m => m.LoginModule)}'
56
+ })
57
+ ];
58
+ return result;
59
+ }
60
+ function getStore(options, pathStore, pathVo) {
61
+ const result = [
62
+ (0, my_utility_1.addExport)(options, (0, core_1.normalize)(`${pathStore}/index.ts`)),
63
+ (0, my_utility_1.addExport)(options, (0, core_1.normalize)(`${pathStore}/index.d.ts`)),
64
+ (0, my_utility_1.addImport)((0, core_1.normalize)(`${pathStore}/state.ts`), `import {${options.clazz}} from '@models/vo/${core_1.strings.dasherize(options.clazz)}';`),
65
+ (0, my_utility_1.updateState)(`${core_1.strings.underscore(options.name)}:${options.clazz};`, (0, core_1.normalize)(`${pathStore}/state.ts`)),
66
+ (0, my_utility_1.render)(options, './files/store', pathStore),
67
+ (0, my_utility_1.render)(options, './files/model', pathVo),
68
+ (0, my_utility_1.addDeclarationToNgModule)({
69
+ module: `${pathStore}/root-store.module.ts`,
70
+ name: `${options.clazz}Store`,
71
+ path: `@root-store/${core_1.strings.dasherize(options.clazz)}-store`
72
+ })
73
+ ];
74
+ return result;
75
+ }
76
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAIA,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SAAS,QAAQ,CAAC,OAAa,EAAE,SAAiB,EAAE,MAAc;IAChE,MAAM,MAAM,GAAW;QACrB,IAAA,sBAAS,EAAC,OAAO,EAAE,IAAA,gBAAS,EAAC,GAAG,SAAS,WAAW,CAAC,CAAC;QACtD,IAAA,sBAAS,EAAC,OAAO,EAAE,IAAA,gBAAS,EAAC,GAAG,SAAS,aAAa,CAAC,CAAC;QACxD,IAAA,sBAAS,EAAC,IAAA,gBAAS,EAAC,GAAG,SAAS,WAAW,CAAC,EAAE,WAAW,OAAO,CAAC,KAAK,sBAAsB,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QACjI,IAAA,wBAAW,EAAC,GAAG,cAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,GAAG,EAAE,IAAA,gBAAS,EAAC,GAAG,SAAS,WAAW,CAAC,CAAC;QACxG,IAAA,mBAAM,EAAC,OAAO,EAAE,eAAe,EAAE,SAAS,CAAC;QAC3C,IAAA,mBAAM,EAAC,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC;QACxC,IAAA,qCAAwB,EAAC;YACvB,MAAM,EAAE,GAAG,SAAS,uBAAuB;YAC3C,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,OAAO;YAC7B,IAAI,EAAE,eAAe,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ;SAC9D,CAAC;KACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function makeAuth0(options: Auth): Rule;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeAuth0 = makeAuth0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const my_utility_1 = require("../my-utility");
6
+ const core_1 = require("@angular-devkit/core");
7
+ function makeAuth0(options) {
8
+ return (tree, _context) => {
9
+ const workspaceConfig = tree.read('/angular.json');
10
+ if (!workspaceConfig) {
11
+ throw new schematics_1.SchematicsException('Could not find Angular workspace configuration');
12
+ }
13
+ // convert workspace to string
14
+ const workspaceContent = workspaceConfig.toString();
15
+ // parse workspace string into JSON object
16
+ const workspace = JSON.parse(workspaceContent);
17
+ if (!options.project) {
18
+ options.project = workspace.defaultProject;
19
+ }
20
+ const projectName = options.project;
21
+ const project = workspace.projects[projectName];
22
+ const projectType = project.projectType === 'application' ? 'app' : 'lib';
23
+ options.path = `${project.sourceRoot}/${projectType}`;
24
+ options.clazz = 'Auth';
25
+ options.name = 'auth';
26
+ let pathApp = 'src/app';
27
+ let pathStore = 'src/app/root-store';
28
+ let pathView = 'src/app/main/views';
29
+ let pathService = 'src/app/main/services';
30
+ let pathVo = 'src/app/main/models/vo/';
31
+ const conf = tree.read('/ngrx-entity-crud.conf.json');
32
+ if (conf) {
33
+ const confData = JSON.parse(conf.toString());
34
+ pathView = confData.pathView;
35
+ pathStore = confData.pathStore;
36
+ pathApp = confData.pathApp;
37
+ pathService = confData.pathService;
38
+ pathVo = confData.pathVo;
39
+ }
40
+ console.log('pathView', pathView);
41
+ console.log('pathStore', pathStore);
42
+ console.log('pathApp', pathApp);
43
+ console.log('pathService', pathService);
44
+ console.log('pathVo', pathVo);
45
+ // const view = getView(options, pathView);
46
+ const store = getStore(options, pathStore, pathVo);
47
+ return (0, schematics_1.chain)([...store]);
48
+ };
49
+ }
50
+ function getStore(options, path, pathVo) {
51
+ const result = [
52
+ (0, my_utility_1.addExport)(options, (0, core_1.normalize)(`${path}/index.ts`)),
53
+ (0, my_utility_1.addExport)(options, (0, core_1.normalize)(`${path}/index.d.ts`)),
54
+ (0, my_utility_1.addImport)((0, core_1.normalize)(`${path}/state.ts`), `import {${options.clazz}} from '@models/vo/${core_1.strings.dasherize(options.clazz)}';`),
55
+ (0, my_utility_1.updateState)(`${core_1.strings.underscore(options.name)}:${options.clazz};`, (0, core_1.normalize)(`${path}/state.ts`)),
56
+ (0, my_utility_1.render)(options, './files/store', path),
57
+ (0, my_utility_1.render)(options, './files/model', pathVo),
58
+ (0, my_utility_1.addDeclarationToNgModule)({
59
+ module: `${path}/root-store.module.ts`,
60
+ name: `${options.clazz}Store`,
61
+ path: `@root-store/${core_1.strings.dasherize(options.clazz)}-store`
62
+ })
63
+ ];
64
+ return result;
65
+ }
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAIA,8BAsDC;AA1DD,2DAAoG;AACpG,8CAAkG;AAClG,+CAAwD;AAExD,SAAgB,SAAS,CAAC,OAAa;IACrC,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,gCAAmB,CAAC,gDAAgD,CAAC,CAAC;QAClF,CAAC;QAED,8BAA8B;QAC9B,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;QAEpD,0CAA0C;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,cAAc,CAAC;QAC7C,CAAC;QAED,MAAM,WAAW,GAAG,OAAO,CAAC,OAAiB,CAAC;QAE9C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEhD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAE1E,OAAO,CAAC,IAAI,GAAG,GAAG,OAAO,CAAC,UAAU,IAAI,WAA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CAAC,OAAa,EAAE,IAAY,EAAE,MAAc;IAC3D,MAAM,MAAM,GAAW;QACrB,IAAA,sBAAS,EAAC,OAAO,EAAE,IAAA,gBAAS,EAAC,GAAG,IAAI,WAAW,CAAC,CAAC;QACjD,IAAA,sBAAS,EAAC,OAAO,EAAE,IAAA,gBAAS,EAAC,GAAG,IAAI,aAAa,CAAC,CAAC;QACnD,IAAA,sBAAS,EAAC,IAAA,gBAAS,EAAC,GAAG,IAAI,WAAW,CAAC,EAAE,WAAW,OAAO,CAAC,KAAK,sBAAsB,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5H,IAAA,wBAAW,EAAC,GAAG,cAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,GAAG,EAAE,IAAA,gBAAS,EAAC,GAAG,IAAI,WAAW,CAAC,CAAC;QACnG,IAAA,mBAAM,EAAC,OAAO,EAAE,eAAe,EAAE,IAAI,CAAC;QACtC,IAAA,mBAAM,EAAC,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC;QACxC,IAAA,qCAAwB,EAAC;YACvB,MAAM,EAAE,GAAG,IAAI,uBAAuB;YACtC,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,OAAO;YAC7B,IAAI,EAAE,eAAe,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ;SAC9D,CAAC;KACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { ModuleOptions } from '@schematics/angular/utility/find-module';
3
+ /**
4
+ * Aggiunge l'export nell'index.ts e index.d.ts
5
+ */
6
+ export declare function addExport(options: {
7
+ clazz: string;
8
+ }, file: string): Rule;
9
+ /**
10
+ * Aggiorna l'interfaccia dell'interfaccia
11
+ */
12
+ export declare function updateState(newLine: string, file: string): Rule;
13
+ /**
14
+ * Aggiunge l'import nella parte del file.
15
+ */
16
+ export declare function addImport(file: string, importString: string): Rule;
17
+ /**
18
+ * Aggiunge al selettore principale RootSelector, i riferimenti allo store appena creato.
19
+ */
20
+ export declare function addRootSelector(options: {
21
+ clazz: string;
22
+ }, file: string): Rule;
23
+ /**
24
+ * viene aggiornato un un file che contiene un json
25
+ */
26
+ /**
27
+ * Aggiunge una linea all'interno di un file.
28
+ * Il punto dove viene aggiunto viene indicato passando una serie di pattern a comporre un percorso univoco all'interno del file.
29
+ * La linea verrà aggiunta immediatamento dopo l'ultimo pattern.
30
+ *
31
+ * @param content attuale contenuto testuale del file a cui aggiungerela linea
32
+ * @param patterns sequenza di chiavi che servono a identificare il punto dove aggiungere la linea, come per i css
33
+ * @param newLine linea da aggiungere
34
+ */
35
+ export declare function addLine(content: string, patterns: string[], newLine: string): string;
36
+ /**
37
+ * Aggiunge il modulo del nuovo store creato, come dipendenza del modulo Root
38
+ */
39
+ export declare function addDeclarationToNgModule(options: ModuleOptions): Rule;
40
+ /**
41
+ * Aggiunge il modulo del nuovo store creato, come dipendenza del modulo Root
42
+ */
43
+ export declare function addRouteDeclarationToNgModule(options: {
44
+ module: string;
45
+ routeLiteral: string;
46
+ }): Rule;
47
+ /**
48
+ *
49
+ * Returns the name of the installed graphics library.:
50
+ * - primeng
51
+ * - ionic
52
+ *
53
+ */
54
+ /**
55
+ *
56
+ */
57
+ export declare function render(options: any, sourceTemplate: string, path: string): Rule;
58
+ export declare function updateTsConfigSelector(): Rule;
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addExport = addExport;
4
+ exports.updateState = updateState;
5
+ exports.addImport = addImport;
6
+ exports.addRootSelector = addRootSelector;
7
+ exports.addLine = addLine;
8
+ exports.addDeclarationToNgModule = addDeclarationToNgModule;
9
+ exports.addRouteDeclarationToNgModule = addRouteDeclarationToNgModule;
10
+ exports.render = render;
11
+ exports.updateTsConfigSelector = updateTsConfigSelector;
12
+ const schematics_1 = require("@angular-devkit/schematics");
13
+ const core_1 = require("@angular-devkit/core");
14
+ const ts = require("typescript/lib/tsserverlibrary");
15
+ const change_1 = require("@schematics/angular/utility/change");
16
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
17
+ /**
18
+ * Aggiunge l'export nell'index.ts e index.d.ts
19
+ */
20
+ function addExport(options, file) {
21
+ return (tree, _context) => {
22
+ const content = tree.read(file);
23
+ let strContent = '';
24
+ if (content) {
25
+ strContent = content.toString();
26
+ }
27
+ const dirName = `${core_1.strings.dasherize(options.clazz)}-store`;
28
+ const updatedContent = strContent.concat('\nexport * from \'./' + dirName + '\';');
29
+ tree.overwrite(file, updatedContent);
30
+ return tree;
31
+ };
32
+ }
33
+ /**
34
+ * Aggiorna l'interfaccia dell'interfaccia
35
+ */
36
+ function updateState(newLine, file) {
37
+ return (tree, _context) => {
38
+ const content = tree.read(file);
39
+ let strContent = '';
40
+ if (content) {
41
+ strContent = content.toString();
42
+ }
43
+ const startIndex = strContent.indexOf('export');
44
+ const endIndex = strContent.indexOf('{', startIndex);
45
+ strContent =
46
+ strContent.slice(0, endIndex + 1) +
47
+ '\n' +
48
+ newLine +
49
+ strContent.slice(endIndex + 1);
50
+ tree.overwrite(file, strContent);
51
+ return tree;
52
+ };
53
+ }
54
+ /**
55
+ * Aggiunge l'import nella parte del file.
56
+ */
57
+ function addImport(file, importString) {
58
+ return (tree, _context) => {
59
+ const content = tree.read(file);
60
+ let strContent = '';
61
+ if (content) {
62
+ strContent = content.toString();
63
+ }
64
+ strContent = importString + '\n' + strContent;
65
+ tree.overwrite(file, strContent);
66
+ return tree;
67
+ };
68
+ }
69
+ /**
70
+ * Aggiunge al selettore principale RootSelector, i riferimenti allo store appena creato.
71
+ */
72
+ function addRootSelector(options, file) {
73
+ return (tree) => {
74
+ const content = tree.read(file);
75
+ let strContent = '';
76
+ if (content) {
77
+ strContent = content.toString();
78
+ }
79
+ strContent = addLine(strContent, ['selectError', 'createSelectorFactory', 'customMemoizer', '('], `${options.clazz}StoreSelectors.selectError,`);
80
+ strContent = addLine(strContent, ['selectIsLoading', 'createSelectorFactory', 'customMemoizer', '('], `${options.clazz}StoreSelectors.selectIsLoading,`);
81
+ tree.overwrite(file, strContent);
82
+ return tree;
83
+ };
84
+ }
85
+ /**
86
+ * viene aggiornato un un file che contiene un json
87
+ */
88
+ // export function updateJson(objToMerge: any, file: string): Rule {
89
+ // return (tree: Tree) => {
90
+ // const content: Buffer | null = tree.read(file);
91
+ // let strContent: string = '';
92
+ // if (content) {
93
+ // strContent = content.toString();
94
+ // }
95
+ // const obj = JSON.parse(strContent);
96
+ //
97
+ // const objB = merge(obj, objToMerge);
98
+ //
99
+ // const result = JSON.stringify(objB);
100
+ // tree.overwrite(file, result);
101
+ // return tree;
102
+ // };
103
+ // }
104
+ /**
105
+ * Aggiunge una linea all'interno di un file.
106
+ * Il punto dove viene aggiunto viene indicato passando una serie di pattern a comporre un percorso univoco all'interno del file.
107
+ * La linea verrà aggiunta immediatamento dopo l'ultimo pattern.
108
+ *
109
+ * @param content attuale contenuto testuale del file a cui aggiungerela linea
110
+ * @param patterns sequenza di chiavi che servono a identificare il punto dove aggiungere la linea, come per i css
111
+ * @param newLine linea da aggiungere
112
+ */
113
+ function addLine(content, patterns, newLine) {
114
+ let index = 0;
115
+ patterns.forEach((value) => {
116
+ index = content.indexOf(value, index) + value.length;
117
+ });
118
+ return content.slice(0, index + 1) + newLine + content.slice(index);
119
+ }
120
+ /**
121
+ * Aggiunge il modulo del nuovo store creato, come dipendenza del modulo Root
122
+ */
123
+ function addDeclarationToNgModule(options) {
124
+ return (host) => {
125
+ if (!options.module) {
126
+ return host;
127
+ }
128
+ const modulePath = options.module;
129
+ const text = host.read(modulePath);
130
+ if (text === null) {
131
+ throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
132
+ }
133
+ const sourceText = text.toString();
134
+ const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
135
+ // const relativePath = buildRelativeModulePath(options, modulePath);
136
+ const changes = (0, ast_utils_1.addImportToModule)(source, modulePath, core_1.strings.classify(`${options.name}Module`), options.path);
137
+ const recorder = host.beginUpdate(modulePath);
138
+ for (const change of changes) {
139
+ if (change instanceof change_1.InsertChange) {
140
+ recorder.insertLeft(change.pos, change.toAdd);
141
+ }
142
+ }
143
+ host.commitUpdate(recorder);
144
+ return host;
145
+ };
146
+ }
147
+ /**
148
+ * Aggiunge il modulo del nuovo store creato, come dipendenza del modulo Root
149
+ */
150
+ function addRouteDeclarationToNgModule(options) {
151
+ return (host) => {
152
+ if (!options.module) {
153
+ return host;
154
+ }
155
+ const modulePath = options.module;
156
+ const text = host.read(modulePath);
157
+ if (text === null) {
158
+ throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
159
+ }
160
+ const sourceText = text.toString();
161
+ const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
162
+ const change = (0, ast_utils_1.addRouteDeclarationToModule)(source, modulePath, options.routeLiteral);
163
+ const recorder = host.beginUpdate(modulePath);
164
+ if (change instanceof change_1.InsertChange) {
165
+ recorder.insertLeft(change.pos, change.toAdd);
166
+ }
167
+ host.commitUpdate(recorder);
168
+ return host;
169
+ };
170
+ }
171
+ /**
172
+ *
173
+ * Returns the name of the installed graphics library.:
174
+ * - primeng
175
+ * - ionic
176
+ *
177
+ */
178
+ /*export function getGraphicsLibraryName(tree: Tree): string {
179
+ const content: Buffer | null = tree.read('package.json');
180
+ let strContent: string = '';
181
+ if (content) {
182
+ strContent = content.toString();
183
+ }
184
+ if (strContent.indexOf('ionic') !== -1) {
185
+ return 'ionic';
186
+ }
187
+ if (strContent.indexOf('primeng') !== -1) {
188
+ return 'primeng';
189
+ }
190
+ return 'no-libs';
191
+ }*/
192
+ /**
193
+ *
194
+ */
195
+ function render(options, sourceTemplate, path) {
196
+ return (_tree, _context) => {
197
+ const _sourceTemplate = (0, schematics_1.url)(sourceTemplate);
198
+ const _path = (0, core_1.normalize)(path);
199
+ const sourceTemplateParametrized = (0, schematics_1.apply)(_sourceTemplate, [
200
+ (0, schematics_1.template)(Object.assign(Object.assign({}, options), core_1.strings)),
201
+ (0, schematics_1.move)(_path),
202
+ ]);
203
+ return (0, schematics_1.mergeWith)(sourceTemplateParametrized, 14);
204
+ };
205
+ }
206
+ function updateTsConfigSelector() {
207
+ return (tree) => {
208
+ const content = tree.read('/tsconfig.json');
209
+ let strContent = '';
210
+ if (content) {
211
+ strContent = content.toString();
212
+ }
213
+ const comment = '/* To learn more about this file see: https://angular.io/config/tsconfig. */';
214
+ let isCommentRemoved = false;
215
+ if (strContent.substring(0, 76) === comment) {
216
+ strContent = strContent.replace(strContent.substring(0, 77), '');
217
+ isCommentRemoved = true;
218
+ }
219
+ const tsconfigJson = JSON.parse(strContent);
220
+ const compilerOptionsPaths = tsconfigJson.compilerOptions.paths || {};
221
+ console.log('compilerOptionsPaths', compilerOptionsPaths);
222
+ const compilerOptionsPathsB = {
223
+ '@components/*': ['src/app/main/components/*'],
224
+ '@services/*': ['src/app/main/services/*'],
225
+ '@models/*': ['src/app/main/models/*'],
226
+ '@views/*': ['src/app/main/views/*'],
227
+ '@core/*': ['src/app/core/*'],
228
+ '@root-store/*': ['src/app/root-store/*'],
229
+ };
230
+ console.log('compilerOptionsPathsB', compilerOptionsPathsB);
231
+ tsconfigJson.compilerOptions.paths = Object.assign(Object.assign({}, compilerOptionsPaths), compilerOptionsPathsB);
232
+ tsconfigJson.compilerOptions.strict = false;
233
+ tsconfigJson.angularCompilerOptions.strictPropertyInitialization = false;
234
+ console.log('tsconfigJson', tsconfigJson);
235
+ let strContentB = JSON.stringify(tsconfigJson, null, '\t');
236
+ if (isCommentRemoved) {
237
+ strContentB = comment.concat('\n' + strContentB);
238
+ }
239
+ tree.overwrite('/tsconfig.json', strContentB);
240
+ return tree;
241
+ };
242
+ }
243
+ //# sourceMappingURL=my-utility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"my-utility.js","s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OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;QAC1C,IAAI,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,gBAAgB,EAAE,CAAC;YACrB,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function ngAdd(options: NgAdd): Rule;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ngAdd = ngAdd;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const my_utility_1 = require("../my-utility");
6
+ // Just return the tree
7
+ function ngAdd(options) {
8
+ return (tree) => {
9
+ const workspaceConfig = tree.read('/angular.json');
10
+ if (!workspaceConfig) {
11
+ throw new schematics_1.SchematicsException('Could not find Angular workspace configuration');
12
+ }
13
+ // convert workspace to string
14
+ const workspaceContent = workspaceConfig.toString();
15
+ // parse workspace string into JSON object
16
+ const workspace = JSON.parse(workspaceContent);
17
+ if (!options.project) {
18
+ options.project = workspace.defaultProject;
19
+ }
20
+ let pathApp = 'src/app';
21
+ let pathStore = 'src/app/root-store';
22
+ let pathView = 'src/app/main/views';
23
+ let pathService = 'src/app/main/services';
24
+ let pathVo = 'src/app/main/models/vo/';
25
+ const conf = tree.read('/ngrx-entity-crud.conf.json');
26
+ if (conf) {
27
+ const confData = JSON.parse(conf.toString());
28
+ pathView = confData.pathView;
29
+ pathStore = confData.pathStore;
30
+ pathApp = confData.pathApp;
31
+ pathService = confData.pathService;
32
+ pathVo = confData.pathVo;
33
+ }
34
+ console.log('pathView', pathView);
35
+ console.log('pathStore', pathStore);
36
+ console.log('pathApp', pathApp);
37
+ console.log('pathService', pathService);
38
+ console.log('pathVo', pathVo);
39
+ // updateTsConfigSelector()
40
+ const baseRules = [
41
+ // addImport(normalize(`${pathStore}/state.ts`), `import {${options.clazz}} from '@models/vo/${strings.dasherize(options.clazz)}';`),
42
+ // updateState(`${strings.underscore(options.name)}:${options.clazz};`, normalize(`${pathStore}/state.ts`)),
43
+ (0, my_utility_1.render)(options, './files', ''),
44
+ (0, my_utility_1.addDeclarationToNgModule)({
45
+ module: `${pathApp}/app.module.ts`,
46
+ name: 'ThemeJng',
47
+ path: './core/theme/theme-jng.module'
48
+ }),
49
+ (0, my_utility_1.addDeclarationToNgModule)({
50
+ module: `${pathApp}/app.module.ts`,
51
+ name: 'BrowserAnimations',
52
+ path: '@angular/platform-browser/animations'
53
+ }),
54
+ (0, my_utility_1.addDeclarationToNgModule)({
55
+ module: `${pathApp}/app.module.ts`,
56
+ name: 'RootStore',
57
+ path: './root-store'
58
+ }),
59
+ (0, my_utility_1.addDeclarationToNgModule)({
60
+ module: `${pathApp}/app.module.ts`,
61
+ name: 'HttpClient',
62
+ path: '@angular/common/http'
63
+ }),
64
+ (0, my_utility_1.updateTsConfigSelector)()
65
+ ];
66
+ return (0, schematics_1.chain)(baseRules);
67
+ };
68
+ }
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAIA,sBAsEC;AA1ED,2DAAkF;AAClF,8CAAuF;AAEvF,uBAAuB;AACvB,SAAgB,KAAK,CAAC,OAAc;IAClC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,gCAAmB,CAAC,gDAAgD,CAAC,CAAC;QAClF,CAAC;QAED,8BAA8B;QAC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rI,4GAA4G;YAC5G,IAAA,mBAAM,EAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC;YAChC,IAAA,qCAAwB,EAAC;gBACrB,MAAM,EAAE,GAAG,OAAO,gBAAgB;gBAClC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,+BAA+B;aACtC,CAAC;YACF,IAAA,qCAAwB,EAAC;gBACvB,MAAM,EAAE,GAAG,OAAO,gBAAgB;gBAClC,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,sCAAsC;aAC7C,CAAC;YACF,IAAA,qCAAwB,EAAC;gBACvB,MAAM,EAAE,GAAG,OAAO,gBAAgB;gBAClC,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,cAAc;aACrB,CAAC;YACF,IAAA,qCAAwB,EAAC;gBACvB,MAAM,EAAE,GAAG,OAAO,gBAAgB;gBAClC,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,sBAAsB;aAC7B,CAAC;YACF,IAAA,mCAAsB,GAAE;SACzB,CAAC;QAEF,OAAO,IAAA,kBAAK,EAAC,SAAS,CAAC,CAAC;IAE1B,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare function crudSection(options: CrudSection): Rule;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.crudSection = crudSection;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const core_1 = require("@angular-devkit/core");
6
+ const my_utility_1 = require("../my-utility");
7
+ function crudSection(options) {
8
+ return (tree, _context) => {
9
+ options.clazz = core_1.strings.classify(options.clazz);
10
+ const workspaceConfig = tree.read('/angular.json');
11
+ if (!workspaceConfig) {
12
+ throw new schematics_1.SchematicsException('Could not find Angular workspace configuration');
13
+ }
14
+ // convert workspace to string
15
+ const workspaceContent = workspaceConfig.toString();
16
+ // parse workspace string into JSON object
17
+ const workspace = JSON.parse(workspaceContent);
18
+ if (!options.project) {
19
+ options.project = workspace.defaultProject;
20
+ }
21
+ const projectName = options.project;
22
+ const project = workspace.projects[projectName];
23
+ const projectType = project.projectType === 'application' ? 'app' : 'lib';
24
+ options.path = `${project.sourceRoot}/${projectType}`;
25
+ const lib = options.lib;
26
+ let pathApp = 'src/app';
27
+ let pathStore = 'src/app/root-store';
28
+ let pathView = 'src/app/main/views';
29
+ let pathService = 'src/app/main/services';
30
+ let pathVo = 'src/app/main/models/vo/';
31
+ const conf = tree.read('/ngrx-entity-crud.conf.json');
32
+ if (conf) {
33
+ const confData = JSON.parse(conf.toString());
34
+ pathView = confData.pathView;
35
+ pathStore = confData.pathStore;
36
+ pathApp = confData.pathApp;
37
+ pathService = confData.pathService;
38
+ pathVo = confData.pathVo;
39
+ }
40
+ console.log('pathView', pathView);
41
+ console.log('pathStore', pathStore);
42
+ console.log('pathApp', pathApp);
43
+ console.log('pathService', pathService);
44
+ console.log('pathVo', pathVo);
45
+ console.log('lib: ', lib);
46
+ const _chain = [];
47
+ _chain.push((0, my_utility_1.render)(options, `./files/${lib}`, pathView));
48
+ _chain.push((0, my_utility_1.addRouteDeclarationToNgModule)({
49
+ module: `${pathApp}/app-routing.module.ts`,
50
+ routeLiteral: `{path: '${core_1.strings.dasherize(options.clazz)}', loadChildren: () => import('./main/views/${core_1.strings.dasherize(options.clazz)}/${core_1.strings.dasherize(options.clazz)}.module').then(m => m.${options.clazz}Module)}`
51
+ }));
52
+ return (0, schematics_1.chain)(_chain);
53
+ };
54
+ }
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAIA,kCA4DC;AAhED,2DAAoG;AACpG,+CAA6C;AAC7C,8CAAoE;AAEpE,SAAgB,WAAW,CAAC,OAAoB;IAC9C,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,OAAO,CAAC,KAAK,GAAG,cAAO,CAAC,QAA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+1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeStore = makeStore;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const core_1 = require("@angular-devkit/core");
6
+ const my_utility_1 = require("../my-utility");
7
+ function makeStore(options) {
8
+ return (tree, _context) => {
9
+ console.log('makeStore(options: CrudStore): Rule');
10
+ options.clazz = core_1.strings.classify(options.clazz);
11
+ options.name = options.name ? core_1.strings.underscore(options.name) : core_1.strings.underscore(options.clazz);
12
+ const workspaceConfig = tree.read('/angular.json');
13
+ if (!workspaceConfig) {
14
+ throw new schematics_1.SchematicsException('Could not find Angular workspace configuration');
15
+ }
16
+ // convert workspace to string
17
+ const workspaceContent = workspaceConfig.toString();
18
+ // parse workspace string into JSON object
19
+ const workspace = JSON.parse(workspaceContent);
20
+ if (!options.project) {
21
+ options.project = workspace.defaultProject;
22
+ }
23
+ let pathApp = 'src/app';
24
+ let pathStore = 'src/app/root-store';
25
+ let pathView = 'src/app/main/views';
26
+ let pathService = 'src/app/main/services';
27
+ let pathVo = 'src/app/main/models/vo/';
28
+ const conf = tree.read('/ngrx-entity-crud.conf.json');
29
+ if (conf) {
30
+ const confData = JSON.parse(conf.toString());
31
+ pathView = confData.pathView;
32
+ pathStore = confData.pathStore;
33
+ pathApp = confData.pathApp;
34
+ pathService = confData.pathService;
35
+ pathVo = confData.pathVo;
36
+ }
37
+ console.log('pathView', pathView);
38
+ console.log('pathStore', pathStore);
39
+ console.log('pathApp', pathApp);
40
+ console.log('pathService', pathService);
41
+ console.log('pathVo', pathVo);
42
+ const genericRules = [
43
+ (0, my_utility_1.addExport)(options, (0, core_1.normalize)(`${pathStore}/index.ts`)),
44
+ (0, my_utility_1.addExport)(options, (0, core_1.normalize)(`${pathStore}/index.d.ts`)),
45
+ ];
46
+ const crudRules = [
47
+ (0, my_utility_1.addImport)((0, core_1.normalize)(`${pathStore}/state.ts`), `import {${options.clazz}StoreState} from '@root-store/${core_1.strings.dasherize(options.clazz)}-store';`),
48
+ (0, my_utility_1.updateState)(`${core_1.strings.underscore(options.name)}:${options.clazz}StoreState.State;`, (0, core_1.normalize)(`${pathStore}/state.ts`)),
49
+ (0, my_utility_1.addImport)((0, core_1.normalize)(`${pathStore}/selectors.ts`), `import {${options.clazz}StoreSelectors} from '@root-store/${core_1.strings.dasherize(options.clazz)}-store';`),
50
+ (0, my_utility_1.addRootSelector)(options, (0, core_1.normalize)(`${pathStore}/selectors.ts`)),
51
+ // render(options, './files/crud-store/plural', pathStore),
52
+ (0, my_utility_1.render)(options, './files/crud-model', pathVo),
53
+ (0, my_utility_1.addDeclarationToNgModule)({
54
+ module: `${pathStore}/root-store.module.ts`,
55
+ name: `${options.clazz}Store`,
56
+ path: `@root-store/${core_1.strings.dasherize(options.clazz)}-store`
57
+ })
58
+ ];
59
+ const baseRules = [
60
+ (0, my_utility_1.addImport)((0, core_1.normalize)(`${pathStore}/state.ts`), `import {${options.clazz}} from '@models/vo/${core_1.strings.dasherize(options.clazz)}';`),
61
+ (0, my_utility_1.updateState)(`${core_1.strings.underscore(options.name)}:${options.clazz};`, (0, core_1.normalize)(`${pathStore}/state.ts`)),
62
+ (0, my_utility_1.render)(options, './files/base-store', pathStore),
63
+ (0, my_utility_1.render)(options, './files/base-model', pathVo),
64
+ (0, my_utility_1.addDeclarationToNgModule)({
65
+ module: `${pathStore}/root-store.module.ts`,
66
+ name: `${options.clazz}Store`,
67
+ path: `@root-store/${core_1.strings.dasherize(options.clazz)}-store`
68
+ })
69
+ ];
70
+ if (options.type === 'CRUD+GRAPHQL') {
71
+ const graphqlSchema = tree.read('/graphql.schema.json');
72
+ if (!graphqlSchema) {
73
+ throw new schematics_1.SchematicsException('Could not find graphql.schema.json configuration');
74
+ }
75
+ const graphqlSchemaString = graphqlSchema.toString();
76
+ const graphqlSchemaJson = JSON.parse(graphqlSchemaString);
77
+ console.log('graphqlSchemaJson', graphqlSchemaJson);
78
+ const types = graphqlSchemaJson.__schema.types;
79
+ const itemType = types.find(value => value.kind === 'OBJECT' && value.name === options.clazz);
80
+ if (!itemType) {
81
+ throw new schematics_1.SchematicsException('Could not find "' + options.clazz + '" in graphql.schema.json configuration, update shema');
82
+ }
83
+ const fields = itemType.fields.map(value => value.name);
84
+ console.log('fieldsB', fields);
85
+ const optionsGQL = Object.assign(Object.assign({}, options), { gqlSchema: { fields } });
86
+ return (0, schematics_1.chain)([...genericRules, ...crudRules,
87
+ (0, my_utility_1.render)(optionsGQL, './files/crud-graphql', pathStore),
88
+ (0, my_utility_1.render)(options, './files/crud-service/graphql', pathService),
89
+ ]);
90
+ }
91
+ if (options.type === 'CRUD-PLURAL') {
92
+ return (0, schematics_1.chain)([
93
+ ...genericRules,
94
+ ...crudRules,
95
+ (0, my_utility_1.render)(options, './files/crud-store/plural', pathStore),
96
+ (0, my_utility_1.render)(options, './files/crud-service/plural', pathService)
97
+ ]);
98
+ }
99
+ if (options.type === 'CRUD-SINGULAR') {
100
+ return (0, schematics_1.chain)([
101
+ ...genericRules,
102
+ ...crudRules,
103
+ (0, my_utility_1.render)(options, './files/crud-store/singular', pathStore),
104
+ (0, my_utility_1.render)(options, './files/crud-service/singular', pathService)
105
+ ]);
106
+ }
107
+ if (options.type === 'BASE') {
108
+ return (0, schematics_1.chain)([
109
+ ...genericRules,
110
+ ...baseRules
111
+ ]);
112
+ }
113
+ };
114
+ }
115
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAIA,8BAqHC;AAzHD,2DAAoG;AACpG,+CAAwD;AACxD,8CAAmH;AAEnH,SAAgB,SAAS,CAAC,OAAkB;IAC1C,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,OAAO,CAAC,KAAK,GAAG,cAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACh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AAC;QACD,IAAI,OAAO,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YACrC,OAAO,IAAA,kBAAK,EAAC;gBACX,GAAG,YAAY;gBACf,GAAG,SAAS;gBACZ,IAAA,mBAAM,EAAC,OAAO,EAAE,6BAA6B,EAAE,SAAS,CAAC;gBACzD,IAAA,mBAAM,EAAC,OAAO,EAAE,+BAA+B,EAAE,WAAW,CAAC;aAC9D,CAAC,CAAC;QACL,CAAC;QACD,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC5B,OAAO,IAAA,kBAAK,EAAC;gBACX,GAAG,YAAY;gBACf,GAAG,SAAS;aACb,CAAC,CAAC;QACL,CAAC;IAEH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
- "lib": [
5
- "es2018",
6
- "dom"
7
- ],
4
+ "lib": ["es2018", "dom"],
8
5
  "declaration": true,
9
6
  "module": "commonjs",
10
7
  "moduleResolution": "node",
@@ -20,17 +17,8 @@
20
17
  "sourceMap": true,
21
18
  "strictNullChecks": true,
22
19
  "target": "es6",
23
- "types": [
24
- "jasmine",
25
- "node"
26
- ]
20
+ "types": ["node"]
27
21
  },
28
- "include": [
29
- "schematics/**/*",
30
- "schematics/*.ts"
31
-
32
- ],
33
- "exclude": [
34
- "schematics/*/files/**/*"
35
- ]
22
+ "include": ["schematics/**/*", "schematics/*.ts"],
23
+ "exclude": ["schematics/*/files/**/*"]
36
24
  }