Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Create React App [![Build & Test](https://github.com/facebook/create-react-app/actions/workflows/build-and-test.yml/badge.svg?branch=main)](https://github.com/facebook/create-react-app/actions/workflows/build-and-test.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/main/CONTRIBUTING.md)
## Create React App [![Build & Test](https://github.com/facebook/create-react-app/actions/workflows/build-and-test.yml/badge.svg?branch=main)](https://github.com/facebook/create-react-app/actions/workflows/build-and-test.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/main/CONTRIBUTING.md)

> [!CAUTION]
> ## Deprecated
> Create React App was one of the key tools for getting a React project up-and-running in 2017-2021, it is now in long-term stasis and we recommend that you migrate to one of React frameworks documented on [Start a New React Project](https://react.dev/learn/start-a-new-react-project).
>
> If you are following a tutorial to learn React, there is still value in continuing your tutorial, but we do not recommend starting production apps based on Create React App.

<img alt="Logo" align="right" src="https://create-react-app.dev/img/logo.svg" width="20%" />

Expand Down
32 changes: 32 additions & 0 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,41 @@ function isUsingYarn() {
return (process.env.npm_config_user_agent || '').indexOf('yarn') === 0;
}

function hasGivenWarning() {
const localWarningFilePath = path.join(
__dirname,
'given-deprecation-warning'
);
return fs.existsSync(localWarningFilePath);
}

function writeWarningFile() {
const localWarningFilePath = path.join(
__dirname,
'given-deprecation-warning'
);
fs.writeFileSync(localWarningFilePath, 'true');
}

let projectName;

function init() {
if (!hasGivenWarning()) {
console.log(chalk.yellow.bold('create-react-app is deprecated.'));
console.log('');
console.log(
'You can find a list of up-to-date React frameworks on react.dev'
);
console.log(
chalk.underline('https://react.dev/learn/start-a-new-react-project')
);
console.log('');
console.log(
chalk.grey('This error message will only be shown once per install.')
);
writeWarningFile();
}

const program = new commander.Command(packageJson.name)
.version(packageJson.version)
.arguments('<project-directory>')
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-app",
"version": "5.0.1",
"version": "5.0.2",
"keywords": [
"react"
],
Expand Down
Loading