Skip to content

Commit 4e31587

Browse files
authored
Merge pull request #10183 from webpack/deps/update
update dependencies in-range
2 parents 0e5e8d9 + 3ec952f commit 4e31587

9 files changed

Lines changed: 892 additions & 1098 deletions

File tree

declarations/WebpackOptions.d.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export type Externals =
5050
request: string,
5151
callback: (err?: Error, result?: string) => void
5252
) => void)
53-
| ExternalItem)[];
53+
| ExternalItem
54+
)[];
5455
/**
5556
* This interface was referenced by `WebpackOptions`'s JSON-Schema
5657
* via the `definition` "ExternalItem".
@@ -391,7 +392,8 @@ export interface WebpackOptions {
391392
| "normal"
392393
| "detailed"
393394
| "verbose"
394-
| "errors-warnings");
395+
| "errors-warnings"
396+
);
395397
/**
396398
* Environment to build for
397399
*/
@@ -404,7 +406,8 @@ export interface WebpackOptions {
404406
| "node-webkit"
405407
| "electron-main"
406408
| "electron-renderer"
407-
| "electron-preload")
409+
| "electron-preload"
410+
)
408411
| ((compiler: import("../lib/Compiler")) => void);
409412
/**
410413
* Enter watch mode, which rebuilds on file change.

lib/CommonJsStuffPlugin.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ class CommonJsStuffPlugin {
4545
.tap("CommonJsStuffPlugin", expr => {
4646
parser.state.module.buildMeta.moduleConcatenationBailout =
4747
"module.loaded";
48-
return ParserHelpers.toConstantDependency(parser, "module.l")(
49-
expr
50-
);
48+
return ParserHelpers.toConstantDependency(
49+
parser,
50+
"module.l"
51+
)(expr);
5152
});
5253
parser.hooks.expression
5354
.for("module.id")
5455
.tap("CommonJsStuffPlugin", expr => {
5556
parser.state.module.buildMeta.moduleConcatenationBailout =
5657
"module.id";
57-
return ParserHelpers.toConstantDependency(parser, "module.i")(
58-
expr
59-
);
58+
return ParserHelpers.toConstantDependency(
59+
parser,
60+
"module.i"
61+
)(expr);
6062
});
6163
parser.hooks.expression
6264
.for("module.exports")

lib/DefinePlugin.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ class DefinePlugin {
190190
strCode
191191
)(expr);
192192
} else {
193-
return ParserHelpers.toConstantDependency(parser, strCode)(
194-
expr
195-
);
193+
return ParserHelpers.toConstantDependency(
194+
parser,
195+
strCode
196+
)(expr);
196197
}
197198
});
198199
}
@@ -255,9 +256,10 @@ class DefinePlugin {
255256
strCode
256257
)(expr);
257258
} else {
258-
return ParserHelpers.toConstantDependency(parser, strCode)(
259-
expr
260-
);
259+
return ParserHelpers.toConstantDependency(
260+
parser,
261+
strCode
262+
)(expr);
261263
}
262264
});
263265
parser.hooks.typeof.for(key).tap("DefinePlugin", expr => {

lib/ProvidePlugin.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ class ProvidePlugin {
6262
return false;
6363
}
6464
if (scopedName) {
65-
ParserHelpers.toConstantDependency(parser, nameIdentifier)(
66-
expr
67-
);
65+
ParserHelpers.toConstantDependency(
66+
parser,
67+
nameIdentifier
68+
)(expr);
6869
}
6970
return true;
7071
});

lib/logging/Logger.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,31 @@
55

66
"use strict";
77

8-
/**
9-
* @enum {string}
10-
*/
118
const LogType = Object.freeze({
12-
error: "error", // message, c style arguments
13-
warn: "warn", // message, c style arguments
14-
info: "info", // message, c style arguments
15-
log: "log", // message, c style arguments
16-
debug: "debug", // message, c style arguments
9+
error: /** @type {"error"} */ ("error"), // message, c style arguments
10+
warn: /** @type {"warn"} */ ("warn"), // message, c style arguments
11+
info: /** @type {"info"} */ ("info"), // message, c style arguments
12+
log: /** @type {"log"} */ ("log"), // message, c style arguments
13+
debug: /** @type {"debug"} */ ("debug"), // message, c style arguments
1714

18-
trace: "trace", // no arguments
15+
trace: /** @type {"trace"} */ ("trace"), // no arguments
1916

20-
group: "group", // [label]
21-
groupCollapsed: "groupCollapsed", // [label]
22-
groupEnd: "groupEnd", // [label]
17+
group: /** @type {"group"} */ ("group"), // [label]
18+
groupCollapsed: /** @type {"groupCollapsed"} */ ("groupCollapsed"), // [label]
19+
groupEnd: /** @type {"groupEnd"} */ ("groupEnd"), // [label]
2320

24-
profile: "profile", // [profileName]
25-
profileEnd: "profileEnd", // [profileName]
21+
profile: /** @type {"profile"} */ ("profile"), // [profileName]
22+
profileEnd: /** @type {"profileEnd"} */ ("profileEnd"), // [profileName]
2623

27-
time: "time", // name, time as [seconds, nanoseconds]
24+
time: /** @type {"time"} */ ("time"), // name, time as [seconds, nanoseconds]
2825

29-
clear: "clear", // no arguments
30-
status: "status" // message, arguments
26+
clear: /** @type {"clear"} */ ("clear"), // no arguments
27+
status: /** @type {"status"} */ ("status") // message, arguments
3128
});
3229

3330
exports.LogType = LogType;
3431

35-
/** @typedef {keyof typeof LogType} LogTypeEnum */
32+
/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */
3633

3734
const LOG_SYMBOL = Symbol("webpack logger raw log method");
3835
const TIMERS_SYMBOL = Symbol("webpack logger times");

setup/setup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ function checkSymlinkExistsAsync() {
4949
function ensureYarnInstalledAsync() {
5050
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-]+)*)?$/;
5151
return execGetOutput("yarn", ["-v"], "Check yarn version")
52-
.then(stdout => semverPattern.test(stdout), () => false)
52+
.then(
53+
stdout => semverPattern.test(stdout),
54+
() => false
55+
)
5356
.then(hasYarn => hasYarn || installYarnAsync());
5457
}
5558

test/NormalModule.unittest.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,14 @@ describe("NormalModule", () => {
210210
fileB = "fileB";
211211
fileDependencies = [fileA, fileB];
212212
contextDependencies = [fileA, fileB];
213-
fileTimestamps = new Map([[fileA, 1], [fileB, 1]]);
214-
contextTimestamps = new Map([[fileA, 1], [fileB, 1]]);
213+
fileTimestamps = new Map([
214+
[fileA, 1],
215+
[fileB, 1]
216+
]);
217+
contextTimestamps = new Map([
218+
[fileA, 1],
219+
[fileB, 1]
220+
]);
215221
normalModule.buildTimestamp = 2;
216222
setDeps(fileDependencies, contextDependencies);
217223
});

test/__snapshots__/StatsTestCases.test.js.snap

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,9 @@ Entrypoint main = main.js
824824
`;
825825

826826
exports[`StatsTestCases should print correct stats for filter-warnings 1`] = `
827-
"Hash: b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0b706ac60cee7c13a1cc0
827+
"Hash: 167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce167b89b0d93ab09243ce
828828
Child undefined:
829-
Hash: b706ac60cee7c13a1cc0
829+
Hash: 167b89b0d93ab09243ce
830830
Time: Xms
831831
Built at: Thu Jan 01 1970 00:00:00 GMT
832832
Asset Size Chunks Chunk Names
@@ -855,49 +855,49 @@ Child undefined:
855855
856856
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
857857
Child Terser:
858-
Hash: b706ac60cee7c13a1cc0
858+
Hash: 167b89b0d93ab09243ce
859859
Time: Xms
860860
Built at: Thu Jan 01 1970 00:00:00 GMT
861861
Asset Size Chunks Chunk Names
862862
bundle.js 2.89 KiB 0 [emitted] main
863863
Entrypoint main = bundle.js
864864
Child /Terser/:
865-
Hash: b706ac60cee7c13a1cc0
865+
Hash: 167b89b0d93ab09243ce
866866
Time: Xms
867867
Built at: Thu Jan 01 1970 00:00:00 GMT
868868
Asset Size Chunks Chunk Names
869869
bundle.js 2.89 KiB 0 [emitted] main
870870
Entrypoint main = bundle.js
871871
Child warnings => true:
872-
Hash: b706ac60cee7c13a1cc0
872+
Hash: 167b89b0d93ab09243ce
873873
Time: Xms
874874
Built at: Thu Jan 01 1970 00:00:00 GMT
875875
Asset Size Chunks Chunk Names
876876
bundle.js 2.89 KiB 0 [emitted] main
877877
Entrypoint main = bundle.js
878878
Child [Terser]:
879-
Hash: b706ac60cee7c13a1cc0
879+
Hash: 167b89b0d93ab09243ce
880880
Time: Xms
881881
Built at: Thu Jan 01 1970 00:00:00 GMT
882882
Asset Size Chunks Chunk Names
883883
bundle.js 2.89 KiB 0 [emitted] main
884884
Entrypoint main = bundle.js
885885
Child [/Terser/]:
886-
Hash: b706ac60cee7c13a1cc0
886+
Hash: 167b89b0d93ab09243ce
887887
Time: Xms
888888
Built at: Thu Jan 01 1970 00:00:00 GMT
889889
Asset Size Chunks Chunk Names
890890
bundle.js 2.89 KiB 0 [emitted] main
891891
Entrypoint main = bundle.js
892892
Child [warnings => true]:
893-
Hash: b706ac60cee7c13a1cc0
893+
Hash: 167b89b0d93ab09243ce
894894
Time: Xms
895895
Built at: Thu Jan 01 1970 00:00:00 GMT
896896
Asset Size Chunks Chunk Names
897897
bundle.js 2.89 KiB 0 [emitted] main
898898
Entrypoint main = bundle.js
899899
Child should not filter:
900-
Hash: b706ac60cee7c13a1cc0
900+
Hash: 167b89b0d93ab09243ce
901901
Time: Xms
902902
Built at: Thu Jan 01 1970 00:00:00 GMT
903903
Asset Size Chunks Chunk Names
@@ -926,7 +926,7 @@ Child should not filter:
926926
927927
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
928928
Child /should not filter/:
929-
Hash: b706ac60cee7c13a1cc0
929+
Hash: 167b89b0d93ab09243ce
930930
Time: Xms
931931
Built at: Thu Jan 01 1970 00:00:00 GMT
932932
Asset Size Chunks Chunk Names
@@ -955,7 +955,7 @@ Child /should not filter/:
955955
956956
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
957957
Child warnings => false:
958-
Hash: b706ac60cee7c13a1cc0
958+
Hash: 167b89b0d93ab09243ce
959959
Time: Xms
960960
Built at: Thu Jan 01 1970 00:00:00 GMT
961961
Asset Size Chunks Chunk Names
@@ -984,7 +984,7 @@ Child warnings => false:
984984
985985
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
986986
Child [should not filter]:
987-
Hash: b706ac60cee7c13a1cc0
987+
Hash: 167b89b0d93ab09243ce
988988
Time: Xms
989989
Built at: Thu Jan 01 1970 00:00:00 GMT
990990
Asset Size Chunks Chunk Names
@@ -1013,7 +1013,7 @@ Child [should not filter]:
10131013
10141014
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
10151015
Child [/should not filter/]:
1016-
Hash: b706ac60cee7c13a1cc0
1016+
Hash: 167b89b0d93ab09243ce
10171017
Time: Xms
10181018
Built at: Thu Jan 01 1970 00:00:00 GMT
10191019
Asset Size Chunks Chunk Names
@@ -1042,7 +1042,7 @@ Child [/should not filter/]:
10421042
10431043
WARNING in Terser Plugin: Dropping unused function someRemoteUnUsedFunction5 [./a.js:7,0]
10441044
Child [warnings => false]:
1045-
Hash: b706ac60cee7c13a1cc0
1045+
Hash: 167b89b0d93ab09243ce
10461046
Time: Xms
10471047
Built at: Thu Jan 01 1970 00:00:00 GMT
10481048
Asset Size Chunks Chunk Names
@@ -3523,7 +3523,7 @@ Entrypoint main = bundle.js
35233523
`;
35243524
35253525
exports[`StatsTestCases should print correct stats for warnings-terser 1`] = `
3526-
"Hash: d747afbed2a2cf9a7f5d
3526+
"Hash: b1d135d55f1314d24fc5
35273527
Time: Xms
35283528
Built at: Thu Jan 01 1970 00:00:00 GMT
35293529
Asset Size Chunks Chunk Names

0 commit comments

Comments
 (0)