webpack-cli
Advanced tools
Comparing version 3.1.0 to 3.1.1
const optionsSchema = require("./optionsSchema.json"); | ||
const nestedProperties = ["anyOf", "oneOf", "allOf"]; | ||
const resolveSchema = schema => { | ||
let current = schema; | ||
if (schema && typeof schema === "object" && "$ref" in schema) { | ||
const path = schema.$ref.split("/"); | ||
for (const element of path) { | ||
if (element === "#") { | ||
current = optionsSchema; | ||
} else { | ||
current = current[element]; | ||
} | ||
} | ||
} | ||
return current; | ||
}; | ||
const findPropertyInSchema = (schema, property, subProperty) => { | ||
if (!schema) return null; | ||
if (subProperty) { | ||
if (schema[property] && typeof schema[property] === "object" && subProperty in schema[property]) { | ||
return resolveSchema(schema[property][subProperty]); | ||
} | ||
} else { | ||
if (property in schema) | ||
return resolveSchema(schema[property]); | ||
} | ||
for (const name of nestedProperties) { | ||
if (schema[name]) { | ||
for (const item of schema[name]) { | ||
const resolvedItem = resolveSchema(item); | ||
const result = findPropertyInSchema(resolvedItem, property, subProperty); | ||
if (result) return result; | ||
} | ||
} | ||
} | ||
return undefined; | ||
}; | ||
const getSchemaInfo = (path, property, subProperty) => { | ||
const pathSegments = path.split("."); | ||
let current = optionsSchema; | ||
for (const segment of pathSegments) { | ||
if (segment === "*") { | ||
current = findPropertyInSchema(current, "additionalProperties") || findPropertyInSchema(current, "items"); | ||
} else { | ||
current = findPropertyInSchema(current, "properties", segment); | ||
} | ||
if (!current) return undefined; | ||
} | ||
return findPropertyInSchema(current, property, subProperty); | ||
}; | ||
const CONFIG_GROUP = "Config options:"; | ||
@@ -44,5 +98,5 @@ const BASIC_GROUP = "Basic options:"; | ||
mode: { | ||
type: optionsSchema.properties.mode.type, | ||
choices: optionsSchema.properties.mode.enum, | ||
describe: optionsSchema.properties.mode.description, | ||
type: getSchemaInfo("mode", "type"), | ||
choices: getSchemaInfo("mode", "enum"), | ||
describe: getSchemaInfo("mode", "description"), | ||
group: CONFIG_GROUP, | ||
@@ -52,4 +106,4 @@ requiresArg: true | ||
context: { | ||
type: optionsSchema.properties.context.type, | ||
describe: optionsSchema.properties.context.description, | ||
type: getSchemaInfo("context", "type"), | ||
describe: getSchemaInfo("context", "description"), | ||
group: BASIC_GROUP, | ||
@@ -61,3 +115,3 @@ defaultDescription: "The current directory", | ||
type: "string", | ||
describe: optionsSchema.properties.entry.description, | ||
describe: getSchemaInfo("entry", "description"), | ||
group: BASIC_GROUP, | ||
@@ -92,3 +146,3 @@ requiresArg: true | ||
type: "string", | ||
describe: optionsSchema.definitions.output.properties.path.description, | ||
describe: getSchemaInfo("output.path", "description"), | ||
group: OUTPUT_GROUP, | ||
@@ -101,3 +155,3 @@ defaultDescription: "The current directory", | ||
describe: | ||
optionsSchema.definitions.output.properties.filename.description, | ||
getSchemaInfo("output.filename", "description"), | ||
group: OUTPUT_GROUP, | ||
@@ -110,3 +164,3 @@ defaultDescription: "[name].js", | ||
describe: | ||
optionsSchema.definitions.output.properties.chunkFilename.description, | ||
getSchemaInfo("output.chunkFilename", "description"), | ||
group: OUTPUT_GROUP, | ||
@@ -120,4 +174,3 @@ defaultDescription: | ||
describe: | ||
optionsSchema.definitions.output.properties.sourceMapFilename | ||
.description, | ||
getSchemaInfo("output.sourceMapFilename", "description"), | ||
group: OUTPUT_GROUP, | ||
@@ -129,3 +182,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.definitions.output.properties.publicPath.description, | ||
getSchemaInfo("output.publicPath", "description"), | ||
group: OUTPUT_GROUP, | ||
@@ -137,3 +190,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.definitions.output.properties.jsonpFunction.description, | ||
getSchemaInfo("output.jsonpFunction", "description"), | ||
group: OUTPUT_GROUP, | ||
@@ -145,3 +198,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.definitions.output.properties.pathinfo.description, | ||
getSchemaInfo("output.pathinfo", "description"), | ||
group: OUTPUT_GROUP | ||
@@ -158,4 +211,4 @@ }, | ||
describe: | ||
optionsSchema.definitions.output.properties.libraryTarget.description, | ||
choices: optionsSchema.definitions.output.properties.libraryTarget.enum, | ||
getSchemaInfo("output.libraryTarget", "description"), | ||
choices: getSchemaInfo("output.libraryTarget", "enum"), | ||
group: OUTPUT_GROUP, | ||
@@ -166,3 +219,3 @@ requiresArg: true | ||
type: "string", | ||
describe: optionsSchema.properties.recordsInputPath.description, | ||
describe: getSchemaInfo("recordsInputPath", "description"), | ||
group: ADVANCED_GROUP, | ||
@@ -173,3 +226,3 @@ requiresArg: true | ||
type: "string", | ||
describe: optionsSchema.properties.recordsOutputPath.description, | ||
describe: getSchemaInfo("recordsOutputPath", "description"), | ||
group: ADVANCED_GROUP, | ||
@@ -180,3 +233,3 @@ requiresArg: true | ||
type: "string", | ||
describe: optionsSchema.properties.recordsPath.description, | ||
describe: getSchemaInfo("recordsPath", "description"), | ||
group: ADVANCED_GROUP, | ||
@@ -193,3 +246,3 @@ requiresArg: true | ||
type: "string", | ||
describe: optionsSchema.properties.target.description, | ||
describe: getSchemaInfo("target", "description"), | ||
group: ADVANCED_GROUP, | ||
@@ -200,3 +253,3 @@ requiresArg: true | ||
type: "boolean", | ||
describe: optionsSchema.properties.cache.description, | ||
describe: getSchemaInfo("cache", "description"), | ||
default: null, | ||
@@ -209,3 +262,3 @@ group: ADVANCED_GROUP, | ||
alias: "w", | ||
describe: optionsSchema.properties.watch.description, | ||
describe: getSchemaInfo("watch", "description"), | ||
group: BASIC_GROUP | ||
@@ -217,3 +270,3 @@ }, | ||
describe: | ||
optionsSchema.properties.watchOptions.properties.stdin.description, | ||
getSchemaInfo("watchOptions.stdin", "description"), | ||
group: ADVANCED_GROUP | ||
@@ -223,7 +276,5 @@ }, | ||
describe: | ||
optionsSchema.properties.watchOptions.properties.aggregateTimeout | ||
.description, | ||
getSchemaInfo("watchOptions.aggregateTimeout", "description"), | ||
type: | ||
optionsSchema.properties.watchOptions.properties.aggregateTimeout | ||
.type, | ||
getSchemaInfo("watchOptions.aggregateTimeout", "type"), | ||
group: ADVANCED_GROUP, | ||
@@ -235,3 +286,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.properties.watchOptions.properties.poll.description, | ||
getSchemaInfo("watchOptions.poll", "description"), | ||
group: ADVANCED_GROUP | ||
@@ -251,3 +302,3 @@ }, | ||
type: "string", | ||
describe: optionsSchema.properties.devtool.description, | ||
describe: getSchemaInfo("devtool", "description"), | ||
group: BASIC_GROUP, | ||
@@ -259,3 +310,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.definitions.resolve.properties.alias.description, | ||
getSchemaInfo("resolve.alias", "description"), | ||
group: RESOLVE_GROUP, | ||
@@ -267,3 +318,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.definitions.resolve.properties.alias.description, | ||
getSchemaInfo("resolve.alias", "description"), | ||
group: RESOLVE_GROUP, | ||
@@ -285,4 +336,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.properties.optimization.properties.splitChunks.oneOf[1] | ||
.properties.minSize.description, | ||
getSchemaInfo("optimization.splitChunks.minSize", "description"), | ||
group: OPTIMIZE_GROUP, | ||
@@ -294,3 +344,3 @@ requiresArg: true | ||
describe: | ||
optionsSchema.properties.optimization.properties.minimize.description, | ||
getSchemaInfo("optimization.minimize", "description"), | ||
group: OPTIMIZE_GROUP | ||
@@ -323,4 +373,4 @@ }, | ||
bail: { | ||
type: optionsSchema.properties.bail.type, | ||
describe: optionsSchema.properties.bail.description, | ||
type: getSchemaInfo("bail", "type"), | ||
describe: getSchemaInfo("bail", "description"), | ||
group: ADVANCED_GROUP, | ||
@@ -331,3 +381,3 @@ default: null | ||
type: "boolean", | ||
describe: optionsSchema.properties.profile.description, | ||
describe: getSchemaInfo("profile", "description"), | ||
group: ADVANCED_GROUP, | ||
@@ -334,0 +384,0 @@ default: null |
@@ -0,4 +1,57 @@ | ||
<a name="3.1.1"></a> | ||
# 3.1.1 (2018-09-23) | ||
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.0...v3.1.1) | ||
## New Features | ||
* migrate: CommonChunksPlugin to SplitChunksPlugin ([#558](https://github.com/webpack/webpack-cli/pull/558)) | ||
* types: types for packages ([#578](https://github.com/webpack/webpack-cli/pull/578)) | ||
## Chore | ||
* ci: add commitlint when trying to commit ([#595](https://github.com/webpack/webpack-cli/pull/595)) | ||
* ci: Set up CI with Azure Pipelines ([89d3a19](https://github.com/webpack/webpack-cli/commit/89d3a19)) | ||
* ci: fix commitlint ([#592](https://github.com/webpack/webpack-cli/pull/592)) | ||
* ci: Add a status badge for the azure pipelines CI build ([#601](https://github.com/webpack/webpack-cli/pull/601)) | ||
* deps: resync package-lock, upgrade major version ([d892b4d](https://github.com/webpack/webpack-cli/commit/d892b4d)) | ||
* deps: Bump lerna version ([#583](https://github.com/webpack/webpack-cli/pull/583)) | ||
* deps: removing inquirer as default package ([#555](https://github.com/webpack/webpack-cli/pull/555)) | ||
* fix: fix clean all script ([6be0478](https://github.com/webpack/webpack-cli/commit/6be0478)) | ||
* Update schema-utils to the latest version 🚀 ([#565](https://github.com/webpack/webpack-cli/pull/565)) | ||
* update pkg.lock ([76c8277](https://github.com/webpack/webpack-cli/commit/76c8277)) | ||
* remove editorconfig from testfixtures ([#560](https://github.com/webpack/webpack-cli/pull/560)) | ||
* lint: fix tslint warnings ([cf0bf4a](https://github.com/webpack/webpack-cli/commit/cf0bf4a)) | ||
* lint: turn off console log warning ([db5f570](https://github.com/webpack/webpack-cli/commit/db5f570)) | ||
* lint: remove or replace console.log with console.error ([e425642](https://github.com/webpack/webpack-cli/commit/e425642)) | ||
* package: update lerna to version 3.0.0 ([08c424d](https://github.com/webpack/webpack-cli/commit/08c424d)) | ||
* scripts: update ts watch ([336ad3e](https://github.com/webpack/webpack-cli/commit/336ad3e)) | ||
* tests: added first ts test for info package ([#584](https://github.com/webpack/webpack-cli/pull/584)) | ||
## CLI | ||
* allow array value for --ouput-library ([#559](https://github.com/webpack/webpack-cli/pull/559)) | ||
## Docs | ||
* fixed latest changelog link ([#556](https://github.com/webpack/webpack-cli/pull/556)) | ||
* migrate documentaion ([#554](https://github.com/webpack/webpack-cli/pull/554)) | ||
* init documentaion ([#547](https://github.com/webpack/webpack-cli/pull/547)) | ||
* contribution: fix the setup workflow #591 ([#597](https://github.com/webpack/webpack-cli/pull/597)) | ||
* typedoc: add ts docs ([#571](https://github.com/webpack/webpack-cli/pull/571)) | ||
## Fix | ||
* generate-loader: include example template in npm package ([d26ea82](https://github.com/webpack/webpack-cli/commit/d26ea82)) | ||
* generate-plugin: include example template in npm package ([77fa723](https://github.com/webpack/webpack-cli/commit/77fa723)) | ||
* package: update import-local to version 2.0.0 🚀 ([#576](https://github.com/webpack/webpack-cli/pull/576)) | ||
* prettier: add parser, filePath ([#553](https://github.com/webpack/webpack-cli/pull/553)) | ||
* schema: resolve references in schema ([#605](https://github.com/webpack/webpack-cli/pull/605)) | ||
## Misc | ||
* Revert "cli: allow array value for --ouput-library (#559)" ([#561](https://github.com/webpack/webpack-cli/pull/561)) | ||
<a name="3.1.0"></a> | ||
# 3.1.0 (2018-07-18) | ||
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v3.0.8...v3.1.0) | ||
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v3.0.8...v.3.1.0) | ||
@@ -5,0 +58,0 @@ ## New Features |
{ | ||
"name": "webpack-cli", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "CLI for webpack & friends", | ||
@@ -28,5 +28,2 @@ "license": "MIT", | ||
"scripts": { | ||
"appveyor:build": "lerna bootstrap && npm run build", | ||
"appveyor:lint": "npm run lint && npm run tslint", | ||
"appveyor:test": "npm run test", | ||
"bootstrap": "npm run clean:all && npm install && lerna bootstrap", | ||
@@ -36,3 +33,4 @@ "build": "tsc", | ||
"changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile CHANGELOG.md --same-file", | ||
"clean:all": "rimraf node_modules package-lock.json packages/*/node_modules packages/*/package-lock.json", | ||
"clean:all": "rimraf node_modules packages/*/node_modules", | ||
"docs": "typedoc", | ||
"format": "prettier-eslint ./bin/*.js ./test/**/*.js ./packages/**/*.js --write", | ||
@@ -42,2 +40,3 @@ "lint:codeOnly": "eslint \"{bin}/**/!(__testfixtures__)/*.js\" \"{bin}/**.js\"", | ||
"precommit": "lint-staged", | ||
"commitmsg": "commitlint -E GIT_PARAMS", | ||
"pretest": "npm run build && npm run lint && npm run tslint", | ||
@@ -49,3 +48,3 @@ "reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov", | ||
"tslint": "tslint -c tslint.json \"packages/**/*.ts\"", | ||
"watch": "tsc -w" | ||
"watch": "npm run build && tsc -w" | ||
}, | ||
@@ -56,2 +55,6 @@ "lint-staged": { | ||
"git add" | ||
], | ||
"{packages,bin}/**/!(__testfixtures__)/**.ts": [ | ||
"tslint --fix", | ||
"git add" | ||
] | ||
@@ -65,3 +68,6 @@ }, | ||
"html" | ||
] | ||
], | ||
"moduleNameMapper": { | ||
"^.+\\.(ts)?$": "ts-jest" | ||
} | ||
}, | ||
@@ -103,11 +109,10 @@ "nyc": { | ||
"cross-spawn": "^6.0.5", | ||
"enhanced-resolve": "^4.0.0", | ||
"global-modules-path": "^2.1.0", | ||
"import-local": "^1.0.0", | ||
"inquirer": "^6.0.0", | ||
"enhanced-resolve": "^4.1.0", | ||
"global-modules-path": "^2.3.0", | ||
"import-local": "^2.0.0", | ||
"interpret": "^1.1.0", | ||
"loader-utils": "^1.1.0", | ||
"supports-color": "^5.4.0", | ||
"v8-compile-cache": "^2.0.0", | ||
"yargs": "^12.0.1" | ||
"supports-color": "^5.5.0", | ||
"v8-compile-cache": "^2.0.2", | ||
"yargs": "^12.0.2" | ||
}, | ||
@@ -118,31 +123,32 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@commitlint/cli": "^7.0.0", | ||
"@commitlint/config-angular": "^7.0.0", | ||
"@commitlint/config-lerna-scopes": "^7.0.0", | ||
"@commitlint/prompt-cli": "^7.0.0", | ||
"@commitlint/travis-cli": "^7.0.0", | ||
"@types/jest": "^23.1.1", | ||
"@types/node": "^10.5.1", | ||
"@commitlint/cli": "^7.1.2", | ||
"@commitlint/config-lerna-scopes": "^7.1.2", | ||
"@commitlint/prompt-cli": "^7.1.2", | ||
"@commitlint/travis-cli": "^7.1.2", | ||
"@types/jest": "^23.3.2", | ||
"@types/node": "^10.9.4", | ||
"bundlesize": "^0.17.0", | ||
"codecov": "^3.0.2", | ||
"codecov": "^3.1.0", | ||
"commitizen": "^2.10.1", | ||
"conventional-changelog-cli": "^2.0.0", | ||
"conventional-changelog-lint-config-cz": "^0.3.0", | ||
"cz-customizable": "^5.2.0", | ||
"eslint": "^5.0.1", | ||
"eslint-plugin-node": "^7.0.0", | ||
"commitlint-config-cz": "^0.10.1", | ||
"conventional-changelog-cli": "^2.0.5", | ||
"eslint": "^5.5.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"husky": "^0.14.3", | ||
"jest": "^22.4.4", | ||
"jest-cli": "^23.0.1", | ||
"lerna": "^2.11.0", | ||
"lint-staged": "^7.1.2", | ||
"nyc": "^12.0.1", | ||
"jest": "^23.6.0", | ||
"jest-cli": "^23.6.0", | ||
"lerna": "^3.4.0", | ||
"lint-staged": "^7.2.2", | ||
"nyc": "^13.0.1", | ||
"prettier-eslint-cli": "^4.7.1", | ||
"rimraf": "^2.6.2", | ||
"schema-utils": "^0.4.5", | ||
"tslint": "^5.10.0", | ||
"schema-utils": "^1.0.0", | ||
"ts-jest": "^23.10.1", | ||
"tslint": "^5.11.0", | ||
"typedoc": "^0.12.0", | ||
"typedoc-plugin-monorepo": "^0.1.0", | ||
"typescript": "^2.9.2", | ||
"webpack": "^4.8.3", | ||
"webpack-dev-server": "^3.1.4" | ||
"webpack": "^4.19.1", | ||
"webpack-dev-server": "^3.1.8" | ||
} | ||
} |
@@ -10,3 +10,3 @@ <div align="center"> | ||
[![Build Status](https://travis-ci.org/webpack/webpack-cli.svg)](https://travis-ci.org/webpack/webpack-cli) | ||
[![Build status](https://ci.appveyor.com/api/projects/status/c2a37nlrfv9mg64f?svg=true)](https://ci.appveyor.com/project/ev1stensberg/webpack-cli) | ||
[![Build2 Status](https://dev.azure.com/webpack/webpack/_apis/build/status/webpack.webpack-cli)](https://dev.azure.com/webpack/webpack/_build/latest?definitionId=4) | ||
[![Dependency Status](https://david-dm.org/webpack/webpack-cli.svg)](https://david-dm.org/webpack/webpack-cli) | ||
@@ -13,0 +13,0 @@ [![Code Climate](https://codeclimate.com/github/webpack/webpack-cli/badges/gpa.svg)](https://codeclimate.com/github/webpack/webpack-cli) |
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
156361
11
3537
29
+ Addedimport-local@2.0.0(transitive)
- Removedinquirer@^6.0.0
- Removedansi-escapes@3.2.0(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedchardet@0.7.0(transitive)
- Removedcli-cursor@2.1.0(transitive)
- Removedcli-width@2.2.1(transitive)
- Removedexternal-editor@3.1.0(transitive)
- Removedfigures@2.0.0(transitive)
- Removedfind-up@2.1.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedimport-local@1.0.0(transitive)
- Removedinquirer@6.5.2(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmimic-fn@1.2.0(transitive)
- Removedmute-stream@0.0.7(transitive)
- Removedonetime@2.0.1(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpkg-dir@2.0.0(transitive)
- Removedrestore-cursor@2.0.0(transitive)
- Removedrun-async@2.4.1(transitive)
- Removedrxjs@6.6.7(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedstrip-ansi@5.2.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedtmp@0.0.33(transitive)
- Removedtslib@1.14.1(transitive)
Updatedenhanced-resolve@^4.1.0
Updatedglobal-modules-path@^2.3.0
Updatedimport-local@^2.0.0
Updatedsupports-color@^5.5.0
Updatedv8-compile-cache@^2.0.2
Updatedyargs@^12.0.2