@nx/next 0.0.0-pr-28808-bceb02f → 0.0.0-pr-28808-ae8ea8d

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "0.0.0-pr-28808-bceb02f",
3
+ "version": "0.0.0-pr-28808-ae8ea8d",
4
4
  "private": false,
5
5
  "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Playwright, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "next": ">=14.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "0.0.0-pr-28808-bceb02f",
38
+ "@nx/devkit": "0.0.0-pr-28808-ae8ea8d",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.0.1",
41
41
  "copy-webpack-plugin": "^10.2.4",
@@ -44,11 +44,11 @@
44
44
  "semver": "^7.5.3",
45
45
  "tslib": "^2.3.0",
46
46
  "webpack-merge": "^5.8.0",
47
- "@nx/js": "0.0.0-pr-28808-bceb02f",
48
- "@nx/eslint": "0.0.0-pr-28808-bceb02f",
49
- "@nx/react": "0.0.0-pr-28808-bceb02f",
50
- "@nx/web": "0.0.0-pr-28808-bceb02f",
51
- "@nx/webpack": "0.0.0-pr-28808-bceb02f",
47
+ "@nx/js": "0.0.0-pr-28808-ae8ea8d",
48
+ "@nx/eslint": "0.0.0-pr-28808-ae8ea8d",
49
+ "@nx/react": "0.0.0-pr-28808-ae8ea8d",
50
+ "@nx/web": "0.0.0-pr-28808-ae8ea8d",
51
+ "@nx/webpack": "0.0.0-pr-28808-ae8ea8d",
52
52
  "@phenomnomnominal/tsquery": "~5.0.1"
53
53
  },
54
54
  "publishConfig": {
@@ -88,8 +88,8 @@ async function applicationGeneratorInternal(host, schema) {
88
88
  module: 'esnext',
89
89
  moduleResolution: 'bundler',
90
90
  }, options.linter === 'eslint'
91
- ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
92
- : undefined);
91
+ ? ['.next', 'eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
92
+ : ['.next'], options.src ? 'src' : '.');
93
93
  if (!options.skipFormat) {
94
94
  await (0, devkit_1.formatFiles)(host);
95
95
  }
@@ -8,6 +8,7 @@ const web_1 = require("@nx/web");
8
8
  const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
9
9
  const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
10
10
  const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
11
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
11
12
  async function addE2e(host, options) {
12
13
  const nxJson = (0, devkit_1.readNxJson)(host);
13
14
  const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
@@ -24,13 +25,25 @@ async function addE2e(host, options) {
24
25
  spa: true,
25
26
  });
26
27
  }
27
- (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
28
- root: options.e2eProjectRoot,
29
- sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
30
- targets: {},
31
- tags: [],
32
- implicitDependencies: [options.projectName],
33
- });
28
+ if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
29
+ (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), {
30
+ name: options.e2eProjectName,
31
+ version: '0.0.1',
32
+ private: true,
33
+ nx: {
34
+ name: options.e2eProjectName,
35
+ },
36
+ });
37
+ }
38
+ else {
39
+ (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
40
+ root: options.e2eProjectRoot,
41
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
42
+ targets: {},
43
+ tags: [],
44
+ implicitDependencies: [options.projectName],
45
+ });
46
+ }
34
47
  const e2eTask = await configurationGenerator(host, {
35
48
  ...options,
36
49
  linter: eslint_1.Linter.EsLint,
@@ -65,13 +78,25 @@ async function addE2e(host, options) {
65
78
  }
66
79
  else if (options.e2eTestRunner === 'playwright') {
67
80
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
68
- (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
69
- root: options.e2eProjectRoot,
70
- sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
71
- targets: {},
72
- tags: [],
73
- implicitDependencies: [options.projectName],
74
- });
81
+ if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
82
+ (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), {
83
+ name: options.e2eProjectName,
84
+ version: '0.0.1',
85
+ private: true,
86
+ nx: {
87
+ name: options.e2eProjectName,
88
+ },
89
+ });
90
+ }
91
+ else {
92
+ (0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
93
+ root: options.e2eProjectRoot,
94
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
95
+ targets: {},
96
+ tags: [],
97
+ implicitDependencies: [options.projectName],
98
+ });
99
+ }
75
100
  const e2eTask = await configurationGenerator(host, {
76
101
  rootProject: options.rootProject,
77
102
  project: options.e2eProjectName,
@@ -10,8 +10,7 @@ function createApplicationFiles(host, options) {
10
10
  const offsetFromRoot = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
11
11
  const layoutTypeSrcPath = (0, devkit_1.joinPathFragments)(offsetFromRoot, options.appProjectRoot, '.next/types/**/*.ts');
12
12
  const layoutTypeDistPath = (0, devkit_1.joinPathFragments)(offsetFromRoot, options.outputPath, '.next/types/**/*.ts');
13
- // scope tsconfig to the project directory so that it doesn't include other projects/libs
14
- const rootPath = options.rootProject
13
+ const rootPath = options.rootProject || (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)
15
14
  ? options.src
16
15
  ? 'src/'
17
16
  : options.appDir