expo-module-scripts 3.2.0 → 3.4.0

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/CHANGELOG.md CHANGED
@@ -10,6 +10,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 3.4.0 — 2023-12-12
14
+
15
+ ### 🎉 New features
16
+
17
+ - Add Node-specific Babel and Jest configurations. ([#25458](https://github.com/expo/expo/pull/25458) by [@byCedric](https://github.com/byCedric))
18
+ - Add Node override in ESLint config for root configuraiton files. ([#25767](https://github.com/expo/expo/pull/25767) by [@byCedric](https://github.com/byCedric))
19
+
20
+ ## 3.3.0 — 2023-11-14
21
+
22
+ ### 🐛 Bug fixes
23
+
24
+ - Remove watchPlugins from sub-projects when using multi-project runner. ([#25302](https://github.com/expo/expo/pull/25302) by [@EvanBacon](https://github.com/EvanBacon))
25
+ - Default to using jest-preset-plugin when running `yarn test plugin` with no `plugin/jest.config.js` file. ([#25302](https://github.com/expo/expo/pull/25302) by [@EvanBacon](https://github.com/EvanBacon))
26
+
13
27
  ## 3.2.0 — 2023-10-17
14
28
 
15
29
  ### 🎉 New features
@@ -1,4 +1,4 @@
1
- module.exports = function(api) {
1
+ module.exports = function (api) {
2
2
  api.cache(true);
3
3
  return {
4
4
  presets: ['babel-preset-expo'],
@@ -0,0 +1,27 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ return {
4
+ presets: [
5
+ [
6
+ require('@babel/preset-env'),
7
+ {
8
+ modules: false, // Disable the default `modules-commonjs`, to enable lazy evaluation
9
+ targets: {
10
+ node: '12.0.0',
11
+ },
12
+ },
13
+ ],
14
+ require('@babel/preset-typescript'),
15
+ ],
16
+ plugins: [
17
+ require('babel-plugin-dynamic-import-node'),
18
+ require('@babel/plugin-proposal-export-namespace-from'),
19
+ [
20
+ require('@babel/plugin-transform-modules-commonjs'),
21
+ {
22
+ lazy: /* istanbul ignore next */ (source) => true,
23
+ },
24
+ ],
25
+ ],
26
+ };
27
+ };
@@ -1,6 +1,6 @@
1
- module.exports = function(api) {
1
+ module.exports = function (api) {
2
2
  api.cache(true);
3
3
  return {
4
- plugins: ['@babel/plugin-transform-flow-strip-types'],
4
+ plugins: ['@babel/plugin-transform-flow-strip-types'],
5
5
  };
6
6
  };
@@ -15,6 +15,9 @@ if [ "$1" == "plugin" ]; then
15
15
  if [[ -f plugin/jest.config.js ]]; then
16
16
  args+=("--config")
17
17
  args+=("plugin/jest.config.js")
18
+ else
19
+ args+=("--config")
20
+ args+=("$(node --print "require.resolve('expo-module-scripts/jest-preset-plugin.js')")")
18
21
  fi
19
22
 
20
23
  # Push the rest of the arguments minus the `plugin` arg
package/eslintrc.base.js CHANGED
@@ -7,6 +7,10 @@ module.exports = {
7
7
  env: { node: true },
8
8
  globals: { __DEV__: true },
9
9
  },
10
+ {
11
+ files: ['./*.config.js', './.*rc.js'],
12
+ extends: ['universe/node'],
13
+ },
10
14
  ],
11
15
  rules: {
12
16
  'no-restricted-imports': [
@@ -0,0 +1,12 @@
1
+ /** @type {import('jest').Config} */
2
+ module.exports = {
3
+ testEnvironment: 'node',
4
+ testRegex: '/__tests__/.*(test|spec)\\.[jt]sx?$',
5
+ transform: {
6
+ '^.+\\.[jt]sx?$': ['babel-jest', { configFile: require.resolve('./babel.config.cli.js') }],
7
+ },
8
+ watchPlugins: [
9
+ require.resolve('jest-watch-typeahead/filename'),
10
+ require.resolve('jest-watch-typeahead/testname'),
11
+ ],
12
+ };
@@ -1,10 +1,12 @@
1
- const nodePreset = {
1
+ /** @type {import('jest').Config} */
2
+ module.exports = {
2
3
  testEnvironment: 'node',
3
4
  testRegex: '/__tests__/.*(test|spec)\\.[jt]sx?$',
4
5
  transform: {
5
6
  '^.+\\.[jt]sx?$': ['babel-jest', { configFile: require.resolve('./babel.config.base.js') }],
6
7
  },
7
- watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
8
+ watchPlugins: [
9
+ require.resolve('jest-watch-typeahead/filename'),
10
+ require.resolve('jest-watch-typeahead/testname'),
11
+ ],
8
12
  };
9
-
10
- module.exports = nodePreset;
package/jest-preset.js CHANGED
@@ -6,5 +6,6 @@ module.exports = withWatchPlugins({
6
6
  createJestPreset(require('jest-expo/android/jest-preset')),
7
7
  createJestPreset(require('jest-expo/web/jest-preset')),
8
8
  createJestPreset(require('jest-expo/node/jest-preset')),
9
- ],
9
+ // Remove sub-watch-plugins from the preset when using multi-project runner.
10
+ ].map(({ watchPlugins, ...config }) => config),
10
11
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-module-scripts",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "description": "A private package for various tasks for Expo module packages like compiling and testing",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -27,11 +27,15 @@
27
27
  "homepage": "https://github.com/expo/expo/tree/main/packages/expo-module-scripts#readme",
28
28
  "dependencies": {
29
29
  "@babel/cli": "^7.1.2",
30
+ "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
31
+ "@babel/preset-env": "^7.20.2",
32
+ "@babel/preset-typescript": "^7.12.12",
30
33
  "@expo/npm-proofread": "^1.0.1",
31
34
  "@testing-library/react-hooks": "^7.0.1",
32
35
  "@tsconfig/node18": "^18.2.2",
33
36
  "@types/jest": "^29.2.1",
34
- "babel-preset-expo": "~9.8.0",
37
+ "babel-plugin-dynamic-import-node": "^2.3.3",
38
+ "babel-preset-expo": "~10.0.0",
35
39
  "commander": "^2.19.0",
36
40
  "eslint-config-universe": "^12.0.0",
37
41
  "find-yarn-workspace-root": "^2.0.0",
@@ -41,5 +45,5 @@
41
45
  "ts-jest": "~29.0.4",
42
46
  "typescript": "^5.1.3"
43
47
  },
44
- "gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
48
+ "gitHead": "6aca7ce098ddc667776a3d7cf612adbb985e264a"
45
49
  }