@nx/react 21.0.0-beta.1 → 21.0.0-beta.11

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 (114) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -2
  3. package/migrations.json +6 -38
  4. package/package.json +6 -6
  5. package/plugins/component-testing/index.js +1 -1
  6. package/plugins/nx-react-webpack-plugin/lib/apply-react-config.js +3 -21
  7. package/plugins/with-react.d.ts +4 -0
  8. package/router-plugin.d.ts +1 -0
  9. package/router-plugin.js +5 -0
  10. package/src/executors/module-federation-dev-server/schema.json +1 -0
  11. package/src/executors/module-federation-ssr-dev-server/schema.json +1 -0
  12. package/src/executors/module-federation-static-server/schema.json +1 -0
  13. package/src/generators/application/application.js +52 -15
  14. package/src/generators/application/files/react-router-ssr/common/app/app-nav.tsx__tmpl__ +14 -0
  15. package/src/generators/application/files/react-router-ssr/common/app/entry.client.tsx__tmpl__ +18 -0
  16. package/src/generators/application/files/react-router-ssr/common/app/entry.server.tsx__tmpl__ +74 -0
  17. package/src/generators/application/files/react-router-ssr/common/app/root.tsx__tmpl__ +51 -0
  18. package/src/generators/application/files/react-router-ssr/common/app/routes/about.tsx__tmpl__ +7 -0
  19. package/src/generators/application/files/react-router-ssr/common/app/routes.tsx__tmpl__ +6 -0
  20. package/src/generators/application/files/react-router-ssr/common/public/favicon.ico +0 -0
  21. package/src/generators/application/files/react-router-ssr/common/react-router.config.ts__tmpl__ +5 -0
  22. package/src/generators/application/files/react-router-ssr/common/tests/routes/_index.spec.tsx__tmpl__ +16 -0
  23. package/src/generators/application/files/react-router-ssr/common/tsconfig.app.json__tmpl__ +23 -0
  24. package/src/generators/application/files/react-router-ssr/common/tsconfig.json__tmpl__ +27 -0
  25. package/src/generators/application/files/react-router-ssr/non-root/.gitignore__tmpl__ +5 -0
  26. package/src/generators/application/files/react-router-ssr/non-root/package.json__tmpl__ +24 -0
  27. package/src/generators/application/files/react-router-ssr/nx-welcome/claimed/app/nx-welcome.tsx__tmpl__ +866 -0
  28. package/src/generators/application/files/react-router-ssr/nx-welcome/not-configured/app/nx-welcome.tsx__tmpl__ +866 -0
  29. package/src/generators/application/files/react-router-ssr/nx-welcome/unclaimed/app/nx-welcome.tsx__tmpl__ +864 -0
  30. package/src/generators/application/files/react-router-ssr/ts-solution/package.json__tmpl__ +24 -0
  31. package/src/generators/application/files/react-router-ssr/ts-solution/tsconfig.app.json__tmpl__ +39 -0
  32. package/src/generators/application/lib/add-e2e.js +38 -71
  33. package/src/generators/application/lib/add-jest.js +26 -2
  34. package/src/generators/application/lib/add-linting.d.ts +1 -0
  35. package/src/generators/application/lib/add-linting.js +39 -1
  36. package/src/generators/application/lib/add-project.js +31 -15
  37. package/src/generators/application/lib/add-routing.js +1 -1
  38. package/src/generators/application/lib/bundlers/add-rspack.d.ts +0 -1
  39. package/src/generators/application/lib/bundlers/add-rspack.js +0 -18
  40. package/src/generators/application/lib/bundlers/add-vite.js +15 -6
  41. package/src/generators/application/lib/create-application-files.d.ts +61 -0
  42. package/src/generators/application/lib/create-application-files.js +81 -39
  43. package/src/generators/application/lib/get-app-tests.js +3 -3
  44. package/src/generators/application/lib/install-common-dependencies.js +13 -2
  45. package/src/generators/application/lib/normalize-options.d.ts +0 -2
  46. package/src/generators/application/lib/normalize-options.js +14 -20
  47. package/src/generators/application/schema.d.ts +5 -1
  48. package/src/generators/application/schema.json +10 -1
  49. package/src/generators/component-test/component-test.js +1 -1
  50. package/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -1
  51. package/src/generators/cypress-component-configuration/lib/add-files.js +7 -4
  52. package/src/generators/host/files/rspack-module-federation/rspack.config.js__tmpl__ +37 -13
  53. package/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +60 -32
  54. package/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +6 -0
  55. package/src/generators/host/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +66 -0
  56. package/src/generators/host/files/rspack-module-federation-ssr/server.ts__tmpl__ +1 -1
  57. package/src/generators/host/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +49 -0
  58. package/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +6 -0
  59. package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +66 -0
  60. package/src/generators/host/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +1 -1
  61. package/src/generators/host/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +49 -0
  62. package/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +37 -9
  63. package/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +37 -14
  64. package/src/generators/host/host.js +21 -18
  65. package/src/generators/host/lib/add-module-federation-files.js +28 -12
  66. package/src/generators/host/lib/normalize-host-name.d.ts +2 -0
  67. package/src/generators/host/lib/normalize-host-name.js +12 -0
  68. package/src/generators/host/lib/setup-ssr-for-host.d.ts +3 -3
  69. package/src/generators/host/lib/setup-ssr-for-host.js +46 -22
  70. package/src/generators/init/init.js +23 -0
  71. package/src/generators/init/schema.d.ts +2 -0
  72. package/src/generators/library/lib/add-linting.js +1 -1
  73. package/src/generators/library/lib/add-rollup-build-target.d.ts +3 -1
  74. package/src/generators/library/lib/add-rollup-build-target.js +6 -7
  75. package/src/generators/library/lib/create-files.js +2 -1
  76. package/src/generators/library/lib/normalize-options.js +8 -5
  77. package/src/generators/library/library.js +44 -30
  78. package/src/generators/library/schema.d.ts +2 -0
  79. package/src/generators/library/schema.json +8 -4
  80. package/src/generators/remote/files/rspack-module-federation/rspack.config.js__tmpl__ +40 -13
  81. package/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +6 -0
  82. package/src/generators/remote/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +69 -0
  83. package/src/generators/remote/files/rspack-module-federation-ssr/server.ts__tmpl__ +2 -2
  84. package/src/generators/remote/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +45 -0
  85. package/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +6 -0
  86. package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +69 -0
  87. package/src/generators/remote/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +2 -2
  88. package/src/generators/remote/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +45 -0
  89. package/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +40 -13
  90. package/src/generators/remote/lib/setup-ssr-for-remote.d.ts +1 -1
  91. package/src/generators/remote/lib/setup-ssr-for-remote.js +37 -15
  92. package/src/generators/remote/remote.js +46 -30
  93. package/src/migrations/update-21-0-0/update-babel-loose.d.ts +2 -0
  94. package/src/migrations/update-21-0-0/update-babel-loose.js +30 -0
  95. package/src/plugins/router-plugin.d.ts +10 -0
  96. package/src/plugins/router-plugin.js +221 -0
  97. package/src/rules/update-module-federation-project.d.ts +2 -1
  98. package/src/rules/update-module-federation-project.js +28 -47
  99. package/src/utils/assertion.d.ts +2 -0
  100. package/src/utils/assertion.js +6 -0
  101. package/src/utils/ast-utils.d.ts +1 -1
  102. package/src/utils/ast-utils.js +2 -2
  103. package/src/utils/ct-utils.d.ts +1 -1
  104. package/src/utils/testing-generators.js +1 -2
  105. package/src/utils/versions.d.ts +6 -4
  106. package/src/utils/versions.js +9 -6
  107. package/src/generators/host/files/rspack-module-federation-ssr/rspack.server.config.js__tmpl__ +0 -16
  108. package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.server.config.ts__tmpl__ +0 -16
  109. package/src/generators/remote/files/rspack-module-federation-ssr/rspack.server.config.js__tmpl__ +0 -16
  110. package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.server.config.ts__tmpl__ +0 -16
  111. package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -2
  112. package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
  113. package/src/utils/format-file.d.ts +0 -1
  114. package/src/utils/format-file.js +0 -11
@@ -4,11 +4,10 @@ exports.createApp = createApp;
4
4
  exports.createLib = createLib;
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const application_1 = require("../generators/application/application");
7
- const eslint_1 = require("@nx/eslint");
8
7
  async function createApp(tree, appName) {
9
8
  await (0, application_1.default)(tree, {
10
9
  e2eTestRunner: 'none',
11
- linter: eslint_1.Linter.EsLint,
10
+ linter: 'eslint',
12
11
  skipFormat: true,
13
12
  style: 'css',
14
13
  unitTestRunner: 'none',
@@ -14,7 +14,7 @@ export declare const typesReactDomVersion = "19.0.0";
14
14
  export declare const typesReactIsV18Version = "18.3.0";
15
15
  export declare const typesReactIsVersion = "19.0.0";
16
16
  export declare const reactViteVersion = "^4.2.0";
17
- export declare const typesNodeVersion = "18.16.9";
17
+ export declare const typesNodeVersion = "^20.0.0";
18
18
  export declare const babelPresetReactVersion = "^7.14.5";
19
19
  export declare const babelCoreVersion = "^7.14.5";
20
20
  export declare const styledComponentsVersion = "5.3.6";
@@ -23,7 +23,9 @@ export declare const emotionStyledVersion = "11.11.0";
23
23
  export declare const emotionReactVersion = "11.11.1";
24
24
  export declare const emotionBabelPlugin = "11.11.0";
25
25
  export declare const styledJsxVersion = "5.1.2";
26
- export declare const reactRouterDomVersion = "6.11.2";
26
+ export declare const reactRouterDomVersion = "6.29.0";
27
+ export declare const reactRouterVersion = "^7.2.0";
28
+ export declare const reactRouterIsBotVersion = "^4.4.0";
27
29
  export declare const testingLibraryReactVersion = "16.1.0";
28
30
  export declare const testingLibraryDomVersion = "10.4.0";
29
31
  export declare const reduxjsToolkitVersion = "1.9.3";
@@ -42,8 +44,8 @@ export declare const typesExpressVersion = "^4.17.21";
42
44
  export declare const isbotVersion = "^3.6.5";
43
45
  export declare const corsVersion = "~2.8.5";
44
46
  export declare const typesCorsVersion = "~2.8.12";
45
- export declare const moduleFederationNodeVersion = "^2.6.21";
46
- export declare const moduleFederationEnhancedVersion = "^0.8.8";
47
+ export declare const moduleFederationNodeVersion = "^2.6.26";
48
+ export declare const moduleFederationEnhancedVersion = "^0.9.0";
47
49
  export declare const lessVersion = "3.12.2";
48
50
  export declare const sassVersion = "^1.55.0";
49
51
  export declare const rollupPluginUrlVersion = "^8.0.2";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.svgrRollupVersion = exports.rollupPluginUrlVersion = exports.sassVersion = exports.lessVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.tailwindcssVersion = exports.postcssVersion = exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryDomVersion = exports.testingLibraryReactVersion = exports.reactRouterDomVersion = exports.styledJsxVersion = exports.emotionBabelPlugin = exports.emotionReactVersion = exports.emotionStyledVersion = exports.typesStyledComponentsVersion = exports.styledComponentsVersion = exports.babelCoreVersion = exports.babelPresetReactVersion = exports.typesNodeVersion = exports.reactViteVersion = exports.typesReactIsVersion = exports.typesReactIsV18Version = exports.typesReactDomVersion = exports.typesReactDomV18Version = exports.typesReactVersion = exports.typesReactV18Version = exports.babelLoaderVersion = exports.swcLoaderVersion = exports.reactIsV18Version = exports.reactIsVersion = exports.reactDomV18Version = exports.reactDomVersion = exports.reactV18Version = exports.reactVersion = exports.nxVersion = void 0;
4
- exports.swcPluginStyledComponentsVersion = exports.swcPluginEmotionVersion = exports.swcPluginStyledJsxVersion = void 0;
3
+ exports.sassVersion = exports.lessVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.tailwindcssVersion = exports.postcssVersion = exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryDomVersion = exports.testingLibraryReactVersion = exports.reactRouterIsBotVersion = exports.reactRouterVersion = exports.reactRouterDomVersion = exports.styledJsxVersion = exports.emotionBabelPlugin = exports.emotionReactVersion = exports.emotionStyledVersion = exports.typesStyledComponentsVersion = exports.styledComponentsVersion = exports.babelCoreVersion = exports.babelPresetReactVersion = exports.typesNodeVersion = exports.reactViteVersion = exports.typesReactIsVersion = exports.typesReactIsV18Version = exports.typesReactDomVersion = exports.typesReactDomV18Version = exports.typesReactVersion = exports.typesReactV18Version = exports.babelLoaderVersion = exports.swcLoaderVersion = exports.reactIsV18Version = exports.reactIsVersion = exports.reactDomV18Version = exports.reactDomVersion = exports.reactV18Version = exports.reactVersion = exports.nxVersion = void 0;
4
+ exports.swcPluginStyledComponentsVersion = exports.swcPluginEmotionVersion = exports.swcPluginStyledJsxVersion = exports.svgrRollupVersion = exports.rollupPluginUrlVersion = void 0;
5
5
  exports.nxVersion = require('../../package.json').version;
6
6
  exports.reactVersion = '19.0.0';
7
7
  exports.reactV18Version = '18.3.1';
@@ -18,7 +18,8 @@ exports.typesReactDomVersion = '19.0.0';
18
18
  exports.typesReactIsV18Version = '18.3.0';
19
19
  exports.typesReactIsVersion = '19.0.0';
20
20
  exports.reactViteVersion = '^4.2.0';
21
- exports.typesNodeVersion = '18.16.9';
21
+ // Needed for React-Router
22
+ exports.typesNodeVersion = '^20.0.0';
22
23
  exports.babelPresetReactVersion = '^7.14.5';
23
24
  exports.babelCoreVersion = '^7.14.5';
24
25
  exports.styledComponentsVersion = '5.3.6';
@@ -28,7 +29,9 @@ exports.emotionReactVersion = '11.11.1';
28
29
  exports.emotionBabelPlugin = '11.11.0';
29
30
  // WARNING: This needs to be in sync with Next.js' dependency or else there might be issues.
30
31
  exports.styledJsxVersion = '5.1.2';
31
- exports.reactRouterDomVersion = '6.11.2';
32
+ exports.reactRouterDomVersion = '6.29.0';
33
+ exports.reactRouterVersion = '^7.2.0';
34
+ exports.reactRouterIsBotVersion = '^4.4.0';
32
35
  exports.testingLibraryReactVersion = '16.1.0';
33
36
  exports.testingLibraryDomVersion = '10.4.0';
34
37
  exports.reduxjsToolkitVersion = '1.9.3';
@@ -48,8 +51,8 @@ exports.typesExpressVersion = '^4.17.21';
48
51
  exports.isbotVersion = '^3.6.5';
49
52
  exports.corsVersion = '~2.8.5';
50
53
  exports.typesCorsVersion = '~2.8.12';
51
- exports.moduleFederationNodeVersion = '^2.6.21';
52
- exports.moduleFederationEnhancedVersion = '^0.8.8';
54
+ exports.moduleFederationNodeVersion = '^2.6.26';
55
+ exports.moduleFederationEnhancedVersion = '^0.9.0';
53
56
  // style preprocessors
54
57
  exports.lessVersion = '3.12.2';
55
58
  exports.sassVersion = '^1.55.0';
@@ -1,16 +0,0 @@
1
- const {composePlugins, withNx, withReact} = require('@nx/rspack');
2
- const {withModuleFederationForSSR} = require('@nx/module-federation/rspack');
3
-
4
- const baseConfig = require('./module-federation.config');
5
-
6
- const defaultConfig = {
7
- ...baseConfig
8
- };
9
-
10
- // Nx plugins for rspack to build config object from Nx options and context.
11
- /**
12
- * DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
13
- * The DTS Plugin can be enabled by setting dts: true
14
- * Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
15
- */
16
- module.exports = composePlugins(withNx(), withReact({ssr: true}), withModuleFederationForSSR(defaultConfig, { dts: false }));
@@ -1,16 +0,0 @@
1
- import {composePlugins, withNx, withReact} from '@nx/rspack';
2
- import {withModuleFederationForSSR} from '@nx/module-federation/rspack';
3
-
4
- import baseConfig from './module-federation.config';
5
-
6
- const defaultConfig = {
7
- ...baseConfig
8
- };
9
-
10
- // Nx plugins for rspack to build config object from Nx options and context.
11
- /**
12
- * DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support for Module Federation
13
- * The DTS Plugin can be enabled by setting dts: true
14
- * Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
15
- */
16
- export default composePlugins(withNx(), withReact({ssr: true}), withModuleFederationForSSR(defaultConfig, { dts: false }));
@@ -1,16 +0,0 @@
1
- const {composePlugins, withNx, withReact} = require('@nx/rspack');
2
- const {withModuleFederationForSSR} = require('@nx/module-federation/rspack');
3
-
4
- const baseConfig = require("./module-federation.server.config");
5
-
6
- const defaultConfig = {
7
- ...baseConfig,
8
- };
9
-
10
- // Nx plugins for rspack to build config object from Nx options and context.
11
- /**
12
- * DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support Module Federation
13
- * The DTS Plugin can be enabled by setting dts: true
14
- * Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
15
- */
16
- module.exports = composePlugins(withNx(), withReact({ssr: true}), withModuleFederationForSSR(defaultConfig, { dts: false }));
@@ -1,16 +0,0 @@
1
- import {composePlugins, withNx, withReact} from '@nx/rspack';
2
- import {withModuleFederationForSSR} from '@nx/module-federation/rspack';
3
-
4
- import baseConfig from "./module-federation.server.config";
5
-
6
- const defaultConfig = {
7
- ...baseConfig,
8
- };
9
-
10
- // Nx plugins for rspack to build config object from Nx options and context.
11
- /**
12
- * DTS Plugin is disabled in Nx Workspaces as Nx already provides Typing support Module Federation
13
- * The DTS Plugin can be enabled by setting dts: true
14
- * Learn more about the DTS Plugin here: https://module-federation.io/configure/dts.html
15
- */
16
- export default composePlugins(withNx(), withReact({ssr: true}), withModuleFederationForSSR(defaultConfig, { dts: false }));
@@ -1,2 +0,0 @@
1
- import { type Tree } from '@nx/devkit';
2
- export default function (tree: Tree): Promise<void>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const devkit_1 = require("@nx/devkit");
5
- async function default_1(tree) {
6
- if (!hasModuleFederationProject(tree)) {
7
- return;
8
- }
9
- ensureTargetDefaultsContainProductionInputs(tree);
10
- await (0, devkit_1.formatFiles)(tree);
11
- }
12
- function ensureTargetDefaultsContainProductionInputs(tree) {
13
- const nxJson = (0, devkit_1.readNxJson)(tree);
14
- const webpackExecutor = '@nx/webpack:webpack';
15
- const mfEnvVar = 'NX_MF_DEV_SERVER_STATIC_REMOTES';
16
- nxJson.targetDefaults[webpackExecutor] ??= {};
17
- nxJson.targetDefaults[webpackExecutor].inputs ??= [
18
- 'production',
19
- '^production',
20
- { env: mfEnvVar },
21
- ];
22
- if (!nxJson.targetDefaults[webpackExecutor].inputs.includes('production')) {
23
- nxJson.targetDefaults[webpackExecutor].inputs.push('production');
24
- }
25
- if (!nxJson.targetDefaults[webpackExecutor].inputs.includes('^production')) {
26
- nxJson.targetDefaults[webpackExecutor].inputs.push('^production');
27
- }
28
- let mfEnvVarExists = false;
29
- for (const input of nxJson.targetDefaults[webpackExecutor].inputs) {
30
- if (typeof input === 'object' && input['env'] === mfEnvVar) {
31
- mfEnvVarExists = true;
32
- break;
33
- }
34
- }
35
- if (!mfEnvVarExists) {
36
- nxJson.targetDefaults[webpackExecutor].inputs.push({ env: mfEnvVar });
37
- }
38
- (0, devkit_1.updateNxJson)(tree, nxJson);
39
- }
40
- function hasModuleFederationProject(tree) {
41
- const projects = (0, devkit_1.getProjects)(tree);
42
- for (const project of projects.values()) {
43
- const targets = project.targets || {};
44
- for (const [_, target] of Object.entries(targets)) {
45
- if (target.executor === '@nx/webpack:webpack' &&
46
- (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.ts')) ||
47
- tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js')))) {
48
- return true;
49
- }
50
- }
51
- }
52
- return false;
53
- }
@@ -1 +0,0 @@
1
- export declare function formatFile(content: any, ...values: any[]): string;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatFile = formatFile;
4
- const prettier_1 = require("prettier");
5
- const devkit_1 = require("@nx/devkit");
6
- function formatFile(content, ...values) {
7
- return (0, prettier_1.format)((0, devkit_1.stripIndents)(content, values), {
8
- singleQuote: true,
9
- parser: 'typescript',
10
- });
11
- }