Skip to content

Commit

Permalink
npm owners scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Oct 24, 2016
1 parent 5b03058 commit 6958bed
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ To run current plugin timing on a file:
```sh
$ ./scripts/plugin-timing.js file.js
```

### Releasing

Use `npm run publish`. It will run `lerna publish` (we use --independent) so it will prompt the version number for every package.

If you are releasing a new package, you'll want to run `.scripts/npm-owner-update.sh` to add all owners to the new npm package.
4 changes: 4 additions & 0 deletions NPM_OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
amasad
hzoo
kangax
boopathi
4 changes: 4 additions & 0 deletions scripts/NPM_OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hzoo
amasad
kangax
boopathi
22 changes: 22 additions & 0 deletions scripts/npm-owner-grant.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
set -e

read -p "Username: " username
read -p "Are you sure you want to add $username to all packages (y/n)? " confirm

if [ "$confirm" != "y" ]; then
echo "Ok bye."
exit 0
fi

for f in packages/*; do
package=`basename $f`

if [ -d "$f" ] && [ -e "$f/package.json" ]; then
npm owner add $username $package
fi
done

echo "$username" >> NPM_OWNERS

echo "Success."
24 changes: 24 additions & 0 deletions scripts/npm-owner-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -e

cat NPM_OWNERS
read -p "Do you want to add the above owners to all packages (y/n)? " confirm

if [ "$confirm" != "y" ]; then
echo "Ok bye."
exit 0
fi

while read username
do
for f in packages/*; do
package=`basename $f`

if [ -d "$f" ] && [ -e "$f/package.json" ]; then
echo "Adding $username to $package."
npm owner add $username $package
fi
done
done < NPM_OWNERS

echo "Success."

0 comments on commit 6958bed

Please sign in to comment.