Skip to content

Commit

Permalink
chore: deduplicate lock, update packages repository fields (#30044)
Browse files Browse the repository at this point in the history
Summary:
This small PR includes the following changes:
* deduplicate yarn lock file using [`yarn-deduplicate`](https://github.com/atlassian/yarn-deduplicate) package
  * deduplicate script has been added as `update-lock`, let me know if you would like also to see this in [`postinstall`](https://docs.npmjs.com/misc/scripts) (to automatically optimize lock on every dependency change)
* according to the [npm docs](https://docs.npmjs.com/files/package.json#repository):
  * main `package.json` repository field has been replaced with shorthand
  * monorepo packages repository field has been extended by `directory`

The main goal of introducing deduplication script was to optimize the dependencies footprint while developing and speed up the initial installation process. Running `yarn-deduplicate` also increase the security in some way, because it enforces usage only of the latest version of the package. You can read more about the benefits in the deduplicate script [repository](https://github.com/atlassian/yarn-deduplicate#duplicated-packages).

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Added] - add yarn lock deduplication script

Pull Request resolved: #30044

Test Plan: `yarn install` was successful, this also should not affect yarn workspaces in any way.

Reviewed By: GijsWeterings

Differential Revision: D23959812

Pulled By: cpojer

fbshipit-source-id: e2455e3718378e1ce6206e79463d4083f8fe5d47
  • Loading branch information
Simek authored and facebook-github-bot committed Sep 29, 2020
1 parent 2160377 commit 29f5dc2
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 499 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
"bin": "./cli.js",
"description": "A framework for building native apps using React",
"license": "MIT",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
},
"repository": "github:facebook/react-native",
"engines": {
"node": ">=10"
},
Expand Down Expand Up @@ -64,6 +61,7 @@
"format": "npm run prettier && npm run clang-format",
"prettier": "prettier --write \"./**/*.{js,md,yml}\"",
"format-check": "prettier --list-different \"./**/*.{js,md,yml}\"",
"update-lock": "npx yarn-deduplicate",
"docker-setup-android": "docker pull reactnativecommunity/react-native-android",
"docker-build-android": "docker build -t reactnativeci/android -f .circleci/Dockerfiles/Dockerfile.android .",
"test-android-run-instrumentation": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash .circleci/Dockerfiles/scripts/run-android-docker-instrumentation-tests.sh",
Expand Down
3 changes: 2 additions & 1 deletion packages/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Asset support code for React Native.",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/assets"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/babel-plugin-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Babel plugin to generate native module and view manager code for React Native.",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/babel-plugin-codegen"
},
"dependencies": {
"react-native-codegen": "*"
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config-react-native-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/eslint-config-react-native-community"
},
"homepage": "https://github.com/facebook/react-native/tree/master/packages/eslint-config-react-native-community#readme",
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/eslint-plugin-codegen"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/eslint-plugin-react-native-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/eslint-plugin-react-native-community"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/normalize-color/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Color normalization code for React Native.",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/normalize-color"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Polyfills for React Native.",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/polyfills"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/react-native-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"homepage": "https://github.com/facebook/react-native/tree/master/packages/react-native-codegen",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/react-native-codegen"
},
"scripts": {
"build": "yarn clean && node scripts/build.js --verbose",
Expand Down
3 changes: 2 additions & 1 deletion packages/rn-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"homepage": "https://github.com/facebook/react-native/tree/master/packages/rn-tester",
"repository": {
"type": "git",
"url": "git@github.com:facebook/react-native.git"
"url": "git@github.com:facebook/react-native.git",
"directory": "packages/rn-tester"
},
"dependencies": {
"invariant": "^2.2.4",
Expand Down
Loading

0 comments on commit 29f5dc2

Please sign in to comment.