ngrx-entity-crud 12.9.0-beta.2 → 12.9.0-beta.3
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
|
@@ -5,9 +5,7 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
5
5
|
const my_utility_1 = require("../my-utility");
|
|
6
6
|
// Just return the tree
|
|
7
7
|
function ngAdd(options) {
|
|
8
|
-
return (tree
|
|
9
|
-
console.log('makeStore(options: CrudStore): Rule');
|
|
10
|
-
console.log('context', context);
|
|
8
|
+
return (tree) => {
|
|
11
9
|
const workspaceConfig = tree.read('/angular.json');
|
|
12
10
|
if (!workspaceConfig) {
|
|
13
11
|
throw new schematics_1.SchematicsException('Could not find Angular workspace configuration');
|
|
@@ -15,12 +13,10 @@ function ngAdd(options) {
|
|
|
15
13
|
// convert workspace to string
|
|
16
14
|
const workspaceContent = workspaceConfig.toString();
|
|
17
15
|
// parse workspace string into JSON object
|
|
18
|
-
console.log('1');
|
|
19
16
|
const workspace = JSON.parse(workspaceContent);
|
|
20
17
|
if (!options.project) {
|
|
21
18
|
options.project = workspace.defaultProject;
|
|
22
19
|
}
|
|
23
|
-
console.log('2');
|
|
24
20
|
let pathApp = 'src/app';
|
|
25
21
|
let pathStore = 'src/app/root-store';
|
|
26
22
|
let pathView = 'src/app/main/views';
|
|
@@ -28,7 +24,6 @@ function ngAdd(options) {
|
|
|
28
24
|
let pathVo = 'src/app/main/models/vo/';
|
|
29
25
|
const conf = tree.read('/ngrx-entity-crud.conf.json');
|
|
30
26
|
if (conf) {
|
|
31
|
-
console.log('3');
|
|
32
27
|
const confData = JSON.parse(conf.toString());
|
|
33
28
|
pathView = confData.pathView;
|
|
34
29
|
pathStore = confData.pathStore;
|
|
@@ -41,29 +36,11 @@ function ngAdd(options) {
|
|
|
41
36
|
console.log('pathApp', pathApp);
|
|
42
37
|
console.log('pathService', pathService);
|
|
43
38
|
console.log('pathVo', pathVo);
|
|
44
|
-
/* const genericRules: Rule[] = [
|
|
45
|
-
addExport(options, normalize(`${pathStore}/index.ts`)),
|
|
46
|
-
addExport(options, normalize(`${pathStore}/index.d.ts`)),
|
|
47
|
-
];*/
|
|
48
|
-
/* const crudRules: Rule[] = [
|
|
49
|
-
addImport(normalize(`${pathStore}/state.ts`), `import {${options.clazz}StoreState} from '@root-store/${strings.dasherize(options.clazz)}-store';`),
|
|
50
|
-
updateState(`${strings.underscore(options.name)}:${options.clazz}StoreState.State;`, normalize(`${pathStore}/state.ts`)),
|
|
51
|
-
addImport(normalize(`${pathStore}/selectors.ts`), `import {${options.clazz}StoreSelectors} from '@root-store/${strings.dasherize(options.clazz)}-store';`),
|
|
52
|
-
addRootSelector(options, normalize(`${pathStore}/selectors.ts`)),
|
|
53
|
-
render(options, './files/crud-store', pathStore),
|
|
54
|
-
render(options, './files/crud-service', pathService),
|
|
55
|
-
render(options, './files/crud-model', pathVo),
|
|
56
|
-
addDeclarationToNgModule({
|
|
57
|
-
module: `${pathStore}/root-store.module.ts`,
|
|
58
|
-
name: `${options.clazz}Store`,
|
|
59
|
-
path: `@root-store/${strings.dasherize(options.clazz)}-store`
|
|
60
|
-
})
|
|
61
|
-
];*/
|
|
62
39
|
// updateTsConfigSelector()
|
|
63
40
|
const baseRules = [
|
|
64
41
|
// addImport(normalize(`${pathStore}/state.ts`), `import {${options.clazz}} from '@models/vo/${strings.dasherize(options.clazz)}';`),
|
|
65
42
|
// updateState(`${strings.underscore(options.name)}:${options.clazz};`, normalize(`${pathStore}/state.ts`)),
|
|
66
|
-
my_utility_1.render(options, './files', pathStore),
|
|
43
|
+
my_utility_1.render(options, './files/root-store', pathStore),
|
|
67
44
|
my_utility_1.addDeclarationToNgModule({
|
|
68
45
|
module: `${pathApp}/app.module.ts`,
|
|
69
46
|
name: `RootStore`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngrx-entity-crud/schematics/ng-add/index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