@nx/expo 22.1.0-beta.5 → 22.1.0-beta.7

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.
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ module.exports = {
3
+ transform: {
4
+ '^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
5
+ },
6
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'],
7
+ globals: {},
8
+ displayName: 'expo',
9
+ preset: '../../jest.preset.js',
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/expo",
3
- "version": "22.1.0-beta.5",
3
+ "version": "22.1.0-beta.7",
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": [
@@ -28,10 +28,10 @@
28
28
  "main": "./index.js",
29
29
  "types": "index.d.ts",
30
30
  "dependencies": {
31
- "@nx/devkit": "22.1.0-beta.5",
32
- "@nx/eslint": "22.1.0-beta.5",
33
- "@nx/js": "22.1.0-beta.5",
34
- "@nx/react": "22.1.0-beta.5",
31
+ "@nx/devkit": "22.1.0-beta.7",
32
+ "@nx/eslint": "22.1.0-beta.7",
33
+ "@nx/js": "22.1.0-beta.7",
34
+ "@nx/react": "22.1.0-beta.7",
35
35
  "enhanced-resolve": "^5.8.3",
36
36
  "picocolors": "^1.1.0",
37
37
  "tsconfig-paths": "^4.1.2",
@@ -42,8 +42,8 @@
42
42
  "metro-resolver": ">= 0.82.0"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@nx/detox": "22.1.0-beta.5",
46
- "@nx/rollup": "22.1.0-beta.5"
45
+ "@nx/detox": "22.1.0-beta.7",
46
+ "@nx/rollup": "22.1.0-beta.7"
47
47
  },
48
48
  "executors": "./executors.json",
49
49
  "ng-update": {
@@ -1 +1 @@
1
- {"version":3,"file":"add-jest-resolver.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/migrations/update-21-4-0/add-jest-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,IAAI,EAAE,MAAM,YAAY,CAAC;AAK5D,wBAA8B,eAAe,CAAC,IAAI,EAAE,IAAI,iBAgEvD"}
1
+ {"version":3,"file":"add-jest-resolver.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/migrations/update-21-4-0/add-jest-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,IAAI,EAAE,MAAM,YAAY,CAAC;AAK5D,wBAA8B,eAAe,CAAC,IAAI,EAAE,IAAI,iBAoEvD"}
@@ -17,12 +17,17 @@ async function addJestResolver(tree) {
17
17
  // Check if this is an Expo project by looking for jest.config file with expo preset
18
18
  const jestConfigPath = (0, path_1.join)(config.root, 'jest.config.ts');
19
19
  const jestConfigJsPath = (0, path_1.join)(config.root, 'jest.config.js');
20
+ const jestConfigCtsPath = (0, path_1.join)(config.root, 'jest.config.cts');
20
21
  let jestConfigContent = '';
21
22
  let configPath = '';
22
23
  if (tree.exists(jestConfigPath)) {
23
24
  jestConfigContent = tree.read(jestConfigPath, 'utf-8');
24
25
  configPath = jestConfigPath;
25
26
  }
27
+ else if (tree.exists(jestConfigCtsPath)) {
28
+ jestConfigContent = tree.read(jestConfigCtsPath, 'utf-8');
29
+ configPath = jestConfigCtsPath;
30
+ }
26
31
  else if (tree.exists(jestConfigJsPath)) {
27
32
  jestConfigContent = tree.read(jestConfigJsPath, 'utf-8');
28
33
  configPath = jestConfigJsPath;
@@ -1 +1 @@
1
- {"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../packages/expo/src/utils/add-linting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AACtE,OAAO,EAEL,iBAAiB,EAEjB,IAAI,EACL,MAAM,YAAY,CAAC;AAYpB,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,8BAwFrE"}
1
+ {"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../packages/expo/src/utils/add-linting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AACtE,OAAO,EAEL,iBAAiB,EAEjB,IAAI,EACL,MAAM,YAAY,CAAC;AAYpB,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,8BAyFrE"}
@@ -36,6 +36,7 @@ async function addLinting(host, options) {
36
36
  '@nx/rollup',
37
37
  '@rollup/plugin-url',
38
38
  '@svgr/rollup',
39
+ 'jest-expo',
39
40
  ];
40
41
  for (const dep of ignoredDeps) {
41
42
  if (!rule[1].ignoredDependencies.includes(dep)) {
@@ -1 +1 @@
1
- {"version":3,"file":"add-jest.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/utils/jest/add-jest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgD,MAAM,YAAY,CAAC;AAKhF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,GAAG,MAAM,EAC/B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,OAAO,EACX,eAAe,EAAE,OAAO,EACxB,SAAS,EAAE,OAAO,uBAiEnB"}
1
+ {"version":3,"file":"add-jest.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/utils/jest/add-jest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgD,MAAM,YAAY,CAAC;AAKhF,wBAAsB,OAAO,CAC3B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,GAAG,MAAM,EAC/B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,OAAO,EACX,eAAe,EAAE,OAAO,EACxB,SAAS,EAAE,OAAO,uBAoEnB"}
@@ -23,8 +23,11 @@ async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, sk
23
23
  });
24
24
  // Overwrite the jest.config.ts file because react native needs to have special transform property
25
25
  // use preset from https://github.com/expo/expo/blob/main/packages/jest-expo/jest-preset.js
26
- const configPath = `${appProjectRoot}/jest.config.${js ? 'js' : 'ts'}`;
27
- const content = `module.exports = {
26
+ // Workaround issue where Jest is not picking tyope node nor jest types from tsconfig by using <reference>.
27
+ const configPath = `${appProjectRoot}/jest.config.${js ? 'js' : 'cts'}`;
28
+ const content = `/// <reference types="jest" />
29
+ /// <reference types="node" />
30
+ module.exports = {
28
31
  displayName: '${projectName}',
29
32
  resolver: require.resolve('./jest.resolver.js'),
30
33
  preset: 'jest-expo',