@rsdoctor/cli 1.2.3 → 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.
@@ -10,4 +10,3 @@ interface Options {
10
10
  }
11
11
  export declare const analyze: Command<Commands.Analyze, Options, RsdoctorSDK>;
12
12
  export {};
13
- //# sourceMappingURL=analyze.d.ts.map
@@ -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 { SDK } from '@rsdoctor/types';
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, SDK.RsdoctorSdkInstance>;
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
@@ -1,3 +1,2 @@
1
1
  export * from './analyze';
2
2
  export * from './bundle-diff';
3
- //# sourceMappingURL=index.d.ts.map
@@ -10,4 +10,3 @@ interface Options {
10
10
  }
11
11
  export declare const statsAnalyze: Command<Commands.StatsAnalyze, Options, RsdoctorSDK>;
12
12
  export {};
13
- //# sourceMappingURL=stats-analyze.d.ts.map
@@ -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 common_utils_namespaceObject = require("@rsdoctor/core/common-utils");
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 Web Doctor Server'
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 common_utils_namespaceObject.TransUtils.transStats(json);
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(),
@@ -9,4 +9,3 @@ export declare const pkg: {
9
9
  bin: Record<string, string>;
10
10
  };
11
11
  export declare const bin: string;
12
- //# sourceMappingURL=constants.d.ts.map
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
@@ -19,4 +19,3 @@ export type GetCommandArgumentsType<T> = T extends Command<infer C, infer Option
19
19
  options: Options;
20
20
  result: Result;
21
21
  } : unknown;
22
- //# sourceMappingURL=types.d.ts.map
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 build_namespaceObject.File.fse.readFile(file, 'utf-8');
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",
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,22 +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.2.2"
21
+ "typescript": "^5.9.2"
24
22
  },
25
23
  "dependencies": {
26
- "axios": "^1.11.0",
24
+ "axios": "^1.12.0",
27
25
  "ora": "^5.4.1",
28
26
  "picocolors": "^1.1.1",
29
27
  "yargs": "17.7.2",
30
- "@rsdoctor/types": "1.2.3",
31
- "@rsdoctor/utils": "1.2.3",
32
- "@rsdoctor/core": "1.2.3",
33
- "@rsdoctor/sdk": "1.2.3"
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"
34
33
  },
35
34
  "publishConfig": {
36
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"}
@@ -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"}
@@ -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"}
@@ -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,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM;IACjD,OAAO,EAAE,GAAG,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IACpC,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CACxD,MAAM,CAAC,EACP,MAAM,OAAO,EACb,MAAM,MAAM,CACb,GACG;IACE,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD,OAAO,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,wBAAgB,cAAc,CAAC,GAAG,SAAS,MAAM,EAAE,OAAO,EAAE,MAAM,EAChE,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAK/B;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,gBAS1C;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,mBAItD;AAED,wBAAsB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EACzD,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,GAAG,GACX,OAAO,CAAC,MAAM,CAAC,CAKjB"}