@rspack/core 2.1.0-beta.0 → 2.1.0

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.
Files changed (33) hide show
  1. package/compiled/http-proxy-middleware/package.json +1 -1
  2. package/compiled/watchpack/index.js +474 -235
  3. package/compiled/watchpack/package.json +1 -1
  4. package/compiled/watchpack/types/DirectoryWatcher.d.ts +2 -0
  5. package/compiled/watchpack/types/index.d.ts +121 -113
  6. package/compiled/watchpack/types/util/globToRegExp.d.ts +2 -0
  7. package/compiled/watchpack/types/watchpack.d.ts +1 -1
  8. package/compiled/webpack-sources/index.js +953 -351
  9. package/compiled/webpack-sources/package.json +1 -1
  10. package/compiled/webpack-sources/types.d.ts +40 -1
  11. package/dist/Module.d.ts +0 -1
  12. package/dist/NativeWatchFileSystem.d.ts +29 -0
  13. package/dist/RuntimeGlobals.d.ts +0 -1
  14. package/dist/builtin-loader/swc/types.d.ts +1 -59
  15. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/html-plugin/options.d.ts +1 -1
  17. package/dist/config/normalization.d.ts +2 -2
  18. package/dist/config/types.d.ts +15 -14
  19. package/dist/index.js +116 -67
  20. package/dist/lib/HookWebpackError.d.ts +0 -1
  21. package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
  22. package/dist/lib/cache/mergeEtags.d.ts +0 -1
  23. package/dist/node/NodeWatchFileSystem.d.ts +13 -1
  24. package/dist/rslib-runtime-worker.js +22 -0
  25. package/dist/rspack.d.ts +0 -1
  26. package/dist/sharing/IndependentSharedPlugin.d.ts +0 -1
  27. package/dist/stats/statsFactoryUtils.d.ts +0 -6
  28. package/dist/util/comparators.d.ts +1 -1
  29. package/dist/util/fake.d.ts +0 -3
  30. package/dist/util/fs.d.ts +9 -8
  31. package/dist/worker.js +1 -1
  32. package/package.json +7 -7
  33. /package/dist/{612.js → rslib-runtime-index.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "watchpack",
3
3
  "author": "Tobias Koppers @sokra",
4
- "version": "2.5.1",
4
+ "version": "2.5.2",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",
7
7
  "type": "commonjs"
@@ -48,6 +48,8 @@ declare class DirectoryWatcher extends EventEmitter<{
48
48
  filesWithoutCase: Map<string, number>;
49
49
  /** @type {Map<string, Watcher<DirectoryWatcherEvents> | boolean>} */
50
50
  directories: Map<string, Watcher<DirectoryWatcherEvents> | boolean>;
51
+ /** @type {Map<string, Watcher<FileWatcherEvents>>} */
52
+ _symlinkTargetWatchers: Map<string, Watcher<FileWatcherEvents>>;
51
53
  lastWatchEvent: number;
52
54
  initialScan: boolean;
53
55
  ignored: import("./index").IgnoredFunction;
@@ -1,4 +1,123 @@
1
- export = Watchpack;
1
+ declare namespace _exports {
2
+ export {
3
+ WatcherManager,
4
+ DirectoryWatcher,
5
+ DirectoryWatcherEvents,
6
+ FileWatcherEvents,
7
+ EventMap,
8
+ Watcher,
9
+ IgnoredFunction,
10
+ Ignored,
11
+ WatcherOptions,
12
+ WatchOptions,
13
+ NormalizedWatchOptions,
14
+ EventType,
15
+ Entry,
16
+ OnlySafeTimeEntry,
17
+ ExistenceOnlyTimeEntry,
18
+ TimeInfoEntries,
19
+ Changes,
20
+ Removals,
21
+ Aggregated,
22
+ WatchMethodOptions,
23
+ Times,
24
+ WatchpackEvents,
25
+ WatchpackExports,
26
+ };
27
+ }
28
+ declare const _exports: WatchpackExports;
29
+ export = _exports;
30
+ type WatcherManager = import("./getWatcherManager").WatcherManager;
31
+ type DirectoryWatcher = import("./DirectoryWatcher");
32
+ type DirectoryWatcherEvents =
33
+ import("./DirectoryWatcher").DirectoryWatcherEvents;
34
+ type FileWatcherEvents = import("./DirectoryWatcher").FileWatcherEvents;
35
+ type EventMap = Record<string, (...args: any[]) => any>;
36
+ type Watcher<T extends EventMap> = import("./DirectoryWatcher").Watcher<T>;
37
+ type IgnoredFunction = (item: string) => boolean;
38
+ type Ignored = string[] | RegExp | string | IgnoredFunction;
39
+ type WatcherOptions = {
40
+ /**
41
+ * true when need to resolve symlinks and watch symlink and real file, otherwise false
42
+ */
43
+ followSymlinks?: boolean | undefined;
44
+ /**
45
+ * ignore some files from watching (glob pattern or regexp)
46
+ */
47
+ ignored?: Ignored | undefined;
48
+ /**
49
+ * true when need to enable polling mode for watching, otherwise false
50
+ */
51
+ poll?: (number | boolean) | undefined;
52
+ };
53
+ type WatchOptions = WatcherOptions & {
54
+ aggregateTimeout?: number;
55
+ };
56
+ type NormalizedWatchOptions = {
57
+ /**
58
+ * true when need to resolve symlinks and watch symlink and real file, otherwise false
59
+ */
60
+ followSymlinks: boolean;
61
+ /**
62
+ * ignore some files from watching (glob pattern or regexp)
63
+ */
64
+ ignored: IgnoredFunction;
65
+ /**
66
+ * true when need to enable polling mode for watching, otherwise false
67
+ */
68
+ poll?: (number | boolean) | undefined;
69
+ };
70
+ type EventType =
71
+ | `scan (${string})`
72
+ | "change"
73
+ | "rename"
74
+ | `watch ${string}`
75
+ | `directory-removed ${string}`;
76
+ type Entry = {
77
+ safeTime: number;
78
+ timestamp: number;
79
+ accuracy: number;
80
+ };
81
+ type OnlySafeTimeEntry = {
82
+ safeTime: number;
83
+ };
84
+ type ExistenceOnlyTimeEntry = {};
85
+ type TimeInfoEntries = Map<
86
+ string,
87
+ Entry | OnlySafeTimeEntry | ExistenceOnlyTimeEntry | null
88
+ >;
89
+ type Changes = Set<string>;
90
+ type Removals = Set<string>;
91
+ type Aggregated = {
92
+ changes: Changes;
93
+ removals: Removals;
94
+ };
95
+ type WatchMethodOptions = {
96
+ files?: Iterable<string>;
97
+ directories?: Iterable<string>;
98
+ missing?: Iterable<string>;
99
+ startTime?: number;
100
+ };
101
+ type Times = Record<string, number>;
102
+ type WatchpackEvents = {
103
+ /**
104
+ * change event
105
+ */
106
+ change: (file: string, mtime: number, type: EventType) => void;
107
+ /**
108
+ * remove event
109
+ */
110
+ remove: (file: string, type: EventType) => void;
111
+ /**
112
+ * aggregated event
113
+ */
114
+ aggregated: (changes: Changes, removals: Removals) => void;
115
+ };
116
+ type WatchpackExports = typeof Watchpack & {
117
+ util: {
118
+ readonly globToRegExp: typeof globToRegExp;
119
+ };
120
+ };
2
121
  /**
3
122
  * @typedef {object} WatchpackEvents
4
123
  * @property {(file: string, mtime: number, type: EventType) => void} change change event
@@ -102,32 +221,7 @@ declare class Watchpack extends EventEmitter<{
102
221
  */
103
222
  _onRemove(item: string, file: string, type: EventType): void;
104
223
  }
105
- declare namespace Watchpack {
106
- export {
107
- WatcherManager,
108
- DirectoryWatcher,
109
- DirectoryWatcherEvents,
110
- FileWatcherEvents,
111
- EventMap,
112
- Watcher,
113
- IgnoredFunction,
114
- Ignored,
115
- WatcherOptions,
116
- WatchOptions,
117
- NormalizedWatchOptions,
118
- EventType,
119
- Entry,
120
- OnlySafeTimeEntry,
121
- ExistenceOnlyTimeEntry,
122
- TimeInfoEntries,
123
- Changes,
124
- Removals,
125
- Aggregated,
126
- WatchMethodOptions,
127
- Times,
128
- WatchpackEvents,
129
- };
130
- }
224
+ import globToRegExp = require("./util/globToRegExp");
131
225
  import { EventEmitter } from "events";
132
226
  declare class WatchpackFileWatcher {
133
227
  /**
@@ -173,89 +267,3 @@ declare class WatchpackDirectoryWatcher {
173
267
  update(directories: string | string[]): void;
174
268
  close(): void;
175
269
  }
176
- type WatcherManager = import("./getWatcherManager").WatcherManager;
177
- type DirectoryWatcher = import("./DirectoryWatcher");
178
- type DirectoryWatcherEvents =
179
- import("./DirectoryWatcher").DirectoryWatcherEvents;
180
- type FileWatcherEvents = import("./DirectoryWatcher").FileWatcherEvents;
181
- type EventMap = Record<string, (...args: any[]) => any>;
182
- type Watcher<T extends EventMap> = import("./DirectoryWatcher").Watcher<T>;
183
- type IgnoredFunction = (item: string) => boolean;
184
- type Ignored = string[] | RegExp | string | IgnoredFunction;
185
- type WatcherOptions = {
186
- /**
187
- * true when need to resolve symlinks and watch symlink and real file, otherwise false
188
- */
189
- followSymlinks?: boolean | undefined;
190
- /**
191
- * ignore some files from watching (glob pattern or regexp)
192
- */
193
- ignored?: Ignored | undefined;
194
- /**
195
- * true when need to enable polling mode for watching, otherwise false
196
- */
197
- poll?: (number | boolean) | undefined;
198
- };
199
- type WatchOptions = WatcherOptions & {
200
- aggregateTimeout?: number;
201
- };
202
- type NormalizedWatchOptions = {
203
- /**
204
- * true when need to resolve symlinks and watch symlink and real file, otherwise false
205
- */
206
- followSymlinks: boolean;
207
- /**
208
- * ignore some files from watching (glob pattern or regexp)
209
- */
210
- ignored: IgnoredFunction;
211
- /**
212
- * true when need to enable polling mode for watching, otherwise false
213
- */
214
- poll?: (number | boolean) | undefined;
215
- };
216
- type EventType =
217
- | `scan (${string})`
218
- | "change"
219
- | "rename"
220
- | `watch ${string}`
221
- | `directory-removed ${string}`;
222
- type Entry = {
223
- safeTime: number;
224
- timestamp: number;
225
- accuracy: number;
226
- };
227
- type OnlySafeTimeEntry = {
228
- safeTime: number;
229
- };
230
- type ExistenceOnlyTimeEntry = {};
231
- type TimeInfoEntries = Map<
232
- string,
233
- Entry | OnlySafeTimeEntry | ExistenceOnlyTimeEntry | null
234
- >;
235
- type Changes = Set<string>;
236
- type Removals = Set<string>;
237
- type Aggregated = {
238
- changes: Changes;
239
- removals: Removals;
240
- };
241
- type WatchMethodOptions = {
242
- files?: Iterable<string>;
243
- directories?: Iterable<string>;
244
- missing?: Iterable<string>;
245
- startTime?: number;
246
- };
247
- type Times = Record<string, number>;
248
- type WatchpackEvents = {
249
- /**
250
- * change event
251
- */
252
- change: (file: string, mtime: number, type: EventType) => void;
253
- /**
254
- * remove event
255
- */
256
- remove: (file: string, type: EventType) => void;
257
- /**
258
- * aggregated event
259
- */
260
- aggregated: (changes: Changes, removals: Removals) => void;
261
- };
@@ -0,0 +1,2 @@
1
+ declare function _exports(glob: string): string;
2
+ export = _exports;
@@ -1,2 +1,2 @@
1
- declare const _exports: typeof import("./index");
1
+ declare const _exports: import("./index").WatchpackExports;
2
2
  export = _exports;