@nasl/cli 0.1.12 → 0.1.13
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/bin/nasl.mjs +17 -4
- package/dist/bin/nasl.mjs.map +1 -1
- package/dist/bin/naslc.mjs +17 -4
- package/dist/bin/naslc.mjs.map +1 -1
- package/dist/index.mjs +16 -3
- package/dist/index.mjs.map +1 -1
- package/out/services/resolve.d.ts.map +1 -1
- package/out/services/resolve.js +16 -3
- package/out/services/resolve.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/naslc.mjs
CHANGED
|
@@ -37452,9 +37452,14 @@ function extractDeps(content) {
|
|
|
37452
37452
|
/**
|
|
37453
37453
|
* 提取页面文件的签名,移除函数体
|
|
37454
37454
|
* @param content 页面文件内容
|
|
37455
|
-
* @
|
|
37455
|
+
* @param hasSubViews 是否有子页面
|
|
37456
|
+
* @returns 只包含签名的内容,或者返回 ElRouterView 的实现
|
|
37456
37457
|
*/
|
|
37457
|
-
function replaceViewAsSignature(content) {
|
|
37458
|
+
function replaceViewAsSignature(content, hasSubViews = false) {
|
|
37459
|
+
if (hasSubViews) {
|
|
37460
|
+
// 如果有子页面,替换为返回 ElRouterView 的函数
|
|
37461
|
+
return content.replace(/export function ((\w+)\([^)]*\)) \{[\s\S]+$/, 'export function $1 {\n return <ElRouterView />\n}');
|
|
37462
|
+
}
|
|
37458
37463
|
return content.replace(/export function ((\w+)\([^)]*\)) \{[\s\S]+$/, 'export declare function $1;');
|
|
37459
37464
|
}
|
|
37460
37465
|
/**
|
|
@@ -37483,7 +37488,15 @@ function processFileDeps(pathRelativeToSrc, srcDir, matchedFileSet, processedFil
|
|
|
37483
37488
|
const pathWithoutExt = pathRelativeToSrc.slice(0, -4);
|
|
37484
37489
|
const isEntryParent = Array.from(matchedFileSet).some((filePath) => filePath.startsWith(pathWithoutExt));
|
|
37485
37490
|
if (!isEntryParent) {
|
|
37486
|
-
|
|
37491
|
+
// 检查是否有子页面(路径更长的页面文件)
|
|
37492
|
+
const subViewPattern = `${pathWithoutExt}.views.*.tsx`;
|
|
37493
|
+
const subViews = globby.sync([subViewPattern], {
|
|
37494
|
+
cwd: srcDir,
|
|
37495
|
+
onlyFiles: true,
|
|
37496
|
+
absolute: false,
|
|
37497
|
+
});
|
|
37498
|
+
const hasSubViews = subViews.length > 0;
|
|
37499
|
+
fileInfo.content = replaceViewAsSignature(fileInfo.content, hasSubViews);
|
|
37487
37500
|
}
|
|
37488
37501
|
}
|
|
37489
37502
|
processedFileMap.set(pathRelativeToSrc, fileInfo);
|
|
@@ -37680,7 +37693,7 @@ async function tryCompile(entry, options) {
|
|
|
37680
37693
|
}
|
|
37681
37694
|
}
|
|
37682
37695
|
|
|
37683
|
-
var version = "0.1.
|
|
37696
|
+
var version = "0.1.13";
|
|
37684
37697
|
var pkg = {
|
|
37685
37698
|
version: version};
|
|
37686
37699
|
|