@rsdoctor/sdk 1.5.0 → 1.5.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/cors/index.js +8 -8
- package/compiled/cors/package.json +1 -1
- package/dist/index.cjs +14 -10
- package/dist/index.js +13 -9
- package/package.json +7 -7
package/compiled/cors/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 218:
|
|
5
5
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6
6
|
|
|
7
7
|
(function () {
|
|
@@ -169,11 +169,11 @@
|
|
|
169
169
|
if (method === 'OPTIONS') {
|
|
170
170
|
// preflight
|
|
171
171
|
headers.push(configureOrigin(options, req));
|
|
172
|
-
headers.push(configureCredentials(options
|
|
173
|
-
headers.push(configureMethods(options
|
|
172
|
+
headers.push(configureCredentials(options))
|
|
173
|
+
headers.push(configureMethods(options))
|
|
174
174
|
headers.push(configureAllowedHeaders(options, req));
|
|
175
|
-
headers.push(configureMaxAge(options
|
|
176
|
-
headers.push(configureExposedHeaders(options
|
|
175
|
+
headers.push(configureMaxAge(options))
|
|
176
|
+
headers.push(configureExposedHeaders(options))
|
|
177
177
|
applyHeaders(headers, res);
|
|
178
178
|
|
|
179
179
|
if (options.preflightContinue) {
|
|
@@ -188,8 +188,8 @@
|
|
|
188
188
|
} else {
|
|
189
189
|
// actual response
|
|
190
190
|
headers.push(configureOrigin(options, req));
|
|
191
|
-
headers.push(configureCredentials(options
|
|
192
|
-
headers.push(configureExposedHeaders(options
|
|
191
|
+
headers.push(configureCredentials(options))
|
|
192
|
+
headers.push(configureExposedHeaders(options))
|
|
193
193
|
applyHeaders(headers, res);
|
|
194
194
|
next();
|
|
195
195
|
}
|
|
@@ -543,7 +543,7 @@ function vary (res, field) {
|
|
|
543
543
|
/******/ // startup
|
|
544
544
|
/******/ // Load entry module and return exports
|
|
545
545
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
546
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
546
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(218);
|
|
547
547
|
/******/ module.exports = __webpack_exports__;
|
|
548
548
|
/******/
|
|
549
549
|
/******/ })()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cors","author":"Troy Goode <troygoode@gmail.com> (https://github.com/troygoode/)","version":"2.8.
|
|
1
|
+
{"name":"cors","author":"Troy Goode <troygoode@gmail.com> (https://github.com/troygoode/)","version":"2.8.6","funding":{"type":"opencollective","url":"https://opencollective.com/express"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
|
package/dist/index.cjs
CHANGED
|
@@ -5321,7 +5321,7 @@ for(var __rspack_i in (()=>{
|
|
|
5321
5321
|
let external_module_namespaceObject = require("module"), error_namespaceObject = require("@rsdoctor/utils/error"), types_namespaceObject = require("@rsdoctor/types");
|
|
5322
5322
|
var source_map = __webpack_require__("../../node_modules/.pnpm/source-map@0.7.6/node_modules/source-map/source-map.js");
|
|
5323
5323
|
let graph_namespaceObject = require("@rsdoctor/graph"), logger_namespaceObject = require("@rsdoctor/utils/logger"), build_namespaceObject = require("@rsdoctor/utils/build");
|
|
5324
|
-
var external_fs_ = __webpack_require__("fs"), external_fs_default = __webpack_require__.n(external_fs_);
|
|
5324
|
+
var external_node_path_ = __webpack_require__("node:path"), external_node_path_default = __webpack_require__.n(external_node_path_), external_fs_ = __webpack_require__("fs"), external_fs_default = __webpack_require__.n(external_fs_);
|
|
5325
5325
|
let external_node_querystring_namespaceObject = require("node:querystring"), mimes = {
|
|
5326
5326
|
"3g2": "video/3gpp2",
|
|
5327
5327
|
"3gp": "video/3gpp",
|
|
@@ -5771,8 +5771,8 @@ for(var __rspack_i in (()=>{
|
|
|
5771
5771
|
}
|
|
5772
5772
|
function viaLocal(dir, isEtag, uri, extns) {
|
|
5773
5773
|
let abs, stats, name, headers, i = 0, arr = toAssume(uri, extns);
|
|
5774
|
-
for(; i < arr.length; i++)if ((abs = (0,
|
|
5775
|
-
if ((stats =
|
|
5774
|
+
for(; i < arr.length; i++)if ((abs = (0, external_node_path_.normalize)((0, external_node_path_.join)(dir, name = arr[i]))).startsWith(dir) && external_node_fs_.existsSync(abs)) {
|
|
5775
|
+
if ((stats = external_node_fs_.statSync(abs)).isDirectory()) continue;
|
|
5776
5776
|
return (headers = toHeaders(name, stats, isEtag))['Cache-Control'] = isEtag ? 'no-cache' : 'no-store', {
|
|
5777
5777
|
abs,
|
|
5778
5778
|
stats,
|
|
@@ -6359,8 +6359,8 @@ for(var __rspack_i in (()=>{
|
|
|
6359
6359
|
resolver_ts_metadata("design:paramtypes", []),
|
|
6360
6360
|
resolver_ts_metadata("design:returntype", Promise)
|
|
6361
6361
|
], ResolverAPI.prototype, "getResolverFileDetails", null);
|
|
6362
|
-
var external_node_child_process_ = __webpack_require__("node:child_process")
|
|
6363
|
-
let execAsync = (0,
|
|
6362
|
+
var external_node_child_process_ = __webpack_require__("node:child_process");
|
|
6363
|
+
let execAsync = (0, __webpack_require__("node:util").promisify)(external_node_child_process_.exec), supportedChromiumBrowsers = [
|
|
6364
6364
|
'Google Chrome Canary',
|
|
6365
6365
|
'Google Chrome Dev',
|
|
6366
6366
|
'Google Chrome Beta',
|
|
@@ -6447,7 +6447,7 @@ for(var __rspack_i in (()=>{
|
|
|
6447
6447
|
}));
|
|
6448
6448
|
let clientHtmlPath = this._innerClientPath ? this._innerClientPath : server_require.resolve('@rsdoctor/client'), clientDistPath = external_path_default().resolve(clientHtmlPath, '..');
|
|
6449
6449
|
this.app.use(function(dir, opts = {}) {
|
|
6450
|
-
dir = (0,
|
|
6450
|
+
dir = (0, external_node_path_.resolve)(dir || '.');
|
|
6451
6451
|
let isNotFound = opts.onNoMatch || is404, setHeaders = opts.setHeaders || noop, extensions = opts.extensions || [
|
|
6452
6452
|
'html',
|
|
6453
6453
|
'htm'
|
|
@@ -6475,7 +6475,7 @@ for(var __rspack_i in (()=>{
|
|
|
6475
6475
|
headers
|
|
6476
6476
|
};
|
|
6477
6477
|
});
|
|
6478
|
-
let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES);
|
|
6478
|
+
let lookup = opts.dev ? viaLocal.bind(0, dir + external_node_path_.sep, isEtag) : viaCache.bind(0, FILES);
|
|
6479
6479
|
return function(req, res, next) {
|
|
6480
6480
|
let extns = [
|
|
6481
6481
|
''
|
|
@@ -6513,12 +6513,16 @@ for(var __rspack_i in (()=>{
|
|
|
6513
6513
|
if (end >= stats.size && (end = stats.size - 1), start >= stats.size) return res.setHeader('Content-Range', `bytes */${stats.size}`), res.statusCode = 416, res.end();
|
|
6514
6514
|
headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`, headers['Content-Length'] = end - start + 1, headers['Accept-Ranges'] = 'bytes';
|
|
6515
6515
|
}
|
|
6516
|
-
res.writeHead(code, headers),
|
|
6516
|
+
res.writeHead(code, headers), external_node_fs_.createReadStream(file, opts).pipe(res);
|
|
6517
6517
|
}(req, res, data.abs, data.stats, data.headers)) : next ? next() : isNotFound(req, res);
|
|
6518
6518
|
};
|
|
6519
6519
|
}(clientDistPath, {
|
|
6520
6520
|
dev: !0
|
|
6521
|
-
})), await this._router.setup(), process.once('exit', ()=>this.dispose()), process.once('SIGINT', ()=>this.dispose(0)), process.once('SIGTERM', ()=>this.dispose(0)), process.once('unhandledRejection', ()=>
|
|
6521
|
+
})), await this._router.setup(), process.once('exit', ()=>this.dispose()), process.once('SIGINT', ()=>this.dispose(0)), process.once('SIGTERM', ()=>this.dispose(0)), process.once('unhandledRejection', (reason)=>{
|
|
6522
|
+
console.error('Unhandled promise rejection:', reason), this.dispose(1);
|
|
6523
|
+
}), process.once('uncaughtException', (err, origin)=>{
|
|
6524
|
+
console.error('Uncaught exception:', err), origin && console.error('Exception origin:', origin), this.dispose(1);
|
|
6525
|
+
});
|
|
6522
6526
|
}
|
|
6523
6527
|
wrapNextHandleFunction(method, cb) {
|
|
6524
6528
|
return async (req, res, next)=>{
|
|
@@ -6804,7 +6808,7 @@ for(var __rspack_i in (()=>{
|
|
|
6804
6808
|
logger_namespaceObject.logger.debug(`data size: ${data.size()}`, '[SDK.reportModuleGraph][start]'), this._moduleGraph.fromInstance(data), this.createPackageGraph(), this.onDataReport(), logger_namespaceObject.logger.debug(`sdk._moduleGraph size: ${this._moduleGraph.size()}`, '[SDK reportModuleGraph][end]');
|
|
6805
6809
|
}
|
|
6806
6810
|
reportPackageGraph(data) {
|
|
6807
|
-
logger_namespaceObject.logger.debug('[SDK.reportPackageGraph][start]'), this._packageGraph || (this._packageGraph = data), this.onDataReport(), logger_namespaceObject.logger.debug(`sdk.
|
|
6811
|
+
logger_namespaceObject.logger.debug('[SDK.reportPackageGraph][start]'), this._packageGraph || (this._packageGraph = data), this.onDataReport(), logger_namespaceObject.logger.debug(`sdk._packageGraph size: ${this._packageGraph.getPackages().length}`, '[SDK reportPackageGraph][end]');
|
|
6808
6812
|
}
|
|
6809
6813
|
reportChunkGraph(data) {
|
|
6810
6814
|
this._chunkGraph.addAsset(...data.getAssets()), this._chunkGraph.addChunk(...data.getChunks()), this._chunkGraph.addEntryPoint(...data.getEntryPoints()), this.onDataReport();
|
package/dist/index.js
CHANGED
|
@@ -5223,7 +5223,7 @@ __webpack_require__.r(apis_namespaceObject), __webpack_require__.d(apis_namespac
|
|
|
5223
5223
|
RendererAPI: ()=>RendererAPI,
|
|
5224
5224
|
ResolverAPI: ()=>ResolverAPI
|
|
5225
5225
|
});
|
|
5226
|
-
var external_node_fs_ = __webpack_require__("node:fs"), external_path_ = __webpack_require__("path"), source_map = __webpack_require__("../../node_modules/.pnpm/source-map@0.7.6/node_modules/source-map/source-map.js"), external_fs_ = __webpack_require__("fs");
|
|
5226
|
+
var external_node_fs_ = __webpack_require__("node:fs"), external_path_ = __webpack_require__("path"), source_map = __webpack_require__("../../node_modules/.pnpm/source-map@0.7.6/node_modules/source-map/source-map.js"), external_node_path_ = __webpack_require__("node:path"), external_fs_ = __webpack_require__("fs");
|
|
5227
5227
|
let mimes = {
|
|
5228
5228
|
"3g2": "video/3gpp2",
|
|
5229
5229
|
"3gp": "video/3gpp",
|
|
@@ -5673,8 +5673,8 @@ function viaCache(cache, uri, extns) {
|
|
|
5673
5673
|
}
|
|
5674
5674
|
function viaLocal(dir, isEtag, uri, extns) {
|
|
5675
5675
|
let abs, stats, name, headers, i = 0, arr = toAssume(uri, extns);
|
|
5676
|
-
for(; i < arr.length; i++)if ((abs = (0,
|
|
5677
|
-
if ((stats =
|
|
5676
|
+
for(; i < arr.length; i++)if ((abs = (0, external_node_path_.normalize)((0, external_node_path_.join)(dir, name = arr[i]))).startsWith(dir) && external_node_fs_.existsSync(abs)) {
|
|
5677
|
+
if ((stats = external_node_fs_.statSync(abs)).isDirectory()) continue;
|
|
5678
5678
|
return (headers = toHeaders(name, stats, isEtag))['Cache-Control'] = isEtag ? 'no-cache' : 'no-store', {
|
|
5679
5679
|
abs,
|
|
5680
5680
|
stats,
|
|
@@ -6256,7 +6256,7 @@ resolver_ts_decorate([
|
|
|
6256
6256
|
resolver_ts_metadata("design:paramtypes", []),
|
|
6257
6257
|
resolver_ts_metadata("design:returntype", Promise)
|
|
6258
6258
|
], ResolverAPI.prototype, "getResolverFileDetails", null);
|
|
6259
|
-
var external_node_child_process_ = __webpack_require__("node:child_process"), external_node_util_ = __webpack_require__("node:util"),
|
|
6259
|
+
var external_node_child_process_ = __webpack_require__("node:child_process"), external_node_util_ = __webpack_require__("node:util"), openBrowser_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
6260
6260
|
let execAsync = (0, external_node_util_.promisify)(external_node_child_process_.exec), supportedChromiumBrowsers = [
|
|
6261
6261
|
'Google Chrome Canary',
|
|
6262
6262
|
'Google Chrome Dev',
|
|
@@ -6344,7 +6344,7 @@ class RsdoctorServer {
|
|
|
6344
6344
|
}));
|
|
6345
6345
|
let clientHtmlPath = this._innerClientPath ? this._innerClientPath : server_require.resolve('@rsdoctor/client'), clientDistPath = external_path_.default.resolve(clientHtmlPath, '..');
|
|
6346
6346
|
this.app.use(function(dir, opts = {}) {
|
|
6347
|
-
dir = (0,
|
|
6347
|
+
dir = (0, external_node_path_.resolve)(dir || '.');
|
|
6348
6348
|
let isNotFound = opts.onNoMatch || is404, setHeaders = opts.setHeaders || noop, extensions = opts.extensions || [
|
|
6349
6349
|
'html',
|
|
6350
6350
|
'htm'
|
|
@@ -6372,7 +6372,7 @@ class RsdoctorServer {
|
|
|
6372
6372
|
headers
|
|
6373
6373
|
};
|
|
6374
6374
|
});
|
|
6375
|
-
let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES);
|
|
6375
|
+
let lookup = opts.dev ? viaLocal.bind(0, dir + external_node_path_.sep, isEtag) : viaCache.bind(0, FILES);
|
|
6376
6376
|
return function(req, res, next) {
|
|
6377
6377
|
let extns = [
|
|
6378
6378
|
''
|
|
@@ -6410,12 +6410,16 @@ class RsdoctorServer {
|
|
|
6410
6410
|
if (end >= stats.size && (end = stats.size - 1), start >= stats.size) return res.setHeader('Content-Range', `bytes */${stats.size}`), res.statusCode = 416, res.end();
|
|
6411
6411
|
headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`, headers['Content-Length'] = end - start + 1, headers['Accept-Ranges'] = 'bytes';
|
|
6412
6412
|
}
|
|
6413
|
-
res.writeHead(code, headers),
|
|
6413
|
+
res.writeHead(code, headers), external_node_fs_.createReadStream(file, opts).pipe(res);
|
|
6414
6414
|
}(req, res, data.abs, data.stats, data.headers)) : next ? next() : isNotFound(req, res);
|
|
6415
6415
|
};
|
|
6416
6416
|
}(clientDistPath, {
|
|
6417
6417
|
dev: !0
|
|
6418
|
-
})), await this._router.setup(), process.once('exit', ()=>this.dispose()), process.once('SIGINT', ()=>this.dispose(0)), process.once('SIGTERM', ()=>this.dispose(0)), process.once('unhandledRejection', ()=>
|
|
6418
|
+
})), await this._router.setup(), process.once('exit', ()=>this.dispose()), process.once('SIGINT', ()=>this.dispose(0)), process.once('SIGTERM', ()=>this.dispose(0)), process.once('unhandledRejection', (reason)=>{
|
|
6419
|
+
console.error('Unhandled promise rejection:', reason), this.dispose(1);
|
|
6420
|
+
}), process.once('uncaughtException', (err, origin)=>{
|
|
6421
|
+
console.error('Uncaught exception:', err), origin && console.error('Exception origin:', origin), this.dispose(1);
|
|
6422
|
+
});
|
|
6419
6423
|
}
|
|
6420
6424
|
wrapNextHandleFunction(method, cb) {
|
|
6421
6425
|
return async (req, res, next)=>{
|
|
@@ -6699,7 +6703,7 @@ class RsdoctorSDK extends SDKCore {
|
|
|
6699
6703
|
logger.debug(`data size: ${data.size()}`, '[SDK.reportModuleGraph][start]'), this._moduleGraph.fromInstance(data), this.createPackageGraph(), this.onDataReport(), logger.debug(`sdk._moduleGraph size: ${this._moduleGraph.size()}`, '[SDK reportModuleGraph][end]');
|
|
6700
6704
|
}
|
|
6701
6705
|
reportPackageGraph(data) {
|
|
6702
|
-
logger.debug('[SDK.reportPackageGraph][start]'), this._packageGraph || (this._packageGraph = data), this.onDataReport(), logger.debug(`sdk.
|
|
6706
|
+
logger.debug('[SDK.reportPackageGraph][start]'), this._packageGraph || (this._packageGraph = data), this.onDataReport(), logger.debug(`sdk._packageGraph size: ${this._packageGraph.getPackages().length}`, '[SDK reportPackageGraph][end]');
|
|
6703
6707
|
}
|
|
6704
6708
|
reportChunkGraph(data) {
|
|
6705
6709
|
this._chunkGraph.addAsset(...data.getAssets()), this._chunkGraph.addChunk(...data.getChunks()), this._chunkGraph.addEntryPoint(...data.getEntryPoints()), this.onDataReport();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"safer-buffer": "2.1.2",
|
|
27
27
|
"socket.io": "4.8.1",
|
|
28
28
|
"tapable": "2.2.3",
|
|
29
|
-
"@rsdoctor/
|
|
30
|
-
"@rsdoctor/
|
|
31
|
-
"@rsdoctor/
|
|
32
|
-
"@rsdoctor/
|
|
29
|
+
"@rsdoctor/client": "1.5.1",
|
|
30
|
+
"@rsdoctor/graph": "1.5.1",
|
|
31
|
+
"@rsdoctor/utils": "1.5.1",
|
|
32
|
+
"@rsdoctor/types": "1.5.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/body-parser": "1.19.6",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@types/fs-extra": "^11.0.4",
|
|
39
39
|
"@types/node": "^22.8.1",
|
|
40
40
|
"body-parser": "2.2.2",
|
|
41
|
-
"cors": "2.8.
|
|
41
|
+
"cors": "2.8.6",
|
|
42
42
|
"dayjs": "1.11.19",
|
|
43
43
|
"fs-extra": "^11.1.1",
|
|
44
44
|
"open": "^10.2.0",
|
|
45
|
-
"sirv": "
|
|
45
|
+
"sirv": "3.0.2",
|
|
46
46
|
"source-map": "^0.7.6",
|
|
47
47
|
"prebundle": "1.4.2",
|
|
48
48
|
"tslib": "2.8.1",
|