ngssm-schematics 15.2.2 → 15.2.4
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 +1 -1
- package/esm2020/lib/ngssm-schematics.module.mjs +4 -4
- package/fesm2015/ngssm-schematics.mjs +4 -4
- package/fesm2020/ngssm-schematics.mjs +4 -4
- package/package.json +1 -1
- package/schematics/add-ngssm/index.js +34 -1
- package/schematics/add-ngssm/index.js.map +1 -1
- package/schematics/collection.json +4 -4
- package/schematics/effect/files/__name@dasherize__.effect.spec.ts.template +25 -0
- package/schematics/effect/files/__name@dasherize__.effect.ts.template +1 -1
- package/schematics/effect/schema.json +4 -0
- package/schematics/{module/module-options.d.ts → feature/feature-options.d.ts} +1 -1
- package/schematics/{module/module-options.js → feature/feature-options.js} +1 -1
- package/schematics/feature/feature-options.js.map +1 -0
- package/schematics/feature/files/__name@dasherize__-routes.ts.template +3 -0
- package/schematics/{module → feature}/files/actions/__name@dasherize__-action-type.ts.template +0 -0
- package/schematics/{module → feature}/files/actions/index.ts.template +0 -0
- package/schematics/{module → feature}/files/components/.gitkeep +0 -0
- package/schematics/{module → feature}/files/effects/.gitkeep +0 -0
- package/schematics/{module → feature}/files/guards/.gitkeep +0 -0
- package/schematics/{module → feature}/files/model/.gitkeep +0 -0
- package/schematics/feature/files/provide-__name@dasherize__.ts.template +5 -0
- package/schematics/feature/files/public-api.ts.template +2 -0
- package/schematics/{module → feature}/files/reducers/.gitkeep +0 -0
- package/schematics/{module → feature}/files/services/.gitkeep +0 -0
- package/schematics/{module → feature}/files/state/__name@dasherize__.state.ts.template +1 -1
- package/schematics/{module → feature}/files/state/index.ts.template +0 -0
- package/schematics/feature/index.d.ts +3 -0
- package/schematics/{module → feature}/index.js +0 -0
- package/schematics/feature/index.js.map +1 -0
- package/schematics/{module → feature}/schema.json +3 -3
- package/schematics/feature-state/files/__name@dasherize__.state.ts.template +1 -1
- package/schematics/reducer/files/__name@dasherize__.reducer.spec.ts.template +23 -0
- package/schematics/reducer/files/__name@dasherize__.reducer.ts.template +1 -1
- package/schematics/reducer/schema.json +4 -0
- package/schematics/utilities/helpers.js +5 -1
- package/schematics/utilities/helpers.js.map +1 -1
- package/schematics/utilities/with-provider-options.d.ts +1 -0
- package/schematics/module/files/__name@dasherize__-routing.module.ts.template +0 -10
- package/schematics/module/files/__name@dasherize__.module.ts.template +0 -10
- package/schematics/module/files/public-api.ts.template +0 -1
- package/schematics/module/index.d.ts +0 -3
- package/schematics/module/index.js.map +0 -1
- package/schematics/module/module-options.js.map +0 -1
package/README.md
CHANGED
|
@@ -103,4 +103,4 @@ Add *@angular/material* to the project.
|
|
|
103
103
|
| action | Creation of an action which implements **Action** |
|
|
104
104
|
| reducer | Creation of a reducer which implements **Reducer** |
|
|
105
105
|
| effect | Creation of an effect which implements **Effect** |
|
|
106
|
-
|
|
|
106
|
+
| feature | Create a feature folder and all the folders for actions, components, reducers... |
|
|
@@ -2,10 +2,10 @@ import { NgModule } from '@angular/core';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export class NgssmSchematicsModule {
|
|
4
4
|
}
|
|
5
|
-
NgssmSchematicsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
|
6
|
-
NgssmSchematicsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.
|
|
7
|
-
NgssmSchematicsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.
|
|
8
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
|
5
|
+
NgssmSchematicsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6
|
+
NgssmSchematicsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule });
|
|
7
|
+
NgssmSchematicsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule });
|
|
8
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule, decorators: [{
|
|
9
9
|
type: NgModule,
|
|
10
10
|
args: [{
|
|
11
11
|
declarations: [],
|
|
@@ -3,10 +3,10 @@ import { NgModule } from '@angular/core';
|
|
|
3
3
|
|
|
4
4
|
class NgssmSchematicsModule {
|
|
5
5
|
}
|
|
6
|
-
NgssmSchematicsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
|
7
|
-
NgssmSchematicsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.
|
|
8
|
-
NgssmSchematicsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
|
6
|
+
NgssmSchematicsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7
|
+
NgssmSchematicsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule });
|
|
8
|
+
NgssmSchematicsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule });
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule, decorators: [{
|
|
10
10
|
type: NgModule,
|
|
11
11
|
args: [{
|
|
12
12
|
declarations: [],
|
|
@@ -3,10 +3,10 @@ import { NgModule } from '@angular/core';
|
|
|
3
3
|
|
|
4
4
|
class NgssmSchematicsModule {
|
|
5
5
|
}
|
|
6
|
-
NgssmSchematicsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.
|
|
7
|
-
NgssmSchematicsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.
|
|
8
|
-
NgssmSchematicsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.
|
|
6
|
+
NgssmSchematicsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7
|
+
NgssmSchematicsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule });
|
|
8
|
+
NgssmSchematicsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule });
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgssmSchematicsModule, decorators: [{
|
|
10
10
|
type: NgModule,
|
|
11
11
|
args: [{
|
|
12
12
|
declarations: [],
|
package/package.json
CHANGED
|
@@ -32,7 +32,9 @@ function updateStyles() {
|
|
|
32
32
|
context.logger.info(`Updating ${path}`);
|
|
33
33
|
if (tree.exists(path)) {
|
|
34
34
|
const content = (_b = (_a = tree.read(path)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
|
|
35
|
-
const insertion =
|
|
35
|
+
const insertion = `
|
|
36
|
+
@import "ngssm-toolkit/styles/ngssm.scss";
|
|
37
|
+
@import "ngssm-toolkit/styles/material.scss"`;
|
|
36
38
|
if (content.includes(insertion)) {
|
|
37
39
|
return tree;
|
|
38
40
|
}
|
|
@@ -47,6 +49,36 @@ function updateStyles() {
|
|
|
47
49
|
return tree;
|
|
48
50
|
};
|
|
49
51
|
}
|
|
52
|
+
function updateStylePreprocessorOptions() {
|
|
53
|
+
return (tree, context) => {
|
|
54
|
+
const path = 'angular.json';
|
|
55
|
+
context.logger.log('info', `Updating ${path} with stylePreprocessorOptions`);
|
|
56
|
+
if (tree.exists(path)) {
|
|
57
|
+
var currentAngularJson = tree.read(path).toString('utf-8');
|
|
58
|
+
var json = JSON.parse(currentAngularJson);
|
|
59
|
+
Object.keys(json['projects']).forEach((key) => {
|
|
60
|
+
var buildOptions = json['projects'][key]['architect']['build']['options'];
|
|
61
|
+
if (buildOptions['stylePreprocessorOptions']) {
|
|
62
|
+
if (buildOptions['stylePreprocessorOptions']['includePaths']) {
|
|
63
|
+
if (!buildOptions['stylePreprocessorOptions']['includePaths'].includes('./node_modules')) {
|
|
64
|
+
buildOptions['stylePreprocessorOptions']['includePaths'].push('./node_modules');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
buildOptions['stylePreprocessorOptions']['includePaths'] = ['./node_modules'];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
buildOptions['stylePreprocessorOptions'] = {
|
|
73
|
+
includePaths: ['./node_modules']
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
tree.overwrite(path, JSON.stringify(json, null, 2));
|
|
78
|
+
}
|
|
79
|
+
return tree;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
50
82
|
function default_1() {
|
|
51
83
|
return (_, context) => {
|
|
52
84
|
context.logger.info('Starting installation and configuration of ngssm');
|
|
@@ -54,6 +86,7 @@ function default_1() {
|
|
|
54
86
|
addDependencies(),
|
|
55
87
|
installDependencies(),
|
|
56
88
|
updateStyles(),
|
|
89
|
+
updateStylePreprocessorOptions(),
|
|
57
90
|
(__, ___) => context.logger.info('✔️ ngssm installed and configured')
|
|
58
91
|
]);
|
|
59
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/add-ngssm/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,2EAAwH;AACxH,4DAA0E;AAE1E,SAAS,eAAe;IACtB,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,YAAY,GAAqB;YACrC,EAAE,IAAI,EAAE,iCAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE;YAC/E,EAAE,IAAI,EAAE,iCAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE;YAC7E,EAAE,IAAI,EAAE,iCAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE;SACrF,CAAC;QAEF,YAAY,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YAClC,IAAA,uCAAwB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAC3C,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,UAAU,CAAC,IAAI,gBAAgB,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB;IACjC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AALD,kDAKC;AAED,SAAS,YAAY;IACnB,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;;QAC/C,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,IAAI,CAAC,kDAAkD,CAAC,CAAC;QAExE,OAAO,IAAA,kBAAK,EAAC;YACX,eAAe,EAAE;YACjB,mBAAmB,EAAE;YACrB,YAAY,EAAE;YACd,8BAA8B,EAAE;YAChC,CAAC,EAAQ,EAAE,GAAqB,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC;SAC9F,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAZD,4BAYC"}
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"factory": "./action/index#action",
|
|
58
58
|
"schema": "./action/schema.json"
|
|
59
59
|
},
|
|
60
|
-
"
|
|
61
|
-
"description": "Generate a
|
|
62
|
-
"factory": "./
|
|
63
|
-
"schema": "./
|
|
60
|
+
"feature": {
|
|
61
|
+
"description": "Generate a feature.",
|
|
62
|
+
"factory": "./feature/index",
|
|
63
|
+
"schema": "./feature/schema.json"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { StoreMock } from 'ngssm-store';
|
|
4
|
+
|
|
5
|
+
import { <%= classify(name) %>Effect } from './<%= dasherize(name) %>.effect';
|
|
6
|
+
|
|
7
|
+
describe('<%= classify(name) %>Effect', () => {
|
|
8
|
+
let effect: <%= classify(name) %>Effect;
|
|
9
|
+
let store: StoreMock;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
store = new StoreMock({});
|
|
13
|
+
TestBed.configureTestingModule({
|
|
14
|
+
imports: [],
|
|
15
|
+
providers: [<%= classify(name) %>Effect]
|
|
16
|
+
});
|
|
17
|
+
effect = TestBed.inject(<%= classify(name) %>Effect);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
[].forEach((actionType: string) => {
|
|
21
|
+
it(`should process action of type '${actionType}'`, () => {
|
|
22
|
+
expect(effect.processedActions).toContain(actionType);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-options.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/feature/feature-options.ts"],"names":[],"mappings":""}
|
package/schematics/{module → feature}/files/actions/__name@dasherize__-action-type.ts.template
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ import update, { Spec } from 'immutability-helper';
|
|
|
3
3
|
import { NgSsmFeatureState, State } from 'ngssm-store';
|
|
4
4
|
|
|
5
5
|
export const select<%= classify(name) %>State = (state: State): <%= classify(name) %>State =>
|
|
6
|
-
|
|
6
|
+
state[<%= classify(name) %>StateSpecification.featureStateKey] as <%= classify(name) %>State;
|
|
7
7
|
|
|
8
8
|
export const update<%= classify(name) %>State = (state: State, command: Spec<<%= classify(name) %>State, never>): State =>
|
|
9
9
|
update(state, {
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/feature/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAsI;AACtI,+CAA0D;AAG1D,mBAAyB,OAAuB;IAC9C,OAAO,CAAO,CAAO,EAAE,EAAoB,EAAE,EAAE;QAC7C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxE,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,EAAC;gBACb,QAAQ,EAAE,cAAO,CAAC,QAAQ;gBAC1B,SAAS,EAAE,cAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,cAAO,CAAC,QAAQ;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,CAAC;SAC5B,CAAC,CAAC;QAEH,OAAO,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC,CAAA,CAAC;AACJ,CAAC;AAfD,4BAeC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "SchematicsModule",
|
|
4
|
-
"title": "
|
|
4
|
+
"title": "Folder associated to a feature with state, action and all the folders",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"description": "Creates a new feature
|
|
6
|
+
"description": "Creates a new feature folder.",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|
|
10
|
-
"description": "The name of the feature
|
|
10
|
+
"description": "The name of the feature.",
|
|
11
11
|
"type": "string",
|
|
12
12
|
"$default": {
|
|
13
13
|
"$source": "argv",
|
|
@@ -3,7 +3,7 @@ import update, { Spec } from 'immutability-helper';
|
|
|
3
3
|
import { NgSsmFeatureState, State } from 'ngssm-store';
|
|
4
4
|
|
|
5
5
|
export const select<%= classify(name) %>State = (state: State): <%= classify(name) %>State =>
|
|
6
|
-
|
|
6
|
+
state[<%= classify(name) %>StateSpecification.featureStateKey] as <%= classify(name) %>State;
|
|
7
7
|
|
|
8
8
|
export const update<%= classify(name) %>State = (state: State, command: Spec<<%= classify(name) %>State, never>): State =>
|
|
9
9
|
update(state, {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { <%= classify(name) %>Reducer } from './<%= dasherize(name) %>.reducer';
|
|
2
|
+
|
|
3
|
+
describe('<%= classify(name) %>Reducer', () => {
|
|
4
|
+
let reducer: <%= classify(name) %>Reducer;
|
|
5
|
+
let state: { [key: string]: any };
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
reducer = new <%= classify(name) %>Reducer();
|
|
9
|
+
state = {};
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
[].forEach((actionType: string) => {
|
|
13
|
+
it(`should process action of type '${actionType}'`, () => {
|
|
14
|
+
expect(reducer.processedActions).toContain(actionType);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should return input state when processing not valid action type', () => {
|
|
19
|
+
const updatedState = reducer.updateState(state, { type: 'not-processed' });
|
|
20
|
+
|
|
21
|
+
expect(updatedState).toBe(state);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -16,7 +16,11 @@ function readIntoSourceFile(host, modulePath) {
|
|
|
16
16
|
}
|
|
17
17
|
exports.readIntoSourceFile = readIntoSourceFile;
|
|
18
18
|
function addDeclarationToNgModule(options, objectType) {
|
|
19
|
-
return (host) => {
|
|
19
|
+
return (host, context) => {
|
|
20
|
+
if (options.standalone !== false) {
|
|
21
|
+
context.logger.info(`Standalone ${objectType} => no registration into a module.`);
|
|
22
|
+
return host;
|
|
23
|
+
}
|
|
20
24
|
const modulePath = options.module;
|
|
21
25
|
if (modulePath === undefined) {
|
|
22
26
|
return host;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/utilities/helpers.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/utilities/helpers.ts"],"names":[],"mappings":";;;AAAA,2DAA+F;AAC/F,+CAA+C;AAC/C,yEAA4E;AAC5E,qEAA4E;AAC5E,+DAAkE;AAElE,iCAAiC;AAIjC,SAAgB,kBAAkB,CAAC,IAAU,EAAE,UAAkB;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACnC,IAAI,IAAI,KAAK,IAAI,EAAE;QACj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ACF;QACD,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAlCD,4DAkCC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { RouterModule, Routes } from '@angular/router';
|
|
3
|
-
|
|
4
|
-
const routes: Routes = [];
|
|
5
|
-
|
|
6
|
-
@NgModule({
|
|
7
|
-
imports: [RouterModule.forChild(routes)],
|
|
8
|
-
providers: [RouterModule]
|
|
9
|
-
})
|
|
10
|
-
export class <%= classify(name) %>RoutingModule {}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';
|
|
4
|
-
|
|
5
|
-
@NgModule({
|
|
6
|
-
declarations: [],
|
|
7
|
-
imports: [<%= classify(name) %>RoutingModule],
|
|
8
|
-
providers: []
|
|
9
|
-
})
|
|
10
|
-
export class <%= classify(name) %>Module {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './<%= dasherize(name) %>.module';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/module/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAsI;AACtI,+CAA0D;AAG1D,mBAAyB,OAAsB;IAC7C,OAAO,CAAO,CAAO,EAAE,EAAoB,EAAE,EAAE;QAC7C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,GAAG,GAAG,GAAG,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxE,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,EAAC;gBACb,QAAQ,EAAE,cAAO,CAAC,QAAQ;gBAC1B,SAAS,EAAE,cAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,cAAO,CAAC,QAAQ;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,CAAC;SAC5B,CAAC,CAAC;QAEH,OAAO,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC,CAAA,CAAC;AACJ,CAAC;AAfD,4BAeC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-options.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/module/module-options.ts"],"names":[],"mappings":""}
|