@nx/expo 23.3.0-beta.0 → 23.3.0-beta.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.
@@ -4,6 +4,10 @@ exports.default = update;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const jest_1 = require("@nx/jest");
6
6
  const path_1 = require("path");
7
+ // `preset: 'jest-expo'` or a `jest-expo/<variant>` subpath
8
+ const JEST_EXPO_PRESET_REGEX = /preset:\s*['"]jest-expo(\/[^'"]*)?['"]/;
9
+ // the resolver line the SDK 53 generator wrote (see utils/jest/add-jest.ts)
10
+ const SDK_53_RESOLVER_REGEX = /resolver:\s*require\.resolve\(\s*['"]\.\/jest\.resolver\.js['"]\s*\)/;
7
11
  /**
8
12
  * Update Jest configuration for Expo SDK 54.
9
13
  *
@@ -16,18 +20,17 @@ const path_1 = require("path");
16
20
  async function update(tree) {
17
21
  const projects = (0, devkit_1.getProjects)(tree);
18
22
  for (const [projectName, config] of projects.entries()) {
19
- if (!isExpoProject(tree, config.root)) {
20
- continue;
21
- }
22
23
  // Check if this project has Jest configured
23
24
  const jestConfigPath = findJestConfigPath(tree, config.root);
24
25
  if (!jestConfigPath) {
25
26
  continue;
26
27
  }
27
28
  const jestConfigContent = tree.read(jestConfigPath, 'utf-8');
28
- // Only process if this is an Expo project with jest-expo preset and custom resolver
29
- if (!jestConfigContent.includes('jest-expo') ||
30
- !jestConfigContent.includes('jest.resolver.js')) {
29
+ // No package.json check: expo libraries often have no project-level
30
+ // package.json (or one without expo), which skipped real expo projects.
31
+ // Only the jest config is reliable: jest-expo preset + custom resolver.
32
+ if (!JEST_EXPO_PRESET_REGEX.test(jestConfigContent) ||
33
+ !SDK_53_RESOLVER_REGEX.test(jestConfigContent)) {
31
34
  continue;
32
35
  }
33
36
  // Remove resolver property from jest.config using AST
@@ -135,16 +138,3 @@ function updateTsConfigFilesForV54(tree, projectRoot) {
135
138
  }
136
139
  }
137
140
  }
138
- function isExpoProject(tree, projectRoot) {
139
- const packageJsonPath = (0, devkit_1.joinPathFragments)(projectRoot, 'package.json');
140
- if (!tree.exists(packageJsonPath)) {
141
- return false;
142
- }
143
- try {
144
- const packageJson = (0, devkit_1.readJson)(tree, packageJsonPath);
145
- return Boolean(packageJson.dependencies?.expo || packageJson.devDependencies?.expo);
146
- }
147
- catch {
148
- return false;
149
- }
150
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/expo",
3
- "version": "23.3.0-beta.0",
3
+ "version": "23.3.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
6
6
  "keywords": [
@@ -61,18 +61,18 @@
61
61
  "semver": "^7.6.3",
62
62
  "tsconfig-paths": "^4.1.2",
63
63
  "tslib": "^2.3.0",
64
- "@nx/devkit": "23.3.0-beta.0",
65
- "@nx/eslint": "23.3.0-beta.0",
66
- "@nx/js": "23.3.0-beta.0",
67
- "@nx/react": "23.3.0-beta.0"
64
+ "@nx/devkit": "23.3.0-beta.1",
65
+ "@nx/eslint": "23.3.0-beta.1",
66
+ "@nx/react": "23.3.0-beta.1",
67
+ "@nx/js": "23.3.0-beta.1"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "expo": ">=53.0.0",
71
71
  "@expo/metro": ">= 55.0.0",
72
72
  "metro-config": ">= 0.82.0",
73
73
  "metro-resolver": ">= 0.82.0",
74
- "@nx/cypress": "23.3.0-beta.0",
75
- "@nx/playwright": "23.3.0-beta.0"
74
+ "@nx/cypress": "23.3.0-beta.1",
75
+ "@nx/playwright": "23.3.0-beta.1"
76
76
  },
77
77
  "peerDependenciesMeta": {
78
78
  "@nx/cypress": {
@@ -95,11 +95,11 @@
95
95
  }
96
96
  },
97
97
  "devDependencies": {
98
- "nx": "23.3.0-beta.0"
98
+ "nx": "23.3.0-beta.1"
99
99
  },
100
100
  "optionalDependencies": {
101
- "@nx/detox": "23.3.0-beta.0",
102
- "@nx/rollup": "23.3.0-beta.0"
101
+ "@nx/detox": "23.3.0-beta.1",
102
+ "@nx/rollup": "23.3.0-beta.1"
103
103
  },
104
104
  "executors": "./executors.json",
105
105
  "ng-update": {