Merge pull request #9950 from webpack/dependabot/npm_and_yarn/prettier-1.19.1
chore(deps-dev): bump prettier from 1.18.2 to 1.19.1
This commit is contained in:
commit
eeafeee32a
|
@ -27,7 +27,7 @@ export type EntryStatic = EntryObject | EntryItem;
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "NonEmptyArrayOfUniqueStringValues".
|
* via the `definition` "NonEmptyArrayOfUniqueStringValues".
|
||||||
*/
|
*/
|
||||||
export type NonEmptyArrayOfUniqueStringValues = [string, ...(string)[]];
|
export type NonEmptyArrayOfUniqueStringValues = [string, ...string[]];
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "EntryItem".
|
* via the `definition` "EntryItem".
|
||||||
|
@ -50,7 +50,8 @@ export type Externals =
|
||||||
request: string,
|
request: string,
|
||||||
callback: (err?: Error, result?: string) => void
|
callback: (err?: Error, result?: string) => void
|
||||||
) => void)
|
) => void)
|
||||||
| ExternalItem)[];
|
| ExternalItem
|
||||||
|
)[];
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
||||||
* via the `definition` "ExternalItem".
|
* via the `definition` "ExternalItem".
|
||||||
|
@ -412,7 +413,8 @@ export interface WebpackOptions {
|
||||||
| "normal"
|
| "normal"
|
||||||
| "detailed"
|
| "detailed"
|
||||||
| "verbose"
|
| "verbose"
|
||||||
| "errors-warnings");
|
| "errors-warnings"
|
||||||
|
);
|
||||||
/**
|
/**
|
||||||
* Environment to build for
|
* Environment to build for
|
||||||
*/
|
*/
|
||||||
|
@ -425,7 +427,8 @@ export interface WebpackOptions {
|
||||||
| "node-webkit"
|
| "node-webkit"
|
||||||
| "electron-main"
|
| "electron-main"
|
||||||
| "electron-renderer"
|
| "electron-renderer"
|
||||||
| "electron-preload")
|
| "electron-preload"
|
||||||
|
)
|
||||||
| ((compiler: import("../lib/Compiler")) => void);
|
| ((compiler: import("../lib/Compiler")) => void);
|
||||||
/**
|
/**
|
||||||
* Enter watch mode, which rebuilds on file change.
|
* Enter watch mode, which rebuilds on file change.
|
||||||
|
@ -594,10 +597,10 @@ export interface ModuleOptions {
|
||||||
* Don't parse files matching. It's matched against the full resolved request.
|
* Don't parse files matching. It's matched against the full resolved request.
|
||||||
*/
|
*/
|
||||||
noParse?:
|
noParse?:
|
||||||
| [RegExp, ...(RegExp)[]]
|
| [RegExp, ...RegExp[]]
|
||||||
| RegExp
|
| RegExp
|
||||||
| Function
|
| Function
|
||||||
| [string, ...(string)[]]
|
| [string, ...string[]]
|
||||||
| string;
|
| string;
|
||||||
/**
|
/**
|
||||||
* An array of rules applied for modules.
|
* An array of rules applied for modules.
|
||||||
|
|
|
@ -8,5 +8,5 @@ export interface WatchIgnorePluginOptions {
|
||||||
/**
|
/**
|
||||||
* A list of RegExps or absolute paths to directories or files that should be ignored
|
* A list of RegExps or absolute paths to directories or files that should be ignored
|
||||||
*/
|
*/
|
||||||
paths: [(string | RegExp), ...(string | RegExp)[]];
|
paths: [string | RegExp, ...(string | RegExp)[]];
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,12 +149,10 @@ class CommonJsStuffPlugin {
|
||||||
])(expr);
|
])(expr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
parser.hooks.evaluateIdentifier
|
parser.hooks.evaluateIdentifier.for("module.hot").tap(
|
||||||
.for("module.hot")
|
"CommonJsStuffPlugin",
|
||||||
.tap(
|
evaluateToIdentifier("module.hot", "module", () => ["hot"], false)
|
||||||
"CommonJsStuffPlugin",
|
);
|
||||||
evaluateToIdentifier("module.hot", "module", () => ["hot"], false)
|
|
||||||
);
|
|
||||||
parser.hooks.expression
|
parser.hooks.expression
|
||||||
.for("module")
|
.for("module")
|
||||||
.tap("CommonJsStuffPlugin", expr => {
|
.tap("CommonJsStuffPlugin", expr => {
|
||||||
|
@ -236,26 +234,25 @@ class NodeModuleDecoratorRuntimeModule extends RuntimeModule {
|
||||||
generate() {
|
generate() {
|
||||||
const { runtimeTemplate } = this.compilation;
|
const { runtimeTemplate } = this.compilation;
|
||||||
return Template.asString([
|
return Template.asString([
|
||||||
`${RuntimeGlobals.nodeModuleDecorator} = ${runtimeTemplate.basicFunction(
|
`${
|
||||||
"module",
|
RuntimeGlobals.nodeModuleDecorator
|
||||||
[
|
} = ${runtimeTemplate.basicFunction("module", [
|
||||||
"module.paths = [];",
|
"module.paths = [];",
|
||||||
"if (!module.children) module.children = [];",
|
"if (!module.children) module.children = [];",
|
||||||
"Object.defineProperty(module, 'loaded', {",
|
"Object.defineProperty(module, 'loaded', {",
|
||||||
Template.indent([
|
Template.indent([
|
||||||
"enumerable: true,",
|
"enumerable: true,",
|
||||||
`get: ${runtimeTemplate.returningFunction("module.l")}`
|
`get: ${runtimeTemplate.returningFunction("module.l")}`
|
||||||
]),
|
]),
|
||||||
"});",
|
"});",
|
||||||
"Object.defineProperty(module, 'id', {",
|
"Object.defineProperty(module, 'id', {",
|
||||||
Template.indent([
|
Template.indent([
|
||||||
"enumerable: true,",
|
"enumerable: true,",
|
||||||
`get: ${runtimeTemplate.returningFunction("module.i")}`
|
`get: ${runtimeTemplate.returningFunction("module.i")}`
|
||||||
]),
|
]),
|
||||||
"});",
|
"});",
|
||||||
"return module;"
|
"return module;"
|
||||||
]
|
])};`
|
||||||
)};`
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,9 +76,7 @@ class CompatibilityPlugin {
|
||||||
statement.id &&
|
statement.id &&
|
||||||
statement.id.name === "__webpack_require__"
|
statement.id.name === "__webpack_require__"
|
||||||
) {
|
) {
|
||||||
const newName = `__nested_webpack_require_${
|
const newName = `__nested_webpack_require_${statement.range[0]}__`;
|
||||||
statement.range[0]
|
|
||||||
}__`;
|
|
||||||
const dep = new ConstDependency(newName, statement.id.range);
|
const dep = new ConstDependency(newName, statement.id.range);
|
||||||
dep.loc = statement.id.loc;
|
dep.loc = statement.id.loc;
|
||||||
parser.state.module.addPresentationalDependency(dep);
|
parser.state.module.addPresentationalDependency(dep);
|
||||||
|
|
|
@ -234,7 +234,9 @@ class HotModuleReplacementPlugin {
|
||||||
}
|
}
|
||||||
records.chunkModuleIds = {};
|
records.chunkModuleIds = {};
|
||||||
for (const chunk of compilation.chunks) {
|
for (const chunk of compilation.chunks) {
|
||||||
records.chunkModuleIds[chunk.id] = Array.from(
|
records.chunkModuleIds[
|
||||||
|
chunk.id
|
||||||
|
] = Array.from(
|
||||||
chunkGraph.getOrderedChunkModulesIterable(
|
chunkGraph.getOrderedChunkModulesIterable(
|
||||||
chunk,
|
chunk,
|
||||||
compareModulesById(chunkGraph)
|
compareModulesById(chunkGraph)
|
||||||
|
|
|
@ -22,9 +22,7 @@ const prepareId = id => {
|
||||||
if (/^"\s\+*.*\+\s*"$/.test(id)) {
|
if (/^"\s\+*.*\+\s*"$/.test(id)) {
|
||||||
const match = /^"\s\+*\s*(.*)\s*\+\s*"$/.exec(id);
|
const match = /^"\s\+*\s*(.*)\s*\+\s*"$/.exec(id);
|
||||||
|
|
||||||
return `" + (${
|
return `" + (${match[1]} + "").replace(/(^[.-]|[^a-zA-Z0-9_-])+/g, "_") + "`;
|
||||||
match[1]
|
|
||||||
} + "").replace(/(^[.-]|[^a-zA-Z0-9_-])+/g, "_") + "`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return id.replace(/(^[.-]|[^a-zA-Z0-9_-])+/g, "_");
|
return id.replace(/(^[.-]|[^a-zA-Z0-9_-])+/g, "_");
|
||||||
|
|
|
@ -100,7 +100,8 @@ class HarmonyImportDependency extends ModuleDependency {
|
||||||
// It's not an harmony module
|
// It's not an harmony module
|
||||||
if (
|
if (
|
||||||
moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule &&
|
moduleGraph.getParentModule(this).buildMeta.strictHarmonyModule &&
|
||||||
(ids.length > 0 && ids[0] !== "default")
|
ids.length > 0 &&
|
||||||
|
ids[0] !== "default"
|
||||||
) {
|
) {
|
||||||
// In strict harmony modules we only support the default export
|
// In strict harmony modules we only support the default export
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -42,7 +42,10 @@ const canMangle = (exportsInfo, canBeArray) => {
|
||||||
|
|
||||||
const comparator = concatComparators(
|
const comparator = concatComparators(
|
||||||
// Sort used before unused fields
|
// Sort used before unused fields
|
||||||
compareSelect(e => e.used !== false, (a, b) => (a === b ? 0 : a ? -1 : 1)),
|
compareSelect(
|
||||||
|
e => e.used !== false,
|
||||||
|
(a, b) => (a === b ? 0 : a ? -1 : 1)
|
||||||
|
),
|
||||||
// Sort by name
|
// Sort by name
|
||||||
compareSelect(e => e.name, compareStringsNumeric)
|
compareSelect(e => e.name, compareStringsNumeric)
|
||||||
);
|
);
|
||||||
|
|
|
@ -26,15 +26,14 @@ class EnsureChunkRuntimeModule extends RuntimeModule {
|
||||||
`${handlers} = {};`,
|
`${handlers} = {};`,
|
||||||
"// This file contains only the entry chunk.",
|
"// This file contains only the entry chunk.",
|
||||||
"// The chunk loading function for additional chunks",
|
"// The chunk loading function for additional chunks",
|
||||||
`${RuntimeGlobals.ensureChunk} = ${runtimeTemplate.basicFunction(
|
`${
|
||||||
"chunkId",
|
RuntimeGlobals.ensureChunk
|
||||||
[
|
} = ${runtimeTemplate.basicFunction("chunkId", [
|
||||||
`return Promise.all(Object.keys(${handlers}).reduce(${runtimeTemplate.basicFunction(
|
`return Promise.all(Object.keys(${handlers}).reduce(${runtimeTemplate.basicFunction(
|
||||||
"promises, key",
|
"promises, key",
|
||||||
[`${handlers}[key](chunkId, promises);`, "return promises;"]
|
[`${handlers}[key](chunkId, promises);`, "return promises;"]
|
||||||
)}, []));`
|
)}, []));`
|
||||||
]
|
])};`
|
||||||
)};`
|
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
// There ensureChunk is used somewhere in the tree, so we need an empty requireEnsure
|
// There ensureChunk is used somewhere in the tree, so we need an empty requireEnsure
|
||||||
|
|
|
@ -154,9 +154,7 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator {
|
||||||
", "
|
", "
|
||||||
)}]) { return ${instantiateCall}; })`
|
)}]) { return ${instantiateCall}; })`
|
||||||
: promises.length === 1
|
: promises.length === 1
|
||||||
? `${module.moduleArgument}.exports = Promise.resolve(${
|
? `${module.moduleArgument}.exports = Promise.resolve(${promises[0]}).then(function(${promises[0]}) { return ${instantiateCall}; })`
|
||||||
promises[0]
|
|
||||||
}).then(function(${promises[0]}) { return ${instantiateCall}; })`
|
|
||||||
: `${module.moduleArgument}.exports = ${instantiateCall}`
|
: `${module.moduleArgument}.exports = ${instantiateCall}`
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
|
@ -660,9 +660,9 @@ rules:
|
||||||
title: "Backport to webpack 4: {{{pull_request.title}}}"
|
title: "Backport to webpack 4: {{{pull_request.title}}}"
|
||||||
body: |-
|
body: |-
|
||||||
{{{pull_request.html_url}}} needs to be backported to webpack 4.
|
{{{pull_request.html_url}}} needs to be backported to webpack 4.
|
||||||
|
|
||||||
Send a PR.
|
Send a PR.
|
||||||
|
|
||||||
cc @{{pull_request.user.login}}
|
cc @{{pull_request.user.login}}
|
||||||
comment:
|
comment:
|
||||||
identifier: admin-action-webpack-4-backport-executed
|
identifier: admin-action-webpack-4-backport-executed
|
||||||
|
|
|
@ -49,7 +49,10 @@ function checkSymlinkExistsAsync() {
|
||||||
function ensureYarnInstalledAsync() {
|
function ensureYarnInstalledAsync() {
|
||||||
const semverPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/;
|
const semverPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/;
|
||||||
return execGetOutput("yarn", ["-v"], "Check yarn version")
|
return execGetOutput("yarn", ["-v"], "Check yarn version")
|
||||||
.then(stdout => semverPattern.test(stdout), () => false)
|
.then(
|
||||||
|
stdout => semverPattern.test(stdout),
|
||||||
|
() => false
|
||||||
|
)
|
||||||
.then(hasYarn => hasYarn || installYarnAsync());
|
.then(hasYarn => hasYarn || installYarnAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5018,9 +5018,9 @@ prettier-linter-helpers@^1.0.0:
|
||||||
fast-diff "^1.1.2"
|
fast-diff "^1.1.2"
|
||||||
|
|
||||||
prettier@^1.14.3, prettier@^1.18.2:
|
prettier@^1.14.3, prettier@^1.18.2:
|
||||||
version "1.18.2"
|
version "1.19.1"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
|
||||||
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
|
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
|
||||||
|
|
||||||
pretty-format@^24.8.0, pretty-format@^24.9.0:
|
pretty-format@^24.8.0, pretty-format@^24.9.0:
|
||||||
version "24.9.0"
|
version "24.9.0"
|
||||||
|
|
Loading…
Reference in New Issue