@nx/next 16.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +22 -0
  3. package/README.md +63 -0
  4. package/babel.d.ts +0 -0
  5. package/babel.js +13 -0
  6. package/babel.js.map +1 -0
  7. package/executors.json +36 -0
  8. package/generators.json +72 -0
  9. package/index.d.ts +8 -0
  10. package/index.js +20 -0
  11. package/index.js.map +1 -0
  12. package/migrations.json +312 -0
  13. package/package.json +64 -0
  14. package/plugins/with-less.d.ts +2 -0
  15. package/plugins/with-less.js +79 -0
  16. package/plugins/with-less.js.map +1 -0
  17. package/plugins/with-nx.d.ts +13 -0
  18. package/plugins/with-nx.js +278 -0
  19. package/plugins/with-nx.js.map +1 -0
  20. package/plugins/with-stylus.d.ts +2 -0
  21. package/plugins/with-stylus.js +79 -0
  22. package/plugins/with-stylus.js.map +1 -0
  23. package/src/executors/build/build.impl.d.ts +6 -0
  24. package/src/executors/build/build.impl.js +62 -0
  25. package/src/executors/build/build.impl.js.map +1 -0
  26. package/src/executors/build/compat.d.ts +2 -0
  27. package/src/executors/build/compat.js +6 -0
  28. package/src/executors/build/compat.js.map +1 -0
  29. package/src/executors/build/lib/check-project.d.ts +1 -0
  30. package/src/executors/build/lib/check-project.js +13 -0
  31. package/src/executors/build/lib/check-project.js.map +1 -0
  32. package/src/executors/build/lib/create-next-config-file.d.ts +3 -0
  33. package/src/executors/build/lib/create-next-config-file.js +15 -0
  34. package/src/executors/build/lib/create-next-config-file.js.map +1 -0
  35. package/src/executors/build/lib/update-package-json.d.ts +3 -0
  36. package/src/executors/build/lib/update-package-json.js +24 -0
  37. package/src/executors/build/lib/update-package-json.js.map +1 -0
  38. package/src/executors/build/schema.json +68 -0
  39. package/src/executors/export/compat.d.ts +2 -0
  40. package/src/executors/export/compat.js +6 -0
  41. package/src/executors/export/compat.js.map +1 -0
  42. package/src/executors/export/export.impl.d.ts +6 -0
  43. package/src/executors/export/export.impl.js +53 -0
  44. package/src/executors/export/export.impl.js.map +1 -0
  45. package/src/executors/export/schema.json +30 -0
  46. package/src/executors/server/compat.d.ts +2 -0
  47. package/src/executors/server/compat.js +6 -0
  48. package/src/executors/server/compat.js.map +1 -0
  49. package/src/executors/server/lib/default-server.d.ts +6 -0
  50. package/src/executors/server/lib/default-server.js +31 -0
  51. package/src/executors/server/lib/default-server.js.map +1 -0
  52. package/src/executors/server/lib/tsnode-register.d.ts +1 -0
  53. package/src/executors/server/lib/tsnode-register.js +23 -0
  54. package/src/executors/server/lib/tsnode-register.js.map +1 -0
  55. package/src/executors/server/schema.json +56 -0
  56. package/src/executors/server/server.impl.d.ts +7 -0
  57. package/src/executors/server/server.impl.js +114 -0
  58. package/src/executors/server/server.impl.js.map +1 -0
  59. package/src/generators/application/application.d.ts +4 -0
  60. package/src/generators/application/application.js +43 -0
  61. package/src/generators/application/application.js.map +1 -0
  62. package/src/generators/application/files/app/api/hello/route.ts__tmpl__ +4 -0
  63. package/src/generators/application/files/app/global.__stylesExt____tmpl__ +1 -0
  64. package/src/generators/application/files/app/layout.tsx__tmpl__ +22 -0
  65. package/src/generators/application/files/app/page.module.__style__ +1 -0
  66. package/src/generators/application/files/app/page.tsx__tmpl__ +28 -0
  67. package/src/generators/application/files/common/.babelrc__tmpl__ +21 -0
  68. package/src/generators/application/files/common/index.d.ts__tmpl__ +18 -0
  69. package/src/generators/application/files/common/next-env.d.ts__tmpl__ +5 -0
  70. package/src/generators/application/files/common/next.config.js__tmpl__ +112 -0
  71. package/src/generators/application/files/common/public/.gitkeep +0 -0
  72. package/src/generators/application/files/common/public/favicon.ico +0 -0
  73. package/src/generators/application/files/common/specs/__fileName__.spec.tsx__tmpl__ +11 -0
  74. package/src/generators/application/files/common/tsconfig.json__tmpl__ +18 -0
  75. package/src/generators/application/files/pages/__fileName__.module.__style__ +1 -0
  76. package/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +28 -0
  77. package/src/generators/application/files/pages/_app.tsx__tmpl__ +18 -0
  78. package/src/generators/application/files/pages/_document.tsx__tmpl__ +33 -0
  79. package/src/generators/application/files/pages/styles.__stylesExt____tmpl__ +1 -0
  80. package/src/generators/application/lib/add-cypress.d.ts +3 -0
  81. package/src/generators/application/lib/add-cypress.js +18 -0
  82. package/src/generators/application/lib/add-cypress.js.map +1 -0
  83. package/src/generators/application/lib/add-jest.d.ts +3 -0
  84. package/src/generators/application/lib/add-jest.js +36 -0
  85. package/src/generators/application/lib/add-jest.js.map +1 -0
  86. package/src/generators/application/lib/add-linting.d.ts +3 -0
  87. package/src/generators/application/lib/add-linting.js +66 -0
  88. package/src/generators/application/lib/add-linting.js.map +1 -0
  89. package/src/generators/application/lib/add-project.d.ts +3 -0
  90. package/src/generators/application/lib/add-project.js +56 -0
  91. package/src/generators/application/lib/add-project.js.map +1 -0
  92. package/src/generators/application/lib/create-application-files.d.ts +3 -0
  93. package/src/generators/application/lib/create-application-files.helpers.d.ts +2 -0
  94. package/src/generators/application/lib/create-application-files.helpers.js +785 -0
  95. package/src/generators/application/lib/create-application-files.helpers.js.map +1 -0
  96. package/src/generators/application/lib/create-application-files.js +40 -0
  97. package/src/generators/application/lib/create-application-files.js.map +1 -0
  98. package/src/generators/application/lib/normalize-options.d.ts +13 -0
  99. package/src/generators/application/lib/normalize-options.js +35 -0
  100. package/src/generators/application/lib/normalize-options.js.map +1 -0
  101. package/src/generators/application/lib/set-defaults.d.ts +3 -0
  102. package/src/generators/application/lib/set-defaults.js +14 -0
  103. package/src/generators/application/lib/set-defaults.js.map +1 -0
  104. package/src/generators/application/lib/update-jest-config.d.ts +3 -0
  105. package/src/generators/application/lib/update-jest-config.js +16 -0
  106. package/src/generators/application/lib/update-jest-config.js.map +1 -0
  107. package/src/generators/application/schema.d.ts +19 -0
  108. package/src/generators/application/schema.json +131 -0
  109. package/src/generators/component/component.d.ts +15 -0
  110. package/src/generators/component/component.js +34 -0
  111. package/src/generators/component/component.js.map +1 -0
  112. package/src/generators/component/schema.json +119 -0
  113. package/src/generators/custom-server/custom-server.d.ts +4 -0
  114. package/src/generators/custom-server/custom-server.js +79 -0
  115. package/src/generators/custom-server/custom-server.js.map +1 -0
  116. package/src/generators/custom-server/files/server/main.ts__tmpl__ +46 -0
  117. package/src/generators/custom-server/files/tsconfig.server.json__tmpl__ +15 -0
  118. package/src/generators/custom-server/schema.d.ts +4 -0
  119. package/src/generators/custom-server/schema.json +30 -0
  120. package/src/generators/init/init.d.ts +5 -0
  121. package/src/generators/init/init.js +49 -0
  122. package/src/generators/init/init.js.map +1 -0
  123. package/src/generators/init/schema.d.ts +7 -0
  124. package/src/generators/init/schema.json +39 -0
  125. package/src/generators/library/lib/normalize-options.d.ts +7 -0
  126. package/src/generators/library/lib/normalize-options.js +17 -0
  127. package/src/generators/library/lib/normalize-options.js.map +1 -0
  128. package/src/generators/library/library.d.ts +5 -0
  129. package/src/generators/library/library.js +79 -0
  130. package/src/generators/library/library.js.map +1 -0
  131. package/src/generators/library/schema.d.ts +25 -0
  132. package/src/generators/library/schema.json +156 -0
  133. package/src/generators/page/page.d.ts +5 -0
  134. package/src/generators/page/page.js +27 -0
  135. package/src/generators/page/page.js.map +1 -0
  136. package/src/generators/page/schema.d.ts +13 -0
  137. package/src/generators/page/schema.json +107 -0
  138. package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.d.ts +3 -0
  139. package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.js +34 -0
  140. package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.js.map +1 -0
  141. package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.d.ts +3 -0
  142. package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.js +26 -0
  143. package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.js.map +1 -0
  144. package/src/migrations/update-13-0-0/update-emotion-setup.d.ts +3 -0
  145. package/src/migrations/update-13-0-0/update-emotion-setup.js +39 -0
  146. package/src/migrations/update-13-0-0/update-emotion-setup.js.map +1 -0
  147. package/src/migrations/update-13-0-0/update-to-webpack-5.d.ts +3 -0
  148. package/src/migrations/update-13-0-0/update-to-webpack-5.js +32 -0
  149. package/src/migrations/update-13-0-0/update-to-webpack-5.js.map +1 -0
  150. package/src/migrations/update-13-0-3/fix-less.d.ts +3 -0
  151. package/src/migrations/update-13-0-3/fix-less.js +27 -0
  152. package/src/migrations/update-13-0-3/fix-less.js.map +1 -0
  153. package/src/migrations/update-13-1-1/enable-swc.d.ts +3 -0
  154. package/src/migrations/update-13-1-1/enable-swc.js +46 -0
  155. package/src/migrations/update-13-1-1/enable-swc.js.map +1 -0
  156. package/src/migrations/update-14-0-0/add-default-development-configurations.d.ts +3 -0
  157. package/src/migrations/update-14-0-0/add-default-development-configurations.js +36 -0
  158. package/src/migrations/update-14-0-0/add-default-development-configurations.js.map +1 -0
  159. package/src/migrations/update-14-4-3/add-dev-output-path.d.ts +3 -0
  160. package/src/migrations/update-14-4-3/add-dev-output-path.js +24 -0
  161. package/src/migrations/update-14-4-3/add-dev-output-path.js.map +1 -0
  162. package/src/migrations/update-14-5-3/add-gitignore-entry.d.ts +3 -0
  163. package/src/migrations/update-14-5-3/add-gitignore-entry.js +15 -0
  164. package/src/migrations/update-14-5-3/add-gitignore-entry.js.map +1 -0
  165. package/src/migrations/update-14-5-3/update-dev-output-path.d.ts +3 -0
  166. package/src/migrations/update-14-5-3/update-dev-output-path.js +29 -0
  167. package/src/migrations/update-14-5-3/update-dev-output-path.js.map +1 -0
  168. package/src/migrations/update-14-5-7/update-next-eslint.d.ts +3 -0
  169. package/src/migrations/update-14-5-7/update-next-eslint.js +32 -0
  170. package/src/migrations/update-14-5-7/update-next-eslint.js.map +1 -0
  171. package/src/migrations/update-15-8-8/add-style-packages.d.ts +3 -0
  172. package/src/migrations/update-15-8-8/add-style-packages.js +28 -0
  173. package/src/migrations/update-15-8-8/add-style-packages.js.map +1 -0
  174. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  175. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
  176. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
  177. package/src/utils/add-gitignore-entry.d.ts +2 -0
  178. package/src/utils/add-gitignore-entry.js +18 -0
  179. package/src/utils/add-gitignore-entry.js.map +1 -0
  180. package/src/utils/config-invalid-function.fixture.d.ts +0 -0
  181. package/src/utils/config-invalid-function.fixture.js +2 -0
  182. package/src/utils/config-invalid-function.fixture.js.map +1 -0
  183. package/src/utils/config-not-a-function.fixture.d.ts +0 -0
  184. package/src/utils/config-not-a-function.fixture.js +2 -0
  185. package/src/utils/config-not-a-function.fixture.js.map +1 -0
  186. package/src/utils/config.d.ts +15 -0
  187. package/src/utils/config.fixture.d.ts +0 -0
  188. package/src/utils/config.fixture.js +4 -0
  189. package/src/utils/config.fixture.js.map +1 -0
  190. package/src/utils/config.js +87 -0
  191. package/src/utils/config.js.map +1 -0
  192. package/src/utils/constants.d.ts +1 -0
  193. package/src/utils/constants.js +5 -0
  194. package/src/utils/constants.js.map +1 -0
  195. package/src/utils/create-copy-plugin.d.ts +2 -0
  196. package/src/utils/create-copy-plugin.js +63 -0
  197. package/src/utils/create-copy-plugin.js.map +1 -0
  198. package/src/utils/generate-globs.d.ts +5 -0
  199. package/src/utils/generate-globs.js +30 -0
  200. package/src/utils/generate-globs.js.map +1 -0
  201. package/src/utils/styles.d.ts +40 -0
  202. package/src/utils/styles.js +56 -0
  203. package/src/utils/styles.js.map +1 -0
  204. package/src/utils/types.d.ts +53 -0
  205. package/src/utils/types.js +3 -0
  206. package/src/utils/types.js.map +1 -0
  207. package/src/utils/versions.d.ts +9 -0
  208. package/src/utils/versions.js +13 -0
  209. package/src/utils/versions.js.map +1 -0
  210. package/tailwind.d.ts +2 -0
  211. package/tailwind.js +7 -0
  212. package/tailwind.js.map +1 -0
  213. package/typings/image.d.ts +12 -0
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fixPageDirForEslint = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function fixPageDirForEslint(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ projects.forEach((project) => {
10
+ var _a, _b;
11
+ const eslintRcJson = (0, devkit_1.joinPathFragments)(project.root, '.eslintrc.json');
12
+ if (host.exists(eslintRcJson)) {
13
+ const config = (0, devkit_1.readJson)(host, eslintRcJson);
14
+ // Ignore non-nextjs projects
15
+ if (!((_a = config === null || config === void 0 ? void 0 : config.extends) === null || _a === void 0 ? void 0 : _a.includes('next')))
16
+ return;
17
+ // Find the override that handles both TS and JS files.
18
+ const commonOverride = (_b = config.overrides) === null || _b === void 0 ? void 0 : _b.find((o) => ['*.ts', '*.tsx', '*.js', '*.jsx'].every((ext) => o.files.includes(ext)));
19
+ if (commonOverride &&
20
+ !commonOverride.rules['@next/next/no-html-link-for-pages']) {
21
+ commonOverride.rules = Object.assign(Object.assign({}, commonOverride.rules), { '@next/next/no-html-link-for-pages': [
22
+ 'error',
23
+ `${project.root}/pages`,
24
+ ] });
25
+ (0, devkit_1.writeJson)(host, eslintRcJson, config);
26
+ }
27
+ }
28
+ });
29
+ yield (0, devkit_1.formatFiles)(host);
30
+ });
31
+ }
32
+ exports.fixPageDirForEslint = fixPageDirForEslint;
33
+ exports.default = fixPageDirForEslint;
34
+ //# sourceMappingURL=fix-page-dir-for-eslint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-page-dir-for-eslint.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-12-10-0/fix-page-dir-for-eslint.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AAEpB,SAAsB,mBAAmB,CAAC,IAAU;;QAClD,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,MAAM,YAAY,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YACvE,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;gBAC7B,MAAM,MAAM,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBAC5C,6BAA6B;gBAC7B,IAAI,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;oBAAE,OAAO;gBAE/C,uDAAuD;gBACvD,MAAM,cAAc,GAAG,MAAA,MAAM,CAAC,SAAS,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAClD,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACzE,CAAC;gBAEF,IACE,cAAc;oBACd,CAAC,cAAc,CAAC,KAAK,CAAC,mCAAmC,CAAC,EAC1D;oBACA,cAAc,CAAC,KAAK,mCACf,cAAc,CAAC,KAAK,KACvB,mCAAmC,EAAE;4BACnC,OAAO;4BACP,GAAG,OAAO,CAAC,IAAI,QAAQ;yBACxB,GACF,CAAC;oBAEF,IAAA,kBAAS,EAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;iBACvC;aACF;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAjCD,kDAiCC;AAED,kBAAe,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function removeStyledJsxBabelConfig(host: Tree): Promise<void>;
3
+ export default removeStyledJsxBabelConfig;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeStyledJsxBabelConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function removeStyledJsxBabelConfig(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ projects.forEach((project) => {
10
+ const babelRcPath = (0, devkit_1.joinPathFragments)(project.root, '.babelrc');
11
+ if (host.exists(babelRcPath)) {
12
+ const babelRcContent = (0, devkit_1.readJson)(host, babelRcPath);
13
+ // check whether next.js project
14
+ if (babelRcContent.presets.includes('next/babel')) {
15
+ babelRcContent.plugins = babelRcContent.plugins.filter((x) => x !== 'styled-jsx/babel');
16
+ // update .babelrc
17
+ (0, devkit_1.writeJson)(host, babelRcPath, babelRcContent);
18
+ }
19
+ }
20
+ });
21
+ yield (0, devkit_1.formatFiles)(host);
22
+ });
23
+ }
24
+ exports.removeStyledJsxBabelConfig = removeStyledJsxBabelConfig;
25
+ exports.default = removeStyledJsxBabelConfig;
26
+ //# sourceMappingURL=remove-styled-jsx-babel-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-styled-jsx-babel-plugin.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AAEpB,SAAsB,0BAA0B,CAAC,IAAU;;QACzD,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,MAAM,WAAW,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAChE,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;gBAC5B,MAAM,cAAc,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;gBAEnD,gCAAgC;gBAChC,IAAI,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;oBACjD,cAAc,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CACpD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,kBAAkB,CAChC,CAAC;oBAEF,kBAAkB;oBAClB,IAAA,kBAAS,EAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;iBAC9C;aACF;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AArBD,gEAqBC;AAED,kBAAe,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function updateEmotionSetup(host: Tree): Promise<void>;
3
+ export default updateEmotionSetup;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateEmotionSetup = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function updateEmotionSetup(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ projects.forEach((p) => {
10
+ let hasEmotion = false;
11
+ const babelrcPath = `${p.root}/.babelrc`;
12
+ const tsConfigPath = `${p.root}/tsconfig.json`;
13
+ if (host.exists(babelrcPath)) {
14
+ const babelrc = (0, devkit_1.readJson)(host, babelrcPath);
15
+ if (babelrc.presets) {
16
+ for (const [idx, preset] of babelrc.presets.entries()) {
17
+ if (Array.isArray(preset)) {
18
+ if (!preset[0].includes('@nrwl/next/babel'))
19
+ continue;
20
+ const emotionOptions = preset[1]['preset-react'];
21
+ hasEmotion = (emotionOptions === null || emotionOptions === void 0 ? void 0 : emotionOptions.importSource) === '@emotion/react';
22
+ break;
23
+ }
24
+ }
25
+ }
26
+ }
27
+ if (hasEmotion && host.exists(tsConfigPath)) {
28
+ (0, devkit_1.updateJson)(host, tsConfigPath, (json) => {
29
+ json.compilerOptions.jsxImportSource = '@emotion/react';
30
+ return json;
31
+ });
32
+ }
33
+ });
34
+ yield (0, devkit_1.formatFiles)(host);
35
+ });
36
+ }
37
+ exports.updateEmotionSetup = updateEmotionSetup;
38
+ exports.default = updateEmotionSetup;
39
+ //# sourceMappingURL=update-emotion-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-emotion-setup.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-13-0-0/update-emotion-setup.ts"],"names":[],"mappings":";;;;AAAA,uCAMoB;AAEpB,SAAsB,kBAAkB,CAAC,IAAU;;QACjD,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACrB,IAAI,UAAU,GAAG,KAAK,CAAC;YACvB,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC;YACzC,MAAM,YAAY,GAAG,GAAG,CAAC,CAAC,IAAI,gBAAgB,CAAC;YAE/C,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;gBAC5B,MAAM,OAAO,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;gBAC5C,IAAI,OAAO,CAAC,OAAO,EAAE;oBACnB,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;wBACrD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;4BACzB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;gCAAE,SAAS;4BACtD,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;4BACjD,UAAU,GAAG,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,YAAY,MAAK,gBAAgB,CAAC;4BAC/D,MAAM;yBACP;qBACF;iBACF;aACF;YAED,IAAI,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;gBAC3C,IAAA,mBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;oBACtC,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,gBAAgB,CAAC;oBACxD,OAAO,IAAI,CAAC;gBACd,CAAC,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA/BD,gDA+BC;AAED,kBAAe,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
+ export declare function update(host: Tree): Promise<GeneratorCallback>;
3
+ export default update;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ let task = undefined;
10
+ projects.forEach((project) => {
11
+ const configPath = (0, devkit_1.joinPathFragments)(project.root, 'next.config.js');
12
+ if (!host.exists(configPath))
13
+ return;
14
+ const content = host.read(configPath).toString();
15
+ let updated = content.replace(/webpack5: false/, 'webpack5: true');
16
+ if (content.match(/@zeit\/next-less/)) {
17
+ updated = updated.replace('@zeit/next-less', 'next-with-less');
18
+ task = (0, devkit_1.addDependenciesToPackageJson)(host, { 'next-with-less': '1.0.1' }, {});
19
+ }
20
+ if (content.match(/@zeit\/next-stylus/)) {
21
+ updated = updated.replace('@zeit/next-stylus', '@nrwl/next/plugins/with-stylus');
22
+ task = (0, devkit_1.addDependenciesToPackageJson)(host, { 'stylus-loader': '6.2.0' }, {});
23
+ }
24
+ host.write(configPath, updated);
25
+ });
26
+ yield (0, devkit_1.formatFiles)(host);
27
+ return task;
28
+ });
29
+ }
30
+ exports.update = update;
31
+ exports.default = update;
32
+ //# sourceMappingURL=update-to-webpack-5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-to-webpack-5.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-13-0-0/update-to-webpack-5.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,IAAI,IAAI,GAAkC,SAAS,CAAC;QAEpD,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YAErE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;gBAAE,OAAO;YAErC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;YACjD,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;YAEnE,IAAI,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;gBACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;gBAC/D,IAAI,GAAG,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAC7B,EAAE,CACH,CAAC;aACH;YAED,IAAI,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE;gBACvC,OAAO,GAAG,OAAO,CAAC,OAAO,CACvB,mBAAmB,EACnB,gCAAgC,CACjC,CAAC;gBACF,IAAI,GAAG,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,eAAe,EAAE,OAAO,EAAE,EAC5B,EAAE,CACH,CAAC;aACH;YAED,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAvCD,wBAuCC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { GeneratorCallback, Tree } from '@nx/devkit';
2
+ export declare function update(host: Tree): Promise<GeneratorCallback>;
3
+ export default update;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ let task = undefined;
10
+ projects.forEach((project) => {
11
+ const configPath = (0, devkit_1.joinPathFragments)(project.root, 'next.config.js');
12
+ if (!host.exists(configPath))
13
+ return;
14
+ const content = host.read(configPath).toString();
15
+ if (content.match(/next-with-less/)) {
16
+ const updated = content.replace('next-with-less', '@nrwl/next/plugins/with-less');
17
+ task = (0, devkit_1.addDependenciesToPackageJson)(host, { 'less-loader': '10.2.0' }, {});
18
+ host.write(configPath, updated);
19
+ }
20
+ });
21
+ yield (0, devkit_1.formatFiles)(host);
22
+ return task;
23
+ });
24
+ }
25
+ exports.update = update;
26
+ exports.default = update;
27
+ //# sourceMappingURL=fix-less.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-less.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-13-0-3/fix-less.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,IAAI,IAAI,GAAkC,SAAS,CAAC;QAEpD,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YAErE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;gBAAE,OAAO;YAErC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;YAEjD,IAAI,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE;gBACnC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAC7B,gBAAgB,EAChB,8BAA8B,CAC/B,CAAC;gBACF,IAAI,GAAG,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,aAAa,EAAE,QAAQ,EAAE,EAC3B,EAAE,CACH,CAAC;gBACF,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;aACjC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AA5BD,wBA4BC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function update(host: Tree): Promise<void>;
3
+ export default update;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ projects.forEach((project) => {
10
+ const nextConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'next.config.js');
11
+ const jestConfigPath = (0, devkit_1.joinPathFragments)(project.root, 'jest.config.js');
12
+ const babelConfigPath = (0, devkit_1.joinPathFragments)(project.root, '.babelrc');
13
+ const storybookMainPath = (0, devkit_1.joinPathFragments)(project.root, '.storybook/main.js');
14
+ if (!host.exists(nextConfigPath) || !host.exists(jestConfigPath))
15
+ return;
16
+ if (host.exists(babelConfigPath)) {
17
+ if (customBabelConfig(host, babelConfigPath)) {
18
+ devkit_1.logger.info(`NX Custom .babelrc file detected, skipping deletion. You can delete this file yourself to enable SWC: ${babelConfigPath}`);
19
+ }
20
+ else if (host.exists(storybookMainPath)) {
21
+ devkit_1.logger.info(`NX Storybook configuration for project "${project.name}" detected, skipping deletion of .babelrc`);
22
+ }
23
+ else {
24
+ // Deleting custom babel config enables SWC
25
+ host.delete(babelConfigPath);
26
+ }
27
+ }
28
+ const content = host.read(jestConfigPath).toString();
29
+ if (content.match(/:\s+'babel-jest'/)) {
30
+ const updated = content.replace(/:\s+'babel-jest'/, `: ['babel-jest', { presets: ['@nrwl/next/babel'] }]`);
31
+ host.write(jestConfigPath, updated);
32
+ }
33
+ });
34
+ yield (0, devkit_1.formatFiles)(host);
35
+ });
36
+ }
37
+ exports.update = update;
38
+ function customBabelConfig(host, configPath) {
39
+ var _a, _b, _c;
40
+ const json = (0, devkit_1.readJson)(host, configPath);
41
+ return !(((_a = json.presets) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
42
+ ((_b = json.presets) === null || _b === void 0 ? void 0 : _b[0]) === '@nrwl/next/babel' &&
43
+ (((_c = json.plugins) === null || _c === void 0 ? void 0 : _c.length) === 0 || !json.plugins));
44
+ }
45
+ exports.default = update;
46
+ //# sourceMappingURL=enable-swc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enable-swc.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-13-1-1/enable-swc.ts"],"names":[],"mappings":";;;;AAAA,uCAOoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,MAAM,cAAc,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YACzE,MAAM,cAAc,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YACzE,MAAM,eAAe,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACpE,MAAM,iBAAiB,GAAG,IAAA,0BAAiB,EACzC,OAAO,CAAC,IAAI,EACZ,oBAAoB,CACrB,CAAC;YAEF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;gBAAE,OAAO;YAEzE,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;gBAChC,IAAI,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE;oBAC5C,eAAM,CAAC,IAAI,CACT,yGAAyG,eAAe,EAAE,CAC3H,CAAC;iBACH;qBAAM,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE;oBACzC,eAAM,CAAC,IAAI,CACT,2CAA2C,OAAO,CAAC,IAAI,2CAA2C,CACnG,CAAC;iBACH;qBAAM;oBACL,2CAA2C;oBAC3C,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;iBAC9B;aACF;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;YAErD,IAAI,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;gBACrC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAC7B,kBAAkB,EAClB,qDAAqD,CACtD,CAAC;gBACF,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;aACrC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAzCD,wBAyCC;AAED,SAAS,iBAAiB,CAAC,IAAI,EAAE,UAAU;;IACzC,MAAM,IAAI,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,CAAC,CACN,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,MAAK,CAAC;QAC1B,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAG,CAAC,CAAC,MAAK,kBAAkB;QACxC,CAAC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,MAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAC9C,CAAC;AACJ,CAAC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function update(tree: Tree): Promise<void>;
3
+ export default update;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ projects.forEach((config, name) => {
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11
+ var _l, _m, _o, _p, _q, _r;
12
+ let shouldUpdate = false;
13
+ if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/next:build') {
14
+ shouldUpdate = true;
15
+ (_c = (_l = config.targets.build).defaultConfiguration) !== null && _c !== void 0 ? _c : (_l.defaultConfiguration = 'production');
16
+ (_d = (_m = config.targets.build).configurations) !== null && _d !== void 0 ? _d : (_m.configurations = {});
17
+ (_e = (_o = config.targets.build.configurations).development) !== null && _e !== void 0 ? _e : (_o.development = {});
18
+ }
19
+ if (((_g = (_f = config.targets) === null || _f === void 0 ? void 0 : _f.serve) === null || _g === void 0 ? void 0 : _g.executor) === '@nrwl/next:server') {
20
+ shouldUpdate = true;
21
+ (_h = (_p = config.targets.serve).defaultConfiguration) !== null && _h !== void 0 ? _h : (_p.defaultConfiguration = 'development');
22
+ (_j = (_q = config.targets.serve).configurations) !== null && _j !== void 0 ? _j : (_q.configurations = {});
23
+ (_k = (_r = config.targets.serve.configurations).development) !== null && _k !== void 0 ? _k : (_r.development = {
24
+ buildTarget: `${name}:build:development`,
25
+ dev: true,
26
+ });
27
+ }
28
+ if (shouldUpdate)
29
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
30
+ });
31
+ yield (0, devkit_1.formatFiles)(tree);
32
+ });
33
+ }
34
+ exports.update = update;
35
+ exports.default = update;
36
+ //# sourceMappingURL=add-default-development-configurations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-default-development-configurations.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-0-0/add-default-development-configurations.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;;;YAChC,IAAI,YAAY,GAAG,KAAK,CAAC;YACzB,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;gBAC1D,YAAY,GAAG,IAAI,CAAC;gBACpB,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,oBAAoB,uCAApB,oBAAoB,GAAK,YAAY,EAAC;gBAC3D,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,cAAc,uCAAd,cAAc,GAAK,EAAE,EAAC;gBAC3C,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;aACxD;YAED,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,mBAAmB,EAAE;gBAC3D,YAAY,GAAG,IAAI,CAAC;gBACpB,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,oBAAoB,uCAApB,oBAAoB,GAAK,aAAa,EAAC;gBAC5D,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,cAAc,uCAAd,cAAc,GAAK,EAAE,EAAC;gBAC3C,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAC,WAAW,uCAAX,WAAW,GAAK;oBAClD,WAAW,EAAE,GAAG,IAAI,oBAAoB;oBACxC,GAAG,EAAE,IAAI;iBACV,EAAC;aACH;YAED,IAAI,YAAY;gBAAE,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA1BD,wBA0BC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function update(tree: Tree): Promise<void>;
3
+ export default update;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ projects.forEach((config, name) => {
10
+ var _a, _b, _c, _d, _e;
11
+ var _f, _g, _h;
12
+ if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/next:build') {
13
+ (_c = (_f = config.targets.build).configurations) !== null && _c !== void 0 ? _c : (_f.configurations = {});
14
+ (_d = (_g = config.targets.build.configurations).development) !== null && _d !== void 0 ? _d : (_g.development = {});
15
+ (_e = (_h = config.targets.build.configurations.development).outputPath) !== null && _e !== void 0 ? _e : (_h.outputPath = (0, devkit_1.joinPathFragments)('tmp', config.sourceRoot));
16
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
17
+ }
18
+ });
19
+ yield (0, devkit_1.formatFiles)(tree);
20
+ });
21
+ }
22
+ exports.update = update;
23
+ exports.default = update;
24
+ //# sourceMappingURL=add-dev-output-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-dev-output-path.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-4-3/add-dev-output-path.ts"],"names":[],"mappings":";;;;AAAA,uCAMoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;;;YAChC,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;gBAC1D,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,cAAc,uCAAd,cAAc,GAAK,EAAE,EAAC;gBAC3C,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;gBACvD,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,EAAC,UAAU,uCAAV,UAAU,GACxD,IAAA,0BAAiB,EAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,EAAC;gBAC9C,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;aAChD;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAdD,wBAcC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function update(tree: Tree): Promise<void>;
3
+ export default update;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const add_gitignore_entry_1 = require("../../utils/add-gitignore-entry");
7
+ function update(tree) {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ (0, add_gitignore_entry_1.addGitIgnoreEntry)(tree);
10
+ yield (0, devkit_1.formatFiles)(tree);
11
+ });
12
+ }
13
+ exports.update = update;
14
+ exports.default = update;
15
+ //# sourceMappingURL=add-gitignore-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-gitignore-entry.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-5-3/add-gitignore-entry.ts"],"names":[],"mappings":";;;;AAAA,uCAA+C;AAC/C,yEAAoE;AAEpE,SAAsB,MAAM,CAAC,IAAU;;QACrC,IAAA,uCAAiB,EAAC,IAAI,CAAC,CAAC;QACxB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAHD,wBAGC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function update(tree: Tree): Promise<void>;
3
+ export default update;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(tree);
9
+ projects.forEach((config, name) => {
10
+ var _a, _b, _c, _d;
11
+ var _e, _f;
12
+ if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/next:build') {
13
+ (_c = (_e = config.targets.build).configurations) !== null && _c !== void 0 ? _c : (_e.configurations = {});
14
+ (_d = (_f = config.targets.build.configurations).development) !== null && _d !== void 0 ? _d : (_f.development = {});
15
+ if (!config.targets.build.configurations.development.outputPath ||
16
+ config.targets.build.configurations.development.outputPath ===
17
+ (0, devkit_1.joinPathFragments)('tmp', config.root)) {
18
+ config.targets.build.configurations.development.outputPath =
19
+ config.root;
20
+ (0, devkit_1.updateProjectConfiguration)(tree, name, config);
21
+ }
22
+ }
23
+ });
24
+ yield (0, devkit_1.formatFiles)(tree);
25
+ });
26
+ }
27
+ exports.update = update;
28
+ exports.default = update;
29
+ //# sourceMappingURL=update-dev-output-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-dev-output-path.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-5-3/update-dev-output-path.ts"],"names":[],"mappings":";;;;AAAA,uCAMoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;;;YAChC,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAAE;gBAC1D,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,cAAc,uCAAd,cAAc,GAAK,EAAE,EAAC;gBAC3C,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAC,WAAW,uCAAX,WAAW,GAAK,EAAE,EAAC;gBACvD,IACE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;oBAC3D,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;wBACxD,IAAA,0BAAiB,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EACvC;oBACA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU;wBACxD,MAAM,CAAC,IAAI,CAAC;oBACd,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;iBAChD;aACF;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AApBD,wBAoBC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function updateNextEslint(host: Tree): Promise<void>;
3
+ export default updateNextEslint;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateNextEslint = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function updateNextEslint(host) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const projects = (0, devkit_1.getProjects)(host);
9
+ projects.forEach((project) => {
10
+ var _a, _b;
11
+ if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/next:build')
12
+ return;
13
+ const eslintPath = `${project.root}/.eslintrc.json`;
14
+ if (!host.exists(eslintPath))
15
+ return;
16
+ (0, devkit_1.updateJson)(host, eslintPath, (eslintConfig) => {
17
+ const nextIgnorePattern = '.next/**/*';
18
+ if (eslintConfig.ignorePatterns.indexOf(nextIgnorePattern) < 0) {
19
+ eslintConfig.ignorePatterns = [
20
+ ...eslintConfig.ignorePatterns,
21
+ nextIgnorePattern,
22
+ ];
23
+ }
24
+ return eslintConfig;
25
+ });
26
+ });
27
+ yield (0, devkit_1.formatFiles)(host);
28
+ });
29
+ }
30
+ exports.updateNextEslint = updateNextEslint;
31
+ exports.default = updateNextEslint;
32
+ //# sourceMappingURL=update-next-eslint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-next-eslint.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-14-5-7/update-next-eslint.ts"],"names":[],"mappings":";;;;AAAA,uCAAwE;AAExE,SAAsB,gBAAgB,CAAC,IAAU;;QAC/C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,IAAI,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB;gBAAE,OAAO;YAEpE,MAAM,UAAU,GAAG,GAAG,OAAO,CAAC,IAAI,iBAAiB,CAAC;YAEpD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;gBAAE,OAAO;YAErC,IAAA,mBAAU,EAAC,IAAI,EAAE,UAAU,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC5C,MAAM,iBAAiB,GAAG,YAAY,CAAC;gBAEvC,IAAI,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE;oBAC9D,YAAY,CAAC,cAAc,GAAG;wBAC5B,GAAG,YAAY,CAAC,cAAc;wBAC9B,iBAAiB;qBAClB,CAAC;iBACH;gBACD,OAAO,YAAY,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAvBD,4CAuBC;AAED,kBAAe,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function update(tree: Tree): Promise<import("@nx/devkit").GeneratorCallback>;
3
+ export default update;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function update(tree) {
7
+ var _a, _b;
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ const projects = (0, devkit_1.getProjects)(tree);
10
+ const missingDeps = {};
11
+ for (const [, config] of projects) {
12
+ if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/next:build' &&
13
+ tree.exists((0, devkit_1.joinPathFragments)(config.root, 'next.config.js'))) {
14
+ const nextConfigContent = tree.read((0, devkit_1.joinPathFragments)(config.root, 'next.config.js'), 'utf-8');
15
+ if (nextConfigContent.includes('@nrwl/next/plugins/with-less')) {
16
+ missingDeps['less'] = '3.12.2';
17
+ }
18
+ if (nextConfigContent.includes('@nrwl/next/plugins/with-stylus')) {
19
+ missingDeps['stylus'] = '^0.55.0';
20
+ }
21
+ }
22
+ }
23
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, missingDeps);
24
+ });
25
+ }
26
+ exports.update = update;
27
+ exports.default = update;
28
+ //# sourceMappingURL=add-style-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-style-packages.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-15-8-8/add-style-packages.ts"],"names":[],"mappings":";;;;AAAA,uCAKoB;AAEpB,SAAsB,MAAM,CAAC,IAAU;;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,QAAQ,EAAE;YACjC,IACE,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB;gBACtD,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,EAC7D;gBACA,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CACjC,IAAA,0BAAiB,EAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAChD,OAAO,CACR,CAAC;gBAEF,IAAI,iBAAiB,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE;oBAC9D,WAAW,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;iBAChC;gBAED,IAAI,iBAAiB,CAAC,QAAQ,CAAC,gCAAgC,CAAC,EAAE;oBAChE,WAAW,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;iBACnC;aACF;SACF;QAED,OAAO,IAAA,qCAA4B,EAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;;CAC5D;AAzBD,wBAyBC;AAED,kBAAe,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function replacePackage(tree: Tree): Promise<void>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
+ function replacePackage(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/next', '@nx/next');
9
+ yield (0, devkit_1.formatFiles)(tree);
10
+ });
11
+ }
12
+ exports.default = replacePackage;
13
+ //# sourceMappingURL=update-16-0-0-add-nx-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-16-0-0-add-nx-packages.js","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAC/C,0EAAuF;AAEvF,SAA8B,cAAc,CAAC,IAAU;;QACrD,MAAM,IAAA,iDAA+B,EAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;QAEtE,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAJD,iCAIC"}
@@ -0,0 +1,2 @@
1
+ import { Tree } from 'nx/src/generators/tree';
2
+ export declare function addGitIgnoreEntry(host: Tree): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addGitIgnoreEntry = void 0;
4
+ const ignore_1 = require("ignore");
5
+ function addGitIgnoreEntry(host) {
6
+ if (!host.exists('.gitignore')) {
7
+ return;
8
+ }
9
+ let content = host.read('.gitignore', 'utf-8').trimEnd();
10
+ const ig = (0, ignore_1.default)();
11
+ ig.add(host.read('.gitignore', 'utf-8'));
12
+ if (!ig.ignores('apps/example/.next')) {
13
+ content = `${content}\n\n# Next.js\n.next\n`;
14
+ }
15
+ host.write('.gitignore', content);
16
+ }
17
+ exports.addGitIgnoreEntry = addGitIgnoreEntry;
18
+ //# sourceMappingURL=add-gitignore-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-gitignore-entry.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/add-gitignore-entry.ts"],"names":[],"mappings":";;;AACA,mCAA4B;AAE5B,SAAgB,iBAAiB,CAAC,IAAU;IAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;QAC9B,OAAO;KACR;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IAEzD,MAAM,EAAE,GAAG,IAAA,gBAAM,GAAE,CAAC;IACpB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE;QACrC,OAAO,GAAG,GAAG,OAAO,wBAAwB,CAAC;KAC9C;IAED,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC;AAfD,8CAeC"}
File without changes
@@ -0,0 +1,2 @@
1
+ module.exports = () => { };
2
+ //# sourceMappingURL=config-invalid-function.fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-invalid-function.fixture.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/config-invalid-function.fixture.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC"}
File without changes
@@ -0,0 +1,2 @@
1
+ module.exports = 'BAD';
2
+ //# sourceMappingURL=config-not-a-function.fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-not-a-function.fixture.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/config-not-a-function.fixture.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { NextConfig } from 'next';
2
+ import { Configuration } from 'webpack';
3
+ import { FileReplacement } from './types';
4
+ import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
5
+ export declare function createWebpackConfig(workspaceRoot: string, projectRoot: string, fileReplacements?: FileReplacement[], assets?: any, dependencies?: DependentBuildableProjectNode[], libsDir?: string): (a: any, b: any) => Configuration;
6
+ export interface NextConfigFn {
7
+ (phase: string, context?: any): Promise<NextConfig> | NextConfig;
8
+ }
9
+ export interface NextPlugin {
10
+ (config: NextConfig): NextConfig;
11
+ }
12
+ export interface NextPluginThatReturnsConfigFn {
13
+ (config: NextConfig): NextConfigFn;
14
+ }
15
+ export declare function composePlugins(...plugins: (NextPlugin | NextPluginThatReturnsConfigFn)[]): (baseConfig: NextConfig) => NextConfigFn;
File without changes
@@ -0,0 +1,4 @@
1
+ module.exports = (phase, config, context) => {
2
+ return Object.assign(Object.assign({}, config), { myPhase: phase, myCustomValue: context.options.customValue });
3
+ };
4
+ //# sourceMappingURL=config.fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.fixture.js","sourceRoot":"","sources":["../../../../../packages/next/src/utils/config.fixture.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAC1C,uCACK,MAAM,KACT,OAAO,EAAE,KAAK,EACd,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,IAC1C;AACJ,CAAC,CAAC"}