@reactunity/scripts 0.13.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-
|
|
29
|
+
require.resolve('../babel-preset-extended'),
|
|
30
30
|
{
|
|
31
31
|
runtime: hasJsxRuntime ? 'automatic' : 'classic',
|
|
32
32
|
},
|
|
33
33
|
],
|
|
34
34
|
],
|
|
35
|
-
babelrc:
|
|
36
|
-
configFile:
|
|
35
|
+
babelrc: true,
|
|
36
|
+
configFile: true,
|
|
37
37
|
});
|
package/config/webpack.config.js
CHANGED
|
@@ -187,14 +187,16 @@ const baseConfigFactory = function (webpackEnv) {
|
|
|
187
187
|
};
|
|
188
188
|
|
|
189
189
|
return {
|
|
190
|
-
|
|
190
|
+
// Webpack noise constrained to errors and warnings
|
|
191
|
+
stats: 'errors-warnings',
|
|
192
|
+
mode: isEnvProduction ? 'production' : 'development',
|
|
191
193
|
// Stop compilation early in production
|
|
192
194
|
bail: isEnvProduction,
|
|
193
195
|
devtool: isEnvProduction
|
|
194
196
|
? (shouldUseSourceMap
|
|
195
197
|
? (sourceMapType || 'source-map')
|
|
196
198
|
: false)
|
|
197
|
-
: isEnvDevelopment && (sourceMapType || '
|
|
199
|
+
: isEnvDevelopment && (sourceMapType || 'cheap-module-source-map'),
|
|
198
200
|
// These are the "entry points" to our application.
|
|
199
201
|
// This means they will be the "root" imports that are included in JS bundle.
|
|
200
202
|
entry: {
|
|
@@ -406,15 +408,17 @@ const baseConfigFactory = function (webpackEnv) {
|
|
|
406
408
|
),
|
|
407
409
|
presets: [
|
|
408
410
|
[
|
|
409
|
-
require.resolve('babel-preset-
|
|
411
|
+
require.resolve('./babel-preset-extended'),
|
|
410
412
|
{
|
|
411
413
|
runtime: modules.hasJsxRuntime ? 'automatic' : 'classic',
|
|
414
|
+
flow: false,
|
|
415
|
+
typescript: true,
|
|
412
416
|
},
|
|
413
417
|
],
|
|
414
|
-
],
|
|
418
|
+
].filter(Boolean),
|
|
415
419
|
// @remove-on-eject-begin
|
|
416
|
-
babelrc:
|
|
417
|
-
configFile:
|
|
420
|
+
babelrc: true,
|
|
421
|
+
configFile: true,
|
|
418
422
|
// Make sure we have a unique cache identifier, erring on the
|
|
419
423
|
// side of caution.
|
|
420
424
|
// We remove this when the user ejects because the default
|
|
@@ -453,8 +457,8 @@ const baseConfigFactory = function (webpackEnv) {
|
|
|
453
457
|
exclude: /@babel(?:\/|\\{1,2})runtime/,
|
|
454
458
|
loader: require.resolve('babel-loader'),
|
|
455
459
|
options: {
|
|
456
|
-
babelrc:
|
|
457
|
-
configFile:
|
|
460
|
+
babelrc: true,
|
|
461
|
+
configFile: true,
|
|
458
462
|
compact: false,
|
|
459
463
|
presets: [
|
|
460
464
|
[
|
|
@@ -103,7 +103,6 @@ module.exports = function (proxy, allowedHost) {
|
|
|
103
103
|
// Serve the fallback of web previewer as the index page
|
|
104
104
|
{ directory: path.join(__dirname, 'public'), },
|
|
105
105
|
],
|
|
106
|
-
|
|
107
106
|
client: {
|
|
108
107
|
webSocketURL: {
|
|
109
108
|
// Enable custom sockjs pathname for websocket connection to hot reloading server.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactunity/scripts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Configuration and scripts for React Unity.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,42 +44,42 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@babel/core": "^7.
|
|
48
|
-
"@babel/eslint-parser": "^7.
|
|
49
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
|
50
|
-
"@svgr/webpack": "^6.
|
|
51
|
-
"@types/react": "^18.0.
|
|
52
|
-
"@types/webpack-env": "^1.
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
54
|
-
"@typescript-eslint/parser": "^5.
|
|
55
|
-
"babel-jest": "^
|
|
56
|
-
"babel-loader": "^
|
|
47
|
+
"@babel/core": "^7.20.12",
|
|
48
|
+
"@babel/eslint-parser": "^7.19.1",
|
|
49
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
50
|
+
"@svgr/webpack": "^6.5.1",
|
|
51
|
+
"@types/react": "^18.0.28",
|
|
52
|
+
"@types/webpack-env": "^1.18.0",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^5.52.0",
|
|
54
|
+
"@typescript-eslint/parser": "^5.52.0",
|
|
55
|
+
"babel-jest": "^29.4.2",
|
|
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",
|
|
59
59
|
"bfj": "^7.0.2",
|
|
60
|
-
"camelcase": "^7.0.
|
|
60
|
+
"camelcase": "^7.0.1",
|
|
61
61
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
62
62
|
"confusing-browser-globals": "^1.0.11",
|
|
63
|
-
"css-loader": "^6.7.
|
|
64
|
-
"dotenv": "^16.0.
|
|
65
|
-
"dotenv-expand": "^
|
|
66
|
-
"eslint": "^8.
|
|
67
|
-
"eslint-plugin-import": "^2.
|
|
68
|
-
"eslint-plugin-jest": "^
|
|
69
|
-
"eslint-plugin-react": "^7.
|
|
63
|
+
"css-loader": "^6.7.3",
|
|
64
|
+
"dotenv": "^16.0.3",
|
|
65
|
+
"dotenv-expand": "^10.0.0",
|
|
66
|
+
"eslint": "^8.34.0",
|
|
67
|
+
"eslint-plugin-import": "^2.27.5",
|
|
68
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
69
|
+
"eslint-plugin-react": "^7.32.2",
|
|
70
70
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
71
|
-
"eslint-plugin-testing-library": "^5.
|
|
72
|
-
"eslint-webpack-plugin": "^
|
|
71
|
+
"eslint-plugin-testing-library": "^5.10.1",
|
|
72
|
+
"eslint-webpack-plugin": "^4.0.0",
|
|
73
73
|
"file-loader": "^6.2.0",
|
|
74
|
-
"fs-extra": "^
|
|
74
|
+
"fs-extra": "^11.1.0",
|
|
75
75
|
"identity-obj-proxy": "^3.0.0",
|
|
76
|
-
"jest": "^
|
|
77
|
-
"jest-resolve": "^
|
|
78
|
-
"jest-watch-typeahead": "^
|
|
79
|
-
"mini-css-extract-plugin": "^2.
|
|
76
|
+
"jest": "^29.4.2",
|
|
77
|
+
"jest-resolve": "^29.4.2",
|
|
78
|
+
"jest-watch-typeahead": "^2.2.2",
|
|
79
|
+
"mini-css-extract-plugin": "^2.7.2",
|
|
80
80
|
"null-loader": "^4.0.1",
|
|
81
|
-
"postcss": "^8.4.
|
|
82
|
-
"postcss-loader": "^7.0.
|
|
81
|
+
"postcss": "^8.4.21",
|
|
82
|
+
"postcss-loader": "^7.0.2",
|
|
83
83
|
"prompts": "^2.4.2",
|
|
84
84
|
"raw-loader": "^4.0.2",
|
|
85
85
|
"react-app-polyfill": "^3.0.0",
|
|
@@ -87,29 +87,29 @@
|
|
|
87
87
|
"react-refresh": "^0.14.0",
|
|
88
88
|
"resolve": "^1.22.1",
|
|
89
89
|
"resolve-url-loader": "^5.0.0",
|
|
90
|
-
"sass": "^1.
|
|
91
|
-
"sass-loader": "^13.0
|
|
92
|
-
"semver": "^7.3.
|
|
93
|
-
"source-map-loader": "^4.0.
|
|
90
|
+
"sass": "^1.58.0",
|
|
91
|
+
"sass-loader": "^13.2.0",
|
|
92
|
+
"semver": "^7.3.8",
|
|
93
|
+
"source-map-loader": "^4.0.1",
|
|
94
94
|
"style-loader": "^3.3.1",
|
|
95
|
-
"tailwindcss": "^3.
|
|
96
|
-
"terser-webpack-plugin": "^5.3.
|
|
95
|
+
"tailwindcss": "^3.2.6",
|
|
96
|
+
"terser-webpack-plugin": "^5.3.6",
|
|
97
97
|
"url-loader": "^4.1.1",
|
|
98
|
-
"webpack": "^5.
|
|
99
|
-
"webpack-dev-server": "^4.
|
|
98
|
+
"webpack": "^5.75.0",
|
|
99
|
+
"webpack-dev-server": "^4.11.1",
|
|
100
100
|
"webpack-manifest-plugin": "^5.0.0"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"typescript": "^4.
|
|
103
|
+
"typescript": "^4.9.5"
|
|
104
104
|
},
|
|
105
105
|
"optionalDependencies": {
|
|
106
106
|
"fsevents": "^2.3.2"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
109
109
|
"@reactunity/previewer": "*",
|
|
110
|
-
"@reactunity/renderer": "^0.
|
|
110
|
+
"@reactunity/renderer": "^0.14.0",
|
|
111
111
|
"react": "^18.0.0",
|
|
112
|
-
"typescript": "^4.
|
|
112
|
+
"typescript": "^4.9.5"
|
|
113
113
|
},
|
|
114
114
|
"peerDependenciesMeta": {
|
|
115
115
|
"@reactunity/previewer": {
|