Comparing version 0.0.3 to 0.0.4
#!/usr/bin/env node | ||
const meow = require('meow') | ||
const chalk = require('chalk') | ||
const msg = ` | ||
Usage | ||
$ chimi -f file | ||
${chalk.bold.white('Usage')} | ||
$ chimi -f <file> -c <config-file> | ||
Options | ||
${chalk.bold.white('Options')} | ||
--file, -f File or glob matching multiple files (default: "README.md") | ||
--config, -c Use configuration from this file (default: ".chimirc") | ||
--config, -c Use configuration from this file (default: ".chimirc") | ||
Examples | ||
${chalk.bold.white('Examples')} | ||
$ chimi -f README.md | ||
@@ -14,0 +15,0 @@ |
@@ -59,3 +59,3 @@ # chimi example | ||
console.log('I will never run') | ||
},10 * 1000) | ||
}, 10 * 1000) | ||
@@ -33,3 +33,3 @@ const fs = require('fs') | ||
? Either.Right(readConf(isJS, fromPkg, f)) | ||
: Either.Left(notExistMsg(f, file)) | ||
: file === '.chimirc' ? Either.Right({}) : Either.Left(notExistMsg(f, file)) | ||
@@ -36,0 +36,0 @@ return conf.map(R.merge(defaults)) |
@@ -90,3 +90,5 @@ const R = require('ramda') | ||
// countCases :: List(FileResult) -> {files: Int, success: Int, success: Int} | ||
// Cases :: {files: Int, success: Int, reject: Int, timeout: Int, total: Int } | ||
// countCases :: List(FileResult) -> Cases | ||
const countCases = results => { | ||
@@ -97,3 +99,3 @@ const [success, reject, timeout] = reducers.map(reduceSnippets(results)) | ||
return { files: results.size, total, success, reject, timeout } | ||
return { files: results.size, success, reject, timeout, total } | ||
} | ||
@@ -107,3 +109,3 @@ | ||
// reportResults :: Spinner -> String -> ([Object] -> ()) | ||
// reportResults :: Spinner -> String -> ([FileResult] -> Cases) | ||
const reportResults = (spinner, glob) => results => { | ||
@@ -145,3 +147,3 @@ const cases = countCases(results) | ||
process.exit(Boolean(cases.reject) ? 1 : 0) | ||
return cases | ||
} | ||
@@ -148,0 +150,0 @@ |
@@ -9,8 +9,12 @@ const { taskOfSnippets } = require('./lib') | ||
return taskOfSnippets(dependencies, timeout, glob).fork( | ||
error => spinner.fail(error.message), | ||
reportResults(spinner, glob) | ||
) | ||
return taskOfSnippets(dependencies, timeout, glob) | ||
.map(reportResults(spinner, glob)) | ||
.fork( | ||
error => spinner.fail(error.message), | ||
(results = { reject: 1 }) => { | ||
process.exit(Boolean(results.reject) ? 1 : 0) | ||
} | ||
) | ||
} | ||
module.exports = runner |
{ | ||
"name": "chimi", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Run JavaScript snippets from your markdown files", | ||
@@ -11,8 +11,18 @@ "bin": { | ||
"format": "npm run prettier -- --write 'lib/**/*.js' && npm run prettier -- --write 'bin/**/*.js'", | ||
"babel": "babel runner.js -o runner.build.js", | ||
"precommit": "lint-staged", | ||
"release": "np" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"author": "gillchristian <gillchristiang@gmail.com>", | ||
"contributors": [ | ||
"fvictorio <victorio.franco@gmail.com>" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Huemul/chimi.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Huemul/chimi/issues" | ||
}, | ||
"homepage": "https://github.com/Huemul/chimi#readme", | ||
"dependencies": { | ||
@@ -19,0 +29,0 @@ "chalk": "^1.1.3", |
@@ -43,3 +43,3 @@ # chimi | ||
The depenencies in the example will generate these `require`s: | ||
``` | ||
```js | ||
let trae = require('trae') | ||
@@ -71,3 +71,3 @@ let _ = require('lodash') | ||
- [x] CLI | ||
- [x ] Configuration (`.chimi.js(on)?|.chimirc`). | ||
- [x] Configuration (`.chimi.js(on)?|.chimirc`). | ||
- [x] `--help`. | ||
@@ -74,0 +74,0 @@ - [x] Log failures. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
87888
0
345
1
1
4
21