@reactunity/scripts 0.14.0 → 0.14.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.
@@ -0,0 +1,19 @@
1
+ const babelPresetReact = require('@babel/preset-react').default;
2
+ const babelPresetReactApp = require('babel-preset-react-app');
3
+
4
+ // Extend babel-preset-react-app to accept custom jsxImportSource. This is required for things like @emotion/react
5
+
6
+ module.exports = function (api, opts) {
7
+ const original = babelPresetReactApp(api, opts);
8
+ const jsxImportSource = process.env.JSX_IMPORT_SOURCE;
9
+
10
+ if (jsxImportSource) {
11
+ const preset = original.presets.find(x => x[0] === babelPresetReact);
12
+
13
+ if (preset && preset[1]) {
14
+ preset[1].importSource = jsxImportSource;
15
+ }
16
+ }
17
+
18
+ return original;
19
+ };
@@ -26,12 +26,12 @@ const hasJsxRuntime = (() => {
26
26
  module.exports = babelJest.createTransformer({
27
27
  presets: [
28
28
  [
29
- require.resolve('babel-preset-react-app'),
29
+ require.resolve('../babel-preset-extended'),
30
30
  {
31
31
  runtime: hasJsxRuntime ? 'automatic' : 'classic',
32
32
  },
33
33
  ],
34
34
  ],
35
- babelrc: false,
36
- configFile: false,
35
+ babelrc: true,
36
+ configFile: true,
37
37
  });
@@ -408,15 +408,17 @@ const baseConfigFactory = function (webpackEnv) {
408
408
  ),
409
409
  presets: [
410
410
  [
411
- require.resolve('babel-preset-react-app'),
411
+ require.resolve('./babel-preset-extended'),
412
412
  {
413
413
  runtime: modules.hasJsxRuntime ? 'automatic' : 'classic',
414
+ flow: false,
415
+ typescript: true,
414
416
  },
415
417
  ],
416
- ],
418
+ ].filter(Boolean),
417
419
  // @remove-on-eject-begin
418
- babelrc: false,
419
- configFile: false,
420
+ babelrc: true,
421
+ configFile: true,
420
422
  // Make sure we have a unique cache identifier, erring on the
421
423
  // side of caution.
422
424
  // We remove this when the user ejects because the default
@@ -455,8 +457,8 @@ const baseConfigFactory = function (webpackEnv) {
455
457
  exclude: /@babel(?:\/|\\{1,2})runtime/,
456
458
  loader: require.resolve('babel-loader'),
457
459
  options: {
458
- babelrc: false,
459
- configFile: false,
460
+ babelrc: true,
461
+ configFile: true,
460
462
  compact: false,
461
463
  presets: [
462
464
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactunity/scripts",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Configuration and scripts for React Unity.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,11 +48,11 @@
48
48
  "@babel/eslint-parser": "^7.19.1",
49
49
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
50
50
  "@svgr/webpack": "^6.5.1",
51
- "@types/react": "^18.0.26",
51
+ "@types/react": "^18.0.28",
52
52
  "@types/webpack-env": "^1.18.0",
53
- "@typescript-eslint/eslint-plugin": "^5.48.1",
54
- "@typescript-eslint/parser": "^5.48.1",
55
- "babel-jest": "^29.3.1",
53
+ "@typescript-eslint/eslint-plugin": "^5.52.0",
54
+ "@typescript-eslint/parser": "^5.52.0",
55
+ "babel-jest": "^29.4.2",
56
56
  "babel-loader": "^9.1.2",
57
57
  "babel-plugin-named-asset-import": "^0.3.8",
58
58
  "babel-preset-react-app": "^10.0.1",
@@ -63,19 +63,19 @@
63
63
  "css-loader": "^6.7.3",
64
64
  "dotenv": "^16.0.3",
65
65
  "dotenv-expand": "^10.0.0",
66
- "eslint": "^8.32.0",
67
- "eslint-plugin-import": "^2.27.4",
66
+ "eslint": "^8.34.0",
67
+ "eslint-plugin-import": "^2.27.5",
68
68
  "eslint-plugin-jest": "^27.2.1",
69
- "eslint-plugin-react": "^7.32.0",
69
+ "eslint-plugin-react": "^7.32.2",
70
70
  "eslint-plugin-react-hooks": "^4.6.0",
71
- "eslint-plugin-testing-library": "^5.9.1",
72
- "eslint-webpack-plugin": "^3.2.0",
71
+ "eslint-plugin-testing-library": "^5.10.1",
72
+ "eslint-webpack-plugin": "^4.0.0",
73
73
  "file-loader": "^6.2.0",
74
74
  "fs-extra": "^11.1.0",
75
75
  "identity-obj-proxy": "^3.0.0",
76
- "jest": "^29.3.1",
77
- "jest-resolve": "^29.3.1",
78
- "jest-watch-typeahead": "^2.2.1",
76
+ "jest": "^29.4.2",
77
+ "jest-resolve": "^29.4.2",
78
+ "jest-watch-typeahead": "^2.2.2",
79
79
  "mini-css-extract-plugin": "^2.7.2",
80
80
  "null-loader": "^4.0.1",
81
81
  "postcss": "^8.4.21",
@@ -87,12 +87,12 @@
87
87
  "react-refresh": "^0.14.0",
88
88
  "resolve": "^1.22.1",
89
89
  "resolve-url-loader": "^5.0.0",
90
- "sass": "^1.57.1",
90
+ "sass": "^1.58.0",
91
91
  "sass-loader": "^13.2.0",
92
92
  "semver": "^7.3.8",
93
93
  "source-map-loader": "^4.0.1",
94
94
  "style-loader": "^3.3.1",
95
- "tailwindcss": "^3.2.4",
95
+ "tailwindcss": "^3.2.6",
96
96
  "terser-webpack-plugin": "^5.3.6",
97
97
  "url-loader": "^4.1.1",
98
98
  "webpack": "^5.75.0",
@@ -100,7 +100,7 @@
100
100
  "webpack-manifest-plugin": "^5.0.0"
101
101
  },
102
102
  "devDependencies": {
103
- "typescript": "^4.9.4"
103
+ "typescript": "^4.9.5"
104
104
  },
105
105
  "optionalDependencies": {
106
106
  "fsevents": "^2.3.2"
@@ -109,7 +109,7 @@
109
109
  "@reactunity/previewer": "*",
110
110
  "@reactunity/renderer": "^0.14.0",
111
111
  "react": "^18.0.0",
112
- "typescript": "^4.9.4"
112
+ "typescript": "^4.9.5"
113
113
  },
114
114
  "peerDependenciesMeta": {
115
115
  "@reactunity/previewer": {