1/*
2 * Copyright [2022] [Kevin Velasco]
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1617pub mod ser;
1819use meshed::graph::GraphDefinition;
20use webpack_stats::chunk::{
21 ChunkChild, ChunkChildren, ChunkId, ChunkInitial, ChunkModules, ChunkParentOrSibling, Files,
22};
23use webpack_stats::import::{ImportType, ResolvedModule};
24use webpack_stats::module::{ModuleChunks, ModuleIdentifier, ModuleName};
25use webpack_stats::SizeBytes;
2627pub struct ModuleParentGraph;
2829impl GraphDefinition for ModuleParentGraph {
30type Id = ModuleIdentifier;
31type Label = ModuleName;
32type EdgeMeta = (ImportType, ResolvedModule);
33type NodeData = ModuleChunks;
34}
3536pub struct ChunkGraph;
3738impl GraphDefinition for ChunkGraph {
39type Id = ChunkId;
40type Label = ChunkId;
41type EdgeMeta = ChunkChild;
42type NodeData = ChunkModules;
43}
44pub struct ChunkImportPathGraph;
4546impl GraphDefinition for ChunkImportPathGraph {
47type Id = ChunkId;
48type Label = ChunkId;
49type EdgeMeta = ChunkParentOrSibling;
50type NodeData = ();
51}
5253pub struct ChunkLoadGraph;
5455impl GraphDefinition for ChunkLoadGraph {
56type Id = ChunkId;
57type Label = ChunkId;
58type EdgeMeta = ChunkChild;
59type NodeData = (ChunkChildren, SizeBytes, ChunkInitial, Files);
60}