@nx/next 23.0.0-pr.35413.460eeef → 23.0.0-rc.0

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 (254) hide show
  1. package/dist/babel.d.ts +1 -0
  2. package/{babel.js → dist/babel.js} +2 -0
  3. package/{index.d.ts → dist/index.d.ts} +0 -2
  4. package/{index.js → dist/index.js} +1 -3
  5. package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
  6. package/{plugins → dist/plugins}/component-testing.d.ts +0 -1
  7. package/{plugins → dist/plugins}/component-testing.js +22 -16
  8. package/{plugins → dist/plugins}/with-less.d.ts +0 -1
  9. package/{plugins → dist/plugins}/with-nx.d.ts +0 -1
  10. package/{plugins → dist/plugins}/with-nx.js +11 -45
  11. package/{src → dist/src}/executors/build/build.impl.d.ts +0 -1
  12. package/{src → dist/src}/executors/build/build.impl.js +3 -2
  13. package/{src → dist/src}/executors/build/lib/check-project.d.ts +0 -1
  14. package/{src → dist/src}/executors/build/lib/create-next-config-file.d.ts +0 -1
  15. package/{src → dist/src}/executors/build/lib/update-package-json.d.ts +0 -1
  16. package/{src → dist/src}/executors/build/schema.json +1 -0
  17. package/{src → dist/src}/executors/server/custom-server.impl.d.ts +0 -1
  18. package/{src → dist/src}/executors/server/schema.json +1 -0
  19. package/{src → dist/src}/executors/server/server.impl.d.ts +0 -1
  20. package/{src → dist/src}/executors/server/server.impl.js +6 -4
  21. package/{src → dist/src}/generators/application/application.d.ts +0 -1
  22. package/{src → dist/src}/generators/application/application.js +16 -30
  23. package/dist/src/generators/application/files/app/page.tsx__tmpl__ +15 -0
  24. package/dist/src/generators/application/files/common/__dot__babelrc +4 -0
  25. package/{src → dist/src}/generators/application/files/common/index.d.ts__tmpl__ +0 -7
  26. package/dist/src/generators/application/files/common/next.config.js__tmpl__ +31 -0
  27. package/{src → dist/src}/generators/application/files/common/tsconfig.json__tmpl__ +0 -1
  28. package/dist/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +18 -0
  29. package/{src → dist/src}/generators/application/lib/add-e2e.d.ts +0 -1
  30. package/{src → dist/src}/generators/application/lib/add-e2e.js +7 -9
  31. package/{src → dist/src}/generators/application/lib/add-jest.d.ts +0 -1
  32. package/{src → dist/src}/generators/application/lib/add-linting.d.ts +0 -1
  33. package/{src → dist/src}/generators/application/lib/add-linting.js +13 -14
  34. package/{src → dist/src}/generators/application/lib/add-plugin.d.ts +0 -1
  35. package/{src → dist/src}/generators/application/lib/add-project.d.ts +0 -1
  36. package/{src → dist/src}/generators/application/lib/add-project.js +4 -2
  37. package/{src → dist/src}/generators/application/lib/create-application-files.d.ts +0 -1
  38. package/{src → dist/src}/generators/application/lib/create-application-files.helpers.d.ts +0 -1
  39. package/{src → dist/src}/generators/application/lib/create-application-files.js +5 -24
  40. package/{src → dist/src}/generators/application/lib/normalize-options.d.ts +0 -2
  41. package/{src → dist/src}/generators/application/lib/normalize-options.js +7 -11
  42. package/{src → dist/src}/generators/application/lib/set-defaults.d.ts +0 -1
  43. package/{src → dist/src}/generators/application/lib/update-cypress-tsconfig.d.ts +0 -1
  44. package/{src → dist/src}/generators/application/schema.json +2 -21
  45. package/{src → dist/src}/generators/component/component.d.ts +0 -1
  46. package/{src → dist/src}/generators/component/component.js +4 -2
  47. package/{src → dist/src}/generators/component/schema.json +2 -21
  48. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
  49. package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +6 -5
  50. package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -2
  51. package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.js +6 -6
  52. package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts +1 -3
  53. package/{src → dist/src}/generators/convert-to-inferred/lib/update-next-config.d.ts +1 -2
  54. package/{src → dist/src}/generators/convert-to-inferred/lib/utils.d.ts +0 -1
  55. package/{src → dist/src}/generators/custom-server/custom-server.d.ts +0 -1
  56. package/{src → dist/src}/generators/custom-server/custom-server.js +11 -5
  57. package/{src → dist/src}/generators/cypress-component-configuration/cypress-component-configuration.d.ts +0 -1
  58. package/{src → dist/src}/generators/cypress-component-configuration/cypress-component-configuration.js +11 -42
  59. package/{src → dist/src}/generators/init/init.d.ts +0 -1
  60. package/{src → dist/src}/generators/init/init.js +10 -41
  61. package/{src → dist/src}/generators/init/schema.json +1 -1
  62. package/{src → dist/src}/generators/library/lib/normalize-options.d.ts +0 -1
  63. package/{src → dist/src}/generators/library/lib/normalize-options.js +5 -5
  64. package/{src → dist/src}/generators/library/lib/update-vite-config.d.ts +0 -1
  65. package/{src → dist/src}/generators/library/library.d.ts +0 -1
  66. package/{src → dist/src}/generators/library/library.js +18 -23
  67. package/{src → dist/src}/generators/library/schema.json +2 -21
  68. package/{src → dist/src}/generators/page/page.d.ts +0 -1
  69. package/{src → dist/src}/generators/page/page.js +9 -6
  70. package/{src → dist/src}/generators/page/schema.json +2 -17
  71. package/{src → dist/src}/migrations/update-22-0-0/add-svgr-to-next-config.d.ts +0 -1
  72. package/{src → dist/src}/migrations/update-22-0-0/add-svgr-to-next-config.js +2 -2
  73. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
  74. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +223 -0
  75. package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
  76. package/{src → dist/src}/plugins/plugin.d.ts +3 -4
  77. package/{src → dist/src}/plugins/plugin.js +63 -35
  78. package/{src → dist/src}/utils/add-gitignore-entry.d.ts +0 -1
  79. package/{src → dist/src}/utils/add-swc-to-custom-server.d.ts +0 -1
  80. package/{src → dist/src}/utils/add-swc-to-custom-server.js +7 -8
  81. package/dist/src/utils/assert-supported-next-version.d.ts +2 -0
  82. package/dist/src/utils/assert-supported-next-version.js +8 -0
  83. package/{src → dist/src}/utils/compose-plugins.d.ts +0 -1
  84. package/{src → dist/src}/utils/compose-plugins.js +2 -0
  85. package/dist/src/utils/config-invalid-function.fixture.d.ts +1 -0
  86. package/dist/src/utils/config-invalid-function.fixture.js +3 -0
  87. package/dist/src/utils/config-not-a-function.fixture.d.ts +1 -0
  88. package/{src/generators/setup-tailwind/schema.js → dist/src/utils/config-not-a-function.fixture.js} +1 -0
  89. package/{src → dist/src}/utils/config.d.ts +0 -1
  90. package/{src → dist/src}/utils/constants.d.ts +0 -1
  91. package/{src → dist/src}/utils/create-cli-options.d.ts +0 -1
  92. package/{src → dist/src}/utils/create-copy-plugin.d.ts +0 -1
  93. package/dist/src/utils/deprecation.d.ts +12 -0
  94. package/dist/src/utils/deprecation.js +60 -0
  95. package/{src → dist/src}/utils/jest-config-util.d.ts +0 -1
  96. package/{src → dist/src}/utils/runtime-version-utils.d.ts +0 -1
  97. package/dist/src/utils/styles.d.ts +5 -0
  98. package/dist/src/utils/styles.js +21 -0
  99. package/{src → dist/src}/utils/types.d.ts +0 -1
  100. package/{src → dist/src}/utils/version-utils.d.ts +0 -1
  101. package/dist/src/utils/versions.d.ts +12 -0
  102. package/dist/src/utils/versions.js +16 -0
  103. package/dist/tailwind.d.ts +5 -0
  104. package/dist/tailwind.js +66 -0
  105. package/dist/typings/image.d.ts +12 -0
  106. package/executors.json +4 -4
  107. package/generators.json +16 -16
  108. package/migrations.json +8 -35
  109. package/package.json +96 -16
  110. package/babel.d.ts +0 -1
  111. package/babel.d.ts.map +0 -1
  112. package/index.d.ts.map +0 -1
  113. package/plugin.d.ts.map +0 -1
  114. package/plugins/component-testing.d.ts.map +0 -1
  115. package/plugins/with-less.d.ts.map +0 -1
  116. package/plugins/with-nx.d.ts.map +0 -1
  117. package/src/executors/build/build.impl.d.ts.map +0 -1
  118. package/src/executors/build/lib/check-project.d.ts.map +0 -1
  119. package/src/executors/build/lib/create-next-config-file.d.ts.map +0 -1
  120. package/src/executors/build/lib/update-package-json.d.ts.map +0 -1
  121. package/src/executors/server/custom-server.impl.d.ts.map +0 -1
  122. package/src/executors/server/server.impl.d.ts.map +0 -1
  123. package/src/generators/application/application.d.ts.map +0 -1
  124. package/src/generators/application/files/app/page.tsx__tmpl__ +0 -27
  125. package/src/generators/application/files/app-styled-components/layout.tsx__tmpl__ +0 -21
  126. package/src/generators/application/files/app-styled-components/registry.tsx__tmpl__ +0 -33
  127. package/src/generators/application/files/app-styled-jsx/layout.tsx__tmpl__ +0 -16
  128. package/src/generators/application/files/app-styled-jsx/registry.tsx__tmpl__ +0 -23
  129. package/src/generators/application/files/common/__dot__babelrc +0 -21
  130. package/src/generators/application/files/common/next.config.js__tmpl__ +0 -76
  131. package/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +0 -27
  132. package/src/generators/application/files/pages/_document.tsx__tmpl__ +0 -33
  133. package/src/generators/application/lib/add-e2e.d.ts.map +0 -1
  134. package/src/generators/application/lib/add-jest.d.ts.map +0 -1
  135. package/src/generators/application/lib/add-linting.d.ts.map +0 -1
  136. package/src/generators/application/lib/add-plugin.d.ts.map +0 -1
  137. package/src/generators/application/lib/add-project.d.ts.map +0 -1
  138. package/src/generators/application/lib/create-application-files.d.ts.map +0 -1
  139. package/src/generators/application/lib/create-application-files.helpers.d.ts.map +0 -1
  140. package/src/generators/application/lib/normalize-options.d.ts.map +0 -1
  141. package/src/generators/application/lib/set-defaults.d.ts.map +0 -1
  142. package/src/generators/application/lib/show-possible-warnings.d.ts +0 -4
  143. package/src/generators/application/lib/show-possible-warnings.d.ts.map +0 -1
  144. package/src/generators/application/lib/show-possible-warnings.js +0 -9
  145. package/src/generators/application/lib/update-cypress-tsconfig.d.ts.map +0 -1
  146. package/src/generators/component/component.d.ts.map +0 -1
  147. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
  148. package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +0 -1
  149. package/src/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts.map +0 -1
  150. package/src/generators/convert-to-inferred/lib/update-next-config.d.ts.map +0 -1
  151. package/src/generators/convert-to-inferred/lib/utils.d.ts.map +0 -1
  152. package/src/generators/custom-server/custom-server.d.ts.map +0 -1
  153. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +0 -1
  154. package/src/generators/init/init.d.ts.map +0 -1
  155. package/src/generators/library/lib/normalize-options.d.ts.map +0 -1
  156. package/src/generators/library/lib/update-vite-config.d.ts.map +0 -1
  157. package/src/generators/library/library.d.ts.map +0 -1
  158. package/src/generators/page/page.d.ts.map +0 -1
  159. package/src/generators/setup-tailwind/files/postcss.config.js__tmpl__ +0 -15
  160. package/src/generators/setup-tailwind/files/tailwind.config.js__tmpl__ +0 -23
  161. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +0 -4
  162. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts.map +0 -1
  163. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +0 -27
  164. package/src/generators/setup-tailwind/lib/update-project.d.ts +0 -4
  165. package/src/generators/setup-tailwind/lib/update-project.d.ts.map +0 -1
  166. package/src/generators/setup-tailwind/lib/update-project.js +0 -11
  167. package/src/generators/setup-tailwind/schema.d.ts +0 -7
  168. package/src/generators/setup-tailwind/schema.d.ts.map +0 -1
  169. package/src/generators/setup-tailwind/schema.json +0 -47
  170. package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
  171. package/src/generators/setup-tailwind/setup-tailwind.d.ts.map +0 -1
  172. package/src/generators/setup-tailwind/setup-tailwind.js +0 -35
  173. package/src/migrations/update-22-0-0/add-svgr-to-next-config.d.ts.map +0 -1
  174. package/src/migrations/update-22-2-0/create-ai-instructions-for-next-16.d.ts +0 -3
  175. package/src/migrations/update-22-2-0/create-ai-instructions-for-next-16.d.ts.map +0 -1
  176. package/src/migrations/update-22-2-0/create-ai-instructions-for-next-16.js +0 -16
  177. package/src/plugins/plugin.d.ts.map +0 -1
  178. package/src/utils/add-gitignore-entry.d.ts.map +0 -1
  179. package/src/utils/add-swc-to-custom-server.d.ts.map +0 -1
  180. package/src/utils/compose-plugins.d.ts.map +0 -1
  181. package/src/utils/config-invalid-function.fixture.d.ts +0 -1
  182. package/src/utils/config-invalid-function.fixture.d.ts.map +0 -1
  183. package/src/utils/config-invalid-function.fixture.js +0 -1
  184. package/src/utils/config-not-a-function.fixture.d.ts +0 -1
  185. package/src/utils/config-not-a-function.fixture.d.ts.map +0 -1
  186. package/src/utils/config-not-a-function.fixture.js +0 -1
  187. package/src/utils/config.d.ts.map +0 -1
  188. package/src/utils/constants.d.ts.map +0 -1
  189. package/src/utils/create-cli-options.d.ts.map +0 -1
  190. package/src/utils/create-copy-plugin.d.ts.map +0 -1
  191. package/src/utils/generate-globs.d.ts +0 -6
  192. package/src/utils/generate-globs.d.ts.map +0 -1
  193. package/src/utils/generate-globs.js +0 -28
  194. package/src/utils/jest-config-util.d.ts.map +0 -1
  195. package/src/utils/runtime-version-utils.d.ts.map +0 -1
  196. package/src/utils/styles.d.ts +0 -68
  197. package/src/utils/styles.d.ts.map +0 -1
  198. package/src/utils/styles.js +0 -67
  199. package/src/utils/types.d.ts.map +0 -1
  200. package/src/utils/version-utils.d.ts.map +0 -1
  201. package/src/utils/versions.d.ts +0 -15
  202. package/src/utils/versions.d.ts.map +0 -1
  203. package/src/utils/versions.js +0 -17
  204. package/tailwind.d.ts +0 -8
  205. package/tailwind.d.ts.map +0 -1
  206. package/tailwind.js +0 -41
  207. /package/{LICENSE → dist/LICENSE} +0 -0
  208. /package/{plugin.js → dist/plugin.js} +0 -0
  209. /package/{plugins → dist/plugins}/with-less.js +0 -0
  210. /package/{src → dist/src}/executors/build/lib/check-project.js +0 -0
  211. /package/{src → dist/src}/executors/build/lib/create-next-config-file.js +0 -0
  212. /package/{src → dist/src}/executors/build/lib/update-package-json.js +0 -0
  213. /package/{src → dist/src}/executors/server/custom-server.impl.js +0 -0
  214. /package/{src → dist/src}/generators/application/files/app/api/hello/route.ts__tmpl__ +0 -0
  215. /package/{src → dist/src}/generators/application/files/app/global.__stylesExt____tmpl__ +0 -0
  216. /package/{src → dist/src}/generators/application/files/app/page.module.__style__ +0 -0
  217. /package/{src → dist/src}/generators/application/files/app-default-layout/layout.tsx__tmpl__ +0 -0
  218. /package/{src → dist/src}/generators/application/files/common/next-env.d.ts__tmpl__ +0 -0
  219. /package/{src → dist/src}/generators/application/files/common/public/.gitkeep +0 -0
  220. /package/{src → dist/src}/generators/application/files/common/public/favicon.ico +0 -0
  221. /package/{src → dist/src}/generators/application/files/common/specs/__fileName__.spec.tsx__tmpl__ +0 -0
  222. /package/{src → dist/src}/generators/application/files/pages/__fileName__.module.__style__ +0 -0
  223. /package/{src → dist/src}/generators/application/files/pages/_app.tsx__tmpl__ +0 -0
  224. /package/{src → dist/src}/generators/application/files/pages/styles.__stylesExt____tmpl__ +0 -0
  225. /package/{src → dist/src}/generators/application/lib/add-jest.js +0 -0
  226. /package/{src → dist/src}/generators/application/lib/add-plugin.js +0 -0
  227. /package/{src → dist/src}/generators/application/lib/create-application-files.helpers.js +0 -0
  228. /package/{src → dist/src}/generators/application/lib/set-defaults.js +0 -0
  229. /package/{src → dist/src}/generators/application/lib/update-cypress-tsconfig.js +0 -0
  230. /package/{src → dist/src}/generators/application/schema.d.ts +0 -0
  231. /package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-tranformer.js +0 -0
  232. /package/{src → dist/src}/generators/convert-to-inferred/lib/update-next-config.js +0 -0
  233. /package/{src → dist/src}/generators/convert-to-inferred/lib/utils.js +0 -0
  234. /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
  235. /package/{src → dist/src}/generators/custom-server/files/server/main.ts__tmpl__ +0 -0
  236. /package/{src → dist/src}/generators/custom-server/files/tsconfig.server.json__tmpl__ +0 -0
  237. /package/{src → dist/src}/generators/custom-server/schema.d.ts +0 -0
  238. /package/{src → dist/src}/generators/custom-server/schema.json +0 -0
  239. /package/{src → dist/src}/generators/cypress-component-configuration/schema.d.ts +0 -0
  240. /package/{src → dist/src}/generators/cypress-component-configuration/schema.json +0 -0
  241. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  242. /package/{src → dist/src}/generators/library/lib/update-vite-config.js +0 -0
  243. /package/{src → dist/src}/generators/library/schema.d.ts +0 -0
  244. /package/{src → dist/src}/generators/page/schema.d.ts +0 -0
  245. /package/{src/migrations/update-22-2-0/files → dist/src/migrations/update-22-2-0}/ai-instructions-for-next-16.md +0 -0
  246. /package/{src → dist/src}/utils/add-gitignore-entry.js +0 -0
  247. /package/{src → dist/src}/utils/config.js +0 -0
  248. /package/{src → dist/src}/utils/constants.js +0 -0
  249. /package/{src → dist/src}/utils/create-cli-options.js +0 -0
  250. /package/{src → dist/src}/utils/create-copy-plugin.js +0 -0
  251. /package/{src → dist/src}/utils/jest-config-util.js +0 -0
  252. /package/{src → dist/src}/utils/runtime-version-utils.js +0 -0
  253. /package/{src → dist/src}/utils/types.js +0 -0
  254. /package/{src → dist/src}/utils/version-utils.js +0 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  /*
2
4
  * Babel preset to provide Next.js support for Nx.
3
5
  */
@@ -1,9 +1,7 @@
1
1
  export * from './src/utils/types';
2
- export { createGlobPatternsOfDependentProjects } from './src/utils/generate-globs';
3
2
  export { applicationGenerator } from './src/generators/application/application';
4
3
  export { componentGenerator } from './src/generators/component/component';
5
4
  export { libraryGenerator } from './src/generators/library/library';
6
5
  export { pageGenerator } from './src/generators/page/page';
7
6
  export { withNx } from './plugins/with-nx';
8
7
  export { composePlugins } from './src/utils/compose-plugins';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.composePlugins = exports.withNx = exports.pageGenerator = exports.libraryGenerator = exports.componentGenerator = exports.applicationGenerator = exports.createGlobPatternsOfDependentProjects = void 0;
3
+ exports.composePlugins = exports.withNx = exports.pageGenerator = exports.libraryGenerator = exports.componentGenerator = exports.applicationGenerator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./src/utils/types"), exports);
6
- var generate_globs_1 = require("./src/utils/generate-globs");
7
- Object.defineProperty(exports, "createGlobPatternsOfDependentProjects", { enumerable: true, get: function () { return generate_globs_1.createGlobPatternsOfDependentProjects; } });
8
6
  var application_1 = require("./src/generators/application/application");
9
7
  Object.defineProperty(exports, "applicationGenerator", { enumerable: true, get: function () { return application_1.applicationGenerator; } });
10
8
  var component_1 = require("./src/generators/component/component");
@@ -1,2 +1 @@
1
1
  export { createNodes, createNodesV2, NextPluginOptions, } from './src/plugins/plugin';
2
- //# sourceMappingURL=plugin.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { NxComponentTestingOptions } from '@nx/cypress/plugins/cypress-preset';
2
2
  export declare function nxComponentTestingPreset(pathToConfig: string, options?: NxComponentTestingOptions): any;
3
- //# sourceMappingURL=component-testing.d.ts.map
@@ -2,11 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nxComponentTestingPreset = nxComponentTestingPreset;
4
4
  const cypress_preset_1 = require("@nx/cypress/plugins/cypress-preset");
5
- const ct_helpers_1 = require("@nx/cypress/src/utils/ct-helpers");
5
+ const internal_1 = require("@nx/cypress/internal");
6
6
  const devkit_1 = require("@nx/devkit");
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
  const react_1 = require("@nx/react");
9
+ const internal_3 = require("@nx/react/internal");
9
10
  const webpack_1 = require("@nx/webpack");
11
+ const internal_4 = require("@nx/webpack/internal");
10
12
  const configuration_1 = require("nx/src/config/configuration");
11
13
  const path_1 = require("path");
12
14
  function nxComponentTestingPreset(pathToConfig, options) {
@@ -16,10 +18,10 @@ function nxComponentTestingPreset(pathToConfig, options) {
16
18
  return (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig);
17
19
  }
18
20
  const graph = (0, devkit_1.readCachedProjectGraph)();
19
- const { targets: ctTargets, name: ctProjectName } = (0, ct_helpers_1.getProjectConfigByPath)(graph, pathToConfig);
21
+ const { targets: ctTargets, name: ctProjectName } = (0, internal_1.getProjectConfigByPath)(graph, pathToConfig);
20
22
  const ctTargetName = options?.ctTargetName || 'component-test';
21
23
  const ctConfigurationName = process.env.NX_CYPRESS_TARGET_CONFIGURATION;
22
- const ctExecutorContext = (0, ct_helpers_1.createExecutorContext)(graph, ctTargets, ctProjectName, ctTargetName, ctConfigurationName);
24
+ const ctExecutorContext = (0, internal_1.createExecutorContext)(graph, ctTargets, ctProjectName, ctTargetName, ctConfigurationName);
23
25
  let buildTarget = options?.buildTarget;
24
26
  if (!buildTarget) {
25
27
  const ctExecutorOptions = (0, devkit_1.readTargetOptions)({
@@ -50,7 +52,7 @@ function nxComponentTestingPreset(pathToConfig, options) {
50
52
  ]}' project is not using the '@nx/next:build' executor. ` +
51
53
  `Please make sure to use '@nx/next:build' executor in that target to use Cypress Component Testing.`);
52
54
  }
53
- const buildExecutorContext = (0, ct_helpers_1.createExecutorContext)(graph, buildProjectConfig.targets, parsedBuildTarget.project, parsedBuildTarget.target, parsedBuildTarget.configuration);
55
+ const buildExecutorContext = (0, internal_1.createExecutorContext)(graph, buildProjectConfig.targets, parsedBuildTarget.project, parsedBuildTarget.target, parsedBuildTarget.configuration);
54
56
  const buildExecutorOptions = (0, devkit_1.readTargetOptions)({
55
57
  project: parsedBuildTarget.project,
56
58
  target: parsedBuildTarget.target,
@@ -69,7 +71,7 @@ Able to find CT project, ${!!ctProjectConfig}.`);
69
71
  const webpackOptions = {
70
72
  root: ctExecutorContext.root,
71
73
  projectRoot: ctProjectConfig.root,
72
- sourceRoot: (0, ts_solution_setup_1.getProjectSourceRoot)(ctProjectConfig),
74
+ sourceRoot: (0, internal_2.getProjectSourceRoot)(ctProjectConfig),
73
75
  main: '',
74
76
  useTsconfigPaths: undefined,
75
77
  fileReplacements: buildFileReplacements,
@@ -79,16 +81,20 @@ Able to find CT project, ${!!ctProjectConfig}.`);
79
81
  compiler: options?.compiler || 'swc',
80
82
  tsConfig: (0, path_1.join)(ctExecutorContext.root, ctProjectConfig.root, 'tsconfig.json'),
81
83
  };
82
- const configure = (0, webpack_1.composePluginsSync)((0, webpack_1.withNx)({
83
- target: 'web',
84
- styles: [],
85
- scripts: [],
86
- postcssConfig: ctProjectConfig.root,
87
- }), (0, react_1.withReact)({}));
88
- const webpackConfig = configure({}, {
89
- options: webpackOptions,
90
- context: ctExecutorContext,
91
- });
84
+ // Nx composes these helpers internally for the Cypress CT preset; suppress
85
+ // their deprecation warning so it fires only for user-authored configs.
86
+ const webpackConfig = (0, internal_4.suppressWebpackComposeHelperWarnings)(() => (0, internal_3.suppressReactComposeHelperWarnings)(() => {
87
+ const configure = (0, webpack_1.composePluginsSync)((0, webpack_1.withNx)({
88
+ target: 'web',
89
+ styles: [],
90
+ scripts: [],
91
+ postcssConfig: ctProjectConfig.root,
92
+ }), (0, react_1.withReact)({}));
93
+ return configure({}, {
94
+ options: webpackOptions,
95
+ context: ctExecutorContext,
96
+ });
97
+ }));
92
98
  return {
93
99
  ...(0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig),
94
100
  specPattern: '**/*.cy.{js,jsx,ts,tsx}',
@@ -1,4 +1,3 @@
1
1
  import { NextConfigFn } from '../src/utils/config';
2
2
  import { WithNxOptions } from './with-nx';
3
3
  export declare function withLess(configOrFn: NextConfigFn | WithNxOptions): NextConfigFn;
4
- //# sourceMappingURL=with-less.d.ts.map
@@ -28,4 +28,3 @@ export declare function getNextConfig(nextConfig?: WithNxOptions, context?: With
28
28
  export declare function getAliasForProject(node: ProjectGraphProjectNode, paths: Record<string, string[]>): null | string;
29
29
  export declare function forNextVersion(range: string, fn: () => void): void;
30
30
  export { withNx };
31
- //# sourceMappingURL=with-nx.d.ts.map
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.getNextConfig = getNextConfig;
37
4
  exports.getAliasForProject = getAliasForProject;
@@ -95,7 +62,7 @@ function getNxContext(graph, target) {
95
62
  */
96
63
  function withNx(_nextConfig = {}, context = getWithNxContext()) {
97
64
  return async (phase) => {
98
- const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER } = await Promise.resolve().then(() => __importStar(require('next/constants')));
65
+ const { PHASE_PRODUCTION_SERVER, PHASE_DEVELOPMENT_SERVER, } = require('next/constants');
99
66
  // Three scenarios where we want to skip graph creation:
100
67
  // 1. Running production server means the build is already done so we just need to start the Next.js server.
101
68
  // 2. During graph creation (i.e. create nodes), we won't have a graph to read, and it is not needed anyway since it's a build-time concern.
@@ -112,17 +79,16 @@ function withNx(_nextConfig = {}, context = getWithNxContext()) {
112
79
  };
113
80
  }
114
81
  else {
115
- const { createProjectGraphAsync, joinPathFragments, offsetFromRoot, workspaceRoot, } = require('@nx/devkit');
116
- let graph;
117
- try {
118
- graph = await createProjectGraphAsync({
119
- exitOnError: false,
120
- resetDaemonClient: true,
121
- });
122
- }
123
- catch (e) {
124
- throw new Error('Could not create project graph. Please ensure that your workspace is valid.', { cause: e });
125
- }
82
+ const { readCachedProjectGraph, joinPathFragments, offsetFromRoot, workspaceRoot, } = require('@nx/devkit');
83
+ // Resolved from the workspace (not bundled) so the deprecation warning is
84
+ // not inlined into production builds. Reached only on the active Nx-task
85
+ // path; the production-server phase returns above.
86
+ const { warnWithNxDeprecation } = require(require.resolve('@nx/next/src/utils/deprecation', {
87
+ paths: [workspaceRoot],
88
+ }));
89
+ warnWithNxDeprecation();
90
+ // Since this is invoked by an Nx task, the graph is already cached.
91
+ const graph = readCachedProjectGraph();
126
92
  const originalTarget = {
127
93
  project: process.env.NX_TASK_TARGET_PROJECT,
128
94
  target: process.env.NX_TASK_TARGET_TARGET,
@@ -3,4 +3,3 @@ import { NextBuildBuilderOptions } from '../../utils/types';
3
3
  export default function buildExecutor(options: NextBuildBuilderOptions, context: ExecutorContext): Promise<{
4
4
  success: boolean;
5
5
  }>;
6
- //# sourceMappingURL=build.impl.d.ts.map
@@ -7,7 +7,6 @@ const path_1 = require("path");
7
7
  const node_fs_1 = require("node:fs");
8
8
  const promises_1 = require("node:fs/promises");
9
9
  const semver_1 = require("semver");
10
- const semver_2 = require("@nx/devkit/src/utils/semver");
11
10
  const update_package_json_1 = require("./lib/update-package-json");
12
11
  const create_next_config_file_1 = require("./lib/create-next-config-file");
13
12
  const check_project_1 = require("./lib/check-project");
@@ -15,8 +14,10 @@ const child_process_1 = require("child_process");
15
14
  const create_cli_options_1 = require("../../utils/create-cli-options");
16
15
  const internal_1 = require("@nx/devkit/internal");
17
16
  const runtime_version_utils_1 = require("../../utils/runtime-version-utils");
17
+ const deprecation_1 = require("../../utils/deprecation");
18
18
  let childProcess;
19
19
  async function buildExecutor(options, context) {
20
+ (0, deprecation_1.warnNextBuildExecutorDeprecation)();
20
21
  // Cast to any to overwrite NODE_ENV
21
22
  process.env.NODE_ENV ||= 'production';
22
23
  const projectRoot = context.projectGraph.nodes[context.projectName].data.root;
@@ -30,7 +31,7 @@ async function buildExecutor(options, context) {
30
31
  const reactDomVersion = packageJson?.dependencies?.['react-dom'] ??
31
32
  rootPackageJson.dependencies?.['react-dom'];
32
33
  const hasReact18 = reactDomVersion &&
33
- (0, semver_1.gte)((0, semver_2.checkAndCleanWithSemver)('react-dom', reactDomVersion), '18.0.0');
34
+ (0, semver_1.gte)((0, internal_1.checkAndCleanWithSemver)('react-dom', reactDomVersion), '18.0.0');
34
35
  if (hasReact18) {
35
36
  process.env['__NEXT_REACT_ROOT'] ||= 'true';
36
37
  }
@@ -1,2 +1 @@
1
1
  export declare function checkPublicDirectory(root: string): void;
2
- //# sourceMappingURL=check-project.d.ts.map
@@ -12,4 +12,3 @@ export declare function getRelativeImports({ file, content, }: {
12
12
  content: string;
13
13
  }): string[];
14
14
  export declare function ensureFileExtensions(files: string[], absoluteDir: string): string[];
15
- //# sourceMappingURL=create-next-config-file.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
2
  import type { PackageJson } from 'nx/src/utils/package-json';
3
3
  export declare function updatePackageJson(packageJson: PackageJson, context: ExecutorContext): void;
4
- //# sourceMappingURL=update-package-json.d.ts.map
@@ -6,6 +6,7 @@
6
6
  "title": "Next Build",
7
7
  "description": "Build a Next.js app.",
8
8
  "type": "object",
9
+ "x-deprecated": "The `@nx/next:build` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/next:convert-to-inferred` to migrate to the `@nx/next/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
9
10
  "properties": {
10
11
  "outputPath": {
11
12
  "type": "string",
@@ -4,4 +4,3 @@ export default function serveExecutor(options: NextServeBuilderOptions, context:
4
4
  success: boolean;
5
5
  baseUrl: string;
6
6
  }, void, unknown>;
7
- //# sourceMappingURL=custom-server.impl.d.ts.map
@@ -6,6 +6,7 @@
6
6
  "title": "Next Serve",
7
7
  "description": "Serve a Next.js app.",
8
8
  "type": "object",
9
+ "x-deprecated": "The `@nx/next:server` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/next:convert-to-inferred` to migrate to the `@nx/next/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
9
10
  "properties": {
10
11
  "dev": {
11
12
  "type": "boolean",
@@ -4,4 +4,3 @@ export default function serveExecutor(options: NextServeBuilderOptions, context:
4
4
  success: boolean;
5
5
  baseUrl: string;
6
6
  }, void, any>;
7
- //# sourceMappingURL=server.impl.d.ts.map
@@ -2,15 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = serveExecutor;
4
4
  const tslib_1 = require("tslib");
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const devkit_1 = require("@nx/devkit");
6
7
  const path_1 = require("path");
7
8
  const child_process_1 = require("child_process");
8
9
  const custom_server_impl_1 = tslib_1.__importDefault(require("./custom-server.impl"));
9
10
  const create_cli_options_1 = require("../../utils/create-cli-options");
10
- const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
11
- const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
11
+ const internal_2 = require("@nx/web/internal");
12
12
  const runtime_version_utils_1 = require("../../utils/runtime-version-utils");
13
+ const deprecation_1 = require("../../utils/deprecation");
13
14
  async function* serveExecutor(options, context) {
15
+ (0, deprecation_1.warnNextServerExecutorDeprecation)();
14
16
  const buildOptions = (0, devkit_1.readTargetOptions)((0, devkit_1.parseTargetString)(options.buildTarget, context), context);
15
17
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
16
18
  // This is required for the default custom server to work. See the @nx/next:app generator.
@@ -64,7 +66,7 @@ async function* serveExecutor(options, context) {
64
66
  }
65
67
  }
66
68
  const nextBin = require.resolve('next/dist/bin/next');
67
- yield* (0, async_iterable_1.createAsyncIterable)(async ({ done, next, error }) => {
69
+ yield* (0, internal_1.createAsyncIterable)(async ({ done, next, error }) => {
68
70
  const server = (0, child_process_1.fork)(nextBin, [
69
71
  mode,
70
72
  ...args,
@@ -91,7 +93,7 @@ async function* serveExecutor(options, context) {
91
93
  process.on('SIGINT', () => killServer());
92
94
  process.on('SIGTERM', () => killServer());
93
95
  process.on('SIGHUP', () => killServer());
94
- await (0, wait_for_port_open_1.waitForPortOpen)(options.port, { host: options.hostname });
96
+ await (0, internal_2.waitForPortOpen)(options.port, { host: options.hostname });
95
97
  next({
96
98
  success: true,
97
99
  baseUrl: `http://${options.hostname ?? 'localhost'}:${options.port}`,
@@ -2,4 +2,3 @@ import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Schema } from './schema';
3
3
  export declare function applicationGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
4
4
  export declare function applicationGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
5
- //# sourceMappingURL=application.d.ts.map
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.applicationGenerator = applicationGenerator;
4
4
  exports.applicationGeneratorInternal = applicationGeneratorInternal;
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const devkit_1 = require("@nx/devkit");
7
+ const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
6
8
  const js_1 = require("@nx/js");
7
- const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
8
- const versions_1 = require("@nx/react/src/utils/versions");
9
- const version_utils_1 = require("@nx/react/src/utils/version-utils");
9
+ const internal_2 = require("@nx/react/internal");
10
+ const internal_3 = require("@nx/react/internal");
10
11
  const normalize_options_1 = require("./lib/normalize-options");
11
12
  const add_e2e_1 = require("./lib/add-e2e");
12
13
  const add_jest_1 = require("./lib/add-jest");
@@ -18,14 +19,10 @@ const styles_1 = require("../../utils/styles");
18
19
  const add_linting_1 = require("./lib/add-linting");
19
20
  const custom_server_1 = require("../custom-server/custom-server");
20
21
  const update_cypress_tsconfig_1 = require("./lib/update-cypress-tsconfig");
21
- const show_possible_warnings_1 = require("./lib/show-possible-warnings");
22
- const versions_2 = require("../../utils/versions");
23
- const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
24
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
25
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
22
+ const versions_1 = require("../../utils/versions");
23
+ const internal_4 = require("@nx/js/internal");
26
24
  const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
27
25
  const jest_config_util_1 = require("../../utils/jest-config-util");
28
- const version_utils_2 = require("../../utils/version-utils");
29
26
  async function applicationGenerator(host, schema) {
30
27
  return await applicationGeneratorInternal(host, {
31
28
  addPlugin: false,
@@ -34,8 +31,9 @@ async function applicationGenerator(host, schema) {
34
31
  });
35
32
  }
36
33
  async function applicationGeneratorInternal(host, schema) {
34
+ (0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
37
35
  const tasks = [];
38
- const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
36
+ const addTsPlugin = (0, internal_4.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
39
37
  const jsInitTask = await (0, js_1.initGenerator)(host, {
40
38
  js: schema.js,
41
39
  skipPackageJson: schema.skipPackageJson,
@@ -46,7 +44,6 @@ async function applicationGeneratorInternal(host, schema) {
46
44
  });
47
45
  tasks.push(jsInitTask);
48
46
  const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
49
- (0, show_possible_warnings_1.showPossibleWarnings)(host, options);
50
47
  const nextTask = await (0, init_1.nextInitGenerator)(host, {
51
48
  ...options,
52
49
  skipFormat: true,
@@ -57,7 +54,7 @@ async function applicationGeneratorInternal(host, schema) {
57
54
  // If we are using the new TS solution
58
55
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
59
56
  if (options.isTsSolutionSetup) {
60
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
57
+ await (0, internal_4.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
61
58
  }
62
59
  const lintTask = await (0, add_linting_1.addLinting)(host, options);
63
60
  tasks.push(lintTask);
@@ -65,17 +62,6 @@ async function applicationGeneratorInternal(host, schema) {
65
62
  tasks.push(e2eTask);
66
63
  const jestTask = await (0, add_jest_1.addJest)(host, options);
67
64
  tasks.push(jestTask);
68
- if (options.style === 'tailwind') {
69
- const tailwindTask = await (0, setup_tailwind_1.setupTailwindGenerator)(host, {
70
- project: options.projectName,
71
- });
72
- tasks.push(tailwindTask);
73
- }
74
- // LESS is not currrently supported with Turbopack
75
- // Turbopack is default in Next 16, set to webpack
76
- if (options.style === 'less' && (await (0, version_utils_2.isNext16)(host))) {
77
- devkit_1.logger.warn("NX LESS is only supported with Webpack bundler. Please ensure you run your application with '--webpack'.");
78
- }
79
65
  const styledTask = (0, styles_1.addStyleDependencies)(host, {
80
66
  style: options.style,
81
67
  swc: !host.exists((0, devkit_1.joinPathFragments)(options.appProjectRoot, '.babelrc')),
@@ -95,30 +81,30 @@ async function applicationGeneratorInternal(host, schema) {
95
81
  });
96
82
  }
97
83
  if (!options.skipPackageJson) {
98
- const reactVersions = await (0, version_utils_1.getReactDependenciesVersionsToInstall)(host);
84
+ const reactVersions = await (0, internal_3.getReactDependenciesVersionsToInstall)(host);
99
85
  const devDependencies = {
100
86
  '@types/react': reactVersions['@types/react'],
101
87
  '@types/react-dom': reactVersions['@types/react-dom'],
102
88
  };
103
89
  if (options.unitTestRunner && options.unitTestRunner !== 'none') {
104
- devDependencies['@testing-library/react'] = versions_1.testingLibraryReactVersion;
105
- devDependencies['@testing-library/dom'] = versions_1.testingLibraryDomVersion;
90
+ devDependencies['@testing-library/react'] = internal_2.testingLibraryReactVersion;
91
+ devDependencies['@testing-library/dom'] = internal_2.testingLibraryDomVersion;
106
92
  }
107
- tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_2.tsLibVersion }, devDependencies));
93
+ tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_1.tsLibVersion }, devDependencies, undefined, true));
108
94
  }
109
- (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
95
+ (0, internal_4.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
110
96
  jsx: 'preserve',
111
97
  module: 'esnext',
112
98
  moduleResolution: 'bundler',
113
99
  }, options.linter === 'eslint'
114
100
  ? ['.next', 'eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
115
101
  : ['.next'], options.src ? 'src' : '.');
116
- (0, sort_fields_1.sortPackageJsonFields)(host, options.appProjectRoot);
102
+ (0, internal_4.sortPackageJsonFields)(host, options.appProjectRoot);
117
103
  if (!options.skipFormat) {
118
104
  await (0, devkit_1.formatFiles)(host);
119
105
  }
120
106
  tasks.push(() => {
121
- (0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
107
+ (0, internal_1.logShowProjectCommand)(options.projectName);
122
108
  });
123
109
  return (0, devkit_1.runTasksInSerial)(...tasks);
124
110
  }
@@ -0,0 +1,15 @@
1
+ <%_ if (style !== 'none') { var wrapper = 'div'; _%>
2
+ import styles from './page.module.<%= style %>';
3
+ <% } else { var wrapper = 'div'; } %>
4
+ export default function Index() {
5
+ /*
6
+ * Replace the elements below with your own.
7
+ *
8
+ * Note: The corresponding styles are in the ./<%= fileName %>.<%= style %> file.
9
+ */
10
+ return (
11
+ <<%= wrapper %><% if (style !== 'none') {%> className={styles.page}<% } %>>
12
+ <%- appContent %>
13
+ </<%= wrapper %>>
14
+ );
15
+ };
@@ -0,0 +1,4 @@
1
+ {
2
+ "presets": ["@nx/next/babel"],
3
+ "plugins": []
4
+ }
@@ -4,10 +4,3 @@ declare module '*.svg' {
4
4
  export const ReactComponent: any;
5
5
  export default content;
6
6
  }
7
-
8
- <% if (style === 'less') { %>
9
- declare module '*.module.less' {
10
- const classes: { readonly [key: string]: string };
11
- export default classes;
12
- }
13
- <% } %>
@@ -0,0 +1,31 @@
1
+ //@ts-check
2
+ <% if (addPlugin) { -%>
3
+
4
+ /** @type {import('next').NextConfig} */
5
+ const nextConfig = {
6
+ // Next.js options go here
7
+ // See: https://nextjs.org/docs/app/api-reference/config/next-config-js
8
+ };
9
+
10
+ module.exports = nextConfig;
11
+ <% } else { -%>
12
+
13
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
14
+ const { composePlugins, withNx } = require('@nx/next');
15
+
16
+ /**
17
+ * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
18
+ **/
19
+ const nextConfig = {
20
+ // Use this to set Nx-specific options
21
+ // See: https://nx.dev/docs/technologies/react/next/Guides/next-config-setup
22
+ nx: {},
23
+ };
24
+
25
+ const plugins = [
26
+ // Add more Next.js plugins to this list if needed.
27
+ withNx,
28
+ ];
29
+
30
+ module.exports = composePlugins(...plugins)(nextConfig);
31
+ <% } -%>
@@ -2,7 +2,6 @@
2
2
  "extends": "<%= rootTsConfigPath %>",
3
3
  "compilerOptions": {
4
4
  "jsx": "preserve",
5
- <% if (style === '@emotion/styled') { %>"jsxImportSource": "@emotion/react",<% } %>
6
5
  "strict": true,
7
6
  "noEmit": true,
8
7
  "emitDeclarationOnly": false,
@@ -0,0 +1,18 @@
1
+ <%_ if (style !== 'none') { var wrapper = 'div'; _%>
2
+ import styles from './<%= fileName %>.module.<%= style %>';
3
+ <% } else { var wrapper = 'div'; } %>
4
+
5
+ export function Index() {
6
+ /*
7
+ * Replace the elements below with your own.
8
+ *
9
+ * Note: The corresponding styles are in the ./<%= fileName %>.<%= style %> file.
10
+ */
11
+ return (
12
+ <<%= wrapper %><% if (style !== 'none') {%> className={styles.page}<% } %>>
13
+ <%- appContent %>
14
+ </<%= wrapper %>>
15
+ );
16
+ }
17
+
18
+ export default Index;
@@ -1,4 +1,3 @@
1
1
  import { Tree, GeneratorCallback } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function addE2e(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
4
- //# sourceMappingURL=add-e2e.d.ts.map
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addE2e = addE2e;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
6
6
  const web_1 = require("@nx/web");
7
7
  const versions_1 = require("../../../utils/versions");
8
- const version_utils_1 = require("../../../utils/version-utils");
9
8
  async function addE2e(host, options) {
10
9
  const nxJson = (0, devkit_1.readNxJson)(host);
11
10
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
12
11
  ? p === '@nx/next/plugin'
13
12
  : p.plugin === '@nx/next/plugin');
14
13
  const e2eWebServerInfo = await getNextE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'next.config.js'), options.addPlugin);
15
- const forceWebpack = options.style === 'less' && (await (0, version_utils_1.isNext16)(host));
16
14
  if (options.e2eTestRunner === 'cypress') {
17
15
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
18
16
  if (!hasPlugin) {
@@ -56,7 +54,7 @@ async function addE2e(host, options) {
56
54
  baseUrl: e2eWebServerInfo.e2eWebServerAddress,
57
55
  jsx: true,
58
56
  webServerCommands: {
59
- default: `${e2eWebServerInfo.e2eWebServerCommand}${forceWebpack ? ' --webpack' : ''}`,
57
+ default: e2eWebServerInfo.e2eWebServerCommand,
60
58
  },
61
59
  ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
62
60
  ciBaseUrl: e2eWebServerInfo.e2eCiBaseUrl,
@@ -98,7 +96,7 @@ async function addE2e(host, options) {
98
96
  linter: options.linter,
99
97
  setParserOptionsProject: options.setParserOptionsProject,
100
98
  webServerAddress: e2eWebServerInfo.e2eCiBaseUrl,
101
- webServerCommand: `${e2eWebServerInfo.e2eWebServerCommand}${forceWebpack ? ' --webpack' : ''}`,
99
+ webServerCommand: e2eWebServerInfo.e2eWebServerCommand,
102
100
  addPlugin: options.addPlugin,
103
101
  });
104
102
  return e2eTask;
@@ -109,11 +107,11 @@ async function getNextE2EWebServerInfo(tree, projectName, configFilePath, isPlug
109
107
  const nxJson = (0, devkit_1.readNxJson)(tree);
110
108
  let e2ePort = isPluginBeingAdded ? 3000 : 4200;
111
109
  const defaultServeTarget = isPluginBeingAdded ? 'dev' : 'serve';
112
- if (nxJson.targetDefaults?.[defaultServeTarget] &&
113
- nxJson.targetDefaults?.[defaultServeTarget].options?.port) {
114
- e2ePort = nxJson.targetDefaults?.[defaultServeTarget].options?.port;
110
+ const serveTargetOptions = (0, internal_1.readTargetDefaultsForTarget)(defaultServeTarget, nxJson.targetDefaults)?.options;
111
+ if (serveTargetOptions?.port) {
112
+ e2ePort = serveTargetOptions.port;
115
113
  }
116
- return (0, e2e_web_server_info_utils_1.getE2EWebServerInfo)(tree, projectName, {
114
+ return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
117
115
  plugin: '@nx/next/plugin',
118
116
  serveTargetName: 'devTargetName',
119
117
  serveStaticTargetName: 'startTargetName',
@@ -1,4 +1,3 @@
1
1
  import { Tree, GeneratorCallback } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function addJest(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
4
- //# sourceMappingURL=add-jest.d.ts.map
@@ -1,4 +1,3 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { NormalizedSchema } from './normalize-options';
3
3
  export declare function addLinting(host: Tree, options: NormalizedSchema): Promise<GeneratorCallback>;
4
- //# sourceMappingURL=add-linting.d.ts.map