@nrwl/react 13.10.0-beta.8 → 13.10.0-rc.1
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 +16 -0
- package/generators.json +14 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/migrations.json +13 -3
- package/module-federation.d.ts +4 -0
- package/module-federation.js +10 -0
- package/module-federation.js.map +1 -0
- package/package.json +10 -9
- package/plugins/storybook/index.js +5 -5
- package/plugins/storybook/index.js.map +1 -1
- package/plugins/webpack.d.ts +2 -1
- package/plugins/webpack.js +2 -0
- package/plugins/webpack.js.map +1 -1
- package/src/executors/mfe-dev-server/compat.d.ts +2 -0
- package/src/executors/mfe-dev-server/compat.js +6 -0
- package/src/executors/mfe-dev-server/compat.js.map +1 -0
- package/src/executors/mfe-dev-server/mfe-dev-server.impl.d.ts +11 -0
- package/src/executors/mfe-dev-server/mfe-dev-server.impl.js +86 -0
- package/src/executors/mfe-dev-server/mfe-dev-server.impl.js.map +1 -0
- package/src/executors/mfe-dev-server/schema.json +82 -0
- package/src/generators/application/application.d.ts +1 -1
- package/src/generators/application/files/common/src/app/__fileName__.spec.tsx__tmpl__ +1 -1
- package/src/generators/application/lib/normalize-options.js +2 -2
- package/src/generators/application/lib/normalize-options.js.map +1 -1
- package/src/generators/application/schema.d.ts +2 -0
- package/src/generators/component/component.d.ts +1 -1
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +1 -1
- package/src/generators/component-story/component-story.d.ts +1 -1
- package/src/generators/hook/hook.d.ts +1 -1
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/library/library.d.ts +1 -1
- package/src/generators/mfe-host/files/common/src/app/__fileName__.tsx__tmpl__ +29 -0
- package/src/generators/mfe-host/files/mfe/mfe.config.js__tmpl__ +6 -0
- package/src/generators/mfe-host/files/mfe/src/main.ts__tmpl__ +1 -0
- package/src/generators/mfe-host/files/mfe/src/remotes.d.ts__tmpl__ +4 -0
- package/src/generators/mfe-host/files/mfe/webpack.config.js__tmpl__ +6 -0
- package/src/generators/mfe-host/files/mfe/webpack.config.prod.js__tmpl__ +1 -0
- package/src/generators/mfe-host/lib/add-mfe.d.ts +2 -0
- package/src/generators/mfe-host/lib/add-mfe.js +17 -0
- package/src/generators/mfe-host/lib/add-mfe.js.map +1 -0
- package/src/generators/mfe-host/lib/update-host-with-remote.d.ts +3 -0
- package/src/generators/mfe-host/lib/update-host-with-remote.js +10 -0
- package/src/generators/mfe-host/lib/update-host-with-remote.js.map +1 -0
- package/src/generators/mfe-host/lib/update-mfe-e2e-project.d.ts +3 -0
- package/src/generators/mfe-host/lib/update-mfe-e2e-project.js +17 -0
- package/src/generators/mfe-host/lib/update-mfe-e2e-project.js.map +1 -0
- package/src/generators/mfe-host/lib/update-mfe-project.d.ts +3 -0
- package/src/generators/mfe-host/lib/update-mfe-project.js +13 -0
- package/src/generators/mfe-host/lib/update-mfe-project.js.map +1 -0
- package/src/generators/mfe-host/mfe-host.d.ts +3 -0
- package/src/generators/mfe-host/mfe-host.js +43 -0
- package/src/generators/mfe-host/mfe-host.js.map +1 -0
- package/src/generators/mfe-host/schema.d.ts +28 -0
- package/src/generators/mfe-host/schema.json +155 -0
- package/src/generators/mfe-remote/files/mfe/mfe.config.js__tmpl__ +6 -0
- package/src/generators/mfe-remote/files/mfe/src/main.ts__tmpl__ +1 -0
- package/src/generators/mfe-remote/files/mfe/src/remote-entry.ts__tmpl__ +1 -0
- package/src/generators/mfe-remote/files/mfe/webpack.config.js__tmpl__ +6 -0
- package/src/generators/mfe-remote/files/mfe/webpack.config.prod.js__tmpl__ +1 -0
- package/src/generators/mfe-remote/mfe-remote.d.ts +5 -0
- package/src/generators/mfe-remote/mfe-remote.js +41 -0
- package/src/generators/mfe-remote/mfe-remote.js.map +1 -0
- package/src/generators/mfe-remote/schema.d.ts +30 -0
- package/src/generators/mfe-remote/schema.json +159 -0
- package/src/generators/redux/redux.d.ts +1 -1
- package/src/generators/stories/stories.d.ts +1 -1
- package/src/generators/storybook-configuration/configuration.d.ts +1 -1
- package/src/generators/storybook-migrate-defaults-5-to-6/migrate-defaults-5-to-6.d.ts +1 -1
- package/src/mfe/webpack-utils.d.ts +17 -0
- package/src/mfe/webpack-utils.js +66 -0
- package/src/mfe/webpack-utils.js.map +1 -0
- package/src/mfe/with-module-federation.d.ts +14 -0
- package/src/mfe/with-module-federation.js +167 -0
- package/src/mfe/with-module-federation.js.map +1 -0
- package/src/migrations/update-13-10-0/update-13-10-0.d.ts +3 -0
- package/src/migrations/update-13-10-0/update-13-10-0.js +28 -0
- package/src/migrations/update-13-10-0/update-13-10-0.js.map +1 -0
- package/src/utils/versions.d.ts +6 -6
- package/src/utils/versions.js +7 -7
package/executors.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"builders": {
|
|
3
|
+
"mfe-dev-server": {
|
|
4
|
+
"implementation": "./src/executors/mfe-dev-server/compat",
|
|
5
|
+
"schema": "./src/executors/mfe-dev-server/schema.json",
|
|
6
|
+
"description": "Serve an MFE host or remote application."
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"executors": {
|
|
10
|
+
"mfe-dev-server": {
|
|
11
|
+
"implementation": "./src/executors/mfe-dev-server/mfe-dev-server.impl",
|
|
12
|
+
"schema": "./src/executors/mfe-dev-server/schema.json",
|
|
13
|
+
"description": "Serve an MFE host or remote application."
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/generators.json
CHANGED
|
@@ -162,6 +162,20 @@
|
|
|
162
162
|
"schema": "./src/generators/hook/schema.json",
|
|
163
163
|
"description": "Create a hook.",
|
|
164
164
|
"aliases": "c"
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
"mfe-host": {
|
|
168
|
+
"factory": "./src/generators/mfe-host/mfe-host#mfeHostGenerator",
|
|
169
|
+
"schema": "./src/generators/mfe-host/schema.json",
|
|
170
|
+
"description": "Generate a host react application",
|
|
171
|
+
"aliases": "host"
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
"mfe-remote": {
|
|
175
|
+
"factory": "./src/generators/mfe-remote/mfe-remote#mfeRemoteGenerator",
|
|
176
|
+
"schema": "./src/generators/mfe-remote/schema.json",
|
|
177
|
+
"description": "Generate a remote react application",
|
|
178
|
+
"aliases": "remote"
|
|
165
179
|
}
|
|
166
180
|
}
|
|
167
181
|
}
|
package/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export { reduxGenerator } from './src/generators/redux/redux';
|
|
|
13
13
|
export { storiesGenerator } from './src/generators/stories/stories';
|
|
14
14
|
export { storybookConfigurationGenerator } from './src/generators/storybook-configuration/configuration';
|
|
15
15
|
export { storybookMigration5to6Generator } from './src/generators/storybook-migrate-defaults-5-to-6/migrate-defaults-5-to-6';
|
|
16
|
+
export { mfeHostGenerator } from './src/generators/mfe-host/mfe-host';
|
|
16
17
|
export type { SupportedStyles } from './typings/style';
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.storybookMigration5to6Generator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.componentCypressGenerator = exports.hookGenerator = exports.componentGenerator = exports.applicationGenerator = exports.reactVersion = exports.reactDomVersion = exports.assertValidStyle = exports.CSS_IN_JS_DEPENDENCIES = exports.createReactEslintJson = exports.extraEslintDependencies = void 0;
|
|
3
|
+
exports.mfeHostGenerator = exports.storybookMigration5to6Generator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.componentCypressGenerator = exports.hookGenerator = exports.componentGenerator = exports.applicationGenerator = exports.reactVersion = exports.reactDomVersion = exports.assertValidStyle = exports.CSS_IN_JS_DEPENDENCIES = exports.createReactEslintJson = exports.extraEslintDependencies = void 0;
|
|
4
4
|
var lint_1 = require("./src/utils/lint");
|
|
5
5
|
Object.defineProperty(exports, "extraEslintDependencies", { enumerable: true, get: function () { return lint_1.extraEslintDependencies; } });
|
|
6
6
|
Object.defineProperty(exports, "createReactEslintJson", { enumerable: true, get: function () { return lint_1.createReactEslintJson; } });
|
|
@@ -33,4 +33,6 @@ var configuration_1 = require("./src/generators/storybook-configuration/configur
|
|
|
33
33
|
Object.defineProperty(exports, "storybookConfigurationGenerator", { enumerable: true, get: function () { return configuration_1.storybookConfigurationGenerator; } });
|
|
34
34
|
var migrate_defaults_5_to_6_1 = require("./src/generators/storybook-migrate-defaults-5-to-6/migrate-defaults-5-to-6");
|
|
35
35
|
Object.defineProperty(exports, "storybookMigration5to6Generator", { enumerable: true, get: function () { return migrate_defaults_5_to_6_1.storybookMigration5to6Generator; } });
|
|
36
|
+
var mfe_host_1 = require("./src/generators/mfe-host/mfe-host");
|
|
37
|
+
Object.defineProperty(exports, "mfeHostGenerator", { enumerable: true, get: function () { return mfe_host_1.mfeHostGenerator; } });
|
|
36
38
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/react/index.ts"],"names":[],"mappings":";;;AAAA,yCAG0B;AAFxB,+GAAA,uBAAuB,OAAA;AACvB,6GAAA,qBAAqB,OAAA;AAEvB,6CAA4D;AAAnD,gHAAA,sBAAsB,OAAA;AAC/B,mDAAyD;AAAhD,6GAAA,gBAAgB,OAAA;AACzB,iDAAqE;AAA5D,2GAAA,eAAe,OAAA;AAAE,wGAAA,YAAY,OAAA;AACtC,wEAAgF;AAAvE,mHAAA,oBAAoB,OAAA;AAC7B,kEAA0E;AAAjE,+GAAA,kBAAkB,OAAA;AAC3B,mDAA2D;AAAlD,qGAAA,aAAa,OAAA;AACtB,yGAA2G;AAAlG,mIAAA,yBAAyB,OAAA;AAClC,oFAA2F;AAAlF,0HAAA,uBAAuB,OAAA;AAChC,4DAAoE;AAA3D,2GAAA,gBAAgB,OAAA;AACzB,mDAAgE;AAAvD,0GAAA,kBAAkB,OAAA;AAC3B,sDAA8D;AAArD,uGAAA,cAAc,OAAA;AACvB,4DAAoE;AAA3D,2GAAA,gBAAgB,OAAA;AACzB,wFAAyG;AAAhG,gIAAA,+BAA+B,OAAA;AACxC,sHAA6H;AAApH,0IAAA,+BAA+B,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/react/index.ts"],"names":[],"mappings":";;;AAAA,yCAG0B;AAFxB,+GAAA,uBAAuB,OAAA;AACvB,6GAAA,qBAAqB,OAAA;AAEvB,6CAA4D;AAAnD,gHAAA,sBAAsB,OAAA;AAC/B,mDAAyD;AAAhD,6GAAA,gBAAgB,OAAA;AACzB,iDAAqE;AAA5D,2GAAA,eAAe,OAAA;AAAE,wGAAA,YAAY,OAAA;AACtC,wEAAgF;AAAvE,mHAAA,oBAAoB,OAAA;AAC7B,kEAA0E;AAAjE,+GAAA,kBAAkB,OAAA;AAC3B,mDAA2D;AAAlD,qGAAA,aAAa,OAAA;AACtB,yGAA2G;AAAlG,mIAAA,yBAAyB,OAAA;AAClC,oFAA2F;AAAlF,0HAAA,uBAAuB,OAAA;AAChC,4DAAoE;AAA3D,2GAAA,gBAAgB,OAAA;AACzB,mDAAgE;AAAvD,0GAAA,kBAAkB,OAAA;AAC3B,sDAA8D;AAArD,uGAAA,cAAc,OAAA;AACvB,4DAAoE;AAA3D,2GAAA,gBAAgB,OAAA;AACzB,wFAAyG;AAAhG,gIAAA,+BAA+B,OAAA;AACxC,sHAA6H;AAApH,0IAAA,+BAA+B,OAAA;AACxC,+DAAsE;AAA7D,4GAAA,gBAAgB,OAAA"}
|
package/migrations.json
CHANGED
|
@@ -29,6 +29,12 @@
|
|
|
29
29
|
"version": "13.0.0-beta.0",
|
|
30
30
|
"description": "Migrate Storybook to use webpack 5",
|
|
31
31
|
"factory": "./src/migrations/update-13-0-0/migrate-storybook-to-webpack-5"
|
|
32
|
+
},
|
|
33
|
+
"update-react-18-13.10.0": {
|
|
34
|
+
"cli": "nx",
|
|
35
|
+
"version": "13.10.0-beta.0",
|
|
36
|
+
"description": "Update to React 18",
|
|
37
|
+
"factory": "./src/migrations/update-13-10-0/update-13-10-0"
|
|
32
38
|
}
|
|
33
39
|
},
|
|
34
40
|
"packageJsonUpdates": {
|
|
@@ -268,12 +274,16 @@
|
|
|
268
274
|
"version": "5.3.5",
|
|
269
275
|
"alwaysAddToPackageJson": false
|
|
270
276
|
},
|
|
277
|
+
"eslint-plugin-react": {
|
|
278
|
+
"version": "7.29.4",
|
|
279
|
+
"alwaysAddToPackageJson": false
|
|
280
|
+
},
|
|
271
281
|
"styled-jsx": {
|
|
272
|
-
"version": "5.0.
|
|
282
|
+
"version": "5.0.2",
|
|
273
283
|
"alwaysAddToPackageJson": false
|
|
274
284
|
},
|
|
275
|
-
"eslint-plugin-react": {
|
|
276
|
-
"version": "
|
|
285
|
+
"eslint-plugin-react-hooks": {
|
|
286
|
+
"version": "4.4.0",
|
|
277
287
|
"alwaysAddToPackageJson": false
|
|
278
288
|
}
|
|
279
289
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const with_module_federation_1 = require("./src/mfe/with-module-federation");
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return with_module_federation_1.withModuleFederation; } });
|
|
7
|
+
tslib_1.__exportStar(require("./src/mfe/webpack-utils"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./src/mfe/with-module-federation"), exports);
|
|
9
|
+
module.exports = with_module_federation_1.withModuleFederation;
|
|
10
|
+
//# sourceMappingURL=module-federation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-federation.js","sourceRoot":"","sources":["../../../packages/react/module-federation.ts"],"names":[],"mappings":";;;;AAAA,6EAAwE;AAIvC,wFAJxB,6CAAoB,OAIW;AAFxC,kEAAwC;AACxC,2EAAiD;AAGjD,MAAM,CAAC,OAAO,GAAG,6CAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react",
|
|
3
|
-
"version": "13.10.0-
|
|
3
|
+
"version": "13.10.0-rc.1",
|
|
4
4
|
"description": "The React plugin contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"url": "https://github.com/nrwl/nx/issues"
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://nx.dev",
|
|
26
|
+
"builders": "./executors.json",
|
|
26
27
|
"schematics": "./generators.json",
|
|
27
28
|
"ng-update": {
|
|
28
29
|
"requirements": {},
|
|
@@ -31,14 +32,14 @@
|
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@babel/core": "^7.15.0",
|
|
33
34
|
"@babel/preset-react": "^7.14.5",
|
|
34
|
-
"@nrwl/cypress": "13.10.0-
|
|
35
|
-
"@nrwl/devkit": "13.10.0-
|
|
36
|
-
"@nrwl/jest": "13.10.0-
|
|
37
|
-
"@nrwl/js": "13.10.0-
|
|
38
|
-
"@nrwl/linter": "13.10.0-
|
|
39
|
-
"@nrwl/storybook": "13.10.0-
|
|
40
|
-
"@nrwl/web": "13.10.0-
|
|
41
|
-
"@nrwl/workspace": "13.10.0-
|
|
35
|
+
"@nrwl/cypress": "13.10.0-rc.1",
|
|
36
|
+
"@nrwl/devkit": "13.10.0-rc.1",
|
|
37
|
+
"@nrwl/jest": "13.10.0-rc.1",
|
|
38
|
+
"@nrwl/js": "13.10.0-rc.1",
|
|
39
|
+
"@nrwl/linter": "13.10.0-rc.1",
|
|
40
|
+
"@nrwl/storybook": "13.10.0-rc.1",
|
|
41
|
+
"@nrwl/web": "13.10.0-rc.1",
|
|
42
|
+
"@nrwl/workspace": "13.10.0-rc.1",
|
|
42
43
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
|
|
43
44
|
"@svgr/webpack": "^6.1.2",
|
|
44
45
|
"chalk": "4.1.0",
|
|
@@ -17,7 +17,7 @@ const babelDefault = () => {
|
|
|
17
17
|
// Add babel plugin for styled-components or emotion.
|
|
18
18
|
// We don't have a good way to know when a project uses one or the other, so
|
|
19
19
|
// add the plugin only if the other style package isn't used.
|
|
20
|
-
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(devkit_2.
|
|
20
|
+
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(devkit_2.workspaceRoot, 'package.json'));
|
|
21
21
|
const deps = Object.assign(Object.assign({}, packageJson.dependencies), packageJson.devDependencies);
|
|
22
22
|
const hasStyledComponents = !!deps['styled-components'];
|
|
23
23
|
const plugins = [];
|
|
@@ -61,7 +61,7 @@ const webpack = (storybookWebpackConfig = {}, options) => tslib_1.__awaiter(void
|
|
|
61
61
|
// doesn't work with `@emotion/*` >= v11
|
|
62
62
|
// this is a workaround to fix that
|
|
63
63
|
let resolvedEmotionAliases = {};
|
|
64
|
-
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(devkit_2.
|
|
64
|
+
const packageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(devkit_2.workspaceRoot, 'package.json'));
|
|
65
65
|
const deps = Object.assign(Object.assign({}, packageJson.dependencies), packageJson.devDependencies);
|
|
66
66
|
const emotionReactVersion = deps['@emotion/react'];
|
|
67
67
|
if (emotionReactVersion &&
|
|
@@ -71,9 +71,9 @@ const webpack = (storybookWebpackConfig = {}, options) => tslib_1.__awaiter(void
|
|
|
71
71
|
resolvedEmotionAliases = {
|
|
72
72
|
resolve: {
|
|
73
73
|
alias: {
|
|
74
|
-
'@emotion/core': (0, devkit_1.joinPathFragments)(devkit_2.
|
|
75
|
-
'@emotion/styled': (0, devkit_1.joinPathFragments)(devkit_2.
|
|
76
|
-
'emotion-theming': (0, devkit_1.joinPathFragments)(devkit_2.
|
|
74
|
+
'@emotion/core': (0, devkit_1.joinPathFragments)(devkit_2.workspaceRoot, 'node_modules', '@emotion/react'),
|
|
75
|
+
'@emotion/styled': (0, devkit_1.joinPathFragments)(devkit_2.workspaceRoot, 'node_modules', '@emotion/styled'),
|
|
76
|
+
'emotion-theming': (0, devkit_1.joinPathFragments)(devkit_2.workspaceRoot, 'node_modules', '@emotion/react'),
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/react/plugins/storybook/index.ts"],"names":[],"mappings":";;;;AAAA,yCAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/react/plugins/storybook/index.ts"],"names":[],"mappings":";;;;AAAA,yCAA+D;AAC/D,yCAA6C;AAC7C,uDAAmE;AACnE,+DAAkE;AAClE,+EAAsF;AACtF,wDAAgD;AAChD,+BAA4B;AAC5B,mCAA6B;AAE7B,8CAA8C;AAC9C,mDAA+C;AAE/C,MAAM,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE1C,MAAM,YAAY,GAAG,GAI1B,EAAE;IACF,qDAAqD;IACrD,4EAA4E;IAC5E,6DAA6D;IAC7D,MAAM,WAAW,GAAG,IAAA,qBAAY,EAAC,IAAA,WAAI,EAAC,sBAAa,EAAE,cAAc,CAAC,CAAC,CAAC;IACtE,MAAM,IAAI,mCAAQ,WAAW,CAAC,YAAY,GAAK,WAAW,CAAC,eAAe,CAAE,CAAC;IAC7E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c,EACd,iBAAiB,CAClB;wBACD,iBAAiB,EAAE,IAAA,0BAAiB,EAClC,sBAAa,EACb,cAAc,EACd,gBAAgB,CACjB;qBACF;iBACF;aACF,CAAC;SACH;KACF;IACD,OAAO,YAAY,CAAC,KAAK,iCAElB,sBAAsB,KACzB,MAAM,kCACD,sBAAsB,CAAC,MAAM,KAChC,KAAK,EAAE;gBACL,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK;gBACtC,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK;aAC5B,KAEH,OAAO,kCACF,sBAAsB,CAAC,OAAO,KACjC,OAAO,EAAE,IAAA,4BAAY,EACnB,GAAI,CAAC,MAAA,sBAAsB,CAAC,OAAO,CAAC,OAAO,mCACzC,EAAE,CAAwC,EAC5C,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,CAAC,OAAO,mCAAI,EAAE,CAAC,CACvC,KAEH,OAAO,EAAE,IAAA,4BAAY,EACnB,GAAG,CAAC,MAAA,sBAAsB,CAAC,OAAO,mCAAI,EAAE,CAAC,EACzC,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,CAC/B,KAEH,sBAAsB,CACvB,CAAC;AACJ,CAAC,CAAA,CAAC;AArHW,QAAA,OAAO,WAqHlB"}
|
package/plugins/webpack.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Configuration } from 'webpack';
|
|
2
|
+
export declare function getWebpackConfig(config: Configuration): Configuration;
|
package/plugins/webpack.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWebpackConfig = void 0;
|
|
3
4
|
const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
|
|
4
5
|
// Add React-specific configuration
|
|
5
6
|
function getWebpackConfig(config) {
|
|
@@ -66,5 +67,6 @@ function getWebpackConfig(config) {
|
|
|
66
67
|
}
|
|
67
68
|
return config;
|
|
68
69
|
}
|
|
70
|
+
exports.getWebpackConfig = getWebpackConfig;
|
|
69
71
|
module.exports = getWebpackConfig;
|
|
70
72
|
//# sourceMappingURL=webpack.js.map
|
package/plugins/webpack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../../../packages/react/plugins/webpack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../../../packages/react/plugins/webpack.ts"],"names":[],"mappings":";;;AACA,2EAA4E;AAE5E,mCAAmC;AACnC,SAAgB,gBAAgB,CAAC,MAAqB;;IACpD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE;YACL,oFAAoF;YACpF;gBACE,MAAM,EAAE,iBAAiB;gBACzB,GAAG,EAAE;oBACH;wBACE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC;wBACxC,OAAO,EAAE;4BACP,IAAI,EAAE,KAAK;4BACX,SAAS,EAAE,IAAI;4BACf,GAAG,EAAE,IAAI;yBACV;qBACF;oBACD;wBACE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;wBACrC,OAAO,EAAE;4BACP,KAAK,EAAE,KAAK;4BACZ,IAAI,EAAE,uBAAuB;4BAC7B,QAAQ,EAAE,KAAK;yBAChB;qBACF;iBACF;aACF;YACD,gCAAgC;YAChC;gBACE,GAAG,EAAE;oBACH;wBACE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;wBACrC,OAAO,EAAE;4BACP,KAAK,EAAE,KAAK;4BACZ,IAAI,EAAE,uBAAuB;yBAC9B;qBACF;iBACF;aACF;SACF;KACF,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,KAAI,MAAA,MAAM,CAAC,WAAW,CAAC,0CAAE,GAAG,CAAA,EAAE;QAC7D,mDAAmD;QACnD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAC1C,CAAC,IAAI,EAAE,EAAE;;YACP,OAAA,OAAO,IAAI,KAAK,QAAQ;iBACxB,MAAA,IAAI,CAAC,MAAM,0CAAE,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAA,CAAA;SAAA,CACnD,CAAC;QACF,IAAI,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YAClD,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG;gBAC/B,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;gBACzC;oBACE,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC;oBACtC;wBACE,YAAY,EAAE,IAAI;qBACnB;iBACF;aACF,CAAC;SACH;QACD,+EAA+E;QAC/E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;KAC/C;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAhED,4CAgEC;AAED,MAAM,CAAC,OAAO,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
+
const mfe_dev_server_impl_1 = require("./mfe-dev-server.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(mfe_dev_server_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react/src/executors/mfe-dev-server/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,+DAAiD;AAEjD,kBAAe,IAAA,0BAAiB,EAAC,6BAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import { WebDevServerOptions } from '@nrwl/web/src/executors/dev-server/dev-server.impl';
|
|
3
|
+
declare type MFEDevServerOptions = WebDevServerOptions & {
|
|
4
|
+
apps?: string[];
|
|
5
|
+
};
|
|
6
|
+
export default function mfeDevServer(options: MFEDevServerOptions, context: ExecutorContext): AsyncGenerator<{
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
emittedFiles: import("../../../../../build/packages/web/src/utils/run-webpack").EmittedFile[];
|
|
9
|
+
success: boolean;
|
|
10
|
+
}, any, undefined>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const dev_server_impl_1 = require("@nrwl/web/src/executors/dev-server/dev-server.impl");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
function mfeDevServer(options, context) {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
return tslib_1.__asyncGenerator(this, arguments, function* mfeDevServer_1() {
|
|
10
|
+
let iter = (0, dev_server_impl_1.default)(options, context);
|
|
11
|
+
const p = context.workspace.projects[context.projectName];
|
|
12
|
+
const mfeConfigPath = (0, path_1.join)(context.root, p.root, 'mfe.config.js');
|
|
13
|
+
let mfeConfig;
|
|
14
|
+
try {
|
|
15
|
+
mfeConfig = require(mfeConfigPath);
|
|
16
|
+
}
|
|
17
|
+
catch (_c) {
|
|
18
|
+
// TODO(jack): Add a link to guide
|
|
19
|
+
throw new Error(`Could not load ${mfeConfigPath}. Was this project generated with "@nrwl/react:mfe-host"?`);
|
|
20
|
+
}
|
|
21
|
+
// Remotes can be specified with a custom location
|
|
22
|
+
// e.g.
|
|
23
|
+
// ```
|
|
24
|
+
// remotes: ['app1', 'http://example.com']
|
|
25
|
+
// ```
|
|
26
|
+
// This shouldn't happen for local dev, but we support it regardless.
|
|
27
|
+
let apps = (_b = (_a = options.apps) !== null && _a !== void 0 ? _a : mfeConfig.remotes) !== null && _b !== void 0 ? _b : [];
|
|
28
|
+
apps = apps.map((a) => (Array.isArray(a) ? a[0] : a));
|
|
29
|
+
for (const app of apps) {
|
|
30
|
+
iter = combineAsyncIterators(iter, yield tslib_1.__await((0, devkit_1.runExecutor)({
|
|
31
|
+
project: app,
|
|
32
|
+
target: 'serve',
|
|
33
|
+
configuration: context.configurationName,
|
|
34
|
+
}, {}, context)));
|
|
35
|
+
}
|
|
36
|
+
return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(iter))));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.default = mfeDevServer;
|
|
40
|
+
// TODO(jack): Extract this helper
|
|
41
|
+
function getNextAsyncIteratorFactory(options) {
|
|
42
|
+
return (asyncIterator, index) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const iterator = yield asyncIterator.next();
|
|
45
|
+
return { index, iterator };
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
if (options.errorCallback) {
|
|
49
|
+
options.errorCallback(err, index);
|
|
50
|
+
}
|
|
51
|
+
if (options.throwError !== false) {
|
|
52
|
+
return Promise.reject(err);
|
|
53
|
+
}
|
|
54
|
+
return { index, iterator: { done: true } };
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function combineAsyncIterators(...iterators) {
|
|
59
|
+
return tslib_1.__asyncGenerator(this, arguments, function* combineAsyncIterators_1() {
|
|
60
|
+
let [options] = iterators;
|
|
61
|
+
if (typeof options.next === 'function') {
|
|
62
|
+
options = Object.create(null);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
iterators.shift();
|
|
66
|
+
}
|
|
67
|
+
const getNextAsyncIteratorValue = getNextAsyncIteratorFactory(options);
|
|
68
|
+
try {
|
|
69
|
+
const asyncIteratorsValues = new Map(iterators.map((it, idx) => [idx, getNextAsyncIteratorValue(it, idx)]));
|
|
70
|
+
do {
|
|
71
|
+
const { iterator, index } = yield tslib_1.__await(Promise.race(asyncIteratorsValues.values()));
|
|
72
|
+
if (iterator.done) {
|
|
73
|
+
asyncIteratorsValues.delete(index);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
yield yield tslib_1.__await(iterator.value);
|
|
77
|
+
asyncIteratorsValues.set(index, getNextAsyncIteratorValue(iterators[index], index));
|
|
78
|
+
}
|
|
79
|
+
} while (asyncIteratorsValues.size > 0);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
yield tslib_1.__await(Promise.allSettled(iterators.map((it) => it.return())));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=mfe-dev-server.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mfe-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/react/src/executors/mfe-dev-server/mfe-dev-server.impl.ts"],"names":[],"mappings":";;;AAAA,yCAA4D;AAC5D,wFAE4D;AAC5D,+BAA4B;AAM5B,SAA+B,YAAY,CACzC,OAA4B,EAC5B,OAAwB;;;QAExB,IAAI,IAAI,GAAG,IAAA,yBAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAE1D,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAElE,IAAI,SAAc,CAAC;QACnB,IAAI;YACF,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;SACpC;QAAC,WAAM;YACN,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EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA,CAAC;SAC9D;IACH,CAAC;CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Web Dev Server",
|
|
3
|
+
"description": "Serve a web application.",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"buildTarget": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Target which builds the application."
|
|
10
|
+
},
|
|
11
|
+
"port": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"description": "Port to listen on.",
|
|
14
|
+
"default": 4200
|
|
15
|
+
},
|
|
16
|
+
"host": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Host to listen on.",
|
|
19
|
+
"default": "localhost"
|
|
20
|
+
},
|
|
21
|
+
"ssl": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Serve using `HTTPS`.",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"sslKey": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "SSL key to use for serving `HTTPS`."
|
|
29
|
+
},
|
|
30
|
+
"sslCert": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "SSL certificate to use for serving `HTTPS`."
|
|
33
|
+
},
|
|
34
|
+
"watch": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"description": "Watches for changes and rebuilds application.",
|
|
37
|
+
"default": true
|
|
38
|
+
},
|
|
39
|
+
"liveReload": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"description": "Whether to reload the page on change, using live-reload.",
|
|
42
|
+
"default": true
|
|
43
|
+
},
|
|
44
|
+
"hmr": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Enable hot module replacement.",
|
|
47
|
+
"default": false
|
|
48
|
+
},
|
|
49
|
+
"publicHost": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Public URL where the application will be served."
|
|
52
|
+
},
|
|
53
|
+
"open": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"description": "Open the application in the browser.",
|
|
56
|
+
"default": false
|
|
57
|
+
},
|
|
58
|
+
"allowedHosts": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "This option allows you to whitelist services that are allowed to access the dev server."
|
|
61
|
+
},
|
|
62
|
+
"memoryLimit": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"description": "Memory limit for type checking service process in `MB`."
|
|
65
|
+
},
|
|
66
|
+
"maxWorkers": {
|
|
67
|
+
"type": "number",
|
|
68
|
+
"description": "Number of workers to use for type checking."
|
|
69
|
+
},
|
|
70
|
+
"baseHref": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "Base url for the application being built."
|
|
73
|
+
},
|
|
74
|
+
"apps": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"description": "List of remote applications to serve in addition to the host application."
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -2,4 +2,4 @@ import { Schema } from './schema';
|
|
|
2
2
|
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
3
3
|
export declare function applicationGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default applicationGenerator;
|
|
5
|
-
export declare const applicationSchematic: (
|
|
5
|
+
export declare const applicationSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -4,7 +4,7 @@ exports.normalizeOptions = void 0;
|
|
|
4
4
|
const assertion_1 = require("../../../utils/assertion");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
6
|
function normalizeOptions(host, options) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f;
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8
8
|
const appDirectory = options.directory
|
|
9
9
|
? `${(0, devkit_1.names)(options.directory).fileName}/${(0, devkit_1.names)(options.name).fileName}`
|
|
10
10
|
: (0, devkit_1.names)(options.name).fileName;
|
|
@@ -30,7 +30,7 @@ function normalizeOptions(host, options) {
|
|
|
30
30
|
e2eProjectName,
|
|
31
31
|
parsedTags,
|
|
32
32
|
fileName,
|
|
33
|
-
styledModule, hasStyles: options.style !== 'none' });
|
|
33
|
+
styledModule, hasStyles: options.style !== 'none', devServerPort: (_g = options.devServerPort) !== null && _g !== void 0 ? _g : 4200 });
|
|
34
34
|
}
|
|
35
35
|
exports.normalizeOptions = normalizeOptions;
|
|
36
36
|
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AACA,wDAA4D;AAC5D,yCAA8E;AAE9E,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAe;;IAEf,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS;QACpC,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACxE,CAAC,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAEjC,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACvE,MAAM,cAAc,GAAG,GAAG,cAAc,MAAM,CAAC;IAE/C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,IAAA,sBAAa,EAAC,GAAG,OAAO,IAAI,YAAY,EAAE,CAAC,CAAC;IAEnE,MAAM,UAAU,GAAG,OAAO,C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AO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,KAAK,CAAC;IAC3C,OAAO,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,MAAM,mCAAI,IAAI,CAAC;IACxC,OAAO,CAAC,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,KAAK,CAAC;IACzD,OAAO,CAAC,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,MAAM,CAAC;IAC1D,OAAO,CAAC,aAAa,GAAG,MAAA,OAAO,CAAC,aAAa,mCAAI,SAAS,CAAC;IAC3D,OAAO,CAAC,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC;IAE/C,uCACK,OAAO,KACV,IAAI,EAAE,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAClC,WAAW,EAAE,cAAc,EAC3B,cAAc;QACd,cAAc;QACd,UAAU;QACV,QAAQ;QACR,YAAY,EACZ,SAAS,EAAE,OAAO,CAAC,KAAK,KAAK,MAAM,EACnC,aAAa,EAAE,MAAA,OAAO,CAAC,aAAa,mCAAI,IAAI,IAC5C;AACJ,CAAC;AA7CD,4CA6CC"}
|
|
@@ -2,4 +2,4 @@ import { Schema } from './schema';
|
|
|
2
2
|
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
3
3
|
export declare function componentGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default componentGenerator;
|
|
5
|
-
export declare const componentSchematic: (
|
|
5
|
+
export declare const componentSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -10,4 +10,4 @@ export declare function componentCypressGenerator(host: Tree, schema: CreateComp
|
|
|
10
10
|
export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
|
|
11
11
|
export declare function createComponentSpecFile(tree: Tree, { project, componentPath, js, cypressProject }: CreateComponentSpecFileSchema): void;
|
|
12
12
|
export default componentCypressGenerator;
|
|
13
|
-
export declare const componentCypressSchematic: (
|
|
13
|
+
export declare const componentCypressSchematic: (generatorOptions: CreateComponentSpecFileSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -8,4 +8,4 @@ export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
|
|
|
8
8
|
export declare function createComponentStoriesFile(host: Tree, { project, componentPath }: CreateComponentStoriesFileSchema): void;
|
|
9
9
|
export declare function componentStoryGenerator(host: Tree, schema: CreateComponentStoriesFileSchema): Promise<void>;
|
|
10
10
|
export default componentStoryGenerator;
|
|
11
|
-
export declare const componentStorySchematic: (
|
|
11
|
+
export declare const componentStorySchematic: (generatorOptions: CreateComponentStoriesFileSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -2,4 +2,4 @@ import { Tree } from '@nrwl/devkit';
|
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function hookGenerator(host: Tree, schema: Schema): Promise<void>;
|
|
4
4
|
export default hookGenerator;
|
|
5
|
-
export declare const hookSchematic: (
|
|
5
|
+
export declare const hookSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -2,4 +2,4 @@ import { InitSchema } from './schema';
|
|
|
2
2
|
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
3
3
|
export declare function reactInitGenerator(host: Tree, schema: InitSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export default reactInitGenerator;
|
|
5
|
-
export declare const reactInitSchematic: (
|
|
5
|
+
export declare const reactInitSchematic: (generatorOptions: InitSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -12,4 +12,4 @@ export interface NormalizedSchema extends Schema {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function libraryGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
14
14
|
export default libraryGenerator;
|
|
15
|
-
export declare const librarySchematic: (
|
|
15
|
+
export declare const librarySchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import NxWelcome from "./nx-welcome";
|
|
3
|
+
<% if (remotes.length > 0) { %>
|
|
4
|
+
import { Link, Route, Switch } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
<% remotes.forEach(function(r) { %>
|
|
7
|
+
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
|
|
8
|
+
<% }); %>
|
|
9
|
+
<% } %>
|
|
10
|
+
export function App() {
|
|
11
|
+
return (
|
|
12
|
+
<React.Suspense fallback={null}>
|
|
13
|
+
<ul>
|
|
14
|
+
<li><Link to="/">Home</Link></li>
|
|
15
|
+
<% remotes.forEach(function(r) { %>
|
|
16
|
+
<li><Link to="/<%=r.fileName%>"><%=r.className%></Link></li>
|
|
17
|
+
<% }); %>
|
|
18
|
+
</ul>
|
|
19
|
+
<Switch>
|
|
20
|
+
<Route exact path="/" render={() => <NxWelcome title="<%= projectName %>"/>} />
|
|
21
|
+
<% remotes.forEach(function(r) { %>
|
|
22
|
+
<Route path="/<%=r.fileName%>" render={() => <<%= r.className %>/>} />
|
|
23
|
+
<% }); %>
|
|
24
|
+
</Switch>
|
|
25
|
+
</React.Suspense>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default App;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import('./bootstrap');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./webpack.config');
|