@rsdoctor/utils 1.1.0-alpha.0 → 1.1.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/dist/cjs/common/data/index.js +9 -1
- package/dist/cjs/common/global-config.js +90 -0
- package/dist/cjs/common/index.js +3 -0
- package/dist/cjs/error/error.js +9 -9
- package/dist/cjs/logger.js +2 -2
- package/dist/esm/common/data/index.js +9 -1
- package/dist/esm/common/global-config.js +54 -0
- package/dist/esm/common/index.js +2 -0
- package/dist/esm/error/error.js +9 -9
- package/dist/esm/logger.js +2 -2
- package/dist/type/common/data/index.d.ts.map +1 -1
- package/dist/type/common/global-config.d.ts +28 -0
- package/dist/type/common/global-config.d.ts.map +1 -0
- package/dist/type/common/index.d.ts +1 -0
- package/dist/type/common/index.d.ts.map +1 -1
- package/dist/type/error/error.d.ts.map +1 -1
- package/dist/type/logger.d.ts +2 -2
- package/dist/type/logger.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -382,7 +382,12 @@ class APIDataLoader {
|
|
|
382
382
|
case import_types.SDK.ServerAPI.API.GetModuleIssuerPath:
|
|
383
383
|
return this.loader.loadData("moduleGraph").then((moduleGraph) => {
|
|
384
384
|
const { moduleId } = body;
|
|
385
|
-
|
|
385
|
+
const modules = moduleGraph?.modules || [];
|
|
386
|
+
const issuerPath = modules.find((m) => String(m.id) === moduleId)?.issuerPath || [];
|
|
387
|
+
if (Array.isArray(issuerPath) && issuerPath.length > 0 && typeof issuerPath[0] === "number") {
|
|
388
|
+
return issuerPath.map((id) => modules.find((m) => m.id === id)?.path).filter(Boolean);
|
|
389
|
+
}
|
|
390
|
+
return issuerPath;
|
|
386
391
|
});
|
|
387
392
|
case import_types.SDK.ServerAPI.API.GetPackageInfo:
|
|
388
393
|
return this.loader.loadData("packageGraph").then((packageGraph) => {
|
|
@@ -409,6 +414,9 @@ class APIDataLoader {
|
|
|
409
414
|
const chunkInfo = chunks.find(
|
|
410
415
|
(c) => c.id === chunkId
|
|
411
416
|
);
|
|
417
|
+
if (!chunkInfo) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
412
420
|
const chunkModules = modules.filter((m) => chunkInfo.modules.includes(m.id)).map((module2) => {
|
|
413
421
|
return {
|
|
414
422
|
id: module2.id,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var global_config_exports = {};
|
|
30
|
+
__export(global_config_exports, {
|
|
31
|
+
findRepoRoot: () => findRepoRoot,
|
|
32
|
+
getMcpConfigPath: () => getMcpConfigPath,
|
|
33
|
+
writeMcpPort: () => writeMcpPort
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(global_config_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_path = __toESM(require("path"));
|
|
38
|
+
var import_os = __toESM(require("os"));
|
|
39
|
+
function findRepoRoot(startPath) {
|
|
40
|
+
let dir = import_path.default.resolve(startPath ?? process.cwd());
|
|
41
|
+
while (dir !== import_path.default.dirname(dir)) {
|
|
42
|
+
if (import_fs.default.existsSync(import_path.default.join(dir, "lerna.json")))
|
|
43
|
+
return dir;
|
|
44
|
+
if (import_fs.default.existsSync(import_path.default.join(dir, "pnpm-workspace.yaml")))
|
|
45
|
+
return dir;
|
|
46
|
+
const pkgPath = import_path.default.join(dir, "package.json");
|
|
47
|
+
if (import_fs.default.existsSync(pkgPath)) {
|
|
48
|
+
const pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf8"));
|
|
49
|
+
if (pkg.workspaces)
|
|
50
|
+
return dir;
|
|
51
|
+
}
|
|
52
|
+
if (import_fs.default.existsSync(import_path.default.join(dir, "yarn.lock")) || import_fs.default.existsSync(import_path.default.join(dir, "pnpm-lock.yaml")) || import_fs.default.existsSync(import_path.default.join(dir, "package-lock.json"))) {
|
|
53
|
+
return dir;
|
|
54
|
+
}
|
|
55
|
+
dir = import_path.default.dirname(dir);
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function writeMcpPort(port, builderName) {
|
|
60
|
+
const homeDir = import_os.default.homedir();
|
|
61
|
+
const rsdoctorDir = import_path.default.join(homeDir, ".cache/rsdoctor");
|
|
62
|
+
const mcpPortFilePath = import_path.default.join(rsdoctorDir, "mcp.json");
|
|
63
|
+
if (!import_fs.default.existsSync(rsdoctorDir)) {
|
|
64
|
+
import_fs.default.mkdirSync(rsdoctorDir, { recursive: true });
|
|
65
|
+
}
|
|
66
|
+
let mcpJson = {
|
|
67
|
+
portList: {},
|
|
68
|
+
port: 0
|
|
69
|
+
};
|
|
70
|
+
if (import_fs.default.existsSync(mcpPortFilePath)) {
|
|
71
|
+
mcpJson = JSON.parse(import_fs.default.readFileSync(mcpPortFilePath, "utf8"));
|
|
72
|
+
}
|
|
73
|
+
if (!mcpJson.portList)
|
|
74
|
+
mcpJson.portList = {};
|
|
75
|
+
mcpJson.portList[builderName || "builder"] = port;
|
|
76
|
+
mcpJson.port = port;
|
|
77
|
+
import_fs.default.writeFileSync(mcpPortFilePath, JSON.stringify(mcpJson, null, 2), "utf8");
|
|
78
|
+
}
|
|
79
|
+
function getMcpConfigPath() {
|
|
80
|
+
const homeDir = import_os.default.homedir();
|
|
81
|
+
const rsdoctorDir = import_path.default.join(homeDir, ".cache/rsdoctor");
|
|
82
|
+
const mcpPortFilePath = import_path.default.join(rsdoctorDir, "mcp.json");
|
|
83
|
+
return mcpPortFilePath;
|
|
84
|
+
}
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
findRepoRoot,
|
|
88
|
+
getMcpConfigPath,
|
|
89
|
+
writeMcpPort
|
|
90
|
+
});
|
package/dist/cjs/common/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(common_exports, {
|
|
|
33
33
|
Bundle: () => Bundle,
|
|
34
34
|
Crypto: () => Crypto,
|
|
35
35
|
Data: () => Data,
|
|
36
|
+
GlobalConfig: () => GlobalConfig,
|
|
36
37
|
Graph: () => Graph,
|
|
37
38
|
Loader: () => Loader,
|
|
38
39
|
Lodash: () => Lodash,
|
|
@@ -62,6 +63,7 @@ var Alerts = __toESM(require("./alerts"));
|
|
|
62
63
|
var Rspack = __toESM(require("./rspack"));
|
|
63
64
|
var Package = __toESM(require("./package"));
|
|
64
65
|
var Lodash = __toESM(require("./lodash"));
|
|
66
|
+
var GlobalConfig = __toESM(require("./global-config"));
|
|
65
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
66
68
|
0 && (module.exports = {
|
|
67
69
|
Alerts,
|
|
@@ -69,6 +71,7 @@ var Lodash = __toESM(require("./lodash"));
|
|
|
69
71
|
Bundle,
|
|
70
72
|
Crypto,
|
|
71
73
|
Data,
|
|
74
|
+
GlobalConfig,
|
|
72
75
|
Graph,
|
|
73
76
|
Loader,
|
|
74
77
|
Lodash,
|
package/dist/cjs/error/error.js
CHANGED
|
@@ -33,7 +33,7 @@ __export(error_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(error_exports);
|
|
34
34
|
var import_code_frame = require("@babel/code-frame");
|
|
35
35
|
var import_types = require("@rsdoctor/types");
|
|
36
|
-
var
|
|
36
|
+
var import_picocolors = require("picocolors");
|
|
37
37
|
var import_deep_eql = __toESM(require("deep-eql"));
|
|
38
38
|
var import_strip_ansi = __toESM(require("strip-ansi"));
|
|
39
39
|
var import_transform = require("./transform");
|
|
@@ -164,13 +164,13 @@ class DevToolError extends Error {
|
|
|
164
164
|
referenceUrl,
|
|
165
165
|
_controller: controller
|
|
166
166
|
} = this;
|
|
167
|
-
const print =
|
|
167
|
+
const print = (0, import_picocolors.createColors)(!controller.noColor);
|
|
168
168
|
const mainColorPrint = this._level === import_types.Err.ErrorLevel.Error ? print.red : print.yellow;
|
|
169
|
-
const codeText = code ? `${mainColorPrint.blue(code)}:` : "";
|
|
169
|
+
const codeText = code ? `${mainColorPrint(print.blue(code))}:` : "";
|
|
170
170
|
msgs.push(
|
|
171
|
-
mainColorPrint
|
|
172
|
-
`[${codeText}${this.level}:${title.toUpperCase()}] `
|
|
173
|
-
)
|
|
171
|
+
mainColorPrint(
|
|
172
|
+
print.bold(`[${codeText}${this.level}:${title.toUpperCase()}] `) + message
|
|
173
|
+
)
|
|
174
174
|
);
|
|
175
175
|
msgs.push(...this.printCodeFrame(print));
|
|
176
176
|
if (hint || referenceUrl) {
|
|
@@ -180,12 +180,12 @@ class DevToolError extends Error {
|
|
|
180
180
|
msgs.push(` ${print.blue(`HINT: ${hint}`)}`);
|
|
181
181
|
}
|
|
182
182
|
if (referenceUrl) {
|
|
183
|
-
msgs.push(print.magenta.bold(` See: ${referenceUrl}`));
|
|
183
|
+
msgs.push(print.magenta(print.bold(` See: ${referenceUrl}`)));
|
|
184
184
|
}
|
|
185
185
|
if (!controller.noStack && this.stack) {
|
|
186
|
-
msgs.push(print.red.bold(` Error Stack:
|
|
186
|
+
msgs.push(print.red(print.bold(` Error Stack:
|
|
187
187
|
${this.stack}
|
|
188
|
-
`));
|
|
188
|
+
`)));
|
|
189
189
|
}
|
|
190
190
|
return msgs.join("\n");
|
|
191
191
|
}
|
package/dist/cjs/logger.js
CHANGED
|
@@ -28,12 +28,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var logger_exports = {};
|
|
30
30
|
__export(logger_exports, {
|
|
31
|
-
chalk: () =>
|
|
31
|
+
chalk: () => import_picocolors.default,
|
|
32
32
|
debug: () => debug,
|
|
33
33
|
logger: () => import_rslog.logger
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(logger_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_picocolors = __toESM(require("picocolors"));
|
|
37
37
|
var import_rslog = require("rslog");
|
|
38
38
|
var import_types = require("@rsdoctor/types");
|
|
39
39
|
function debug(getMsg, prefix = "") {
|
|
@@ -349,7 +349,12 @@ class APIDataLoader {
|
|
|
349
349
|
case SDK.ServerAPI.API.GetModuleIssuerPath:
|
|
350
350
|
return this.loader.loadData("moduleGraph").then((moduleGraph) => {
|
|
351
351
|
const { moduleId } = body;
|
|
352
|
-
|
|
352
|
+
const modules = moduleGraph?.modules || [];
|
|
353
|
+
const issuerPath = modules.find((m) => String(m.id) === moduleId)?.issuerPath || [];
|
|
354
|
+
if (Array.isArray(issuerPath) && issuerPath.length > 0 && typeof issuerPath[0] === "number") {
|
|
355
|
+
return issuerPath.map((id) => modules.find((m) => m.id === id)?.path).filter(Boolean);
|
|
356
|
+
}
|
|
357
|
+
return issuerPath;
|
|
353
358
|
});
|
|
354
359
|
case SDK.ServerAPI.API.GetPackageInfo:
|
|
355
360
|
return this.loader.loadData("packageGraph").then((packageGraph) => {
|
|
@@ -376,6 +381,9 @@ class APIDataLoader {
|
|
|
376
381
|
const chunkInfo = chunks.find(
|
|
377
382
|
(c) => c.id === chunkId
|
|
378
383
|
);
|
|
384
|
+
if (!chunkInfo) {
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
379
387
|
const chunkModules = modules.filter((m) => chunkInfo.modules.includes(m.id)).map((module) => {
|
|
380
388
|
return {
|
|
381
389
|
id: module.id,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import os from "os";
|
|
4
|
+
function findRepoRoot(startPath) {
|
|
5
|
+
let dir = path.resolve(startPath ?? process.cwd());
|
|
6
|
+
while (dir !== path.dirname(dir)) {
|
|
7
|
+
if (fs.existsSync(path.join(dir, "lerna.json")))
|
|
8
|
+
return dir;
|
|
9
|
+
if (fs.existsSync(path.join(dir, "pnpm-workspace.yaml")))
|
|
10
|
+
return dir;
|
|
11
|
+
const pkgPath = path.join(dir, "package.json");
|
|
12
|
+
if (fs.existsSync(pkgPath)) {
|
|
13
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
14
|
+
if (pkg.workspaces)
|
|
15
|
+
return dir;
|
|
16
|
+
}
|
|
17
|
+
if (fs.existsSync(path.join(dir, "yarn.lock")) || fs.existsSync(path.join(dir, "pnpm-lock.yaml")) || fs.existsSync(path.join(dir, "package-lock.json"))) {
|
|
18
|
+
return dir;
|
|
19
|
+
}
|
|
20
|
+
dir = path.dirname(dir);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
function writeMcpPort(port, builderName) {
|
|
25
|
+
const homeDir = os.homedir();
|
|
26
|
+
const rsdoctorDir = path.join(homeDir, ".cache/rsdoctor");
|
|
27
|
+
const mcpPortFilePath = path.join(rsdoctorDir, "mcp.json");
|
|
28
|
+
if (!fs.existsSync(rsdoctorDir)) {
|
|
29
|
+
fs.mkdirSync(rsdoctorDir, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
let mcpJson = {
|
|
32
|
+
portList: {},
|
|
33
|
+
port: 0
|
|
34
|
+
};
|
|
35
|
+
if (fs.existsSync(mcpPortFilePath)) {
|
|
36
|
+
mcpJson = JSON.parse(fs.readFileSync(mcpPortFilePath, "utf8"));
|
|
37
|
+
}
|
|
38
|
+
if (!mcpJson.portList)
|
|
39
|
+
mcpJson.portList = {};
|
|
40
|
+
mcpJson.portList[builderName || "builder"] = port;
|
|
41
|
+
mcpJson.port = port;
|
|
42
|
+
fs.writeFileSync(mcpPortFilePath, JSON.stringify(mcpJson, null, 2), "utf8");
|
|
43
|
+
}
|
|
44
|
+
function getMcpConfigPath() {
|
|
45
|
+
const homeDir = os.homedir();
|
|
46
|
+
const rsdoctorDir = path.join(homeDir, ".cache/rsdoctor");
|
|
47
|
+
const mcpPortFilePath = path.join(rsdoctorDir, "mcp.json");
|
|
48
|
+
return mcpPortFilePath;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
findRepoRoot,
|
|
52
|
+
getMcpConfigPath,
|
|
53
|
+
writeMcpPort
|
|
54
|
+
};
|
package/dist/esm/common/index.js
CHANGED
|
@@ -14,12 +14,14 @@ import * as Alerts from "./alerts";
|
|
|
14
14
|
import * as Rspack from "./rspack";
|
|
15
15
|
import * as Package from "./package";
|
|
16
16
|
import * as Lodash from "./lodash";
|
|
17
|
+
import * as GlobalConfig from "./global-config";
|
|
17
18
|
export {
|
|
18
19
|
Alerts,
|
|
19
20
|
Algorithm,
|
|
20
21
|
Bundle,
|
|
21
22
|
Crypto,
|
|
22
23
|
Data,
|
|
24
|
+
GlobalConfig,
|
|
23
25
|
Graph,
|
|
24
26
|
Loader,
|
|
25
27
|
Lodash,
|
package/dist/esm/error/error.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { codeFrameColumns } from "@babel/code-frame";
|
|
2
2
|
import { Err } from "@rsdoctor/types";
|
|
3
|
-
import {
|
|
3
|
+
import { createColors } from "picocolors";
|
|
4
4
|
import deepEql from "deep-eql";
|
|
5
5
|
import stripAnsi from "strip-ansi";
|
|
6
6
|
import { transform } from "./transform";
|
|
@@ -131,13 +131,13 @@ class DevToolError extends Error {
|
|
|
131
131
|
referenceUrl,
|
|
132
132
|
_controller: controller
|
|
133
133
|
} = this;
|
|
134
|
-
const print = controller.noColor
|
|
134
|
+
const print = createColors(!controller.noColor);
|
|
135
135
|
const mainColorPrint = this._level === Err.ErrorLevel.Error ? print.red : print.yellow;
|
|
136
|
-
const codeText = code ? `${mainColorPrint.blue(code)}:` : "";
|
|
136
|
+
const codeText = code ? `${mainColorPrint(print.blue(code))}:` : "";
|
|
137
137
|
msgs.push(
|
|
138
|
-
mainColorPrint
|
|
139
|
-
`[${codeText}${this.level}:${title.toUpperCase()}] `
|
|
140
|
-
)
|
|
138
|
+
mainColorPrint(
|
|
139
|
+
print.bold(`[${codeText}${this.level}:${title.toUpperCase()}] `) + message
|
|
140
|
+
)
|
|
141
141
|
);
|
|
142
142
|
msgs.push(...this.printCodeFrame(print));
|
|
143
143
|
if (hint || referenceUrl) {
|
|
@@ -147,12 +147,12 @@ class DevToolError extends Error {
|
|
|
147
147
|
msgs.push(` ${print.blue(`HINT: ${hint}`)}`);
|
|
148
148
|
}
|
|
149
149
|
if (referenceUrl) {
|
|
150
|
-
msgs.push(print.magenta.bold(` See: ${referenceUrl}`));
|
|
150
|
+
msgs.push(print.magenta(print.bold(` See: ${referenceUrl}`)));
|
|
151
151
|
}
|
|
152
152
|
if (!controller.noStack && this.stack) {
|
|
153
|
-
msgs.push(print.red.bold(` Error Stack:
|
|
153
|
+
msgs.push(print.red(print.bold(` Error Stack:
|
|
154
154
|
${this.stack}
|
|
155
|
-
`));
|
|
155
|
+
`)));
|
|
156
156
|
}
|
|
157
157
|
return msgs.join("\n");
|
|
158
158
|
}
|
package/dist/esm/logger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c from "picocolors";
|
|
2
2
|
import { logger } from "rslog";
|
|
3
3
|
import { Constants } from "@rsdoctor/types";
|
|
4
4
|
function debug(getMsg, prefix = "") {
|
|
@@ -37,7 +37,7 @@ logger.override({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
chalk,
|
|
40
|
+
c as chalk,
|
|
41
41
|
debug,
|
|
42
42
|
logger
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,GAAG,EAAE,QAAQ,EAAa,MAAM,iBAAiB,CAAC;AASjE;;GAEG;AACH,qBAAa,aAAa;IACZ,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB;gBAAnC,MAAM,EAAE,QAAQ,CAAC,kBAAkB;IAIlD,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAItB,OAAO,CACZ,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,GAAG,EAC3B,CAAC,SACC,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAC/E,CAAC,SACC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAEzE,GAAG,IAAI,EAAE,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GACrD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,GAAG,EAAE,QAAQ,EAAa,MAAM,iBAAiB,CAAC;AASjE;;GAEG;AACH,qBAAa,aAAa;IACZ,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB;gBAAnC,MAAM,EAAE,QAAQ,CAAC,kBAAkB;IAIlD,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAItB,OAAO,CACZ,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,GAAG,EAC3B,CAAC,SACC,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAC/E,CAAC,SACC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAEzE,GAAG,IAAI,EAAE,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GACrD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;CAwf/C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the root directory of a monorepo or single repository
|
|
3
|
+
* @param {string} startPath - The starting path (usually a subpackage or any folder)
|
|
4
|
+
* @returns {string|null} The root directory path, or null if not found
|
|
5
|
+
*/
|
|
6
|
+
export declare function findRepoRoot(startPath?: string): string | null;
|
|
7
|
+
/**
|
|
8
|
+
* @description Writes the builder port information to mcp.json.
|
|
9
|
+
*
|
|
10
|
+
* The mcp.json file uses the following format:
|
|
11
|
+
* {
|
|
12
|
+
* portList: {
|
|
13
|
+
* builder1: portNumber,
|
|
14
|
+
* builder2: portNumber,
|
|
15
|
+
* },
|
|
16
|
+
* port: portNumber // The port of the last builder is used by default
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* @param {number} port - The port number to write.
|
|
20
|
+
* @param {string} [builderName] - The name of the builder.
|
|
21
|
+
*/
|
|
22
|
+
export declare function writeMcpPort(port: number, builderName?: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* @description Gets the path to the mcp.json file.
|
|
25
|
+
* @returns {string} The path to the mcp.json file.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getMcpConfigPath(): string;
|
|
28
|
+
//# sourceMappingURL=global-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-config.d.ts","sourceRoot":"","sources":["../../../src/common/global-config.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,iBAyB9C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,QAwB9D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,WAK/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAA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AG,EAAE,GAAG,CAAC,gBAAgB;IAO7C,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,eAAe;IAIrC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,oBAAoB;CAYvC"}
|
package/dist/type/logger.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c from 'picocolors';
|
|
2
2
|
import { logger } from 'rslog';
|
|
3
3
|
/**
|
|
4
4
|
* log debug message
|
|
5
5
|
*/
|
|
6
6
|
export declare function debug(getMsg: () => string, prefix?: string): void;
|
|
7
|
-
export { chalk, logger };
|
|
7
|
+
export { c as chalk, logger };
|
|
8
8
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,YAAY,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,SAAK,QAOtD;AAED,OAAO,EAAE,CAAC,IAAI,KAAK,EAAE,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"acorn": "^8.10.0",
|
|
73
73
|
"acorn-import-attributes": "^1.9.5",
|
|
74
74
|
"acorn-walk": "8.3.4",
|
|
75
|
-
"
|
|
75
|
+
"picocolors": "^1.1.1",
|
|
76
76
|
"connect": "3.7.0",
|
|
77
77
|
"deep-eql": "4.1.4",
|
|
78
78
|
"envinfo": "7.14.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lines-and-columns": "2.0.4",
|
|
84
84
|
"rslog": "^1.2.3",
|
|
85
85
|
"strip-ansi": "^6.0.1",
|
|
86
|
-
"@rsdoctor/types": "1.1.
|
|
86
|
+
"@rsdoctor/types": "1.1.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@types/babel__code-frame": "7.0.6",
|