@nrwl/angular 14.4.0-beta.5 → 14.4.0-beta.8
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/CHANGELOG.md +1 -1
- package/esm2020/mf/index.mjs +2 -0
- package/esm2020/mf/mf.mjs +45 -0
- package/esm2020/mf/nrwl-angular-mf.mjs +5 -0
- package/fesm2015/{nrwl-angular-mfe.mjs → nrwl-angular-mf.mjs} +1 -1
- package/fesm2015/nrwl-angular-mf.mjs.map +1 -0
- package/fesm2020/{nrwl-angular-mfe.mjs → nrwl-angular-mf.mjs} +1 -1
- package/fesm2020/nrwl-angular-mf.mjs.map +1 -0
- package/generators.d.ts +1 -1
- package/generators.js +1 -1
- package/generators.js.map +1 -1
- package/generators.json +6 -6
- package/{mfe → mf}/index.d.ts +1 -1
- package/{mfe → mf}/index.js +4 -4
- package/mf/index.js.map +1 -0
- package/{mfe/mfe.d.ts → mf/mf.d.ts} +0 -0
- package/{mfe/mfe.js → mf/mf.js} +1 -1
- package/mf/mf.js.map +1 -0
- package/{mfe → mf}/ng-package.json +0 -0
- package/migrations.json +8 -2
- package/module-federation/index.d.ts +2 -2
- package/module-federation/index.js +2 -2
- package/module-federation/index.js.map +1 -1
- package/package.json +16 -16
- package/src/executors/file-server/file-server.impl.js +0 -3
- package/src/executors/file-server/file-server.impl.js.map +1 -1
- package/src/generators/application/application.js +2 -2
- package/src/generators/application/application.js.map +1 -1
- package/src/generators/application/lib/{add-mfe.d.ts → add-mf.d.ts} +1 -1
- package/src/generators/application/lib/{add-mfe.js → add-mf.js} +7 -7
- package/src/generators/application/lib/add-mf.js.map +1 -0
- package/src/generators/application/lib/index.d.ts +1 -1
- package/src/generators/application/lib/index.js +1 -1
- package/src/generators/application/lib/index.js.map +1 -1
- package/src/generators/application/schema.d.ts +2 -2
- package/src/generators/application/schema.json +2 -2
- package/src/generators/component/lib/component.js +4 -4
- package/src/generators/component/lib/component.js.map +1 -1
- package/src/generators/host/host.js +1 -1
- package/src/generators/host/host.js.map +1 -1
- package/src/generators/move/lib/update-ng-package.js +1 -1
- package/src/generators/move/lib/update-ng-package.js.map +1 -1
- package/src/generators/ngrx/files/classes-syntax/__directory__/__fileName__.facade.spec.ts__tmpl__ +3 -3
- package/src/generators/ngrx/files/classes-syntax/__directory__/__fileName__.reducer.spec.ts__tmpl__ +4 -4
- package/src/generators/ngrx/files/classes-syntax/__directory__/__fileName__.reducer.ts__tmpl__ +3 -3
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.actions.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.effects.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.effects.ts__tmpl__ +4 -4
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.facade.spec.ts__tmpl__ +5 -5
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.facade.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.reducer.spec.ts__tmpl__ +4 -4
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.reducer.ts__tmpl__ +8 -8
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.selectors.spec.ts__tmpl__ +2 -2
- package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.selectors.ts__tmpl__ +7 -7
- package/src/generators/ngrx/lib/add-imports-to-module.js +2 -1
- package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
- package/src/generators/remote/remote.js +4 -4
- package/src/generators/remote/remote.js.map +1 -1
- package/src/generators/scam/lib/convert-component-to-scam.d.ts +3 -3
- package/src/generators/scam/lib/convert-component-to-scam.js +10 -10
- package/src/generators/scam/lib/convert-component-to-scam.js.map +1 -1
- package/src/generators/scam/lib/index.d.ts +0 -1
- package/src/generators/scam/lib/index.js +0 -1
- package/src/generators/scam/lib/index.js.map +1 -1
- package/src/generators/scam/scam.js +4 -3
- package/src/generators/scam/scam.js.map +1 -1
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.d.ts +4 -0
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +43 -0
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js.map +1 -0
- package/src/generators/scam-pipe/lib/index.d.ts +2 -0
- package/src/generators/scam-pipe/lib/index.js +5 -0
- package/src/generators/scam-pipe/lib/index.js.map +1 -1
- package/src/generators/scam-pipe/lib/normalize-options.d.ts +3 -0
- package/src/generators/scam-pipe/lib/normalize-options.js +16 -0
- package/src/generators/scam-pipe/lib/normalize-options.js.map +1 -0
- package/src/generators/scam-pipe/scam-pipe.d.ts +1 -1
- package/src/generators/scam-pipe/scam-pipe.js +11 -6
- package/src/generators/scam-pipe/scam-pipe.js.map +1 -1
- package/src/generators/scam-pipe/schema.d.ts +7 -0
- package/src/generators/{setup-mfe → setup-mf}/files/entry-module-files/entry.component.ts__tmpl__ +0 -0
- package/src/generators/{setup-mfe → setup-mf}/files/entry-module-files/entry.module.ts__tmpl__ +0 -0
- package/src/generators/{setup-mfe → setup-mf}/files/webpack/module-federation.config.js__tmpl__ +0 -0
- package/src/generators/{setup-mfe → setup-mf}/files/webpack/webpack.config.js__tmpl__ +0 -0
- package/src/generators/{setup-mfe → setup-mf}/files/webpack/webpack.prod.config.js__tmpl__ +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/add-cypress-workaround.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/add-cypress-workaround.js +0 -0
- package/src/generators/setup-mf/lib/add-cypress-workaround.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/add-entry-module.d.ts +1 -1
- package/src/generators/{setup-mfe → setup-mf}/lib/add-entry-module.js +2 -2
- package/src/generators/setup-mf/lib/add-entry-module.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/add-remote-to-host.d.ts +1 -1
- package/src/generators/{setup-mfe → setup-mf}/lib/add-remote-to-host.js +8 -8
- package/src/generators/setup-mf/lib/add-remote-to-host.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/change-build-target.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/change-build-target.js +0 -0
- package/src/generators/setup-mf/lib/change-build-target.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/fix-bootstrap.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/fix-bootstrap.js +2 -2
- package/src/generators/setup-mf/lib/fix-bootstrap.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/generate-config.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/generate-config.js +1 -1
- package/src/generators/setup-mf/lib/generate-config.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/get-remotes-with-ports.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/get-remotes-with-ports.js +1 -1
- package/src/generators/setup-mf/lib/get-remotes-with-ports.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/index.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/index.js +0 -0
- package/src/generators/setup-mf/lib/index.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/set-tsconfig-target.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/set-tsconfig-target.js +0 -0
- package/src/generators/setup-mf/lib/set-tsconfig-target.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/setup-host-if-dynamic.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/setup-host-if-dynamic.js +1 -1
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/setup-serve-target.d.ts +0 -0
- package/src/generators/{setup-mfe → setup-mf}/lib/setup-serve-target.js +2 -2
- package/src/generators/setup-mf/lib/setup-serve-target.js.map +1 -0
- package/src/generators/{setup-mfe → setup-mf}/schema.d.ts +1 -1
- package/src/generators/{setup-mfe → setup-mf}/schema.json +3 -3
- package/src/generators/{setup-mfe/setup-mfe.compat.d.ts → setup-mf/setup-mf.compat.d.ts} +0 -0
- package/src/generators/setup-mf/setup-mf.compat.js +6 -0
- package/src/generators/setup-mf/setup-mf.compat.js.map +1 -0
- package/src/generators/setup-mf/setup-mf.d.ts +4 -0
- package/src/generators/{setup-mfe/setup-mfe.js → setup-mf/setup-mf.js} +5 -5
- package/src/generators/setup-mf/setup-mf.js.map +1 -0
- package/src/generators/utils/export-scam.d.ts +9 -0
- package/src/generators/{scam/lib → utils}/export-scam.js +9 -8
- package/src/generators/utils/export-scam.js.map +1 -0
- package/src/generators/utils/file-info.d.ts +15 -0
- package/src/generators/utils/{component.js → file-info.js} +14 -7
- package/src/generators/utils/file-info.js.map +1 -0
- package/src/migrations/update-13-8-1/{add-cypress-mfe-workaround.d.ts → add-cypress-mf-workaround.d.ts} +0 -0
- package/src/migrations/update-13-8-1/{add-cypress-mfe-workaround.js → add-cypress-mf-workaround.js} +1 -1
- package/src/migrations/update-13-8-1/add-cypress-mf-workaround.js.map +1 -0
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.d.ts +5 -0
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js +94 -0
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js.map +1 -0
- package/src/utils/{mfe/mfe-webpack.d.ts → mf/mf-webpack.d.ts} +0 -0
- package/src/utils/{mfe/mfe-webpack.js → mf/mf-webpack.js} +2 -2
- package/src/utils/mf/mf-webpack.js.map +1 -0
- package/src/utils/{mfe → mf}/utils.d.ts +0 -0
- package/src/utils/{mfe → mf}/utils.js +1 -1
- package/src/utils/mf/utils.js.map +1 -0
- package/src/utils/{mfe → mf}/with-module-federation.d.ts +5 -5
- package/src/utils/{mfe → mf}/with-module-federation.js +6 -6
- package/src/utils/mf/with-module-federation.js.map +1 -0
- package/esm2020/mfe/index.mjs +0 -2
- package/esm2020/mfe/mfe.mjs +0 -45
- package/esm2020/mfe/nrwl-angular-mfe.mjs +0 -5
- package/fesm2015/nrwl-angular-mfe.mjs.map +0 -1
- package/fesm2020/nrwl-angular-mfe.mjs.map +0 -1
- package/mfe/index.js.map +0 -1
- package/mfe/mfe.js.map +0 -1
- package/src/generators/application/lib/add-mfe.js.map +0 -1
- package/src/generators/scam/lib/export-scam.d.ts +0 -4
- package/src/generators/scam/lib/export-scam.js.map +0 -1
- package/src/generators/scam-pipe/lib/create-module.d.ts +0 -3
- package/src/generators/scam-pipe/lib/create-module.js +0 -90
- package/src/generators/scam-pipe/lib/create-module.js.map +0 -1
- package/src/generators/setup-mfe/lib/add-cypress-workaround.js.map +0 -1
- package/src/generators/setup-mfe/lib/add-entry-module.js.map +0 -1
- package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +0 -1
- package/src/generators/setup-mfe/lib/change-build-target.js.map +0 -1
- package/src/generators/setup-mfe/lib/fix-bootstrap.js.map +0 -1
- package/src/generators/setup-mfe/lib/generate-config.js.map +0 -1
- package/src/generators/setup-mfe/lib/get-remotes-with-ports.js.map +0 -1
- package/src/generators/setup-mfe/lib/index.js.map +0 -1
- package/src/generators/setup-mfe/lib/set-tsconfig-target.js.map +0 -1
- package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js.map +0 -1
- package/src/generators/setup-mfe/lib/setup-serve-target.js.map +0 -1
- package/src/generators/setup-mfe/setup-mfe.compat.js +0 -6
- package/src/generators/setup-mfe/setup-mfe.compat.js.map +0 -1
- package/src/generators/setup-mfe/setup-mfe.d.ts +0 -4
- package/src/generators/setup-mfe/setup-mfe.js.map +0 -1
- package/src/generators/utils/component.d.ts +0 -14
- package/src/generators/utils/component.js.map +0 -1
- package/src/migrations/update-13-8-1/add-cypress-mfe-workaround.js.map +0 -1
- package/src/utils/mfe/mfe-webpack.js.map +0 -1
- package/src/utils/mfe/utils.js.map +0 -1
- package/src/utils/mfe/with-module-federation.js.map +0 -1
package/src/generators/ngrx/files/classes-syntax/__directory__/__fileName__.reducer.spec.ts__tmpl__
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { <%= className %>Loaded } from './<%= fileName %>.actions';
|
|
2
|
-
import { <%= className %>State, <%= className %>Entity,
|
|
2
|
+
import { <%= className %>State, <%= className %>Entity, initial<%= className %>State, <%= propertyName %>Reducer } from './<%= fileName %>.reducer';
|
|
3
3
|
|
|
4
4
|
describe('<%= className %> Reducer', () => {
|
|
5
5
|
const get<%= className %>Id = (it: <%= className %>Entity) => it.id;
|
|
@@ -12,7 +12,7 @@ describe('<%= className %> Reducer', () => {
|
|
|
12
12
|
it('should return the list of known <%= className %>', () => {
|
|
13
13
|
const <%= propertyName %> = [create<%= className %>('PRODUCT-AAA'), create<%= className %>('PRODUCT-zzz')];
|
|
14
14
|
const action = new <%= className %>Loaded(<%= propertyName %>);
|
|
15
|
-
const result: <%= className %>State =
|
|
15
|
+
const result: <%= className %>State = <%= propertyName %>Reducer(initial<%= className %>State, action);
|
|
16
16
|
const selId: string = get<%= className %>Id(result.list[1]);
|
|
17
17
|
|
|
18
18
|
expect(result.loaded).toBe(true);
|
|
@@ -24,9 +24,9 @@ describe('<%= className %> Reducer', () => {
|
|
|
24
24
|
describe('unknown action', () => {
|
|
25
25
|
it('should return the previous state', () => {
|
|
26
26
|
const action = {} as any;
|
|
27
|
-
const result =
|
|
27
|
+
const result = <%= propertyName %>Reducer(initial<%= className %>State, action);
|
|
28
28
|
|
|
29
|
-
expect(result).toBe(
|
|
29
|
+
expect(result).toBe(initial<%= className %>State);
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
});
|
package/src/generators/ngrx/files/classes-syntax/__directory__/__fileName__.reducer.ts__tmpl__
CHANGED
|
@@ -24,13 +24,13 @@ export interface <%= className %>PartialState {
|
|
|
24
24
|
readonly [<%= constantName %>_FEATURE_KEY]: <%= className %>State;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export const
|
|
27
|
+
export const initial<%= className %>State: <%= className %>State = {
|
|
28
28
|
list: [],
|
|
29
29
|
loaded: false
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
export function
|
|
33
|
-
state: <%= className %>State =
|
|
32
|
+
export function <%= propertyName %>Reducer(
|
|
33
|
+
state: <%= className %>State = initial<%= className %>State,
|
|
34
34
|
action: <%= className %>Action): <%= className %>State
|
|
35
35
|
{
|
|
36
36
|
switch (action.type) {
|
package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.effects.spec.ts__tmpl__
CHANGED
|
@@ -31,7 +31,7 @@ describe('<%= className %>Effects', () => {
|
|
|
31
31
|
|
|
32
32
|
describe('init$', () => {
|
|
33
33
|
it('should work', () => {
|
|
34
|
-
actions = hot('-a-|', { a: <%= className %>Actions.init() });
|
|
34
|
+
actions = hot('-a-|', { a: <%= className %>Actions.init<%= className %>() });
|
|
35
35
|
|
|
36
36
|
const expected = hot('-a-|', { a: <%= className %>Actions.load<%= className %>Success({ <%= propertyName %>: [] }) });
|
|
37
37
|
|
package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.effects.ts__tmpl__
CHANGED
|
@@ -7,17 +7,17 @@ import * as <%= className %>Feature from './<%= fileName %>.reducer';
|
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
9
|
export class <%= className %>Effects {
|
|
10
|
-
<% if (useDataPersistence) { %>init$ = createEffect(() => this.dataPersistence.fetch(<%= className %>Actions
|
|
11
|
-
run: (action: ReturnType<typeof <%= className %>Actions.init
|
|
10
|
+
<% if (useDataPersistence) { %>init$ = createEffect(() => this.dataPersistence.fetch(<%= className %>Actions.<%= className %>init, {
|
|
11
|
+
run: (action: ReturnType<typeof <%= className %>Actions.init<%= className %>>, state: <%= className %>Feature.<%= className %>PartialState) => {
|
|
12
12
|
// Your custom service 'load' logic goes here. For now just return a success action...
|
|
13
13
|
return <%= className %>Actions.load<%= className %>Success({ <%= propertyName %>: [] });
|
|
14
14
|
},
|
|
15
|
-
onError: (action: ReturnType<typeof <%= className %>Actions.init
|
|
15
|
+
onError: (action: ReturnType<typeof <%= className %>Actions.init<%= className %>>, error) => {
|
|
16
16
|
console.error('Error', error);
|
|
17
17
|
return <%= className %>Actions.load<%= className %>Failure({ error });
|
|
18
18
|
}
|
|
19
19
|
}));<% } else { %>init$ = createEffect(() => this.actions$.pipe(
|
|
20
|
-
ofType(<%= className %>Actions.init),
|
|
20
|
+
ofType(<%= className %>Actions.init<%= className %>),
|
|
21
21
|
fetch({
|
|
22
22
|
run: action => {
|
|
23
23
|
// Your custom service 'load' logic goes here. For now just return a success action...
|
package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.facade.spec.ts__tmpl__
CHANGED
|
@@ -11,14 +11,14 @@ import { <%= className %>Facade } from './<%= fileName %>.facade';
|
|
|
11
11
|
import { <%= className %>Entity } from './<%= fileName %>.models';
|
|
12
12
|
import {
|
|
13
13
|
<%= constantName %>_FEATURE_KEY,
|
|
14
|
-
State,
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<%= className %>State,
|
|
15
|
+
initial<%= className %>State,
|
|
16
|
+
<%= propertyName %>Reducer
|
|
17
17
|
} from './<%= fileName %>.reducer';
|
|
18
18
|
import * as <%= className %>Selectors from './<%= fileName %>.selectors';
|
|
19
19
|
|
|
20
20
|
interface TestSchema {
|
|
21
|
-
<%= propertyName %>: State;
|
|
21
|
+
<%= propertyName %>: <%= className %>State;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
describe('<%= className %>Facade', () => {
|
|
@@ -33,7 +33,7 @@ describe('<%= className %>Facade', () => {
|
|
|
33
33
|
beforeEach(() => {
|
|
34
34
|
@NgModule({
|
|
35
35
|
imports: [
|
|
36
|
-
StoreModule.forFeature(<%= constantName %>_FEATURE_KEY,
|
|
36
|
+
StoreModule.forFeature(<%= constantName %>_FEATURE_KEY, <%= propertyName %>Reducer),
|
|
37
37
|
EffectsModule.forFeature([<%= className %>Effects])
|
|
38
38
|
],
|
|
39
39
|
providers: [<%= className %>Facade]
|
package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.reducer.spec.ts__tmpl__
CHANGED
|
@@ -2,7 +2,7 @@ import { Action } from '@ngrx/store';
|
|
|
2
2
|
|
|
3
3
|
import * as <%= className %>Actions from './<%= fileName %>.actions';
|
|
4
4
|
import { <%= className %>Entity } from './<%= fileName %>.models';
|
|
5
|
-
import { State,
|
|
5
|
+
import { <%= className %>State, initial<%= className %>State, <%= propertyName %>Reducer } from './<%= fileName %>.reducer';
|
|
6
6
|
|
|
7
7
|
describe('<%= className %> Reducer', () => {
|
|
8
8
|
const create<%= className %>Entity = (id: string, name = ''): <%= className %>Entity => ({
|
|
@@ -18,7 +18,7 @@ describe('<%= className %> Reducer', () => {
|
|
|
18
18
|
];
|
|
19
19
|
const action = <%= className %>Actions.load<%= className %>Success({ <%= propertyName %> });
|
|
20
20
|
|
|
21
|
-
const result: State =
|
|
21
|
+
const result: <%= className %>State = <%= propertyName %>Reducer(initial<%= className %>State, action);
|
|
22
22
|
|
|
23
23
|
expect(result.loaded).toBe(true);
|
|
24
24
|
expect(result.ids.length).toBe(2);
|
|
@@ -29,9 +29,9 @@ describe('<%= className %> Reducer', () => {
|
|
|
29
29
|
it('should return the previous state', () => {
|
|
30
30
|
const action = {} as Action;
|
|
31
31
|
|
|
32
|
-
const result =
|
|
32
|
+
const result = <%= propertyName %>Reducer(initial<%= className %>State, action);
|
|
33
33
|
|
|
34
|
-
expect(result).toBe(
|
|
34
|
+
expect(result).toBe(initial<%= className %>State);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
});
|
package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.reducer.ts__tmpl__
CHANGED
|
@@ -6,26 +6,26 @@ import { <%= className %>Entity } from './<%= fileName %>.models';
|
|
|
6
6
|
|
|
7
7
|
export const <%= constantName %>_FEATURE_KEY = '<%= propertyName %>';
|
|
8
8
|
|
|
9
|
-
export interface State extends EntityState<<%= className %>Entity> {
|
|
9
|
+
export interface <%= className %>State extends EntityState<<%= className %>Entity> {
|
|
10
10
|
selectedId?: string | number; // which <%= className %> record has been selected
|
|
11
11
|
loaded: boolean; // has the <%= className %> list been loaded
|
|
12
12
|
error?: string | null; // last known error (if any)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface <%= className %>PartialState {
|
|
16
|
-
readonly [<%= constantName %>_FEATURE_KEY]: State;
|
|
16
|
+
readonly [<%= constantName %>_FEATURE_KEY]: <%= className %>State;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const <%= propertyName %>Adapter: EntityAdapter<<%= className %>Entity> = createEntityAdapter<<%= className %>Entity>();
|
|
20
20
|
|
|
21
|
-
export const
|
|
21
|
+
export const initial<%= className %>State: <%= className %>State = <%= propertyName %>Adapter.getInitialState({
|
|
22
22
|
// set initial required properties
|
|
23
23
|
loaded: false
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
on(<%= className %>Actions.init
|
|
26
|
+
const reducer = createReducer(
|
|
27
|
+
initial<%= className %>State,
|
|
28
|
+
on(<%= className %>Actions.init<%= className %>,
|
|
29
29
|
state => ({ ...state, loaded: false, error: null })
|
|
30
30
|
),
|
|
31
31
|
on(<%= className %>Actions.load<%= className %>Success,
|
|
@@ -36,6 +36,6 @@ const <%= propertyName %>Reducer = createReducer(
|
|
|
36
36
|
),
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
export function
|
|
40
|
-
return
|
|
39
|
+
export function <%= propertyName %>Reducer(state: <%= className %>State | undefined, action: Action) {
|
|
40
|
+
return reducer(state, action);
|
|
41
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { <%= className %>Entity } from './<%= fileName %>.models';
|
|
2
|
-
import { <%= propertyName %>Adapter, <%= className %>PartialState,
|
|
2
|
+
import { <%= propertyName %>Adapter, <%= className %>PartialState, initial<%= className %>State } from './<%= fileName %>.reducer';
|
|
3
3
|
import * as <%= className %>Selectors from './<%= fileName %>.selectors';
|
|
4
4
|
|
|
5
5
|
describe('<%= className %> Selectors', () => {
|
|
@@ -19,7 +19,7 @@ describe('<%= className %> Selectors', () => {
|
|
|
19
19
|
create<%= className %>Entity('PRODUCT-BBB'),
|
|
20
20
|
create<%= className %>Entity('PRODUCT-CCC')
|
|
21
21
|
], {
|
|
22
|
-
...
|
|
22
|
+
...initial<%= className %>State,
|
|
23
23
|
selectedId : 'PRODUCT-BBB',
|
|
24
24
|
error: ERROR_MSG,
|
|
25
25
|
loaded: true
|
package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.selectors.ts__tmpl__
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { createFeatureSelector, createSelector } from '@ngrx/store';
|
|
2
|
-
import { <%= constantName %>_FEATURE_KEY, State, <%= propertyName %>Adapter } from './<%= fileName %>.reducer';
|
|
2
|
+
import { <%= constantName %>_FEATURE_KEY, <%= className %>State, <%= propertyName %>Adapter } from './<%= fileName %>.reducer';
|
|
3
3
|
|
|
4
4
|
// Lookup the '<%= className %>' feature state managed by NgRx
|
|
5
|
-
export const get<%= className %>State = createFeatureSelector
|
|
5
|
+
export const get<%= className %>State = createFeatureSelector<<%= className %>State>(<%= constantName %>_FEATURE_KEY);
|
|
6
6
|
|
|
7
7
|
const { selectAll, selectEntities } = <%= propertyName %>Adapter.getSelectors();
|
|
8
8
|
|
|
9
9
|
export const get<%= className %>Loaded = createSelector(
|
|
10
10
|
get<%= className %>State,
|
|
11
|
-
(state: State) => state.loaded
|
|
11
|
+
(state: <%= className %>State) => state.loaded
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
export const get<%= className %>Error = createSelector(
|
|
15
15
|
get<%= className %>State,
|
|
16
|
-
(state: State) => state.error
|
|
16
|
+
(state: <%= className %>State) => state.error
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
export const getAll<%= className %> = createSelector(
|
|
20
20
|
get<%= className %>State,
|
|
21
|
-
(state: State) => selectAll(state)
|
|
21
|
+
(state: <%= className %>State) => selectAll(state)
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
export const get<%= className %>Entities = createSelector(
|
|
25
25
|
get<%= className %>State,
|
|
26
|
-
(state: State) => selectEntities(state)
|
|
26
|
+
(state: <%= className %>State) => selectEntities(state)
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
export const getSelectedId = createSelector(
|
|
30
30
|
get<%= className %>State,
|
|
31
|
-
(state: State) => state.selectedId
|
|
31
|
+
(state: <%= className %>State) => state.selectedId
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
export const getSelected = createSelector(
|
|
@@ -21,6 +21,7 @@ function addImportsToModule(tree, options) {
|
|
|
21
21
|
const effectsName = `${(0, devkit_1.names)(options.name).className}Effects`;
|
|
22
22
|
const facadeName = `${(0, devkit_1.names)(options.name).className}Facade`;
|
|
23
23
|
const className = `${(0, devkit_1.names)(options.name).className}`;
|
|
24
|
+
const propertyName = `${(0, devkit_1.names)(options.name).propertyName}`;
|
|
24
25
|
const reducerImports = `* as from${className}`;
|
|
25
26
|
const storeMetaReducers = `metaReducers: !environment.production ? [] : []`;
|
|
26
27
|
const storeForRoot = `StoreModule.forRoot({}, {
|
|
@@ -33,7 +34,7 @@ function addImportsToModule(tree, options) {
|
|
|
33
34
|
const nxModule = 'NxModule.forRoot()';
|
|
34
35
|
const effectsForRoot = `EffectsModule.forRoot([${effectsName}])`;
|
|
35
36
|
const effectsForEmptyRoot = `EffectsModule.forRoot([])`;
|
|
36
|
-
const storeForFeature = `StoreModule.forFeature(from${className}.${constantName}_FEATURE_KEY, from${className}
|
|
37
|
+
const storeForFeature = `StoreModule.forFeature(from${className}.${constantName}_FEATURE_KEY, from${className}.${propertyName}Reducer)`;
|
|
37
38
|
const effectsForFeature = `EffectsModule.forFeature([${effectsName}])`;
|
|
38
39
|
const devTools = `!environment.production ? StoreDevtoolsModule.instrument() : []`;
|
|
39
40
|
const storeRouterModule = 'StoreRouterConnectingModule.forRoot()';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-imports-to-module.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ngrx/lib/add-imports-to-module.ts"],"names":[],"mappings":";;;AACA,yCAAqC;AACrC,uEAAuE;AAEvE,2CAA4D;AAC5D,kEAG4C;AAG5C,SAAgB,kBAAkB,CAChC,IAAU,EACV,OAA6B;IAE7B,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,UAAU,GAAG,IAAA,6BAAgB,EAC/B,UAAU,EACV,UAAU,EACV,yBAAY,CAAC,MAAM,EACnB,IAAI,CACL,CAAC;IACF,MAAM,SAAS,GAAG,CAChB,MAAkB,EAClB,UAAkB,EAClB,QAAgB,EAChB,SAAS,GAAG,KAAK,EACL,EAAE;QACd,OAAO,IAAA,wBAAY,EACjB,IAAI,EACJ,MAAM,EACN,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,GAAG,GAAG,KAAK,IAAA,cAAK,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;IACrD,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,MAAM,WAAW,GAAG,GAAG,UAAU,UAAU,CAAC;IAC5C,MAAM,WAAW,GAAG,GAAG,UAAU,UAAU,CAAC;IAC5C,MAAM,UAAU,GAAG,GAAG,UAAU,SAAS,CAAC;IAE1C,MAAM,YAAY,GAAG,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;IAC3D,MAAM,WAAW,GAAG,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,SAAS,CAAC;IAC9D,MAAM,UAAU,GAAG,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,QAAQ,CAAC;IAC5D,MAAM,SAAS,GAAG,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IACrD,MAAM,cAAc,GAAG,YAAY,SAAS,EAAE,CAAC;IAE/C,MAAM,iBAAiB,GAAG,iDAAiD,CAAC;IAE5E,MAAM,YAAY,GAAG;QACf,iBAAiB;;;;;OAKlB,CAAC;IACN,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IACtC,MAAM,cAAc,GAAG,0BAA0B,WAAW,IAAI,CAAC;IACjE,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;IACxD,MAAM,eAAe,GAAG,8BAA8B,SAAS,IAAI,YAAY,qBAAqB,SAAS,
|
|
1
|
+
{"version":3,"file":"add-imports-to-module.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ngrx/lib/add-imports-to-module.ts"],"names":[],"mappings":";;;AACA,yCAAqC;AACrC,uEAAuE;AAEvE,2CAA4D;AAC5D,kEAG4C;AAG5C,SAAgB,kBAAkB,CAChC,IAAU,EACV,OAA6B;IAE7B,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,UAAU,GAAG,IAAA,6BAAgB,EAC/B,UAAU,EACV,UAAU,EACV,yBAAY,CAAC,MAAM,EACnB,IAAI,CACL,CAAC;IACF,MAAM,SAAS,GAAG,CAChB,MAAkB,EAClB,UAAkB,EAClB,QAAgB,EAChB,SAAS,GAAG,KAAK,EACL,EAAE;QACd,OAAO,IAAA,wBAAY,EACjB,IAAI,EACJ,MAAM,EACN,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,CACV,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,GAAG,GAAG,KA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AAiB,EAC5B,IAAI,EACJ,UAAU,EACV,UAAU,EACV,eAAe,CAChB,CAAC;SACH;aAAM;YACL,UAAU,GAAG,gBAAgB,EAAE,CAAC;YAEhC,UAAU,GAAG,IAAA,6BAAiB,EAC5B,IAAI,EACJ,UAAU,EACV,UAAU,EACV,eAAe,CAChB,CAAC;YACF,UAAU,GAAG,IAAA,6BAAiB,EAC5B,IAAI,EACJ,UAAU,EACV,UAAU,EACV,iBAAiB,CAClB,CAAC;SACH;KACF;AACH,CAAC;AA3LD,gDA2LC"}
|
|
@@ -7,10 +7,10 @@ const get_mf_projects_1 = require("../../utils/get-mf-projects");
|
|
|
7
7
|
const project_1 = require("../utils/project");
|
|
8
8
|
function findNextAvailablePort(tree) {
|
|
9
9
|
var _a, _b, _c;
|
|
10
|
-
const
|
|
10
|
+
const mfProjects = (0, get_mf_projects_1.getMFProjects)(tree);
|
|
11
11
|
const ports = new Set([4200]);
|
|
12
|
-
for (const
|
|
13
|
-
const { targets } = (0, devkit_1.readProjectConfiguration)(tree,
|
|
12
|
+
for (const mfProject of mfProjects) {
|
|
13
|
+
const { targets } = (0, devkit_1.readProjectConfiguration)(tree, mfProject);
|
|
14
14
|
const port = (_c = (_b = (_a = targets === null || targets === void 0 ? void 0 : targets.serve) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.port) !== null && _c !== void 0 ? _c : 4200;
|
|
15
15
|
ports.add(port);
|
|
16
16
|
}
|
|
@@ -24,7 +24,7 @@ function remote(tree, options) {
|
|
|
24
24
|
if (options.host && !projects.has(options.host)) {
|
|
25
25
|
throw new Error(`The name of the application to be used as the host app does not exist. (${options.host})`);
|
|
26
26
|
}
|
|
27
|
-
const installTask = yield (0, application_1.default)(tree, Object.assign(Object.assign({}, options), {
|
|
27
|
+
const installTask = yield (0, application_1.default)(tree, Object.assign(Object.assign({}, options), { mf: true, mfType: 'remote', routing: true, host: options.host, port: (_a = options.port) !== null && _a !== void 0 ? _a : findNextAvailablePort(tree) }));
|
|
28
28
|
removeDeadCode(tree, options);
|
|
29
29
|
return installTask;
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/remote/remote.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AAEtB,4DAA8D;AAC9D,iEAA4D;AAC5D,8CAAwD;AAExD,SAAS,qBAAqB,CAAC,IAAU;;IACvC,MAAM,
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/remote/remote.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AAEtB,4DAA8D;AAC9D,iEAA4D;AAC5D,8CAAwD;AAExD,SAAS,qBAAqB,CAAC,IAAU;;IACvC,MAAM,UAAU,GAAG,IAAA,+BAAa,EAAC,IAAI,CAAC,CAAC;IAEvC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,OAAO,0CAAE,IAAI,mCAAI,IAAI,CAAC;QACnD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACjB;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjD,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,SAA8B,MAAM,CAAC,IAAU,EAAE,OAAe;;;QAC9D,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAA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AiB,EAAC,OAAO,CAAC,UAAU,EAAE,2BAA2B,CAAC,CACnE,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAE7E,MAAM,eAAe,GAAG,IAAA,0BAAiB,EACvC,OAAO,CAAC,UAAU,EAClB,sBAAsB,CACvB,CAAC;IACF,MAAM,SAAS,GACb,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3D;;6BAEyB,CAAC;IAE5B,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;IAEvC,IAAI,CAAC,KAAK,CACR,IAAA,0BAAiB,EAAC,OAAO,CAAC,UAAU,EAAE,mBAAmB,CAAC,EAC1D;;;;;;;;;;;;;;;;;0BAiBsB,CACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
export declare function convertComponentToScam(tree: Tree,
|
|
2
|
+
import type { FileInfo } from '../../utils/file-info';
|
|
3
|
+
import type { NormalizedSchema } from '../schema';
|
|
4
|
+
export declare function convertComponentToScam(tree: Tree, componentFileInfo: FileInfo, options: NormalizedSchema): void;
|
|
@@ -4,26 +4,26 @@ exports.convertComponentToScam = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
5
|
const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
|
|
6
6
|
const typescript_1 = require("typescript");
|
|
7
|
-
function convertComponentToScam(tree,
|
|
7
|
+
function convertComponentToScam(tree, componentFileInfo, options) {
|
|
8
8
|
var _a;
|
|
9
|
-
if (!tree.exists(
|
|
10
|
-
throw new Error(`Couldn't find component at path ${
|
|
9
|
+
if (!tree.exists(componentFileInfo.filePath)) {
|
|
10
|
+
throw new Error(`Couldn't find component at path ${componentFileInfo.filePath} to add SCAM setup.`);
|
|
11
11
|
}
|
|
12
12
|
const componentNames = (0, devkit_1.names)(options.name);
|
|
13
13
|
const typeNames = (0, devkit_1.names)((_a = options.type) !== null && _a !== void 0 ? _a : 'component');
|
|
14
14
|
const componentClassName = `${componentNames.className}${typeNames.className}`;
|
|
15
15
|
if (options.inlineScam) {
|
|
16
|
-
const currentComponentContents = tree.read(
|
|
17
|
-
let source = (0, typescript_1.createSourceFile)(
|
|
18
|
-
source = (0, ast_utils_1.insertImport)(tree, source,
|
|
19
|
-
source = (0, ast_utils_1.insertImport)(tree, source,
|
|
16
|
+
const currentComponentContents = tree.read(componentFileInfo.filePath, 'utf-8');
|
|
17
|
+
let source = (0, typescript_1.createSourceFile)(componentFileInfo.filePath, currentComponentContents, typescript_1.ScriptTarget.Latest, true);
|
|
18
|
+
source = (0, ast_utils_1.insertImport)(tree, source, componentFileInfo.filePath, 'NgModule', '@angular/core');
|
|
19
|
+
source = (0, ast_utils_1.insertImport)(tree, source, componentFileInfo.filePath, 'CommonModule', '@angular/common');
|
|
20
20
|
let updatedComponentSource = source.getText();
|
|
21
21
|
updatedComponentSource = `${updatedComponentSource}${getNgModuleDeclaration(componentClassName)}`;
|
|
22
|
-
tree.write(
|
|
22
|
+
tree.write(componentFileInfo.filePath, updatedComponentSource);
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
const moduleFilePath = (0, devkit_1.joinPathFragments)(
|
|
26
|
-
tree.write(moduleFilePath, getModuleFileContent(componentClassName,
|
|
25
|
+
const moduleFilePath = (0, devkit_1.joinPathFragments)(componentFileInfo.directory, `${componentNames.fileName}.module.ts`);
|
|
26
|
+
tree.write(moduleFilePath, getModuleFileContent(componentClassName, componentFileInfo.fileName));
|
|
27
27
|
}
|
|
28
28
|
exports.convertComponentToScam = convertComponentToScam;
|
|
29
29
|
function getModuleFileContent(componentClassName, componentFileName) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-component-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/convert-component-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,uEAAuE;AACvE,2CAA4D;AAI5D,SAAgB,sBAAsB,CACpC,IAAU,EACV,
|
|
1
|
+
{"version":3,"file":"convert-component-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/convert-component-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,uEAAuE;AACvE,2CAA4D;AAI5D,SAAgB,sBAAsB,CACpC,IAAU,EACV,iBAA2B,EAC3B,OAAyB;;IAEzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC5C,MAAM,IAAI,KAAK,CACb,mCAAmC,iBAAiB,CAAC,QAAQ,qBAAqB,CACnF,CAAC;KACH;IAED,MAAM,cAAc,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAK,EAAC,MAAA,OAAO,CAAC,IAAI,mCAAI,WAAW,CAAC,CAAC;IACrD,MAAM,kBAAkB,GAAG,GAAG,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;IAE/E,IAAI,OAAO,CAAC,UAAU,EAAE;QACtB,MAAM,wBAAwB,GAAG,IAAI,CAAC,IAAI,CACxC,iBAAiB,CAAC,QAAQ,EAC1B,OAAO,CACR,CAAC;QACF,IAAI,MAAM,GAAG,IAAA,6BAAgB,EAC3B,iBAAiB,CAAC,QAAQ,EAC1B,wBAAwB,EACxB,yBAAY,CAAC,MAAM,EACnB,IAAI,CACL,CAAC;QAEF,MAAM,GAAG,IAAA,wBAAY,EACnB,IAAI,EACJ,MAAM,EACN,iBAAiB,CAAC,QAAQ,EAC1B,UAAU,EACV,eAAe,CAChB,CAAC;QACF,MAAM,GAAG,IAAA,wBAAY,EACnB,IAAI,EACJ,MAAM,EACN,iBAAiB,CAAC,QAAQ,EAC1B,cAAc,EACd,iBAAiB,CAClB,CAAC;QAEF,IAAI,sBAAsB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9C,sBAAsB,GAAG,GAAG,sBAAsB,GAAG,sBAAsB,CACzE,kBAAkB,CACnB,EAAE,CAAC;QAEJ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;QAC/D,OAAO;KACR;IAED,MAAM,cAAc,GAAG,IAAA,0BAAiB,EACtC,iBAAiB,CAAC,SAAS,EAC3B,GAAG,cAAc,CAAC,QAAQ,YAAY,CACvC,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,cAAc,EACd,oBAAoB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CACrE,CAAC;AACJ,CAAC;AA5DD,wDA4DC;AAED,SAAS,oBAAoB,CAC3B,kBAA0B,EAC1B,iBAAyB;IAEzB,OAAO;;WAEE,kBAAkB,cAAc,iBAAiB;EAC1D,sBAAsB,CAAC,kBAAkB,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,sBAAsB,CAAC,kBAA0B;IACxD,OAAO;;;mBAGU,kBAAkB;cACvB,kBAAkB;;eAEjB,kBAAkB,WAAW,CAAC;AAC7C,CAAC"}
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./convert-component-to-scam"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./export-scam"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam/lib/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C;AAC5C,8DAAoC"}
|
|
@@ -4,9 +4,10 @@ exports.scamGenerator = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
6
|
const ngcli_adapter_1 = require("@nrwl/devkit/ngcli-adapter");
|
|
7
|
+
const export_scam_1 = require("../utils/export-scam");
|
|
8
|
+
const file_info_1 = require("../utils/file-info");
|
|
7
9
|
const path_1 = require("../utils/path");
|
|
8
10
|
const lib_1 = require("./lib");
|
|
9
|
-
const component_1 = require("../utils/component");
|
|
10
11
|
function scamGenerator(tree, rawOptions) {
|
|
11
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
13
|
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
@@ -14,9 +15,9 @@ function scamGenerator(tree, rawOptions) {
|
|
|
14
15
|
checkPathUnderProjectRoot(tree, options);
|
|
15
16
|
const angularComponentSchematic = (0, ngcli_adapter_1.wrapAngularDevkitSchematic)('@schematics/angular', 'component');
|
|
16
17
|
yield angularComponentSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false }));
|
|
17
|
-
const componentFileInfo = (0,
|
|
18
|
+
const componentFileInfo = (0, file_info_1.getComponentFileInfo)(tree, options);
|
|
18
19
|
(0, lib_1.convertComponentToScam)(tree, componentFileInfo, options);
|
|
19
|
-
(0,
|
|
20
|
+
(0, export_scam_1.exportScam)(tree, componentFileInfo, options);
|
|
20
21
|
yield (0, devkit_1.formatFiles)(tree);
|
|
21
22
|
});
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,wCAA+C;AAC/C,+
|
|
1
|
+
{"version":3,"file":"scam.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam/scam.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,sDAAkD;AAClD,kDAA0D;AAC1D,wCAA+C;AAC/C,+BAAiE;AAGjE,SAAsB,aAAa,CAAC,IAAU,EAAE,UAAkB;;QAChE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAA0B,OAAO,EAA5B,gBAAgB,kBAAK,OAAO,EAAhE,mCAAsD,CAAU,CAAC;QAEvE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,yBAAyB,GAAG,IAAA,0CAA0B,EAC1D,qBAAqB,EACrB,WAAW,CACZ,CAAC;QACF,MAAM,yBAAyB,CAAC,IAAI,kCAC/B,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,IACb,CAAC;QAEH,MAAM,iBAAiB,GAAG,IAAA,gCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,IAAA,4BAAsB,EAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACzD,IAAA,wBAAU,EAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAE7C,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AArBD,sCAqBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;;IACrE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACjB,OAAO;KACR;IAED,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAEzD,IAAI,eAAe,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,eAAe,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC;QAC/C,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,CAAC,CAAC,eAAe,CAAC;IAEpB,IAAI,CAAC,IAAA,qBAAc,EAAC,eAAe,EAAE,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,KAAK,CACb,mCAAmC,OAAO,CAAC,IAAI,4CAA4C,IAAI,IAAI,CACpG,CAAC;KACH;AACH,CAAC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertPipeToScam = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
|
|
6
|
+
const typescript_1 = require("typescript");
|
|
7
|
+
function convertPipeToScam(tree, pipeFileInfo, options) {
|
|
8
|
+
if (!tree.exists(pipeFileInfo.filePath)) {
|
|
9
|
+
throw new Error(`Couldn't find pipe at path ${pipeFileInfo.filePath} to add SCAM setup.`);
|
|
10
|
+
}
|
|
11
|
+
const pipeNames = (0, devkit_1.names)(options.name);
|
|
12
|
+
const typeNames = (0, devkit_1.names)('pipe');
|
|
13
|
+
const pipeClassName = `${pipeNames.className}${typeNames.className}`;
|
|
14
|
+
if (options.inlineScam) {
|
|
15
|
+
const currentPipeContents = tree.read(pipeFileInfo.filePath, 'utf-8');
|
|
16
|
+
let source = (0, typescript_1.createSourceFile)(pipeFileInfo.filePath, currentPipeContents, typescript_1.ScriptTarget.Latest, true);
|
|
17
|
+
source = (0, ast_utils_1.insertImport)(tree, source, pipeFileInfo.filePath, 'NgModule', '@angular/core');
|
|
18
|
+
source = (0, ast_utils_1.insertImport)(tree, source, pipeFileInfo.filePath, 'CommonModule', '@angular/common');
|
|
19
|
+
let updatedPipeSource = source.getText();
|
|
20
|
+
updatedPipeSource = `${updatedPipeSource}${getNgModuleDeclaration(pipeClassName)}`;
|
|
21
|
+
tree.write(pipeFileInfo.filePath, updatedPipeSource);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const scamFilePath = (0, devkit_1.joinPathFragments)(pipeFileInfo.directory, `${pipeNames.fileName}.module.ts`);
|
|
25
|
+
tree.write(scamFilePath, getModuleFileContent(pipeClassName, pipeFileInfo.fileName));
|
|
26
|
+
}
|
|
27
|
+
exports.convertPipeToScam = convertPipeToScam;
|
|
28
|
+
function getModuleFileContent(pipeClassName, pipeFileName) {
|
|
29
|
+
return `import { NgModule } from '@angular/core';
|
|
30
|
+
import { CommonModule } from '@angular/common';
|
|
31
|
+
import { ${pipeClassName} } from './${pipeFileName}';
|
|
32
|
+
${getNgModuleDeclaration(pipeClassName)}`;
|
|
33
|
+
}
|
|
34
|
+
function getNgModuleDeclaration(pipeClassName) {
|
|
35
|
+
return `
|
|
36
|
+
@NgModule({
|
|
37
|
+
imports: [CommonModule],
|
|
38
|
+
declarations: [${pipeClassName}],
|
|
39
|
+
exports: [${pipeClassName}],
|
|
40
|
+
})
|
|
41
|
+
export class ${pipeClassName}Module {}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=convert-pipe-to-scam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-pipe-to-scam.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/convert-pipe-to-scam.ts"],"names":[],"mappings":";;;AACA,yCAAwD;AACxD,uEAAuE;AACvE,2CAA4D;AAI5D,SAAgB,iBAAiB,CAC/B,IAAU,EACV,YAAsB,EACtB,OAAyB;IAEzB,IAAI,CAAC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AAC,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,CAC3D,CAAC;AACJ,CAAC;AAzDD,8CAyDC;AAED,SAAS,oBAAoB,CAC3B,aAAqB,EACrB,YAAoB;IAEpB,OAAO;;WAEE,aAAa,cAAc,YAAY;EAChD,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,sBAAsB,CAAC,aAAqB;IACnD,OAAO;;;mBAGU,aAAa;cAClB,aAAa;;eAEZ,aAAa,WAAW,CAAC;AACxC,CAAC"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./convert-pipe-to-scam"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
1
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,8DAAoC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
function normalizeOptions(tree, options) {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
const project = (_a = options.project) !== null && _a !== void 0 ? _a : (0, devkit_1.readWorkspaceConfiguration)(tree).defaultProject;
|
|
8
|
+
const { projectType, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
9
|
+
const projectSourceRoot = sourceRoot !== null && sourceRoot !== void 0 ? sourceRoot : (0, devkit_1.joinPathFragments)(root, 'src');
|
|
10
|
+
const path = (_b = options.path) !== null && _b !== void 0 ? _b : (0, devkit_1.joinPathFragments)(projectSourceRoot, projectType === 'application' ? 'app' : 'lib');
|
|
11
|
+
return Object.assign(Object.assign({}, options), { flat: (_c = options.flat) !== null && _c !== void 0 ? _c : true, path,
|
|
12
|
+
project,
|
|
13
|
+
projectSourceRoot });
|
|
14
|
+
}
|
|
15
|
+
exports.normalizeOptions = normalizeOptions;
|
|
16
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/scam-pipe/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,yCAIsB;AAGtB,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,OAAO,GACX,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC,cAAc,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAChE,IAAI,EACJ,OAAO,CACR,CAAC;IACF,MAAM,iBAAiB,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAA,0BAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,MAAA,OAAO,CAAC,IAAI,mCACZ,IAAA,0BAAiB,EACf,iBAAiB,EACjB,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAC9C,CAAC;IAEJ,uCACK,OAAO,KACV,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,IAAI,EAC1B,IAAI;QACJ,OAAO;QACP,iBAAiB,IACjB;AACJ,CAAC;AAzBD,4CAyBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Tree } from '@nrwl/devkit';
|
|
2
2
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function scamPipeGenerator(tree: Tree,
|
|
3
|
+
export declare function scamPipeGenerator(tree: Tree, rawOptions: Schema): Promise<void>;
|
|
4
4
|
export default scamPipeGenerator;
|
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.scamPipeGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const ngcli_adapter_1 = require("@nrwl/devkit/ngcli-adapter");
|
|
6
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const
|
|
6
|
+
const ngcli_adapter_1 = require("@nrwl/devkit/ngcli-adapter");
|
|
7
|
+
const export_scam_1 = require("../utils/export-scam");
|
|
8
|
+
const file_info_1 = require("../utils/file-info");
|
|
8
9
|
const path_1 = require("../utils/path");
|
|
9
|
-
|
|
10
|
+
const lib_1 = require("./lib");
|
|
11
|
+
function scamPipeGenerator(tree, rawOptions) {
|
|
10
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
-
const
|
|
13
|
+
const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
14
|
+
const { inlineScam, projectSourceRoot } = options, schematicOptions = tslib_1.__rest(options, ["inlineScam", "projectSourceRoot"]);
|
|
12
15
|
checkPathUnderProjectRoot(tree, options);
|
|
13
16
|
const angularPipeSchematic = (0, ngcli_adapter_1.wrapAngularDevkitSchematic)('@schematics/angular', 'pipe');
|
|
14
|
-
yield angularPipeSchematic(tree, Object.assign(Object.assign({},
|
|
15
|
-
(0,
|
|
17
|
+
yield angularPipeSchematic(tree, Object.assign(Object.assign({}, schematicOptions), { skipImport: true, export: false }));
|
|
18
|
+
const pipeFileInfo = (0, file_info_1.getPipeFileInfo)(tree, options);
|
|
19
|
+
(0, lib_1.convertPipeToScam)(tree, pipeFileInfo, options);
|
|
20
|
+
(0, export_scam_1.exportScam)(tree, pipeFileInfo, options);
|
|
16
21
|
yield (0, devkit_1.formatFiles)(tree);
|
|
17
22
|
});
|
|
18
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"scam-pipe.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/scam-pipe/scam-pipe.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,8DAAwE;AACxE,sDAAkD;AAClD,kDAAqD;AACrD,wCAA+C;AAC/C,+BAA4D;AAG5D,SAAsB,iBAAiB,CAAC,IAAU,EAAE,UAAkB;;QACpE,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,EAAE,UAAU,EAAE,iBAAiB,KAA0B,OAAO,EAA5B,gBAAgB,kBAAK,OAAO,EAAhE,mCAAsD,CAAU,CAAC;QAEvE,yBAAyB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEzC,MAAM,oBAAoB,GAAG,IAAA,0CAA0B,EACrD,qBAAqB,EACrB,MAAM,CACP,CAAC;QACF,MAAM,oBAAoB,CAAC,IAAI,kCAC1B,gBAAgB,KACnB,UAAU,EAAE,IAAI,EAChB,MAAM,EAAE,KAAK,IACb,CAAC;QAEH,MAAM,YAAY,GAAG,IAAA,2BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpD,IAAA,uBAAiB,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAA,wBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AArBD,8CAqBC;AAED,SAAS,yBAAyB,CAAC,IAAU,EAAE,OAAwB;;IACrE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