@nx/react 23.0.0-beta.12 → 23.0.0-beta.13

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 (51) hide show
  1. package/package.json +16 -16
  2. package/plugins/component-testing/index.js +3 -3
  3. package/plugins/component-testing/webpack-fallback.js +2 -2
  4. package/plugins/storybook/index.js +3 -3
  5. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +2 -2
  6. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +2 -2
  7. package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +2 -2
  8. package/src/generators/application/application.d.ts.map +1 -1
  9. package/src/generators/application/application.js +29 -14
  10. package/src/generators/application/lib/add-linting.js +2 -2
  11. package/src/generators/application/lib/add-routing.js +2 -2
  12. package/src/generators/application/lib/create-application-files.js +2 -2
  13. package/src/generators/application/lib/normalize-options.js +2 -2
  14. package/src/generators/component/component.js +2 -2
  15. package/src/generators/component/lib/normalize-options.js +2 -2
  16. package/src/generators/component-story/component-story.d.ts.map +1 -1
  17. package/src/generators/component-story/component-story.js +3 -4
  18. package/src/generators/component-test/component-test.d.ts.map +1 -1
  19. package/src/generators/component-test/component-test.js +3 -4
  20. package/src/generators/cypress-component-configuration/lib/add-files.js +2 -2
  21. package/src/generators/federate-module/lib/utils.js +2 -2
  22. package/src/generators/hook/hook.d.ts.map +1 -1
  23. package/src/generators/hook/hook.js +3 -4
  24. package/src/generators/host/host.js +3 -3
  25. package/src/generators/host/lib/add-module-federation-files.d.ts.map +1 -1
  26. package/src/generators/host/lib/add-module-federation-files.js +3 -3
  27. package/src/generators/host/lib/update-module-federation-tsconfig.js +2 -2
  28. package/src/generators/library/lib/install-common-dependencies.js +2 -2
  29. package/src/generators/library/lib/normalize-options.js +4 -4
  30. package/src/generators/library/lib/update-app-routes.js +2 -2
  31. package/src/generators/library/library.d.ts.map +1 -1
  32. package/src/generators/library/library.js +8 -10
  33. package/src/generators/redux/redux.js +5 -6
  34. package/src/generators/remote/lib/setup-package-json-exports-for-remote.js +2 -2
  35. package/src/generators/remote/lib/update-host-with-remote.js +4 -5
  36. package/src/generators/remote/remote.d.ts.map +1 -1
  37. package/src/generators/remote/remote.js +5 -5
  38. package/src/generators/setup-ssr/setup-ssr.d.ts.map +1 -1
  39. package/src/generators/setup-ssr/setup-ssr.js +5 -7
  40. package/src/generators/stories/stories.js +5 -6
  41. package/src/module-federation/ast-utils.js +2 -2
  42. package/src/plugins/router-plugin.d.ts.map +1 -1
  43. package/src/plugins/router-plugin.js +3 -4
  44. package/src/rules/update-module-federation-project.js +3 -3
  45. package/src/utils/add-mf-env-to-inputs.d.ts.map +1 -1
  46. package/src/utils/add-mf-env-to-inputs.js +15 -8
  47. package/src/utils/ast-utils.js +15 -15
  48. package/src/utils/component-props.js +3 -3
  49. package/src/utils/create-ts-config.js +3 -3
  50. package/src/utils/ct-utils.js +2 -2
  51. package/tailwind.js +2 -2
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.installCommonDependencies = installCommonDependencies;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
5
+ const internal_1 = require("@nx/js/internal");
6
6
  const version_utils_1 = require("../../../utils/version-utils");
7
7
  const versions_1 = require("../../../utils/versions");
8
8
  async function installCommonDependencies(host, options) {
@@ -32,7 +32,7 @@ async function installCommonDependencies(host, options) {
32
32
  const baseInstallTask = (0, devkit_1.addDependenciesToPackageJson)(host, dependencies, devDependencies);
33
33
  tasks.push(baseInstallTask);
34
34
  if (options.compiler === 'swc') {
35
- tasks.push((0, add_swc_dependencies_1.addSwcDependencies)(host));
35
+ tasks.push((0, internal_1.addSwcDependencies)(host));
36
36
  }
37
37
  else if (options.compiler === 'babel') {
38
38
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, {}, {
@@ -4,9 +4,9 @@ exports.normalizeOptions = normalizeOptions;
4
4
  const internal_1 = require("@nx/devkit/internal");
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const assertion_1 = require("../../../utils/assertion");
7
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function normalizeOptions(host, options) {
9
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
9
+ const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
10
10
  await (0, internal_1.ensureRootProjectName)(options, 'library');
11
11
  const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
12
12
  name: options.name,
@@ -50,11 +50,11 @@ async function normalizeOptions(host, options) {
50
50
  normalized.inSourceTests === normalized.minimal || normalized.inSourceTests;
51
51
  if (options.appProject) {
52
52
  const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
53
- const appProjectType = (0, ts_solution_setup_1.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
53
+ const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
54
54
  if (appProjectType !== 'application') {
55
55
  throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
56
56
  }
57
- const appSourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(appProjectConfig, host);
57
+ const appSourceRoot = (0, internal_2.getProjectSourceRoot)(appProjectConfig, host);
58
58
  normalized.appMain =
59
59
  appProjectConfig.targets.build?.options?.main ??
60
60
  findMainEntry(host, appProjectConfig.root);
@@ -6,7 +6,7 @@ const ast_utils_1 = require("../../../utils/ast-utils");
6
6
  const ast_utils_2 = require("../../../utils/ast-utils");
7
7
  const maybe_js_1 = require("../../../utils/maybe-js");
8
8
  const versions_1 = require("../../../utils/versions");
9
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
9
+ const internal_1 = require("@nx/js/internal");
10
10
  let tsModule;
11
11
  function updateAppRoutes(host, options) {
12
12
  if (!options.appMain || !options.appSourceRoot) {
@@ -53,7 +53,7 @@ function readComponent(host, path) {
53
53
  throw new Error(`Cannot find ${path}`);
54
54
  }
55
55
  if (!tsModule) {
56
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
56
+ tsModule = (0, internal_1.ensureTypescript)();
57
57
  }
58
58
  const content = host.read(path, 'utf-8');
59
59
  const source = tsModule.createSourceFile(path, content, tsModule.ScriptTarget.Latest, true);
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA8BpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMhE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAyRxE;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA4BpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMhE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAyRxE;AAED,eAAe,gBAAgB,CAAC"}
@@ -7,9 +7,7 @@ const internal_1 = require("@nx/devkit/internal");
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  const js_1 = require("@nx/js");
9
9
  const path_1 = require("path");
10
- const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
11
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
12
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
10
+ const internal_2 = require("@nx/js/internal");
13
11
  const create_ts_config_1 = require("../../utils/create-ts-config");
14
12
  const jest_utils_1 = require("../../utils/jest-utils");
15
13
  const maybe_js_1 = require("../../utils/maybe-js");
@@ -33,7 +31,7 @@ async function libraryGenerator(host, schema) {
33
31
  }
34
32
  async function libraryGeneratorInternal(host, schema) {
35
33
  const tasks = [];
36
- const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
34
+ const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
37
35
  const jsInitTask = await (0, js_1.initGenerator)(host, {
38
36
  ...schema,
39
37
  addTsPlugin,
@@ -84,7 +82,7 @@ async function libraryGeneratorInternal(host, schema) {
84
82
  }
85
83
  (0, create_files_1.createFiles)(host, options);
86
84
  if (options.isUsingTsSolutionConfig) {
87
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
85
+ await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
88
86
  }
89
87
  const lintTask = await (0, add_linting_1.addLinting)(host, options);
90
88
  tasks.push(lintTask);
@@ -202,14 +200,14 @@ async function libraryGeneratorInternal(host, schema) {
202
200
  if (options.publishable) {
203
201
  const projectConfiguration = (0, devkit_1.readProjectConfiguration)(host, options.name);
204
202
  if (options.isUsingTsSolutionConfig) {
205
- await (0, add_release_config_1.addReleaseConfigForTsSolution)(host, options.name, projectConfiguration);
203
+ await (0, internal_2.addReleaseConfigForTsSolution)(host, options.name, projectConfiguration);
206
204
  }
207
205
  else {
208
206
  const nxJson = (0, devkit_1.readNxJson)(host);
209
- await (0, add_release_config_1.addReleaseConfigForNonTsSolution)(host, options.name, projectConfiguration);
207
+ await (0, internal_2.addReleaseConfigForNonTsSolution)(host, options.name, projectConfiguration);
210
208
  }
211
209
  (0, devkit_1.updateProjectConfiguration)(host, options.name, projectConfiguration);
212
- tasks.push(await (0, add_release_config_1.releaseTasks)(host));
210
+ tasks.push(await (0, internal_2.releaseTasks)(host));
213
211
  }
214
212
  if (!options.skipPackageJson) {
215
213
  const installReactTask = await (0, install_common_dependencies_1.installCommonDependencies)(host, options);
@@ -224,14 +222,14 @@ async function libraryGeneratorInternal(host, schema) {
224
222
  (0, maybe_js_1.maybeJs)(options, (0, devkit_1.joinPathFragments)(options.projectRoot, './src/index.ts')),
225
223
  ]);
226
224
  }
227
- (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
225
+ (0, internal_2.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
228
226
  jsx: 'react-jsx',
229
227
  module: 'esnext',
230
228
  moduleResolution: 'bundler',
231
229
  }, options.linter === 'eslint'
232
230
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
233
231
  : undefined);
234
- (0, sort_fields_1.sortPackageJsonFields)(host, options.projectRoot);
232
+ (0, internal_2.sortPackageJsonFields)(host, options.projectRoot);
235
233
  if (!options.skipFormat) {
236
234
  await (0, devkit_1.formatFiles)(host);
237
235
  }
@@ -5,8 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const js_1 = require("@nx/js");
8
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
9
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
8
+ const internal_2 = require("@nx/js/internal");
10
9
  const path = tslib_1.__importStar(require("path"));
11
10
  const ast_utils_1 = require("../../utils/ast-utils");
12
11
  const versions_1 = require("../../utils/versions");
@@ -35,7 +34,7 @@ function addReduxPackageDependencies(host) {
35
34
  }
36
35
  function addExportsToBarrel(host, options) {
37
36
  if (!tsModule) {
38
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
37
+ tsModule = (0, internal_2.ensureTypescript)();
39
38
  }
40
39
  const indexFilePath = (0, devkit_1.joinPathFragments)(options.projectSourcePath, options.fileExtensionType === 'js' ? 'index.js' : 'index.ts');
41
40
  if (!host.exists(indexFilePath)) {
@@ -62,7 +61,7 @@ function addStoreConfiguration(host, options) {
62
61
  }
63
62
  function updateReducerConfiguration(host, options) {
64
63
  if (!tsModule) {
65
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
64
+ tsModule = (0, internal_2.ensureTypescript)();
66
65
  }
67
66
  if (!options.appProjectSourcePath) {
68
67
  return;
@@ -95,7 +94,7 @@ async function normalizeOptions(host, options) {
95
94
  const tsPaths = tsConfigJson.compilerOptions
96
95
  ? tsConfigJson.compilerOptions.paths || {}
97
96
  : {};
98
- const modulePath = (0, ts_solution_setup_1.getProjectType)(host, root, projectType) === 'application'
97
+ const modulePath = (0, internal_2.getProjectType)(host, root, projectType) === 'application'
99
98
  ? options.path
100
99
  ? `./app/${options.path}/${extraNames.fileName}.slice`
101
100
  : `./app/${extraNames.fileName}.slice`
@@ -110,7 +109,7 @@ async function normalizeOptions(host, options) {
110
109
  if (appConfig.projectType !== 'application') {
111
110
  throw new Error(`Expected ${options.appProject} to be an application but got ${appConfig.projectType}`);
112
111
  }
113
- appProjectSourcePath = (0, ts_solution_setup_1.getProjectSourceRoot)(appConfig, host);
112
+ appProjectSourcePath = (0, internal_2.getProjectSourceRoot)(appConfig, host);
114
113
  appMainFilePath = path.join(appProjectSourcePath, options.js ? 'main.js' : 'main.tsx');
115
114
  if (!host.exists(appMainFilePath)) {
116
115
  throw new Error(`Could not find ${appMainFilePath} during store configuration`);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupPackageJsonExportsForRemote = setupPackageJsonExportsForRemote;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/js/internal");
6
6
  const maybe_js_1 = require("../../../utils/maybe-js");
7
7
  function setupPackageJsonExportsForRemote(tree, options) {
8
8
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
@@ -12,7 +12,7 @@ function setupPackageJsonExportsForRemote(tree, options) {
12
12
  `TypeScript solution setup requires package.json for all projects.`);
13
13
  }
14
14
  const exportPath = (0, maybe_js_1.maybeJs)(options, './src/remote-entry.ts');
15
- const customCondition = (0, ts_solution_setup_1.getDefinedCustomConditionName)(tree);
15
+ const customCondition = (0, internal_1.getDefinedCustomConditionName)(tree);
16
16
  (0, devkit_1.updateJson)(tree, packageJsonPath, (json) => {
17
17
  json.exports = {
18
18
  ...json.exports,
@@ -2,20 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateHostWithRemote = updateHostWithRemote;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
6
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/js/internal");
7
6
  const ast_utils_1 = require("../../../module-federation/ast-utils");
8
7
  let tsModule;
9
8
  function updateHostWithRemote(host, hostName, remoteName) {
10
9
  if (!tsModule) {
11
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
10
+ tsModule = (0, internal_1.ensureTypescript)();
12
11
  }
13
12
  const hostConfig = (0, devkit_1.readProjectConfiguration)(host, hostName);
14
13
  let moduleFederationConfigPath = (0, devkit_1.joinPathFragments)(hostConfig.root, 'module-federation.config.js');
15
14
  if (!host.exists(moduleFederationConfigPath)) {
16
15
  moduleFederationConfigPath = (0, devkit_1.joinPathFragments)(hostConfig.root, 'module-federation.config.ts');
17
16
  }
18
- const appComponentPath = findAppComponentPath(host, (0, ts_solution_setup_1.getProjectSourceRoot)(hostConfig, host));
17
+ const appComponentPath = findAppComponentPath(host, (0, internal_1.getProjectSourceRoot)(hostConfig, host));
19
18
  if (host.exists(moduleFederationConfigPath)) {
20
19
  // find the host project path
21
20
  // Update remotes inside ${host_path}/src/remotes.d.ts
@@ -36,7 +35,7 @@ function updateHostWithRemote(host, hostName, remoteName) {
36
35
  devkit_1.logger.warn(`Could not find app component at ${appComponentPath}. Did you generate this project with "@nx/react:host" or "@nx/react:consumer"?`);
37
36
  }
38
37
  // Add remote as devDependency in TS solution setup
39
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
38
+ if ((0, internal_1.isUsingTsSolutionSetup)(host)) {
40
39
  addRemoteAsHostDependency(host, hostName, remoteName);
41
40
  }
42
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/remote/remote.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAsBpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAmFlC;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAqK/D;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/remote/remote.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAmBpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,CAAC,MAAM,CAAC,QAmFlC;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAqK/D;AAED,eAAe,eAAe,CAAC"}
@@ -7,7 +7,7 @@ const internal_1 = require("@nx/devkit/internal");
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  const path_1 = require("path");
9
9
  const js_1 = require("@nx/js");
10
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
10
+ const internal_2 = require("@nx/js/internal");
11
11
  const update_module_federation_project_1 = require("../../rules/update-module-federation-project");
12
12
  const add_mf_env_to_inputs_1 = require("../../utils/add-mf-env-to-inputs");
13
13
  const normalize_remote_1 = require("../../utils/normalize-remote");
@@ -57,7 +57,7 @@ function addModuleFederationFiles(host, options) {
57
57
  host.delete(pathToWebpackProdConfig);
58
58
  }
59
59
  // Delete TypeScript prod config in TS solution setup - not needed in Crystal
60
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
60
+ if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
61
61
  const pathToTsProdConfig = (0, devkit_1.joinPathFragments)(options.appProjectRoot, options.bundler === 'rspack'
62
62
  ? 'rspack.config.prod.ts'
63
63
  : 'webpack.config.prod.ts');
@@ -105,7 +105,7 @@ async function remoteGenerator(host, schema) {
105
105
  });
106
106
  tasks.push(initAppTask);
107
107
  // In TS solution setup, update package.json to use simple name instead of scoped name
108
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
108
+ if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
109
109
  const remotePackageJsonPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json');
110
110
  if (host.exists(remotePackageJsonPath)) {
111
111
  (0, devkit_1.updateJson)(host, remotePackageJsonPath, (json) => {
@@ -124,7 +124,7 @@ async function remoteGenerator(host, schema) {
124
124
  addModuleFederationFiles(host, options);
125
125
  (0, update_module_federation_project_1.updateModuleFederationProject)(host, options);
126
126
  // Conditionally setup TS path or package.json exports based on TS solution setup
127
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
127
+ if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
128
128
  (0, setup_package_json_exports_for_remote_1.setupPackageJsonExportsForRemote)(host, options);
129
129
  }
130
130
  else {
@@ -160,7 +160,7 @@ async function remoteGenerator(host, schema) {
160
160
  }
161
161
  if (options.host && options.dynamic) {
162
162
  const hostConfig = (0, devkit_1.readProjectConfiguration)(host, schema.host);
163
- const pathToMFManifest = (0, devkit_1.joinPathFragments)((0, ts_solution_setup_1.getProjectSourceRoot)(hostConfig, host), 'assets/module-federation.manifest.json');
163
+ const pathToMFManifest = (0, devkit_1.joinPathFragments)((0, internal_2.getProjectSourceRoot)(hostConfig, host), 'assets/module-federation.manifest.json');
164
164
  (0, add_remote_to_dynamic_host_1.addRemoteToDynamicHost)(host, options.projectName, options.devServerPort, pathToMFManifest);
165
165
  }
166
166
  (0, add_mf_env_to_inputs_1.addMfEnvToTargetDefaultInputs)(host, options.bundler);
@@ -1 +1 @@
1
- {"version":3,"file":"setup-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/setup-ssr/setup-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,IAAI,EAGL,MAAM,YAAY,CAAC;AAcpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA2CvC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAkNlE;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"setup-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/setup-ssr/setup-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,IAAI,EAGL,MAAM,YAAY,CAAC;AAcpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA2CvC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAgNlE;AAED,eAAe,iBAAiB,CAAC"}
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupSsrGenerator = setupSsrGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
6
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/js/internal");
7
7
  const path_1 = require("path");
8
8
  const ast_utils_1 = require("../../utils/ast-utils");
9
9
  const versions_1 = require("../../utils/versions");
10
10
  let tsModule;
11
11
  function readEntryFile(host, path) {
12
12
  if (!tsModule) {
13
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
13
+ tsModule = (0, internal_2.ensureTypescript)();
14
14
  }
15
15
  const content = host.read(path, 'utf-8');
16
16
  return {
@@ -44,7 +44,7 @@ async function setupSsrGenerator(tree, options) {
44
44
  ].map((importPath) => {
45
45
  return {
46
46
  importPath,
47
- filePath: (0, devkit_1.joinPathFragments)((0, ts_solution_setup_1.getProjectSourceRoot)(projectConfig, tree), `${importPath}.tsx`),
47
+ filePath: (0, devkit_1.joinPathFragments)((0, internal_2.getProjectSourceRoot)(projectConfig, tree), `${importPath}.tsx`),
48
48
  };
49
49
  });
50
50
  const appComponentInfo = appImportCandidates.find((candidate) => tree.exists(candidate.filePath));
@@ -160,9 +160,6 @@ async function setupSsrGenerator(tree, options) {
160
160
  'server',
161
161
  ];
162
162
  }
163
- nxJson.targetDefaults ??= {};
164
- nxJson.targetDefaults['server'] ??= {};
165
- nxJson.targetDefaults.server.cache = true;
166
163
  (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), projectRoot, {
167
164
  tmpl: '',
168
165
  port: Number(options?.serverPort) || 4200,
@@ -183,6 +180,7 @@ async function setupSsrGenerator(tree, options) {
183
180
  const changes = (0, devkit_1.applyChangesToString)(content, (0, ast_utils_1.addStaticRouter)(serverEntry, source));
184
181
  tree.write(serverEntry, changes);
185
182
  }
183
+ (0, internal_1.upsertTargetDefault)(tree, nxJson, { target: 'server', cache: true });
186
184
  (0, devkit_1.updateNxJson)(tree, nxJson);
187
185
  const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
188
186
  express: versions_1.expressVersion,
@@ -6,8 +6,7 @@ exports.createAllStories = createAllStories;
6
6
  exports.storiesGenerator = storiesGenerator;
7
7
  const tslib_1 = require("tslib");
8
8
  const devkit_1 = require("@nx/devkit");
9
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
10
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
9
+ const internal_1 = require("@nx/js/internal");
11
10
  const minimatch_1 = require("minimatch");
12
11
  const path_1 = require("path");
13
12
  const ast_utils_1 = require("../../utils/ast-utils");
@@ -16,7 +15,7 @@ const component_story_1 = tslib_1.__importDefault(require("../component-story/co
16
15
  let tsModule;
17
16
  async function projectRootPath(tree, config) {
18
17
  let projectDir;
19
- if ((0, ts_solution_setup_1.getProjectType)(tree, config.root, config.projectType) === 'application') {
18
+ if ((0, internal_1.getProjectType)(tree, config.root, config.projectType) === 'application') {
20
19
  const isNextJs = await isNextJsProject(tree, config);
21
20
  if (isNextJs) {
22
21
  // Next.js apps
@@ -34,11 +33,11 @@ async function projectRootPath(tree, config) {
34
33
  else {
35
34
  projectDir = '.';
36
35
  }
37
- return (0, devkit_1.joinPathFragments)((0, ts_solution_setup_1.getProjectSourceRoot)(config, tree), projectDir);
36
+ return (0, devkit_1.joinPathFragments)((0, internal_1.getProjectSourceRoot)(config, tree), projectDir);
38
37
  }
39
38
  function containsComponentDeclaration(tree, componentPath) {
40
39
  if (!tsModule) {
41
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
40
+ tsModule = (0, internal_1.ensureTypescript)();
42
41
  }
43
42
  const contents = tree.read(componentPath, 'utf-8');
44
43
  if (contents === null) {
@@ -50,7 +49,7 @@ function containsComponentDeclaration(tree, componentPath) {
50
49
  }
51
50
  async function createAllStories(tree, schema, projectConfiguration) {
52
51
  const { isTheFileAStory } = await Promise.resolve().then(() => tslib_1.__importStar(require('@nx/storybook/src/utils/utilities')));
53
- const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(projectConfiguration, tree);
52
+ const sourceRoot = (0, internal_1.getProjectSourceRoot)(projectConfiguration, tree);
54
53
  let componentPaths = [];
55
54
  const projectPath = await projectRootPath(tree, projectConfiguration);
56
55
  (0, devkit_1.visitNotIgnoredFiles)(tree, projectPath, (path) => {
@@ -6,11 +6,11 @@ exports.addRemoteRoute = addRemoteRoute;
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const js_1 = require("@nx/js");
8
8
  const ast_utils_1 = require("../utils/ast-utils");
9
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
9
+ const internal_1 = require("@nx/js/internal");
10
10
  let tsModule;
11
11
  function addRemoteToConfig(source, app) {
12
12
  if (!tsModule) {
13
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
13
+ tsModule = (0, internal_1.ensureTypescript)();
14
14
  }
15
15
  const assignments = (0, js_1.findNodes)(source, tsModule.SyntaxKind.PropertyAssignment);
16
16
  const remotesAssignment = assignments.find((s) => s.name.getText() === 'remotes');
@@ -1 +1 @@
1
- {"version":3,"file":"router-plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/plugins/router-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,wBAAwB;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAUD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,wBAAwB,CA2FjE,CAAC"}
1
+ {"version":3,"file":"router-plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/plugins/router-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,wBAAwB;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAUD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,wBAAwB,CA2FjE,CAAC"}
@@ -8,8 +8,7 @@ const fs_1 = require("fs");
8
8
  const cache_directory_1 = require("nx/src/utils/cache-directory");
9
9
  const js_1 = require("@nx/js");
10
10
  const devkit_internals_1 = require("nx/src/devkit-internals");
11
- const util_1 = require("@nx/js/src/plugins/typescript/util");
12
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
11
+ const internal_2 = require("@nx/js/internal");
13
12
  const pmCommand = (0, devkit_1.getPackageManagerCommand)();
14
13
  const reactRouterConfigBlob = '**/react-router.config.{ts,js,cjs,cts,mjs,mts}';
15
14
  exports.createNodesV2 = [
@@ -19,7 +18,7 @@ exports.createNodesV2 = [
19
18
  const normalizedOptions = normalizeOptions(options);
20
19
  const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `react-router-${optionsHash}.hash`);
21
20
  const targetsCache = new internal_1.PluginCache(cachePath);
22
- const isUsingTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
21
+ const isUsingTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
23
22
  const { roots: projectRoots, configFiles: validConfigFiles } = configFiles.reduce((acc, configFile) => {
24
23
  const potentialRoot = (0, path_1.dirname)(configFile);
25
24
  if (checkIfConfigFileShouldBeProject(potentialRoot, context)) {
@@ -77,7 +76,7 @@ async function buildReactRouterTargets(configFilePath, projectRoot, options, con
77
76
  targets[options.startTargetName] = await startTarget(projectRoot, serverBuildPath, options.buildTargetName, isUsingTsSolutionSetup);
78
77
  }
79
78
  targets[options.typecheckTargetName] = await typecheckTarget(projectRoot, options.typecheckTargetName, namedInputs, siblingFiles, isUsingTsSolutionSetup);
80
- (0, util_1.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmCommand);
79
+ (0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmCommand);
81
80
  const metadata = {};
82
81
  return {
83
82
  targets,
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateModuleFederationProject = updateModuleFederationProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const maybe_js_1 = require("../utils/maybe-js");
6
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
6
+ const internal_1 = require("@nx/js/internal");
7
7
  function updateModuleFederationProject(host, options, isHost = false) {
8
8
  const projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
9
9
  projectConfig.targets ??= {};
@@ -14,7 +14,7 @@ function updateModuleFederationProject(host, options, isHost = false) {
14
14
  webpackConfig: `${options.appProjectRoot}/webpack.config.${options.typescriptConfiguration && !options.js ? 'ts' : 'js'}`,
15
15
  };
16
16
  projectConfig.targets.build.configurations ??= {};
17
- if (!(0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
17
+ if (!(0, internal_1.isUsingTsSolutionSetup)(host)) {
18
18
  projectConfig.targets.build.configurations.production = {
19
19
  ...(projectConfig.targets.build.configurations?.production ?? {}),
20
20
  webpackConfig: `${options.appProjectRoot}/webpack.config.prod.${options.typescriptConfiguration && !options.js ? 'ts' : 'js'}`,
@@ -62,7 +62,7 @@ function updateModuleFederationProject(host, options, isHost = false) {
62
62
  };
63
63
  }
64
64
  // Typechecks must be performed first before build and serve to generate remote d.ts files.
65
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
65
+ if ((0, internal_1.isUsingTsSolutionSetup)(host)) {
66
66
  projectConfig.targets.build ??= {};
67
67
  projectConfig.targets.serve ??= {};
68
68
  projectConfig.targets.build.dependsOn = ['^build', 'typecheck'];
@@ -1 +1 @@
1
- {"version":3,"file":"add-mf-env-to-inputs.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/add-mf-env-to-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAA4B,MAAM,YAAY,CAAC;AAEjE,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,QAAQ,GAAG,SAAS,QAwB9B"}
1
+ {"version":3,"file":"add-mf-env-to-inputs.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/add-mf-env-to-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAA4B,MAAM,YAAY,CAAC;AAMjE,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,QAAQ,GAAG,SAAS,QAkC9B"}
@@ -2,24 +2,31 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addMfEnvToTargetDefaultInputs = addMfEnvToTargetDefaultInputs;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  function addMfEnvToTargetDefaultInputs(tree, bundler) {
6
- const nxJson = (0, devkit_1.readNxJson)(tree);
7
+ const nxJson = (0, devkit_1.readNxJson)(tree) ?? {};
7
8
  const executor = bundler === 'rspack' ? '@nx/rspack:rspack' : '@nx/webpack:webpack';
8
9
  const mfEnvVar = 'NX_MF_DEV_REMOTES';
9
- nxJson.targetDefaults ??= {};
10
- nxJson.targetDefaults[executor] ??= {};
11
- nxJson.targetDefaults[executor].inputs ??= ['production', '^production'];
12
- nxJson.targetDefaults[executor].dependsOn ??= ['^build'];
10
+ const existing = (0, internal_1.normalizeTargetDefaults)(nxJson.targetDefaults).find((e) => e.executor === executor &&
11
+ e.target === undefined &&
12
+ e.projects === undefined &&
13
+ e.plugin === undefined);
14
+ const inputs = [...(existing?.inputs ?? ['production', '^production'])];
13
15
  let mfEnvVarExists = false;
14
- for (const input of nxJson.targetDefaults[executor].inputs) {
16
+ for (const input of inputs) {
15
17
  if (typeof input === 'object' && input['env'] === mfEnvVar) {
16
18
  mfEnvVarExists = true;
17
19
  break;
18
20
  }
19
21
  }
20
22
  if (!mfEnvVarExists) {
21
- nxJson.targetDefaults[executor].inputs.push({ env: mfEnvVar });
23
+ inputs.push({ env: mfEnvVar });
22
24
  }
23
- nxJson.targetDefaults[executor].cache = true;
25
+ (0, internal_1.upsertTargetDefault)(tree, nxJson, {
26
+ executor,
27
+ cache: true,
28
+ inputs,
29
+ dependsOn: existing?.dependsOn ?? ['^build'],
30
+ });
24
31
  (0, devkit_1.updateNxJson)(tree, nxJson);
25
32
  }
@@ -21,11 +21,11 @@ exports.getComponentNode = getComponentNode;
21
21
  exports.parseComponentPropsInfo = parseComponentPropsInfo;
22
22
  const js_1 = require("@nx/js");
23
23
  const devkit_1 = require("@nx/devkit");
24
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
24
+ const internal_1 = require("@nx/js/internal");
25
25
  let tsModule;
26
26
  function addImport(source, statement) {
27
27
  if (!tsModule) {
28
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
28
+ tsModule = (0, internal_1.ensureTypescript)();
29
29
  }
30
30
  const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
31
31
  if (allImports.length > 0) {
@@ -50,7 +50,7 @@ function addImport(source, statement) {
50
50
  }
51
51
  function findMainRenderStatement(source) {
52
52
  if (!tsModule) {
53
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
53
+ tsModule = (0, internal_1.ensureTypescript)();
54
54
  }
55
55
  // 1. Try to find ReactDOM.render.
56
56
  const calls = (0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression);
@@ -88,7 +88,7 @@ function findDefaultExport(source) {
88
88
  }
89
89
  function findDefaultExportDeclaration(source) {
90
90
  if (!tsModule) {
91
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
91
+ tsModule = (0, internal_1.ensureTypescript)();
92
92
  }
93
93
  const identifier = findDefaultExportIdentifier(source);
94
94
  if (identifier) {
@@ -107,7 +107,7 @@ function findDefaultExportDeclaration(source) {
107
107
  }
108
108
  function findExportDeclarationsForJsx(source) {
109
109
  if (!tsModule) {
110
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
110
+ tsModule = (0, internal_1.ensureTypescript)();
111
111
  }
112
112
  const variables = (0, js_1.findNodes)(source, tsModule.SyntaxKind.VariableDeclaration);
113
113
  const variableStatements = (0, js_1.findNodes)(source, tsModule.SyntaxKind.VariableStatement);
@@ -157,7 +157,7 @@ function findExportDeclarationsForJsx(source) {
157
157
  }
158
158
  function findDefaultExportIdentifier(source) {
159
159
  if (!tsModule) {
160
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
160
+ tsModule = (0, internal_1.ensureTypescript)();
161
161
  }
162
162
  const exports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ExportAssignment);
163
163
  const identifier = exports
@@ -167,7 +167,7 @@ function findDefaultExportIdentifier(source) {
167
167
  }
168
168
  function findDefaultClassOrFunction(source) {
169
169
  if (!tsModule) {
170
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
170
+ tsModule = (0, internal_1.ensureTypescript)();
171
171
  }
172
172
  const fns = (0, js_1.findNodes)(source, tsModule.SyntaxKind.FunctionDeclaration);
173
173
  const cls = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ClassDeclaration);
@@ -177,7 +177,7 @@ function findDefaultClassOrFunction(source) {
177
177
  }
178
178
  function hasDefaultExportModifier(x) {
179
179
  if (!tsModule) {
180
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
180
+ tsModule = (0, internal_1.ensureTypescript)();
181
181
  }
182
182
  return (x.modifiers &&
183
183
  x.modifiers.some((m) => m.kind === tsModule.SyntaxKind.ExportKeyword) &&
@@ -185,7 +185,7 @@ function hasDefaultExportModifier(x) {
185
185
  }
186
186
  function findComponentImportPath(componentName, source) {
187
187
  if (!tsModule) {
188
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
188
+ tsModule = (0, internal_1.ensureTypescript)();
189
189
  }
190
190
  const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
191
191
  const matching = allImports.filter((i) => {
@@ -201,7 +201,7 @@ function findComponentImportPath(componentName, source) {
201
201
  }
202
202
  function findElements(source, tagName) {
203
203
  if (!tsModule) {
204
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
204
+ tsModule = (0, internal_1.ensureTypescript)();
205
205
  }
206
206
  const nodes = (0, js_1.findNodes)(source, [
207
207
  tsModule.SyntaxKind.JsxSelfClosingElement,
@@ -222,7 +222,7 @@ function findClosestOpening(tagName, node) {
222
222
  }
223
223
  function isTag(tagName, node) {
224
224
  if (!tsModule) {
225
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
225
+ tsModule = (0, internal_1.ensureTypescript)();
226
226
  }
227
227
  if (tsModule.isJsxOpeningLikeElement(node)) {
228
228
  return (node.tagName.kind === tsModule.SyntaxKind.Identifier &&
@@ -236,7 +236,7 @@ function isTag(tagName, node) {
236
236
  }
237
237
  function addInitialRoutes(sourcePath, source, addBrowserRouter) {
238
238
  if (!tsModule) {
239
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
239
+ tsModule = (0, internal_1.ensureTypescript)();
240
240
  }
241
241
  const jsxClosingElements = (0, js_1.findNodes)(source, [
242
242
  tsModule.SyntaxKind.JsxClosingElement,
@@ -405,7 +405,7 @@ const store = configureStore({
405
405
  }
406
406
  function updateReduxStore(sourcePath, source, feature) {
407
407
  if (!tsModule) {
408
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
408
+ tsModule = (0, internal_1.ensureTypescript)();
409
409
  }
410
410
  const calls = (0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression);
411
411
  let reducerDescriptor;
@@ -459,7 +459,7 @@ function updateReduxStore(sourcePath, source, feature) {
459
459
  }
460
460
  function getComponentNode(sourceFile) {
461
461
  if (!tsModule) {
462
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
462
+ tsModule = (0, internal_1.ensureTypescript)();
463
463
  }
464
464
  const defaultExport = findDefaultExport(sourceFile);
465
465
  if (!(defaultExport &&
@@ -472,7 +472,7 @@ function getComponentNode(sourceFile) {
472
472
  }
473
473
  function parseComponentPropsInfo(sourceFile, cmpDeclaration) {
474
474
  if (!tsModule) {
475
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
475
+ tsModule = (0, internal_1.ensureTypescript)();
476
476
  }
477
477
  let propsTypeName = null;
478
478
  let inlineTypeString = null;