@rsbuild/core 1.5.12 → 1.5.13
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/@jridgewell/remapping/index.js +5 -848
- package/compiled/@jridgewell/trace-mapping/index.d.ts +194 -0
- package/compiled/@jridgewell/trace-mapping/index.js +1408 -0
- package/compiled/@jridgewell/trace-mapping/license +19 -0
- package/compiled/@jridgewell/trace-mapping/package.json +1 -0
- package/compiled/css-loader/index.js +22 -22
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/launch-editor-middleware/index.js +3 -3
- package/compiled/memfs/index.d.ts +6 -1
- package/compiled/memfs/index.js +662 -636
- package/compiled/memfs/package.json +1 -1
- package/compiled/postcss/index.js +4 -4
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/client/hmr.js +58 -19
- package/dist/index.cjs +426 -373
- package/dist/index.js +420 -369
- package/dist-types/configChain.d.ts +0 -4
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +9 -0
- package/dist-types/server/assets-middleware/index.d.ts +48 -0
- package/dist-types/server/assets-middleware/middleware.d.ts +3 -0
- package/dist-types/server/assets-middleware/setupOutputFileSystem.d.ts +4 -0
- package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
- package/dist-types/server/browserLogs.d.ts +7 -0
- package/dist-types/server/{compilationManager.d.ts → buildManager.d.ts} +11 -11
- package/dist-types/server/devMiddlewares.d.ts +2 -2
- package/dist-types/server/devServer.d.ts +3 -3
- package/dist-types/server/middlewares.d.ts +3 -3
- package/dist-types/server/socketServer.d.ts +22 -11
- package/dist-types/server/watchFiles.d.ts +2 -2
- package/dist-types/types/config.d.ts +13 -6
- package/dist-types/types/context.d.ts +14 -4
- package/dist-types/types/plugin.d.ts +1 -1
- package/dist-types/types/rsbuild.d.ts +8 -1
- package/package.json +5 -3
- package/dist-types/dev-middleware/index.d.ts +0 -53
- package/dist-types/dev-middleware/middleware.d.ts +0 -3
- package/dist-types/dev-middleware/utils/getFilenameFromUrl.d.ts +0 -7
- package/dist-types/dev-middleware/utils/getPaths.d.ts +0 -7
- package/dist-types/dev-middleware/utils/ready.d.ts +0 -2
- package/dist-types/dev-middleware/utils/setupHooks.d.ts +0 -3
- package/dist-types/dev-middleware/utils/setupOutputFileSystem.d.ts +0 -3
- package/dist-types/dev-middleware/utils/setupWriteToDisk.d.ts +0 -7
- package/dist-types/server/compilationMiddleware.d.ts +0 -36
- /package/dist-types/{dev-middleware/utils → server/assets-middleware}/escapeHtml.d.ts +0 -0
- /package/dist-types/{dev-middleware/utils → server/assets-middleware}/memorize.d.ts +0 -0
- /package/dist-types/{dev-middleware/utils → server/assets-middleware}/parseTokenList.d.ts +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
type GeneratedColumn = number;
|
|
2
|
+
type SourcesIndex = number;
|
|
3
|
+
type SourceLine = number;
|
|
4
|
+
type SourceColumn = number;
|
|
5
|
+
type NamesIndex = number;
|
|
6
|
+
type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
|
|
7
|
+
|
|
8
|
+
interface SourceMapV3 {
|
|
9
|
+
file?: string | null;
|
|
10
|
+
names: string[];
|
|
11
|
+
sourceRoot?: string;
|
|
12
|
+
sources: (string | null)[];
|
|
13
|
+
sourcesContent?: (string | null)[];
|
|
14
|
+
version: 3;
|
|
15
|
+
ignoreList?: number[];
|
|
16
|
+
}
|
|
17
|
+
interface EncodedSourceMap extends SourceMapV3 {
|
|
18
|
+
mappings: string;
|
|
19
|
+
}
|
|
20
|
+
interface DecodedSourceMap extends SourceMapV3 {
|
|
21
|
+
mappings: SourceMapSegment[][];
|
|
22
|
+
}
|
|
23
|
+
interface Section {
|
|
24
|
+
offset: {
|
|
25
|
+
line: number;
|
|
26
|
+
column: number;
|
|
27
|
+
};
|
|
28
|
+
map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap;
|
|
29
|
+
}
|
|
30
|
+
interface SectionedSourceMap {
|
|
31
|
+
file?: string | null;
|
|
32
|
+
sections: Section[];
|
|
33
|
+
version: 3;
|
|
34
|
+
}
|
|
35
|
+
type OriginalMapping = {
|
|
36
|
+
source: string | null;
|
|
37
|
+
line: number;
|
|
38
|
+
column: number;
|
|
39
|
+
name: string | null;
|
|
40
|
+
};
|
|
41
|
+
type InvalidOriginalMapping = {
|
|
42
|
+
source: null;
|
|
43
|
+
line: null;
|
|
44
|
+
column: null;
|
|
45
|
+
name: null;
|
|
46
|
+
};
|
|
47
|
+
type GeneratedMapping = {
|
|
48
|
+
line: number;
|
|
49
|
+
column: number;
|
|
50
|
+
};
|
|
51
|
+
type InvalidGeneratedMapping = {
|
|
52
|
+
line: null;
|
|
53
|
+
column: null;
|
|
54
|
+
};
|
|
55
|
+
type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND;
|
|
56
|
+
type XInput = {
|
|
57
|
+
x_google_ignoreList?: SourceMapV3['ignoreList'];
|
|
58
|
+
};
|
|
59
|
+
type EncodedSourceMapXInput = EncodedSourceMap & XInput;
|
|
60
|
+
type DecodedSourceMapXInput = DecodedSourceMap & XInput;
|
|
61
|
+
type SectionedSourceMapXInput = Omit<SectionedSourceMap, 'sections'> & {
|
|
62
|
+
sections: SectionXInput[];
|
|
63
|
+
};
|
|
64
|
+
type SectionXInput = Omit<Section, 'map'> & {
|
|
65
|
+
map: SectionedSourceMapInput;
|
|
66
|
+
};
|
|
67
|
+
type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap;
|
|
68
|
+
type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput;
|
|
69
|
+
type Needle = {
|
|
70
|
+
line: number;
|
|
71
|
+
column: number;
|
|
72
|
+
bias?: Bias;
|
|
73
|
+
};
|
|
74
|
+
type SourceNeedle = {
|
|
75
|
+
source: string;
|
|
76
|
+
line: number;
|
|
77
|
+
column: number;
|
|
78
|
+
bias?: Bias;
|
|
79
|
+
};
|
|
80
|
+
type EachMapping = {
|
|
81
|
+
generatedLine: number;
|
|
82
|
+
generatedColumn: number;
|
|
83
|
+
source: null;
|
|
84
|
+
originalLine: null;
|
|
85
|
+
originalColumn: null;
|
|
86
|
+
name: null;
|
|
87
|
+
} | {
|
|
88
|
+
generatedLine: number;
|
|
89
|
+
generatedColumn: number;
|
|
90
|
+
source: string | null;
|
|
91
|
+
originalLine: number;
|
|
92
|
+
originalColumn: number;
|
|
93
|
+
name: string | null;
|
|
94
|
+
};
|
|
95
|
+
declare abstract class SourceMap {
|
|
96
|
+
version: SourceMapV3['version'];
|
|
97
|
+
file: SourceMapV3['file'];
|
|
98
|
+
names: SourceMapV3['names'];
|
|
99
|
+
sourceRoot: SourceMapV3['sourceRoot'];
|
|
100
|
+
sources: SourceMapV3['sources'];
|
|
101
|
+
sourcesContent: SourceMapV3['sourcesContent'];
|
|
102
|
+
resolvedSources: SourceMapV3['sources'];
|
|
103
|
+
ignoreList: SourceMapV3['ignoreList'];
|
|
104
|
+
}
|
|
105
|
+
type Ro<T> = T extends Array<infer V> ? V[] | Readonly<V[]> | RoArray<V> | Readonly<RoArray<V>> : T extends object ? T | Readonly<T> | RoObject<T> | Readonly<RoObject<T>> : T;
|
|
106
|
+
type RoArray<T> = Ro<T>[];
|
|
107
|
+
type RoObject<T> = {
|
|
108
|
+
[K in keyof T]: T[K] | Ro<T[K]>;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
type FlattenMap = {
|
|
112
|
+
new (map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
|
|
113
|
+
(map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
|
|
114
|
+
};
|
|
115
|
+
declare const FlattenMap: FlattenMap;
|
|
116
|
+
|
|
117
|
+
declare const LEAST_UPPER_BOUND = -1;
|
|
118
|
+
declare const GREATEST_LOWER_BOUND = 1;
|
|
119
|
+
|
|
120
|
+
declare class TraceMap implements SourceMap {
|
|
121
|
+
version: SourceMapV3['version'];
|
|
122
|
+
file: SourceMapV3['file'];
|
|
123
|
+
names: SourceMapV3['names'];
|
|
124
|
+
sourceRoot: SourceMapV3['sourceRoot'];
|
|
125
|
+
sources: SourceMapV3['sources'];
|
|
126
|
+
sourcesContent: SourceMapV3['sourcesContent'];
|
|
127
|
+
ignoreList: SourceMapV3['ignoreList'];
|
|
128
|
+
resolvedSources: string[];
|
|
129
|
+
private _encoded;
|
|
130
|
+
private _decoded;
|
|
131
|
+
private _decodedMemo;
|
|
132
|
+
private _bySources;
|
|
133
|
+
private _bySourceMemos;
|
|
134
|
+
constructor(map: Ro<SourceMapInput>, mapUrl?: string | null);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns the encoded (VLQ string) form of the SourceMap's mappings field.
|
|
138
|
+
*/
|
|
139
|
+
declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'];
|
|
140
|
+
/**
|
|
141
|
+
* Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
|
|
142
|
+
*/
|
|
143
|
+
declare function decodedMappings(map: TraceMap): Readonly<DecodedSourceMap['mappings']>;
|
|
144
|
+
/**
|
|
145
|
+
* A low-level API to find the segment associated with a generated line/column (think, from a
|
|
146
|
+
* stack trace). Line and column here are 0-based, unlike `originalPositionFor`.
|
|
147
|
+
*/
|
|
148
|
+
declare function traceSegment(map: TraceMap, line: number, column: number): Readonly<SourceMapSegment> | null;
|
|
149
|
+
/**
|
|
150
|
+
* A higher-level API to find the source/line/column associated with a generated line/column
|
|
151
|
+
* (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
|
|
152
|
+
* `source-map` library.
|
|
153
|
+
*/
|
|
154
|
+
declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping;
|
|
155
|
+
/**
|
|
156
|
+
* Finds the generated line/column position of the provided source/line/column source position.
|
|
157
|
+
*/
|
|
158
|
+
declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping;
|
|
159
|
+
/**
|
|
160
|
+
* Finds all generated line/column positions of the provided source/line/column source position.
|
|
161
|
+
*/
|
|
162
|
+
declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[];
|
|
163
|
+
/**
|
|
164
|
+
* Iterates each mapping in generated position order.
|
|
165
|
+
*/
|
|
166
|
+
declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void;
|
|
167
|
+
/**
|
|
168
|
+
* Retrieves the source content for a particular source, if its found. Returns null if not.
|
|
169
|
+
*/
|
|
170
|
+
declare function sourceContentFor(map: TraceMap, source: string): string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Determines if the source is marked to ignore by the source map.
|
|
173
|
+
*/
|
|
174
|
+
declare function isIgnored(map: TraceMap, source: string): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* A helper that skips sorting of the input map's mappings array, which can be expensive for larger
|
|
177
|
+
* maps.
|
|
178
|
+
*/
|
|
179
|
+
declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap;
|
|
180
|
+
/**
|
|
181
|
+
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
|
|
182
|
+
* a sourcemap, or to JSON.stringify.
|
|
183
|
+
*/
|
|
184
|
+
declare function decodedMap(map: TraceMap): Omit<DecodedSourceMap, 'mappings'> & {
|
|
185
|
+
mappings: readonly SourceMapSegment[][];
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
|
|
189
|
+
* a sourcemap, or to JSON.stringify.
|
|
190
|
+
*/
|
|
191
|
+
declare function encodedMap(map: TraceMap): EncodedSourceMap;
|
|
192
|
+
|
|
193
|
+
export { FlattenMap as AnyMap, FlattenMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, SourceMap, TraceMap, allGeneratedPositionsFor, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, isIgnored, originalPositionFor, presortedDecodedMap, sourceContentFor, traceSegment };
|
|
194
|
+
export type { Bias, DecodedSourceMap, DecodedSourceMapXInput, EachMapping, EncodedSourceMap, EncodedSourceMapXInput, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, OriginalMapping as Mapping, Needle, OriginalMapping, Section, SectionXInput, SectionedSourceMap, SectionedSourceMapInput, SectionedSourceMapXInput, SourceMapInput, SourceMapSegment, SourceMapV3, SourceNeedle, XInput };
|