@nx/next 20.5.0-rc.2 → 20.5.0-rc.3

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": "20.5.0-rc.2",
3
+ "version": "20.5.0-rc.3",
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": "20.5.0-rc.2",
38
+ "@nx/devkit": "20.5.0-rc.3",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.1.0",
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": "20.5.0-rc.2",
48
- "@nx/eslint": "20.5.0-rc.2",
49
- "@nx/react": "20.5.0-rc.2",
50
- "@nx/web": "20.5.0-rc.2",
51
- "@nx/webpack": "20.5.0-rc.2",
47
+ "@nx/js": "20.5.0-rc.3",
48
+ "@nx/eslint": "20.5.0-rc.3",
49
+ "@nx/react": "20.5.0-rc.3",
50
+ "@nx/web": "20.5.0-rc.3",
51
+ "@nx/webpack": "20.5.0-rc.3",
52
52
  "@phenomnomnominal/tsquery": "~5.0.1"
53
53
  },
54
54
  "publishConfig": {
package/tailwind.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Generates a set of glob patterns based off the source root of the app and its dependencies
3
3
  * @param dirPath workspace relative directory path that will be used to infer the parent project and dependencies
4
- * @param fileGlobPattern pass a custom glob pattern to be used
4
+ * @param fileGlobPatternToInclude pass a custom glob pattern to be used
5
+ * @param fileGlobPatternToExclude pass a custom glob pattern for files to be excluded
5
6
  */
6
- export declare function createGlobPatternsForDependencies(dirPath: string, fileGlobPatternToInclude?: string, fileGlobPatternToExclude?: string): string[];
7
+ export declare function createGlobPatternsForDependencies(dirPath: string, fileGlobPatternToInclude?: string, fileGlobPatternToExclude?: string): any;
package/tailwind.js CHANGED
@@ -6,27 +6,36 @@ const path_1 = require("path");
6
6
  /**
7
7
  * Generates a set of glob patterns based off the source root of the app and its dependencies
8
8
  * @param dirPath workspace relative directory path that will be used to infer the parent project and dependencies
9
- * @param fileGlobPattern pass a custom glob pattern to be used
9
+ * @param fileGlobPatternToInclude pass a custom glob pattern to be used
10
+ * @param fileGlobPatternToExclude pass a custom glob pattern for files to be excluded
10
11
  */
11
12
  function createGlobPatternsForDependencies(dirPath, fileGlobPatternToInclude = '/**/*.{tsx,ts,jsx,js,html}', fileGlobPatternToExclude = '/**/*.{stories,spec}.{tsx,ts,jsx,js,html}') {
12
- try {
13
- return [
14
- ...(0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToInclude).map((glob) => (0, path_1.relative)(dirPath, glob)),
15
- ...(0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToExclude).map((glob) => `!${(0, path_1.relative)(dirPath, glob)}`),
16
- ];
17
- }
18
- catch (e) {
19
- /**
20
- * It should not be possible to reach this point when the utility is invoked as part of the normal
21
- * lifecycle of Nx executors. However, other tooling, such as the VSCode Tailwind IntelliSense plugin
22
- * or JetBrains editors such as WebStorm, may execute the tailwind.config.js file in order to provide
23
- * autocomplete features, for example.
24
- *
25
- * In order to best support that use-case, we therefore do not hard error when the ProjectGraph is
26
- * fundamently unavailable in this tailwind-specific context.
27
- */
28
- console.warn('\nWARNING: There was an error creating glob patterns, returning an empty array\n' +
29
- `${e.message}\n`);
30
- return [];
13
+ /**
14
+ * There is an issue with TailwindCSS v4 and how globs patterns are consumed.
15
+ * This is a temporary workaround to support both TailwindCSS v4 and v3.
16
+ * Once TailwindCSS v3 is no longer supported, this workaround can be removed.
17
+ */
18
+ const tailwindVersion = require(require.resolve('tailwindcss/package.json', {
19
+ paths: [dirPath],
20
+ })).version;
21
+ if (tailwindVersion && typeof tailwindVersion === 'string') {
22
+ const majorVersion = parseInt(tailwindVersion.split('.')[0], 10);
23
+ if (majorVersion >= 4) {
24
+ try {
25
+ return [
26
+ ...(0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToInclude).map((glob) => (0, path_1.relative)(dirPath, glob)),
27
+ ...(0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPatternToExclude).map((glob) => `!${(0, path_1.relative)(dirPath, glob)}`),
28
+ ];
29
+ }
30
+ catch (e) {
31
+ console.warn('\nWARNING: There was an error creating glob patterns, returning an empty array\n' +
32
+ `${e.message}\n`);
33
+ }
34
+ }
35
+ else {
36
+ const { createGlobPatternsForDependencies: reactGlobPatternFunction, } = require('@nx/react/tailwind');
37
+ return reactGlobPatternFunction(dirPath, fileGlobPatternToInclude);
38
+ }
31
39
  }
40
+ return [];
32
41
  }