@nx/react 16.8.0-beta.4 → 16.8.0-beta.6

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.
Files changed (79) hide show
  1. package/babel.js +2 -3
  2. package/package.json +7 -7
  3. package/plugins/bundle-rollup.js +9 -3
  4. package/plugins/component-testing/index.d.ts +0 -1
  5. package/plugins/component-testing/index.js +57 -37
  6. package/plugins/jest.js +4 -6
  7. package/plugins/storybook/index.js +46 -17
  8. package/plugins/with-react.js +5 -9
  9. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +101 -103
  10. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +67 -72
  11. package/src/generators/application/application.js +124 -124
  12. package/src/generators/application/lib/add-e2e.js +41 -37
  13. package/src/generators/application/lib/add-jest.js +13 -8
  14. package/src/generators/application/lib/add-project.js +4 -3
  15. package/src/generators/application/lib/create-application-files.js +8 -1
  16. package/src/generators/application/lib/find-free-port.js +1 -2
  17. package/src/generators/application/lib/normalize-options.js +49 -47
  18. package/src/generators/application/lib/set-defaults.js +25 -5
  19. package/src/generators/component/component.js +68 -64
  20. package/src/generators/component-cypress-spec/component-cypress-spec.js +6 -9
  21. package/src/generators/component-story/component-story.js +8 -9
  22. package/src/generators/component-test/component-test.js +15 -18
  23. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +23 -26
  24. package/src/generators/cypress-component-configuration/lib/add-files.js +38 -42
  25. package/src/generators/hook/hook.js +59 -58
  26. package/src/generators/host/host.js +54 -53
  27. package/src/generators/host/lib/add-module-federation-files.js +11 -3
  28. package/src/generators/host/lib/normalize-remote.js +8 -11
  29. package/src/generators/host/lib/setup-ssr-for-host.js +21 -15
  30. package/src/generators/host/lib/update-module-federation-e2e-project.js +5 -2
  31. package/src/generators/init/init.js +30 -20
  32. package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +6 -6
  33. package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +7 -7
  34. package/src/generators/library/lib/add-linting.js +24 -27
  35. package/src/generators/library/lib/add-rollup-build-target.js +42 -46
  36. package/src/generators/library/lib/create-files.js +7 -1
  37. package/src/generators/library/lib/normalize-options.js +53 -50
  38. package/src/generators/library/lib/set-defaults.js +12 -4
  39. package/src/generators/library/library.js +122 -111
  40. package/src/generators/redux/redux.js +25 -16
  41. package/src/generators/remote/lib/setup-ssr-for-remote.js +25 -23
  42. package/src/generators/remote/remote.js +44 -39
  43. package/src/generators/setup-ssr/setup-ssr.js +134 -132
  44. package/src/generators/setup-tailwind/lib/update-project.js +3 -5
  45. package/src/generators/setup-tailwind/setup-tailwind.js +23 -26
  46. package/src/generators/stories/stories.js +79 -88
  47. package/src/generators/storybook-configuration/configuration.js +40 -47
  48. package/src/migrations/update-12-0-0/remove-react-redux-types-package.js +2 -5
  49. package/src/migrations/update-12-0-0/update-emotion-setup.js +50 -55
  50. package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js +14 -18
  51. package/src/migrations/update-12-8-0/update-12-8-0.js +3 -6
  52. package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js +23 -26
  53. package/src/migrations/update-13-0-0/update-emotion-setup.js +24 -27
  54. package/src/migrations/update-13-0-0/webpack5-changes-utils.js +30 -34
  55. package/src/migrations/update-13-10-0/update-13-10-0.js +15 -18
  56. package/src/migrations/update-14-0-0/add-default-development-configurations.js +26 -31
  57. package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js +12 -16
  58. package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js +13 -17
  59. package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js +24 -27
  60. package/src/migrations/update-14-6-0/add-preset-jest-config.js +1 -2
  61. package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js +3 -4
  62. package/src/migrations/update-15-3-0/update-rollup-executor.js +1 -2
  63. package/src/migrations/update-15-6-3/webpack-config-setup.js +53 -57
  64. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
  65. package/src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package.js +3 -6
  66. package/src/migrations/update-16-3-0/remove-types-react-router-dom-package.js +3 -6
  67. package/src/migrations/update-16-7-0/add-babel-core.js +8 -11
  68. package/src/migrations/update-16-7-0-add-typings/update-16-7-0-add-typings.js +36 -41
  69. package/src/module-federation/ast-utils.js +1 -1
  70. package/src/module-federation/load-config.js +1 -1
  71. package/src/module-federation/utils.js +36 -37
  72. package/src/module-federation/with-module-federation-ssr.js +24 -25
  73. package/src/module-federation/with-module-federation.js +23 -22
  74. package/src/rules/update-module-federation-project.js +10 -3
  75. package/src/utils/ast-utils.js +12 -15
  76. package/src/utils/create-ts-config.js +6 -4
  77. package/src/utils/ct-utils.js +31 -33
  78. package/src/utils/lint.js +5 -3
  79. package/src/utils/testing-generators.js +18 -23
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const dev_server_impl_1 = require("@nx/webpack/src/executors/dev-server/dev-server.impl");
6
5
  const path_1 = require("path");
@@ -14,7 +13,9 @@ const tsnode_register_1 = require("@nx/js/src/utils/typescript/tsnode-register")
14
13
  function getBuildOptions(buildTarget, context) {
15
14
  const target = (0, devkit_1.parseTargetString)(buildTarget, context.projectGraph);
16
15
  const buildOptions = (0, devkit_1.readTargetOptions)(target, context);
17
- return Object.assign({}, buildOptions);
16
+ return {
17
+ ...buildOptions,
18
+ };
18
19
  }
19
20
  function getModuleFederationConfig(tsconfigPath, workspaceRoot, projectRoot) {
20
21
  const moduleFederationConfigPathJS = (0, path_1.join)(workspaceRoot, projectRoot, 'module-federation.config.js');
@@ -28,113 +29,110 @@ function getModuleFederationConfig(tsconfigPath, workspaceRoot, projectRoot) {
28
29
  const config = require(moduleFederationConfigPath);
29
30
  return config.default || config;
30
31
  }
31
- catch (_a) {
32
+ catch {
32
33
  throw new Error(`Could not load ${moduleFederationConfigPath}. Was this project generated with "@nx/react:host"?\nSee: https://nx.dev/concepts/more-concepts/faster-builds-with-module-federation`);
33
34
  }
34
35
  }
35
- function moduleFederationDevServer(options, context) {
36
- var _a, _b;
37
- return tslib_1.__asyncGenerator(this, arguments, function* moduleFederationDevServer_1() {
38
- const nxBin = require.resolve('nx');
39
- const currIter = (0, dev_server_impl_1.default)(options, context);
40
- const p = context.projectsConfigurations.projects[context.projectName];
41
- const buildOptions = getBuildOptions(options.buildTarget, context);
42
- const moduleFederationConfig = getModuleFederationConfig(buildOptions.tsConfig, context.root, p.root);
43
- const remotesToSkip = new Set((_a = (0, find_matching_projects_1.findMatchingProjects)(options.skipRemotes, context.projectGraph.nodes)) !== null && _a !== void 0 ? _a : []);
44
- if (remotesToSkip.size > 0) {
45
- devkit_1.logger.info(`Remotes not served automatically: ${[...remotesToSkip.values()].join(', ')}`);
36
+ async function* moduleFederationDevServer(options, context) {
37
+ const nxBin = require.resolve('nx');
38
+ const currIter = (0, dev_server_impl_1.default)(options, context);
39
+ const p = context.projectsConfigurations.projects[context.projectName];
40
+ const buildOptions = getBuildOptions(options.buildTarget, context);
41
+ const moduleFederationConfig = getModuleFederationConfig(buildOptions.tsConfig, context.root, p.root);
42
+ const remotesToSkip = new Set((0, find_matching_projects_1.findMatchingProjects)(options.skipRemotes, context.projectGraph.nodes) ?? []);
43
+ if (remotesToSkip.size > 0) {
44
+ devkit_1.logger.info(`Remotes not served automatically: ${[...remotesToSkip.values()].join(', ')}`);
45
+ }
46
+ const remotesNotInWorkspace = [];
47
+ const knownRemotes = (moduleFederationConfig.remotes ?? []).filter((r) => {
48
+ const validRemote = Array.isArray(r) ? r[0] : r;
49
+ if (remotesToSkip.has(validRemote)) {
50
+ return false;
46
51
  }
47
- const remotesNotInWorkspace = [];
48
- const knownRemotes = ((_b = moduleFederationConfig.remotes) !== null && _b !== void 0 ? _b : []).filter((r) => {
49
- const validRemote = Array.isArray(r) ? r[0] : r;
50
- if (remotesToSkip.has(validRemote)) {
51
- return false;
52
- }
53
- else if (!context.projectGraph.nodes[validRemote]) {
54
- remotesNotInWorkspace.push(validRemote);
55
- return false;
56
- }
57
- else {
58
- return true;
59
- }
60
- });
61
- if (remotesNotInWorkspace.length > 0) {
62
- devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
52
+ else if (!context.projectGraph.nodes[validRemote]) {
53
+ remotesNotInWorkspace.push(validRemote);
54
+ return false;
63
55
  }
64
- const remotePorts = knownRemotes.map((r) => context.projectGraph.nodes[r].data.targets['serve'].options.port);
65
- const devServeApps = !options.devRemotes
66
- ? []
67
- : Array.isArray(options.devRemotes)
68
- ? (0, find_matching_projects_1.findMatchingProjects)(options.devRemotes, context.projectGraph.nodes)
69
- : (0, find_matching_projects_1.findMatchingProjects)([options.devRemotes], context.projectGraph.nodes);
70
- devkit_1.logger.info(`NX Starting module federation dev-server for ${chalk.bold(context.projectName)} with ${knownRemotes.length} remotes`);
71
- const devRemoteIters = [];
72
- let isCollectingStaticRemoteOutput = true;
73
- for (const app of knownRemotes) {
74
- const appName = Array.isArray(app) ? app[0] : app;
75
- if (devServeApps.includes(appName)) {
76
- devRemoteIters.push(yield tslib_1.__await((0, devkit_1.runExecutor)({
77
- project: appName,
78
- target: 'serve',
79
- configuration: context.configurationName,
80
- }, {
81
- watch: true,
82
- }, context)));
83
- }
84
- else {
85
- let outWithErr = [];
86
- const staticProcess = (0, child_process_1.fork)(nxBin, [
87
- 'run',
88
- `${appName}:serve-static${context.configurationName ? `:${context.configurationName}` : ''}`,
89
- ], {
90
- cwd: context.root,
91
- stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
92
- });
93
- staticProcess.stdout.on('data', (data) => {
94
- if (isCollectingStaticRemoteOutput) {
95
- outWithErr.push(data.toString());
96
- }
97
- else {
98
- outWithErr = null;
99
- staticProcess.stdout.removeAllListeners('data');
100
- }
101
- });
102
- staticProcess.stderr.on('data', (data) => devkit_1.logger.info(data.toString()));
103
- staticProcess.on('exit', (code) => {
104
- if (code !== 0) {
105
- devkit_1.logger.info(outWithErr.join(''));
106
- throw new Error(`Remote failed to start. See above for errors.`);
107
- }
108
- });
109
- process.on('SIGTERM', () => staticProcess.kill('SIGTERM'));
110
- process.on('exit', () => staticProcess.kill('SIGTERM'));
111
- }
56
+ else {
57
+ return true;
112
58
  }
113
- return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, async_iterable_1.combineAsyncIterables)(currIter, ...devRemoteIters, (0, async_iterable_1.createAsyncIterable)(({ next, done }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
114
- if (remotePorts.length === 0) {
115
- done();
116
- return;
117
- }
118
- try {
119
- yield Promise.all(remotePorts.map((port) =>
120
- // Allow 20 minutes for each remote to start, which is plenty of time but we can tweak it later if needed.
121
- // Most remotes should start in under 1 minute.
122
- (0, wait_for_port_open_1.waitForPortOpen)(port, {
123
- retries: 480,
124
- retryDelay: 2500,
125
- host: 'localhost',
126
- })));
127
- isCollectingStaticRemoteOutput = false;
128
- devkit_1.logger.info(`NX All remotes started, server ready at http://localhost:${options.port}`);
129
- next({ success: true, baseUrl: `http://localhost:${options.port}` });
130
- }
131
- catch (_c) {
132
- throw new Error(`Timed out waiting for remote to start. Check above for any errors.`);
133
- }
134
- finally {
135
- done();
136
- }
137
- })))))));
138
59
  });
60
+ if (remotesNotInWorkspace.length > 0) {
61
+ devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
62
+ }
63
+ const remotePorts = knownRemotes.map((r) => context.projectGraph.nodes[r].data.targets['serve'].options.port);
64
+ const devServeApps = !options.devRemotes
65
+ ? []
66
+ : Array.isArray(options.devRemotes)
67
+ ? (0, find_matching_projects_1.findMatchingProjects)(options.devRemotes, context.projectGraph.nodes)
68
+ : (0, find_matching_projects_1.findMatchingProjects)([options.devRemotes], context.projectGraph.nodes);
69
+ devkit_1.logger.info(`NX Starting module federation dev-server for ${chalk.bold(context.projectName)} with ${knownRemotes.length} remotes`);
70
+ const devRemoteIters = [];
71
+ let isCollectingStaticRemoteOutput = true;
72
+ for (const app of knownRemotes) {
73
+ const appName = Array.isArray(app) ? app[0] : app;
74
+ if (devServeApps.includes(appName)) {
75
+ devRemoteIters.push(await (0, devkit_1.runExecutor)({
76
+ project: appName,
77
+ target: 'serve',
78
+ configuration: context.configurationName,
79
+ }, {
80
+ watch: true,
81
+ }, context));
82
+ }
83
+ else {
84
+ let outWithErr = [];
85
+ const staticProcess = (0, child_process_1.fork)(nxBin, [
86
+ 'run',
87
+ `${appName}:serve-static${context.configurationName ? `:${context.configurationName}` : ''}`,
88
+ ], {
89
+ cwd: context.root,
90
+ stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
91
+ });
92
+ staticProcess.stdout.on('data', (data) => {
93
+ if (isCollectingStaticRemoteOutput) {
94
+ outWithErr.push(data.toString());
95
+ }
96
+ else {
97
+ outWithErr = null;
98
+ staticProcess.stdout.removeAllListeners('data');
99
+ }
100
+ });
101
+ staticProcess.stderr.on('data', (data) => devkit_1.logger.info(data.toString()));
102
+ staticProcess.on('exit', (code) => {
103
+ if (code !== 0) {
104
+ devkit_1.logger.info(outWithErr.join(''));
105
+ throw new Error(`Remote failed to start. See above for errors.`);
106
+ }
107
+ });
108
+ process.on('SIGTERM', () => staticProcess.kill('SIGTERM'));
109
+ process.on('exit', () => staticProcess.kill('SIGTERM'));
110
+ }
111
+ }
112
+ return yield* (0, async_iterable_1.combineAsyncIterables)(currIter, ...devRemoteIters, (0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
113
+ if (remotePorts.length === 0) {
114
+ done();
115
+ return;
116
+ }
117
+ try {
118
+ await Promise.all(remotePorts.map((port) =>
119
+ // Allow 20 minutes for each remote to start, which is plenty of time but we can tweak it later if needed.
120
+ // Most remotes should start in under 1 minute.
121
+ (0, wait_for_port_open_1.waitForPortOpen)(port, {
122
+ retries: 480,
123
+ retryDelay: 2500,
124
+ host: 'localhost',
125
+ })));
126
+ isCollectingStaticRemoteOutput = false;
127
+ devkit_1.logger.info(`NX All remotes started, server ready at http://localhost:${options.port}`);
128
+ next({ success: true, baseUrl: `http://localhost:${options.port}` });
129
+ }
130
+ catch {
131
+ throw new Error(`Timed out waiting for remote to start. Check above for any errors.`);
132
+ }
133
+ finally {
134
+ done();
135
+ }
136
+ }));
139
137
  }
140
138
  exports.default = moduleFederationDevServer;
@@ -1,87 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
3
  const devkit_1 = require("@nx/devkit");
5
4
  const ssr_dev_server_impl_1 = require("@nx/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl");
6
5
  const path_1 = require("path");
7
6
  const chalk = require("chalk");
8
7
  const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
9
8
  const child_process_1 = require("child_process");
10
- function moduleFederationSsrDevServer(options, context) {
11
- var _a, _b;
12
- return tslib_1.__asyncGenerator(this, arguments, function* moduleFederationSsrDevServer_1() {
13
- let iter = (0, ssr_dev_server_impl_1.default)(options, context);
14
- const p = context.projectsConfigurations.projects[context.projectName];
15
- const moduleFederationConfigPath = (0, path_1.join)(context.root, p.root, 'module-federation.config.js');
16
- let moduleFederationConfig;
17
- try {
18
- moduleFederationConfig = require(moduleFederationConfigPath);
9
+ async function* moduleFederationSsrDevServer(options, context) {
10
+ let iter = (0, ssr_dev_server_impl_1.default)(options, context);
11
+ const p = context.projectsConfigurations.projects[context.projectName];
12
+ const moduleFederationConfigPath = (0, path_1.join)(context.root, p.root, 'module-federation.config.js');
13
+ let moduleFederationConfig;
14
+ try {
15
+ moduleFederationConfig = require(moduleFederationConfigPath);
16
+ }
17
+ catch {
18
+ // TODO(jack): Add a link to guide
19
+ throw new Error(`Could not load ${moduleFederationConfigPath}. Was this project generated with "@nx/react:host"?`);
20
+ }
21
+ const remotesToSkip = new Set(options.skipRemotes ?? []);
22
+ const remotesNotInWorkspace = [];
23
+ const knownRemotes = (moduleFederationConfig.remotes ?? []).filter((r) => {
24
+ const validRemote = Array.isArray(r) ? r[0] : r;
25
+ if (remotesToSkip.has(validRemote)) {
26
+ return false;
19
27
  }
20
- catch (_c) {
21
- // TODO(jack): Add a link to guide
22
- throw new Error(`Could not load ${moduleFederationConfigPath}. Was this project generated with "@nx/react:host"?`);
28
+ else if (!context.projectGraph.nodes[validRemote]) {
29
+ remotesNotInWorkspace.push(validRemote);
30
+ return false;
23
31
  }
24
- const remotesToSkip = new Set((_a = options.skipRemotes) !== null && _a !== void 0 ? _a : []);
25
- const remotesNotInWorkspace = [];
26
- const knownRemotes = ((_b = moduleFederationConfig.remotes) !== null && _b !== void 0 ? _b : []).filter((r) => {
27
- const validRemote = Array.isArray(r) ? r[0] : r;
28
- if (remotesToSkip.has(validRemote)) {
29
- return false;
30
- }
31
- else if (!context.projectGraph.nodes[validRemote]) {
32
- remotesNotInWorkspace.push(validRemote);
33
- return false;
34
- }
35
- else {
36
- return true;
37
- }
38
- });
39
- if (remotesNotInWorkspace.length > 0) {
40
- devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
32
+ else {
33
+ return true;
41
34
  }
42
- const devServeApps = !options.devRemotes
43
- ? []
44
- : Array.isArray(options.devRemotes)
45
- ? options.devRemotes
46
- : [options.devRemotes];
47
- for (const app of knownRemotes) {
48
- const [appName] = Array.isArray(app) ? app : [app];
49
- const isDev = devServeApps.includes(appName);
50
- const remoteServeIter = isDev
51
- ? yield tslib_1.__await((0, devkit_1.runExecutor)({
52
- project: appName,
53
- target: 'serve',
54
- configuration: context.configurationName,
55
- }, {
56
- watch: isDev,
57
- }, context))
58
- : (0, async_iterable_1.mapAsyncIterable)((0, async_iterable_1.createAsyncIterable)(({ next, done }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
59
- const remoteProject = context.projectsConfigurations.projects[appName];
60
- const remoteServerOutput = (0, path_1.join)(devkit_1.workspaceRoot, remoteProject.targets.server.options.outputPath, 'main.js');
61
- const pm = (0, devkit_1.getPackageManagerCommand)();
62
- (0, child_process_1.execSync)(`${pm.exec} nx run ${appName}:server${context.configurationName ? `:${context.configurationName}` : ''}`, { stdio: 'inherit' });
63
- const child = (0, child_process_1.fork)(remoteServerOutput, {
64
- env: {
65
- PORT: remoteProject.targets['serve-browser'].options.port,
66
- },
67
- });
68
- child.on('message', (msg) => {
69
- if (msg === 'nx.server.ready') {
70
- next(true);
71
- done();
72
- }
73
- });
74
- })), (x) => x);
75
- iter = (0, async_iterable_1.combineAsyncIterables)(iter, remoteServeIter);
35
+ });
36
+ if (remotesNotInWorkspace.length > 0) {
37
+ devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
38
+ }
39
+ const devServeApps = !options.devRemotes
40
+ ? []
41
+ : Array.isArray(options.devRemotes)
42
+ ? options.devRemotes
43
+ : [options.devRemotes];
44
+ for (const app of knownRemotes) {
45
+ const [appName] = Array.isArray(app) ? app : [app];
46
+ const isDev = devServeApps.includes(appName);
47
+ const remoteServeIter = isDev
48
+ ? await (0, devkit_1.runExecutor)({
49
+ project: appName,
50
+ target: 'serve',
51
+ configuration: context.configurationName,
52
+ }, {
53
+ watch: isDev,
54
+ }, context)
55
+ : (0, async_iterable_1.mapAsyncIterable)((0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
56
+ const remoteProject = context.projectsConfigurations.projects[appName];
57
+ const remoteServerOutput = (0, path_1.join)(devkit_1.workspaceRoot, remoteProject.targets.server.options.outputPath, 'main.js');
58
+ const pm = (0, devkit_1.getPackageManagerCommand)();
59
+ (0, child_process_1.execSync)(`${pm.exec} nx run ${appName}:server${context.configurationName ? `:${context.configurationName}` : ''}`, { stdio: 'inherit' });
60
+ const child = (0, child_process_1.fork)(remoteServerOutput, {
61
+ env: {
62
+ PORT: remoteProject.targets['serve-browser'].options.port,
63
+ },
64
+ });
65
+ child.on('message', (msg) => {
66
+ if (msg === 'nx.server.ready') {
67
+ next(true);
68
+ done();
69
+ }
70
+ });
71
+ }), (x) => x);
72
+ iter = (0, async_iterable_1.combineAsyncIterables)(iter, remoteServeIter);
73
+ }
74
+ let numAwaiting = knownRemotes.length + 1; // remotes + host
75
+ return yield* (0, async_iterable_1.tapAsyncIterable)(iter, (x) => {
76
+ numAwaiting--;
77
+ if (numAwaiting === 0) {
78
+ devkit_1.logger.info(`[ ${chalk.green('ready')} ] http://${options.host ?? 'localhost'}:${options.port ?? 4200}`);
76
79
  }
77
- let numAwaiting = knownRemotes.length + 1; // remotes + host
78
- return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, async_iterable_1.tapAsyncIterable)(iter, (x) => {
79
- var _a, _b;
80
- numAwaiting--;
81
- if (numAwaiting === 0) {
82
- devkit_1.logger.info(`[ ${chalk.green('ready')} ] http://${(_a = options.host) !== null && _a !== void 0 ? _a : 'localhost'}:${(_b = options.port) !== null && _b !== void 0 ? _b : 4200}`);
83
- }
84
- })))));
85
80
  });
86
81
  }
87
82
  exports.default = moduleFederationSsrDevServer;