This repository has been archived by the owner on Oct 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): Add semantic-release and more...
Update eslint support, add commitizen, add publish-latest (going to get rid of dist in master)
- Loading branch information
Kent C. Dodds
committed
Sep 26, 2015
1 parent
7e8cb7d
commit 37ed4b8
Showing
17 changed files
with
236 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"extends": "./node_modules/kcd-common-tools/shared/.eslintrc" | ||
// this exists solely for editors. The test and app eslints are slightly different | ||
// and the app validates the app code via the other/app.eslintrc and validates the | ||
// test code via the other/test.eslintrc | ||
// we simply use the test.eslintrc so our editors don't get mad at us. | ||
"extends": "./other/test.eslintrc" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
branches: | ||
only: | ||
- master | ||
notifications: | ||
email: false | ||
node_js: | ||
- iojs | ||
before_install: | ||
- npm i -g npm@^2.0.0 | ||
before_script: | ||
- npm prune | ||
script: | ||
- npm run code-checks | ||
- npm t | ||
- npm run check-coverage | ||
after_success: | ||
- npm run report-coverage | ||
- npm run semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//! api-check version 7.5.0 built with ♥ by Kent C. Dodds <[email protected]> (http://kent.doddsfamily.us) (ó ì_í)=óò=(ì_í ò) | ||
//! api-check version 0.0.0-semantically-released.0 built with ♥ by Kent C. Dodds <[email protected]> (http://kent.doddsfamily.us) (ó ì_í)=óò=(ì_í ò) | ||
|
||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
|
@@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
var apiCheckApis = getApiCheckApis(); | ||
|
||
module.exports = getApiCheckInstance; | ||
module.exports.VERSION = ("7.5.0"); | ||
module.exports.VERSION = ("0.0.0-semantically-released.0"); | ||
module.exports.utils = apiCheckUtil; | ||
module.exports.globalConfig = { | ||
verbose: false, | ||
|
@@ -151,9 +151,9 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
/** | ||
* This is the instance function. Other things are attached to this see additional properties above. | ||
* @param api {Array} | ||
* @param args {arguments} | ||
* @param output {Object} | ||
* @param {Array} api - the checkers to check with | ||
* @param {Array} args - the args to check | ||
* @param {Object} output - output options | ||
* @returns {Object} - if this has a failed = true property, then it failed | ||
*/ | ||
function apiCheck(api, args, output) { | ||
|
@@ -195,7 +195,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
/** | ||
* checkApiCheckApi, should be read like: check apiCheck api. As in, check the api for apiCheck :-) | ||
* @param checkApiArgs | ||
* @param {Array} checkApiArgs - args provided to apiCheck function | ||
*/ | ||
function checkApiCheckApi(checkApiArgs) { | ||
var api = checkApiArgs[0]; | ||
|
@@ -348,9 +348,9 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
/** | ||
* This is where the magic happens for actually checking the arguments with the api. | ||
* @param api {Array} - checkers | ||
* @param args {Array} - and arguments object | ||
* @returns {Array} | ||
* @param {Array} api - checkers | ||
* @param {Array} args - and arguments object | ||
* @returns {Array} - the error messages | ||
*/ | ||
function checkApiWithArgs(api, args) { | ||
/* eslint complexity:[2, 7] */ | ||
|
@@ -641,15 +641,16 @@ return /******/ (function(modules) { // webpackBootstrap | |
|
||
function each(obj, iterator, context) { | ||
if (Array.isArray(obj)) { | ||
return eachArry.apply(undefined, arguments); | ||
return eachArry(obj, iterator, context); | ||
} else { | ||
return eachObj.apply(undefined, arguments); | ||
return eachObj(obj, iterator, context); | ||
} | ||
} | ||
|
||
function eachObj(obj, iterator, context) { | ||
var ret; | ||
var ret = undefined; | ||
var hasOwn = Object.prototype.hasOwnProperty; | ||
/* eslint prefer-const:0 */ // some weird eslint bug? | ||
for (var key in obj) { | ||
if (hasOwn.call(obj, key)) { | ||
ret = iterator.call(context, obj[key], key, obj); | ||
|
@@ -662,7 +663,7 @@ return /******/ (function(modules) { // webpackBootstrap | |
} | ||
|
||
function eachArry(obj, iterator, context) { | ||
var ret; | ||
var ret = undefined; | ||
var length = obj.length; | ||
for (var i = 0; i < length; i++) { | ||
ret = iterator.call(context, obj[i], i, obj); | ||
|
@@ -712,9 +713,11 @@ return /******/ (function(modules) { // webpackBootstrap | |
/** | ||
* This will set up the checker with all of the defaults that most checkers want like required by default and an | ||
* optional version | ||
* @param checker | ||
* @param properties properties to add to the checker | ||
* @param disabled - when set to true, this will set the checker to a no-op function | ||
* | ||
* @param {Function} checker - the checker to setup with properties | ||
* @param {Object} properties - properties to add to the checker | ||
* @param {boolean} disabled - when set to true, this will set the checker to a no-op function | ||
* @returns {Function} checker - the setup checker | ||
*/ | ||
function setupChecker(checker, properties, disabled) { | ||
/* eslint complexity:[2, 9] */ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"rules": { | ||
"func-names": 0, // I wish, but doing this right now would be a royal pain | ||
"new-cap": [ | ||
2, | ||
{ | ||
"newIsCap": true, | ||
"capIsNew": true | ||
} | ||
], | ||
"max-params": [2, 10], | ||
"max-statements": [2, 30], // TODO bring this down | ||
}, | ||
"globals": { | ||
"VERSION": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["kentcdodds", "./common.eslintrc"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["kentcdodds/test", "./common.eslintrc"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "api-check", | ||
"version": "7.5.0", | ||
"version": "0.0.0-semantically-released.0", | ||
"description": "Validate the api to your functions to help people use them correctly. This is pretty much React's propTypes without React.", | ||
"main": "dist/api-check.js", | ||
"dependencies": {}, | ||
|
@@ -9,11 +9,15 @@ | |
"babel-core": "5.5.8", | ||
"babel-eslint": "3.1.17", | ||
"babel-loader": "5.1.4", | ||
"bootstrap": "3.3.5", | ||
"chai": "2.1.0", | ||
"codecov.io": "0.1.4", | ||
"eslint": "0.23.0", | ||
"eslint-loader": "0.14.0", | ||
"ghooks": "0.2.4", | ||
"commitizen": "1.0.4", | ||
"cz-conventional-changelog": "1.1.0", | ||
"eslint": "1.5.1", | ||
"eslint-config-kentcdodds": "4.0.0", | ||
"eslint-loader": "1.0.0", | ||
"ghooks": "0.3.2", | ||
"isparta": "3.0.3", | ||
"isparta-loader": "0.2.0", | ||
"istanbul": "0.3.5", | ||
|
@@ -29,32 +33,31 @@ | |
"lodash": "3.9.3", | ||
"mocha": "2.1.0", | ||
"node-libs-browser": "^0.5.2", | ||
"publish-latest": "1.1.0", | ||
"semantic-release": "^4.3.5", | ||
"surge": "0.14.2", | ||
"uglify-loader": "1.2.0", | ||
"webpack": "1.9.11", | ||
"with-package": "0.2.0" | ||
"validate-commit-msg": "1.0.0", | ||
"webpack": "1.9.11" | ||
}, | ||
"scripts": { | ||
"start": "npm run test", | ||
"test": "COVERAGE=true NODE_ENV=test karma start", | ||
"test:single": "COVERAGE=true NODE_ENV=test karma start --single-run", | ||
"commit": "git-cz", | ||
"start": "COVERAGE=true NODE_ENV=test karma start", | ||
"test": "COVERAGE=true NODE_ENV=test karma start --single-run", | ||
"test:debug": "echo 'WARNING: This is currently not working quite right...' && NODE_ENV=test karma start --browsers Chrome", | ||
"build:dist": "NODE_ENV=development webpack --config node_modules/kcd-common-tools/shared/webpack.config.js --progress --colors", | ||
"build:prod": "NODE_ENV=production webpack --config node_modules/kcd-common-tools/shared/webpack.config.js --progress --colors", | ||
"build": "npm run build:dist & npm run build:prod", | ||
"ci": "npm run code-checks && npm run test:single && npm run check-coverage && npm run build", | ||
"check-coverage": "./node_modules/istanbul/lib/cli.js check-coverage --statements 100 --functions 100 --lines 100 --branches 100", | ||
"report-coverage": "cat ./coverage/lcov.info | codecov", | ||
"deploy": "npm run deployClean && npm run deployCopy && npm run deploySurge", | ||
"deploySurge": "surge -p deploy.ignored -d api-check.surge.sh", | ||
"deployCopy": "cp index.html deploy.ignored/ && cp dist/api-check.js deploy.ignored/dist/", | ||
"deployClean": "rm -rf deploy.ignored/ && mkdir deploy.ignored/ && mkdir deploy.ignored/dist/", | ||
"only-check": "node node_modules/kcd-common-tools/shared/scripts/only-check.js", | ||
"console-check": "node node_modules/kcd-common-tools/shared/scripts/console-check.js", | ||
"code-checks": "npm run only-check && npm run console-check", | ||
"release": "npm run build && with-package git commit -am pkg.version && with-package git tag pkg.version && git push && npm publish && git push --tags", | ||
"release:beta": "npm run release && npm run tag:beta", | ||
"tag:beta": "with-package npm dist-tag add [email protected] beta" | ||
"code-checks": "eslint src/", | ||
"prepublish": "npm run build", | ||
"postpublish": "publish-latest", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -75,9 +78,12 @@ | |
"homepage": "https://github.com/kentcdodds/api-check", | ||
"config": { | ||
"ghooks": { | ||
"pre-commit": "npm run ci" | ||
"pre-commit": "./node_modules/.bin/validate-commit-msg && npm run code-checks && npm t && npm run check-coverage" | ||
} | ||
}, | ||
"czConfig": { | ||
"path": "node_modules/cz-conventional-changelog" | ||
}, | ||
"kcdCommon": { | ||
"webpack": { | ||
"output": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.