npmversioner
v1.0.2
Published
This module updates npm packge versions and dependency references
Downloads
2
Readme
NPM Versioner
This is the long awaited NPM Versioner. This tool does the following:
- Updates NPM interdependencies between our private NPM modules and Git repos
- Publishes updated NPM modules
- Displays a list of repos that need to be PR'd
Setup
- In the root of the app, create a file called
basepathconfig.json
- Inside of the file, add the path to the folder that contains your git repositories:
{
"basePath": "/your/base/repo/path/here"
}
Before running the app
- Make sure that you've cloned all of our repositories to your local machine.
- Make sure to merge in the latest Sift.Lib
master
branch from GitHub
Running the app
node app
- Select the packages you've changed that need to be updated
- Confirm the change by typing
y
at the prompt if everything looks good - The app will update and publish your packages then inform you of which github repos need to be committed to
Adding a new module
If you create a new module, add it to the config.json
file using the format:
{
"name": {package name},
"description": {package description (optional)},
"configLocation": {relative folder path to package.json location},
"isNPM": {set to true if this is a sift.lib package}
}
Linking Script
We recommend npm linking all @sift packages on development machines. This ensures that you can write code and test it in real time without publishing to npm.
The siftliblinks.sh
script in this repo will perform all of the necessary linking.
To run:
cd /your/git/directory
sudo chmod +x ./NpmVersioner/siftliblinks.sh #(first time only)
sudo chown -R {yourUserName} {/your/base/repo/path/here}
sudo chown -R /usr/local/lib/node_modules
./NpmVersioner/siftliblinks.sh '{/your/base/repo/path/here}'
Note: You MUST run this script inside of your git directory.
Bash Utilities
Get latest from all repos
** Please note the variables within the script: yourGitFolder, nameForBaseRemote
cd ~/{{yourGitFolder}}/
for i in $(ls -d Sift*/)
do
cd ~/git/$i
echo
echo
echo =========== Start updating $i ==============
git remote update {{nameForBaseRemote}}
if [ $(git rev-parse master) = $(git rev-parse {{nameForBaseRemote}}/master) ]
then
echo ++++++++++ $i is up to date ++++++++++
else
echo ======= Updating origin with upstream=====
git checkout master
git pull {{nameForBaseRemote}} master
# git push origin master
# echo ====== Updating local master =====
# git pull --rebase
fi
done
Install.js
The purpose of install.js is to install all node modules on sift lib.
To run simply type in node install