Skip to content

Updating Package Dependencies

Rui Marinho edited this page Mar 6, 2015 · 8 revisions

Updating libphonenumber

Fetch the wanted tag or revision from the googlei18n/libphonenumber repository:

curl -L https://github.com/googlei18n/libphonenumber/archive/libphonenumber-<tag>.tar.gz | tar -xvf - --strip-components=4 -C lib/closure/goog/i18n/phonenumbers --include=*javascript/i18n/phonenumbers*

Run npm test and make sure all tests pass. That's it!

If the googlei18n/libphonenumber update modifies the required dependencies, something unlikely to happen on a minor or patch release, you can also automatically generate the new ones by running:

chmod +x node_modules/seegno-closure-library/closure/bin/build/depswriter.py
rm ./lib/closure/goog/deps.js && node_modules/seegno-closure-library/closure/bin/build/depswriter.py --root_with_prefix="./lib/closure/goog '<basePath>/lib/closure/goog'" | sed -E '/metadatalite|metadatafortesting/d' | sed -E $'s/\'<basePath>/basePath + \'/' > ./lib/closure/goog/deps.js

Updating seegno-closure-library

This project uses a mirror of the upstream Google Closure Library but repackaged for npm and without global namespace pollution. The package is maintained by Seegno and receives regular updates.

If you absolutely need to update to the latest Google Closure Library version you may have to fork the seegno-closure-library and follow the project's instructions on how to merge with the upstream repository. This is unlikely to happen because libphonenumber uses a very small and pretty stable set of closure dependences.

Push the changes to your fork and add the following lines to your project's package.json :

"dependencies": {
  "seegno-closure-library": "git://github.com/<username>/closure-library#<commit-sha1,branch,tag>"
}

Run npm install and after a successful install, the library should pick that version instead.

Clone this wiki locally