@lynx-js/rspeedy 0.8.2 → 0.8.3
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/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/lib/config/validate.js +80 -28
- package/lib/plugins/dev.plugin.d.ts +1 -1
- package/lib/plugins/dev.plugin.js +27 -26
- package/package.json +14 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @lynx-js/rspeedy
|
|
2
2
|
|
|
3
|
+
## 0.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Support NPM provenance. ([#30](https://github.com/lynx-family/lynx-stack/pull/30))
|
|
8
|
+
|
|
9
|
+
- Fix error "'wmic' is not recognized as an internal or external command" ([#91](https://github.com/lynx-family/lynx-stack/pull/91))
|
|
10
|
+
|
|
11
|
+
- Bump Rsbuild v1.2.15 with Rspack v1.2.7. ([#44](https://github.com/lynx-family/lynx-stack/pull/44))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`c617453`](https://github.com/lynx-family/lynx-stack/commit/c617453aea967aba702967deb2916b5c883f03bb)]:
|
|
14
|
+
- @lynx-js/chunk-loading-webpack-plugin@0.1.7
|
|
15
|
+
- @lynx-js/webpack-dev-transport@0.1.1
|
|
16
|
+
- @lynx-js/websocket@0.0.4
|
|
17
|
+
|
|
3
18
|
## 0.8.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://
|
|
2
|
+
<a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
|
-
The
|
|
14
|
+
The Rspack-based build tool for Lynx.
|
|
15
15
|
|
|
16
16
|
## Getting Started
|
|
17
17
|
|
package/lib/config/validate.js
CHANGED
|
@@ -1089,8 +1089,8 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
1089
1089
|
if (undefined === value)
|
|
1090
1090
|
return true;
|
|
1091
1091
|
return true;
|
|
1092
|
-
}); const _io144 = (input, _exceptionable = true) => (undefined === input.cacheGroups || "object" === typeof input.cacheGroups && null !== input.cacheGroups && false === Array.isArray(input.cacheGroups) && _io145(input.cacheGroups, true && _exceptionable)) && (undefined === input.fallbackCacheGroup || "object" === typeof input.fallbackCacheGroup && null !== input.fallbackCacheGroup && false === Array.isArray(input.fallbackCacheGroup) && _io148(input.fallbackCacheGroup, true && _exceptionable)) && (undefined === input.hidePathInfo || "boolean" === typeof input.hidePathInfo) && (null !== input.chunks && (undefined === input.chunks || "function" === typeof input.chunks || "all" === input.chunks || "initial" === input.chunks || "async" === input.chunks || input.chunks instanceof RegExp)) && (undefined === input.defaultSizeTypes || Array.isArray(input.defaultSizeTypes) && input.defaultSizeTypes.every((elem, _index107) => "string" === typeof elem)) && (undefined === input.minChunks || "number" === typeof input.minChunks) && (undefined === input.usedExports || "boolean" === typeof input.usedExports) && (null !== input.name && (undefined === input.name || "function" === typeof input.name || false === input.name || "string" === typeof input.name)) && (null !== input.minSize && (undefined === input.minSize || "number" === typeof input.minSize || "object" === typeof input.minSize && null !== input.minSize && false === Array.isArray(input.minSize) && _io147(input.minSize, true && _exceptionable))) && (null !== input.maxSize && (undefined === input.maxSize || "number" === typeof input.maxSize || "object" === typeof input.maxSize && null !== input.maxSize && false === Array.isArray(input.maxSize) && _io147(input.maxSize, true && _exceptionable))) && (null !== input.maxAsyncSize && (undefined === input.maxAsyncSize || "number" === typeof input.maxAsyncSize || "object" === typeof input.maxAsyncSize && null !== input.maxAsyncSize && false === Array.isArray(input.maxAsyncSize) && _io147(input.maxAsyncSize, true && _exceptionable))) && (null !== input.maxInitialSize && (undefined === input.maxInitialSize || "number" === typeof input.maxInitialSize || "object" === typeof input.maxInitialSize && null !== input.maxInitialSize && false === Array.isArray(input.maxInitialSize) && _io147(input.maxInitialSize, true && _exceptionable))) && (undefined === input.maxAsyncRequests || "number" === typeof input.maxAsyncRequests) && (undefined === input.maxInitialRequests || "number" === typeof input.maxInitialRequests) && (undefined === input.automaticNameDelimiter || "string" === typeof input.automaticNameDelimiter) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
1093
|
-
if (["cacheGroups", "fallbackCacheGroup", "hidePathInfo", "chunks", "defaultSizeTypes", "minChunks", "usedExports", "name", "minSize", "maxSize", "maxAsyncSize", "maxInitialSize", "maxAsyncRequests", "maxInitialRequests", "automaticNameDelimiter"].some(prop => key === prop))
|
|
1092
|
+
}); const _io144 = (input, _exceptionable = true) => (undefined === input.cacheGroups || "object" === typeof input.cacheGroups && null !== input.cacheGroups && false === Array.isArray(input.cacheGroups) && _io145(input.cacheGroups, true && _exceptionable)) && (undefined === input.fallbackCacheGroup || "object" === typeof input.fallbackCacheGroup && null !== input.fallbackCacheGroup && false === Array.isArray(input.fallbackCacheGroup) && _io148(input.fallbackCacheGroup, true && _exceptionable)) && (undefined === input.hidePathInfo || "boolean" === typeof input.hidePathInfo) && (null !== input.chunks && (undefined === input.chunks || "function" === typeof input.chunks || "all" === input.chunks || "initial" === input.chunks || "async" === input.chunks || input.chunks instanceof RegExp)) && (undefined === input.defaultSizeTypes || Array.isArray(input.defaultSizeTypes) && input.defaultSizeTypes.every((elem, _index107) => "string" === typeof elem)) && (undefined === input.minChunks || "number" === typeof input.minChunks) && (undefined === input.usedExports || "boolean" === typeof input.usedExports) && (null !== input.name && (undefined === input.name || "function" === typeof input.name || false === input.name || "string" === typeof input.name)) && (null !== input.filename && (undefined === input.filename || "function" === typeof input.filename || "string" === typeof input.filename)) && (null !== input.minSize && (undefined === input.minSize || "number" === typeof input.minSize || "object" === typeof input.minSize && null !== input.minSize && false === Array.isArray(input.minSize) && _io147(input.minSize, true && _exceptionable))) && (null !== input.minSizeReduction && (undefined === input.minSizeReduction || "number" === typeof input.minSizeReduction || "object" === typeof input.minSizeReduction && null !== input.minSizeReduction && false === Array.isArray(input.minSizeReduction) && _io147(input.minSizeReduction, true && _exceptionable))) && (null !== input.maxSize && (undefined === input.maxSize || "number" === typeof input.maxSize || "object" === typeof input.maxSize && null !== input.maxSize && false === Array.isArray(input.maxSize) && _io147(input.maxSize, true && _exceptionable))) && (null !== input.maxAsyncSize && (undefined === input.maxAsyncSize || "number" === typeof input.maxAsyncSize || "object" === typeof input.maxAsyncSize && null !== input.maxAsyncSize && false === Array.isArray(input.maxAsyncSize) && _io147(input.maxAsyncSize, true && _exceptionable))) && (null !== input.maxInitialSize && (undefined === input.maxInitialSize || "number" === typeof input.maxInitialSize || "object" === typeof input.maxInitialSize && null !== input.maxInitialSize && false === Array.isArray(input.maxInitialSize) && _io147(input.maxInitialSize, true && _exceptionable))) && (undefined === input.maxAsyncRequests || "number" === typeof input.maxAsyncRequests) && (undefined === input.maxInitialRequests || "number" === typeof input.maxInitialRequests) && (undefined === input.automaticNameDelimiter || "string" === typeof input.automaticNameDelimiter) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
1093
|
+
if (["cacheGroups", "fallbackCacheGroup", "hidePathInfo", "chunks", "defaultSizeTypes", "minChunks", "usedExports", "name", "filename", "minSize", "minSizeReduction", "maxSize", "maxAsyncSize", "maxInitialSize", "maxAsyncRequests", "maxInitialRequests", "automaticNameDelimiter"].some(prop => key === prop))
|
|
1094
1094
|
return true;
|
|
1095
1095
|
const value = input[key];
|
|
1096
1096
|
if (undefined === value)
|
|
@@ -1101,8 +1101,8 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
1101
1101
|
if (undefined === value)
|
|
1102
1102
|
return true;
|
|
1103
1103
|
return null !== value && undefined !== value && (false === value || "object" === typeof value && null !== value && false === Array.isArray(value) && _io146(value, true && _exceptionable));
|
|
1104
|
-
}); const _io146 = (input, _exceptionable = true) => null !== input.test && (undefined === input.test || "function" === typeof input.test || "string" === typeof input.test || input.test instanceof RegExp) && (undefined === input.priority || "number" === typeof input.priority) && (undefined === input.enforce || "boolean" === typeof input.enforce) && (
|
|
1105
|
-
if (["test", "priority", "enforce", "
|
|
1104
|
+
}); const _io146 = (input, _exceptionable = true) => null !== input.test && (undefined === input.test || "function" === typeof input.test || "string" === typeof input.test || input.test instanceof RegExp) && (undefined === input.priority || "number" === typeof input.priority) && (undefined === input.enforce || "boolean" === typeof input.enforce) && (undefined === input.reuseExistingChunk || "boolean" === typeof input.reuseExistingChunk) && (null !== input.type && (undefined === input.type || "string" === typeof input.type || input.type instanceof RegExp)) && (undefined === input.idHint || "string" === typeof input.idHint) && (null !== input.layer && (undefined === input.layer || "function" === typeof input.layer || "string" === typeof input.layer || input.layer instanceof RegExp)) && (null !== input.chunks && (undefined === input.chunks || "function" === typeof input.chunks || "all" === input.chunks || "initial" === input.chunks || "async" === input.chunks || input.chunks instanceof RegExp)) && (undefined === input.defaultSizeTypes || Array.isArray(input.defaultSizeTypes) && input.defaultSizeTypes.every((elem, _index108) => "string" === typeof elem)) && (undefined === input.minChunks || "number" === typeof input.minChunks) && (undefined === input.usedExports || "boolean" === typeof input.usedExports) && (null !== input.name && (undefined === input.name || "function" === typeof input.name || false === input.name || "string" === typeof input.name)) && (null !== input.filename && (undefined === input.filename || "function" === typeof input.filename || "string" === typeof input.filename)) && (null !== input.minSize && (undefined === input.minSize || "number" === typeof input.minSize || "object" === typeof input.minSize && null !== input.minSize && false === Array.isArray(input.minSize) && _io147(input.minSize, true && _exceptionable))) && (null !== input.minSizeReduction && (undefined === input.minSizeReduction || "number" === typeof input.minSizeReduction || "object" === typeof input.minSizeReduction && null !== input.minSizeReduction && false === Array.isArray(input.minSizeReduction) && _io147(input.minSizeReduction, true && _exceptionable))) && (null !== input.maxSize && (undefined === input.maxSize || "number" === typeof input.maxSize || "object" === typeof input.maxSize && null !== input.maxSize && false === Array.isArray(input.maxSize) && _io147(input.maxSize, true && _exceptionable))) && (null !== input.maxAsyncSize && (undefined === input.maxAsyncSize || "number" === typeof input.maxAsyncSize || "object" === typeof input.maxAsyncSize && null !== input.maxAsyncSize && false === Array.isArray(input.maxAsyncSize) && _io147(input.maxAsyncSize, true && _exceptionable))) && (null !== input.maxInitialSize && (undefined === input.maxInitialSize || "number" === typeof input.maxInitialSize || "object" === typeof input.maxInitialSize && null !== input.maxInitialSize && false === Array.isArray(input.maxInitialSize) && _io147(input.maxInitialSize, true && _exceptionable))) && (undefined === input.maxAsyncRequests || "number" === typeof input.maxAsyncRequests) && (undefined === input.maxInitialRequests || "number" === typeof input.maxInitialRequests) && (undefined === input.automaticNameDelimiter || "string" === typeof input.automaticNameDelimiter) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
1105
|
+
if (["test", "priority", "enforce", "reuseExistingChunk", "type", "idHint", "layer", "chunks", "defaultSizeTypes", "minChunks", "usedExports", "name", "filename", "minSize", "minSizeReduction", "maxSize", "maxAsyncSize", "maxInitialSize", "maxAsyncRequests", "maxInitialRequests", "automaticNameDelimiter"].some(prop => key === prop))
|
|
1106
1106
|
return true;
|
|
1107
1107
|
const value = input[key];
|
|
1108
1108
|
if (undefined === value)
|
|
@@ -2574,8 +2574,8 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
2574
2574
|
if (undefined === value)
|
|
2575
2575
|
return true;
|
|
2576
2576
|
return false;
|
|
2577
|
-
})); const _io375 = (input, _exceptionable = true) => null !== input.js && (undefined === input.js || "function" === typeof input.js || "string" === typeof input.js) && (null !== input.css && (undefined === input.css || "function" === typeof input.css || "string" === typeof input.css)) && (undefined === input.svg || "
|
|
2578
|
-
if (["
|
|
2577
|
+
})); const _io375 = (input, _exceptionable = true) => (undefined === input.html || "string" === typeof input.html) && (null !== input.js && (undefined === input.js || "function" === typeof input.js || "string" === typeof input.js)) && (null !== input.css && (undefined === input.css || "function" === typeof input.css || "string" === typeof input.css)) && (null !== input.svg && (undefined === input.svg || "function" === typeof input.svg || "string" === typeof input.svg)) && (null !== input.font && (undefined === input.font || "function" === typeof input.font || "string" === typeof input.font)) && (null !== input.image && (undefined === input.image || "function" === typeof input.image || "string" === typeof input.image)) && (null !== input.media && (undefined === input.media || "function" === typeof input.media || "string" === typeof input.media)) && (null !== input.assets && (undefined === input.assets || "function" === typeof input.assets || "string" === typeof input.assets)) && (0 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
2578
|
+
if (["html", "js", "css", "svg", "font", "image", "media", "assets"].some(prop => key === prop))
|
|
2579
2579
|
return true;
|
|
2580
2580
|
const value = input[key];
|
|
2581
2581
|
if (undefined === value)
|
|
@@ -11697,6 +11697,14 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11697
11697
|
path: _path + ".name",
|
|
11698
11698
|
expected: "(false | string | undefined)",
|
|
11699
11699
|
value: input.name
|
|
11700
|
+
})), (null !== input.filename || _report(_exceptionable, {
|
|
11701
|
+
path: _path + ".filename",
|
|
11702
|
+
expected: "(string | undefined)",
|
|
11703
|
+
value: input.filename
|
|
11704
|
+
})) && (undefined === input.filename || "function" === typeof input.filename || "string" === typeof input.filename || _report(_exceptionable, {
|
|
11705
|
+
path: _path + ".filename",
|
|
11706
|
+
expected: "(string | undefined)",
|
|
11707
|
+
value: input.filename
|
|
11700
11708
|
})), (null !== input.minSize || _report(_exceptionable, {
|
|
11701
11709
|
path: _path + ".minSize",
|
|
11702
11710
|
expected: "(Record<string, number> | number | undefined)",
|
|
@@ -11709,6 +11717,18 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11709
11717
|
path: _path + ".minSize",
|
|
11710
11718
|
expected: "(Record<string, number> | number | undefined)",
|
|
11711
11719
|
value: input.minSize
|
|
11720
|
+
})), (null !== input.minSizeReduction || _report(_exceptionable, {
|
|
11721
|
+
path: _path + ".minSizeReduction",
|
|
11722
|
+
expected: "(Record<string, number> | number | undefined)",
|
|
11723
|
+
value: input.minSizeReduction
|
|
11724
|
+
})) && (undefined === input.minSizeReduction || "number" === typeof input.minSizeReduction || ("object" === typeof input.minSizeReduction && null !== input.minSizeReduction && false === Array.isArray(input.minSizeReduction) || _report(_exceptionable, {
|
|
11725
|
+
path: _path + ".minSizeReduction",
|
|
11726
|
+
expected: "(Record<string, number> | number | undefined)",
|
|
11727
|
+
value: input.minSizeReduction
|
|
11728
|
+
})) && _vo147(input.minSizeReduction, _path + ".minSizeReduction", true && _exceptionable) || _report(_exceptionable, {
|
|
11729
|
+
path: _path + ".minSizeReduction",
|
|
11730
|
+
expected: "(Record<string, number> | number | undefined)",
|
|
11731
|
+
value: input.minSizeReduction
|
|
11712
11732
|
})), (null !== input.maxSize || _report(_exceptionable, {
|
|
11713
11733
|
path: _path + ".maxSize",
|
|
11714
11734
|
expected: "(Record<string, number> | number | undefined)",
|
|
@@ -11758,7 +11778,7 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11758
11778
|
expected: "(string | undefined)",
|
|
11759
11779
|
value: input.automaticNameDelimiter
|
|
11760
11780
|
}), 0 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
11761
|
-
if (["cacheGroups", "fallbackCacheGroup", "hidePathInfo", "chunks", "defaultSizeTypes", "minChunks", "usedExports", "name", "minSize", "maxSize", "maxAsyncSize", "maxInitialSize", "maxAsyncRequests", "maxInitialRequests", "automaticNameDelimiter"].some(prop => key === prop))
|
|
11781
|
+
if (["cacheGroups", "fallbackCacheGroup", "hidePathInfo", "chunks", "defaultSizeTypes", "minChunks", "usedExports", "name", "filename", "minSize", "minSizeReduction", "maxSize", "maxAsyncSize", "maxInitialSize", "maxAsyncRequests", "maxInitialRequests", "automaticNameDelimiter"].some(prop => key === prop))
|
|
11762
11782
|
return true;
|
|
11763
11783
|
const value = input[key];
|
|
11764
11784
|
if (undefined === value)
|
|
@@ -11805,15 +11825,7 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11805
11825
|
path: _path + ".enforce",
|
|
11806
11826
|
expected: "(boolean | undefined)",
|
|
11807
11827
|
value: input.enforce
|
|
11808
|
-
}),
|
|
11809
|
-
path: _path + ".filename",
|
|
11810
|
-
expected: "(string | undefined)",
|
|
11811
|
-
value: input.filename
|
|
11812
|
-
})) && (undefined === input.filename || "function" === typeof input.filename || "string" === typeof input.filename || _report(_exceptionable, {
|
|
11813
|
-
path: _path + ".filename",
|
|
11814
|
-
expected: "(string | undefined)",
|
|
11815
|
-
value: input.filename
|
|
11816
|
-
})), undefined === input.reuseExistingChunk || "boolean" === typeof input.reuseExistingChunk || _report(_exceptionable, {
|
|
11828
|
+
}), undefined === input.reuseExistingChunk || "boolean" === typeof input.reuseExistingChunk || _report(_exceptionable, {
|
|
11817
11829
|
path: _path + ".reuseExistingChunk",
|
|
11818
11830
|
expected: "(boolean | undefined)",
|
|
11819
11831
|
value: input.reuseExistingChunk
|
|
@@ -11873,6 +11885,14 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11873
11885
|
path: _path + ".name",
|
|
11874
11886
|
expected: "(false | string | undefined)",
|
|
11875
11887
|
value: input.name
|
|
11888
|
+
})), (null !== input.filename || _report(_exceptionable, {
|
|
11889
|
+
path: _path + ".filename",
|
|
11890
|
+
expected: "(string | undefined)",
|
|
11891
|
+
value: input.filename
|
|
11892
|
+
})) && (undefined === input.filename || "function" === typeof input.filename || "string" === typeof input.filename || _report(_exceptionable, {
|
|
11893
|
+
path: _path + ".filename",
|
|
11894
|
+
expected: "(string | undefined)",
|
|
11895
|
+
value: input.filename
|
|
11876
11896
|
})), (null !== input.minSize || _report(_exceptionable, {
|
|
11877
11897
|
path: _path + ".minSize",
|
|
11878
11898
|
expected: "(Record<string, number> | number | undefined)",
|
|
@@ -11885,6 +11905,18 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11885
11905
|
path: _path + ".minSize",
|
|
11886
11906
|
expected: "(Record<string, number> | number | undefined)",
|
|
11887
11907
|
value: input.minSize
|
|
11908
|
+
})), (null !== input.minSizeReduction || _report(_exceptionable, {
|
|
11909
|
+
path: _path + ".minSizeReduction",
|
|
11910
|
+
expected: "(Record<string, number> | number | undefined)",
|
|
11911
|
+
value: input.minSizeReduction
|
|
11912
|
+
})) && (undefined === input.minSizeReduction || "number" === typeof input.minSizeReduction || ("object" === typeof input.minSizeReduction && null !== input.minSizeReduction && false === Array.isArray(input.minSizeReduction) || _report(_exceptionable, {
|
|
11913
|
+
path: _path + ".minSizeReduction",
|
|
11914
|
+
expected: "(Record<string, number> | number | undefined)",
|
|
11915
|
+
value: input.minSizeReduction
|
|
11916
|
+
})) && _vo147(input.minSizeReduction, _path + ".minSizeReduction", true && _exceptionable) || _report(_exceptionable, {
|
|
11917
|
+
path: _path + ".minSizeReduction",
|
|
11918
|
+
expected: "(Record<string, number> | number | undefined)",
|
|
11919
|
+
value: input.minSizeReduction
|
|
11888
11920
|
})), (null !== input.maxSize || _report(_exceptionable, {
|
|
11889
11921
|
path: _path + ".maxSize",
|
|
11890
11922
|
expected: "(Record<string, number> | number | undefined)",
|
|
@@ -11934,7 +11966,7 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
11934
11966
|
expected: "(string | undefined)",
|
|
11935
11967
|
value: input.automaticNameDelimiter
|
|
11936
11968
|
}), 0 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
11937
|
-
if (["test", "priority", "enforce", "
|
|
11969
|
+
if (["test", "priority", "enforce", "reuseExistingChunk", "type", "idHint", "layer", "chunks", "defaultSizeTypes", "minChunks", "usedExports", "name", "filename", "minSize", "minSizeReduction", "maxSize", "maxAsyncSize", "maxInitialSize", "maxAsyncRequests", "maxInitialRequests", "automaticNameDelimiter"].some(prop => key === prop))
|
|
11938
11970
|
return true;
|
|
11939
11971
|
const value = input[key];
|
|
11940
11972
|
if (undefined === value)
|
|
@@ -24394,7 +24426,11 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
24394
24426
|
expected: "undefined",
|
|
24395
24427
|
value: value
|
|
24396
24428
|
});
|
|
24397
|
-
}).every(flag => flag))].every(flag => flag); const _vo375 = (input, _path, _exceptionable = true) => [
|
|
24429
|
+
}).every(flag => flag))].every(flag => flag); const _vo375 = (input, _path, _exceptionable = true) => [undefined === input.html || "string" === typeof input.html || _report(_exceptionable, {
|
|
24430
|
+
path: _path + ".html",
|
|
24431
|
+
expected: "(string | undefined)",
|
|
24432
|
+
value: input.html
|
|
24433
|
+
}), (null !== input.js || _report(_exceptionable, {
|
|
24398
24434
|
path: _path + ".js",
|
|
24399
24435
|
expected: "(string | undefined)",
|
|
24400
24436
|
value: input.js
|
|
@@ -24410,32 +24446,48 @@ export const validateConfig = (() => { const _iv8 = new Set(["ascii", "utf8", "b
|
|
|
24410
24446
|
path: _path + ".css",
|
|
24411
24447
|
expected: "(string | undefined)",
|
|
24412
24448
|
value: input.css
|
|
24413
|
-
})),
|
|
24449
|
+
})), (null !== input.svg || _report(_exceptionable, {
|
|
24414
24450
|
path: _path + ".svg",
|
|
24415
24451
|
expected: "(string | undefined)",
|
|
24416
24452
|
value: input.svg
|
|
24417
|
-
})
|
|
24418
|
-
path: _path + ".
|
|
24453
|
+
})) && (undefined === input.svg || "function" === typeof input.svg || "string" === typeof input.svg || _report(_exceptionable, {
|
|
24454
|
+
path: _path + ".svg",
|
|
24419
24455
|
expected: "(string | undefined)",
|
|
24420
|
-
value: input.
|
|
24421
|
-
}),
|
|
24456
|
+
value: input.svg
|
|
24457
|
+
})), (null !== input.font || _report(_exceptionable, {
|
|
24422
24458
|
path: _path + ".font",
|
|
24423
24459
|
expected: "(string | undefined)",
|
|
24424
24460
|
value: input.font
|
|
24425
|
-
})
|
|
24461
|
+
})) && (undefined === input.font || "function" === typeof input.font || "string" === typeof input.font || _report(_exceptionable, {
|
|
24462
|
+
path: _path + ".font",
|
|
24463
|
+
expected: "(string | undefined)",
|
|
24464
|
+
value: input.font
|
|
24465
|
+
})), (null !== input.image || _report(_exceptionable, {
|
|
24426
24466
|
path: _path + ".image",
|
|
24427
24467
|
expected: "(string | undefined)",
|
|
24428
24468
|
value: input.image
|
|
24429
|
-
})
|
|
24469
|
+
})) && (undefined === input.image || "function" === typeof input.image || "string" === typeof input.image || _report(_exceptionable, {
|
|
24470
|
+
path: _path + ".image",
|
|
24471
|
+
expected: "(string | undefined)",
|
|
24472
|
+
value: input.image
|
|
24473
|
+
})), (null !== input.media || _report(_exceptionable, {
|
|
24430
24474
|
path: _path + ".media",
|
|
24431
24475
|
expected: "(string | undefined)",
|
|
24432
24476
|
value: input.media
|
|
24433
|
-
})
|
|
24477
|
+
})) && (undefined === input.media || "function" === typeof input.media || "string" === typeof input.media || _report(_exceptionable, {
|
|
24478
|
+
path: _path + ".media",
|
|
24479
|
+
expected: "(string | undefined)",
|
|
24480
|
+
value: input.media
|
|
24481
|
+
})), (null !== input.assets || _report(_exceptionable, {
|
|
24434
24482
|
path: _path + ".assets",
|
|
24435
24483
|
expected: "(string | undefined)",
|
|
24436
24484
|
value: input.assets
|
|
24437
|
-
})
|
|
24438
|
-
|
|
24485
|
+
})) && (undefined === input.assets || "function" === typeof input.assets || "string" === typeof input.assets || _report(_exceptionable, {
|
|
24486
|
+
path: _path + ".assets",
|
|
24487
|
+
expected: "(string | undefined)",
|
|
24488
|
+
value: input.assets
|
|
24489
|
+
})), 0 === Object.keys(input).length || (false === _exceptionable || Object.keys(input).map(key => {
|
|
24490
|
+
if (["html", "js", "css", "svg", "font", "image", "media", "assets"].some(prop => key === prop))
|
|
24439
24491
|
return true;
|
|
24440
24492
|
const value = input[key];
|
|
24441
24493
|
if (undefined === value)
|
|
@@ -2,4 +2,4 @@ import type { RsbuildPlugin } from '@rsbuild/core';
|
|
|
2
2
|
import type { Dev } from '../config/dev/index.js';
|
|
3
3
|
import type { Server } from '../config/server/index.js';
|
|
4
4
|
export declare function pluginDev(options?: Dev, server?: Server): RsbuildPlugin;
|
|
5
|
-
export declare function findIp(family: 'v4' | 'v6'): Promise<string>;
|
|
5
|
+
export declare function findIp(family: 'v4' | 'v6', isInternal?: boolean): Promise<string>;
|
|
@@ -91,40 +91,41 @@ export function pluginDev(options, server) {
|
|
|
91
91
|
},
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
export async function findIp(family) {
|
|
95
|
-
const [{ default:
|
|
96
|
-
import('default-gateway'),
|
|
94
|
+
export async function findIp(family, isInternal = false) {
|
|
95
|
+
const [{ default: ipaddr }, os,] = await Promise.all([
|
|
97
96
|
import('ipaddr.js'),
|
|
98
97
|
import('node:os'),
|
|
99
98
|
]);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
let host;
|
|
100
|
+
Object.values(os.networkInterfaces())
|
|
101
|
+
.flatMap((networks) => networks ?? [])
|
|
102
|
+
.filter((network) => {
|
|
103
|
+
if (!network || !network.address) {
|
|
104
|
+
return false;
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return gateway;
|
|
106
|
+
if (network.family !== `IP${family}`) {
|
|
107
|
+
return false;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// Look for the matching interface in all local interfaces.
|
|
112
|
-
for (const addresses of Object.values(os.networkInterfaces())) {
|
|
113
|
-
if (!addresses) {
|
|
114
|
-
continue;
|
|
109
|
+
if (network.internal !== isInternal) {
|
|
110
|
+
return false;
|
|
115
111
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const net = ipaddr.parseCIDR(cidr);
|
|
121
|
-
if (net[0]
|
|
122
|
-
&& net[0].kind() === gatewayIp.kind()
|
|
123
|
-
&& gatewayIp.match(net)) {
|
|
124
|
-
return net[0].toString();
|
|
112
|
+
if (family === 'v6') {
|
|
113
|
+
const range = ipaddr.parse(network.address).range();
|
|
114
|
+
if (range !== 'ipv4Mapped' && range !== 'uniqueLocal') {
|
|
115
|
+
return false;
|
|
125
116
|
}
|
|
126
117
|
}
|
|
118
|
+
return network.address;
|
|
119
|
+
})
|
|
120
|
+
.forEach((network) => {
|
|
121
|
+
host = network.address;
|
|
122
|
+
if (host.includes(':')) {
|
|
123
|
+
host = `[${host}]`;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
if (!host) {
|
|
127
|
+
throw new Error(`No valid IP found`);
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
+
return host;
|
|
129
130
|
}
|
|
130
131
|
//# sourceMappingURL=dev.plugin.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/rspeedy",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "A webpack/rspack-based frontend toolchain for Lynx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"Lynx",
|
|
9
9
|
"ReactLynx"
|
|
10
10
|
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/lynx-family/lynx-stack.git",
|
|
14
|
+
"directory": "packages/rspeedy/core"
|
|
15
|
+
},
|
|
11
16
|
"license": "Apache-2.0",
|
|
12
17
|
"author": {
|
|
13
18
|
"name": "Qingyu Wang",
|
|
@@ -43,31 +48,29 @@
|
|
|
43
48
|
"README.md"
|
|
44
49
|
],
|
|
45
50
|
"dependencies": {
|
|
46
|
-
"@microsoft/api-extractor": "7.51.
|
|
47
|
-
"@rsbuild/core": "1.2.
|
|
51
|
+
"@microsoft/api-extractor": "7.51.1",
|
|
52
|
+
"@rsbuild/core": "1.2.15",
|
|
48
53
|
"@rsbuild/plugin-css-minimizer": "1.0.2",
|
|
49
54
|
"@rsdoctor/rspack-plugin": "^0.4.13",
|
|
50
55
|
"chokidar": "^4.0.3",
|
|
51
56
|
"commander": "^13.1.0",
|
|
52
|
-
"default-gateway": "^7.2.2",
|
|
53
57
|
"exit-hook": "^4.0.0",
|
|
54
58
|
"ipaddr.js": "^2.2.0",
|
|
55
59
|
"javascript-stringify": "^2.1.0",
|
|
56
60
|
"picocolors": "^1.1.1",
|
|
57
61
|
"tiny-invariant": "^1.3.3",
|
|
58
|
-
"ts-blank-space": "^0.6.
|
|
62
|
+
"ts-blank-space": "^0.6.1",
|
|
59
63
|
"typia": "7.6.4",
|
|
60
|
-
"@lynx-js/chunk-loading-webpack-plugin": "^0.1.
|
|
61
|
-
"@lynx-js/webpack-dev-transport": "^0.1.
|
|
62
|
-
"@lynx-js/websocket": "^0.0.
|
|
64
|
+
"@lynx-js/chunk-loading-webpack-plugin": "^0.1.7",
|
|
65
|
+
"@lynx-js/webpack-dev-transport": "^0.1.1",
|
|
66
|
+
"@lynx-js/websocket": "^0.0.4"
|
|
63
67
|
},
|
|
64
68
|
"devDependencies": {
|
|
65
69
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
66
70
|
"@rsbuild/webpack": "1.2.3",
|
|
67
|
-
"@types/default-gateway": "^7.2.2",
|
|
68
71
|
"eventemitter3": "^5.0.1",
|
|
69
|
-
"type-fest": "^4.
|
|
70
|
-
"vitest": "^3.0.
|
|
72
|
+
"type-fest": "^4.37.0",
|
|
73
|
+
"vitest": "^3.0.8",
|
|
71
74
|
"webpack": "^5.98.0",
|
|
72
75
|
"@lynx-js/vitest-setup": "0.0.0"
|
|
73
76
|
},
|