Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] reroute npm publish to deploy scripts #190

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"compile:browser": "rm -rf ./dist && mkdir ./dist && browserify ./lib/src/index.js -o=./dist/index.js && npm run minify:browser",
"minify:browser": "uglifyjs --compress --mangle --screw-ie8 -o=./dist/index.min.js -- ./dist/index.js",
"watch": "tsc -w",
"prepublish": "npm run compile",
"prepublish": "npm run deploy",
"lint": "grunt tslint",
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace lib/test/tests.js",
"postcoverage": "remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info",
Expand Down
11 changes: 10 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#!/bin/sh -e
# Because of a long-running npm issue (https://github.com/npm/npm/issues/3059)
# prepublish runs after `npm install` and `npm pack`.
# In order to only run prepublish before `npm publish`, we have to check argv.
if node -e "process.exit(($npm_config_argv).original[0].indexOf('pu') === 0)"; then
exit 0;
fi


if node -e "process.exit(process.platform.indexOf('win32') === 0)"; then
exit 0;
fi

# When we publish to npm, the published files are available in the root
# directory, which allows for a clean include or require of sub-modules.
#
# var language = require('apollo-client/parser');
#

npm run compile

rm -rf ./npm
Expand Down