Skip to content

Commit

Permalink
Improve publishing experience
Browse files Browse the repository at this point in the history
In preparation for publishing v4, I wanted to bring over some of the npm
scripts I had set up for react-with-styles. This should make publishing
the next version a bit smoother.

I also needed to make Karma run as a single run by default, so I added a
testonly:watch script that allows you to run it in non-single-run mode
if you like.
  • Loading branch information
lencioni committed Oct 19, 2016
1 parent 54d9b84 commit 330dbed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
3 changes: 1 addition & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ module.exports = function(config) {
browsers: process.env.CONTINUOUS_INTEGRATION === 'true' ?
['Firefox'] : ['Chrome'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: process.env.CONTINUOUS_INTEGRATION === 'true'
singleRun: true,
});
};
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@
"bugs": "https://github.com/brigade/react-waypoint/issues",
"scripts": {
"build": "npm run clean && babel src/ -d build/",
"check-changelog": "expr $(git status --porcelain 2>/dev/null| grep \"^\\s*M.*CHANGELOG.md\" | wc -l) >/dev/null || (echo 'Please edit CHANGELOG.md' && exit 1)",
"check-only-changelog-changed": "(expr $(git status --porcelain 2>/dev/null| grep -v \"CHANGELOG.md\" | wc -l) >/dev/null && echo 'Only CHANGELOG.md may have uncommitted changes' && exit 1) || exit 0",
"clean": "rimraf build",
"lint": "eslint . --ext .js,.jsx",
"prepublish": "in-publish && npm run build || not-in-publish",
"test": "npm run lint && npm run testonly",
"testonly": "karma start"
"postversion": "git commit package.json CHANGELOG.md -m \"Version $npm_package_version\" && npm run tag && git push && git push --tags && npm publish",
"prepublish": "in-publish && safe-publish-latest && npm run build || not-in-publish",
"pretest": "npm run --silent lint",
"preversion": "npm run test && npm run check-changelog && npm run check-only-changelog-changed",
"tag": "git tag v$npm_package_version",
"test": "npm run testonly",
"testonly": "karma start --single-run",
"testonly:watch": "karma start --no-single-run",
"version:major": "npm --no-git-tag-version version major",
"version:minor": "npm --no-git-tag-version version minor",
"version:patch": "npm --no-git-tag-version version patch"
},
"author": "Brigade Engineering",
"license": "MIT",
Expand Down Expand Up @@ -44,6 +54,7 @@
"react": "^15.0.0",
"react-dom": "^15.0.0",
"rimraf": "^2.5.2",
"safe-publish-latest": "^1.1.1",
"webpack": "^1.5.3"
},
"keywords": [
Expand Down

0 comments on commit 330dbed

Please sign in to comment.