@unpackjs/core 1.6.4 → 1.7.1
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/css-loader/index.js +48 -50
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +11 -11
- package/compiled/sass-loader/index.js +8 -8
- package/dist/bundler-config/chunkSplit.cjs +3 -3
- package/dist/bundler-config/chunkSplit.d.ts +1 -1
- package/dist/bundler-config/chunkSplit.d.ts.map +1 -1
- package/dist/bundler-config/chunkSplit.js +2 -2
- package/dist/bundler-config/css.cjs +3 -3
- package/dist/bundler-config/css.d.ts +1 -1
- package/dist/bundler-config/css.d.ts.map +1 -1
- package/dist/bundler-config/css.js +2 -2
- package/dist/bundler-config/experimentCss.cjs +3 -3
- package/dist/bundler-config/experimentCss.d.ts +1 -1
- package/dist/bundler-config/experimentCss.d.ts.map +1 -1
- package/dist/bundler-config/experimentCss.js +2 -2
- package/dist/bundler-config/index.cjs +18 -14
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +22 -18
- package/dist/createUnpack.cjs +6 -3
- package/dist/createUnpack.d.ts.map +1 -1
- package/dist/createUnpack.js +7 -4
- package/dist/index.cjs +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/logger.cjs +5 -3
- package/dist/logger.js +5 -3
- package/dist/plugin-progress/rspack.cjs +11 -2
- package/dist/plugin-progress/rspack.d.ts.map +1 -1
- package/dist/plugin-progress/rspack.js +11 -2
- package/dist/plugin-progress/webpack.cjs +11 -2
- package/dist/plugin-progress/webpack.d.ts.map +1 -1
- package/dist/plugin-progress/webpack.js +11 -2
- package/dist/prebundleDeps.cjs +349 -0
- package/dist/prebundleDeps.d.ts +5 -0
- package/dist/prebundleDeps.d.ts.map +1 -0
- package/dist/prebundleDeps.js +334 -0
- package/dist/run/dev.cjs +22 -39
- package/dist/run/dev.d.ts +1 -1
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +23 -40
- package/dist/thread-loader/worker.js +1 -1
- package/dist/types/config.d.ts +30 -8
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/logger.cjs +1 -0
- package/dist/types/logger.d.ts +2 -1
- package/dist/types/logger.d.ts.map +1 -1
- package/dist/types/logger.js +1 -0
- package/dist/utils.cjs +7 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +5 -0
- package/package.json +6 -9
- package/compiled/chokidar/index.d.ts +0 -327
- package/compiled/chokidar/index.js +0 -1773
- package/compiled/chokidar/license +0 -21
- package/compiled/chokidar/package.json +0 -1
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { Stats, Dirent } from 'fs';
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { Readable } from 'stream';
|
|
4
|
-
|
|
5
|
-
type Path$1 = string;
|
|
6
|
-
interface EntryInfo {
|
|
7
|
-
path: string;
|
|
8
|
-
fullPath: string;
|
|
9
|
-
stats?: Stats;
|
|
10
|
-
dirent?: Dirent;
|
|
11
|
-
basename: string;
|
|
12
|
-
}
|
|
13
|
-
type PathOrDirent = Dirent | Path$1;
|
|
14
|
-
type Tester = (path: EntryInfo) => boolean;
|
|
15
|
-
declare function defaultOptions(): {
|
|
16
|
-
root: string;
|
|
17
|
-
fileFilter: (_path: EntryInfo) => boolean;
|
|
18
|
-
directoryFilter: (_path: EntryInfo) => boolean;
|
|
19
|
-
type: string;
|
|
20
|
-
lstat: boolean;
|
|
21
|
-
depth: number;
|
|
22
|
-
alwaysStat: boolean;
|
|
23
|
-
highWaterMark: number;
|
|
24
|
-
};
|
|
25
|
-
type ReaddirpOptions = ReturnType<typeof defaultOptions>;
|
|
26
|
-
interface DirEntry$1 {
|
|
27
|
-
files: PathOrDirent[];
|
|
28
|
-
depth: number;
|
|
29
|
-
path: Path$1;
|
|
30
|
-
}
|
|
31
|
-
declare class ReaddirpStream extends Readable {
|
|
32
|
-
parents: any[];
|
|
33
|
-
reading: boolean;
|
|
34
|
-
parent?: DirEntry$1;
|
|
35
|
-
_stat: Function;
|
|
36
|
-
_maxDepth: number;
|
|
37
|
-
_wantsDir: boolean;
|
|
38
|
-
_wantsFile: boolean;
|
|
39
|
-
_wantsEverything: boolean;
|
|
40
|
-
_root: Path$1;
|
|
41
|
-
_isDirent: boolean;
|
|
42
|
-
_statsProp: 'dirent' | 'stats';
|
|
43
|
-
_rdOptions: {
|
|
44
|
-
encoding: 'utf8';
|
|
45
|
-
withFileTypes: boolean;
|
|
46
|
-
};
|
|
47
|
-
_fileFilter: Tester;
|
|
48
|
-
_directoryFilter: Tester;
|
|
49
|
-
constructor(options?: Partial<ReaddirpOptions>);
|
|
50
|
-
_read(batch: number): Promise<void>;
|
|
51
|
-
_exploreDir(path: Path$1, depth: number): Promise<{
|
|
52
|
-
files: string[] | undefined;
|
|
53
|
-
depth: number;
|
|
54
|
-
path: string;
|
|
55
|
-
}>;
|
|
56
|
-
_formatEntry(dirent: PathOrDirent, path: Path$1): EntryInfo | undefined;
|
|
57
|
-
_onError(err: Error): void;
|
|
58
|
-
_getEntryType(entry: EntryInfo): Promise<void | "" | "file" | "directory">;
|
|
59
|
-
_includeAsFile(entry: EntryInfo): boolean | undefined;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
type Path = string;
|
|
63
|
-
declare const EVENTS: {
|
|
64
|
-
readonly ALL: "all";
|
|
65
|
-
readonly READY: "ready";
|
|
66
|
-
readonly ADD: "add";
|
|
67
|
-
readonly CHANGE: "change";
|
|
68
|
-
readonly ADD_DIR: "addDir";
|
|
69
|
-
readonly UNLINK: "unlink";
|
|
70
|
-
readonly UNLINK_DIR: "unlinkDir";
|
|
71
|
-
readonly RAW: "raw";
|
|
72
|
-
readonly ERROR: "error";
|
|
73
|
-
};
|
|
74
|
-
type EventName = (typeof EVENTS)[keyof typeof EVENTS];
|
|
75
|
-
/**
|
|
76
|
-
* @mixin
|
|
77
|
-
*/
|
|
78
|
-
declare class NodeFsHandler {
|
|
79
|
-
fsw: FSWatcher;
|
|
80
|
-
_boundHandleError: (error: unknown) => void;
|
|
81
|
-
constructor(fsW: FSWatcher);
|
|
82
|
-
/**
|
|
83
|
-
* Watch file for changes with fs_watchFile or fs_watch.
|
|
84
|
-
* @param path to file or dir
|
|
85
|
-
* @param listener on fs change
|
|
86
|
-
* @returns closer for the watcher instance
|
|
87
|
-
*/
|
|
88
|
-
_watchWithNodeFs(path: string, listener: (path: string, newStats?: any) => void | Promise<void>): (() => void) | undefined;
|
|
89
|
-
/**
|
|
90
|
-
* Watch a file and emit add event if warranted.
|
|
91
|
-
* @returns closer for the watcher instance
|
|
92
|
-
*/
|
|
93
|
-
_handleFile(file: Path, stats: Stats, initialAdd: boolean): (() => void) | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Handle symlinks encountered while reading a dir.
|
|
96
|
-
* @param entry returned by readdirp
|
|
97
|
-
* @param directory path of dir being read
|
|
98
|
-
* @param path of this item
|
|
99
|
-
* @param item basename of this item
|
|
100
|
-
* @returns true if no more processing is needed for this entry.
|
|
101
|
-
*/
|
|
102
|
-
_handleSymlink(entry: EntryInfo, directory: string, path: Path, item: string): Promise<boolean | undefined>;
|
|
103
|
-
_handleRead(directory: string, initialAdd: boolean, wh: WatchHelper, target: Path, dir: Path, depth: number, throttler: Throttler): Promise<unknown> | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Read directory to add / remove files from `@watched` list and re-read it on change.
|
|
106
|
-
* @param dir fs path
|
|
107
|
-
* @param stats
|
|
108
|
-
* @param initialAdd
|
|
109
|
-
* @param depth relative to user-supplied path
|
|
110
|
-
* @param target child path targeted for watch
|
|
111
|
-
* @param wh Common watch helpers for this path
|
|
112
|
-
* @param realpath
|
|
113
|
-
* @returns closer for the watcher instance.
|
|
114
|
-
*/
|
|
115
|
-
_handleDir(dir: string, stats: Stats, initialAdd: boolean, depth: number, target: string, wh: WatchHelper, realpath: string): Promise<(() => void) | undefined>;
|
|
116
|
-
/**
|
|
117
|
-
* Handle added file, directory, or glob pattern.
|
|
118
|
-
* Delegates call to _handleFile / _handleDir after checks.
|
|
119
|
-
* @param path to file or ir
|
|
120
|
-
* @param initialAdd was the file added at watch instantiation?
|
|
121
|
-
* @param priorWh depth relative to user-supplied path
|
|
122
|
-
* @param depth Child path actually targeted for watch
|
|
123
|
-
* @param target Child path actually targeted for watch
|
|
124
|
-
*/
|
|
125
|
-
_addToNodeFs(path: string, initialAdd: boolean, priorWh: WatchHelper | undefined, depth: number, target?: string): Promise<string | false | undefined>;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
type AWF = {
|
|
129
|
-
stabilityThreshold: number;
|
|
130
|
-
pollInterval: number;
|
|
131
|
-
};
|
|
132
|
-
type BasicOpts = {
|
|
133
|
-
persistent: boolean;
|
|
134
|
-
ignoreInitial: boolean;
|
|
135
|
-
followSymlinks: boolean;
|
|
136
|
-
cwd?: string;
|
|
137
|
-
usePolling: boolean;
|
|
138
|
-
interval: number;
|
|
139
|
-
binaryInterval: number;
|
|
140
|
-
alwaysStat?: boolean;
|
|
141
|
-
depth?: number;
|
|
142
|
-
ignorePermissionErrors: boolean;
|
|
143
|
-
atomic: boolean | number;
|
|
144
|
-
};
|
|
145
|
-
type Throttler = {
|
|
146
|
-
timeoutObject: NodeJS.Timeout;
|
|
147
|
-
clear: () => void;
|
|
148
|
-
count: number;
|
|
149
|
-
};
|
|
150
|
-
type ChokidarOptions = Partial<BasicOpts & {
|
|
151
|
-
ignored: Matcher | Matcher[];
|
|
152
|
-
awaitWriteFinish: boolean | Partial<AWF>;
|
|
153
|
-
}>;
|
|
154
|
-
type FSWInstanceOptions = BasicOpts & {
|
|
155
|
-
ignored: Matcher[];
|
|
156
|
-
awaitWriteFinish: false | AWF;
|
|
157
|
-
};
|
|
158
|
-
type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change';
|
|
159
|
-
type EmitArgs = [EventName, Path | Error, any?, any?, any?];
|
|
160
|
-
type MatchFunction = (val: string, stats?: Stats) => boolean;
|
|
161
|
-
interface MatcherObject {
|
|
162
|
-
path: string;
|
|
163
|
-
recursive?: boolean;
|
|
164
|
-
}
|
|
165
|
-
type Matcher = string | RegExp | MatchFunction | MatcherObject;
|
|
166
|
-
/**
|
|
167
|
-
* Directory entry.
|
|
168
|
-
*/
|
|
169
|
-
declare class DirEntry {
|
|
170
|
-
path: Path;
|
|
171
|
-
_removeWatcher: (dir: string, base: string) => void;
|
|
172
|
-
items: Set<Path>;
|
|
173
|
-
constructor(dir: Path, removeWatcher: (dir: string, base: string) => void);
|
|
174
|
-
add(item: string): void;
|
|
175
|
-
remove(item: string): Promise<void>;
|
|
176
|
-
has(item: string): boolean | undefined;
|
|
177
|
-
getChildren(): string[];
|
|
178
|
-
dispose(): void;
|
|
179
|
-
}
|
|
180
|
-
declare class WatchHelper {
|
|
181
|
-
fsw: FSWatcher;
|
|
182
|
-
path: string;
|
|
183
|
-
watchPath: string;
|
|
184
|
-
fullWatchPath: string;
|
|
185
|
-
dirParts: string[][];
|
|
186
|
-
followSymlinks: boolean;
|
|
187
|
-
statMethod: 'stat' | 'lstat';
|
|
188
|
-
constructor(path: string, follow: boolean, fsw: FSWatcher);
|
|
189
|
-
entryPath(entry: EntryInfo): Path;
|
|
190
|
-
filterPath(entry: EntryInfo): boolean;
|
|
191
|
-
filterDir(entry: EntryInfo): boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Watches files & directories for changes. Emitted events:
|
|
195
|
-
* `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
|
|
196
|
-
*
|
|
197
|
-
* new FSWatcher()
|
|
198
|
-
* .add(directories)
|
|
199
|
-
* .on('add', path => log('File', path, 'was added'))
|
|
200
|
-
*/
|
|
201
|
-
declare class FSWatcher extends EventEmitter {
|
|
202
|
-
closed: boolean;
|
|
203
|
-
options: FSWInstanceOptions;
|
|
204
|
-
_closers: Map<string, Array<any>>;
|
|
205
|
-
_ignoredPaths: Set<Matcher>;
|
|
206
|
-
_throttled: Map<ThrottleType, Map<any, any>>;
|
|
207
|
-
_streams: Set<ReaddirpStream>;
|
|
208
|
-
_symlinkPaths: Map<Path, string | boolean>;
|
|
209
|
-
_watched: Map<string, DirEntry>;
|
|
210
|
-
_pendingWrites: Map<string, any>;
|
|
211
|
-
_pendingUnlinks: Map<string, EmitArgs>;
|
|
212
|
-
_readyCount: number;
|
|
213
|
-
_emitReady: () => void;
|
|
214
|
-
_closePromise?: Promise<void>;
|
|
215
|
-
_userIgnored?: MatchFunction;
|
|
216
|
-
_readyEmitted: boolean;
|
|
217
|
-
_emitRaw: () => void;
|
|
218
|
-
_boundRemove: (dir: string, item: string) => void;
|
|
219
|
-
_nodeFsHandler: NodeFsHandler;
|
|
220
|
-
constructor(_opts?: ChokidarOptions);
|
|
221
|
-
_addIgnoredPath(matcher: Matcher): void;
|
|
222
|
-
_removeIgnoredPath(matcher: Matcher): void;
|
|
223
|
-
/**
|
|
224
|
-
* Adds paths to be watched on an existing FSWatcher instance.
|
|
225
|
-
* @param paths_ file or file list. Other arguments are unused
|
|
226
|
-
*/
|
|
227
|
-
add(paths_: Path | Path[], _origAdd?: string, _internal?: boolean): FSWatcher;
|
|
228
|
-
/**
|
|
229
|
-
* Close watchers or start ignoring events from specified paths.
|
|
230
|
-
*/
|
|
231
|
-
unwatch(paths_: Path | Path[]): FSWatcher;
|
|
232
|
-
/**
|
|
233
|
-
* Close watchers and remove all listeners from watched paths.
|
|
234
|
-
*/
|
|
235
|
-
close(): Promise<void>;
|
|
236
|
-
/**
|
|
237
|
-
* Expose list of watched paths
|
|
238
|
-
* @returns for chaining
|
|
239
|
-
*/
|
|
240
|
-
getWatched(): Record<string, string[]>;
|
|
241
|
-
emitWithAll(event: EventName, args: EmitArgs): void;
|
|
242
|
-
/**
|
|
243
|
-
* Normalize and emit events.
|
|
244
|
-
* Calling _emit DOES NOT MEAN emit() would be called!
|
|
245
|
-
* @param event Type of event
|
|
246
|
-
* @param path File or directory path
|
|
247
|
-
* @param stats arguments to be passed with event
|
|
248
|
-
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
249
|
-
*/
|
|
250
|
-
_emit(event: EventName, path: Path, stats?: Stats): Promise<this | undefined>;
|
|
251
|
-
/**
|
|
252
|
-
* Common handler for errors
|
|
253
|
-
* @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
254
|
-
*/
|
|
255
|
-
_handleError(error: Error): Error | boolean;
|
|
256
|
-
/**
|
|
257
|
-
* Helper utility for throttling
|
|
258
|
-
* @param actionType type being throttled
|
|
259
|
-
* @param path being acted upon
|
|
260
|
-
* @param timeout duration of time to suppress duplicate actions
|
|
261
|
-
* @returns tracking object or false if action should be suppressed
|
|
262
|
-
*/
|
|
263
|
-
_throttle(actionType: ThrottleType, path: Path, timeout: number): Throttler | false;
|
|
264
|
-
_incrReadyCount(): number;
|
|
265
|
-
/**
|
|
266
|
-
* Awaits write operation to finish.
|
|
267
|
-
* Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
|
|
268
|
-
* @param path being acted upon
|
|
269
|
-
* @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
|
|
270
|
-
* @param event
|
|
271
|
-
* @param awfEmit Callback to be called when ready for event to be emitted.
|
|
272
|
-
*/
|
|
273
|
-
_awaitWriteFinish(path: Path, threshold: number, event: EventName, awfEmit: (err?: Error, stat?: Stats) => void): void;
|
|
274
|
-
/**
|
|
275
|
-
* Determines whether user has asked to ignore this path.
|
|
276
|
-
*/
|
|
277
|
-
_isIgnored(path: Path, stats?: Stats): boolean;
|
|
278
|
-
_isntIgnored(path: Path, stat?: Stats): boolean;
|
|
279
|
-
/**
|
|
280
|
-
* Provides a set of common helpers and properties relating to symlink handling.
|
|
281
|
-
* @param path file or directory pattern being watched
|
|
282
|
-
*/
|
|
283
|
-
_getWatchHelpers(path: Path): WatchHelper;
|
|
284
|
-
/**
|
|
285
|
-
* Provides directory tracking objects
|
|
286
|
-
* @param directory path of the directory
|
|
287
|
-
*/
|
|
288
|
-
_getWatchedDir(directory: string): DirEntry;
|
|
289
|
-
/**
|
|
290
|
-
* Check for read permissions: https://stackoverflow.com/a/11781404/1358405
|
|
291
|
-
*/
|
|
292
|
-
_hasReadPermissions(stats: Stats): boolean;
|
|
293
|
-
/**
|
|
294
|
-
* Handles emitting unlink events for
|
|
295
|
-
* files and directories, and via recursion, for
|
|
296
|
-
* files and directories within directories that are unlinked
|
|
297
|
-
* @param directory within which the following item is located
|
|
298
|
-
* @param item base path of item/directory
|
|
299
|
-
*/
|
|
300
|
-
_remove(directory: string, item: string, isDirectory?: boolean): void;
|
|
301
|
-
/**
|
|
302
|
-
* Closes all watchers for a path
|
|
303
|
-
*/
|
|
304
|
-
_closePath(path: Path): void;
|
|
305
|
-
/**
|
|
306
|
-
* Closes only file-specific watchers
|
|
307
|
-
*/
|
|
308
|
-
_closeFile(path: Path): void;
|
|
309
|
-
_addPathCloser(path: Path, closer: () => void): void;
|
|
310
|
-
_readdirp(root: Path, opts?: Partial<ReaddirpOptions>): ReaddirpStream | undefined;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Instantiates watcher with paths to be tracked.
|
|
314
|
-
* @param paths file / directory paths
|
|
315
|
-
* @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others
|
|
316
|
-
* @returns an instance of FSWatcher for chaining.
|
|
317
|
-
* @example
|
|
318
|
-
* const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });
|
|
319
|
-
* watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })
|
|
320
|
-
*/
|
|
321
|
-
declare function watch(paths: string | string[], options?: ChokidarOptions): FSWatcher;
|
|
322
|
-
declare const _default: {
|
|
323
|
-
watch: typeof watch;
|
|
324
|
-
FSWatcher: typeof FSWatcher;
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
export { type ChokidarOptions, type EmitArgs, type FSWInstanceOptions, FSWatcher, type MatchFunction, type Matcher, type MatcherObject, type ThrottleType, type Throttler, WatchHelper, _default as default, watch };
|