@rsdoctor/sdk 1.3.13 → 1.3.14
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/dist/{0~307.js → 0~604.js} +13 -14
- package/dist/index.cjs +10 -10
- package/dist/index.js +14 -10
- package/package.json +5 -5
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import node_process from "node:process";
|
|
2
1
|
import { Buffer } from "node:buffer";
|
|
3
2
|
import { fileURLToPath } from "node:url";
|
|
4
3
|
import promises, { constants } from "node:fs/promises";
|
|
5
4
|
import node_os from "node:os";
|
|
6
|
-
export const __rspack_esm_id = "
|
|
5
|
+
export const __rspack_esm_id = "604";
|
|
7
6
|
export const __rspack_esm_ids = [
|
|
8
|
-
"
|
|
7
|
+
"604"
|
|
9
8
|
];
|
|
10
9
|
export const __webpack_modules__ = {
|
|
11
10
|
"../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js" (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
@@ -13,7 +12,7 @@ export const __webpack_modules__ = {
|
|
|
13
12
|
__webpack_require__.d(__webpack_exports__, {
|
|
14
13
|
default: ()=>node_modules_open
|
|
15
14
|
});
|
|
16
|
-
var external_node_path_ = __webpack_require__("node:path"), external_node_util_ = __webpack_require__("node:util"), external_node_child_process_ = __webpack_require__("node:child_process"), external_node_fs_ = __webpack_require__("node:fs");
|
|
15
|
+
var external_node_process_ = __webpack_require__("node:process"), external_node_path_ = __webpack_require__("node:path"), external_node_util_ = __webpack_require__("node:util"), external_node_child_process_ = __webpack_require__("node:child_process"), external_node_fs_ = __webpack_require__("node:fs");
|
|
17
16
|
function isInsideContainer() {
|
|
18
17
|
return void 0 === cachedResult && (cachedResult = (()=>{
|
|
19
18
|
try {
|
|
@@ -36,14 +35,14 @@ export const __webpack_modules__ = {
|
|
|
36
35
|
}()), isDockerCached)), cachedResult;
|
|
37
36
|
}
|
|
38
37
|
let isWsl = ()=>{
|
|
39
|
-
if ('linux' !==
|
|
38
|
+
if ('linux' !== external_node_process_.default.platform) return !1;
|
|
40
39
|
if (node_os.release().toLowerCase().includes('microsoft')) return !isInsideContainer();
|
|
41
40
|
try {
|
|
42
41
|
return !!external_node_fs_.default.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') && !isInsideContainer();
|
|
43
42
|
} catch {
|
|
44
43
|
return !1;
|
|
45
44
|
}
|
|
46
|
-
}, is_wsl =
|
|
45
|
+
}, is_wsl = external_node_process_.default.env.__IS_WSL_TEST__ ? isWsl : isWsl(), wslDrivesMountPoint = (defaultMountPoint = '/mnt/', async function() {
|
|
47
46
|
if (mountPoint) return mountPoint;
|
|
48
47
|
let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
|
|
49
48
|
try {
|
|
@@ -57,7 +56,7 @@ export const __webpack_modules__ = {
|
|
|
57
56
|
}), powerShellPathFromWsl = async ()=>{
|
|
58
57
|
let mountPoint = await wslDrivesMountPoint();
|
|
59
58
|
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
60
|
-
}, powerShellPath = async ()=>is_wsl ? powerShellPathFromWsl() : `${
|
|
59
|
+
}, powerShellPath = async ()=>is_wsl ? powerShellPathFromWsl() : `${external_node_process_.default.env.SYSTEMROOT || external_node_process_.default.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
61
60
|
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
62
61
|
let define = (value)=>Object.defineProperty(object, propertyName, {
|
|
63
62
|
value,
|
|
@@ -78,7 +77,7 @@ export const __webpack_modules__ = {
|
|
|
78
77
|
}
|
|
79
78
|
let execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
|
|
80
79
|
async function defaultBrowserId() {
|
|
81
|
-
if ('darwin' !==
|
|
80
|
+
if ('darwin' !== external_node_process_.default.platform) throw Error('macOS only');
|
|
82
81
|
let { stdout } = await execFileAsync('defaults', [
|
|
83
82
|
'read',
|
|
84
83
|
'com.apple.LaunchServices/com.apple.launchservices.secure',
|
|
@@ -88,7 +87,7 @@ export const __webpack_modules__ = {
|
|
|
88
87
|
}
|
|
89
88
|
let run_applescript_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
|
|
90
89
|
async function runAppleScript(script, { humanReadableOutput = !0 } = {}) {
|
|
91
|
-
if ('darwin' !==
|
|
90
|
+
if ('darwin' !== external_node_process_.default.platform) throw Error('macOS only');
|
|
92
91
|
let { stdout } = await run_applescript_execFileAsync("osascript", [
|
|
93
92
|
'-e',
|
|
94
93
|
script,
|
|
@@ -155,14 +154,14 @@ export const __webpack_modules__ = {
|
|
|
155
154
|
}
|
|
156
155
|
let default_browser_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
|
|
157
156
|
async function default_browser_defaultBrowser() {
|
|
158
|
-
if ('darwin' ===
|
|
157
|
+
if ('darwin' === external_node_process_.default.platform) {
|
|
159
158
|
let id = await defaultBrowserId();
|
|
160
159
|
return {
|
|
161
160
|
name: await bundleName(id),
|
|
162
161
|
id
|
|
163
162
|
};
|
|
164
163
|
}
|
|
165
|
-
if ('linux' ===
|
|
164
|
+
if ('linux' === external_node_process_.default.platform) {
|
|
166
165
|
let { stdout } = await default_browser_execFileAsync('xdg-mime', [
|
|
167
166
|
'query',
|
|
168
167
|
'default',
|
|
@@ -173,10 +172,10 @@ export const __webpack_modules__ = {
|
|
|
173
172
|
id
|
|
174
173
|
};
|
|
175
174
|
}
|
|
176
|
-
if ('win32' ===
|
|
175
|
+
if ('win32' === external_node_process_.default.platform) return defaultBrowser();
|
|
177
176
|
throw Error('Only macOS, Linux, and Windows are supported');
|
|
178
177
|
}
|
|
179
|
-
let execFile = (0, external_node_util_.promisify)(external_node_child_process_.default.execFile), open_dirname = external_node_path_.default.dirname(fileURLToPath(import.meta.url)), localXdgOpenPath = external_node_path_.default.join(open_dirname, 'xdg-open'), { platform, arch } =
|
|
178
|
+
let execFile = (0, external_node_util_.promisify)(external_node_child_process_.default.execFile), open_dirname = external_node_path_.default.dirname(fileURLToPath(import.meta.url)), localXdgOpenPath = external_node_path_.default.join(open_dirname, 'xdg-open'), { platform, arch } = external_node_process_.default;
|
|
180
179
|
async function getWindowsDefaultBrowserFromWsl() {
|
|
181
180
|
let powershellPath = await powerShellPath(), rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, encodedCommand = Buffer.from(rawCommand, 'utf16le').toString('base64'), { stdout } = await execFile(powershellPath, [
|
|
182
181
|
'-NoProfile',
|
|
@@ -265,7 +264,7 @@ export const __webpack_modules__ = {
|
|
|
265
264
|
try {
|
|
266
265
|
await promises.access(localXdgOpenPath, constants.X_OK), exeLocalXdgOpen = !0;
|
|
267
266
|
} catch {}
|
|
268
|
-
command =
|
|
267
|
+
command = external_node_process_.default.versions.electron ?? ('android' === platform || !open_dirname || '/' === open_dirname || !exeLocalXdgOpen) ? 'xdg-open' : localXdgOpenPath;
|
|
269
268
|
}
|
|
270
269
|
appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = 'ignore', childProcessOptions.detached = !0);
|
|
271
270
|
} else {
|
package/dist/index.cjs
CHANGED
|
@@ -6443,7 +6443,7 @@ for(var __rspack_i in (()=>{
|
|
|
6443
6443
|
resolver_ts_metadata("design:paramtypes", []),
|
|
6444
6444
|
resolver_ts_metadata("design:returntype", Promise)
|
|
6445
6445
|
], ResolverAPI.prototype, "getResolverFileDetails", null);
|
|
6446
|
-
var external_node_child_process_ = __webpack_require__("node:child_process"), external_node_util_ = __webpack_require__("node:util"), external_node_path_ = __webpack_require__("node:path");
|
|
6446
|
+
var external_node_child_process_ = __webpack_require__("node:child_process"), external_node_util_ = __webpack_require__("node:util"), external_node_path_ = __webpack_require__("node:path"), external_node_path_default = __webpack_require__.n(external_node_path_);
|
|
6447
6447
|
let execAsync = (0, external_node_util_.promisify)(external_node_child_process_.exec), supportedChromiumBrowsers = [
|
|
6448
6448
|
'Google Chrome Canary',
|
|
6449
6449
|
'Google Chrome Dev',
|
|
@@ -6659,8 +6659,8 @@ for(var __rspack_i in (()=>{
|
|
|
6659
6659
|
}
|
|
6660
6660
|
async openClientPage() {}
|
|
6661
6661
|
}
|
|
6662
|
-
let
|
|
6663
|
-
var
|
|
6662
|
+
let external_node_crypto_namespaceObject = require("node:crypto");
|
|
6663
|
+
var external_node_process_ = __webpack_require__("node:process"), external_node_process_default = __webpack_require__.n(external_node_process_);
|
|
6664
6664
|
let external_tapable_namespaceObject = require("tapable"), dayjs_index_js_namespaceObject = require("../compiled/dayjs/index.js");
|
|
6665
6665
|
function findRoot(startDir = process.cwd()) {
|
|
6666
6666
|
let dir = startDir, firstPkgDir = null;
|
|
@@ -6681,7 +6681,7 @@ for(var __rspack_i in (()=>{
|
|
|
6681
6681
|
])
|
|
6682
6682
|
}, this._envinfo = {}, this._clientRoutes = new Set([
|
|
6683
6683
|
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.Overall
|
|
6684
|
-
]), this.diskManifestPath = '', this._name = name, this.root = root, this.pid =
|
|
6684
|
+
]), this.diskManifestPath = '', this._name = name, this.root = root, this.pid = external_node_process_default().pid, this._outputDir = external_node_path_default().join(this.outputDir || this.root, types_namespaceObject.Constants.RsdoctorOutputFolder);
|
|
6685
6685
|
}
|
|
6686
6686
|
get outputDir() {
|
|
6687
6687
|
return this._outputDir;
|
|
@@ -6707,7 +6707,7 @@ for(var __rspack_i in (()=>{
|
|
|
6707
6707
|
npmVersion,
|
|
6708
6708
|
pnpmVersion
|
|
6709
6709
|
};
|
|
6710
|
-
let hash = (0,
|
|
6710
|
+
let hash = (0, external_node_crypto_namespaceObject.createHash)('md5').update([
|
|
6711
6711
|
this.name,
|
|
6712
6712
|
this.root,
|
|
6713
6713
|
JSON.stringify(this._envinfo),
|
|
@@ -6739,7 +6739,7 @@ for(var __rspack_i in (()=>{
|
|
|
6739
6739
|
}), this.onDataReport();
|
|
6740
6740
|
}
|
|
6741
6741
|
async writePieces(storeData, _options) {
|
|
6742
|
-
let { outputDir } = this, manifest =
|
|
6742
|
+
let { outputDir } = this, manifest = external_node_path_default().resolve(outputDir, types_namespaceObject.Constants.RsdoctorOutputManifest);
|
|
6743
6743
|
this.diskManifestPath = manifest, await build_namespaceObject.File.fse.ensureDir(outputDir);
|
|
6744
6744
|
let urlsPromiseList = [];
|
|
6745
6745
|
for (let key of Object.keys(storeData)){
|
|
@@ -6775,8 +6775,8 @@ for(var __rspack_i in (()=>{
|
|
|
6775
6775
|
async writeManifest() {
|
|
6776
6776
|
let { cloudData: data, diskManifestPath } = this, dataStr = JSON.stringify(data, null, 2);
|
|
6777
6777
|
logger_namespaceObject.logger.debug(`SDKCore.writeManifest extraConfig: ${this.extraConfig}`, '[SDKCore.writeManifest]');
|
|
6778
|
-
let dir =
|
|
6779
|
-
return await build_namespaceObject.File.fse.outputFile(tmpPath, dataStr),
|
|
6778
|
+
let dir = external_node_path_default().dirname(diskManifestPath), base = external_node_path_default().basename(diskManifestPath), tmpPath = external_node_path_default().join(dir, `${base}.${Date.now()}.${(0, external_node_crypto_namespaceObject.randomUUID)()}.tmp`);
|
|
6779
|
+
return await build_namespaceObject.File.fse.outputFile(tmpPath, dataStr), external_node_fs_default().renameSync(tmpPath, diskManifestPath), diskManifestPath;
|
|
6780
6780
|
}
|
|
6781
6781
|
async saveManifest(data, options) {
|
|
6782
6782
|
await this.writePieces(data, options);
|
|
@@ -6787,11 +6787,11 @@ for(var __rspack_i in (()=>{
|
|
|
6787
6787
|
}), manifestDiskPath;
|
|
6788
6788
|
}
|
|
6789
6789
|
writeToFolder(jsonStr, dir, key, index) {
|
|
6790
|
-
let sharding = new build_namespaceObject.File.FileSharding(common_namespaceObject.Algorithm.compressText(jsonStr)), folder =
|
|
6790
|
+
let sharding = new build_namespaceObject.File.FileSharding(common_namespaceObject.Algorithm.compressText(jsonStr)), folder = external_node_path_default().resolve(dir, key);
|
|
6791
6791
|
return sharding.writeStringToFolder(folder, '', index).then((item)=>({
|
|
6792
6792
|
name: key,
|
|
6793
6793
|
files: item.map((el)=>({
|
|
6794
|
-
path:
|
|
6794
|
+
path: external_node_path_default().resolve(folder, el.filename),
|
|
6795
6795
|
basename: el.filename,
|
|
6796
6796
|
content: el.content
|
|
6797
6797
|
}))
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as __rspack_external_async_hooks from "async_hooks";
|
|
|
4
4
|
import * as __rspack_external_fs from "fs";
|
|
5
5
|
import * as __rspack_external_node_child_process_27f17141 from "node:child_process";
|
|
6
6
|
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
7
|
+
import * as __rspack_external_node_process_786449bf from "node:process";
|
|
7
8
|
import * as __rspack_external_node_util_1b29d436 from "node:util";
|
|
8
9
|
import * as __rspack_external_node_zlib_a5bb16fc from "node:zlib";
|
|
9
10
|
import * as __rspack_external_os from "os";
|
|
@@ -26,8 +27,7 @@ import { Algorithm, Bundle, Data, GlobalConfig, Lodash, decycle } from "@rsdocto
|
|
|
26
27
|
import assert from "assert";
|
|
27
28
|
import cors from "../compiled/cors/index.js";
|
|
28
29
|
import { Server as external_socket_io_Server } from "socket.io";
|
|
29
|
-
import { createHash, randomUUID } from "crypto";
|
|
30
|
-
import process_0 from "process";
|
|
30
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
31
31
|
import { AsyncSeriesHook } from "tapable";
|
|
32
32
|
import dayjs from "../compiled/dayjs/index.js";
|
|
33
33
|
var installedChunks, installChunk, __webpack_modules__ = {
|
|
@@ -5176,6 +5176,9 @@ var installedChunks, installChunk, __webpack_modules__ = {
|
|
|
5176
5176
|
"node:path" (module) {
|
|
5177
5177
|
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
5178
5178
|
},
|
|
5179
|
+
"node:process" (module) {
|
|
5180
|
+
module.exports = __rspack_external_node_process_786449bf;
|
|
5181
|
+
},
|
|
5179
5182
|
"node:util" (module) {
|
|
5180
5183
|
module.exports = __rspack_external_node_util_1b29d436;
|
|
5181
5184
|
},
|
|
@@ -6357,13 +6360,13 @@ async function openBrowser(url, needEncodeURI = !0) {
|
|
|
6357
6360
|
cwd: (0, external_node_path_.join)(openBrowser_dirname, '../static')
|
|
6358
6361
|
}), !0;
|
|
6359
6362
|
logger.debug('Failed to find the target browser.');
|
|
6360
|
-
let { default: open } = await __webpack_require__.e("
|
|
6363
|
+
let { default: open } = await __webpack_require__.e("604").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js"));
|
|
6361
6364
|
return await open(url), !0;
|
|
6362
6365
|
} catch (err) {
|
|
6363
6366
|
logger.debug("Failed to open Rsdoctor URL with apple script."), logger.debug(err);
|
|
6364
6367
|
}
|
|
6365
6368
|
else try {
|
|
6366
|
-
let { default: open } = await __webpack_require__.e("
|
|
6369
|
+
let { default: open } = await __webpack_require__.e("604").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js"));
|
|
6367
6370
|
return await open(url), !0;
|
|
6368
6371
|
} catch (err) {
|
|
6369
6372
|
return logger.error('Failed to open Rsdoctor URL.'), logger.error(err), !1;
|
|
@@ -6548,6 +6551,7 @@ class RsdoctorFakeServer extends RsdoctorServer {
|
|
|
6548
6551
|
}
|
|
6549
6552
|
async openClientPage() {}
|
|
6550
6553
|
}
|
|
6554
|
+
var external_node_process_ = __webpack_require__("node:process");
|
|
6551
6555
|
function findRoot(startDir = process.cwd()) {
|
|
6552
6556
|
let dir = startDir, firstPkgDir = null;
|
|
6553
6557
|
for(; dir !== external_path_.default.parse(dir).root;){
|
|
@@ -6567,7 +6571,7 @@ class SDKCore {
|
|
|
6567
6571
|
])
|
|
6568
6572
|
}, this._envinfo = {}, this._clientRoutes = new Set([
|
|
6569
6573
|
Manifest.RsdoctorManifestClientRoutes.Overall
|
|
6570
|
-
]), this.diskManifestPath = '', this._name = name, this.root = root, this.pid =
|
|
6574
|
+
]), this.diskManifestPath = '', this._name = name, this.root = root, this.pid = external_node_process_.default.pid, this._outputDir = external_node_path_.default.join(this.outputDir || this.root, Constants.RsdoctorOutputFolder);
|
|
6571
6575
|
}
|
|
6572
6576
|
get outputDir() {
|
|
6573
6577
|
return this._outputDir;
|
|
@@ -6625,7 +6629,7 @@ class SDKCore {
|
|
|
6625
6629
|
}), this.onDataReport();
|
|
6626
6630
|
}
|
|
6627
6631
|
async writePieces(storeData, _options) {
|
|
6628
|
-
let { outputDir } = this, manifest =
|
|
6632
|
+
let { outputDir } = this, manifest = external_node_path_.default.resolve(outputDir, Constants.RsdoctorOutputManifest);
|
|
6629
6633
|
this.diskManifestPath = manifest, await File.fse.ensureDir(outputDir);
|
|
6630
6634
|
let urlsPromiseList = [];
|
|
6631
6635
|
for (let key of Object.keys(storeData)){
|
|
@@ -6661,8 +6665,8 @@ class SDKCore {
|
|
|
6661
6665
|
async writeManifest() {
|
|
6662
6666
|
let { cloudData: data, diskManifestPath } = this, dataStr = JSON.stringify(data, null, 2);
|
|
6663
6667
|
logger.debug(`SDKCore.writeManifest extraConfig: ${this.extraConfig}`, '[SDKCore.writeManifest]');
|
|
6664
|
-
let dir =
|
|
6665
|
-
return await File.fse.outputFile(tmpPath, dataStr),
|
|
6668
|
+
let dir = external_node_path_.default.dirname(diskManifestPath), base = external_node_path_.default.basename(diskManifestPath), tmpPath = external_node_path_.default.join(dir, `${base}.${Date.now()}.${randomUUID()}.tmp`);
|
|
6669
|
+
return await File.fse.outputFile(tmpPath, dataStr), external_node_fs_.default.renameSync(tmpPath, diskManifestPath), diskManifestPath;
|
|
6666
6670
|
}
|
|
6667
6671
|
async saveManifest(data, options) {
|
|
6668
6672
|
await this.writePieces(data, options);
|
|
@@ -6673,11 +6677,11 @@ class SDKCore {
|
|
|
6673
6677
|
}), manifestDiskPath;
|
|
6674
6678
|
}
|
|
6675
6679
|
writeToFolder(jsonStr, dir, key, index) {
|
|
6676
|
-
let sharding = new File.FileSharding(Algorithm.compressText(jsonStr)), folder =
|
|
6680
|
+
let sharding = new File.FileSharding(Algorithm.compressText(jsonStr)), folder = external_node_path_.default.resolve(dir, key);
|
|
6677
6681
|
return sharding.writeStringToFolder(folder, '', index).then((item)=>({
|
|
6678
6682
|
name: key,
|
|
6679
6683
|
files: item.map((el)=>({
|
|
6680
|
-
path:
|
|
6684
|
+
path: external_node_path_.default.resolve(folder, el.filename),
|
|
6681
6685
|
basename: el.filename,
|
|
6682
6686
|
content: el.content
|
|
6683
6687
|
}))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.14",
|
|
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/client": "1.3.
|
|
30
|
-
"@rsdoctor/graph": "1.3.
|
|
31
|
-
"@rsdoctor/types": "1.3.
|
|
32
|
-
"@rsdoctor/utils": "1.3.
|
|
29
|
+
"@rsdoctor/client": "1.3.14",
|
|
30
|
+
"@rsdoctor/graph": "1.3.14",
|
|
31
|
+
"@rsdoctor/types": "1.3.14",
|
|
32
|
+
"@rsdoctor/utils": "1.3.14"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/body-parser": "1.19.6",
|