cli-engine-config
Advanced tools
Comparing version 5.0.8 to 5.0.9
@@ -6,48 +6,2 @@ "use strict"; | ||
const path = require("path"); | ||
const schema = { | ||
type: 'object', | ||
properties: { | ||
'cli-engine': { | ||
type: 'object', | ||
description: "cli-engine entry in CLI's package.json", | ||
additionalProperties: false, | ||
properties: { | ||
bin: { type: 'string' }, | ||
commands: { type: 'string' }, | ||
defaultCommand: { type: 'string' }, | ||
dirname: { type: 'string' }, | ||
npmRegistry: { type: 'string' }, | ||
userPlugins: { type: 'boolean' }, | ||
plugins: { type: 'array', items: { type: 'string' } }, | ||
hooks: { | ||
additionalProperties: { | ||
anyOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }], | ||
}, | ||
}, | ||
s3: { | ||
type: 'object', | ||
additionalProperties: false, | ||
properties: { | ||
host: { type: 'string' }, | ||
}, | ||
}, | ||
topics: { $ref: '#/definitions/topics' }, | ||
}, | ||
}, | ||
}, | ||
definitions: { | ||
topics: { | ||
type: 'object', | ||
additionalProperties: { | ||
type: 'object', | ||
additionalProperties: false, | ||
properties: { | ||
description: { type: 'string' }, | ||
hidden: { type: 'boolean' }, | ||
subtopics: { $ref: '#/definitions/topics' }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
function dir({ dirname, category, home, platform, d, }) { | ||
@@ -129,10 +83,2 @@ let cacheKey = `dir:${category}`; | ||
} | ||
function validate(pjson, filename) { | ||
const validator = require('is-my-json-valid'); | ||
const validate = validator(schema, { verbose: true }); | ||
if (validate(pjson)) | ||
return; | ||
const e = validate.errors[0]; | ||
throw new Error(`Error parsing ${filename}: ${e.field} ${e.message}. Received ${e.value}`); | ||
} | ||
function buildConfig(existing = {}) { | ||
@@ -148,3 +94,2 @@ if (!existing) | ||
let pjson = readJSONSync(path.join(existing.root, 'package.json')); | ||
validate(pjson, pjsonPath); | ||
existing.pjson = { | ||
@@ -151,0 +96,0 @@ 'cli-engine': pjson['cli-engine'] || {}, |
{ | ||
"name": "cli-engine-config", | ||
"description": "base cli-engine config objects and interfaces", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"author": "Jeff Dickey @jdxcode", | ||
"bugs": "https://github.com/heroku/cli-engine-config/issues", | ||
"dependencies": { | ||
"is-my-json-valid": "^2.17.1" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@types/is-my-json-valid": "^0.0.20", | ||
"@types/jest": "21.1.9", | ||
"@types/node": "8.5.2", | ||
"ajv-cli": "^2.1.0", | ||
"cli-flags": "2.0.3", | ||
@@ -44,5 +42,8 @@ "debug": "^3.1.0", | ||
"scripts": { | ||
"clean": "del-cli lib", | ||
"build": "tsc && ajv compile -s schema.js -o lib/schema.js", | ||
"posttest": "tslint -p . && prettier -l 'src/**/*.ts'", | ||
"precommit": "lint-staged", | ||
"prepare": "del-cli lib && tsc && del-cli \"lib/**/*.test.+(d.ts|js)\"", | ||
"prepare": "yarn run clean && yarn run build && yarn run prune", | ||
"prune": "del-cli \"lib/**/*.test.+(d.ts|js)\"", | ||
"pretest": "tsc", | ||
@@ -49,0 +50,0 @@ "test": "jest" |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
43557
0
5
1130
1
- Removedis-my-json-valid@^2.17.1
- Removedgenerate-function@2.3.1(transitive)
- Removedgenerate-object-property@1.2.0(transitive)
- Removedis-my-ip-valid@1.0.1(transitive)
- Removedis-my-json-valid@2.20.6(transitive)
- Removedis-property@1.0.2(transitive)
- Removedjsonpointer@5.0.1(transitive)
- Removedxtend@4.0.2(transitive)