@rsdoctor/components 1.3.0-beta.0 → 1.3.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/utils/stats.mjs +1 -1
- package/dist/utils/stats.mjs.map +1 -1
- package/package.json +4 -4
package/dist/utils/stats.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { SDK } from "@rsdoctor/types";
|
|
|
2
2
|
import { Chunks, ModuleGraphTrans, PackageGraph } from "@rsdoctor/graph";
|
|
3
3
|
import { isArray } from "lodash-es";
|
|
4
4
|
function isRspackStats(json) {
|
|
5
|
-
return
|
|
5
|
+
return isArray(json.assets) && isArray(json.chunks);
|
|
6
6
|
}
|
|
7
7
|
async function loadRspackStats(jsons) {
|
|
8
8
|
const res = await Promise.all(jsons.map(async (json)=>{
|
package/dist/utils/stats.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils/stats.mjs","sources":["webpack://@rsdoctor/components/./src/utils/stats.ts"],"sourcesContent":["import { Common, Manifest, Plugin, SDK } from '@rsdoctor/types';\nimport { PackageGraph } from '@rsdoctor/graph';\nimport { Chunks, ModuleGraphTrans } from '@rsdoctor/graph';\nimport { isArray } from 'lodash-es';\n\nexport function isRspackStats(\n json: Common.PlainObject,\n): json is Plugin.StatsCompilation {\n return
|
|
1
|
+
{"version":3,"file":"utils/stats.mjs","sources":["webpack://@rsdoctor/components/./src/utils/stats.ts"],"sourcesContent":["import { Common, Manifest, Plugin, SDK } from '@rsdoctor/types';\nimport { PackageGraph } from '@rsdoctor/graph';\nimport { Chunks, ModuleGraphTrans } from '@rsdoctor/graph';\nimport { isArray } from 'lodash-es';\n\nexport function isRspackStats(\n json: Common.PlainObject,\n): json is Plugin.StatsCompilation {\n return isArray(json.assets) && isArray(json.chunks);\n}\n\nexport async function loadRspackStats(\n jsons: Plugin.StatsCompilation[],\n): Promise<Manifest.RsdoctorManifest[]> {\n const res = await Promise.all(\n jsons.map(async (json) => {\n const chunkGraph = Chunks.chunkTransform(new Map(), json);\n const moduleGraph = ModuleGraphTrans.getModuleGraphByStats(\n json,\n '.',\n chunkGraph,\n );\n await Chunks.getAssetsModulesData(\n moduleGraph,\n chunkGraph,\n json.outputPath || '',\n {},\n undefined,\n );\n const pkgGraph = PackageGraph.fromModuleGraph(moduleGraph, '.');\n\n return {\n hash: json.hash || '',\n moduleGraph: await moduleGraph.toData(),\n chunkGraph: chunkGraph.toData(SDK.ToDataType.Normal),\n packageGraph: pkgGraph.toData(),\n } as Pick<\n SDK.StoreData,\n 'moduleGraph' | 'chunkGraph' | 'hash' | 'packageGraph'\n >;\n }),\n );\n\n return res.map((e) => {\n return {\n client: {\n enableRoutes: [],\n },\n data: {\n pid: 0,\n root: '',\n errors: [],\n configs: [],\n plugin: {},\n summary: {\n costs: [],\n },\n envinfo: {} as SDK.EnvInfo,\n resolver: [],\n loader: [],\n moduleCodeMap: {},\n ...e,\n },\n };\n });\n}\n"],"names":["isRspackStats","json","isArray","loadRspackStats","jsons","res","Promise","chunkGraph","Chunks","Map","moduleGraph","ModuleGraphTrans","undefined","pkgGraph","PackageGraph","SDK","e"],"mappings":";;;AAKO,SAASA,cACdC,IAAwB;IAExB,OAAOC,QAAQD,KAAK,MAAM,KAAKC,QAAQD,KAAK,MAAM;AACpD;AAEO,eAAeE,gBACpBC,KAAgC;IAEhC,MAAMC,MAAM,MAAMC,QAAQ,GAAG,CAC3BF,MAAM,GAAG,CAAC,OAAOH;QACf,MAAMM,aAAaC,OAAO,cAAc,CAAC,IAAIC,OAAOR;QACpD,MAAMS,cAAcC,iBAAiB,qBAAqB,CACxDV,MACA,KACAM;QAEF,MAAMC,OAAO,oBAAoB,CAC/BE,aACAH,YACAN,KAAK,UAAU,IAAI,IACnB,CAAC,GACDW;QAEF,MAAMC,WAAWC,aAAa,eAAe,CAACJ,aAAa;QAE3D,OAAO;YACL,MAAMT,KAAK,IAAI,IAAI;YACnB,aAAa,MAAMS,YAAY,MAAM;YACrC,YAAYH,WAAW,MAAM,CAACQ,IAAI,UAAU,CAAC,MAAM;YACnD,cAAcF,SAAS,MAAM;QAC/B;IAIF;IAGF,OAAOR,IAAI,GAAG,CAAC,CAACW,IACP;YACL,QAAQ;gBACN,cAAc,EAAE;YAClB;YACA,MAAM;gBACJ,KAAK;gBACL,MAAM;gBACN,QAAQ,EAAE;gBACV,SAAS,EAAE;gBACX,QAAQ,CAAC;gBACT,SAAS;oBACP,OAAO,EAAE;gBACX;gBACA,SAAS,CAAC;gBACV,UAAU,EAAE;gBACZ,QAAQ,EAAE;gBACV,eAAe,CAAC;gBAChB,GAAGA,CAAC;YACN;QACF;AAEJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/components",
|
|
3
|
-
"version": "1.3.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"react-router-dom": "6.4.3",
|
|
76
76
|
"socket.io-client": "4.8.1",
|
|
77
77
|
"url-parse": "1.5.10",
|
|
78
|
-
"@rsdoctor/graph": "1.3.0
|
|
79
|
-
"@rsdoctor/
|
|
80
|
-
"@rsdoctor/
|
|
78
|
+
"@rsdoctor/graph": "1.3.0",
|
|
79
|
+
"@rsdoctor/types": "1.3.0",
|
|
80
|
+
"@rsdoctor/utils": "1.3.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": ">=18.3.1",
|