@nasl/cli 0.1.10 → 0.1.12
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/build/index.js +3 -0
- package/dist/bin/nasl.mjs +16 -3
- package/dist/bin/nasl.mjs.map +1 -1
- package/dist/bin/naslc.mjs +12 -2
- package/dist/bin/naslc.mjs.map +1 -1
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/out/bin/nasl.js +1 -0
- package/out/bin/nasl.js.map +1 -1
- package/out/commands/dev.d.ts +1 -0
- package/out/commands/dev.d.ts.map +1 -1
- package/out/commands/dev.js +2 -0
- package/out/commands/dev.js.map +1 -1
- package/out/services/resolve.d.ts.map +1 -1
- package/out/services/resolve.js +3 -0
- package/out/services/resolve.js.map +1 -1
- package/out/utils/logger.d.ts.map +1 -1
- package/out/utils/logger.js +10 -3
- package/out/utils/logger.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -8,6 +8,9 @@ import '@/index.css';
|
|
|
8
8
|
|
|
9
9
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
10
|
|
|
11
|
+
window.LcapMicro = window.LcapMicro || {};
|
|
12
|
+
window.LcapMicro.routePrefix = __webpack_public_path__;
|
|
13
|
+
|
|
11
14
|
// 应用初始化
|
|
12
15
|
class AppHandler {
|
|
13
16
|
constructor() {}
|
package/dist/bin/nasl.mjs
CHANGED
|
@@ -8198,7 +8198,7 @@ function fastLogToFile(entry, suffix, content) {
|
|
|
8198
8198
|
const hourInDir = parseInt(timeInDir.slice(0, 2), 10);
|
|
8199
8199
|
// 跨天则累加 24 小时
|
|
8200
8200
|
const hourStr = (now.hour() >= hourInDir ? now.hour() : Math.ceil(hourInDir / 24) * 24 + now.hour()).toString().padStart(2, '0');
|
|
8201
|
-
const entryName = sysPath.basename(Array.isArray(entry) ? entry[0] || '*' : entry).replace(/[\[\]\(\)\{\}
|
|
8201
|
+
const entryName = sysPath.basename(Array.isArray(entry) ? entry[0] || '*' : entry).replace(/[\[\]\(\)\{\}\+\-\*\?\|\^\$\#\:\,\\\/\s]+/g, '_');
|
|
8202
8202
|
const filePath = sysPath.resolve(logDir, `${hourStr}${now.format('mmss_SSS')}-${entryName}-${suffix}`);
|
|
8203
8203
|
libExports.outputFileSync(filePath, content);
|
|
8204
8204
|
}
|
|
@@ -8284,7 +8284,14 @@ class ConsoleLogger extends BaseLogger {
|
|
|
8284
8284
|
}
|
|
8285
8285
|
}
|
|
8286
8286
|
exit(code) {
|
|
8287
|
-
process.
|
|
8287
|
+
if (process.argv[1]?.endsWith('/nasl')) { // 添加保险措施,避免在非 CLI 环境下退出
|
|
8288
|
+
process.exit(code);
|
|
8289
|
+
}
|
|
8290
|
+
else {
|
|
8291
|
+
if (code)
|
|
8292
|
+
throw new Error(`Error with code: ${code}`);
|
|
8293
|
+
return undefined;
|
|
8294
|
+
}
|
|
8288
8295
|
}
|
|
8289
8296
|
}
|
|
8290
8297
|
class ConsoleLoggerWithoutExit extends ConsoleLogger {
|
|
@@ -37522,6 +37529,9 @@ function extractDeps(content) {
|
|
|
37522
37529
|
else if (/\.enums\.(\w+)\.(\w+)/.test(dep)) {
|
|
37523
37530
|
dep = dep.replace(/\.enums\.(\w+).+$/, '.enums.$1');
|
|
37524
37531
|
}
|
|
37532
|
+
else if (/app\.dataSources\.\w+\.entities\.\w+\.\w+$/.test(dep)) {
|
|
37533
|
+
continue; // 应该是写法有问题,跳过让后面的 checker 做检查
|
|
37534
|
+
}
|
|
37525
37535
|
dep = `${dep}.${dep.includes('.views.') ? 'tsx' : 'ts'}`;
|
|
37526
37536
|
deps.add(dep);
|
|
37527
37537
|
}
|
|
@@ -37998,6 +38008,8 @@ async function startWebpackDevServer(outDir, options, logger) {
|
|
|
37998
38008
|
webpackArgs += ' --no-open';
|
|
37999
38009
|
if (options?.hot === false)
|
|
38000
38010
|
webpackArgs += ' --no-hot';
|
|
38011
|
+
if (options?.publicPath)
|
|
38012
|
+
webpackArgs += ` --output-public-path "${options.publicPath}"`;
|
|
38001
38013
|
logger?.info(webpackArgs);
|
|
38002
38014
|
// 使用 spawn 而不是 spawnSync,以便进程可以常驻
|
|
38003
38015
|
const webpackProcess = spawn(webpackArgs, {
|
|
@@ -38036,7 +38048,7 @@ async function build(entry, options) {
|
|
|
38036
38048
|
await justExecCommandSync(webpackArgs, outDir);
|
|
38037
38049
|
}
|
|
38038
38050
|
|
|
38039
|
-
var version = "0.1.
|
|
38051
|
+
var version = "0.1.12";
|
|
38040
38052
|
var pkg = {
|
|
38041
38053
|
version: version};
|
|
38042
38054
|
|
|
@@ -38094,6 +38106,7 @@ program
|
|
|
38094
38106
|
.description('启动开发服务')
|
|
38095
38107
|
.option('-p, --port <port>', '指定开发服务器端口号')
|
|
38096
38108
|
.option('-h, --host <host>', '指定开发服务器主机名')
|
|
38109
|
+
.option('--public-path <public-path>', '指定公共路径')
|
|
38097
38110
|
.option('--no-open', '不在浏览器中自动打开')
|
|
38098
38111
|
.option('--no-hot', '禁用热模块替换 (HMR)')
|
|
38099
38112
|
.action(async (entry, options) => {
|