@rspack/core 1.4.7-alpha.1 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/glob-to-regexp/index.d.ts +11 -0
- package/compiled/glob-to-regexp/index.js +187 -0
- package/compiled/glob-to-regexp/package.json +1 -0
- package/compiled/watchpack/index.js +9 -149
- package/dist/Compilation.d.ts +6 -0
- package/dist/NativeWatchFileSystem.d.ts +17 -0
- package/dist/Watching.d.ts +10 -1
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +5 -0
- package/dist/index.js +109 -10
- package/dist/schema/config.d.ts +1 -0
- package/dist/util/fs.d.ts +10 -1
- package/package.json +4 -2
@@ -0,0 +1,11 @@
|
|
1
|
+
declare function GlobToRegExp(glob: string, options?: GlobToRegExp.Options): RegExp;
|
2
|
+
|
3
|
+
declare namespace GlobToRegExp {
|
4
|
+
interface Options {
|
5
|
+
extended?: boolean | undefined;
|
6
|
+
globstar?: boolean | undefined;
|
7
|
+
flags?: string | undefined;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
export { GlobToRegExp as default };
|
@@ -0,0 +1,187 @@
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
2
|
+
/******/ var __webpack_modules__ = ({
|
3
|
+
|
4
|
+
/***/ 137:
|
5
|
+
/***/ ((module) => {
|
6
|
+
|
7
|
+
module.exports = function (glob, opts) {
|
8
|
+
if (typeof glob !== 'string') {
|
9
|
+
throw new TypeError('Expected a string');
|
10
|
+
}
|
11
|
+
|
12
|
+
var str = String(glob);
|
13
|
+
|
14
|
+
// The regexp we are building, as a string.
|
15
|
+
var reStr = "";
|
16
|
+
|
17
|
+
// Whether we are matching so called "extended" globs (like bash) and should
|
18
|
+
// support single character matching, matching ranges of characters, group
|
19
|
+
// matching, etc.
|
20
|
+
var extended = opts ? !!opts.extended : false;
|
21
|
+
|
22
|
+
// When globstar is _false_ (default), '/foo/*' is translated a regexp like
|
23
|
+
// '^\/foo\/.*$' which will match any string beginning with '/foo/'
|
24
|
+
// When globstar is _true_, '/foo/*' is translated to regexp like
|
25
|
+
// '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT
|
26
|
+
// which does not have a '/' to the right of it.
|
27
|
+
// E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but
|
28
|
+
// these will not '/foo/bar/baz', '/foo/bar/baz.txt'
|
29
|
+
// Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when
|
30
|
+
// globstar is _false_
|
31
|
+
var globstar = opts ? !!opts.globstar : false;
|
32
|
+
|
33
|
+
// If we are doing extended matching, this boolean is true when we are inside
|
34
|
+
// a group (eg {*.html,*.js}), and false otherwise.
|
35
|
+
var inGroup = false;
|
36
|
+
|
37
|
+
// RegExp flags (eg "i" ) to pass in to RegExp constructor.
|
38
|
+
var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : "";
|
39
|
+
|
40
|
+
var c;
|
41
|
+
for (var i = 0, len = str.length; i < len; i++) {
|
42
|
+
c = str[i];
|
43
|
+
|
44
|
+
switch (c) {
|
45
|
+
case "/":
|
46
|
+
case "$":
|
47
|
+
case "^":
|
48
|
+
case "+":
|
49
|
+
case ".":
|
50
|
+
case "(":
|
51
|
+
case ")":
|
52
|
+
case "=":
|
53
|
+
case "!":
|
54
|
+
case "|":
|
55
|
+
reStr += "\\" + c;
|
56
|
+
break;
|
57
|
+
|
58
|
+
case "?":
|
59
|
+
if (extended) {
|
60
|
+
reStr += ".";
|
61
|
+
break;
|
62
|
+
}
|
63
|
+
|
64
|
+
case "[":
|
65
|
+
case "]":
|
66
|
+
if (extended) {
|
67
|
+
reStr += c;
|
68
|
+
break;
|
69
|
+
}
|
70
|
+
|
71
|
+
case "{":
|
72
|
+
if (extended) {
|
73
|
+
inGroup = true;
|
74
|
+
reStr += "(";
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
|
78
|
+
case "}":
|
79
|
+
if (extended) {
|
80
|
+
inGroup = false;
|
81
|
+
reStr += ")";
|
82
|
+
break;
|
83
|
+
}
|
84
|
+
|
85
|
+
case ",":
|
86
|
+
if (inGroup) {
|
87
|
+
reStr += "|";
|
88
|
+
break;
|
89
|
+
}
|
90
|
+
reStr += "\\" + c;
|
91
|
+
break;
|
92
|
+
|
93
|
+
case "*":
|
94
|
+
// Move over all consecutive "*"'s.
|
95
|
+
// Also store the previous and next characters
|
96
|
+
var prevChar = str[i - 1];
|
97
|
+
var starCount = 1;
|
98
|
+
while(str[i + 1] === "*") {
|
99
|
+
starCount++;
|
100
|
+
i++;
|
101
|
+
}
|
102
|
+
var nextChar = str[i + 1];
|
103
|
+
|
104
|
+
if (!globstar) {
|
105
|
+
// globstar is disabled, so treat any number of "*" as one
|
106
|
+
reStr += ".*";
|
107
|
+
} else {
|
108
|
+
// globstar is enabled, so determine if this is a globstar segment
|
109
|
+
var isGlobstar = starCount > 1 // multiple "*"'s
|
110
|
+
&& (prevChar === "/" || prevChar === undefined) // from the start of the segment
|
111
|
+
&& (nextChar === "/" || nextChar === undefined) // to the end of the segment
|
112
|
+
|
113
|
+
if (isGlobstar) {
|
114
|
+
// it's a globstar, so match zero or more path segments
|
115
|
+
reStr += "((?:[^/]*(?:\/|$))*)";
|
116
|
+
i++; // move over the "/"
|
117
|
+
} else {
|
118
|
+
// it's not a globstar, so only match one path segment
|
119
|
+
reStr += "([^/]*)";
|
120
|
+
}
|
121
|
+
}
|
122
|
+
break;
|
123
|
+
|
124
|
+
default:
|
125
|
+
reStr += c;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
// When regexp 'g' flag is specified don't
|
130
|
+
// constrain the regular expression with ^ & $
|
131
|
+
if (!flags || !~flags.indexOf('g')) {
|
132
|
+
reStr = "^" + reStr + "$";
|
133
|
+
}
|
134
|
+
|
135
|
+
return new RegExp(reStr, flags);
|
136
|
+
};
|
137
|
+
|
138
|
+
|
139
|
+
/***/ })
|
140
|
+
|
141
|
+
/******/ });
|
142
|
+
/************************************************************************/
|
143
|
+
/******/ // The module cache
|
144
|
+
/******/ var __webpack_module_cache__ = {};
|
145
|
+
/******/
|
146
|
+
/******/ // The require function
|
147
|
+
/******/ function __nccwpck_require__(moduleId) {
|
148
|
+
/******/ // Check if module is in cache
|
149
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
150
|
+
/******/ if (cachedModule !== undefined) {
|
151
|
+
/******/ return cachedModule.exports;
|
152
|
+
/******/ }
|
153
|
+
/******/ // Create a new module (and put it into the cache)
|
154
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
155
|
+
/******/ // no module.id needed
|
156
|
+
/******/ // no module.loaded needed
|
157
|
+
/******/ exports: {}
|
158
|
+
/******/ };
|
159
|
+
/******/
|
160
|
+
/******/ // Execute the module function
|
161
|
+
/******/ var threw = true;
|
162
|
+
/******/ try {
|
163
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
|
164
|
+
/******/ threw = false;
|
165
|
+
/******/ } finally {
|
166
|
+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
167
|
+
/******/ }
|
168
|
+
/******/
|
169
|
+
/******/ // Return the exports of the module
|
170
|
+
/******/ return module.exports;
|
171
|
+
/******/ }
|
172
|
+
/******/
|
173
|
+
/************************************************************************/
|
174
|
+
/******/ /* webpack/runtime/compat */
|
175
|
+
/******/
|
176
|
+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
177
|
+
/******/
|
178
|
+
/************************************************************************/
|
179
|
+
/******/
|
180
|
+
/******/ // startup
|
181
|
+
/******/ // Load entry module and return exports
|
182
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
183
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(137);
|
184
|
+
/******/ module.exports = __webpack_exports__;
|
185
|
+
/******/
|
186
|
+
/******/ })()
|
187
|
+
;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"glob-to-regexp","author":"Nick Fitzgerald <fitzgen@gmail.com>","version":"0.4.1","license":"BSD-2-Clause","types":"index.d.ts","type":"commonjs"}
|
@@ -1,147 +1,10 @@
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
2
|
+
/******/ "use strict";
|
2
3
|
/******/ var __webpack_modules__ = ({
|
3
4
|
|
4
|
-
/***/ 137:
|
5
|
-
/***/ ((module) => {
|
6
|
-
|
7
|
-
module.exports = function (glob, opts) {
|
8
|
-
if (typeof glob !== 'string') {
|
9
|
-
throw new TypeError('Expected a string');
|
10
|
-
}
|
11
|
-
|
12
|
-
var str = String(glob);
|
13
|
-
|
14
|
-
// The regexp we are building, as a string.
|
15
|
-
var reStr = "";
|
16
|
-
|
17
|
-
// Whether we are matching so called "extended" globs (like bash) and should
|
18
|
-
// support single character matching, matching ranges of characters, group
|
19
|
-
// matching, etc.
|
20
|
-
var extended = opts ? !!opts.extended : false;
|
21
|
-
|
22
|
-
// When globstar is _false_ (default), '/foo/*' is translated a regexp like
|
23
|
-
// '^\/foo\/.*$' which will match any string beginning with '/foo/'
|
24
|
-
// When globstar is _true_, '/foo/*' is translated to regexp like
|
25
|
-
// '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT
|
26
|
-
// which does not have a '/' to the right of it.
|
27
|
-
// E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but
|
28
|
-
// these will not '/foo/bar/baz', '/foo/bar/baz.txt'
|
29
|
-
// Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when
|
30
|
-
// globstar is _false_
|
31
|
-
var globstar = opts ? !!opts.globstar : false;
|
32
|
-
|
33
|
-
// If we are doing extended matching, this boolean is true when we are inside
|
34
|
-
// a group (eg {*.html,*.js}), and false otherwise.
|
35
|
-
var inGroup = false;
|
36
|
-
|
37
|
-
// RegExp flags (eg "i" ) to pass in to RegExp constructor.
|
38
|
-
var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : "";
|
39
|
-
|
40
|
-
var c;
|
41
|
-
for (var i = 0, len = str.length; i < len; i++) {
|
42
|
-
c = str[i];
|
43
|
-
|
44
|
-
switch (c) {
|
45
|
-
case "/":
|
46
|
-
case "$":
|
47
|
-
case "^":
|
48
|
-
case "+":
|
49
|
-
case ".":
|
50
|
-
case "(":
|
51
|
-
case ")":
|
52
|
-
case "=":
|
53
|
-
case "!":
|
54
|
-
case "|":
|
55
|
-
reStr += "\\" + c;
|
56
|
-
break;
|
57
|
-
|
58
|
-
case "?":
|
59
|
-
if (extended) {
|
60
|
-
reStr += ".";
|
61
|
-
break;
|
62
|
-
}
|
63
|
-
|
64
|
-
case "[":
|
65
|
-
case "]":
|
66
|
-
if (extended) {
|
67
|
-
reStr += c;
|
68
|
-
break;
|
69
|
-
}
|
70
|
-
|
71
|
-
case "{":
|
72
|
-
if (extended) {
|
73
|
-
inGroup = true;
|
74
|
-
reStr += "(";
|
75
|
-
break;
|
76
|
-
}
|
77
|
-
|
78
|
-
case "}":
|
79
|
-
if (extended) {
|
80
|
-
inGroup = false;
|
81
|
-
reStr += ")";
|
82
|
-
break;
|
83
|
-
}
|
84
|
-
|
85
|
-
case ",":
|
86
|
-
if (inGroup) {
|
87
|
-
reStr += "|";
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
reStr += "\\" + c;
|
91
|
-
break;
|
92
|
-
|
93
|
-
case "*":
|
94
|
-
// Move over all consecutive "*"'s.
|
95
|
-
// Also store the previous and next characters
|
96
|
-
var prevChar = str[i - 1];
|
97
|
-
var starCount = 1;
|
98
|
-
while(str[i + 1] === "*") {
|
99
|
-
starCount++;
|
100
|
-
i++;
|
101
|
-
}
|
102
|
-
var nextChar = str[i + 1];
|
103
|
-
|
104
|
-
if (!globstar) {
|
105
|
-
// globstar is disabled, so treat any number of "*" as one
|
106
|
-
reStr += ".*";
|
107
|
-
} else {
|
108
|
-
// globstar is enabled, so determine if this is a globstar segment
|
109
|
-
var isGlobstar = starCount > 1 // multiple "*"'s
|
110
|
-
&& (prevChar === "/" || prevChar === undefined) // from the start of the segment
|
111
|
-
&& (nextChar === "/" || nextChar === undefined) // to the end of the segment
|
112
|
-
|
113
|
-
if (isGlobstar) {
|
114
|
-
// it's a globstar, so match zero or more path segments
|
115
|
-
reStr += "((?:[^/]*(?:\/|$))*)";
|
116
|
-
i++; // move over the "/"
|
117
|
-
} else {
|
118
|
-
// it's not a globstar, so only match one path segment
|
119
|
-
reStr += "([^/]*)";
|
120
|
-
}
|
121
|
-
}
|
122
|
-
break;
|
123
|
-
|
124
|
-
default:
|
125
|
-
reStr += c;
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
|
-
// When regexp 'g' flag is specified don't
|
130
|
-
// constrain the regular expression with ^ & $
|
131
|
-
if (!flags || !~flags.indexOf('g')) {
|
132
|
-
reStr = "^" + reStr + "$";
|
133
|
-
}
|
134
|
-
|
135
|
-
return new RegExp(reStr, flags);
|
136
|
-
};
|
137
|
-
|
138
|
-
|
139
|
-
/***/ }),
|
140
|
-
|
141
5
|
/***/ 799:
|
142
6
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
143
7
|
|
144
|
-
"use strict";
|
145
8
|
/*
|
146
9
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
147
10
|
Author Tobias Koppers @sokra
|
@@ -940,7 +803,6 @@ function ensureFsAccuracy(mtime) {
|
|
940
803
|
/***/ 308:
|
941
804
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
942
805
|
|
943
|
-
"use strict";
|
944
806
|
/*
|
945
807
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
946
808
|
Author Tobias Koppers @sokra
|
@@ -1055,7 +917,6 @@ module.exports = LinkResolver;
|
|
1055
917
|
/***/ 847:
|
1056
918
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
1057
919
|
|
1058
|
-
"use strict";
|
1059
920
|
/*
|
1060
921
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
1061
922
|
Author Tobias Koppers @sokra
|
@@ -1115,7 +976,6 @@ module.exports.WatcherManager = WatcherManager;
|
|
1115
976
|
/***/ 935:
|
1116
977
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
1117
978
|
|
1118
|
-
"use strict";
|
1119
979
|
/*
|
1120
980
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
1121
981
|
Author Tobias Koppers @sokra
|
@@ -1261,7 +1121,6 @@ module.exports = (plan, limit) => {
|
|
1261
1121
|
/***/ 214:
|
1262
1122
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
1263
1123
|
|
1264
|
-
"use strict";
|
1265
1124
|
/*
|
1266
1125
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
1267
1126
|
Author Tobias Koppers @sokra
|
@@ -1640,7 +1499,6 @@ exports.watcherLimit = watcherLimit;
|
|
1640
1499
|
/***/ 882:
|
1641
1500
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
1642
1501
|
|
1643
|
-
"use strict";
|
1644
1502
|
/*
|
1645
1503
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
1646
1504
|
Author Tobias Koppers @sokra
|
@@ -1650,7 +1508,7 @@ exports.watcherLimit = watcherLimit;
|
|
1650
1508
|
const getWatcherManager = __nccwpck_require__(847);
|
1651
1509
|
const LinkResolver = __nccwpck_require__(308);
|
1652
1510
|
const EventEmitter = (__nccwpck_require__(434).EventEmitter);
|
1653
|
-
const globToRegExp = __nccwpck_require__(
|
1511
|
+
const globToRegExp = __nccwpck_require__(686);
|
1654
1512
|
const watchEventSource = __nccwpck_require__(214);
|
1655
1513
|
|
1656
1514
|
const EMPTY_ARRAY = [];
|
@@ -2036,12 +1894,18 @@ class Watchpack extends EventEmitter {
|
|
2036
1894
|
module.exports = Watchpack;
|
2037
1895
|
|
2038
1896
|
|
1897
|
+
/***/ }),
|
1898
|
+
|
1899
|
+
/***/ 686:
|
1900
|
+
/***/ ((module) => {
|
1901
|
+
|
1902
|
+
module.exports = require("../glob-to-regexp/index.js");
|
1903
|
+
|
2039
1904
|
/***/ }),
|
2040
1905
|
|
2041
1906
|
/***/ 923:
|
2042
1907
|
/***/ ((module) => {
|
2043
1908
|
|
2044
|
-
"use strict";
|
2045
1909
|
module.exports = require("../graceful-fs/index.js");
|
2046
1910
|
|
2047
1911
|
/***/ }),
|
@@ -2049,7 +1913,6 @@ module.exports = require("../graceful-fs/index.js");
|
|
2049
1913
|
/***/ 434:
|
2050
1914
|
/***/ ((module) => {
|
2051
1915
|
|
2052
|
-
"use strict";
|
2053
1916
|
module.exports = require("events");
|
2054
1917
|
|
2055
1918
|
/***/ }),
|
@@ -2057,7 +1920,6 @@ module.exports = require("events");
|
|
2057
1920
|
/***/ 896:
|
2058
1921
|
/***/ ((module) => {
|
2059
1922
|
|
2060
|
-
"use strict";
|
2061
1923
|
module.exports = require("fs");
|
2062
1924
|
|
2063
1925
|
/***/ }),
|
@@ -2065,7 +1927,6 @@ module.exports = require("fs");
|
|
2065
1927
|
/***/ 857:
|
2066
1928
|
/***/ ((module) => {
|
2067
1929
|
|
2068
|
-
"use strict";
|
2069
1930
|
module.exports = require("os");
|
2070
1931
|
|
2071
1932
|
/***/ }),
|
@@ -2073,7 +1934,6 @@ module.exports = require("os");
|
|
2073
1934
|
/***/ 928:
|
2074
1935
|
/***/ ((module) => {
|
2075
1936
|
|
2076
|
-
"use strict";
|
2077
1937
|
module.exports = require("path");
|
2078
1938
|
|
2079
1939
|
/***/ })
|
package/dist/Compilation.d.ts
CHANGED
@@ -296,6 +296,12 @@ export declare class Compilation {
|
|
296
296
|
add: (dep: string) => void;
|
297
297
|
addAll: (deps: Iterable<string>) => void;
|
298
298
|
};
|
299
|
+
get __internal__addedFileDependencies(): string[];
|
300
|
+
get __internal__removedFileDependencies(): string[];
|
301
|
+
get __internal__addedContextDependencies(): string[];
|
302
|
+
get __internal__removedContextDependencies(): string[];
|
303
|
+
get __internal__addedMissingDependencies(): string[];
|
304
|
+
get __internal__removedMissingDependencies(): string[];
|
299
305
|
contextDependencies: {
|
300
306
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
301
307
|
has(dep: string): boolean;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import * as binding from "@rspack/binding";
|
2
|
+
import type Watchpack from "../compiled/watchpack";
|
3
|
+
import type { FileSystemInfoEntry, WatchFileSystem, Watcher } from "./util/fs";
|
4
|
+
export default class NativeWatchFileSystem implements WatchFileSystem {
|
5
|
+
#private;
|
6
|
+
watch(files: Iterable<string> & {
|
7
|
+
added?: Iterable<string>;
|
8
|
+
removed?: Iterable<string>;
|
9
|
+
}, directories: Iterable<string> & {
|
10
|
+
added?: Iterable<string>;
|
11
|
+
removed?: Iterable<string>;
|
12
|
+
}, missing: Iterable<string> & {
|
13
|
+
added?: Iterable<string>;
|
14
|
+
removed?: Iterable<string>;
|
15
|
+
}, _startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
16
|
+
getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
|
17
|
+
}
|
package/dist/Watching.d.ts
CHANGED
@@ -21,7 +21,16 @@ export declare class Watching {
|
|
21
21
|
startTime?: number;
|
22
22
|
suspended: boolean;
|
23
23
|
constructor(compiler: Compiler, watchOptions: WatchOptions, handler: Callback<Error, Stats>);
|
24
|
-
watch(files: Iterable<string
|
24
|
+
watch(files: Iterable<string> & {
|
25
|
+
added?: Iterable<string>;
|
26
|
+
removed?: Iterable<string>;
|
27
|
+
}, dirs: Iterable<string> & {
|
28
|
+
added?: Iterable<string>;
|
29
|
+
removed?: Iterable<string>;
|
30
|
+
}, missing: Iterable<string> & {
|
31
|
+
added?: Iterable<string>;
|
32
|
+
removed?: Iterable<string>;
|
33
|
+
}): void;
|
25
34
|
close(callback?: () => void): void;
|
26
35
|
invalidate(callback?: Callback<Error, void>): void;
|
27
36
|
/**
|
@@ -111,6 +111,7 @@ export interface ExperimentsNormalized {
|
|
111
111
|
inlineConst?: boolean;
|
112
112
|
inlineEnum?: boolean;
|
113
113
|
typeReexportsPresence?: boolean;
|
114
|
+
nativeWatcher?: boolean;
|
114
115
|
}
|
115
116
|
export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
|
116
117
|
export type OptimizationRuntimeChunkNormalized = false | {
|
package/dist/config/types.d.ts
CHANGED
@@ -2042,6 +2042,11 @@ export type Experiments = {
|
|
2042
2042
|
* @default false
|
2043
2043
|
*/
|
2044
2044
|
inlineConst?: boolean;
|
2045
|
+
/**
|
2046
|
+
* Enable native watcher
|
2047
|
+
* @default false
|
2048
|
+
*/
|
2049
|
+
nativeWatcher?: boolean;
|
2045
2050
|
/**
|
2046
2051
|
* Enable inline enum feature
|
2047
2052
|
* @default false
|
package/dist/index.js
CHANGED
@@ -210,6 +210,9 @@ var __webpack_modules__ = {
|
|
210
210
|
"browserslist-load-config": function(module) {
|
211
211
|
module.exports = require("../compiled/browserslist-load-config/index.js");
|
212
212
|
},
|
213
|
+
"glob-to-regexp": function(module) {
|
214
|
+
module.exports = require("../compiled/glob-to-regexp/index.js");
|
215
|
+
},
|
213
216
|
watchpack: function(module) {
|
214
217
|
module.exports = require("../compiled/watchpack/index.js");
|
215
218
|
},
|
@@ -1757,6 +1760,24 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1757
1760
|
});
|
1758
1761
|
}
|
1759
1762
|
fileDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().fileDependencies, (d)=>this.#inner.addFileDependencies(d));
|
1763
|
+
get __internal__addedFileDependencies() {
|
1764
|
+
return this.#inner.dependencies().addedFileDependencies;
|
1765
|
+
}
|
1766
|
+
get __internal__removedFileDependencies() {
|
1767
|
+
return this.#inner.dependencies().removedFileDependencies;
|
1768
|
+
}
|
1769
|
+
get __internal__addedContextDependencies() {
|
1770
|
+
return this.#inner.dependencies().addedContextDependencies;
|
1771
|
+
}
|
1772
|
+
get __internal__removedContextDependencies() {
|
1773
|
+
return this.#inner.dependencies().removedContextDependencies;
|
1774
|
+
}
|
1775
|
+
get __internal__addedMissingDependencies() {
|
1776
|
+
return this.#inner.dependencies().addedMissingDependencies;
|
1777
|
+
}
|
1778
|
+
get __internal__removedMissingDependencies() {
|
1779
|
+
return this.#inner.dependencies().removedMissingDependencies;
|
1780
|
+
}
|
1760
1781
|
contextDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().contextDependencies, (d)=>this.#inner.addContextDependencies(d));
|
1761
1782
|
missingDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().missingDependencies, (d)=>this.#inner.addMissingDependencies(d));
|
1762
1783
|
buildDependencies = createFakeCompilationDependencies(()=>this.#inner.dependencies().buildDependencies, (d)=>this.#inner.addBuildDependencies(d));
|
@@ -9094,7 +9115,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9094
9115
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
9095
9116
|
defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
|
9096
9117
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
9097
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7
|
9118
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
9098
9119
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
|
9099
9120
|
var parserOptions;
|
9100
9121
|
if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), D(parserOptions = module.parser.javascript, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
@@ -9971,12 +9992,16 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9971
9992
|
this.callbacks = [];
|
9972
9993
|
let fileDependencies = new Set([
|
9973
9994
|
...compilation.fileDependencies
|
9974
|
-
])
|
9995
|
+
]);
|
9996
|
+
fileDependencies.added = new Set(compilation.__internal__addedFileDependencies), fileDependencies.removed = new Set(compilation.__internal__removedFileDependencies);
|
9997
|
+
let contextDependencies = new Set([
|
9975
9998
|
...compilation.contextDependencies
|
9976
|
-
])
|
9999
|
+
]);
|
10000
|
+
contextDependencies.added = new Set(compilation.__internal__addedContextDependencies), contextDependencies.removed = new Set(compilation.__internal__removedContextDependencies);
|
10001
|
+
let missingDependencies = new Set([
|
9977
10002
|
...compilation.missingDependencies
|
9978
10003
|
]);
|
9979
|
-
this.compiler.hooks.done.callAsync(stats, (err)=>{
|
10004
|
+
missingDependencies.added = new Set(compilation.__internal__addedMissingDependencies), missingDependencies.removed = new Set(compilation.__internal__removedMissingDependencies), this.compiler.hooks.done.callAsync(stats, (err)=>{
|
9980
10005
|
if (err) return handleError(err, cbs);
|
9981
10006
|
for (let cb of (this.handler(null, stats), process.nextTick(()=>{
|
9982
10007
|
this.#closed || this.watch(fileDependencies, contextDependencies, missingDependencies);
|
@@ -9999,7 +10024,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
9999
10024
|
this.suspended && (this.suspended = !1, this.#invalidate());
|
10000
10025
|
}
|
10001
10026
|
}
|
10002
|
-
let CORE_VERSION = "1.4.7
|
10027
|
+
let CORE_VERSION = "1.4.7", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10003
10028
|
|
10004
10029
|
Help:
|
10005
10030
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -11412,7 +11437,7 @@ Help:
|
|
11412
11437
|
obj.children = this.stats.map((stat, idx)=>{
|
11413
11438
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11414
11439
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11415
|
-
}), childOptions.version && (obj.rspackVersion = "1.4.7
|
11440
|
+
}), childOptions.version && (obj.rspackVersion = "1.4.7", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11416
11441
|
let mapError = (j, obj)=>({
|
11417
11442
|
...obj,
|
11418
11443
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12312,7 +12337,7 @@ Help:
|
|
12312
12337
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12313
12338
|
},
|
12314
12339
|
version: (object)=>{
|
12315
|
-
object.version = "5.75.0", object.rspackVersion = "1.4.7
|
12340
|
+
object.version = "5.75.0", object.rspackVersion = "1.4.7";
|
12316
12341
|
},
|
12317
12342
|
env: (object, _compilation, _context, { _env })=>{
|
12318
12343
|
object.env = _env;
|
@@ -13911,6 +13936,79 @@ Help:
|
|
13911
13936
|
}
|
13912
13937
|
}
|
13913
13938
|
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
13939
|
+
let stringToRegexp = (ignored)=>{
|
13940
|
+
if (0 === ignored.length) return;
|
13941
|
+
let { source } = __webpack_require__("glob-to-regexp")(ignored, {
|
13942
|
+
globstar: !0,
|
13943
|
+
extended: !0
|
13944
|
+
});
|
13945
|
+
return `${source.slice(0, -1)}(?:$|\\/)`;
|
13946
|
+
};
|
13947
|
+
class NativeWatchFileSystem {
|
13948
|
+
#inner;
|
13949
|
+
watch(files, directories, missing, _startTime, options, callback, callbackUndelayed) {
|
13950
|
+
if ((!files.added || "function" != typeof files.added[Symbol.iterator]) && (!files.removed || "function" != typeof files.removed[Symbol.iterator])) throw Error("Invalid arguments: 'files'");
|
13951
|
+
if ((!directories.added || "function" != typeof directories.added[Symbol.iterator]) && (!directories.removed || "function" != typeof directories.removed[Symbol.iterator])) throw Error("Invalid arguments: 'directories'");
|
13952
|
+
if ("function" != typeof callback) throw Error("Invalid arguments: 'callback'");
|
13953
|
+
if ("object" != typeof options) throw Error("Invalid arguments: 'options'");
|
13954
|
+
if ("function" != typeof callbackUndelayed && callbackUndelayed) throw Error("Invalid arguments: 'callbackUndelayed'");
|
13955
|
+
let nativeWatcher = this.getNativeWatcher(options);
|
13956
|
+
return nativeWatcher.watch([
|
13957
|
+
Array.from(files.added),
|
13958
|
+
Array.from(files.removed)
|
13959
|
+
], [
|
13960
|
+
Array.from(directories.added),
|
13961
|
+
Array.from(directories.removed)
|
13962
|
+
], [
|
13963
|
+
Array.from(missing.added),
|
13964
|
+
Array.from(missing.removed)
|
13965
|
+
], (err, result)=>{
|
13966
|
+
let { changedFiles, removedFiles } = result;
|
13967
|
+
callback(err, new Map(), new Map(), new Set(changedFiles), new Set(removedFiles));
|
13968
|
+
}, (fileName)=>{
|
13969
|
+
callbackUndelayed(fileName, Date.now());
|
13970
|
+
}), {
|
13971
|
+
close: ()=>{
|
13972
|
+
nativeWatcher.close();
|
13973
|
+
},
|
13974
|
+
pause: ()=>{
|
13975
|
+
nativeWatcher.pause();
|
13976
|
+
},
|
13977
|
+
getInfo: ()=>({
|
13978
|
+
changes: new Set(),
|
13979
|
+
removals: new Set(),
|
13980
|
+
fileTimeInfoEntries: new Map(),
|
13981
|
+
contextTimeInfoEntries: new Map()
|
13982
|
+
})
|
13983
|
+
};
|
13984
|
+
}
|
13985
|
+
getNativeWatcher(options) {
|
13986
|
+
if (this.#inner) return this.#inner;
|
13987
|
+
let nativeWatcherOptions = {
|
13988
|
+
followSymlinks: options.followSymlinks,
|
13989
|
+
aggregateTimeout: options.aggregateTimeout,
|
13990
|
+
pollInterval: "boolean" == typeof options.poll ? 0 : options.poll,
|
13991
|
+
ignored: ((ignored)=>{
|
13992
|
+
if (Array.isArray(ignored)) {
|
13993
|
+
let stringRegexps = ignored.map((i)=>stringToRegexp(i)).filter(Boolean);
|
13994
|
+
if (0 === stringRegexps.length) return ()=>!1;
|
13995
|
+
let regexp = new RegExp(stringRegexps.join("|"));
|
13996
|
+
return (item)=>regexp.test(item.replace(/\\/g, "/"));
|
13997
|
+
}
|
13998
|
+
if ("string" == typeof ignored) {
|
13999
|
+
let stringRegexp = stringToRegexp(ignored);
|
14000
|
+
if (!stringRegexp) return ()=>!1;
|
14001
|
+
let regexp = new RegExp(stringRegexp);
|
14002
|
+
return (item)=>regexp.test(item.replace(/\\/g, "/"));
|
14003
|
+
}
|
14004
|
+
if (ignored instanceof RegExp) return (item)=>ignored.test(item.replace(/\\/g, "/"));
|
14005
|
+
if ("function" == typeof ignored) return (item)=>ignored(item);
|
14006
|
+
if (ignored) throw Error(`Invalid option for 'ignored': ${ignored}`);
|
14007
|
+
})(options.ignored)
|
14008
|
+
}, nativeWatcher = new binding_.NativeWatcher(nativeWatcherOptions);
|
14009
|
+
return this.#inner = nativeWatcher, nativeWatcher;
|
14010
|
+
}
|
14011
|
+
}
|
13914
14012
|
let filterToFunction = (item)=>{
|
13915
14013
|
if ("string" == typeof item) {
|
13916
14014
|
let regExp = RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
|
@@ -14180,7 +14278,7 @@ Help:
|
|
14180
14278
|
})
|
14181
14279
|
});
|
14182
14280
|
let inputFileSystem = new (CachedInputFileSystem_default())(graceful_fs_index_js_default(), 60000);
|
14183
|
-
compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
|
14281
|
+
compiler.inputFileSystem = inputFileSystem, compiler.outputFileSystem = graceful_fs_index_js_default(), compiler.intermediateFileSystem = null, compiler.options.experiments.nativeWatcher ? compiler.watchFileSystem = new NativeWatchFileSystem() : compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem), compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler)=>{
|
14184
14282
|
compiler.inputFileSystem === inputFileSystem && (compiler.fsStartTime = Date.now(), inputFileSystem.purge?.());
|
14185
14283
|
});
|
14186
14284
|
}
|
@@ -15297,7 +15395,8 @@ Help:
|
|
15297
15395
|
useInputFileSystem: useInputFileSystem,
|
15298
15396
|
inlineConst: schemas_boolean(),
|
15299
15397
|
inlineEnum: schemas_boolean(),
|
15300
|
-
typeReexportsPresence: schemas_boolean()
|
15398
|
+
typeReexportsPresence: schemas_boolean(),
|
15399
|
+
nativeWatcher: schemas_boolean()
|
15301
15400
|
}).partial(), watch = schemas_boolean(), watchOptions = strictObject({
|
15302
15401
|
aggregateTimeout: numberOrInfinity,
|
15303
15402
|
followSymlinks: schemas_boolean(),
|
@@ -15746,7 +15845,7 @@ Help:
|
|
15746
15845
|
let _options = JSON.stringify(options || {});
|
15747
15846
|
return binding_default().transform(source, _options);
|
15748
15847
|
}
|
15749
|
-
let exports_rspackVersion = "1.4.7
|
15848
|
+
let exports_rspackVersion = "1.4.7", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15750
15849
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15751
15850
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15752
15851
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
package/dist/schema/config.d.ts
CHANGED
@@ -403,6 +403,7 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
|
|
403
403
|
inlineConst: z.ZodOptional<z.ZodBoolean>;
|
404
404
|
inlineEnum: z.ZodOptional<z.ZodBoolean>;
|
405
405
|
typeReexportsPresence: z.ZodOptional<z.ZodBoolean>;
|
406
|
+
nativeWatcher: z.ZodOptional<z.ZodBoolean>;
|
406
407
|
}, z.core.$strict>>;
|
407
408
|
externals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>]>>]>, z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>]>>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>]>>]>, z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>]>]>>;
|
408
409
|
externalsType: z.ZodOptional<z.ZodEnum<{
|
package/dist/util/fs.d.ts
CHANGED
@@ -338,6 +338,15 @@ export interface FileSystemInfoEntry {
|
|
338
338
|
timestamp?: number;
|
339
339
|
}
|
340
340
|
export interface WatchFileSystem {
|
341
|
-
watch(files: Iterable<string
|
341
|
+
watch(files: Iterable<string> & {
|
342
|
+
added?: Iterable<String>;
|
343
|
+
removed?: Iterable<String>;
|
344
|
+
}, directories: Iterable<string> & {
|
345
|
+
added?: Iterable<String>;
|
346
|
+
removed?: Iterable<String>;
|
347
|
+
}, missing: Iterable<string> & {
|
348
|
+
added?: Iterable<String>;
|
349
|
+
removed?: Iterable<String>;
|
350
|
+
}, startTime: number, options: WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
342
351
|
}
|
343
352
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/core",
|
3
|
-
"version": "1.4.7
|
3
|
+
"version": "1.4.7",
|
4
4
|
"webpackVersion": "5.75.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
@@ -52,13 +52,15 @@
|
|
52
52
|
"typescript": "^5.8.3",
|
53
53
|
"watchpack": "^2.4.4",
|
54
54
|
"webpack-sources": "3.3.3",
|
55
|
+
"glob-to-regexp": "^0.4.1",
|
55
56
|
"zod": "^3.25.76",
|
57
|
+
"@types/glob-to-regexp": "^0.4.4",
|
56
58
|
"zod-validation-error": "3.5.3"
|
57
59
|
},
|
58
60
|
"dependencies": {
|
59
61
|
"@module-federation/runtime-tools": "0.16.0",
|
60
62
|
"@rspack/lite-tapable": "1.0.1",
|
61
|
-
"@rspack/binding": "1.4.7
|
63
|
+
"@rspack/binding": "1.4.7"
|
62
64
|
},
|
63
65
|
"peerDependencies": {
|
64
66
|
"@swc/helpers": ">=0.5.1"
|