update dependencies in-range

This commit is contained in:
Tobias Koppers 2019-12-27 15:47:00 +01:00
parent 0e5e8d9f3d
commit 3ec952fe34
9 changed files with 891 additions and 1097 deletions

View File

@ -50,7 +50,8 @@ export type Externals =
request: string,
callback: (err?: Error, result?: string) => void
) => void)
| ExternalItem)[];
| ExternalItem
)[];
/**
* This interface was referenced by `WebpackOptions`'s JSON-Schema
* via the `definition` "ExternalItem".
@ -391,7 +392,8 @@ export interface WebpackOptions {
| "normal"
| "detailed"
| "verbose"
| "errors-warnings");
| "errors-warnings"
);
/**
* Environment to build for
*/
@ -404,7 +406,8 @@ export interface WebpackOptions {
| "node-webkit"
| "electron-main"
| "electron-renderer"
| "electron-preload")
| "electron-preload"
)
| ((compiler: import("../lib/Compiler")) => void);
/**
* Enter watch mode, which rebuilds on file change.

View File

@ -45,18 +45,20 @@ class CommonJsStuffPlugin {
.tap("CommonJsStuffPlugin", expr => {
parser.state.module.buildMeta.moduleConcatenationBailout =
"module.loaded";
return ParserHelpers.toConstantDependency(parser, "module.l")(
expr
);
return ParserHelpers.toConstantDependency(
parser,
"module.l"
)(expr);
});
parser.hooks.expression
.for("module.id")
.tap("CommonJsStuffPlugin", expr => {
parser.state.module.buildMeta.moduleConcatenationBailout =
"module.id";
return ParserHelpers.toConstantDependency(parser, "module.i")(
expr
);
return ParserHelpers.toConstantDependency(
parser,
"module.i"
)(expr);
});
parser.hooks.expression
.for("module.exports")

View File

@ -190,9 +190,10 @@ class DefinePlugin {
strCode
)(expr);
} else {
return ParserHelpers.toConstantDependency(parser, strCode)(
expr
);
return ParserHelpers.toConstantDependency(
parser,
strCode
)(expr);
}
});
}
@ -255,9 +256,10 @@ class DefinePlugin {
strCode
)(expr);
} else {
return ParserHelpers.toConstantDependency(parser, strCode)(
expr
);
return ParserHelpers.toConstantDependency(
parser,
strCode
)(expr);
}
});
parser.hooks.typeof.for(key).tap("DefinePlugin", expr => {

View File

@ -62,9 +62,10 @@ class ProvidePlugin {
return false;
}
if (scopedName) {
ParserHelpers.toConstantDependency(parser, nameIdentifier)(
expr
);
ParserHelpers.toConstantDependency(
parser,
nameIdentifier
)(expr);
}
return true;
});

View File

@ -5,34 +5,31 @@
"use strict";
/**
* @enum {string}
*/
const LogType = Object.freeze({
error: "error", // message, c style arguments
warn: "warn", // message, c style arguments
info: "info", // message, c style arguments
log: "log", // message, c style arguments
debug: "debug", // message, c style arguments
error: /** @type {"error"} */ ("error"), // message, c style arguments
warn: /** @type {"warn"} */ ("warn"), // message, c style arguments
info: /** @type {"info"} */ ("info"), // message, c style arguments
log: /** @type {"log"} */ ("log"), // message, c style arguments
debug: /** @type {"debug"} */ ("debug"), // message, c style arguments
trace: "trace", // no arguments
trace: /** @type {"trace"} */ ("trace"), // no arguments
group: "group", // [label]
groupCollapsed: "groupCollapsed", // [label]
groupEnd: "groupEnd", // [label]
group: /** @type {"group"} */ ("group"), // [label]
groupCollapsed: /** @type {"groupCollapsed"} */ ("groupCollapsed"), // [label]
groupEnd: /** @type {"groupEnd"} */ ("groupEnd"), // [label]
profile: "profile", // [profileName]
profileEnd: "profileEnd", // [profileName]
profile: /** @type {"profile"} */ ("profile"), // [profileName]
profileEnd: /** @type {"profileEnd"} */ ("profileEnd"), // [profileName]
time: "time", // name, time as [seconds, nanoseconds]
time: /** @type {"time"} */ ("time"), // name, time as [seconds, nanoseconds]
clear: "clear", // no arguments
status: "status" // message, arguments
clear: /** @type {"clear"} */ ("clear"), // no arguments
status: /** @type {"status"} */ ("status") // message, arguments
});
exports.LogType = LogType;
/** @typedef {keyof typeof LogType} LogTypeEnum */
/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */
const LOG_SYMBOL = Symbol("webpack logger raw log method");
const TIMERS_SYMBOL = Symbol("webpack logger times");

View File

@ -49,7 +49,10 @@ function checkSymlinkExistsAsync() {
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-]+)*)?$/;
return execGetOutput("yarn", ["-v"], "Check yarn version")
.then(stdout => semverPattern.test(stdout), () => false)
.then(
stdout => semverPattern.test(stdout),
() => false
)
.then(hasYarn => hasYarn || installYarnAsync());
}

View File

@ -210,8 +210,14 @@ describe("NormalModule", () => {
fileB = "fileB";
fileDependencies = [fileA, fileB];
contextDependencies = [fileA, fileB];
fileTimestamps = new Map([[fileA, 1], [fileB, 1]]);
contextTimestamps = new Map([[fileA, 1], [fileB, 1]]);
fileTimestamps = new Map([
[fileA, 1],
[fileB, 1]
]);
contextTimestamps = new Map([
[fileA, 1],
[fileB, 1]
]);
normalModule.buildTimestamp = 2;
setDeps(fileDependencies, contextDependencies);
});

View File

@ -824,9 +824,9 @@ Entrypoint main = main.js
`;
exports[`StatsTestCases should print correct stats for filter-warnings 1`] = `
"Hash: b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0
"Hash: 167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce
Child undefined:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -855,49 +855,49 @@ Child undefined:
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child Terser:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child /Terser/:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child warnings => true:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child [Terser]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child [/Terser/]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child [warnings => true]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
bundle.js 2.89 KiB 0 [emitted] main
Entrypoint main = bundle.js
Child should not filter:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -926,7 +926,7 @@ Child should not filter:
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child /should not filter/:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -955,7 +955,7 @@ Child /should not filter/:
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child warnings => false:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -984,7 +984,7 @@ Child warnings => false:
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child [should not filter]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -1013,7 +1013,7 @@ Child [should not filter]:
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child [/should not filter/]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -1042,7 +1042,7 @@ Child [/should not filter/]:
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
Child [warnings => false]:
Hash: b706ac60cee7c13a1cc0
Hash: 167b89b0d93ab09243ce
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names
@ -3523,7 +3523,7 @@ Entrypoint main = bundle.js
`;
exports[`StatsTestCases should print correct stats for warnings-terser 1`] = `
"Hash: d747afbed2a2cf9a7f5d
"Hash: b1d135d55f1314d24fc5
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names

1866
yarn.lock

File diff suppressed because it is too large Load Diff