@rspack/core 1.3.15 → 1.4.0-beta.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.
- package/compiled/@swc/types/index.d.ts +18 -2
- package/compiled/@swc/types/package.json +1 -1
- package/compiled/tinypool/README.md +4 -196
- package/compiled/tinypool/dist/common-Qw-RoVFD.js +28 -0
- package/compiled/tinypool/dist/entry/process.d.ts +1 -2
- package/compiled/tinypool/dist/entry/process.js +63 -83
- package/compiled/tinypool/dist/entry/utils.d.ts +3 -1
- package/compiled/tinypool/dist/entry/utils.js +3 -9
- package/compiled/tinypool/dist/entry/worker.d.ts +1 -2
- package/compiled/tinypool/dist/entry/worker.js +66 -94
- package/compiled/tinypool/dist/index.d.ts +132 -125
- package/compiled/tinypool/dist/index.js +771 -1035
- package/compiled/tinypool/dist/utils-B--2TaWv.js +38 -0
- package/compiled/tinypool/dist/utils-De75vAgL.js +10 -0
- package/compiled/tinypool/package.json +6 -22
- package/compiled/zod/dist/types/v4/classic/schemas.d.ts +19 -14
- package/compiled/zod/dist/types/v4/core/api.d.ts +5 -4
- package/compiled/zod/dist/types/v4/core/checks.d.ts +1 -1
- package/compiled/zod/dist/types/v4/core/core.d.ts +1 -1
- package/compiled/zod/dist/types/v4/core/registries.d.ts +3 -1
- package/compiled/zod/dist/types/v4/core/schemas.d.ts +33 -39
- package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +2 -2
- package/compiled/zod/dist/types/v4/core/util.d.ts +1 -1
- package/compiled/zod/dist/types/v4/locales/index.d.ts +1 -0
- package/compiled/zod/dist/types/v4/locales/ps.d.ts +4 -0
- package/compiled/zod/dist/types/v4/mini/schemas.d.ts +77 -125
- package/compiled/zod/index.js +33 -33
- package/compiled/zod/package.json +1 -1
- package/dist/BuildInfo.d.ts +17 -0
- package/dist/FileSystem.d.ts +26 -3
- package/dist/Module.d.ts +1 -13
- package/dist/builtin-loader/swc/types.d.ts +255 -255
- package/dist/config/devServer.d.ts +10 -10
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +10 -1
- package/dist/config/utils.d.ts +1 -0
- package/dist/config/zod.d.ts +1638 -1068
- package/dist/cssExtractLoader.js +5 -5
- package/dist/exports.d.ts +2 -1
- package/dist/index.js +544 -470
- package/dist/loader-runner/index.d.ts +0 -9
- package/dist/trace/index.d.ts +16 -18
- package/dist/worker.js +2 -2
- package/module.d.ts +1 -1
- package/package.json +8 -8
- package/compiled/tinypool/dist/chunk-6LX4VMOV.js +0 -31
- package/compiled/tinypool/dist/chunk-ACQHDOFQ.js +0 -12
- package/compiled/tinypool/dist/chunk-E2J7JLFN.js +0 -53
- package/compiled/tinypool/dist/chunk-UBWFVGJX.js +0 -38
@@ -1,32 +1,37 @@
|
|
1
|
-
|
2
|
-
import {
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { MessagePort, TransferListItem } from "node:worker_threads";
|
3
|
+
import { EventEmitterAsyncResource } from "node:events";
|
3
4
|
|
5
|
+
//#region src/common.d.ts
|
6
|
+
/** Channel for communicating between main thread and workers */
|
4
7
|
/** Channel for communicating between main thread and workers */
|
5
8
|
interface TinypoolChannel {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
/** Workers subscribing to messages */
|
10
|
+
onMessage?: (callback: (message: any) => void) => void;
|
11
|
+
/** Called with worker's messages */
|
12
|
+
postMessage?: (message: any) => void;
|
13
|
+
/** Called when channel can be closed */
|
14
|
+
onClose?: () => void;
|
10
15
|
}
|
11
16
|
interface TinypoolWorker {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
17
|
+
runtime: string;
|
18
|
+
initialize(options: {
|
19
|
+
env?: Record<string, string>;
|
20
|
+
argv?: string[];
|
21
|
+
execArgv?: string[];
|
22
|
+
resourceLimits?: any;
|
23
|
+
workerData: TinypoolData;
|
24
|
+
trackUnmanagedFds?: boolean;
|
25
|
+
}): void;
|
26
|
+
terminate(): Promise<any>;
|
27
|
+
postMessage(message: any, transferListItem?: TransferListItem[]): void;
|
28
|
+
setChannel?: (channel: TinypoolChannel) => void;
|
29
|
+
on(event: string, listener: (...args: any[]) => void): void;
|
30
|
+
once(event: string, listener: (...args: any[]) => void): void;
|
31
|
+
emit(event: string, ...data: any[]): void;
|
32
|
+
ref?: () => void;
|
33
|
+
unref?: () => void;
|
34
|
+
threadId: number;
|
30
35
|
}
|
31
36
|
/**
|
32
37
|
* Tinypool's internal messaging between main thread and workers.
|
@@ -34,33 +39,33 @@ interface TinypoolWorker {
|
|
34
39
|
* these messages and ignore them.
|
35
40
|
*/
|
36
41
|
interface TinypoolWorkerMessage<T extends 'port' | 'pool' = 'port' | 'pool'> {
|
37
|
-
|
38
|
-
|
42
|
+
__tinypool_worker_message__: true;
|
43
|
+
source: T;
|
39
44
|
}
|
40
45
|
interface StartupMessage {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
filename: string | null;
|
47
|
+
name: string;
|
48
|
+
port: MessagePort;
|
49
|
+
sharedBuffer: Int32Array;
|
50
|
+
useAtomics: boolean;
|
46
51
|
}
|
47
52
|
interface RequestMessage {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
taskId: number;
|
54
|
+
task: any;
|
55
|
+
filename: string;
|
56
|
+
name: string;
|
52
57
|
}
|
53
58
|
interface ReadyMessage {
|
54
|
-
|
59
|
+
ready: true;
|
55
60
|
}
|
56
61
|
interface ResponseMessage {
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
62
|
+
taskId: number;
|
63
|
+
result: any;
|
64
|
+
error: unknown | null;
|
65
|
+
usedMemory: number;
|
61
66
|
}
|
62
67
|
interface TinypoolPrivateData {
|
63
|
-
|
68
|
+
workerId: number;
|
64
69
|
}
|
65
70
|
type TinypoolData = [TinypoolPrivateData, any];
|
66
71
|
declare const kTransferable: unique symbol;
|
@@ -70,119 +75,121 @@ declare function isTransferable(value: any): boolean;
|
|
70
75
|
declare function isMovable(value: any): boolean;
|
71
76
|
declare function markMovable(value: object): void;
|
72
77
|
interface Transferable {
|
73
|
-
|
74
|
-
|
78
|
+
readonly [kTransferable]: object;
|
79
|
+
readonly [kValue]: object;
|
75
80
|
}
|
76
81
|
interface Task {
|
77
|
-
|
78
|
-
|
82
|
+
readonly [kQueueOptions]: object | null;
|
83
|
+
cancel(): void;
|
79
84
|
}
|
80
85
|
interface TaskQueue {
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
+
readonly size: number;
|
87
|
+
shift(): Task | null;
|
88
|
+
remove(task: Task): void;
|
89
|
+
push(task: Task): void;
|
90
|
+
cancel(): void;
|
86
91
|
}
|
87
92
|
declare function isTaskQueue(value: any): boolean;
|
88
93
|
declare const kRequestCountField = 0;
|
89
94
|
declare const kResponseCountField = 1;
|
90
|
-
declare const kFieldCount = 2;
|
91
|
-
|
95
|
+
declare const kFieldCount = 2; //#endregion
|
96
|
+
//#region src/index.d.ts
|
92
97
|
declare global {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
98
|
+
namespace NodeJS {
|
99
|
+
interface Process {
|
100
|
+
__tinypool_state__: {
|
101
|
+
isTinypoolWorker: boolean;
|
102
|
+
isWorkerThread?: boolean;
|
103
|
+
isChildProcess?: boolean;
|
104
|
+
workerData: any;
|
105
|
+
workerId: number;
|
106
|
+
};
|
103
107
|
}
|
108
|
+
}
|
104
109
|
}
|
105
110
|
interface AbortSignalEventTargetAddOptions {
|
106
|
-
|
111
|
+
once: boolean;
|
107
112
|
}
|
108
113
|
interface AbortSignalEventTarget {
|
109
|
-
|
110
|
-
|
111
|
-
|
114
|
+
addEventListener: (name: 'abort', listener: () => void, options?: AbortSignalEventTargetAddOptions) => void;
|
115
|
+
removeEventListener: (name: 'abort', listener: () => void) => void;
|
116
|
+
aborted?: boolean;
|
112
117
|
}
|
113
118
|
interface AbortSignalEventEmitter {
|
114
|
-
|
115
|
-
|
119
|
+
off: (name: 'abort', listener: () => void) => void;
|
120
|
+
once: (name: 'abort', listener: () => void) => void;
|
116
121
|
}
|
117
122
|
type AbortSignalAny = AbortSignalEventTarget | AbortSignalEventEmitter;
|
118
123
|
type ResourceLimits = Worker extends {
|
119
|
-
|
124
|
+
resourceLimits?: infer T;
|
120
125
|
} ? T : object;
|
121
126
|
interface Options {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
127
|
+
filename?: string | null;
|
128
|
+
runtime?: 'worker_threads' | 'child_process';
|
129
|
+
name?: string;
|
130
|
+
minThreads?: number;
|
131
|
+
maxThreads?: number;
|
132
|
+
idleTimeout?: number;
|
133
|
+
terminateTimeout?: number;
|
134
|
+
maxQueue?: number | 'auto';
|
135
|
+
concurrentTasksPerWorker?: number;
|
136
|
+
useAtomics?: boolean;
|
137
|
+
resourceLimits?: ResourceLimits;
|
138
|
+
maxMemoryLimitBeforeRecycle?: number;
|
139
|
+
argv?: string[];
|
140
|
+
execArgv?: string[];
|
141
|
+
env?: Record<string, string>;
|
142
|
+
workerData?: any;
|
143
|
+
taskQueue?: TaskQueue;
|
144
|
+
trackUnmanagedFds?: boolean;
|
145
|
+
isolateWorkers?: boolean;
|
146
|
+
teardown?: string;
|
141
147
|
}
|
142
148
|
interface FilledOptions extends Options {
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
filename: string | null;
|
150
|
+
name: string;
|
151
|
+
runtime: NonNullable<Options['runtime']>;
|
152
|
+
minThreads: number;
|
153
|
+
maxThreads: number;
|
154
|
+
idleTimeout: number;
|
155
|
+
maxQueue: number;
|
156
|
+
concurrentTasksPerWorker: number;
|
157
|
+
useAtomics: boolean;
|
158
|
+
taskQueue: TaskQueue;
|
153
159
|
}
|
154
160
|
interface RunOptions {
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
+
transferList?: TransferList;
|
162
|
+
channel?: TinypoolChannel;
|
163
|
+
filename?: string | null;
|
164
|
+
signal?: AbortSignalAny | null;
|
165
|
+
name?: string | null;
|
166
|
+
runtime?: Options['runtime'];
|
161
167
|
}
|
162
168
|
type TransferList = MessagePort extends {
|
163
|
-
|
169
|
+
postMessage(value: any, transferList: infer T): any;
|
164
170
|
} ? T : never;
|
165
|
-
type TransferListItem = TransferList extends (infer T)[] ? T : never;
|
171
|
+
type TransferListItem$1 = TransferList extends (infer T)[] ? T : never;
|
166
172
|
declare class Tinypool extends EventEmitterAsyncResource {
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
173
|
+
#private;
|
174
|
+
constructor(options?: Options);
|
175
|
+
run(task: any, options?: RunOptions): Promise<any>;
|
176
|
+
destroy(): Promise<void>;
|
177
|
+
get options(): FilledOptions;
|
178
|
+
get threads(): TinypoolWorker[];
|
179
|
+
get queueSize(): number;
|
180
|
+
cancelPendingTasks(): void;
|
181
|
+
recycleWorkers(options?: Pick<Options, 'runtime'>): Promise<void>;
|
182
|
+
get completed(): number;
|
183
|
+
get duration(): number;
|
184
|
+
static get isWorkerThread(): boolean;
|
185
|
+
static get workerData(): any;
|
186
|
+
static get version(): string;
|
187
|
+
static move(val: Transferable | TransferListItem$1 | ArrayBufferView | ArrayBuffer | MessagePort): MessagePort | ArrayBuffer | Transferable | ArrayBufferView;
|
188
|
+
static get transferableSymbol(): symbol;
|
189
|
+
static get valueSymbol(): symbol;
|
190
|
+
static get queueOptionsSymbol(): symbol;
|
185
191
|
}
|
186
192
|
declare const _workerId: number;
|
187
193
|
|
188
|
-
|
194
|
+
//#endregion
|
195
|
+
export { Options, ReadyMessage, RequestMessage, ResponseMessage, StartupMessage, Task, TaskQueue, Tinypool, TinypoolChannel, TinypoolData, TinypoolPrivateData, TinypoolWorker, TinypoolWorkerMessage, Transferable, Tinypool as default, isMovable, isTaskQueue, isTransferable, kFieldCount, kQueueOptions, kRequestCountField, kResponseCountField, kTransferable, kValue, markMovable, _workerId as workerId };
|