@blinkmobile/blinkmrc
Advanced tools
Comparing version 1.1.0 to 2.0.0
# Change Log | ||
## Unreleased | ||
## 2.0.0 - 2018-07-20 | ||
### Removed | ||
- Support for NodeJS 4 | ||
### Fixed | ||
- ON-1323 # Fixed sorting keys issue on NodeJS 10 | ||
### Dependencies | ||
- update [load-json-file](https://www.npmjs.com/package/load-json-file) to 4.0.0 (from 1.1.0) | ||
- update [write-json-file](https://www.npmjs.com/package/write-json-file) to 2.0.0 (from 1.2.0) | ||
## 1.1.0 - 2016-02-19 | ||
@@ -15,1 +33,5 @@ | ||
- write JSON files with indenting and sorted keys | ||
- project file written with 0666 permissions by default | ||
- user file written with 0600 permissions by default |
30
index.js
@@ -0,1 +1,2 @@ | ||
/* @flow */ | ||
'use strict'; | ||
@@ -11,1 +12,30 @@ | ||
module.exports = { userConfig, projectConfig }; | ||
/* :: | ||
export type Config = { | ||
load: () => Promise<Object>, | ||
update: ((Object) => Object) => Promise<Object>, | ||
write: (Object) => Promise<Object> | ||
} | ||
export type ConfigOptions = { | ||
dir: string, | ||
fileMode?: number, | ||
filename?: string | ||
} | ||
export type ProjectConfigOptions = { | ||
cwd?: string, | ||
fileMode?: number, | ||
filename?: string, | ||
name: string | ||
} | ||
export type UserConfigOptions = { | ||
fileMode?: number, | ||
name: string, | ||
userConfigDir?: string | ||
} | ||
*/ |
@@ -0,3 +1,11 @@ | ||
/* @flow */ | ||
'use strict'; | ||
/* :: | ||
import type { | ||
Config, | ||
ConfigOptions | ||
} from '..' | ||
*/ | ||
// Node.js built-ins | ||
@@ -28,3 +36,5 @@ | ||
function load (filePath) { | ||
function load ( | ||
filePath /* : string */ | ||
) /* : Promise<Object> */ { | ||
return loadJson(filePath) | ||
@@ -34,2 +44,3 @@ .catch((err) => { | ||
const error = new Error(`${filePath} is not valid JSON`); | ||
// $FlowFixMe [flow] property `code` (Property not found in Error) | ||
error.code = err.code; | ||
@@ -49,3 +60,7 @@ throw error; | ||
/** wrap a promise function so that error is swallowed, resolving instead */ | ||
function resolveOnError (fn, code, value) { | ||
function resolveOnError ( | ||
fn /* : Function */, | ||
code /* : string */, | ||
value /* : Object */ | ||
) /* : (arguments) => Promise<Object> */ { | ||
return function () { | ||
@@ -62,6 +77,9 @@ return fn.apply(this, arguments) | ||
function write (filePath, options, data) { | ||
function write ( | ||
filePath /* : string */, | ||
options /* : { mode?: number } */, | ||
data /* : Object */ | ||
) /* : Promise<Object> */ { | ||
options = Object.assign({}, { | ||
indent: 2, | ||
sortKeys: true | ||
indent: 2 | ||
}, options); | ||
@@ -72,3 +90,7 @@ return writeJson(filePath, data, options) | ||
function update (filePath, options, updater) { | ||
function update ( | ||
filePath /* : string */, | ||
options /* : { mode?: number } */, | ||
updater /* : (Object) => Object */ | ||
) /* : Promise<Object> */ { | ||
assertUpdater(updater); | ||
@@ -80,3 +102,5 @@ // it's okay if the file does not exist yet | ||
function config (options) { | ||
function config ( | ||
options /* : ConfigOptions */ | ||
) /* : Config */ { | ||
options = Object.assign({}, options); | ||
@@ -83,0 +107,0 @@ assertDir(options); |
@@ -0,3 +1,11 @@ | ||
/* @flow */ | ||
'use strict'; | ||
/* :: | ||
import type { | ||
Config, | ||
ProjectConfigOptions | ||
} from '..' | ||
*/ | ||
// local modules | ||
@@ -11,3 +19,5 @@ | ||
function projectConfig (options) { | ||
function projectConfig ( | ||
options /* : ProjectConfigOptions */ | ||
) /* : Config */ { | ||
options = Object.assign({}, options); | ||
@@ -14,0 +24,0 @@ // default is a dotfile, like .eslintrc.json or .travis.yml |
@@ -0,3 +1,11 @@ | ||
/* @flow */ | ||
'use strict'; | ||
/* :: | ||
import type { | ||
Config, | ||
UserConfigOptions | ||
} from '..' | ||
*/ | ||
// Node.js built-ins | ||
@@ -28,3 +36,5 @@ | ||
function userConfig (options) { | ||
function userConfig ( | ||
options /* : UserConfigOptions */ | ||
) /* : Config */ { | ||
options = Object.assign({}, options); | ||
@@ -31,0 +41,0 @@ |
{ | ||
"name": "@blinkmobile/blinkmrc", | ||
"description": "bit like https://github.com/yeoman/configstore but with home-directory and project-specific files", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"author": "Ron Waldon <jokeyrhyme@gmail.com> (https://github.com/jokeyrhyme)", | ||
"bugs": { | ||
@@ -10,20 +11,26 @@ "url": "https://github.com/blinkmobile/blinkmrc.js/issues" | ||
"appdirectory": "0.1.0", | ||
"load-json-file": "^1.1.0", | ||
"write-json-file": "^1.2.0" | ||
"load-json-file": "^4.0.0", | ||
"write-json-file": "2.3.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.11.0", | ||
"eslint": "^1.10.3", | ||
"eslint-config-semistandard": "5.0.0", | ||
"eslint-config-standard": "^4.4.0", | ||
"eslint-plugin-standard": "^1.3.1", | ||
"fixpack": "^2.2.0", | ||
"npm-run-all": "^1.5.0", | ||
"nyc": "^5.3.0", | ||
"pify": "^2.3.0", | ||
"ava": "^0.25.0", | ||
"eslint": "^5.1.0", | ||
"eslint-config-semistandard": "^12.0.1", | ||
"eslint-config-standard": "^11.0.0", | ||
"eslint-plugin-import": "^2.13.0", | ||
"eslint-plugin-node": "^6.0.0", | ||
"eslint-plugin-promise": "^3.8.0", | ||
"eslint-plugin-standard": "^3.1.0", | ||
"fixpack": "^2.3.1", | ||
"flow-bin": "^0.76.0", | ||
"nyc": "^12.0.0", | ||
"pify": "^3.0.0", | ||
"temp": "^0.8.3" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0", | ||
"npm": ">=3.0.0" | ||
"node": ">=6.0.0", | ||
"npm": ">=6.0.0" | ||
}, | ||
@@ -38,2 +45,11 @@ "files": [ | ||
"main": "index.js", | ||
"nyc": { | ||
"lines": 80, | ||
"statements": 80, | ||
"functions": 80, | ||
"branches": 50 | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
@@ -45,8 +61,10 @@ "type": "git", | ||
"ava": "nyc ava", | ||
"eslint": "eslint .", | ||
"eslint": "eslint --fix --cache .", | ||
"fixpack": "fixpack", | ||
"nyc": "nyc check-coverage -s 80 -b 50 -f 80 -l 80", | ||
"posttest": "npm-run-all eslint fixpack", | ||
"test": "npm-run-all -s ava nyc" | ||
"flow_check": "flow check", | ||
"nyc": "nyc check-coverage", | ||
"posttest": "npm run nyc && npm run eslint && npm run flow_check", | ||
"pretest": "npm run fixpack", | ||
"test": "npm run ava" | ||
} | ||
} |
@@ -1,9 +0,5 @@ | ||
# blinkmrc.js | ||
# blinkmrc.j [![npm module](https://img.shields.io/npm/v/@blinkmobile/blinkmrc.svg)](https://www.npmjs.com/package/@blinkmobile/blinkmrc) [![Travis CI Status](https://travis-ci.org/blinkmobile/blinkmrc.js.svg?branch=master)](https://travis-ci.org/blinkmobile/blinkmrc.js) [![AppVeyor Status](https://img.shields.io/appveyor/ci/blinkmobile/blinkmrc-js/master.svg)](https://ci.appveyor.com/project/blinkmobile/blinkmrc-js) [![Greenkeeper badge](https://badges.greenkeeper.io/blinkmobile/blinkmrc.js.svg)](https://greenkeeper.io/) | ||
bit like https://github.com/yeoman/configstore but with home-directory and project-specific files | ||
[![npm module](https://img.shields.io/npm/v/@blinkmobile/blinkmrc.svg)](https://www.npmjs.com/package/@blinkmobile/blinkmrc) | ||
[![Build Status](https://travis-ci.org/blinkmobile/bmp-cli.svg?branch=master)](https://travis-ci.org/blinkmobile/blinkmrc.js) | ||
We extracted this from [blinkmobile/bmp-cli](https://github.com/blinkmobile/bmp-cli) for the benefit of our other CLI projects. | ||
@@ -10,0 +6,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
12262
194
1
13
118
+ Addeddetect-indent@5.0.0(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedload-json-file@4.0.0(transitive)
+ Addedmake-dir@1.3.0(transitive)
+ Addedparse-json@4.0.0(transitive)
+ Addedpify@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsort-keys@2.0.0(transitive)
+ Addedstrip-bom@3.0.0(transitive)
+ Addedwrite-file-atomic@2.4.3(transitive)
+ Addedwrite-json-file@2.3.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedslide@1.1.6(transitive)
- Removedsort-keys@1.1.2(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedwrite-file-atomic@1.3.4(transitive)
- Removedwrite-json-file@1.2.0(transitive)
Updatedload-json-file@^4.0.0
Updatedwrite-json-file@2.3.0