@nx/angular 17.0.0-beta.2 → 17.0.0-beta.5
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/executors.json +0 -20
- package/generators.d.ts +1 -0
- package/generators.js +1 -0
- package/generators.json +6 -148
- package/package.json +11 -11
- package/src/executors/ng-packagr-lite/schema.json +0 -13
- package/src/executors/package/package.impl.js +2 -8
- package/src/executors/package/schema.d.ts +0 -12
- package/src/executors/package/schema.json +0 -13
- package/src/generators/directive/directive.js +6 -7
- package/src/generators/directive/files/__fileName__.spec.ts__tpl__ +8 -0
- package/src/generators/directive/files/{__directiveFileName__.directive.ts__tpl__ → __fileName__.ts__tpl__} +1 -1
- package/src/generators/directive/lib/normalize-options.d.ts +1 -1
- package/src/generators/directive/lib/normalize-options.js +20 -8
- package/src/generators/directive/lib/validate-options.js +0 -2
- package/src/generators/directive/schema.d.ts +20 -4
- package/src/generators/directive/schema.json +15 -11
- package/src/generators/federate-module/federate-module.d.ts +4 -0
- package/src/generators/federate-module/federate-module.js +39 -0
- package/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +2 -0
- package/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +15 -0
- package/src/generators/federate-module/lib/add-path-to-exposes.d.ts +8 -0
- package/src/generators/federate-module/lib/add-path-to-exposes.js +78 -0
- package/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +8 -0
- package/src/generators/federate-module/lib/add-path-to-ts-config.js +12 -0
- package/src/generators/federate-module/lib/add-remote.d.ts +7 -0
- package/src/generators/federate-module/lib/add-remote.js +47 -0
- package/src/generators/federate-module/lib/check-remote-exists.d.ts +2 -0
- package/src/generators/federate-module/lib/check-remote-exists.js +22 -0
- package/src/generators/federate-module/lib/index.d.ts +4 -0
- package/src/generators/federate-module/lib/index.js +7 -0
- package/src/generators/federate-module/schema.d.ts +14 -0
- package/src/generators/federate-module/schema.json +77 -0
- package/src/generators/pipe/files/__fileName__.spec.ts__tpl__ +8 -0
- package/src/generators/pipe/files/{__pipeFileName__.pipe.ts__tpl__ → __fileName__.ts__tpl__} +2 -2
- package/src/generators/pipe/lib/normalize-options.d.ts +1 -1
- package/src/generators/pipe/lib/normalize-options.js +20 -7
- package/src/generators/pipe/lib/validate-options.js +0 -2
- package/src/generators/pipe/pipe.js +7 -7
- package/src/generators/pipe/schema.d.ts +20 -4
- package/src/generators/pipe/schema.json +15 -11
- package/src/generators/scam/lib/convert-component-to-scam.js +3 -6
- package/src/generators/scam/lib/normalize-options.d.ts +1 -1
- package/src/generators/scam/lib/normalize-options.js +18 -5
- package/src/generators/scam/scam.js +1 -1
- package/src/generators/scam/schema.d.ts +18 -3
- package/src/generators/scam/schema.json +25 -18
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +3 -6
- package/src/generators/scam-directive/lib/normalize-options.d.ts +1 -1
- package/src/generators/scam-directive/lib/normalize-options.js +17 -7
- package/src/generators/scam-directive/scam-directive.js +1 -1
- package/src/generators/scam-directive/schema.d.ts +18 -5
- package/src/generators/scam-directive/schema.json +24 -17
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +3 -6
- package/src/generators/scam-pipe/lib/normalize-options.d.ts +1 -1
- package/src/generators/scam-pipe/lib/normalize-options.js +17 -7
- package/src/generators/scam-pipe/scam-pipe.js +1 -1
- package/src/generators/scam-pipe/schema.d.ts +18 -5
- package/src/generators/scam-pipe/schema.json +23 -16
- package/src/executors/browser-esbuild/compat.d.ts +0 -2
- package/src/executors/browser-esbuild/compat.js +0 -5
- package/src/executors/delegate-build/compat.d.ts +0 -2
- package/src/executors/delegate-build/compat.js +0 -5
- package/src/executors/ng-packagr-lite/compat.d.ts +0 -2
- package/src/executors/ng-packagr-lite/compat.js +0 -5
- package/src/executors/package/compat.d.ts +0 -2
- package/src/executors/package/compat.js +0 -5
- package/src/generators/add-linting/compat.d.ts +0 -2
- package/src/generators/add-linting/compat.js +0 -6
- package/src/generators/application/application.compat.d.ts +0 -1
- package/src/generators/application/application.compat.js +0 -7
- package/src/generators/component/component.compat.d.ts +0 -2
- package/src/generators/component/component.compat.js +0 -6
- package/src/generators/component-cypress-spec/compat.d.ts +0 -2
- package/src/generators/component-cypress-spec/compat.js +0 -6
- package/src/generators/component-story/compat.d.ts +0 -2
- package/src/generators/component-story/compat.js +0 -6
- package/src/generators/component-test/compat.d.ts +0 -2
- package/src/generators/component-test/compat.js +0 -6
- package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.d.ts +0 -2
- package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.js +0 -6
- package/src/generators/cypress-component-configuration/compat.d.ts +0 -2
- package/src/generators/cypress-component-configuration/compat.js +0 -6
- package/src/generators/directive/files/__directiveFileName__.directive.spec.ts__tpl__ +0 -8
- package/src/generators/host/host.compat.d.ts +0 -2
- package/src/generators/host/host.compat.js +0 -6
- package/src/generators/init/init.compat.d.ts +0 -1
- package/src/generators/init/init.compat.js +0 -7
- package/src/generators/library/library.compat.d.ts +0 -1
- package/src/generators/library/library.compat.js +0 -7
- package/src/generators/library-secondary-entry-point/compat.d.ts +0 -2
- package/src/generators/library-secondary-entry-point/compat.js +0 -6
- package/src/generators/move/compat.d.ts +0 -1
- package/src/generators/move/compat.js +0 -7
- package/src/generators/ng-add/compat.d.ts +0 -2
- package/src/generators/ng-add/compat.js +0 -5
- package/src/generators/ngrx/compat.d.ts +0 -2
- package/src/generators/ngrx/compat.js +0 -6
- package/src/generators/pipe/files/__pipeFileName__.pipe.spec.ts__tpl__ +0 -8
- package/src/generators/remote/remote.compat.d.ts +0 -2
- package/src/generators/remote/remote.compat.js +0 -6
- package/src/generators/scam/scam.compat.d.ts +0 -2
- package/src/generators/scam/scam.compat.js +0 -6
- package/src/generators/scam-directive/scam-directive.compat.d.ts +0 -2
- package/src/generators/scam-directive/scam-directive.compat.js +0 -6
- package/src/generators/scam-pipe/scam-pipe.compat.d.ts +0 -2
- package/src/generators/scam-pipe/scam-pipe.compat.js +0 -6
- package/src/generators/scam-to-standalone/compat.d.ts +0 -2
- package/src/generators/scam-to-standalone/compat.js +0 -6
- package/src/generators/setup-mf/setup-mf.compat.d.ts +0 -2
- package/src/generators/setup-mf/setup-mf.compat.js +0 -6
- package/src/generators/setup-ssr/setup-ssr.compat.d.ts +0 -2
- package/src/generators/setup-ssr/setup-ssr.compat.js +0 -6
- package/src/generators/setup-tailwind/setup-tailwind.compat.d.ts +0 -2
- package/src/generators/setup-tailwind/setup-tailwind.compat.js +0 -6
- package/src/generators/stories/compat.d.ts +0 -2
- package/src/generators/stories/compat.js +0 -6
- package/src/generators/storybook-configuration/compat.d.ts +0 -2
- package/src/generators/storybook-configuration/compat.js +0 -6
- package/src/generators/utils/warn-for-schematic-usage.d.ts +0 -1
- package/src/generators/utils/warn-for-schematic-usage.js +0 -8
- package/src/generators/web-worker/compat.d.ts +0 -2
- package/src/generators/web-worker/compat.js +0 -6
package/executors.json
CHANGED
|
@@ -22,21 +22,6 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"builders": {
|
|
25
|
-
"delegate-build": {
|
|
26
|
-
"implementation": "./src/executors/delegate-build/compat",
|
|
27
|
-
"schema": "./src/executors/delegate-build/schema.json",
|
|
28
|
-
"description": "Delegates the build to a different target while supporting incremental builds."
|
|
29
|
-
},
|
|
30
|
-
"ng-packagr-lite": {
|
|
31
|
-
"implementation": "./src/executors/ng-packagr-lite/compat",
|
|
32
|
-
"schema": "./src/executors/ng-packagr-lite/schema.json",
|
|
33
|
-
"description": "Builds a library with support for incremental builds.\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nrwl/angular:package` executor but with some key differences:\n- It doesn't run `ngcc` automatically (`ngcc` needs to be run separately beforehand if needed, this can be done in a `postinstall` hook on `package.json`)\n- It only produces ESM2020 bundles\n- It doesn't generate package exports in the `package.json`"
|
|
34
|
-
},
|
|
35
|
-
"package": {
|
|
36
|
-
"implementation": "./src/executors/package/compat",
|
|
37
|
-
"schema": "./src/executors/package/schema.json",
|
|
38
|
-
"description": "Builds and packages an Angular library to be distributed as an NPM package. It supports incremental builds."
|
|
39
|
-
},
|
|
40
25
|
"webpack-browser": {
|
|
41
26
|
"implementation": "./src/builders/webpack-browser/webpack-browser.impl",
|
|
42
27
|
"schema": "./src/builders/webpack-browser/schema.json",
|
|
@@ -61,11 +46,6 @@
|
|
|
61
46
|
"implementation": "./src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl",
|
|
62
47
|
"schema": "./src/builders/module-federation-dev-ssr/schema.json",
|
|
63
48
|
"description": "The module-federation-dev-ssr executor is reserved exclusively for use with host Module Federation applications that use SSR. It allows the user to specify which remote applications should be served with the host."
|
|
64
|
-
},
|
|
65
|
-
"browser-esbuild": {
|
|
66
|
-
"implementation": "./src/executors/browser-esbuild/compat",
|
|
67
|
-
"schema": "./src/executors/browser-esbuild/schema.json",
|
|
68
|
-
"description": "Builds your application with esbuild and adds support for incremental builds."
|
|
69
49
|
}
|
|
70
50
|
}
|
|
71
51
|
}
|
package/generators.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './src/generators/component-cypress-spec/component-cypress-spec';
|
|
|
4
4
|
export * from './src/generators/component-story/component-story';
|
|
5
5
|
export * from './src/generators/component/component';
|
|
6
6
|
export * from './src/generators/directive/directive';
|
|
7
|
+
export * from './src/generators/federate-module/federate-module';
|
|
7
8
|
export * from './src/generators/host/host';
|
|
8
9
|
export * from './src/generators/init/init';
|
|
9
10
|
export * from './src/generators/library-secondary-entry-point/library-secondary-entry-point';
|
package/generators.js
CHANGED
|
@@ -7,6 +7,7 @@ tslib_1.__exportStar(require("./src/generators/component-cypress-spec/component-
|
|
|
7
7
|
tslib_1.__exportStar(require("./src/generators/component-story/component-story"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./src/generators/component/component"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./src/generators/directive/directive"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./src/generators/federate-module/federate-module"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./src/generators/host/host"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./src/generators/init/init"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./src/generators/library-secondary-entry-point/library-secondary-entry-point"), exports);
|
package/generators.json
CHANGED
|
@@ -2,154 +2,6 @@
|
|
|
2
2
|
"name": "Nx Angular",
|
|
3
3
|
"version": "0.1",
|
|
4
4
|
"extends": ["@schematics/angular", "@nx/workspace"],
|
|
5
|
-
"schematics": {
|
|
6
|
-
"add-linting": {
|
|
7
|
-
"factory": "./src/generators/add-linting/compat",
|
|
8
|
-
"schema": "./src/generators/add-linting/schema.json",
|
|
9
|
-
"description": "Adds linting configuration to an Angular project.",
|
|
10
|
-
"hidden": true
|
|
11
|
-
},
|
|
12
|
-
"application": {
|
|
13
|
-
"factory": "./src/generators/application/application.compat#applicationSchematic",
|
|
14
|
-
"schema": "./src/generators/application/schema.json",
|
|
15
|
-
"aliases": ["app"],
|
|
16
|
-
"x-type": "application",
|
|
17
|
-
"description": "Creates an Angular application."
|
|
18
|
-
},
|
|
19
|
-
"component": {
|
|
20
|
-
"factory": "./src/generators/component/component.compat",
|
|
21
|
-
"schema": "./src/generators/component/schema.json",
|
|
22
|
-
"aliases": ["c"],
|
|
23
|
-
"description": "Generate an Angular Component."
|
|
24
|
-
},
|
|
25
|
-
"component-cypress-spec": {
|
|
26
|
-
"factory": "./src/generators/component-cypress-spec/compat",
|
|
27
|
-
"schema": "./src/generators/component-cypress-spec/schema.json",
|
|
28
|
-
"description": "Creates a Cypress spec for a UI component that has a story.",
|
|
29
|
-
"hidden": true
|
|
30
|
-
},
|
|
31
|
-
"component-story": {
|
|
32
|
-
"factory": "./src/generators/component-story/compat",
|
|
33
|
-
"schema": "./src/generators/component-story/schema.json",
|
|
34
|
-
"description": "Creates a `stories.ts` file for a component.",
|
|
35
|
-
"hidden": true
|
|
36
|
-
},
|
|
37
|
-
"component-test": {
|
|
38
|
-
"factory": "./src/generators/component-test/compat",
|
|
39
|
-
"schema": "./src/generators/component-test/schema.json",
|
|
40
|
-
"description": "Creates a cypress component test file for a component."
|
|
41
|
-
},
|
|
42
|
-
"init": {
|
|
43
|
-
"factory": "./src/generators/init/init.compat#initSchematic",
|
|
44
|
-
"schema": "./src/generators/init/schema.json",
|
|
45
|
-
"description": "Initializes the `@nrwl/angular` plugin.",
|
|
46
|
-
"hidden": true
|
|
47
|
-
},
|
|
48
|
-
"library": {
|
|
49
|
-
"factory": "./src/generators/library/library.compat#librarySchematic",
|
|
50
|
-
"schema": "./src/generators/library/schema.json",
|
|
51
|
-
"aliases": ["lib"],
|
|
52
|
-
"x-type": "library",
|
|
53
|
-
"description": "Creates an Angular library."
|
|
54
|
-
},
|
|
55
|
-
"library-secondary-entry-point": {
|
|
56
|
-
"factory": "./src/generators/library-secondary-entry-point/compat",
|
|
57
|
-
"schema": "./src/generators/library-secondary-entry-point/schema.json",
|
|
58
|
-
"aliases": ["secondary-entry-point", "entry-point"],
|
|
59
|
-
"description": "Creates a secondary entry point for an Angular publishable library."
|
|
60
|
-
},
|
|
61
|
-
"remote": {
|
|
62
|
-
"factory": "./src/generators/remote/remote.compat",
|
|
63
|
-
"schema": "./src/generators/remote/schema.json",
|
|
64
|
-
"x-type": "application",
|
|
65
|
-
"description": "Generate a Remote Angular Module Federation Application."
|
|
66
|
-
},
|
|
67
|
-
"move": {
|
|
68
|
-
"factory": "./src/generators/move/compat",
|
|
69
|
-
"schema": "./src/generators/move/schema.json",
|
|
70
|
-
"aliases": ["mv"],
|
|
71
|
-
"description": "Moves an Angular application or library to another folder within the workspace and updates the project configuration.",
|
|
72
|
-
"x-deprecated": "Use the `@nx/workspace:move` generator instead. This generator will be removed in Nx v18."
|
|
73
|
-
},
|
|
74
|
-
"convert-to-with-mf": {
|
|
75
|
-
"factory": "./src/generators/convert-to-with-mf/convert-to-with-mf.compat",
|
|
76
|
-
"schema": "./src/generators/convert-to-with-mf/schema.json",
|
|
77
|
-
"description": "Converts an old micro frontend configuration to use the new `withModuleFederation` helper. It will run successfully if the following conditions are met: \n - Is either a host or remote application \n - Shared npm package configurations have not been modified \n - Name used to identify the Micro Frontend application matches the project name \n\n{% callout type=\"warning\" title=\"Overrides\" %}This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!{% /callout %}"
|
|
78
|
-
},
|
|
79
|
-
"host": {
|
|
80
|
-
"factory": "./src/generators/host/host.compat",
|
|
81
|
-
"schema": "./src/generators/host/schema.json",
|
|
82
|
-
"x-type": "application",
|
|
83
|
-
"description": "Generate a Host Angular Module Federation Application."
|
|
84
|
-
},
|
|
85
|
-
"ng-add": {
|
|
86
|
-
"factory": "./src/generators/ng-add/compat",
|
|
87
|
-
"schema": "./src/generators/ng-add/schema.json",
|
|
88
|
-
"description": "Migrates an Angular CLI workspace to Nx or adds the Angular plugin to an Nx workspace.",
|
|
89
|
-
"hidden": true
|
|
90
|
-
},
|
|
91
|
-
"ngrx": {
|
|
92
|
-
"factory": "./src/generators/ngrx/compat",
|
|
93
|
-
"schema": "./src/generators/ngrx/schema.json",
|
|
94
|
-
"description": "Adds NgRx support to an application or library.",
|
|
95
|
-
"x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Use the 'ngrx-root-store' and 'ngrx-feature-store' generators instead."
|
|
96
|
-
},
|
|
97
|
-
"scam-to-standalone": {
|
|
98
|
-
"factory": "./src/generators/scam-to-standalone/compat",
|
|
99
|
-
"schema": "./src/generators/scam-to-standalone/schema.json",
|
|
100
|
-
"description": "Convert an existing Single Component Angular Module (SCAM) to a Standalone Component."
|
|
101
|
-
},
|
|
102
|
-
"scam": {
|
|
103
|
-
"factory": "./src/generators/scam/scam.compat",
|
|
104
|
-
"schema": "./src/generators/scam/schema.json",
|
|
105
|
-
"description": "Generate a component with an accompanying Single Component Angular Module (SCAM)."
|
|
106
|
-
},
|
|
107
|
-
"scam-directive": {
|
|
108
|
-
"factory": "./src/generators/scam-directive/scam-directive.compat",
|
|
109
|
-
"schema": "./src/generators/scam-directive/schema.json",
|
|
110
|
-
"description": "Generate a directive with an accompanying Single Component Angular Module (SCAM)."
|
|
111
|
-
},
|
|
112
|
-
"scam-pipe": {
|
|
113
|
-
"factory": "./src/generators/scam-pipe/scam-pipe.compat",
|
|
114
|
-
"schema": "./src/generators/scam-pipe/schema.json",
|
|
115
|
-
"description": "Generate a pipe with an accompanying Single Component Angular Module (SCAM)."
|
|
116
|
-
},
|
|
117
|
-
"setup-mf": {
|
|
118
|
-
"factory": "./src/generators/setup-mf/setup-mf.compat",
|
|
119
|
-
"schema": "./src/generators/setup-mf/schema.json",
|
|
120
|
-
"description": "Generate a Module Federation configuration for a given Angular application."
|
|
121
|
-
},
|
|
122
|
-
"setup-ssr": {
|
|
123
|
-
"factory": "./src/generators/setup-ssr/setup-ssr.compat",
|
|
124
|
-
"schema": "./src/generators/setup-ssr/schema.json",
|
|
125
|
-
"description": "Generate Angular Universal (SSR) setup for an Angular application."
|
|
126
|
-
},
|
|
127
|
-
"setup-tailwind": {
|
|
128
|
-
"factory": "./src/generators/setup-tailwind/setup-tailwind.compat",
|
|
129
|
-
"schema": "./src/generators/setup-tailwind/schema.json",
|
|
130
|
-
"description": "Configures Tailwind CSS for an application or a buildable/publishable library."
|
|
131
|
-
},
|
|
132
|
-
"stories": {
|
|
133
|
-
"factory": "./src/generators/stories/compat",
|
|
134
|
-
"schema": "./src/generators/stories/schema.json",
|
|
135
|
-
"description": "Creates stories/specs for all components declared in a project."
|
|
136
|
-
},
|
|
137
|
-
"storybook-configuration": {
|
|
138
|
-
"factory": "./src/generators/storybook-configuration/compat",
|
|
139
|
-
"schema": "./src/generators/storybook-configuration/schema.json",
|
|
140
|
-
"description": "Adds Storybook configuration to a project."
|
|
141
|
-
},
|
|
142
|
-
"cypress-component-configuration": {
|
|
143
|
-
"factory": "./src/generators/cypress-component-configuration/compat",
|
|
144
|
-
"schema": "./src/generators/cypress-component-configuration/schema.json",
|
|
145
|
-
"description": "Setup Cypress component testing for a project."
|
|
146
|
-
},
|
|
147
|
-
"web-worker": {
|
|
148
|
-
"factory": "./src/generators/web-worker/compat",
|
|
149
|
-
"schema": "./src/generators/web-worker/schema.json",
|
|
150
|
-
"description": "Creates a Web Worker."
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
5
|
"generators": {
|
|
154
6
|
"add-linting": {
|
|
155
7
|
"factory": "./src/generators/add-linting/add-linting",
|
|
@@ -193,6 +45,12 @@
|
|
|
193
45
|
"aliases": ["d"],
|
|
194
46
|
"description": "Generate an Angular directive."
|
|
195
47
|
},
|
|
48
|
+
"federate-module": {
|
|
49
|
+
"factory": "./src/generators/federate-module/federate-module",
|
|
50
|
+
"schema": "./src/generators/federate-module/schema.json",
|
|
51
|
+
"x-type": "application",
|
|
52
|
+
"description": "Create a federated module, which is exposed by a remote and can be subsequently loaded by a host."
|
|
53
|
+
},
|
|
196
54
|
"init": {
|
|
197
55
|
"factory": "./src/generators/init/init",
|
|
198
56
|
"schema": "./src/generators/init/schema.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "17.0.0-beta.
|
|
3
|
+
"version": "17.0.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"url": "https://github.com/nrwl/nx/issues"
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://nx.dev",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
63
|
+
"executors": "./executors.json",
|
|
64
|
+
"generators": "./generators.json",
|
|
65
65
|
"ng-update": {
|
|
66
66
|
"requirements": {},
|
|
67
67
|
"migrations": "./migrations.json"
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
"webpack": "^5.80.0",
|
|
80
80
|
"webpack-merge": "^5.8.0",
|
|
81
81
|
"enquirer": "^2.3.6",
|
|
82
|
-
"@nx/devkit": "17.0.0-beta.
|
|
83
|
-
"@nx/cypress": "17.0.0-beta.
|
|
84
|
-
"@nx/jest": "17.0.0-beta.
|
|
85
|
-
"@nx/js": "17.0.0-beta.
|
|
86
|
-
"@nx/linter": "17.0.0-beta.
|
|
87
|
-
"@nx/webpack": "17.0.0-beta.
|
|
88
|
-
"@nx/workspace": "17.0.0-beta.
|
|
89
|
-
"@nrwl/angular": "17.0.0-beta.
|
|
82
|
+
"@nx/devkit": "17.0.0-beta.5",
|
|
83
|
+
"@nx/cypress": "17.0.0-beta.5",
|
|
84
|
+
"@nx/jest": "17.0.0-beta.5",
|
|
85
|
+
"@nx/js": "17.0.0-beta.5",
|
|
86
|
+
"@nx/linter": "17.0.0-beta.5",
|
|
87
|
+
"@nx/webpack": "17.0.0-beta.5",
|
|
88
|
+
"@nx/workspace": "17.0.0-beta.5",
|
|
89
|
+
"@nrwl/angular": "17.0.0-beta.5"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@angular-devkit/build-angular": ">= 14.0.0 < 17.0.0",
|
|
@@ -33,19 +33,6 @@
|
|
|
33
33
|
"description": "Whether to run a build when any file changes.",
|
|
34
34
|
"default": false
|
|
35
35
|
},
|
|
36
|
-
"updateBuildableProjectDepsInPackageJson": {
|
|
37
|
-
"type": "boolean",
|
|
38
|
-
"description": "Whether to update the buildable project dependencies in the build output package.json.",
|
|
39
|
-
"default": false,
|
|
40
|
-
"x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
|
|
41
|
-
},
|
|
42
|
-
"buildableProjectDepsInPackageJsonType": {
|
|
43
|
-
"type": "string",
|
|
44
|
-
"description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
|
|
45
|
-
"enum": ["dependencies", "peerDependencies"],
|
|
46
|
-
"default": "peerDependencies",
|
|
47
|
-
"x-deprecated": "Configure the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
|
|
48
|
-
},
|
|
49
36
|
"tailwindConfig": {
|
|
50
37
|
"type": "string",
|
|
51
38
|
"description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured."
|
|
@@ -39,17 +39,11 @@ function createLibraryExecutor(initializeNgPackagr) {
|
|
|
39
39
|
if (!(0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.root, context.projectName, context.targetName, dependencies)) {
|
|
40
40
|
return Promise.resolve({ success: false });
|
|
41
41
|
}
|
|
42
|
-
function updatePackageJson() {
|
|
43
|
-
if (topLevelDependencies.length > 0 &&
|
|
44
|
-
options.updateBuildableProjectDepsInPackageJson) {
|
|
45
|
-
(0, buildable_libs_utils_1.updateBuildableProjectPackageJsonDependencies)(context.root, context.projectName, context.targetName, context.configurationName, target, topLevelDependencies, options.buildableProjectDepsInPackageJsonType);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
42
|
if (options.watch) {
|
|
49
|
-
return yield* (0, rxjs_for_await_1.eachValueFrom)((0, rxjs_1.from)(initializeNgPackagr(options, context, dependencies)).pipe((0, operators_1.switchMap)((packagr) => packagr.watch()), (0, operators_1.
|
|
43
|
+
return yield* (0, rxjs_for_await_1.eachValueFrom)((0, rxjs_1.from)(initializeNgPackagr(options, context, dependencies)).pipe((0, operators_1.switchMap)((packagr) => packagr.watch()), (0, operators_1.mapTo)({ success: true })));
|
|
50
44
|
}
|
|
51
45
|
return (0, rxjs_1.from)(initializeNgPackagr(options, context, dependencies))
|
|
52
|
-
.pipe((0, operators_1.switchMap)((packagr) => packagr.build()), (0, operators_1.
|
|
46
|
+
.pipe((0, operators_1.switchMap)((packagr) => packagr.build()), (0, operators_1.mapTo)({ success: true }))
|
|
53
47
|
.toPromise();
|
|
54
48
|
};
|
|
55
49
|
}
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
export interface BuildAngularLibraryExecutorOptions {
|
|
2
2
|
project: string;
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
|
|
5
|
-
* rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
|
|
6
|
-
* It will be removed in v17.
|
|
7
|
-
*/
|
|
8
|
-
buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
|
|
9
3
|
tailwindConfig?: string;
|
|
10
4
|
tsConfig?: string;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
|
|
13
|
-
* rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
|
|
14
|
-
* It will be removed in v17.
|
|
15
|
-
*/
|
|
16
|
-
updateBuildableProjectDepsInPackageJson?: boolean;
|
|
17
5
|
watch?: boolean;
|
|
18
6
|
}
|
|
@@ -33,19 +33,6 @@
|
|
|
33
33
|
"description": "Whether to run a build when any file changes.",
|
|
34
34
|
"default": false
|
|
35
35
|
},
|
|
36
|
-
"updateBuildableProjectDepsInPackageJson": {
|
|
37
|
-
"type": "boolean",
|
|
38
|
-
"description": "Whether to update the buildable project dependencies in the build output package.json.",
|
|
39
|
-
"default": false,
|
|
40
|
-
"x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
|
|
41
|
-
},
|
|
42
|
-
"buildableProjectDepsInPackageJsonType": {
|
|
43
|
-
"type": "string",
|
|
44
|
-
"description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
|
|
45
|
-
"enum": ["dependencies", "peerDependencies"],
|
|
46
|
-
"default": "peerDependencies",
|
|
47
|
-
"x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
|
|
48
|
-
},
|
|
49
36
|
"tailwindConfig": {
|
|
50
37
|
"type": "string",
|
|
51
38
|
"description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured.",
|
|
@@ -6,22 +6,21 @@ const utils_1 = require("../utils");
|
|
|
6
6
|
const lib_1 = require("./lib");
|
|
7
7
|
async function directiveGenerator(tree, schema) {
|
|
8
8
|
(0, lib_1.validateOptions)(tree, schema);
|
|
9
|
-
const options = (0, lib_1.normalizeOptions)(tree, schema);
|
|
10
|
-
const directiveNames = (0, devkit_1.names)(options.name);
|
|
9
|
+
const options = await (0, lib_1.normalizeOptions)(tree, schema);
|
|
11
10
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.directory, {
|
|
12
11
|
selector: options.selector,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
symbolName: options.symbolName,
|
|
13
|
+
fileName: options.fileName,
|
|
15
14
|
standalone: options.standalone,
|
|
16
15
|
tpl: '',
|
|
17
16
|
});
|
|
18
17
|
if (options.skipTests) {
|
|
19
|
-
const pathToSpecFile = (0, devkit_1.joinPathFragments)(options.directory, `${
|
|
18
|
+
const pathToSpecFile = (0, devkit_1.joinPathFragments)(options.directory, `${options.fileName}.spec.ts`);
|
|
20
19
|
tree.delete(pathToSpecFile);
|
|
21
20
|
}
|
|
22
21
|
if (!options.skipImport && !options.standalone) {
|
|
23
|
-
const modulePath = (0, utils_1.findModule)(tree, options.
|
|
24
|
-
(0, utils_1.addToNgModule)(tree, options.
|
|
22
|
+
const modulePath = (0, utils_1.findModule)(tree, options.directory, options.module);
|
|
23
|
+
(0, utils_1.addToNgModule)(tree, options.directory, modulePath, '', options.symbolName, options.fileName, 'declarations', options.flat, options.export);
|
|
25
24
|
}
|
|
26
25
|
if (!options.skipFormat) {
|
|
27
26
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Tree } from '@nx/devkit';
|
|
2
2
|
import type { NormalizedSchema, Schema } from '../schema';
|
|
3
|
-
export declare function normalizeOptions(tree: Tree, options: Schema): NormalizedSchema
|
|
3
|
+
export declare function normalizeOptions(tree: Tree, options: Schema): Promise<NormalizedSchema>;
|
|
@@ -2,21 +2,33 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("../../utils/path");
|
|
6
5
|
const selector_1 = require("../../utils/selector");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
7
|
+
async function normalizeOptions(tree, options) {
|
|
8
|
+
const { artifactName: name, directory, fileName, filePath, project, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
9
|
+
artifactType: 'directive',
|
|
10
|
+
callingGenerator: '@nx/angular:directive',
|
|
11
|
+
name: options.name,
|
|
12
|
+
directory: options.directory ?? options.path,
|
|
13
|
+
flat: options.flat,
|
|
14
|
+
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
15
|
+
project: options.project,
|
|
16
|
+
suffix: 'directive',
|
|
11
17
|
});
|
|
12
|
-
const {
|
|
18
|
+
const { className } = (0, devkit_1.names)(name);
|
|
19
|
+
const { className: suffixClassName } = (0, devkit_1.names)('directive');
|
|
20
|
+
const symbolName = `${className}${suffixClassName}`;
|
|
21
|
+
const { prefix } = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
13
22
|
const selector = options.selector ??
|
|
14
23
|
(0, selector_1.buildSelector)(tree, name, options.prefix, prefix, 'propertyName');
|
|
15
24
|
return {
|
|
16
25
|
...options,
|
|
17
|
-
|
|
26
|
+
project,
|
|
18
27
|
name,
|
|
19
|
-
|
|
28
|
+
directory,
|
|
29
|
+
fileName,
|
|
30
|
+
filePath,
|
|
31
|
+
symbolName,
|
|
20
32
|
selector,
|
|
21
33
|
};
|
|
22
34
|
}
|
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateOptions = void 0;
|
|
4
4
|
const validations_1 = require("../../utils/validations");
|
|
5
5
|
function validateOptions(tree, options) {
|
|
6
|
-
(0, validations_1.validateProject)(tree, options.project);
|
|
7
|
-
(0, validations_1.validatePathIsUnderProjectRoot)(tree, options.project, options.path);
|
|
8
6
|
(0, validations_1.validateStandaloneOption)(tree, options.standalone);
|
|
9
7
|
}
|
|
10
8
|
exports.validateOptions = validateOptions;
|
|
@@ -1,19 +1,35 @@
|
|
|
1
|
+
import { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
|
|
2
|
+
|
|
1
3
|
export interface Schema {
|
|
2
4
|
name: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
directory?: string;
|
|
6
|
+
nameAndDirectoryFormat?: NameAndDirectoryFormat;
|
|
5
7
|
prefix?: string;
|
|
6
8
|
skipTests?: boolean;
|
|
7
9
|
skipImport?: boolean;
|
|
8
10
|
selector?: string;
|
|
9
11
|
standalone?: boolean;
|
|
10
|
-
flat?: boolean;
|
|
11
12
|
module?: string;
|
|
12
13
|
export?: boolean;
|
|
13
14
|
skipFormat?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18.
|
|
17
|
+
*/
|
|
18
|
+
flat?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Provide the `directory` option instead. It will be removed in Nx v18.
|
|
21
|
+
*/
|
|
22
|
+
path?: string;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v18.
|
|
25
|
+
*/
|
|
26
|
+
project?: string;
|
|
14
27
|
}
|
|
15
28
|
|
|
16
29
|
export interface NormalizedSchema extends Schema {
|
|
17
30
|
directory: string;
|
|
18
|
-
|
|
31
|
+
filePath: string;
|
|
32
|
+
fileName: string;
|
|
33
|
+
symbolName: string;
|
|
34
|
+
project: string;
|
|
19
35
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"cli": "nx",
|
|
5
5
|
"title": "Nx Angular Directive Options Schema",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"description": "Creates a new
|
|
7
|
+
"description": "Creates a new Angular directive.",
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
10
|
"name": {
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
},
|
|
17
17
|
"x-prompt": "What name would you like to use for the directive?"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
19
|
+
"directory": {
|
|
20
20
|
"type": "string",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
21
|
+
"description": "The directory at which to create the directive file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
|
22
|
+
"aliases": ["dir", "path"],
|
|
23
|
+
"x-priority": "important"
|
|
24
|
+
},
|
|
25
|
+
"nameAndDirectoryFormat": {
|
|
26
|
+
"description": "Whether to generate the directive in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"enum": ["as-provided", "derived"]
|
|
27
29
|
},
|
|
28
30
|
"project": {
|
|
29
31
|
"type": "string",
|
|
@@ -31,7 +33,8 @@
|
|
|
31
33
|
"$default": {
|
|
32
34
|
"$source": "projectName"
|
|
33
35
|
},
|
|
34
|
-
"x-dropdown": "projects"
|
|
36
|
+
"x-dropdown": "projects",
|
|
37
|
+
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v18."
|
|
35
38
|
},
|
|
36
39
|
"prefix": {
|
|
37
40
|
"type": "string",
|
|
@@ -70,7 +73,8 @@
|
|
|
70
73
|
"flat": {
|
|
71
74
|
"type": "boolean",
|
|
72
75
|
"description": "When true (the default), creates the new files at the top level of the current project.",
|
|
73
|
-
"default": true
|
|
76
|
+
"default": true,
|
|
77
|
+
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18."
|
|
74
78
|
},
|
|
75
79
|
"module": {
|
|
76
80
|
"type": "string",
|
|
@@ -88,5 +92,5 @@
|
|
|
88
92
|
"description": "Skip formatting of files."
|
|
89
93
|
}
|
|
90
94
|
},
|
|
91
|
-
"required": ["name"
|
|
95
|
+
"required": ["name"]
|
|
92
96
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.federateModuleGenerator = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const lib_1 = require("./lib");
|
|
6
|
+
async function federateModuleGenerator(tree, schema) {
|
|
7
|
+
if (!tree.exists(schema.path)) {
|
|
8
|
+
throw new Error((0, devkit_1.stripIndents) `The "path" provided does not exist. Please verify the path is correct and pointing to a file that exists in the workspace.
|
|
9
|
+
|
|
10
|
+
Path: ${schema.path}`);
|
|
11
|
+
}
|
|
12
|
+
const { tasks, projectRoot, remoteName } = await (0, lib_1.addRemote)(tree, schema);
|
|
13
|
+
(0, lib_1.addFileToRemoteTsconfig)(tree, remoteName, schema.path);
|
|
14
|
+
(0, lib_1.addPathToExposes)(tree, {
|
|
15
|
+
projectPath: projectRoot,
|
|
16
|
+
modulePath: schema.path,
|
|
17
|
+
moduleName: schema.name,
|
|
18
|
+
});
|
|
19
|
+
(0, lib_1.addPathToTsConfig)(tree, {
|
|
20
|
+
remoteName,
|
|
21
|
+
moduleName: schema.name,
|
|
22
|
+
pathToFile: schema.path,
|
|
23
|
+
});
|
|
24
|
+
if (!schema.skipFormat) {
|
|
25
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
26
|
+
}
|
|
27
|
+
devkit_1.logger.info(`✅️ Updated module federation config.
|
|
28
|
+
Now you can use the module from your remote app like this:
|
|
29
|
+
|
|
30
|
+
Static import:
|
|
31
|
+
import { MyComponent } from '${remoteName}/${schema.name}';
|
|
32
|
+
|
|
33
|
+
Dynamic import:
|
|
34
|
+
import('${remoteName}/${schema.name}').then((m) => m.MyComponent);
|
|
35
|
+
`);
|
|
36
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
37
|
+
}
|
|
38
|
+
exports.federateModuleGenerator = federateModuleGenerator;
|
|
39
|
+
exports.default = federateModuleGenerator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addFileToRemoteTsconfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function addFileToRemoteTsconfig(tree, remoteName, pathToExpose) {
|
|
6
|
+
const remote = (0, devkit_1.readProjectConfiguration)(tree, remoteName);
|
|
7
|
+
(0, devkit_1.updateJson)(tree, remote.targets.build.options.tsConfig, (json) => ({
|
|
8
|
+
...json,
|
|
9
|
+
files: [
|
|
10
|
+
...json.files,
|
|
11
|
+
(0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(remote.root), pathToExpose),
|
|
12
|
+
],
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
exports.addFileToRemoteTsconfig = addFileToRemoteTsconfig;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
type AddPathToExposesOptions = {
|
|
3
|
+
projectPath: string;
|
|
4
|
+
moduleName: string;
|
|
5
|
+
modulePath: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function addPathToExposes(tree: Tree, { projectPath, moduleName, modulePath }: AddPathToExposesOptions): void;
|
|
8
|
+
export {};
|