@lcap/nasl 4.5.0-beta.2 → 4.5.0-beta.4
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/out/generator/genBundleFiles.d.ts.map +1 -1
- package/out/generator/genBundleFiles.js +160 -23
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/release-body/data.d.ts.map +1 -1
- package/out/generator/release-body/data.js +21 -9
- package/out/generator/release-body/data.js.map +1 -1
- package/out/generator/release-body/types.d.ts +2 -0
- package/out/generator/release-body/types.d.ts.map +1 -1
- package/out/generator/release-body/utils.d.ts +1 -1
- package/out/generator/release-body/utils.d.ts.map +1 -1
- package/out/generator/release-body/utils.js +8 -6
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/generator/rspack-broswer/bundle.d.ts +24 -0
- package/out/generator/rspack-broswer/bundle.d.ts.map +1 -0
- package/out/generator/rspack-broswer/bundle.js +442 -0
- package/out/generator/rspack-broswer/bundle.js.map +1 -0
- package/out/generator/rspack-broswer/container/client-lazyload-template.d.ts +9 -0
- package/out/generator/rspack-broswer/container/client-lazyload-template.d.ts.map +1 -0
- package/out/generator/rspack-broswer/container/client-lazyload-template.js +88 -0
- package/out/generator/rspack-broswer/container/client-lazyload-template.js.map +1 -0
- package/out/generator/rspack-broswer/container/file-system.d.ts +12 -0
- package/out/generator/rspack-broswer/container/file-system.d.ts.map +1 -0
- package/out/generator/rspack-broswer/container/file-system.js +58 -0
- package/out/generator/rspack-broswer/container/file-system.js.map +1 -0
- package/out/generator/rspack-broswer/container/index.d.ts +3 -0
- package/out/generator/rspack-broswer/container/index.d.ts.map +1 -0
- package/out/generator/rspack-broswer/container/index.js +15 -0
- package/out/generator/rspack-broswer/container/index.js.map +1 -0
- package/out/generator/rspack-broswer/index.d.ts +3 -0
- package/out/generator/rspack-broswer/index.d.ts.map +1 -0
- package/out/generator/rspack-broswer/index.js +19 -0
- package/out/generator/rspack-broswer/index.js.map +1 -0
- package/out/generator/rspack-broswer/loaders/vue/index.d.ts +2 -0
- package/out/generator/rspack-broswer/loaders/vue/index.d.ts.map +1 -0
- package/out/generator/rspack-broswer/loaders/vue/index.js +228 -0
- package/out/generator/rspack-broswer/loaders/vue/index.js.map +1 -0
- package/out/generator/rspack-broswer/plugins/lcap/constant.d.ts +3 -0
- package/out/generator/rspack-broswer/plugins/lcap/constant.d.ts.map +1 -0
- package/out/generator/rspack-broswer/plugins/lcap/constant.js +213 -0
- package/out/generator/rspack-broswer/plugins/lcap/constant.js.map +1 -0
- package/out/generator/rspack-broswer/plugins/lcap/index.d.ts +6 -0
- package/out/generator/rspack-broswer/plugins/lcap/index.d.ts.map +1 -0
- package/out/generator/rspack-broswer/plugins/lcap/index.js +175 -0
- package/out/generator/rspack-broswer/plugins/lcap/index.js.map +1 -0
- package/out/generator/rspack-broswer/plugins/missing-css-fallback/index.d.ts +10 -0
- package/out/generator/rspack-broswer/plugins/missing-css-fallback/index.d.ts.map +1 -0
- package/out/generator/rspack-broswer/plugins/missing-css-fallback/index.js +50 -0
- package/out/generator/rspack-broswer/plugins/missing-css-fallback/index.js.map +1 -0
- package/out/generator/ui-library-declaration/material.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/material.js +1 -0
- package/out/generator/ui-library-declaration/material.js.map +1 -1
- package/out/natural/exports/doctor/doctorView.d.ts +2 -2
- package/out/natural/exports/doctor/doctorView.d.ts.map +1 -1
- package/out/natural/exports/doctor/doctorView.js +32 -14
- package/out/natural/exports/doctor/doctorView.js.map +1 -1
- package/out/natural/exports/doctor/index.d.ts +1 -1
- package/out/natural/exports/doctor/index.d.ts.map +1 -1
- package/out/natural/exports/doctor/types.d.ts +16 -2
- package/out/natural/exports/doctor/types.d.ts.map +1 -1
- package/out/natural/exports/doctor/viewGraph.d.ts.map +1 -1
- package/out/natural/exports/doctor/viewGraph.js +46 -13
- package/out/natural/exports/doctor/viewGraph.js.map +1 -1
- package/out/natural/exports/nasl2Files.d.ts.map +1 -1
- package/out/natural/exports/nasl2Files.js +78 -8
- package/out/natural/exports/nasl2Files.js.map +1 -1
- package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts +24 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts.map +1 -1
- package/out/natural/exports/transform2BatchActions/diff/nodes.js +35 -1
- package/out/natural/exports/transform2BatchActions/diff/nodes.js.map +1 -1
- package/out/natural/exports/transform2BatchActions/parse.d.ts.map +1 -1
- package/out/natural/exports/transform2BatchActions/parse.js +25 -2
- package/out/natural/exports/transform2BatchActions/parse.js.map +1 -1
- package/out/natural/exports/transform2BatchActions/types.d.ts +2 -2
- package/out/natural/exports/transform2BatchActions/types.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTS.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTS.js +45 -1
- package/out/natural/parser/parseNaturalTS.js.map +1 -1
- package/out/natural/parser/parseNaturalTSXView.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTSXView.js +34 -5
- package/out/natural/parser/parseNaturalTSXView.js.map +1 -1
- package/out/natural/transforms/checker/checkAuthLogic.d.ts +3 -0
- package/out/natural/transforms/checker/checkAuthLogic.d.ts.map +1 -0
- package/out/natural/transforms/checker/checkAuthLogic.js +19 -0
- package/out/natural/transforms/checker/checkAuthLogic.js.map +1 -0
- package/out/natural/transforms/checker/checkCronLogic.d.ts +3 -0
- package/out/natural/transforms/checker/checkCronLogic.d.ts.map +1 -0
- package/out/natural/transforms/checker/checkCronLogic.js +11 -0
- package/out/natural/transforms/checker/checkCronLogic.js.map +1 -0
- package/out/natural/transforms/checker/checkExportInterface.d.ts +6 -0
- package/out/natural/transforms/checker/checkExportInterface.d.ts.map +1 -0
- package/out/natural/transforms/checker/checkExportInterface.js +54 -0
- package/out/natural/transforms/checker/checkExportInterface.js.map +1 -0
- package/out/natural/transforms/checker/checkKeywords.js +3 -3
- package/out/natural/transforms/checker/checkKeywords.js.map +1 -1
- package/out/natural/transforms/checker/index.d.ts +3 -0
- package/out/natural/transforms/checker/index.d.ts.map +1 -1
- package/out/natural/transforms/checker/index.js +10 -1
- package/out/natural/transforms/checker/index.js.map +1 -1
- package/out/natural/transforms/transform2AuthLogic.d.ts +4 -0
- package/out/natural/transforms/transform2AuthLogic.d.ts.map +1 -0
- package/out/natural/transforms/transform2AuthLogic.js +119 -0
- package/out/natural/transforms/transform2AuthLogic.js.map +1 -0
- package/out/natural/transforms/transform2Enum.d.ts.map +1 -1
- package/out/natural/transforms/transform2Enum.js +8 -1
- package/out/natural/transforms/transform2Enum.js.map +1 -1
- package/out/natural/transforms/transform2ExportInterface.d.ts +3 -0
- package/out/natural/transforms/transform2ExportInterface.d.ts.map +1 -0
- package/out/natural/transforms/transform2ExportInterface.js +101 -0
- package/out/natural/transforms/transform2ExportInterface.js.map +1 -0
- package/out/natural/transforms/transform2GlobalLogicDeclaration.d.ts.map +1 -1
- package/out/natural/transforms/transform2GlobalLogicDeclaration.js +6 -0
- package/out/natural/transforms/transform2GlobalLogicDeclaration.js.map +1 -1
- package/out/natural/transforms/transform2Logic.d.ts.map +1 -1
- package/out/natural/transforms/transform2Logic.js +10 -28
- package/out/natural/transforms/transform2Logic.js.map +1 -1
- package/out/natural/transforms/transform2LogicItem.d.ts +7 -2
- package/out/natural/transforms/transform2LogicItem.d.ts.map +1 -1
- package/out/natural/transforms/transform2LogicItem.js +73 -12
- package/out/natural/transforms/transform2LogicItem.js.map +1 -1
- package/out/natural/transforms/transform2OverriddenLogic.d.ts +3 -0
- package/out/natural/transforms/transform2OverriddenLogic.d.ts.map +1 -0
- package/out/natural/transforms/transform2OverriddenLogic.js +83 -0
- package/out/natural/transforms/transform2OverriddenLogic.js.map +1 -0
- package/out/natural/transforms/utils/parseDecorator.d.ts +1 -1
- package/out/natural/transforms/utils/parseDecorator.d.ts.map +1 -1
- package/out/natural/transforms/utils/parseDecorator.js +17 -1
- package/out/natural/transforms/utils/parseDecorator.js.map +1 -1
- package/out/natural/transforms/utils/parseLogicBody.d.ts +17 -0
- package/out/natural/transforms/utils/parseLogicBody.d.ts.map +1 -0
- package/out/natural/transforms/utils/parseLogicBody.js +47 -0
- package/out/natural/transforms/utils/parseLogicBody.js.map +1 -0
- package/out/natural/utils/nasl-file-types.d.ts.map +1 -1
- package/out/natural/utils/nasl-file-types.js +28 -0
- package/out/natural/utils/nasl-file-types.js.map +1 -1
- package/out/server/naslServer.d.ts.map +1 -1
- package/out/server/naslServer.js +1 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/specTools.d.ts.map +1 -1
- package/out/service/storage/specTools.js +10 -7
- package/out/service/storage/specTools.js.map +1 -1
- package/package.json +14 -9
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lazyLoadCode = `var LazyLoad = (function (doc) {
|
|
4
|
+
var env,
|
|
5
|
+
head,
|
|
6
|
+
pending = {},
|
|
7
|
+
pollCount = 0,
|
|
8
|
+
queue = {
|
|
9
|
+
css: [],
|
|
10
|
+
js: []
|
|
11
|
+
},
|
|
12
|
+
styleSheets = doc.styleSheets;
|
|
13
|
+
|
|
14
|
+
function createNode(name, attrs) {
|
|
15
|
+
var node = doc.createElement(name),
|
|
16
|
+
attr;
|
|
17
|
+
for (attr in attrs) {
|
|
18
|
+
if (attrs.hasOwnProperty(attr)) {
|
|
19
|
+
node.setAttribute(attr, attrs[attr]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return node;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function finish(type) {
|
|
26
|
+
var p = pending[type],
|
|
27
|
+
callback,
|
|
28
|
+
urls;
|
|
29
|
+
if (p) {
|
|
30
|
+
callback = p.callback;
|
|
31
|
+
urls = p.urls;
|
|
32
|
+
urls.shift();
|
|
33
|
+
pollCount = 0;
|
|
34
|
+
if (!urls.length) {
|
|
35
|
+
callback && callback.call(p.context, p.obj);
|
|
36
|
+
pending[type] = null;
|
|
37
|
+
queue[type].length && load(type);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function getEnv() {
|
|
43
|
+
var ua = navigator.userAgent;
|
|
44
|
+
env = {
|
|
45
|
+
async: doc.createElement('script').async === true
|
|
46
|
+
};
|
|
47
|
+
(env.webkit = /AppleWebKit\\//.test(ua)) || (env.ie = /MSIE|Trident/.test(ua)) || (env.opera = /Opera/.test(ua)) || (env.gecko = /Gecko\\//.test(ua)) || (env.unknown = true);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function load(type, urls, callback, obj, context) {
|
|
51
|
+
var _finish = function () {
|
|
52
|
+
finish(type);
|
|
53
|
+
},
|
|
54
|
+
isCSS = type === 'css',
|
|
55
|
+
nodes = [],
|
|
56
|
+
i,
|
|
57
|
+
len,
|
|
58
|
+
node,
|
|
59
|
+
p,
|
|
60
|
+
pendingUrls,
|
|
61
|
+
url;
|
|
62
|
+
env || getEnv();
|
|
63
|
+
if (urls) {
|
|
64
|
+
urls = typeof urls === 'string' ? [urls] : urls.concat();
|
|
65
|
+
if (isCSS || env.async || env.gecko || env.opera) {
|
|
66
|
+
queue[type].push({
|
|
67
|
+
urls: urls,
|
|
68
|
+
callback: callback,
|
|
69
|
+
obj: obj,
|
|
70
|
+
context: context
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
for (i = 0, len = urls.length; i < len; ++i) {
|
|
74
|
+
queue[type].push({
|
|
75
|
+
urls: [urls[i]],
|
|
76
|
+
callback: i === len - 1 ? callback : null,
|
|
77
|
+
obj: obj,
|
|
78
|
+
context: context
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (pending[type] || !(p = pending[type] = queue[type].shift())) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
head || (head = doc.head || doc.getElementsByTagName('head')[0]);
|
|
87
|
+
pendingUrls = p.urls.concat();
|
|
88
|
+
for (i = 0, len = pendingUrls.length; i < len; ++i) {
|
|
89
|
+
url = pendingUrls[i];
|
|
90
|
+
if (isCSS) {
|
|
91
|
+
node = env.gecko
|
|
92
|
+
? createNode('style')
|
|
93
|
+
: createNode('link', {
|
|
94
|
+
href: url,
|
|
95
|
+
rel: 'stylesheet'
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
node = createNode('script', {
|
|
99
|
+
src: url
|
|
100
|
+
});
|
|
101
|
+
node.async = false;
|
|
102
|
+
}
|
|
103
|
+
node.className = 'lazyload';
|
|
104
|
+
node.setAttribute('charset', 'utf-8');
|
|
105
|
+
if (env.ie && !isCSS && 'onreadystatechange' in node && !('draggable' in node)) {
|
|
106
|
+
node.onreadystatechange = function () {
|
|
107
|
+
if (/loaded|complete/.test(node.readyState)) {
|
|
108
|
+
node.onreadystatechange = null;
|
|
109
|
+
_finish();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
} else if (isCSS && (env.gecko || env.webkit)) {
|
|
113
|
+
if (env.webkit) {
|
|
114
|
+
p.urls[i] = node.href;
|
|
115
|
+
pollWebKit();
|
|
116
|
+
} else {
|
|
117
|
+
node.innerHTML = '@import "' + url + '";';
|
|
118
|
+
pollGecko(node);
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
node.onload = node.onerror = _finish;
|
|
122
|
+
}
|
|
123
|
+
nodes.push(node);
|
|
124
|
+
}
|
|
125
|
+
for (i = 0, len = nodes.length; i < len; ++i) {
|
|
126
|
+
head.appendChild(nodes[i]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function pollGecko(node) {
|
|
131
|
+
var hasRules;
|
|
132
|
+
try {
|
|
133
|
+
hasRules = !!node.sheet.cssRules;
|
|
134
|
+
} catch (ex) {
|
|
135
|
+
pollCount += 1;
|
|
136
|
+
if (pollCount < 200) {
|
|
137
|
+
setTimeout(function () {
|
|
138
|
+
pollGecko(node);
|
|
139
|
+
}, 50);
|
|
140
|
+
} else {
|
|
141
|
+
hasRules && finish('css');
|
|
142
|
+
}
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
finish('css');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function pollWebKit() {
|
|
149
|
+
var css = pending.css,
|
|
150
|
+
i;
|
|
151
|
+
if (css) {
|
|
152
|
+
i = styleSheets.length;
|
|
153
|
+
while (--i >= 0) {
|
|
154
|
+
if (styleSheets[i].href === css.urls[0]) {
|
|
155
|
+
finish('css');
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
pollCount += 1;
|
|
160
|
+
if (css) {
|
|
161
|
+
if (pollCount < 200) {
|
|
162
|
+
setTimeout(pollWebKit, 50);
|
|
163
|
+
} else {
|
|
164
|
+
finish('css');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function preload(url) {
|
|
170
|
+
var asAttr = '';
|
|
171
|
+
if (/\\.js$/.test(url)) {
|
|
172
|
+
asAttr = 'script';
|
|
173
|
+
} else if (/\\.css$/.test(url)) {
|
|
174
|
+
asAttr = 'style';
|
|
175
|
+
}
|
|
176
|
+
var node = createNode('link', {
|
|
177
|
+
href: url,
|
|
178
|
+
as: asAttr,
|
|
179
|
+
rel: 'preload'
|
|
180
|
+
});
|
|
181
|
+
head.appendChild(node);
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
css: function (urls, callback, obj, context) {
|
|
185
|
+
load('css', urls, callback, obj, context);
|
|
186
|
+
},
|
|
187
|
+
js: function (urls, callback, obj, context) {
|
|
188
|
+
load('js', urls, callback, obj, context);
|
|
189
|
+
},
|
|
190
|
+
preload: function (urls) {
|
|
191
|
+
if (Object.prototype.toString.call(urls) === '[object Array]') {
|
|
192
|
+
for (var i = 0; i < urls.length; i++) {
|
|
193
|
+
urls[i] && preload(urls[i]);
|
|
194
|
+
}
|
|
195
|
+
} else {
|
|
196
|
+
urls && preload(urls);
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
reset: function () {
|
|
200
|
+
env = undefined;
|
|
201
|
+
head = undefined;
|
|
202
|
+
pending = {};
|
|
203
|
+
pollCount = 0;
|
|
204
|
+
queue = {
|
|
205
|
+
css: [],
|
|
206
|
+
js: []
|
|
207
|
+
};
|
|
208
|
+
styleSheets = doc.styleSheets;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
})(document);`;
|
|
212
|
+
exports.default = lazyLoadCode;
|
|
213
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../../../src/generator/rspack-broswer/plugins/lcap/constant.js"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAgNL,CAAA;AAEhB,kBAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/generator/rspack-broswer/plugins/lcap/index.js"],"names":[],"mappings":"AAKA;IACE,0BAEC;IADC,aAAsB;IAExB,2BAuBC;CACF"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const browser_1 = require("@rspack/browser");
|
|
7
|
+
const constant_1 = __importDefault(require("./constant"));
|
|
8
|
+
const plugin = "lcap-plugin";
|
|
9
|
+
class LcapPlugin {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
apply(compiler) {
|
|
14
|
+
const { isDev, isIncremental, lastResource, extra } = this.options;
|
|
15
|
+
// 增量发布
|
|
16
|
+
if (isIncremental) {
|
|
17
|
+
addIncrementalBuild(compiler, {
|
|
18
|
+
lastResource,
|
|
19
|
+
});
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// 标准发布
|
|
23
|
+
overrideRuntime(compiler, {
|
|
24
|
+
isDev,
|
|
25
|
+
});
|
|
26
|
+
emitChunksMapResource(compiler, {
|
|
27
|
+
isDev,
|
|
28
|
+
});
|
|
29
|
+
emitClientResource(compiler, {
|
|
30
|
+
isDev,
|
|
31
|
+
extra,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.default = LcapPlugin;
|
|
36
|
+
// 复写加载css\js chunk的函数
|
|
37
|
+
function overrideRuntime(compiler, options) {
|
|
38
|
+
const { isDev } = options;
|
|
39
|
+
if (!isDev) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const { RuntimeGlobals } = compiler.webpack;
|
|
43
|
+
// 复写__webpack_require__.k和__webpack_require__.u
|
|
44
|
+
compiler.hooks.compilation.tap(plugin, (compilation) => {
|
|
45
|
+
compilation.hooks.runtimeModule.tap(plugin, (module, chunk) => {
|
|
46
|
+
if (module.name === "get javascript chunk filename" && chunk.name === "runtime") {
|
|
47
|
+
module.source.source = `__webpack_require__.u = (chunkId) => {
|
|
48
|
+
return "" + window.lcapChunksNameMap[chunkId] + "." + window.lcapChunksHashMap[chunkId] + ".js"
|
|
49
|
+
}\n`;
|
|
50
|
+
}
|
|
51
|
+
if (module.name === "get css chunk filename" && chunk.name === "runtime") {
|
|
52
|
+
module.source.source = `__webpack_require__.k = (chunkId) => {
|
|
53
|
+
return "" + window.lcapChunksNameMap[chunkId] + "." + window.lcapChunksHashMap[chunkId] + ".css"
|
|
54
|
+
}\n`;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// 增加chunkMap资源
|
|
60
|
+
function emitChunksMapResource(compiler, options) {
|
|
61
|
+
const { isDev } = options;
|
|
62
|
+
if (!isDev) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
compiler.hooks.emit.tapAsync(plugin, (compilation, callback) => {
|
|
66
|
+
// 2、增加router.min.js asset
|
|
67
|
+
const ChunksNameMap = {};
|
|
68
|
+
const ChunksHashMap = {};
|
|
69
|
+
compilation.chunks.forEach((chunk) => {
|
|
70
|
+
const chunkId = chunk.id;
|
|
71
|
+
const chunkName = chunk.name;
|
|
72
|
+
const chunkHash = chunk.hash.substring(0, 8);
|
|
73
|
+
ChunksNameMap[chunkId] = chunkName || chunkId;
|
|
74
|
+
ChunksHashMap[chunkId] = chunkHash;
|
|
75
|
+
});
|
|
76
|
+
const { RawSource } = compiler.webpack.sources;
|
|
77
|
+
const code = `window.lcapChunksNameMap = ${JSON.stringify(ChunksNameMap)};
|
|
78
|
+
window.lcapChunksHashMap = ${JSON.stringify(ChunksHashMap)};
|
|
79
|
+
|
|
80
|
+
var lcap_changed_chunks = [];
|
|
81
|
+
|
|
82
|
+
// lcap_changed_chunks placeholder
|
|
83
|
+
|
|
84
|
+
lcap_changed_chunks.forEach(item => {
|
|
85
|
+
window.lcapChunksNameMap[item.id] = item.name;
|
|
86
|
+
window.lcapChunksHashMap[item.id] = item.hash;
|
|
87
|
+
});`;
|
|
88
|
+
compilation.emitAsset("router.min.js", new RawSource(code), {
|
|
89
|
+
minimized: true,
|
|
90
|
+
});
|
|
91
|
+
callback();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// 生成client.js
|
|
95
|
+
function emitClientResource(compiler, options) {
|
|
96
|
+
const { isDev, extra } = options;
|
|
97
|
+
compiler.hooks.compilation.tap(plugin, (compilation) => {
|
|
98
|
+
browser_1.HtmlRspackPlugin.getCompilationHooks(compilation).beforeAssetTagGeneration.tapPromise(plugin, async (data) => {
|
|
99
|
+
const { assets } = data;
|
|
100
|
+
const { publicPath, js, css } = assets;
|
|
101
|
+
const allJS = [...(extra.preJS || []), ...js, ...(extra.postJS || [])];
|
|
102
|
+
const allCSS = [
|
|
103
|
+
...(extra.preCSS || []),
|
|
104
|
+
...css,
|
|
105
|
+
...(extra.postCSS || []),
|
|
106
|
+
];
|
|
107
|
+
const clientCode = `(function() {
|
|
108
|
+
${constant_1.default}
|
|
109
|
+
|
|
110
|
+
function loadAssets() {
|
|
111
|
+
// chunksMap
|
|
112
|
+
${isDev} && LazyLoad.js(["${publicPath}router.min.js"].map(item => {
|
|
113
|
+
var timestamp = Date.now();
|
|
114
|
+
return item + '?timestamp=' + timestamp;
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
LazyLoad.js(${JSON.stringify(allJS)});
|
|
118
|
+
LazyLoad.css(${JSON.stringify(allCSS)});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
${extra.entryCode}
|
|
122
|
+
})();
|
|
123
|
+
`;
|
|
124
|
+
// 浏览器环境兼容:RawSource 直接支持字符串
|
|
125
|
+
const source = new compiler.webpack.sources.RawSource(clientCode, {
|
|
126
|
+
minimized: true,
|
|
127
|
+
});
|
|
128
|
+
compilation.emitAsset("client.js", source);
|
|
129
|
+
data.assets.js = [`${publicPath}client.js?t=${Date.now()}`];
|
|
130
|
+
data.assets.css = [];
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
// 增量构建
|
|
135
|
+
function addIncrementalBuild(compiler, options) {
|
|
136
|
+
const { lastResource } = options;
|
|
137
|
+
const { chunksMap: chunksMapCode } = lastResource;
|
|
138
|
+
compiler.hooks.emit.tapAsync(plugin, (compilation, callback) => {
|
|
139
|
+
// 只保留pages相关的chunk 资源
|
|
140
|
+
const pagesAssets = [];
|
|
141
|
+
const changedChunks = [];
|
|
142
|
+
compilation.chunks.forEach((chunk) => {
|
|
143
|
+
if (chunk.idNameHints?.includes("page")) {
|
|
144
|
+
chunk.files.forEach((file) => pagesAssets.push(file));
|
|
145
|
+
changedChunks.push({
|
|
146
|
+
id: chunk.id,
|
|
147
|
+
name: chunk.name || chunk.id,
|
|
148
|
+
hash: chunk.hash.substring(0, 8),
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
// 删除不需要的chunk(非页面相关的chunk)
|
|
153
|
+
compilation.getAssets().forEach((asset) => {
|
|
154
|
+
if (!pagesAssets.includes(asset.name)) {
|
|
155
|
+
compilation.deleteAsset(asset.name);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
// 生成增量变更的chunks-map.js
|
|
159
|
+
let code = chunksMapCode;
|
|
160
|
+
const placeholderIdx = code.indexOf("// lcap_changed_chunks placeholder");
|
|
161
|
+
// 前面插入代码
|
|
162
|
+
if (placeholderIdx !== -1) {
|
|
163
|
+
code =
|
|
164
|
+
code.slice(0, placeholderIdx) +
|
|
165
|
+
`lcap_changed_chunks.push(...${JSON.stringify(changedChunks)});\n` +
|
|
166
|
+
code.slice(placeholderIdx);
|
|
167
|
+
}
|
|
168
|
+
const { RawSource } = compiler.webpack.sources;
|
|
169
|
+
compilation.emitAsset("router.min.js", new RawSource(code), {
|
|
170
|
+
minimized: true,
|
|
171
|
+
});
|
|
172
|
+
callback();
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generator/rspack-broswer/plugins/lcap/index.js"],"names":[],"mappings":";;;;;AAAA,6CAA2D;AAC3D,0DAAsC;AAEtC,MAAM,MAAM,GAAG,aAAa,CAAC;AAE7B,MAAqB,UAAU;IAC7B,YAAY,OAAO;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,KAAK,CAA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IAAI,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,uBAAuB;QACvB,IAAI,IAAI,GAAG,aAAa,CAAC;QAEzB,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC;QAC1E,SAAS;QACT,IAAI,cAAc,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1B,IAAI;gBACF,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;oBAC7B,+BAA+B,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM;oBAClE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAC/B,CAAC;QAED,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;QAC/C,WAAW,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE;YAC1D,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/generator/rspack-broswer/plugins/missing-css-fallback/index.js"],"names":[],"mappings":"AAIA;IACE,0BASC;IARC;;;;MAOC;IAGH,2BAsCC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const browser_1 = require("@rspack/browser");
|
|
4
|
+
const fs = browser_1.builtinMemFs.fs;
|
|
5
|
+
class MissingCssFallbackPlugin {
|
|
6
|
+
constructor(options = {}) {
|
|
7
|
+
this.options = {
|
|
8
|
+
// 默认匹配 dist-theme/index.css 结尾的路径
|
|
9
|
+
pattern: /\/dist-theme\/index\.css$/,
|
|
10
|
+
filename: 'lcap-missing-css.css',
|
|
11
|
+
// 空的 CSS 内容
|
|
12
|
+
fallbackContent: '/* CSS file not found, using empty fallback */',
|
|
13
|
+
...options
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
apply(compiler) {
|
|
17
|
+
const { pattern, fallbackContent, filename } = this.options;
|
|
18
|
+
// 使用 NormalModuleReplacementPlugin 来替换不存在的 CSS 文件
|
|
19
|
+
const normalModuleReplacementPlugin = new browser_1.NormalModuleReplacementPlugin(pattern, (resource) => {
|
|
20
|
+
const originalRequest = resource.request;
|
|
21
|
+
try {
|
|
22
|
+
// 尝试解析原始模块
|
|
23
|
+
const context = resource.context || compiler.context;
|
|
24
|
+
const resolver = compiler.resolverFactory.get('normal');
|
|
25
|
+
try {
|
|
26
|
+
// 使用同步解析方法
|
|
27
|
+
const resolvedPath = resolver.resolveSync(null, context, originalRequest);
|
|
28
|
+
// 检查文件是否存在
|
|
29
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
30
|
+
throw new Error('File not found');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
// 文件不存在,创建一个内联模块
|
|
35
|
+
console.log(`[MissingCssFallbackPlugin] CSS file not found: ${originalRequest}, using empty fallback`);
|
|
36
|
+
// 创建一个临时的空 CSS 文件
|
|
37
|
+
const tempCssPath = '/fallback/' + filename;
|
|
38
|
+
fs.writeFileSync(tempCssPath, fallbackContent);
|
|
39
|
+
resource.request = tempCssPath;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.warn(`[MissingCssFallbackPlugin] Warning: Error processing ${originalRequest}:`, error.message);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
normalModuleReplacementPlugin.apply(compiler);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = MissingCssFallbackPlugin;
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/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GAAG,QAAQ,CAAC;oBAC5C,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;oBAC/C,QAAQ,CAAC,OAAO,GAAG,WAAW,CAAC;gBACjC,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,wDAAwD,eAAe,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC1G,CAAC;QACH,CAAC,CACF,CAAC;QAEF,6BAA6B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;CACF;AAnDD,2CAmDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../../src/generator/ui-library-declaration/material.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAiB1C,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAE,OAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../../src/generator/ui-library-declaration/material.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,OAAO,EACP,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAiB1C,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAE,OAAe,GAAG,OAAO,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IAC9G,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvC,IAAA,oBAAY,EAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;QAC3B,IAAA,wBAAgB,EAAC,KAAK,EAAE,GAAG,CAAC;KAC7B,CAAC,CAAC;IACH,sBAAsB;IACtB,MAAM,IAAA,uBAAe,EACnB,KAAK,EACL,GAAG,EACH,GAAG,CAAC,UAAU,EACd,OAAO,CAAC,WAAW,CACpB,CAAC;IAEF,OAAO,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE;QACrC,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,QAAQ,EAAE,GAAG,CAAC,gBAAgB;KAC/B,EAAE,WAAW,CAAC,CAAC;AAClB,CAAC;AAjBD,sEAiBC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 3. Unreferenced views
|
|
8
8
|
* 4. Per-role accessibility analysis
|
|
9
9
|
*/
|
|
10
|
-
import type { DoctorViewOptions,
|
|
10
|
+
import type { DoctorViewOptions, DoctorViewResultJSON } from './types';
|
|
11
11
|
/**
|
|
12
12
|
* Generate a diagnostic report for the App's view navigation structure.
|
|
13
13
|
*
|
|
@@ -20,5 +20,5 @@ export declare function doctorView(app: any, options?: DoctorViewOptions): strin
|
|
|
20
20
|
* Generate a DoctorViewResult for the App's view navigation structure.
|
|
21
21
|
* Result extends ViewGraph with computed unrefViews.
|
|
22
22
|
*/
|
|
23
|
-
export declare function doctorViewJson(app: any, options?: Pick<DoctorViewOptions, 'unrefViewsIncludesRoots'>):
|
|
23
|
+
export declare function doctorViewJson(app: any, options?: Pick<DoctorViewOptions, 'unrefViewsIncludesRoots'>): DoctorViewResultJSON;
|
|
24
24
|
//# sourceMappingURL=doctorView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctorView.d.ts","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/doctorView.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"doctorView.d.ts","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/doctorView.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAoB,oBAAoB,EAA4C,MAAM,SAAS,CAAC;AAGnI;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAqCxE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,yBAAyB,CAAC,GAAG,oBAAoB,CAuB3H"}
|
|
@@ -10,8 +10,9 @@ const viewGraph_1 = require("./viewGraph");
|
|
|
10
10
|
* @returns Formatted markdown report string
|
|
11
11
|
*/
|
|
12
12
|
function doctorView(app, options) {
|
|
13
|
+
const graph = (0, viewGraph_1.buildViewGraph)(app);
|
|
13
14
|
const includeRoots = !!options?.unrefViewsIncludesRoots;
|
|
14
|
-
const
|
|
15
|
+
const unrefViews = findUnreferencedPages(graph, !includeRoots).map((n) => n.path);
|
|
15
16
|
const hideCode = !!options?.hideCode;
|
|
16
17
|
// Determine which sections to output.
|
|
17
18
|
const hasExplicitSection = options?.viewTree !== undefined
|
|
@@ -25,16 +26,16 @@ function doctorView(app, options) {
|
|
|
25
26
|
const showRoleAccess = hasExplicitSection ? roles.length > 0 : false;
|
|
26
27
|
const parts = [];
|
|
27
28
|
if (showViewTree) {
|
|
28
|
-
parts.push(renderViewTree(
|
|
29
|
+
parts.push(renderViewTree(graph, hideCode));
|
|
29
30
|
}
|
|
30
31
|
if (showReverseRefs) {
|
|
31
|
-
parts.push(renderReverseReferences(
|
|
32
|
+
parts.push(renderReverseReferences(graph, hideCode));
|
|
32
33
|
}
|
|
33
34
|
if (showUnrefViews) {
|
|
34
|
-
parts.push(renderUnreferencedViews(
|
|
35
|
+
parts.push(renderUnreferencedViews(graph, unrefViews));
|
|
35
36
|
}
|
|
36
37
|
if (showRoleAccess && roles.length > 0) {
|
|
37
|
-
parts.push(renderRoleAccessTrees(
|
|
38
|
+
parts.push(renderRoleAccessTrees(graph, roles, hideCode));
|
|
38
39
|
}
|
|
39
40
|
return parts.join('\n\n');
|
|
40
41
|
}
|
|
@@ -47,8 +48,22 @@ function doctorViewJson(app, options) {
|
|
|
47
48
|
const graph = (0, viewGraph_1.buildViewGraph)(app);
|
|
48
49
|
const includeRoots = !!options?.unrefViewsIncludesRoots;
|
|
49
50
|
const unreferenced = findUnreferencedPages(graph, !includeRoots);
|
|
51
|
+
// Convert Map/Set to plain objects/arrays for JSON serialization
|
|
52
|
+
const flatRouteMap = {};
|
|
53
|
+
for (const [k, v] of graph.flatRouteMap)
|
|
54
|
+
flatRouteMap[k] = v;
|
|
55
|
+
const forwardEdgeMap = {};
|
|
56
|
+
for (const [k, v] of graph.forwardEdgeMap)
|
|
57
|
+
forwardEdgeMap[k] = v;
|
|
58
|
+
const reverseEdgeMap = {};
|
|
59
|
+
for (const [k, v] of graph.reverseEdgeMap)
|
|
60
|
+
reverseEdgeMap[k] = v;
|
|
50
61
|
return {
|
|
51
|
-
|
|
62
|
+
flatRouteMap,
|
|
63
|
+
rootPaths: graph.rootPaths,
|
|
64
|
+
forwardEdgeMap,
|
|
65
|
+
reverseEdgeMap,
|
|
66
|
+
allRoleSet: [...graph.allRoleSet],
|
|
52
67
|
unrefViews: unreferenced.map((n) => n.path),
|
|
53
68
|
};
|
|
54
69
|
}
|
|
@@ -76,16 +91,16 @@ function renderReverseReferences(graph, hideCode) {
|
|
|
76
91
|
// ============================================================================
|
|
77
92
|
// Section 3: Unreferenced Views
|
|
78
93
|
// ============================================================================
|
|
79
|
-
function renderUnreferencedViews(
|
|
94
|
+
function renderUnreferencedViews(graph, unrefViews) {
|
|
80
95
|
const lines = ['## 没有默认跳转且没有被引用的页面\n'];
|
|
81
|
-
if (
|
|
96
|
+
if (unrefViews.length) {
|
|
82
97
|
lines.push('**注意:以下页面没有默认跳转且没有被引用,可能实现存在问题。**\n');
|
|
83
|
-
for (const
|
|
84
|
-
const node =
|
|
98
|
+
for (const viewPath of unrefViews) {
|
|
99
|
+
const node = graph.flatRouteMap.get(viewPath);
|
|
85
100
|
if (!node)
|
|
86
101
|
continue;
|
|
87
102
|
const title = node.levels[node.levels.length - 1] || '';
|
|
88
|
-
lines.push(`- (${title})${node.path}(${node
|
|
103
|
+
lines.push(`- (${title})${node.path}(${formatParams(node)})${formatTags(node, { abbreviateRoles: false })}`);
|
|
89
104
|
}
|
|
90
105
|
}
|
|
91
106
|
else {
|
|
@@ -115,7 +130,7 @@ function renderViewSubtree(graph, path, lines, indent, opts, hideCode) {
|
|
|
115
130
|
return;
|
|
116
131
|
const title = node.levels[node.levels.length - 1] || '';
|
|
117
132
|
const prefix = makeTreePrefix(indent);
|
|
118
|
-
lines.push(`${prefix}(${title})${node.alias}(${node
|
|
133
|
+
lines.push(`${prefix}(${title})${node.alias}(${formatParams(node)})${formatTags(node, opts)}`);
|
|
119
134
|
// Show forward edges (outgoing navigation)
|
|
120
135
|
const edges = graph.forwardEdgeMap.get(path) || [];
|
|
121
136
|
for (const edge of edges) {
|
|
@@ -138,7 +153,7 @@ function renderReverseSubtree(graph, path, lines, indent, hideCode) {
|
|
|
138
153
|
return;
|
|
139
154
|
const title = node.levels[node.levels.length - 1] || '';
|
|
140
155
|
const prefix = makeTreePrefix(indent);
|
|
141
|
-
lines.push(`${prefix}(${title})${node.alias}(${node
|
|
156
|
+
lines.push(`${prefix}(${title})${node.alias}(${formatParams(node)})${formatTags(node, { abbreviateRoles: false })}`);
|
|
142
157
|
// Show reverse edges (incoming navigation)
|
|
143
158
|
const edges = graph.reverseEdgeMap.get(path) || [];
|
|
144
159
|
for (const edge of edges) {
|
|
@@ -163,7 +178,7 @@ function renderRoleSubtree(graph, path, lines, indent, role, reachable, hideCode
|
|
|
163
178
|
return;
|
|
164
179
|
const title = node.levels[node.levels.length - 1] || '';
|
|
165
180
|
const prefix = makeTreePrefix(indent);
|
|
166
|
-
lines.push(`${prefix}(${title})${node.alias}(${node
|
|
181
|
+
lines.push(`${prefix}(${title})${node.alias}(${formatParams(node)})${formatTags(node, { abbreviateRoles: true })}`);
|
|
167
182
|
// Show forward edges only if the role can use them
|
|
168
183
|
const edges = graph.forwardEdgeMap.get(path) || [];
|
|
169
184
|
for (const edge of edges) {
|
|
@@ -262,6 +277,9 @@ function canRoleUseEdge(edge, role) {
|
|
|
262
277
|
// ============================================================================
|
|
263
278
|
// Formatting Utilities
|
|
264
279
|
// ============================================================================
|
|
280
|
+
function formatParams(node) {
|
|
281
|
+
return node.paramsStrList?.join(', ') || '';
|
|
282
|
+
}
|
|
265
283
|
function formatTags(node, opts) {
|
|
266
284
|
const tags = [];
|
|
267
285
|
if (node.isIndex)
|