@ohos-ports/rsbuild-core 2.2.9-beta.0 → 2.2.13-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/README.md +12 -0
- package/bin/rsbuild.js +3 -1
- package/compiled/@rstackjs/load-config/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.d.ts +16 -2
- package/compiled/html-rspack-plugin/index.js +78 -28
- package/compiled/jiti/lib/jiti-cli.mjs +0 -0
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/ws/index.d.ts +4 -0
- package/compiled/ws/package.json +1 -1
- package/dist/1.js +84 -0
- package/dist/client/hmr.js +7 -2
- package/dist/client/overlay.js +9 -6
- package/dist/cssUrlLoader.mjs +18 -7
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/path.d.ts +9 -0
- package/dist/http-proxy-middleware.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/launch-editor-middleware.js +1 -1
- package/dist/loader/cssUrlLoader.d.ts +1 -0
- package/dist/m.js +446 -353
- package/dist/manifest-plugin.js +1 -1
- package/dist/memfs.js +1 -1
- package/dist/plugins/fileSize.d.ts +11 -0
- package/dist/server/assets-middleware/getFileFromUrl.d.ts +1 -0
- package/dist/server/assets-middleware/setupOutputFileSystem.d.ts +1 -2
- package/dist/server/assets-middleware/setupWriteToDisk.d.ts +19 -7
- package/dist/server/browserLogs.d.ts +5 -2
- package/dist/server/gracefulShutdown.d.ts +1 -2
- package/dist/server/helper.d.ts +2 -2
- package/dist/server/hostCheck.d.ts +7 -0
- package/dist/trace-mapping.js +16 -14
- package/dist/types/config.d.ts +21 -2
- package/dist/types/plugin.d.ts +1 -0
- package/dist/ws.js +2 -2
- package/package.json +8 -49
|
@@ -60,11 +60,17 @@ interface Hook<T = any, R = any, AdditionalOptions = UnsetAdditionalOptions> {
|
|
|
60
60
|
withOptions(opt: TapOptions & IfSet<AdditionalOptions>): Hook<T, R, AdditionalOptions>;
|
|
61
61
|
queryStageRange(stageRange: StageRange): QueriedHook<T, R, AdditionalOptions>;
|
|
62
62
|
}
|
|
63
|
+
type AllStageTaps<Tap> = {
|
|
64
|
+
source: Tap[];
|
|
65
|
+
length: number;
|
|
66
|
+
taps: Tap[];
|
|
67
|
+
};
|
|
63
68
|
declare class HookBase<T, R, AdditionalOptions = UnsetAdditionalOptions> implements Hook<T, R, AdditionalOptions> {
|
|
64
69
|
args: ArgumentNames<AsArray<T>>;
|
|
65
70
|
name?: string;
|
|
66
71
|
taps: (FullTap & IfSet<AdditionalOptions>)[];
|
|
67
72
|
interceptors: HookInterceptor<T, R, AdditionalOptions>[];
|
|
73
|
+
_allStageTaps: AllStageTaps<FullTap & IfSet<AdditionalOptions>> | undefined;
|
|
68
74
|
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
69
75
|
intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
|
|
70
76
|
_runRegisterInterceptors(options: FullTap & IfSet<AdditionalOptions>): FullTap & IfSet<AdditionalOptions>;
|
|
@@ -85,6 +91,14 @@ declare class HookBase<T, R, AdditionalOptions = UnsetAdditionalOptions> impleme
|
|
|
85
91
|
tapPromise(options: Options<AdditionalOptions>, fn: FnPromise<T, R>): void;
|
|
86
92
|
_tap(type: 'sync' | 'async' | 'promise', options: Options<AdditionalOptions>, fn: TapFunction): void;
|
|
87
93
|
_insert(item: FullTap & IfSet<AdditionalOptions>): void;
|
|
94
|
+
/**
|
|
95
|
+
* The taps `queryStageRange(allStageRange)` would select, reused across calls.
|
|
96
|
+
*
|
|
97
|
+
* `tap()` always grows `this.taps`, and code that replaces or splices it changes its
|
|
98
|
+
* identity or length, so both are checked. An interceptor's `register` rewrites taps in
|
|
99
|
+
* place, but hooks with interceptors never take the path that reads this.
|
|
100
|
+
*/
|
|
101
|
+
_tapsInAllStages(): (FullTap & IfSet<AdditionalOptions>)[];
|
|
88
102
|
_prepareArgs(args: AsArray<T>): (T | undefined)[];
|
|
89
103
|
}
|
|
90
104
|
type StageRange = readonly [number, number];
|
|
@@ -98,9 +112,9 @@ declare class QueriedHook<T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
|
98
112
|
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
99
113
|
promise(...args: AsArray<T>): Promise<R>;
|
|
100
114
|
}
|
|
101
|
-
declare class AsyncSeriesWaterfallHook<T, AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T,
|
|
115
|
+
declare class AsyncSeriesWaterfallHook<T, R = AsArray<T>[0], AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, R, AdditionalOptions> {
|
|
102
116
|
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
103
|
-
callAsyncStageRange(queried: QueriedHook<T,
|
|
117
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
declare class HtmlRspackPlugin {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
240: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(53);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
}
|
|
308
308
|
module.exports = { CachedChildCompilation };
|
|
309
309
|
},
|
|
310
|
-
|
|
310
|
+
53: (module) => {
|
|
311
311
|
"use strict";
|
|
312
312
|
class HtmlWebpackChildCompiler {
|
|
313
313
|
compilationPromise;
|
|
@@ -476,7 +476,7 @@
|
|
|
476
476
|
}
|
|
477
477
|
module.exports = { HtmlWebpackChildCompiler };
|
|
478
478
|
},
|
|
479
|
-
|
|
479
|
+
251: (module) => {
|
|
480
480
|
"use strict";
|
|
481
481
|
function none(chunks) {
|
|
482
482
|
return chunks;
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
}
|
|
493
493
|
module.exports = { auto: none, manual, none };
|
|
494
494
|
},
|
|
495
|
-
|
|
495
|
+
438: (module) => {
|
|
496
496
|
"use strict";
|
|
497
497
|
module.exports = function (err) {
|
|
498
498
|
return {
|
|
@@ -516,9 +516,9 @@
|
|
|
516
516
|
};
|
|
517
517
|
};
|
|
518
518
|
},
|
|
519
|
-
|
|
519
|
+
861: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
520
520
|
"use strict";
|
|
521
|
-
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(
|
|
521
|
+
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(537);
|
|
522
522
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
523
523
|
function getHtmlRspackPluginHooks(compilation) {
|
|
524
524
|
let hooks = htmlWebpackPluginHooksMap.get(compilation);
|
|
@@ -542,7 +542,7 @@
|
|
|
542
542
|
}
|
|
543
543
|
module.exports = { getHtmlRspackPluginHooks };
|
|
544
544
|
},
|
|
545
|
-
|
|
545
|
+
748: (module) => {
|
|
546
546
|
const voidTags = [
|
|
547
547
|
"area",
|
|
548
548
|
"base",
|
|
@@ -610,19 +610,19 @@
|
|
|
610
610
|
htmlTagObjectToString,
|
|
611
611
|
};
|
|
612
612
|
},
|
|
613
|
-
|
|
613
|
+
993: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
614
614
|
"use strict";
|
|
615
615
|
const promisify = __nccwpck_require__(23).promisify;
|
|
616
616
|
const vm = __nccwpck_require__(154);
|
|
617
617
|
const fs = __nccwpck_require__(896);
|
|
618
618
|
const path = __nccwpck_require__(928);
|
|
619
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
619
|
+
const { CachedChildCompilation } = __nccwpck_require__(240);
|
|
620
620
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
621
|
-
__nccwpck_require__(
|
|
622
|
-
const prettyError = __nccwpck_require__(
|
|
623
|
-
const chunkSorter = __nccwpck_require__(
|
|
621
|
+
__nccwpck_require__(748);
|
|
622
|
+
const prettyError = __nccwpck_require__(438);
|
|
623
|
+
const chunkSorter = __nccwpck_require__(251);
|
|
624
624
|
const getHtmlRspackPluginHooks =
|
|
625
|
-
__nccwpck_require__(
|
|
625
|
+
__nccwpck_require__(861).getHtmlRspackPluginHooks;
|
|
626
626
|
const WITH_PLACEHOLDER = "function __with_placeholder__";
|
|
627
627
|
class HtmlRspackPlugin {
|
|
628
628
|
constructor(userOptions = {}) {
|
|
@@ -1520,7 +1520,7 @@
|
|
|
1520
1520
|
"use strict";
|
|
1521
1521
|
module.exports = require("vm");
|
|
1522
1522
|
},
|
|
1523
|
-
|
|
1523
|
+
537: (__unused_webpack_module, exports) => {
|
|
1524
1524
|
"use strict";
|
|
1525
1525
|
var __nested_webpack_require_18__ = {};
|
|
1526
1526
|
(() => {
|
|
@@ -1700,6 +1700,22 @@
|
|
|
1700
1700
|
}
|
|
1701
1701
|
this.taps[i] = item;
|
|
1702
1702
|
}
|
|
1703
|
+
_tapsInAllStages() {
|
|
1704
|
+
const cached = this._allStageTaps;
|
|
1705
|
+
if (
|
|
1706
|
+
void 0 !== cached &&
|
|
1707
|
+
cached.source === this.taps &&
|
|
1708
|
+
cached.length === this.taps.length
|
|
1709
|
+
)
|
|
1710
|
+
return cached.taps;
|
|
1711
|
+
const taps = this.queryStageRange(allStageRange).tapsInRange;
|
|
1712
|
+
this._allStageTaps = {
|
|
1713
|
+
source: this.taps,
|
|
1714
|
+
length: this.taps.length,
|
|
1715
|
+
taps,
|
|
1716
|
+
};
|
|
1717
|
+
return taps;
|
|
1718
|
+
}
|
|
1703
1719
|
_prepareArgs(args) {
|
|
1704
1720
|
const len = this.args.length;
|
|
1705
1721
|
if (args.length < len) {
|
|
@@ -1714,10 +1730,12 @@
|
|
|
1714
1730
|
_define_property(this, "name", void 0);
|
|
1715
1731
|
_define_property(this, "taps", void 0);
|
|
1716
1732
|
_define_property(this, "interceptors", void 0);
|
|
1733
|
+
_define_property(this, "_allStageTaps", void 0);
|
|
1717
1734
|
this.args = args;
|
|
1718
1735
|
this.name = name;
|
|
1719
1736
|
this.taps = [];
|
|
1720
1737
|
this.interceptors = [];
|
|
1738
|
+
this._allStageTaps = void 0;
|
|
1721
1739
|
}
|
|
1722
1740
|
}
|
|
1723
1741
|
const minStage = -1 / 0;
|
|
@@ -1801,10 +1819,18 @@
|
|
|
1801
1819
|
}
|
|
1802
1820
|
}
|
|
1803
1821
|
call(...args) {
|
|
1804
|
-
|
|
1805
|
-
this.
|
|
1806
|
-
|
|
1807
|
-
|
|
1822
|
+
if (this.interceptors.length > 0)
|
|
1823
|
+
return this.callStageRange(
|
|
1824
|
+
this.queryStageRange(allStageRange),
|
|
1825
|
+
...args,
|
|
1826
|
+
);
|
|
1827
|
+
const taps = this._tapsInAllStages();
|
|
1828
|
+
const args2 = this._prepareArgs(args);
|
|
1829
|
+
try {
|
|
1830
|
+
for (let i = 0; i < taps.length; i++) taps[i].fn(...args2);
|
|
1831
|
+
} catch (e) {
|
|
1832
|
+
if (e) throw e;
|
|
1833
|
+
}
|
|
1808
1834
|
}
|
|
1809
1835
|
callStageRange(queried, ...args) {
|
|
1810
1836
|
let result;
|
|
@@ -1854,10 +1880,21 @@
|
|
|
1854
1880
|
}
|
|
1855
1881
|
}
|
|
1856
1882
|
call(...args) {
|
|
1857
|
-
|
|
1858
|
-
this.
|
|
1859
|
-
|
|
1860
|
-
|
|
1883
|
+
if (this.interceptors.length > 0)
|
|
1884
|
+
return this.callStageRange(
|
|
1885
|
+
this.queryStageRange(allStageRange),
|
|
1886
|
+
...args,
|
|
1887
|
+
);
|
|
1888
|
+
const taps = this._tapsInAllStages();
|
|
1889
|
+
const args2 = this._prepareArgs(args);
|
|
1890
|
+
try {
|
|
1891
|
+
for (let i = 0; i < taps.length; i++) {
|
|
1892
|
+
const r = taps[i].fn(...args2);
|
|
1893
|
+
if (void 0 !== r) return r;
|
|
1894
|
+
}
|
|
1895
|
+
} catch (e) {
|
|
1896
|
+
if (e) throw e;
|
|
1897
|
+
}
|
|
1861
1898
|
}
|
|
1862
1899
|
callStageRange(queried, ...args) {
|
|
1863
1900
|
let result;
|
|
@@ -1903,10 +1940,23 @@
|
|
|
1903
1940
|
}
|
|
1904
1941
|
}
|
|
1905
1942
|
call(...args) {
|
|
1906
|
-
|
|
1907
|
-
this.
|
|
1908
|
-
|
|
1909
|
-
|
|
1943
|
+
if (this.interceptors.length > 0)
|
|
1944
|
+
return this.callStageRange(
|
|
1945
|
+
this.queryStageRange(allStageRange),
|
|
1946
|
+
...args,
|
|
1947
|
+
);
|
|
1948
|
+
const taps = this._tapsInAllStages();
|
|
1949
|
+
const args2 = this._prepareArgs(args);
|
|
1950
|
+
try {
|
|
1951
|
+
for (let i = 0; i < taps.length; i++) {
|
|
1952
|
+
const r = taps[i].fn(...args2);
|
|
1953
|
+
if (void 0 !== r) args2[0] = r;
|
|
1954
|
+
}
|
|
1955
|
+
} catch (e) {
|
|
1956
|
+
if (e) throw e;
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
return args2[0];
|
|
1910
1960
|
}
|
|
1911
1961
|
callStageRange(queried, ...args) {
|
|
1912
1962
|
let result;
|
|
@@ -2395,6 +2445,6 @@
|
|
|
2395
2445
|
}
|
|
2396
2446
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
2397
2447
|
__nccwpck_require__.ab = __dirname + "/";
|
|
2398
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
2448
|
+
var __webpack_exports__ = __nccwpck_require__(993);
|
|
2399
2449
|
module.exports = __webpack_exports__;
|
|
2400
2450
|
})();
|
|
File without changes
|