@nx/react 18.3.0-beta.0 → 18.3.0-beta.2

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/react",
3
- "version": "18.3.0-beta.0",
3
+ "version": "18.3.0-beta.2",
4
4
  "private": false,
5
5
  "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -37,11 +37,11 @@
37
37
  "file-loader": "^6.2.0",
38
38
  "minimatch": "9.0.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "18.3.0-beta.0",
41
- "@nx/js": "18.3.0-beta.0",
42
- "@nx/eslint": "18.3.0-beta.0",
43
- "@nx/web": "18.3.0-beta.0",
44
- "@nrwl/react": "18.3.0-beta.0"
40
+ "@nx/devkit": "18.3.0-beta.2",
41
+ "@nx/js": "18.3.0-beta.2",
42
+ "@nx/eslint": "18.3.0-beta.2",
43
+ "@nx/web": "18.3.0-beta.2",
44
+ "@nrwl/react": "18.3.0-beta.2"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -28,7 +28,7 @@ function nxComponentTestingPreset(pathToConfig, options) {
28
28
  const basePresetSettings = (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig, {
29
29
  testingType: 'component',
30
30
  });
31
- if (global.NX_GRAPH_CREATION || global.NX_CYPRESS_INIT_GENERATOR_RUNNING) {
31
+ if (global.NX_GRAPH_CREATION) {
32
32
  // this is only used by plugins, so we don't need the component testing
33
33
  // options, cast to any to avoid type errors
34
34
  return basePresetSettings;
@@ -2,22 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addTailwindStyleImports = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const knownLocations = [
6
- // Plain React
7
- 'src/styles.css',
8
- 'src/styles.scss',
9
- 'src/styles.less',
10
- // Next.js
11
- 'pages/styles.css',
12
- 'pages/styles.scss',
13
- 'pages/styles.less',
14
- 'app/global.css',
15
- 'app/global.scss',
16
- 'app/global.less',
17
- ];
5
+ // base directories and file types to simplify locating the stylesheet
6
+ const baseDirs = ['src', 'pages', 'src/pages', 'src/app', 'app'];
7
+ const fileNames = ['styles', 'global'];
8
+ const extensions = ['.css', '.scss', '.less'];
9
+ const knownLocations = baseDirs.flatMap((dir) => fileNames.flatMap((name) => extensions.map((ext) => `${dir}/${name}${ext}`)));
18
10
  function addTailwindStyleImports(tree, project, _options) {
19
- const candidates = knownLocations.map((x) => (0, devkit_1.joinPathFragments)(project.root, x));
20
- const stylesPath = candidates.find((x) => tree.exists(x));
11
+ const candidates = knownLocations.map((currentPath) => (0, devkit_1.joinPathFragments)(project.root, currentPath));
12
+ const stylesPath = candidates.find((currentStylePath) => tree.exists(currentStylePath));
21
13
  if (stylesPath) {
22
14
  const content = tree.read(stylesPath).toString();
23
15
  tree.write(stylesPath, `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n${content}`);