@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.
- package/dist/bin/nasl.mjs +20 -4
- package/dist/bin/nasl.mjs.map +1 -1
- package/dist/bin/naslc.mjs +20 -4
- package/dist/bin/naslc.mjs.map +1 -1
- package/dist/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/out/services/resolve.d.ts.map +1 -1
- package/out/services/resolve.js +19 -3
- package/out/services/resolve.js.map +1 -1
- package/out/utils/logger.js +1 -1
- package/package.json +1 -1
package/dist/bin/nasl.mjs
CHANGED
|
@@ -37529,6 +37529,9 @@ function extractDeps(content) {
|
|
|
37529
37529
|
else if (/\.enums\.(\w+)\.(\w+)/.test(dep)) {
|
|
37530
37530
|
dep = dep.replace(/\.enums\.(\w+).+$/, '.enums.$1');
|
|
37531
37531
|
}
|
|
37532
|
+
else if (/app\.dataSources\.\w+\.entities\.\w+\.\w+$/.test(dep)) {
|
|
37533
|
+
continue; // 应该是写法有问题,跳过让后面的 checker 做检查
|
|
37534
|
+
}
|
|
37532
37535
|
dep = `${dep}.${dep.includes('.views.') ? 'tsx' : 'ts'}`;
|
|
37533
37536
|
deps.add(dep);
|
|
37534
37537
|
}
|
|
@@ -37537,9 +37540,14 @@ function extractDeps(content) {
|
|
|
37537
37540
|
/**
|
|
37538
37541
|
* 提取页面文件的签名,移除函数体
|
|
37539
37542
|
* @param content 页面文件内容
|
|
37540
|
-
* @
|
|
37543
|
+
* @param hasSubViews 是否有子页面
|
|
37544
|
+
* @returns 只包含签名的内容,或者返回 ElRouterView 的实现
|
|
37541
37545
|
*/
|
|
37542
|
-
function replaceViewAsSignature(content) {
|
|
37546
|
+
function replaceViewAsSignature(content, hasSubViews = false) {
|
|
37547
|
+
if (hasSubViews) {
|
|
37548
|
+
// 如果有子页面,替换为返回 ElRouterView 的函数
|
|
37549
|
+
return content.replace(/export function ((\w+)\([^)]*\)) \{[\s\S]+$/, 'export function $1 {\n return <ElRouterView />\n}');
|
|
37550
|
+
}
|
|
37543
37551
|
return content.replace(/export function ((\w+)\([^)]*\)) \{[\s\S]+$/, 'export declare function $1;');
|
|
37544
37552
|
}
|
|
37545
37553
|
/**
|
|
@@ -37568,7 +37576,15 @@ function processFileDeps(pathRelativeToSrc, srcDir, matchedFileSet, processedFil
|
|
|
37568
37576
|
const pathWithoutExt = pathRelativeToSrc.slice(0, -4);
|
|
37569
37577
|
const isEntryParent = Array.from(matchedFileSet).some((filePath) => filePath.startsWith(pathWithoutExt));
|
|
37570
37578
|
if (!isEntryParent) {
|
|
37571
|
-
|
|
37579
|
+
// 检查是否有子页面(路径更长的页面文件)
|
|
37580
|
+
const subViewPattern = `${pathWithoutExt}.views.*.tsx`;
|
|
37581
|
+
const subViews = globby.sync([subViewPattern], {
|
|
37582
|
+
cwd: srcDir,
|
|
37583
|
+
onlyFiles: true,
|
|
37584
|
+
absolute: false,
|
|
37585
|
+
});
|
|
37586
|
+
const hasSubViews = subViews.length > 0;
|
|
37587
|
+
fileInfo.content = replaceViewAsSignature(fileInfo.content, hasSubViews);
|
|
37572
37588
|
}
|
|
37573
37589
|
}
|
|
37574
37590
|
processedFileMap.set(pathRelativeToSrc, fileInfo);
|
|
@@ -38045,7 +38061,7 @@ async function build(entry, options) {
|
|
|
38045
38061
|
await justExecCommandSync(webpackArgs, outDir);
|
|
38046
38062
|
}
|
|
38047
38063
|
|
|
38048
|
-
var version = "0.1.
|
|
38064
|
+
var version = "0.1.13";
|
|
38049
38065
|
var pkg = {
|
|
38050
38066
|
version: version};
|
|
38051
38067
|
|