Move package script out and make it tar into a versioned top level directory. It may as well be a shell script since it's unix specific anyway, and maintaining it inside package.json is now impractical.

This commit is contained in:
David Baker 2016-02-24 18:41:30 +00:00
parent b088651211
commit 874123bbfa
2 changed files with 15 additions and 1 deletions

View File

@ -17,7 +17,7 @@
"build:compile": "babel --source-maps -d lib src", "build:compile": "babel --source-maps -d lib src",
"build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js", "build:bundle": "NODE_ENV=production webpack -p lib/vector/index.js vector/bundle.js",
"build": "npm run build:css && npm run build:compile && npm run build:bundle", "build": "npm run build:css && npm run build:compile && npm run build:bundle",
"package": "npm run build && mkdir -p packages && tar chvzf packages/vector-`git describe --dirty --tags || echo unknown`.tar.gz vector", "package": "scripts/package.sh",
"start:js": "webpack -w src/vector/index.js vector/bundle.js", "start:js": "webpack -w src/vector/index.js vector/bundle.js",
"start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js", "start:js:prod": "NODE_ENV=production webpack -w src/vector/index.js vector/bundle.js",
"start:skins:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css", "start:skins:css": "catw \"src/skins/vector/css/**/*.css\" -o vector/components.css",

14
scripts/package.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
set -e
version=`git describe --dirty --tags || echo unknown`
npm run build
mkdir -p packages
ln -s vector vector-$version
tar chvzf packages/vector-$version.tar.gz vector-$version
rm vector-$version
echo
echo "Packaged packages/vector-$version.tar.gz"