schema-utils
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="0.3.0"></a> | ||
# [0.3.0](https://github.com/webpack-contrib/schema-utils/compare/v0.2.1...v0.3.0) (2017-04-29) | ||
### Features | ||
* add ValidationError ([#8](https://github.com/webpack-contrib/schema-utils/issues/8)) ([d48f0fb](https://github.com/webpack-contrib/schema-utils/commit/d48f0fb)) | ||
<a name="0.2.1"></a> | ||
@@ -7,0 +17,0 @@ ## [0.2.1](https://github.com/webpack-contrib/schema-utils/compare/v0.2.0...v0.2.1) (2017-03-13) |
@@ -0,7 +1,8 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.validateOptions = undefined; | ||
var _validateOptions = require('./lib/validate-options'); | ||
var _validateOptions = require('./validateOptions'); | ||
@@ -12,3 +13,2 @@ var _validateOptions2 = _interopRequireDefault(_validateOptions); | ||
exports.validateOptions = _validateOptions2.default; | ||
//# sourceMappingURL=index.js.map | ||
exports.default = _validateOptions2.default; |
{ | ||
"name": "schema-utils", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Webpack Schema Validation Utilities", | ||
"main": "dist/index.js", | ||
"main": "dist/cjs.js", | ||
"files": [ | ||
"dist", | ||
"lib", | ||
"src", | ||
".babelrc" | ||
"dist" | ||
], | ||
"engines": { | ||
"node": ">= 4.3 < 5.0.0 || >= 5.10" | ||
}, | ||
"scripts": { | ||
"prebuild": "yarn run clean:dist", | ||
"build": "cross-env NODE_ENV=production babel -s true src -d dist --ignore 'src/**/*.test.js'", | ||
"clean:dist": "del-cli dist", | ||
"start": "yarn run serve:dev src", | ||
"serve:dev": "nodemon $2 --exec babel-node", | ||
"start": "yarn run build -- -w", | ||
"prebuild": "yarn run clean", | ||
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'", | ||
"clean": "del-cli dist", | ||
"lint": "eslint --cache src test", | ||
"lint-staged": "lint-staged", | ||
"security": "nsp check", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage", | ||
"travis:test": "yarn run test", | ||
"travis:coverage": "yarn run test:coverage", | ||
"travis:lint": "yarn run lint && yarn run security", | ||
"travis:test": "yarn run test", | ||
"webpack-defaults": "webpack-defaults", | ||
"lint-staged": "lint-staged", | ||
"postinstall": "node lib/post_install.js", | ||
"prepublish": "yarn run build", | ||
@@ -32,34 +31,31 @@ "release": "yarn run standard-version" | ||
"dependencies": { | ||
"ajv": "^4.11.2" | ||
"ajv": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.22.2", | ||
"babel-jest": "^18.0.0", | ||
"babel-polyfill": "^6.22.0", | ||
"babel-preset-env": "^1.2.1", | ||
"babel-cli": "^6.24.1", | ||
"babel-jest": "^19.0.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-env": "^1.4.0", | ||
"babel-preset-webpack": "^1.0.0", | ||
"chai": "^3.5.0", | ||
"codecov": "^1.0.1", | ||
"cross-env": "^3.1.4", | ||
"codecov": "^2.0.1", | ||
"cross-env": "^4.0.0", | ||
"del-cli": "^0.2.1", | ||
"eslint": "^3.14.1", | ||
"eslint-config-webpack": "^1.0.0", | ||
"eslint": "^3.19.0", | ||
"eslint-config-webpack": "^1.2.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"greenkeeper-postpublish": "^1.0.1", | ||
"jest": "^18.1.0", | ||
"lint-staged": "^3.3.1", | ||
"nodemon": "^1.11.0", | ||
"nsp": "^2.6.2", | ||
"jest": "^19.0.2", | ||
"lint-staged": "^3.4.0", | ||
"nsp": "^2.6.3", | ||
"pre-commit": "^1.2.2", | ||
"shx": "^0.2.2", | ||
"standard-version": "^4.0.0", | ||
"webpack-defaults": "^0.2.1" | ||
"webpack-defaults": "^0.4.5" | ||
}, | ||
"engines": { | ||
"node": ">=4.3 <5.0.0 || >=5.10" | ||
"pre-commit": "lint-staged", | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
] | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/webpack-contrib/schema-utils.git" | ||
}, | ||
"eslintConfig": { | ||
@@ -81,5 +77,11 @@ "extends": "webpack", | ||
"name": "Joshua Wiens <@d3viant0ne>" | ||
}, | ||
{ | ||
"name": "Michael Ciniawsky <@michael-ciniawsky>" | ||
} | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/webpack-contrib/schema-utils.git" | ||
}, | ||
"bugs": { | ||
@@ -89,9 +91,3 @@ "url": "https://github.com/webpack-contrib/schema-utils/issues" | ||
"homepage": "https://github.com/webpack-contrib/schema-utils#readme", | ||
"pre-commit": "lint-staged", | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
] | ||
} | ||
"license": "MIT" | ||
} |
[![npm][npm]][npm-url] | ||
[![node][node]][node-url] | ||
[![deps][deps]][deps-url] | ||
[![test][test]][test-url] | ||
[![coverage][cover]][cover-url] | ||
[![quality][quality]][quality-url] | ||
[![chat][chat]][chat-url] | ||
<div align="center"> | ||
<!-- replace with accurate logo e.g from https://worldvectorlogo.com/ --> | ||
<a href="http://json-schema.org"> | ||
<!-- src="https://webpack-contrib.github.io/schema-utils/logo.png" --> | ||
<img width="180" height="180" | ||
src="https://raw.githubusercontent.com/json-schema-org/json-schema-org.github.io/master/img/logo.png"> | ||
</a> | ||
<a href="https://github.com/webpack/webpack"> | ||
<img width="200" height="200" vspace="" hspace="25" | ||
src="https://worldvectorlogo.com/logos/webpack.svg"> | ||
<img width="200" height="200" hspace="10" | ||
src="https://webpack.js.org/assets/icon-square-big.svg"> | ||
</a> | ||
<h1>Webpack Schema Utilities</h1> | ||
<p>Schema validation utilities for Ajv<p> | ||
<h1>Schema Utils</h1> | ||
</div> | ||
@@ -21,3 +24,3 @@ | ||
```bash | ||
npm i schema-utils@latest | ||
npm install --save schema-utils | ||
``` | ||
@@ -27,23 +30,38 @@ | ||
### Validate Options | ||
### `validateOptions` | ||
```js | ||
import validateOptions from 'schema-utils' | ||
validateOptions('path/to/schema.json', options, 'Loader/Plugin Name') | ||
``` | ||
<h2 align="center">Examples</h2> | ||
```javascript | ||
const { validateSchema } = require('schema-utils'); | ||
### Loader | ||
... | ||
```js | ||
import { getOptions } from 'loader-utils' | ||
import validateOptions from 'schema-utils' | ||
// This injects possible default values to options | ||
const validation = validateSchema(jsonSchema, options); | ||
function loader (src, map) { | ||
const options = getOptions(this) || {} | ||
if(validation.isValid) { | ||
throw new Error(validation.error); | ||
validateOptions('path/to/schema.json', options, 'Loader Name') | ||
} | ||
``` | ||
// options are ok to use now | ||
### Plugin | ||
```js | ||
import Tapable from 'tapable' | ||
import validateOptions from 'schema-utils' | ||
class Plugin extends Tapable { | ||
constructor (options) { | ||
validateOptions('path/to/schema.json', options, 'Plugin Name') | ||
} | ||
} | ||
``` | ||
<h2 align="center">Maintainers</h2> | ||
@@ -56,3 +74,3 @@ | ||
<img width="150" height="150" | ||
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150"> | ||
src="https://github.com/bebraw.png?v=3&s=150"> | ||
</br> | ||
@@ -63,6 +81,12 @@ <a href="https://github.com/bebraw">Juho Vepsäläinen</a> | ||
<img width="150" height="150" | ||
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150"> | ||
src="https://github.com/d3viant0ne.png?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/d3viant0ne">Joshua Wiens</a> | ||
</td> | ||
<td align="center"> | ||
<img width="150" height="150" | ||
src="https://github.com/michael-ciniawsky.png?v=3&s=150"> | ||
</br> | ||
<a href="https://github.com/michael-ciniawsky">Michael Ciniawsky</a> | ||
</td> | ||
</tr> | ||
@@ -72,11 +96,12 @@ <tbody> | ||
[npm]: https://img.shields.io/npm/v/schema-utils.svg | ||
[npm-url]: https://npmjs.com/package/schema-utils | ||
[node]: https://img.shields.io/node/v/schema-utils.svg | ||
[node-url]: https://nodejs.org | ||
[deps]: https://david-dm.org/webpack-contrib/schema-utils.svg | ||
[deps-url]: https://david-dm.org/webpack-contrib/schema-utils | ||
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg | ||
[chat-url]: https://gitter.im/webpack/webpack | ||
[test]: http://img.shields.io/travis/webpack-contrib/schema-utils.svg | ||
@@ -88,3 +113,3 @@ [test-url]: https://travis-ci.org/webpack-contrib/schema-utils | ||
[quality]: https://www.bithound.io/github/webpack-contrib/schema-utils/badges/score.svg | ||
[quality-url]: https://www.bithound.io/github/webpack-contrib/schema-utils | ||
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg | ||
[chat-url]: https://gitter.im/webpack/webpack |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
18
110
0
1
1
10860
8
61
+ Addedajv@5.5.2(transitive)
+ Addedfast-deep-equal@1.1.0(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedjson-schema-traverse@0.3.1(transitive)
- Removedajv@4.11.8(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedjson-stable-stringify@1.1.1(transitive)
- Removedjsonify@0.0.1(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedset-function-length@1.2.2(transitive)
Updatedajv@^5.0.0