@rsdoctor/utils 1.0.2 → 1.1.0-alpha.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.
@@ -354,6 +354,81 @@ class APIDataLoader {
354
354
  return this.loader.loadData("otherReports").then((otherReports) => {
355
355
  return otherReports?.tileReportHtml;
356
356
  });
357
+ case import_types.SDK.ServerAPI.API.GetChunkGraph:
358
+ return this.loader.loadData("chunkGraph").then((res) => {
359
+ const { chunks = [] } = res || {};
360
+ return chunks;
361
+ });
362
+ case import_types.SDK.ServerAPI.API.GetAllModuleGraphFilter:
363
+ return this.loader.loadData("moduleGraph").then((moduleGraph) => {
364
+ return moduleGraph?.modules.map((m) => ({
365
+ id: m.id,
366
+ webpackId: m.webpackId,
367
+ path: m.path,
368
+ size: m.size,
369
+ chunks: m.chunks,
370
+ kind: m.kind
371
+ }));
372
+ });
373
+ case import_types.SDK.ServerAPI.API.GetModuleByName:
374
+ return this.loader.loadData("moduleGraph").then((moduleGraph) => {
375
+ const { moduleName } = body;
376
+ const { modules = [] } = moduleGraph || {};
377
+ return modules.filter((m) => m.path.includes(moduleName)).map((m) => ({
378
+ id: m.id,
379
+ path: m.path
380
+ })) || [];
381
+ });
382
+ case import_types.SDK.ServerAPI.API.GetModuleIssuerPath:
383
+ return this.loader.loadData("moduleGraph").then((moduleGraph) => {
384
+ const { moduleId } = body;
385
+ return moduleGraph?.modules.find((m) => String(m.id) === moduleId)?.issuerPath || [];
386
+ });
387
+ case import_types.SDK.ServerAPI.API.GetPackageInfo:
388
+ return this.loader.loadData("packageGraph").then((packageGraph) => {
389
+ return packageGraph?.packages;
390
+ });
391
+ case import_types.SDK.ServerAPI.API.GetPackageDependency:
392
+ return this.loader.loadData("packageGraph").then((packageGraph) => {
393
+ return packageGraph?.dependencies || [];
394
+ });
395
+ case import_types.SDK.ServerAPI.API.GetChunkGraphAI:
396
+ return this.loader.loadData("chunkGraph").then((res) => {
397
+ const { chunks = [] } = res || {};
398
+ const filteredChunks = chunks.map(({ modules, ...rest }) => rest);
399
+ return filteredChunks;
400
+ });
401
+ case import_types.SDK.ServerAPI.API.GetChunkByIdAI:
402
+ return Promise.all([
403
+ this.loader.loadData("chunkGraph"),
404
+ this.loader.loadData("moduleGraph")
405
+ ]).then(([chunkGraph, moduleGraph]) => {
406
+ const { chunks = [] } = chunkGraph || {};
407
+ const { modules = [] } = moduleGraph || {};
408
+ const { chunkId } = body;
409
+ const chunkInfo = chunks.find(
410
+ (c) => c.id === chunkId
411
+ );
412
+ const chunkModules = modules.filter((m) => chunkInfo.modules.includes(m.id)).map((module2) => {
413
+ return {
414
+ id: module2.id,
415
+ path: module2.path,
416
+ size: module2.size,
417
+ chunks: module2.chunks,
418
+ kind: module2.kind,
419
+ issuerPath: module2.issuerPath
420
+ };
421
+ });
422
+ chunkInfo.modulesInfo = chunkModules;
423
+ return chunkInfo;
424
+ });
425
+ case import_types.SDK.ServerAPI.API.GetDirectoriesLoaders:
426
+ return Promise.all([
427
+ this.loader.loadData("root"),
428
+ this.loader.loadData("loader")
429
+ ]).then(([root, loaders]) => {
430
+ return Loader.getDirectoriesLoaders(loaders || [], root || "");
431
+ });
357
432
  default:
358
433
  throw new Error(`API not implement: "${api}"`);
359
434
  }
@@ -20,6 +20,7 @@ var loader_exports = {};
20
20
  __export(loader_exports, {
21
21
  LoaderInternalPropertyName: () => LoaderInternalPropertyName,
22
22
  findLoaderTotalTiming: () => findLoaderTotalTiming,
23
+ getDirectoriesLoaders: () => getDirectoriesLoaders,
23
24
  getLoaderChartData: () => getLoaderChartData,
24
25
  getLoaderCosts: () => getLoaderCosts,
25
26
  getLoaderFileDetails: () => getLoaderFileDetails,
@@ -217,6 +218,34 @@ function getLoaderFolderStatistics(folder, loaders) {
217
218
  });
218
219
  return loaderCosts;
219
220
  }
221
+ function collectResourceDirectories(loaders, root) {
222
+ const directories = /* @__PURE__ */ new Set();
223
+ loaders.forEach((item) => {
224
+ if (item.resource.path.startsWith(root)) {
225
+ const pathParts = item.resource.path.split(root).slice(1).join("/").split("/");
226
+ if (pathParts.length >= 2) {
227
+ const twoLevelDir = pathParts.slice(0, 2).join("/");
228
+ directories.add(`${root}/${twoLevelDir}`);
229
+ }
230
+ } else {
231
+ const pathParts = item.resource.path.split("/");
232
+ const twoLevelDir = pathParts.slice(0, pathParts.length - 1).join("/");
233
+ directories.add(twoLevelDir);
234
+ }
235
+ });
236
+ return Array.from(directories);
237
+ }
238
+ function getDirectoriesLoaders(loaders, root) {
239
+ const rootPath = root || process.cwd();
240
+ const directories = collectResourceDirectories(loaders, rootPath);
241
+ return directories.map((directory) => {
242
+ const stats = getLoaderFolderStatistics(directory, loaders);
243
+ return {
244
+ directory,
245
+ stats
246
+ };
247
+ });
248
+ }
220
249
  function getLoaderFileFirstInput(file, loaders) {
221
250
  for (let i = 0; i < loaders.length; i++) {
222
251
  const item = loaders[i];
@@ -272,6 +301,7 @@ const getLoadrName = (loader) => {
272
301
  0 && (module.exports = {
273
302
  LoaderInternalPropertyName,
274
303
  findLoaderTotalTiming,
304
+ getDirectoriesLoaders,
275
305
  getLoaderChartData,
276
306
  getLoaderCosts,
277
307
  getLoaderFileDetails,
@@ -23,8 +23,11 @@ __export(lodash_exports, {
23
23
  isNil: () => isNil,
24
24
  isNumber: () => isNumber,
25
25
  isObject: () => isObject,
26
+ isPlainObject: () => isPlainObject,
27
+ isString: () => isString,
26
28
  isUndefined: () => isUndefined,
27
- last: () => last
29
+ last: () => last,
30
+ pick: () => pick
28
31
  });
29
32
  module.exports = __toCommonJS(lodash_exports);
30
33
  function isUndefined(value) {
@@ -50,6 +53,20 @@ function compact(array) {
50
53
  function isNil(value) {
51
54
  return value === null || value === void 0;
52
55
  }
56
+ const isPlainObject = (obj) => {
57
+ return obj !== null && typeof obj === "object" && Object.getPrototypeOf(obj) === Object.prototype;
58
+ };
59
+ const isString = (v) => typeof v === "string" || !!v && typeof v === "object" && !Array.isArray(v) && {}.toString.call(v) === "[object String]";
60
+ function pick(obj, keys) {
61
+ const result = {};
62
+ for (let i = 0; i < keys.length; i++) {
63
+ const key = keys[i];
64
+ if (Object.hasOwn(obj, key)) {
65
+ result[key] = obj[key];
66
+ }
67
+ }
68
+ return result;
69
+ }
53
70
  // Annotate the CommonJS export names for ESM import in node:
54
71
  0 && (module.exports = {
55
72
  compact,
@@ -57,6 +74,9 @@ function isNil(value) {
57
74
  isNil,
58
75
  isNumber,
59
76
  isObject,
77
+ isPlainObject,
78
+ isString,
60
79
  isUndefined,
61
- last
80
+ last,
81
+ pick
62
82
  });
@@ -43,6 +43,34 @@ function debug(getMsg, prefix = "") {
43
43
  import_rslog.logger.level = "verbose";
44
44
  import_rslog.logger.debug(`${prefix} ${getMsg()}`);
45
45
  }
46
+ import_rslog.logger.override({
47
+ log: (message) => {
48
+ console.log(`[Rsdoctor log] ${message}`);
49
+ },
50
+ info: (message) => {
51
+ console.log(`[Rsdoctor info] ${message}`);
52
+ },
53
+ warn: (message) => {
54
+ console.warn(`[Rsdoctor warn] ${message}`);
55
+ },
56
+ start: (message) => {
57
+ console.log(`[Rsdoctor start] ${message}`);
58
+ },
59
+ ready: (message) => {
60
+ console.log(`[Rsdoctor ready] ${message}`);
61
+ },
62
+ error: (message) => {
63
+ console.error(`[Rsdoctor error] ${message}`);
64
+ },
65
+ success: (message) => {
66
+ console.error(`[Rsdoctor success] ${message}`);
67
+ },
68
+ debug: (message) => {
69
+ if (process.env.DEBUG) {
70
+ console.log(`[Rsdoctor debug] ${message}`);
71
+ }
72
+ }
73
+ });
46
74
  // Annotate the CommonJS export names for ESM import in node:
47
75
  0 && (module.exports = {
48
76
  chalk,
@@ -321,6 +321,81 @@ class APIDataLoader {
321
321
  return this.loader.loadData("otherReports").then((otherReports) => {
322
322
  return otherReports?.tileReportHtml;
323
323
  });
324
+ case SDK.ServerAPI.API.GetChunkGraph:
325
+ return this.loader.loadData("chunkGraph").then((res) => {
326
+ const { chunks = [] } = res || {};
327
+ return chunks;
328
+ });
329
+ case SDK.ServerAPI.API.GetAllModuleGraphFilter:
330
+ return this.loader.loadData("moduleGraph").then((moduleGraph) => {
331
+ return moduleGraph?.modules.map((m) => ({
332
+ id: m.id,
333
+ webpackId: m.webpackId,
334
+ path: m.path,
335
+ size: m.size,
336
+ chunks: m.chunks,
337
+ kind: m.kind
338
+ }));
339
+ });
340
+ case SDK.ServerAPI.API.GetModuleByName:
341
+ return this.loader.loadData("moduleGraph").then((moduleGraph) => {
342
+ const { moduleName } = body;
343
+ const { modules = [] } = moduleGraph || {};
344
+ return modules.filter((m) => m.path.includes(moduleName)).map((m) => ({
345
+ id: m.id,
346
+ path: m.path
347
+ })) || [];
348
+ });
349
+ case SDK.ServerAPI.API.GetModuleIssuerPath:
350
+ return this.loader.loadData("moduleGraph").then((moduleGraph) => {
351
+ const { moduleId } = body;
352
+ return moduleGraph?.modules.find((m) => String(m.id) === moduleId)?.issuerPath || [];
353
+ });
354
+ case SDK.ServerAPI.API.GetPackageInfo:
355
+ return this.loader.loadData("packageGraph").then((packageGraph) => {
356
+ return packageGraph?.packages;
357
+ });
358
+ case SDK.ServerAPI.API.GetPackageDependency:
359
+ return this.loader.loadData("packageGraph").then((packageGraph) => {
360
+ return packageGraph?.dependencies || [];
361
+ });
362
+ case SDK.ServerAPI.API.GetChunkGraphAI:
363
+ return this.loader.loadData("chunkGraph").then((res) => {
364
+ const { chunks = [] } = res || {};
365
+ const filteredChunks = chunks.map(({ modules, ...rest }) => rest);
366
+ return filteredChunks;
367
+ });
368
+ case SDK.ServerAPI.API.GetChunkByIdAI:
369
+ return Promise.all([
370
+ this.loader.loadData("chunkGraph"),
371
+ this.loader.loadData("moduleGraph")
372
+ ]).then(([chunkGraph, moduleGraph]) => {
373
+ const { chunks = [] } = chunkGraph || {};
374
+ const { modules = [] } = moduleGraph || {};
375
+ const { chunkId } = body;
376
+ const chunkInfo = chunks.find(
377
+ (c) => c.id === chunkId
378
+ );
379
+ const chunkModules = modules.filter((m) => chunkInfo.modules.includes(m.id)).map((module) => {
380
+ return {
381
+ id: module.id,
382
+ path: module.path,
383
+ size: module.size,
384
+ chunks: module.chunks,
385
+ kind: module.kind,
386
+ issuerPath: module.issuerPath
387
+ };
388
+ });
389
+ chunkInfo.modulesInfo = chunkModules;
390
+ return chunkInfo;
391
+ });
392
+ case SDK.ServerAPI.API.GetDirectoriesLoaders:
393
+ return Promise.all([
394
+ this.loader.loadData("root"),
395
+ this.loader.loadData("loader")
396
+ ]).then(([root, loaders]) => {
397
+ return Loader.getDirectoriesLoaders(loaders || [], root || "");
398
+ });
324
399
  default:
325
400
  throw new Error(`API not implement: "${api}"`);
326
401
  }
@@ -182,6 +182,34 @@ function getLoaderFolderStatistics(folder, loaders) {
182
182
  });
183
183
  return loaderCosts;
184
184
  }
185
+ function collectResourceDirectories(loaders, root) {
186
+ const directories = /* @__PURE__ */ new Set();
187
+ loaders.forEach((item) => {
188
+ if (item.resource.path.startsWith(root)) {
189
+ const pathParts = item.resource.path.split(root).slice(1).join("/").split("/");
190
+ if (pathParts.length >= 2) {
191
+ const twoLevelDir = pathParts.slice(0, 2).join("/");
192
+ directories.add(`${root}/${twoLevelDir}`);
193
+ }
194
+ } else {
195
+ const pathParts = item.resource.path.split("/");
196
+ const twoLevelDir = pathParts.slice(0, pathParts.length - 1).join("/");
197
+ directories.add(twoLevelDir);
198
+ }
199
+ });
200
+ return Array.from(directories);
201
+ }
202
+ function getDirectoriesLoaders(loaders, root) {
203
+ const rootPath = root || process.cwd();
204
+ const directories = collectResourceDirectories(loaders, rootPath);
205
+ return directories.map((directory) => {
206
+ const stats = getLoaderFolderStatistics(directory, loaders);
207
+ return {
208
+ directory,
209
+ stats
210
+ };
211
+ });
212
+ }
185
213
  function getLoaderFileFirstInput(file, loaders) {
186
214
  for (let i = 0; i < loaders.length; i++) {
187
215
  const item = loaders[i];
@@ -236,6 +264,7 @@ const getLoadrName = (loader) => {
236
264
  export {
237
265
  LoaderInternalPropertyName,
238
266
  findLoaderTotalTiming,
267
+ getDirectoriesLoaders,
239
268
  getLoaderChartData,
240
269
  getLoaderCosts,
241
270
  getLoaderFileDetails,
@@ -21,12 +21,29 @@ function compact(array) {
21
21
  function isNil(value) {
22
22
  return value === null || value === void 0;
23
23
  }
24
+ const isPlainObject = (obj) => {
25
+ return obj !== null && typeof obj === "object" && Object.getPrototypeOf(obj) === Object.prototype;
26
+ };
27
+ const isString = (v) => typeof v === "string" || !!v && typeof v === "object" && !Array.isArray(v) && {}.toString.call(v) === "[object String]";
28
+ function pick(obj, keys) {
29
+ const result = {};
30
+ for (let i = 0; i < keys.length; i++) {
31
+ const key = keys[i];
32
+ if (Object.hasOwn(obj, key)) {
33
+ result[key] = obj[key];
34
+ }
35
+ }
36
+ return result;
37
+ }
24
38
  export {
25
39
  compact,
26
40
  isEmpty,
27
41
  isNil,
28
42
  isNumber,
29
43
  isObject,
44
+ isPlainObject,
45
+ isString,
30
46
  isUndefined,
31
- last
47
+ last,
48
+ pick
32
49
  };
@@ -8,6 +8,34 @@ function debug(getMsg, prefix = "") {
8
8
  logger.level = "verbose";
9
9
  logger.debug(`${prefix} ${getMsg()}`);
10
10
  }
11
+ logger.override({
12
+ log: (message) => {
13
+ console.log(`[Rsdoctor log] ${message}`);
14
+ },
15
+ info: (message) => {
16
+ console.log(`[Rsdoctor info] ${message}`);
17
+ },
18
+ warn: (message) => {
19
+ console.warn(`[Rsdoctor warn] ${message}`);
20
+ },
21
+ start: (message) => {
22
+ console.log(`[Rsdoctor start] ${message}`);
23
+ },
24
+ ready: (message) => {
25
+ console.log(`[Rsdoctor ready] ${message}`);
26
+ },
27
+ error: (message) => {
28
+ console.error(`[Rsdoctor error] ${message}`);
29
+ },
30
+ success: (message) => {
31
+ console.error(`[Rsdoctor success] ${message}`);
32
+ },
33
+ debug: (message) => {
34
+ if (process.env.DEBUG) {
35
+ console.log(`[Rsdoctor debug] ${message}`);
36
+ }
37
+ }
38
+ });
11
39
  export {
12
40
  chalk,
13
41
  debug,
@@ -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;CAyY/C"}
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;CAye/C"}
@@ -12,6 +12,10 @@ export declare function getLoaderChartData(loaders: SDK.LoaderData): SDK.ServerA
12
12
  export declare function getLoaderFileTree(loaders: SDK.LoaderData): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileTree>;
13
13
  export declare function getLoaderFileDetails(path: string, loaders: SDK.LoaderData): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileDetails>;
14
14
  export declare function getLoaderFolderStatistics(folder: string, loaders: SDK.LoaderData): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFolderStatistics>;
15
+ export declare function getDirectoriesLoaders(loaders: SDK.LoaderData, root?: string): {
16
+ directory: string;
17
+ stats: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFolderStatistics>;
18
+ }[];
15
19
  export declare function getLoaderFileFirstInput(file: string, loaders: SDK.LoaderData): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileFirstInput>;
16
20
  export declare function getLoaderFileInputAndOutput(file: string, loader: string, loaderIndex: number, loaders: SDK.LoaderData): SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetLoaderFileInputAndOutput>;
17
21
  export declare const LoaderInternalPropertyName = "__l__";
@@ -1 +1 @@
1
- {"version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C9E;AA6BD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,GAAG,CAAC,UAAU,EACvB,IAAI,CAAC,EAAE,MAAM,GACZ;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;CACrF,EAAE,CAWF;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,GAAG,CAAC,UAAU,GACtB,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAW5E;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,GAAG,CAAC,UAAU,GACtB,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,2BAA2B,CAAC,CA2BhF;AAED,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAElD,eAAO,MAAM,KAAK,aAAc,MAAM,CAAC,YAAY,YAelD,CAAC"}
@@ -5,4 +5,7 @@ export declare function isEmpty(value: unknown): boolean;
5
5
  export declare function last<T>(array: T[]): T | undefined;
6
6
  export declare function compact<T>(array: (T | null | undefined)[]): T[];
7
7
  export declare function isNil(value: unknown): value is null | undefined;
8
+ export declare const isPlainObject: (obj: unknown) => obj is Record<string, any>;
9
+ export declare const isString: (v: unknown) => v is string;
10
+ export declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Pick<T, K>;
8
11
  //# sourceMappingURL=lodash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lodash.d.ts","sourceRoot":"","sources":["../../../src/common/lodash.ts"],"names":[],"mappings":"AACA,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,G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E,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAE/D;AAGD,eAAO,MAAM,aAAa,QAAS,OAAO,KAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAMrE,CAAC;AAGF,eAAO,MAAM,QAAQ,MAAO,OAAO,KAAG,CAAC,IAAI,MAKG,CAAC;AAG/C,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EACnE,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,SAAS,CAAC,EAAE,GACjB,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CASZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/utils",
3
- "version": "1.0.2",
3
+ "version": "1.1.0-alpha.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -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.0.2"
86
+ "@rsdoctor/types": "1.1.0-alpha.0"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@types/babel__code-frame": "7.0.6",
@@ -91,7 +91,7 @@
91
91
  "@types/deep-eql": "4.0.2",
92
92
  "@types/envinfo": "7.8.4",
93
93
  "@types/fs-extra": "^11.0.4",
94
- "@types/node": "^16",
94
+ "@types/node": "^22.8.1",
95
95
  "tslib": "2.8.1",
96
96
  "typescript": "^5.2.2"
97
97
  },