@nx/next 23.0.0-pr.35465.2bc2643 → 23.0.0-rc.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.
- package/dist/babel.d.ts +1 -0
- package/{babel.js → dist/babel.js} +2 -0
- package/{index.d.ts → dist/index.d.ts} +0 -2
- package/{index.js → dist/index.js} +1 -3
- package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
- package/{plugins → dist/plugins}/component-testing.d.ts +0 -1
- package/{plugins → dist/plugins}/component-testing.js +22 -16
- package/{plugins → dist/plugins}/with-less.d.ts +0 -1
- package/{plugins → dist/plugins}/with-nx.d.ts +0 -1
- package/{plugins → dist/plugins}/with-nx.js +11 -45
- package/{src → dist/src}/executors/build/build.impl.d.ts +0 -1
- package/{src → dist/src}/executors/build/build.impl.js +3 -2
- package/{src → dist/src}/executors/build/lib/check-project.d.ts +0 -1
- package/{src → dist/src}/executors/build/lib/create-next-config-file.d.ts +0 -1
- package/{src → dist/src}/executors/build/lib/update-package-json.d.ts +0 -1
- package/{src → dist/src}/executors/build/schema.json +1 -0
- package/{src → dist/src}/executors/server/custom-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/server/schema.json +1 -0
- package/{src → dist/src}/executors/server/server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/server/server.impl.js +6 -4
- package/{src → dist/src}/generators/application/application.d.ts +0 -1
- package/{src → dist/src}/generators/application/application.js +16 -30
- package/dist/src/generators/application/files/app/page.tsx__tmpl__ +15 -0
- package/dist/src/generators/application/files/common/__dot__babelrc +4 -0
- package/{src → dist/src}/generators/application/files/common/index.d.ts__tmpl__ +0 -7
- package/dist/src/generators/application/files/common/next.config.js__tmpl__ +31 -0
- package/{src → dist/src}/generators/application/files/common/tsconfig.json__tmpl__ +0 -1
- package/dist/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +18 -0
- package/{src → dist/src}/generators/application/lib/add-e2e.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-e2e.js +7 -9
- package/{src → dist/src}/generators/application/lib/add-jest.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-linting.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-linting.js +13 -14
- package/{src → dist/src}/generators/application/lib/add-plugin.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-project.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-project.js +4 -2
- package/{src → dist/src}/generators/application/lib/create-application-files.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/create-application-files.helpers.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/create-application-files.js +5 -24
- package/{src → dist/src}/generators/application/lib/normalize-options.d.ts +0 -2
- package/{src → dist/src}/generators/application/lib/normalize-options.js +7 -11
- package/{src → dist/src}/generators/application/lib/set-defaults.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/update-cypress-tsconfig.d.ts +0 -1
- package/{src → dist/src}/generators/application/schema.json +2 -21
- package/{src → dist/src}/generators/component/component.d.ts +0 -1
- package/{src → dist/src}/generators/component/component.js +4 -2
- package/{src → dist/src}/generators/component/schema.json +2 -21
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +6 -5
- package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +1 -2
- package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.js +6 -6
- package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts +1 -3
- package/{src → dist/src}/generators/convert-to-inferred/lib/update-next-config.d.ts +1 -2
- package/{src → dist/src}/generators/convert-to-inferred/lib/utils.d.ts +0 -1
- package/{src → dist/src}/generators/custom-server/custom-server.d.ts +0 -1
- package/{src → dist/src}/generators/custom-server/custom-server.js +11 -5
- package/{src → dist/src}/generators/cypress-component-configuration/cypress-component-configuration.d.ts +0 -1
- package/{src → dist/src}/generators/cypress-component-configuration/cypress-component-configuration.js +11 -42
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.js +10 -41
- package/{src → dist/src}/generators/init/schema.json +1 -1
- package/{src → dist/src}/generators/library/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/generators/library/lib/normalize-options.js +5 -5
- package/{src → dist/src}/generators/library/lib/update-vite-config.d.ts +0 -1
- package/{src → dist/src}/generators/library/library.d.ts +0 -1
- package/{src → dist/src}/generators/library/library.js +18 -23
- package/{src → dist/src}/generators/library/schema.json +2 -21
- package/{src → dist/src}/generators/page/page.d.ts +0 -1
- package/{src → dist/src}/generators/page/page.js +9 -6
- package/{src → dist/src}/generators/page/schema.json +2 -17
- package/{src → dist/src}/migrations/update-22-0-0/add-svgr-to-next-config.d.ts +0 -1
- package/{src → dist/src}/migrations/update-22-0-0/add-svgr-to-next-config.js +2 -2
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +223 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
- package/{src → dist/src}/plugins/plugin.d.ts +3 -4
- package/{src → dist/src}/plugins/plugin.js +63 -35
- package/{src → dist/src}/utils/add-gitignore-entry.d.ts +0 -1
- package/{src → dist/src}/utils/add-swc-to-custom-server.d.ts +0 -1
- package/{src → dist/src}/utils/add-swc-to-custom-server.js +7 -8
- package/dist/src/utils/assert-supported-next-version.d.ts +2 -0
- package/dist/src/utils/assert-supported-next-version.js +8 -0
- package/{src → dist/src}/utils/compose-plugins.d.ts +0 -1
- package/{src → dist/src}/utils/compose-plugins.js +2 -0
- package/dist/src/utils/config-invalid-function.fixture.d.ts +1 -0
- package/dist/src/utils/config-invalid-function.fixture.js +3 -0
- package/dist/src/utils/config-not-a-function.fixture.d.ts +1 -0
- package/{src/generators/setup-tailwind/schema.js → dist/src/utils/config-not-a-function.fixture.js} +1 -0
- package/{src → dist/src}/utils/config.d.ts +0 -1
- package/{src → dist/src}/utils/constants.d.ts +0 -1
- package/{src → dist/src}/utils/create-cli-options.d.ts +0 -1
- package/{src → dist/src}/utils/create-copy-plugin.d.ts +0 -1
- package/dist/src/utils/deprecation.d.ts +12 -0
- package/dist/src/utils/deprecation.js +60 -0
- package/{src → dist/src}/utils/jest-config-util.d.ts +0 -1
- package/{src → dist/src}/utils/runtime-version-utils.d.ts +0 -1
- package/dist/src/utils/styles.d.ts +5 -0
- package/dist/src/utils/styles.js +21 -0
- package/{src → dist/src}/utils/types.d.ts +0 -1
- package/{src → dist/src}/utils/version-utils.d.ts +0 -1
- package/dist/src/utils/versions.d.ts +12 -0
- package/dist/src/utils/versions.js +16 -0
- package/dist/tailwind.d.ts +5 -0
- package/dist/tailwind.js +66 -0
- package/dist/typings/image.d.ts +12 -0
- package/executors.json +4 -4
- package/generators.json +16 -16
- package/migrations.json +8 -35
- package/package.json +96 -16
- package/babel.d.ts +0 -1
- package/babel.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/plugin.d.ts.map +0 -1
- package/plugins/component-testing.d.ts.map +0 -1
- package/plugins/with-less.d.ts.map +0 -1
- package/plugins/with-nx.d.ts.map +0 -1
- package/src/executors/build/build.impl.d.ts.map +0 -1
- package/src/executors/build/lib/check-project.d.ts.map +0 -1
- package/src/executors/build/lib/create-next-config-file.d.ts.map +0 -1
- package/src/executors/build/lib/update-package-json.d.ts.map +0 -1
- package/src/executors/server/custom-server.impl.d.ts.map +0 -1
- package/src/executors/server/server.impl.d.ts.map +0 -1
- package/src/generators/application/application.d.ts.map +0 -1
- package/src/generators/application/files/app/page.tsx__tmpl__ +0 -27
- package/src/generators/application/files/app-styled-components/layout.tsx__tmpl__ +0 -21
- package/src/generators/application/files/app-styled-components/registry.tsx__tmpl__ +0 -33
- package/src/generators/application/files/app-styled-jsx/layout.tsx__tmpl__ +0 -16
- package/src/generators/application/files/app-styled-jsx/registry.tsx__tmpl__ +0 -23
- package/src/generators/application/files/common/__dot__babelrc +0 -21
- package/src/generators/application/files/common/next.config.js__tmpl__ +0 -76
- package/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +0 -27
- package/src/generators/application/files/pages/_document.tsx__tmpl__ +0 -33
- package/src/generators/application/lib/add-e2e.d.ts.map +0 -1
- package/src/generators/application/lib/add-jest.d.ts.map +0 -1
- package/src/generators/application/lib/add-linting.d.ts.map +0 -1
- package/src/generators/application/lib/add-plugin.d.ts.map +0 -1
- package/src/generators/application/lib/add-project.d.ts.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts.map +0 -1
- package/src/generators/application/lib/create-application-files.helpers.d.ts.map +0 -1
- package/src/generators/application/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/application/lib/set-defaults.d.ts.map +0 -1
- package/src/generators/application/lib/show-possible-warnings.d.ts +0 -4
- package/src/generators/application/lib/show-possible-warnings.d.ts.map +0 -1
- package/src/generators/application/lib/show-possible-warnings.js +0 -9
- package/src/generators/application/lib/update-cypress-tsconfig.d.ts.map +0 -1
- package/src/generators/component/component.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/update-next-config.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/utils.d.ts.map +0 -1
- package/src/generators/custom-server/custom-server.d.ts.map +0 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +0 -1
- package/src/generators/init/init.d.ts.map +0 -1
- package/src/generators/library/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/library/lib/update-vite-config.d.ts.map +0 -1
- package/src/generators/library/library.d.ts.map +0 -1
- package/src/generators/page/page.d.ts.map +0 -1
- package/src/generators/setup-tailwind/files/postcss.config.js__tmpl__ +0 -15
- package/src/generators/setup-tailwind/files/tailwind.config.js__tmpl__ +0 -23
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +0 -27
- package/src/generators/setup-tailwind/lib/update-project.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/update-project.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/update-project.js +0 -11
- package/src/generators/setup-tailwind/schema.d.ts +0 -7
- package/src/generators/setup-tailwind/schema.d.ts.map +0 -1
- package/src/generators/setup-tailwind/schema.json +0 -47
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
- package/src/generators/setup-tailwind/setup-tailwind.d.ts.map +0 -1
- package/src/generators/setup-tailwind/setup-tailwind.js +0 -35
- package/src/migrations/update-22-0-0/add-svgr-to-next-config.d.ts.map +0 -1
- package/src/migrations/update-22-2-0/create-ai-instructions-for-next-16.d.ts +0 -3
- package/src/migrations/update-22-2-0/create-ai-instructions-for-next-16.d.ts.map +0 -1
- package/src/migrations/update-22-2-0/create-ai-instructions-for-next-16.js +0 -16
- package/src/plugins/plugin.d.ts.map +0 -1
- package/src/utils/add-gitignore-entry.d.ts.map +0 -1
- package/src/utils/add-swc-to-custom-server.d.ts.map +0 -1
- package/src/utils/compose-plugins.d.ts.map +0 -1
- package/src/utils/config-invalid-function.fixture.d.ts +0 -1
- package/src/utils/config-invalid-function.fixture.d.ts.map +0 -1
- package/src/utils/config-invalid-function.fixture.js +0 -1
- package/src/utils/config-not-a-function.fixture.d.ts +0 -1
- package/src/utils/config-not-a-function.fixture.d.ts.map +0 -1
- package/src/utils/config-not-a-function.fixture.js +0 -1
- package/src/utils/config.d.ts.map +0 -1
- package/src/utils/constants.d.ts.map +0 -1
- package/src/utils/create-cli-options.d.ts.map +0 -1
- package/src/utils/create-copy-plugin.d.ts.map +0 -1
- package/src/utils/generate-globs.d.ts +0 -6
- package/src/utils/generate-globs.d.ts.map +0 -1
- package/src/utils/generate-globs.js +0 -28
- package/src/utils/jest-config-util.d.ts.map +0 -1
- package/src/utils/runtime-version-utils.d.ts.map +0 -1
- package/src/utils/styles.d.ts +0 -68
- package/src/utils/styles.d.ts.map +0 -1
- package/src/utils/styles.js +0 -67
- package/src/utils/types.d.ts.map +0 -1
- package/src/utils/version-utils.d.ts.map +0 -1
- package/src/utils/versions.d.ts +0 -15
- package/src/utils/versions.d.ts.map +0 -1
- package/src/utils/versions.js +0 -17
- package/tailwind.d.ts +0 -8
- package/tailwind.d.ts.map +0 -1
- package/tailwind.js +0 -41
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{plugin.js → dist/plugin.js} +0 -0
- /package/{plugins → dist/plugins}/with-less.js +0 -0
- /package/{src → dist/src}/executors/build/lib/check-project.js +0 -0
- /package/{src → dist/src}/executors/build/lib/create-next-config-file.js +0 -0
- /package/{src → dist/src}/executors/build/lib/update-package-json.js +0 -0
- /package/{src → dist/src}/executors/server/custom-server.impl.js +0 -0
- /package/{src → dist/src}/generators/application/files/app/api/hello/route.ts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/app/global.__stylesExt____tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/app/page.module.__style__ +0 -0
- /package/{src → dist/src}/generators/application/files/app-default-layout/layout.tsx__tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/common/next-env.d.ts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/common/public/.gitkeep +0 -0
- /package/{src → dist/src}/generators/application/files/common/public/favicon.ico +0 -0
- /package/{src → dist/src}/generators/application/files/common/specs/__fileName__.spec.tsx__tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/pages/__fileName__.module.__style__ +0 -0
- /package/{src → dist/src}/generators/application/files/pages/_app.tsx__tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/pages/styles.__stylesExt____tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/lib/add-jest.js +0 -0
- /package/{src → dist/src}/generators/application/lib/add-plugin.js +0 -0
- /package/{src → dist/src}/generators/application/lib/create-application-files.helpers.js +0 -0
- /package/{src → dist/src}/generators/application/lib/set-defaults.js +0 -0
- /package/{src → dist/src}/generators/application/lib/update-cypress-tsconfig.js +0 -0
- /package/{src → dist/src}/generators/application/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-tranformer.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/lib/update-next-config.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/lib/utils.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
- /package/{src → dist/src}/generators/custom-server/files/server/main.ts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/custom-server/files/tsconfig.server.json__tmpl__ +0 -0
- /package/{src → dist/src}/generators/custom-server/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/custom-server/schema.json +0 -0
- /package/{src → dist/src}/generators/cypress-component-configuration/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/cypress-component-configuration/schema.json +0 -0
- /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/library/lib/update-vite-config.js +0 -0
- /package/{src → dist/src}/generators/library/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/page/schema.d.ts +0 -0
- /package/{src/migrations/update-22-2-0/files → dist/src/migrations/update-22-2-0}/ai-instructions-for-next-16.md +0 -0
- /package/{src → dist/src}/utils/add-gitignore-entry.js +0 -0
- /package/{src → dist/src}/utils/config.js +0 -0
- /package/{src → dist/src}/utils/constants.js +0 -0
- /package/{src → dist/src}/utils/create-cli-options.js +0 -0
- /package/{src → dist/src}/utils/create-copy-plugin.js +0 -0
- /package/{src → dist/src}/utils/jest-config-util.js +0 -0
- /package/{src → dist/src}/utils/runtime-version-utils.js +0 -0
- /package/{src → dist/src}/utils/types.js +0 -0
- /package/{src → dist/src}/utils/version-utils.js +0 -0
package/dist/babel.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 =
|
|
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");
|
|
@@ -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
|
|
5
|
+
const internal_1 = require("@nx/cypress/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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}',
|
|
@@ -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 } =
|
|
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 {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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,
|
|
@@ -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,
|
|
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
|
}
|
|
@@ -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",
|
|
@@ -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",
|
|
@@ -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
|
|
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,
|
|
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,
|
|
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
|
|
8
|
-
const
|
|
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
|
|
22
|
-
const
|
|
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,
|
|
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,
|
|
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,
|
|
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'] =
|
|
105
|
-
devDependencies['@testing-library/dom'] =
|
|
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:
|
|
93
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_1.tsLibVersion }, devDependencies, undefined, true));
|
|
108
94
|
}
|
|
109
|
-
(0,
|
|
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,
|
|
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,
|
|
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,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
|
+
<% } -%>
|
|
@@ -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,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:
|
|
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:
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
e2ePort =
|
|
110
|
+
const serveTargetOptions = (0, internal_1.readTargetDefaultsForTarget)(defaultServeTarget, nxJson.targetDefaults)?.options;
|
|
111
|
+
if (serveTargetOptions?.port) {
|
|
112
|
+
e2ePort = serveTargetOptions.port;
|
|
115
113
|
}
|
|
116
|
-
return (0,
|
|
114
|
+
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
117
115
|
plugin: '@nx/next/plugin',
|
|
118
116
|
serveTargetName: 'devTargetName',
|
|
119
117
|
serveStaticTargetName: 'startTargetName',
|