Skip to content

Commit 6998bc6

Browse files
committed
fix: resolve PnP and yarn.lock.cache issues
1 parent 923e2cf commit 6998bc6

File tree

8 files changed

+1540
-1420
lines changed

8 files changed

+1540
-1420
lines changed

packages/cra-template-typescript/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"typescript"
99
],
1010
"description": "The base TypeScript template for Create React App.",
11+
"main": "template.json",
1112
"repository": {
1213
"type": "git",
1314
"url": "https://github.com/facebook/create-react-app.git",

packages/cra-template/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"template"
88
],
99
"description": "The base template for Create React App.",
10+
"main": "template.json",
1011
"repository": {
1112
"type": "git",
1213
"url": "https://github.com/facebook/create-react-app.git",

packages/create-react-app/createReactApp.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function createApp(
216216
useTypeScript
217217
) {
218218
const unsupportedNodeVersion = !semver.satisfies(process.version, '>=8.10.0');
219-
if (unsupportedNodeVersion && useTypescript) {
219+
if (unsupportedNodeVersion && useTypeScript) {
220220
console.log(
221221
chalk.red(
222222
`You are using Node ${process.version} with the TypeScript template. Node 8.10 or higher is required to use TypeScript.\n`
@@ -452,7 +452,7 @@ function run(
452452

453453
// Only support templates when used alongside new react-scripts versions.
454454
const supportsTemplates = semver.gte(
455-
packageVersion,
455+
semver.coerce(packageVersion),
456456
templatesVersionMinimum
457457
);
458458
if (supportsTemplates) {

packages/create-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-app",
3-
"version": "3.2.0",
3+
"version": "3.3.0-beta",
44
"keywords": [
55
"react"
66
],

packages/create-react-app/yarn.lock.cached

+1,527-1,413
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"name": "kitchensink",
3-
"version": "1.0.0"
2+
"name": "kitchensink",
3+
"main": "template.json",
4+
"version": "1.0.0"
45
}

packages/react-scripts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scripts",
3-
"version": "3.2.0",
3+
"version": "3.3.0-beta",
44
"description": "Configuration and scripts for Create React App.",
55
"repository": {
66
"type": "git",

packages/react-scripts/scripts/init.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ module.exports = function(
100100
return;
101101
}
102102

103-
const templatePath = path.join(appPath, 'node_modules', templateName);
103+
const templatePath = path.join(
104+
require.resolve(templateName, { paths: [appPath] }),
105+
'..'
106+
);
104107

105108
// Copy over some of the devDependencies
106109
appPackage.dependencies = appPackage.dependencies || {};

0 commit comments

Comments
 (0)