From 59ed0cacc993e512f6c93646b8787ac7619cd5f2 Mon Sep 17 00:00:00 2001 From: James Ide Date: Wed, 24 Jun 2015 12:14:38 -0700 Subject: [PATCH] [npm] Add the semver caret to package.json deps The caret is standard for `npm --save` and makes it easier to get bugfixes from package maintainers. As I understand it, Facebook pins the versions since the packages are manually downloaded. One issue with this is that the dependencies of dependencies aren't pinned so what probably makes the most sense for Facebook is to use `npm shrinkwrap` which recursively pins the versions of all dependencies. How this works is: 1. Someone at Facebook manually downloads the latest version of an npm package they want to use 2. They add the entry to package.json using the caret, ex: `"babel": "^5.6.5"` 3. They run `npm shrinkwrap` to generate npm-shrinkwrap.json so the exact versions of the packages are recorded and if you were to run `npm install` then it would know to get those specific versions (example npm-shrinkwrap.json: https://gist.github.com/ide/a2f6e6818802e39978d5) 4. package.json is synced out to GitHub but npm-shrinkwrap.json is not 5. External users run `npm install` and get the latest compatible versions of all packages Test Plan: Ran UIExplorer and tested the Chrome debugger. --- package.json | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 13c57fbebde27c..0a397818e80654 100644 --- a/package.json +++ b/package.json @@ -45,36 +45,36 @@ "react-native-start": "packager/packager.sh" }, "dependencies": { - "absolute-path": "0.0.0", - "babel": "5.4.3", + "absolute-path": "^0.0.0", + "babel": "^5.4.3", "babel-core": "^5.6.4", "bluebird": "^2.9.21", "chalk": "^1.0.0", - "connect": "2.8.3", - "debug": "~2.1.0", + "connect": "^2.8.3", + "debug": "^2.1.0", "graceful-fs": "^3.0.6", - "image-size": "0.3.5", - "joi": "~5.1.0", - "jstransform": "11.0.1", - "module-deps": "3.5.6", - "optimist": "0.6.1", + "image-size": "^0.3.5", + "joi": "^5.1.0", + "jstransform": "^11.0.1", + "module-deps": "^3.5.6", + "optimist": "^0.6.1", "promise": "^7.0.3", "react-timer-mixin": "^0.13.1", - "react-tools": "0.13.2", + "react-tools": "^0.13.2", "rebound": "^0.0.12", "sane": "^1.1.2", - "source-map": "0.1.31", + "source-map": "^0.1.31", "stacktrace-parser": "frantic/stacktrace-parser#493c5e5638", - "uglify-js": "~2.4.16", - "underscore": "1.7.0", + "uglify-js": "^2.4.16", + "underscore": "^1.7.0", "worker-farm": "^1.3.1", - "ws": "0.4.31", - "yargs": "1.3.2" + "ws": "^0.4.31", + "yargs": "^1.3.2" }, "devDependencies": { - "jest-cli": "0.4.5", - "babel-eslint": "3.1.5", - "eslint": "0.21.2", - "eslint-plugin-react": "2.3.0" + "jest-cli": "^0.4.5", + "babel-eslint": "^3.1.5", + "eslint": "^0.21.2", + "eslint-plugin-react": "^2.3.0" } }