Skip to content

Commit e36b8f4

Browse files
committed
update packages & remove react dependency
1 parent fa460b9 commit e36b8f4

File tree

5 files changed

+34
-42
lines changed

5 files changed

+34
-42
lines changed

config/env.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const dotenvFiles = [
4040
// https://github.com/motdotla/dotenv-expand
4141
dotenvFiles.forEach(dotenvFile => {
4242
if (fs.existsSync(dotenvFile)) {
43-
require('dotenv-expand')(
43+
require('dotenv-expand').expand(
4444
require('dotenv').config({
4545
path: dotenvFile,
4646
})

config/webpack.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,8 @@ module.exports = function (webpackEnv) {
657657
if (fs.existsSync(paths.webpackSetup)) {
658658
const customSetup = require(paths.webpackSetup);
659659

660+
console.log(`Using custom webpack config found in '${paths.webpackSetup}'`);
661+
660662
if (typeof customSetup !== 'function') {
661663
throw new Error('Custom webpack config file must export a function that accepts `env` as first parameter and `defaultConfig` as second');
662664
}

package.json

+26-27
Original file line numberDiff line numberDiff line change
@@ -44,71 +44,70 @@
4444
}
4545
},
4646
"dependencies": {
47-
"@babel/core": "^7.16.7",
48-
"@babel/eslint-parser": "^7.16.5",
47+
"@babel/core": "^7.17.0",
48+
"@babel/eslint-parser": "^7.17.0",
4949
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
50-
"@types/react": "^17.0.38",
50+
"@types/react": "^17.0.39",
5151
"@types/webpack-env": "^1.16.3",
52-
"@typescript-eslint/eslint-plugin": "^5.9.1",
53-
"@typescript-eslint/parser": "^5.9.1",
54-
"babel-jest": "^27.4.6",
52+
"@typescript-eslint/eslint-plugin": "^5.10.2",
53+
"@typescript-eslint/parser": "^5.10.2",
54+
"babel-jest": "^27.5.0",
5555
"babel-loader": "^8.2.3",
5656
"babel-plugin-named-asset-import": "^0.3.8",
5757
"babel-preset-react-app": "^10.0.1",
5858
"bfj": "^7.0.2",
5959
"camelcase": "^6.3.0",
6060
"case-sensitive-paths-webpack-plugin": "^2.4.0",
6161
"confusing-browser-globals": "^1.0.11",
62-
"css-loader": "^6.5.1",
63-
"dotenv": "^11.0.0",
64-
"dotenv-expand": "^5.1.0",
65-
"eslint": "^8.6.0",
62+
"css-loader": "^6.6.0",
63+
"dotenv": "^16.0.0",
64+
"dotenv-expand": "^8.0.1",
65+
"eslint": "^8.8.0",
6666
"eslint-plugin-import": "^2.25.4",
67-
"eslint-plugin-jest": "^25.3.4",
67+
"eslint-plugin-jest": "^26.0.0",
6868
"eslint-plugin-react": "^7.28.0",
6969
"eslint-plugin-react-hooks": "^4.3.0",
70-
"eslint-plugin-testing-library": "^5.0.3",
70+
"eslint-plugin-testing-library": "^5.0.5",
7171
"eslint-webpack-plugin": "^3.1.1",
7272
"file-loader": "^6.2.0",
7373
"fs-extra": "^10.0.0",
7474
"identity-obj-proxy": "^3.0.0",
75-
"jest": "^27.4.7",
76-
"jest-resolve": "^27.4.6",
75+
"jest": "^27.5.0",
76+
"jest-resolve": "^27.5.0",
7777
"jest-watch-typeahead": "^1.0.0",
78-
"mini-css-extract-plugin": "^2.4.7",
78+
"mini-css-extract-plugin": "^2.5.3",
7979
"null-loader": "^4.0.1",
80-
"postcss": "^8.4.5",
80+
"postcss": "^8.4.6",
8181
"postcss-loader": "^6.2.1",
8282
"prompts": "^2.4.2",
8383
"raw-loader": "^4.0.2",
8484
"react-app-polyfill": "^3.0.0",
8585
"react-dev-utils": "^12.0.0",
8686
"react-refresh": "^0.11.0",
87-
"resolve": "^1.21.0",
88-
"resolve-url-loader": "^4.0.0",
89-
"sass": "^1.48.0",
87+
"resolve": "^1.22.0",
88+
"resolve-url-loader": "^5.0.0",
89+
"sass": "^1.49.7",
9090
"sass-loader": "^12.4.0",
9191
"semver": "^7.3.5",
9292
"source-map-loader": "^3.0.1",
9393
"style-loader": "^3.3.1",
94-
"tailwindcss": "^3.0.13",
95-
"terser-webpack-plugin": "^5.3.0",
94+
"tailwindcss": "^3.0.18",
95+
"terser-webpack-plugin": "^5.3.1",
9696
"url-loader": "^4.1.1",
97-
"webpack": "^5.66.0",
98-
"webpack-dev-server": "^4.7.3",
97+
"webpack": "^5.68.0",
98+
"webpack-dev-server": "^4.7.4",
9999
"webpack-manifest-plugin": "^4.1.1"
100100
},
101101
"devDependencies": {
102-
"react": "^17.0.2",
103-
"typescript": "^4.5.4"
102+
"typescript": "^4.5.5"
104103
},
105104
"optionalDependencies": {
106105
"fsevents": "^2.3.2"
107106
},
108107
"peerDependencies": {
109-
"@reactunity/renderer": "^0.8.0",
108+
"@reactunity/renderer": "^0.9.0",
110109
"react": ">= 16",
111-
"typescript": "^4.5.4"
110+
"typescript": "^4.5.5"
112111
},
113112
"peerDependenciesMeta": {
114113
"typescript": {

scripts/init.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@ module.exports = function (
312312
);
313313
}
314314

315-
// Install react and react-dom for backward compatibility with old CRA cli
316-
// which doesn't install react and react-dom along with react-unity-scripts
315+
// Install react and @reactunity/renderer for backward compatibility with old CRA cli
316+
// which doesn't install react and @reactunity/renderer along with react-unity-scripts
317317
if (!isReactInstalled(appPackage)) {
318-
args = args.concat(['react', 'react-dom']);
318+
args = args.concat(['react', '@reactunity/renderer']);
319319
}
320320

321-
// Install template dependencies, and react and react-dom if missing.
321+
// Install template dependencies, and react and @reactunity/renderer if missing.
322322
if ((!isReactInstalled(appPackage) || templateName) && args.length > 1) {
323323
console.log();
324324
console.log(`Installing template dependencies using ${command}...`);
@@ -412,6 +412,6 @@ function isReactInstalled(appPackage) {
412412

413413
return (
414414
typeof dependencies.react !== 'undefined' &&
415-
typeof dependencies['react-dom'] !== 'undefined'
415+
typeof dependencies['@reactunity/renderer'] !== 'undefined'
416416
);
417417
}

scripts/start.js

-9
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const paths = require('../config/paths');
4747
const configFactory = require('../config/webpack.config');
4848
const createDevServerConfig = require('../config/webpackDevServer.config');
4949
const getClientEnvironment = require('../config/env');
50-
const react = require(require.resolve('react', { paths: [paths.appPath] }));
5150

5251
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
5352
const useYarn = fs.existsSync(paths.yarnLockFile);
@@ -134,14 +133,6 @@ checkBrowsers(paths.appPath, isInteractive)
134133
clearConsole();
135134
}
136135

137-
if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {
138-
console.log(
139-
chalk.yellow(
140-
`Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`
141-
)
142-
);
143-
}
144-
145136
console.log(chalk.cyan('Starting the development server...\n'));
146137
});
147138

0 commit comments

Comments
 (0)