@nx/next 23.0.0-beta.23 → 23.0.0-beta.25
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 -1
- 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 +16 -10
- 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 +1 -34
- package/{src → dist/src}/executors/build/build.impl.d.ts +0 -1
- 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/server/custom-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/server/server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/server/server.impl.js +2 -2
- package/{src → dist/src}/generators/application/application.d.ts +0 -1
- package/{src → dist/src}/generators/application/application.js +14 -12
- package/{src → dist/src}/generators/application/lib/add-e2e.d.ts +0 -1
- 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 +4 -4
- 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/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/normalize-options.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/normalize-options.js +2 -2
- 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/component/component.d.ts +0 -1
- package/{src → dist/src}/generators/component/component.js +2 -0
- 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 +2 -0
- package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/lib/update-next-config.d.ts +0 -1
- 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 +2 -0
- 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 +7 -38
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.js +8 -39
- 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/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 -16
- package/{src → dist/src}/generators/page/page.d.ts +0 -1
- package/{src → dist/src}/generators/page/page.js +2 -0
- package/{src → dist/src}/migrations/update-22-0-0/add-svgr-to-next-config.d.ts +0 -1
- package/dist/src/migrations/update-22-2-0/ai-instructions-for-next-16.md +845 -0
- 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 +134 -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 +0 -1
- package/{src → dist/src}/plugins/plugin.js +4 -2
- 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 +1 -1
- 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/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/dist/src/utils/config-not-a-function.fixture.js +3 -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/{src → dist/src}/utils/deprecation.d.ts +0 -1
- 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/{src → dist/src}/utils/styles.d.ts +0 -1
- package/{src → dist/src}/utils/styles.js +1 -1
- package/{src → dist/src}/utils/types.d.ts +0 -1
- package/{src → dist/src}/utils/version-utils.d.ts +0 -1
- package/{src → dist/src}/utils/versions.d.ts +5 -5
- package/{src → dist/src}/utils/versions.js +8 -6
- package/{tailwind.d.ts → dist/tailwind.d.ts} +0 -1
- 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 +94 -14
- 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/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/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/migrations/update-22-0-0/add-svgr-to-next-config.d.ts.map +0 -1
- 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/deprecation.d.ts.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- package/tailwind.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{index.js → dist/index.js} +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/build.impl.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/build/schema.json +0 -0
- /package/{src → dist/src}/executors/server/custom-server.impl.js +0 -0
- /package/{src → dist/src}/executors/server/schema.json +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/page.tsx__tmpl__ +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/__dot__babelrc +0 -0
- /package/{src → dist/src}/generators/application/files/common/index.d.ts__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/next.config.js__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/common/tsconfig.json__tmpl__ +0 -0
- /package/{src → dist/src}/generators/application/files/pages/__fileName__.module.__style__ +0 -0
- /package/{src → dist/src}/generators/application/files/pages/__fileName__.tsx__tmpl__ +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-e2e.js +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/add-project.js +0 -0
- /package/{src → dist/src}/generators/application/lib/create-application-files.helpers.js +0 -0
- /package/{src → dist/src}/generators/application/lib/create-application-files.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/application/schema.json +0 -0
- /package/{src → dist/src}/generators/component/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.js +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/normalize-options.js +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/library/schema.json +0 -0
- /package/{src → dist/src}/generators/page/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/page/schema.json +0 -0
- /package/{src → dist/src}/migrations/update-22-0-0/add-svgr-to-next-config.js +0 -0
- /package/{src → dist/src}/utils/add-gitignore-entry.js +0 -0
- /package/{src → dist/src}/utils/compose-plugins.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/deprecation.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/{tailwind.js → dist/tailwind.js} +0 -0
package/dist/babel.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,4 +5,3 @@ export { libraryGenerator } from './src/generators/library/library';
|
|
|
5
5
|
export { pageGenerator } from './src/generators/page/page';
|
|
6
6
|
export { withNx } from './plugins/with-nx';
|
|
7
7
|
export { composePlugins } from './src/utils/compose-plugins';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,7 +6,9 @@ const internal_1 = require("@nx/cypress/internal");
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
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) {
|
|
@@ -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.
|
|
@@ -8,7 +8,7 @@ const path_1 = require("path");
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
const custom_server_impl_1 = tslib_1.__importDefault(require("./custom-server.impl"));
|
|
10
10
|
const create_cli_options_1 = require("../../utils/create-cli-options");
|
|
11
|
-
const
|
|
11
|
+
const internal_2 = require("@nx/web/internal");
|
|
12
12
|
const runtime_version_utils_1 = require("../../utils/runtime-version-utils");
|
|
13
13
|
const deprecation_1 = require("../../utils/deprecation");
|
|
14
14
|
async function* serveExecutor(options, context) {
|
|
@@ -93,7 +93,7 @@ async function* serveExecutor(options, context) {
|
|
|
93
93
|
process.on('SIGINT', () => killServer());
|
|
94
94
|
process.on('SIGTERM', () => killServer());
|
|
95
95
|
process.on('SIGHUP', () => killServer());
|
|
96
|
-
await (0,
|
|
96
|
+
await (0, internal_2.waitForPortOpen)(options.port, { host: options.hostname });
|
|
97
97
|
next({
|
|
98
98
|
success: true,
|
|
99
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
|
|
@@ -4,9 +4,10 @@ exports.applicationGenerator = applicationGenerator;
|
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
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,8 +19,8 @@ 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
|
|
22
|
+
const versions_1 = require("../../utils/versions");
|
|
23
|
+
const internal_4 = require("@nx/js/internal");
|
|
23
24
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
24
25
|
const jest_config_util_1 = require("../../utils/jest-config-util");
|
|
25
26
|
async function applicationGenerator(host, schema) {
|
|
@@ -30,8 +31,9 @@ async function applicationGenerator(host, schema) {
|
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
async function applicationGeneratorInternal(host, schema) {
|
|
34
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
33
35
|
const tasks = [];
|
|
34
|
-
const addTsPlugin = (0,
|
|
36
|
+
const addTsPlugin = (0, internal_4.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
|
|
35
37
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
36
38
|
js: schema.js,
|
|
37
39
|
skipPackageJson: schema.skipPackageJson,
|
|
@@ -52,7 +54,7 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
52
54
|
// If we are using the new TS solution
|
|
53
55
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
54
56
|
if (options.isTsSolutionSetup) {
|
|
55
|
-
await (0,
|
|
57
|
+
await (0, internal_4.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
|
|
56
58
|
}
|
|
57
59
|
const lintTask = await (0, add_linting_1.addLinting)(host, options);
|
|
58
60
|
tasks.push(lintTask);
|
|
@@ -79,25 +81,25 @@ async function applicationGeneratorInternal(host, schema) {
|
|
|
79
81
|
});
|
|
80
82
|
}
|
|
81
83
|
if (!options.skipPackageJson) {
|
|
82
|
-
const reactVersions = await (0,
|
|
84
|
+
const reactVersions = await (0, internal_3.getReactDependenciesVersionsToInstall)(host);
|
|
83
85
|
const devDependencies = {
|
|
84
86
|
'@types/react': reactVersions['@types/react'],
|
|
85
87
|
'@types/react-dom': reactVersions['@types/react-dom'],
|
|
86
88
|
};
|
|
87
89
|
if (options.unitTestRunner && options.unitTestRunner !== 'none') {
|
|
88
|
-
devDependencies['@testing-library/react'] =
|
|
89
|
-
devDependencies['@testing-library/dom'] =
|
|
90
|
+
devDependencies['@testing-library/react'] = internal_2.testingLibraryReactVersion;
|
|
91
|
+
devDependencies['@testing-library/dom'] = internal_2.testingLibraryDomVersion;
|
|
90
92
|
}
|
|
91
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib:
|
|
93
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { tslib: versions_1.tsLibVersion }, devDependencies, undefined, true));
|
|
92
94
|
}
|
|
93
|
-
(0,
|
|
95
|
+
(0, internal_4.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.json', {
|
|
94
96
|
jsx: 'preserve',
|
|
95
97
|
module: 'esnext',
|
|
96
98
|
moduleResolution: 'bundler',
|
|
97
99
|
}, options.linter === 'eslint'
|
|
98
100
|
? ['.next', 'eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
99
101
|
: ['.next'], options.src ? 'src' : '.');
|
|
100
|
-
(0,
|
|
102
|
+
(0, internal_4.sortPackageJsonFields)(host, options.appProjectRoot);
|
|
101
103
|
if (!options.skipFormat) {
|
|
102
104
|
await (0, devkit_1.formatFiles)(host);
|
|
103
105
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addLinting = addLinting;
|
|
4
4
|
const eslint_1 = require("@nx/eslint");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const react_1 = require("@nx/react");
|
|
7
7
|
const internal_1 = require("@nx/eslint/internal");
|
|
8
8
|
const version_utils_1 = require("../../../utils/version-utils");
|
|
9
9
|
async function addLinting(host, options) {
|
|
@@ -69,11 +69,11 @@ async function addLinting(host, options) {
|
|
|
69
69
|
}
|
|
70
70
|
if (!options.skipPackageJson) {
|
|
71
71
|
const eslintConfigNextVersion = await (0, version_utils_1.getEslintConfigNextDependenciesVersionsToInstall)(host);
|
|
72
|
-
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host,
|
|
73
|
-
...
|
|
72
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, react_1.extraEslintDependencies.dependencies, {
|
|
73
|
+
...react_1.extraEslintDependencies.devDependencies,
|
|
74
74
|
'eslint-config-next': eslintConfigNextVersion,
|
|
75
75
|
'@next/eslint-plugin-next': eslintConfigNextVersion,
|
|
76
|
-
}));
|
|
76
|
+
}, undefined, true));
|
|
77
77
|
}
|
|
78
78
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
79
79
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const react_1 = require("@nx/react");
|
|
7
7
|
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
async function normalizeOptions(host, options) {
|
|
9
9
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
@@ -29,7 +29,7 @@ async function normalizeOptions(host, options) {
|
|
|
29
29
|
const fileName = 'index';
|
|
30
30
|
const appDir = options.appDir ?? true;
|
|
31
31
|
const src = options.src ?? true;
|
|
32
|
-
(0,
|
|
32
|
+
(0, react_1.assertValidStyle)(options.style);
|
|
33
33
|
return {
|
|
34
34
|
...options,
|
|
35
35
|
appDir,
|
|
@@ -5,11 +5,13 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const react_1 = require("@nx/react");
|
|
7
7
|
const styles_1 = require("../../utils/styles");
|
|
8
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
8
9
|
/*
|
|
9
10
|
* This schematic is basically the React one, but for Next we need
|
|
10
11
|
* extra dependencies for css, sass, less style options.
|
|
11
12
|
*/
|
|
12
13
|
async function componentGenerator(host, options) {
|
|
14
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
13
15
|
// we only need to provide the path to get the project, we let the react
|
|
14
16
|
// generator handle the rest
|
|
15
17
|
const { project: projectName } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
@@ -6,7 +6,9 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
7
|
const build_post_target_transformer_1 = require("./lib/build-post-target-transformer");
|
|
8
8
|
const serve_post_target_tranformer_1 = require("./lib/serve-post-target-tranformer");
|
|
9
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
9
10
|
async function convertToInferred(tree, options) {
|
|
11
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(tree);
|
|
10
12
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
11
13
|
const migrationLogs = new internal_1.AggregatedLog();
|
|
12
14
|
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/next/plugin', plugin_1.createNodesV2, {
|
package/{src → dist/src}/generators/convert-to-inferred/lib/build-post-target-transformer.d.ts
RENAMED
|
@@ -5,4 +5,3 @@ export declare function buildPostTargetTransformer(migrationLogs: AggregatedLog)
|
|
|
5
5
|
projectName: string;
|
|
6
6
|
root: string;
|
|
7
7
|
}, inferredTargetConfiguration: TargetConfiguration) => TargetConfiguration<NextBuildBuilderOptions>;
|
|
8
|
-
//# sourceMappingURL=build-post-target-transformer.d.ts.map
|
package/{src → dist/src}/generators/convert-to-inferred/lib/serve-post-target-tranformer.d.ts
RENAMED
|
@@ -5,4 +5,3 @@ export declare function servePosTargetTransformer(migrationLogs: AggregatedLog):
|
|
|
5
5
|
projectName: string;
|
|
6
6
|
root: string;
|
|
7
7
|
}, inferredTargetConfiguration: InferredTargetConfiguration) => TargetConfiguration<NextServeBuilderOptions>;
|
|
8
|
-
//# sourceMappingURL=serve-post-target-tranformer.d.ts.map
|
|
@@ -7,7 +7,9 @@ const devkit_2 = require("@nx/devkit");
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const add_swc_to_custom_server_1 = require("../../utils/add-swc-to-custom-server");
|
|
9
9
|
const internal_2 = require("@nx/js/internal");
|
|
10
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
10
11
|
async function customServerGenerator(host, options) {
|
|
12
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(host);
|
|
11
13
|
const project = (0, devkit_2.readProjectConfiguration)(host, options.project);
|
|
12
14
|
const swcServerName = '.server.swcrc';
|
|
13
15
|
const nxJson = (0, devkit_2.readNxJson)(host);
|
|
@@ -3,4 +3,3 @@ import { CypressComponentConfigurationGeneratorSchema } from './schema';
|
|
|
3
3
|
export declare function cypressComponentConfiguration(tree: Tree, options: CypressComponentConfigurationGeneratorSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function cypressComponentConfigurationInternal(tree: Tree, options: CypressComponentConfigurationGeneratorSchema): Promise<GeneratorCallback>;
|
|
5
5
|
export default cypressComponentConfiguration;
|
|
6
|
-
//# sourceMappingURL=cypress-component-configuration.d.ts.map
|
|
@@ -1,46 +1,14 @@
|
|
|
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.cypressComponentConfiguration = cypressComponentConfiguration;
|
|
37
4
|
exports.cypressComponentConfigurationInternal = cypressComponentConfigurationInternal;
|
|
38
5
|
const devkit_1 = require("@nx/devkit");
|
|
39
6
|
const internal_1 = require("@nx/js/internal");
|
|
40
7
|
const react_1 = require("@nx/react");
|
|
41
|
-
const
|
|
8
|
+
const internal_2 = require("@nx/react/internal");
|
|
42
9
|
const path_1 = require("path");
|
|
43
10
|
const versions_1 = require("../../utils/versions");
|
|
11
|
+
const assert_supported_next_version_1 = require("../../utils/assert-supported-next-version");
|
|
44
12
|
function cypressComponentConfiguration(tree, options) {
|
|
45
13
|
return cypressComponentConfigurationInternal(tree, {
|
|
46
14
|
addPlugin: false,
|
|
@@ -48,6 +16,7 @@ function cypressComponentConfiguration(tree, options) {
|
|
|
48
16
|
});
|
|
49
17
|
}
|
|
50
18
|
async function cypressComponentConfigurationInternal(tree, options) {
|
|
19
|
+
(0, assert_supported_next_version_1.assertSupportedNextVersion)(tree);
|
|
51
20
|
const tasks = [];
|
|
52
21
|
const { componentConfigurationGenerator: baseCyCtConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
53
22
|
tasks.push(await baseCyCtConfig(tree, {
|
|
@@ -62,7 +31,7 @@ async function cypressComponentConfigurationInternal(tree, options) {
|
|
|
62
31
|
skipFormat: true,
|
|
63
32
|
addPlugin: options.addPlugin,
|
|
64
33
|
}));
|
|
65
|
-
const { ensureDependencies } =
|
|
34
|
+
const { ensureDependencies, } = require('@nx/webpack/internal');
|
|
66
35
|
tasks.push(ensureDependencies(tree, { compiler: 'swc', uiFramework: 'react' }));
|
|
67
36
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
68
37
|
if (projectConfig.targets?.['component-test']?.executor ===
|
|
@@ -80,8 +49,8 @@ async function cypressComponentConfigurationInternal(tree, options) {
|
|
|
80
49
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
81
50
|
}
|
|
82
51
|
async function addFiles(tree, projectConfig, opts) {
|
|
83
|
-
const { addMountDefinition, addDefaultCTConfig } = await
|
|
84
|
-
const { getInstalledCypressMajorVersion } = await
|
|
52
|
+
const { addMountDefinition, addDefaultCTConfig } = await import('@nx/cypress/internal');
|
|
53
|
+
const { getInstalledCypressMajorVersion } = await import('@nx/cypress/internal');
|
|
85
54
|
const installedCypressMajorVersion = getInstalledCypressMajorVersion(tree);
|
|
86
55
|
const ctFile = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress', 'support', 'component.ts');
|
|
87
56
|
const updatedCommandFile = await addMountDefinition(tree.read(ctFile, 'utf-8'));
|
|
@@ -109,7 +78,7 @@ ${isUsingTailwind
|
|
|
109
78
|
fromProjectRootPath.includes('app')) {
|
|
110
79
|
return;
|
|
111
80
|
}
|
|
112
|
-
if ((0,
|
|
81
|
+
if ((0, internal_2.isComponent)(tree, filePath)) {
|
|
113
82
|
filePaths.push(filePath);
|
|
114
83
|
}
|
|
115
84
|
});
|
|
@@ -3,4 +3,3 @@ import type { InitSchema } from './schema';
|
|
|
3
3
|
export declare function nextInitGenerator(tree: Tree, schema: InitSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function nextInitGeneratorInternal(host: Tree, schema: InitSchema): Promise<GeneratorCallback>;
|
|
5
5
|
export default nextInitGenerator;
|
|
6
|
-
//# sourceMappingURL=init.d.ts.map
|