@rsdoctor/cli 1.2.2 → 1.2.4-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/dist/commands/analyze.d.ts +0 -1
- package/dist/commands/analyze.js +0 -3
- package/dist/commands/bundle-diff.d.ts +5 -3
- package/dist/commands/index.d.ts +0 -1
- package/dist/commands/stats-analyze.d.ts +0 -1
- package/dist/commands/stats-analyze.js +3 -3
- package/dist/constants.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +3 -2
- package/package.json +8 -11
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/bundle-diff.d.ts.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/stats-analyze.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils.d.ts.map +0 -1
package/dist/commands/analyze.js
CHANGED
|
@@ -63,9 +63,6 @@ example: ${bin} ${external_constants_js_namespaceObject.Commands.Analyze} --prof
|
|
|
63
63
|
}).option('port', {
|
|
64
64
|
type: 'number',
|
|
65
65
|
description: 'port for Rsdoctor Server'
|
|
66
|
-
}).option('type', {
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: 'if need lite bundle mode'
|
|
69
66
|
});
|
|
70
67
|
},
|
|
71
68
|
async action ({ profile, open = true, port, type = types_namespaceObject.SDK.ToDataType.Normal }) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Command } from '../types';
|
|
2
2
|
import { Commands } from '../constants';
|
|
3
|
-
import {
|
|
3
|
+
import { RsdoctorSDK } from '@rsdoctor/sdk';
|
|
4
4
|
interface Options {
|
|
5
5
|
current: string;
|
|
6
6
|
baseline: string;
|
|
7
7
|
open?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare const bundleDiff: Command<Commands.BundleDiff, Options,
|
|
9
|
+
export declare const bundleDiff: Command<Commands.BundleDiff, Options, RsdoctorSDK<{
|
|
10
|
+
name: string;
|
|
11
|
+
root: string;
|
|
12
|
+
}>>;
|
|
10
13
|
export {};
|
|
11
|
-
//# sourceMappingURL=bundle-diff.d.ts.map
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ const external_ora_namespaceObject = require("ora");
|
|
|
42
42
|
var external_ora_default = /*#__PURE__*/ __webpack_require__.n(external_ora_namespaceObject);
|
|
43
43
|
const external_constants_js_namespaceObject = require("../constants.js");
|
|
44
44
|
const external_utils_js_namespaceObject = require("../utils.js");
|
|
45
|
-
const
|
|
45
|
+
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
46
46
|
const statsAnalyze = (0, external_utils_js_namespaceObject.enhanceCommand)(({ cwd, name, bin })=>({
|
|
47
47
|
command: external_constants_js_namespaceObject.Commands.StatsAnalyze,
|
|
48
48
|
description: `use ${name} to open "${types_namespaceObject.Constants.RsdoctorOutputManifestPath}" in browser for analysis.example: ${bin} ${external_constants_js_namespaceObject.Commands.StatsAnalyze} --profile "${types_namespaceObject.Constants.StatsFilePath}"`.trim(),
|
|
@@ -53,7 +53,7 @@ const statsAnalyze = (0, external_utils_js_namespaceObject.enhanceCommand)(({ cw
|
|
|
53
53
|
demandOption: true
|
|
54
54
|
}).option('port', {
|
|
55
55
|
type: 'number',
|
|
56
|
-
description: 'port for
|
|
56
|
+
description: 'port for Rsdoctor Server'
|
|
57
57
|
}).option('type', {
|
|
58
58
|
type: 'string',
|
|
59
59
|
description: 'Bundle analysis mode (normal or lite)'
|
|
@@ -66,7 +66,7 @@ const statsAnalyze = (0, external_utils_js_namespaceObject.enhanceCommand)(({ cw
|
|
|
66
66
|
const statsStrings = await (0, external_utils_js_namespaceObject.readFile)(profile, cwd);
|
|
67
67
|
const json = JSON.parse(statsStrings);
|
|
68
68
|
spinner.text = "start server";
|
|
69
|
-
const { chunkGraph, moduleGraph } = await
|
|
69
|
+
const { chunkGraph, moduleGraph } = await graph_namespaceObject.TransUtils.transStats(json);
|
|
70
70
|
const sdk = new sdk_namespaceObject.RsdoctorSDK({
|
|
71
71
|
name: 'stats-analyze',
|
|
72
72
|
root: process.cwd(),
|
package/dist/constants.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ import { Commands } from './constants';
|
|
|
4
4
|
export declare function execute<T extends GetCommandArgumentsType<typeof analyze>>(command: Commands.Analyze | `${Commands.Analyze}`, options: T['options']): Promise<T['result']>;
|
|
5
5
|
export declare function execute<T extends GetCommandArgumentsType<typeof bundleDiff>>(command: Commands.BundleDiff | `${Commands.BundleDiff}`, options: T['options']): Promise<T['result']>;
|
|
6
6
|
export declare function execute(): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/types.d.ts
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export declare function readFile(url: string, cwd: string): Promise<string>;
|
|
|
7
7
|
export declare function loadJSON<T extends Common.PlainObject>(uri: string, cwd: string): Promise<T>;
|
|
8
8
|
export declare function loadShardingFile(uri: string, cwd: string): Promise<string>;
|
|
9
9
|
export declare function loadShardingFileWithSpinner(uri: string, cwd: string, spinner: Ora): Promise<string>;
|
|
10
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
CHANGED
|
@@ -44,8 +44,9 @@ const external_axios_namespaceObject = require("axios");
|
|
|
44
44
|
var external_axios_default = /*#__PURE__*/ __webpack_require__.n(external_axios_namespaceObject);
|
|
45
45
|
const external_path_namespaceObject = require("path");
|
|
46
46
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
47
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
48
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
47
49
|
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
48
|
-
const build_namespaceObject = require("@rsdoctor/utils/build");
|
|
49
50
|
function enhanceCommand(fn) {
|
|
50
51
|
return (ctx)=>{
|
|
51
52
|
const res = fn(ctx);
|
|
@@ -64,7 +65,7 @@ async function fetchText(url) {
|
|
|
64
65
|
}
|
|
65
66
|
async function readFile(url, cwd) {
|
|
66
67
|
const file = external_path_default().resolve(cwd, url);
|
|
67
|
-
return
|
|
68
|
+
return external_node_fs_default().readFileSync(file, 'utf-8');
|
|
68
69
|
}
|
|
69
70
|
async function loadJSON(uri, cwd) {
|
|
70
71
|
if (common_namespaceObject.Url.isUrl(uri)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4-beta.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -15,24 +15,21 @@
|
|
|
15
15
|
],
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"main": "dist/index.js",
|
|
18
|
-
"module": "dist/index.js",
|
|
19
18
|
"types": "dist/index.d.ts",
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@rslib/core": "^0.11.0",
|
|
22
20
|
"@types/yargs": "17.0.33",
|
|
23
|
-
"typescript": "^5.
|
|
21
|
+
"typescript": "^5.9.2"
|
|
24
22
|
},
|
|
25
23
|
"dependencies": {
|
|
26
|
-
"axios": "^1.
|
|
24
|
+
"axios": "^1.12.0",
|
|
27
25
|
"ora": "^5.4.1",
|
|
28
26
|
"picocolors": "^1.1.1",
|
|
29
|
-
"tslib": "2.8.1",
|
|
30
27
|
"yargs": "17.7.2",
|
|
31
|
-
"@rsdoctor/
|
|
32
|
-
"@rsdoctor/
|
|
33
|
-
"@rsdoctor/
|
|
34
|
-
"@rsdoctor/
|
|
35
|
-
"@rsdoctor/sdk": "1.2.
|
|
28
|
+
"@rsdoctor/types": "1.2.4-beta.0",
|
|
29
|
+
"@rsdoctor/utils": "1.2.4-beta.0",
|
|
30
|
+
"@rsdoctor/core": "1.2.4-beta.0",
|
|
31
|
+
"@rsdoctor/graph": "1.2.4-beta.0",
|
|
32
|
+
"@rsdoctor/sdk": "1.2.4-beta.0"
|
|
36
33
|
},
|
|
37
34
|
"publishConfig": {
|
|
38
35
|
"access": "public",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AACA,OAAO,EAAuC,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAyF/D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-diff.d.ts","sourceRoot":"","sources":["../../src/commands/bundle-diff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAoC,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAIxE,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,OAAO,CAC9B,QAAQ,CAAC,UAAU,EACnB,OAAO,EACP,GAAG,CAAC,mBAAmB,CAyJtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stats-analyze.d.ts","sourceRoot":"","sources":["../../src/commands/stats-analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAuC,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKnC,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAChC,QAAQ,CAAC,YAAY,EACrB,OAAO,EACP,WAAW,CA2DV,CAAC"}
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,UAAU,gBAAgB;IAC1B,YAAY,kBAAkB;CAC/B;AAED,eAAO,MAAM,GAAG,EAAE;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACA,CAAC;AAE/B,eAAO,MAAM,GAAG,QAA0B,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAY,MAAM,aAAa,CAAC;AAIjD,wBAAsB,OAAO,CAC3B,CAAC,SAAS,uBAAuB,CAAC,OAAO,OAAO,CAAC,EAEjD,OAAO,EAAE,QAAQ,CAAC,OAAO,GAAG,GAAG,QAAQ,CAAC,OAAO,EAAE,EACjD,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,GACpB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExB,wBAAsB,OAAO,CAC3B,CAAC,SAAS,uBAAuB,CAAC,OAAO,UAAU,CAAC,EAEpD,OAAO,EAAE,QAAQ,CAAC,UAAU,GAAG,GAAG,QAAQ,CAAC,UAAU,EAAE,EACvD,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,GACpB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExB,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,MAAM,WAAW,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAC1E,CAAC,GAAG,EAAE,cAAc,GAAG,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAA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