@nasl/cli 0.1.11 → 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.
@@ -37441,6 +37441,9 @@ function extractDeps(content) {
37441
37441
  else if (/\.enums\.(\w+)\.(\w+)/.test(dep)) {
37442
37442
  dep = dep.replace(/\.enums\.(\w+).+$/, '.enums.$1');
37443
37443
  }
37444
+ else if (/app\.dataSources\.\w+\.entities\.\w+\.\w+$/.test(dep)) {
37445
+ continue; // 应该是写法有问题,跳过让后面的 checker 做检查
37446
+ }
37444
37447
  dep = `${dep}.${dep.includes('.views.') ? 'tsx' : 'ts'}`;
37445
37448
  deps.add(dep);
37446
37449
  }
@@ -37449,9 +37452,14 @@ function extractDeps(content) {
37449
37452
  /**
37450
37453
  * 提取页面文件的签名,移除函数体
37451
37454
  * @param content 页面文件内容
37452
- * @returns 只包含签名的内容
37455
+ * @param hasSubViews 是否有子页面
37456
+ * @returns 只包含签名的内容,或者返回 ElRouterView 的实现
37453
37457
  */
37454
- 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
+ }
37455
37463
  return content.replace(/export function ((\w+)\([^)]*\)) \{[\s\S]+$/, 'export declare function $1;');
37456
37464
  }
37457
37465
  /**
@@ -37480,7 +37488,15 @@ function processFileDeps(pathRelativeToSrc, srcDir, matchedFileSet, processedFil
37480
37488
  const pathWithoutExt = pathRelativeToSrc.slice(0, -4);
37481
37489
  const isEntryParent = Array.from(matchedFileSet).some((filePath) => filePath.startsWith(pathWithoutExt));
37482
37490
  if (!isEntryParent) {
37483
- fileInfo.content = replaceViewAsSignature(fileInfo.content);
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);
37484
37500
  }
37485
37501
  }
37486
37502
  processedFileMap.set(pathRelativeToSrc, fileInfo);
@@ -37677,7 +37693,7 @@ async function tryCompile(entry, options) {
37677
37693
  }
37678
37694
  }
37679
37695
 
37680
- var version = "0.1.11";
37696
+ var version = "0.1.13";
37681
37697
  var pkg = {
37682
37698
  version: version};
37683
37699