Skip to content

Commit

Permalink
Remove cached lockfile
Browse files Browse the repository at this point in the history
To go along with #11474, we no longer need the cached lockfile after unpinning all the dependencies.

This PR should removes all references to it in the creation of new projects and the tests.
  • Loading branch information
lukekarrys committed Dec 2, 2021
1 parent e8319da commit f559dd0
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 8,837 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ By default git would use `CRLF` line endings which would cause the scripts to fa
2. Close the milestone and create a new one for the next release.
3. In most releases, only `react-scripts` needs to be released. If you don’t have any changes to the `packages/create-react-app` folder, you don’t need to bump its version or publish it (the publish script will publish only changed packages).
4. Note that files in `packages/create-react-app` should be modified with extreme caution. Since it’s a global CLI, any version of `create-react-app` (global CLI) including very old ones should work with the latest version of `react-scripts`.
5. Pull the latest changes from GitHub, run `npm ci` and then `npm run compile:lockfile`. The command will generate an updated lockfile in `packages/create-react-app` that should be committed.
5. Pull the latest changes from GitHub, run `npm ci`.
6. Create a change log entry for the release:

- You'll need an [access token for the GitHub API](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). Save it to this environment variable: `export GITHUB_AUTH="..."`
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"alex": "alex .",
"test:integration": "jest test/integration",
"test": "cd packages/react-scripts && node bin/react-scripts.js test",
"format": "prettier --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'",
"compile:lockfile": "node tasks/compile-lockfile.js"
"format": "prettier --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.4",
Expand Down
23 changes: 1 addition & 22 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,6 @@ function createApp(name, verbose, version, template, useYarn, usePnp) {
}
}

if (useYarn) {
let yarnUsesDefaultRegistry = true;
try {
yarnUsesDefaultRegistry =
execSync('yarnpkg config get registry').toString().trim() ===
'https://registry.yarnpkg.com';
} catch (e) {
// ignore
}
if (yarnUsesDefaultRegistry) {
fs.copySync(
require.resolve('./yarn.lock.cached'),
path.join(root, 'yarn.lock')
);
}
}

run(
root,
appName,
Expand Down Expand Up @@ -540,11 +523,7 @@ function run(
console.log();

// On 'exit' we will delete these files from target directory.
const knownGeneratedFiles = [
'package.json',
'yarn.lock',
'node_modules',
];
const knownGeneratedFiles = ['package.json', 'node_modules'];
const currentFiles = fs.readdirSync(path.join(root));
currentFiles.forEach(file => {
knownGeneratedFiles.forEach(fileToMatch => {
Expand Down
3 changes: 1 addition & 2 deletions packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
},
"files": [
"index.js",
"createReactApp.js",
"yarn.lock.cached"
"createReactApp.js"
],
"bin": {
"create-react-app": "./index.js"
Expand Down
8,757 changes: 0 additions & 8,757 deletions packages/create-react-app/yarn.lock.cached

This file was deleted.

49 changes: 0 additions & 49 deletions tasks/compile-lockfile.js

This file was deleted.

4 changes: 0 additions & 4 deletions tasks/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ set -x
cd ..
root_path=$PWD

if [ -z $CI ]; then
npm run compile:lockfile
fi

if [ -n "$(git status --porcelain)" ]; then
echo "Your git status is not clean. Aborting.";
exit 1;
Expand Down

0 comments on commit f559dd0

Please sign in to comment.