@nasl/cli 0.1.2 → 0.1.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/README.md +5 -5
- package/build/index.html +6 -6
- package/build/index.js +21 -17
- package/build/nasl.bundle.js +59104 -8
- package/build/webpack.config.js +74 -45
- package/out/apis/createAxios.d.ts +2 -0
- package/out/apis/createAxios.d.ts.map +1 -0
- package/out/apis/createAxios.js +17 -0
- package/out/apis/createAxios.js.map +1 -0
- package/out/apis/index.d.ts +2 -2
- package/out/apis/index.d.ts.map +1 -1
- package/out/apis/index.js +6 -6
- package/out/apis/index.js.map +1 -1
- package/out/bin/nasl.js +26 -7
- package/out/bin/nasl.js.map +1 -1
- package/out/bin/naslc.js +1 -1
- package/out/bin/naslc.js.map +1 -1
- package/out/commands/build.d.ts +8 -0
- package/out/commands/build.d.ts.map +1 -0
- package/out/commands/build.js +54 -0
- package/out/commands/build.js.map +1 -0
- package/out/commands/check.d.ts +2 -1
- package/out/commands/check.d.ts.map +1 -1
- package/out/commands/check.js +20 -12
- package/out/commands/check.js.map +1 -1
- package/out/commands/compile.d.ts +4 -3
- package/out/commands/compile.d.ts.map +1 -1
- package/out/commands/compile.js +8 -10
- package/out/commands/compile.js.map +1 -1
- package/out/commands/dep.d.ts +1 -1
- package/out/commands/dep.d.ts.map +1 -1
- package/out/commands/dep.js +3 -3
- package/out/commands/dep.js.map +1 -1
- package/out/commands/dev.d.ts +7 -1
- package/out/commands/dev.d.ts.map +1 -1
- package/out/commands/dev.js +14 -4
- package/out/commands/dev.js.map +1 -1
- package/out/commands/index.d.ts +3 -1
- package/out/commands/index.d.ts.map +1 -1
- package/out/commands/index.js +3 -1
- package/out/commands/index.js.map +1 -1
- package/out/commands/init.d.ts +1 -1
- package/out/commands/init.d.ts.map +1 -1
- package/out/commands/init.js +2 -2
- package/out/commands/init.js.map +1 -1
- package/out/index.d.ts +2 -11
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -11
- package/out/index.js.map +1 -1
- package/out/services/compose.d.ts.map +1 -1
- package/out/services/compose.js +29 -2
- package/out/services/compose.js.map +1 -1
- package/out/services/resolve.d.ts +2 -2
- package/out/services/resolve.d.ts.map +1 -1
- package/out/services/resolve.js +35 -30
- package/out/services/resolve.js.map +1 -1
- package/out/types/command.d.ts +4 -0
- package/out/types/command.d.ts.map +1 -0
- package/out/types/command.js +3 -0
- package/out/types/command.js.map +1 -0
- package/out/types/config.js +1 -1
- package/out/types/index.d.ts +1 -0
- package/out/types/index.d.ts.map +1 -1
- package/out/types/index.js +1 -0
- package/out/types/index.js.map +1 -1
- package/out/utils/logger.d.ts +1 -0
- package/out/utils/logger.d.ts.map +1 -1
- package/out/utils/logger.js +51 -0
- package/out/utils/logger.js.map +1 -1
- package/package.json +29 -11
package/README.md
CHANGED
|
@@ -57,10 +57,10 @@ nasl compile
|
|
|
57
57
|
nasl compile src/app.frontendTypes.pc.frontends.pc.views.dashboard.tsx
|
|
58
58
|
# 或使用简写
|
|
59
59
|
naslc src/app.frontendTypes.pc.frontends.pc.views.dashboard.tsx
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
naslc "src/app.enums.*.ts"
|
|
61
|
+
naslc "src/app.{*.entities.*.ts,structures.*.ts,enums.*.ts}"
|
|
62
|
+
naslc "src/app.logics.*.ts"
|
|
63
|
+
naslc "src/*.tsx"
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
### 检查 NASL 代码
|
|
@@ -95,7 +95,7 @@ nasl dep
|
|
|
95
95
|
nasl dev
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
启动开发服务后,默认可以访问 http://localhost:
|
|
98
|
+
启动开发服务后,默认可以访问 http://localhost:3100 查看预览效果。
|
|
99
99
|
|
|
100
100
|
## 开发 CLI 工具
|
|
101
101
|
|
package/build/index.html
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
<!-- <script src="https://ide-sandbox.lcap.codewave-test.163yun.com/dependency/lodash@4.17.21/lodash.js"></script> -->
|
|
8
8
|
<script src="https://ide-sandbox.lcap.codewave-test.163yun.com/dependency/vue@3.5.13/umd/vue.global.js"></script>
|
|
9
9
|
<script src="https://ide-sandbox.lcap.codewave-test.163yun.com/dependency/vue-router@4.5.0/umd/vue-router.global.js"></script>
|
|
10
|
-
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/pc-template-vue3@2.
|
|
11
|
-
<link rel="stylesheet" type="text/css" href="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.
|
|
12
|
-
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.
|
|
13
|
-
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.
|
|
14
|
-
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.
|
|
10
|
+
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/pc-template-vue3@2.2.0/cloudAdminDesigner.umd.min.js"></script>
|
|
11
|
+
<link rel="stylesheet" type="text/css" href="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.1.0/dist-theme/index.css" />
|
|
12
|
+
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.1.0/dist-theme/index.js"></script>
|
|
13
|
+
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.1.0/dist-theme/nasl.ui.json"></script>
|
|
14
|
+
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/@lcap/element-plus@1.1.0/dist-theme/i18n.json"></script>
|
|
15
15
|
<link rel="stylesheet" type="text/css" href="//minio-api.codewave-test.163yun.com/lowcode-static/packages/extension/cw_chart_js@0.2.2/dist-theme/index.css" />
|
|
16
16
|
<script src="//minio-api.codewave-test.163yun.com/lowcode-static/packages/extension/cw_chart_js@0.2.2/dist-theme/index.js"></script>
|
|
17
|
-
<script src="
|
|
17
|
+
<script src="/nasl.bundle.js"></script>
|
|
18
18
|
<!-- webpack will inject bundle.js here -->
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
package/build/index.js
CHANGED
|
@@ -6,24 +6,26 @@ import '@/backendMock';
|
|
|
6
6
|
import { routes, metaData } from '@/router';
|
|
7
7
|
import '@/index.css';
|
|
8
8
|
|
|
9
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
|
+
|
|
9
11
|
// 应用初始化
|
|
10
12
|
class AppHandler {
|
|
11
13
|
constructor() {}
|
|
12
14
|
|
|
13
15
|
// 处理路由相关
|
|
14
16
|
handleRouter() {
|
|
15
|
-
messager.sendCommand('getRoutes', [JSON.stringify(routes)]);
|
|
16
|
-
window.afterRouter = async (to, from) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
17
|
+
// messager.sendCommand('getRoutes', [JSON.stringify(routes)]);
|
|
18
|
+
// window.afterRouter = async (to, from) => {
|
|
19
|
+
// try {
|
|
20
|
+
// // 获取 messager 实例
|
|
21
|
+
// const messager = window.messager;
|
|
22
|
+
// if (messager && typeof messager.sendCommand === 'function') {
|
|
23
|
+
// await messager.sendCommand('routeChanged', to.path);
|
|
24
|
+
// }
|
|
25
|
+
// } catch (err) {
|
|
26
|
+
// console.error('路由变化处理失败:', err);
|
|
27
|
+
// }
|
|
28
|
+
// };
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
initLogic(options = {}, Basic) {
|
|
@@ -63,9 +65,9 @@ class AppHandler {
|
|
|
63
65
|
const argNames =
|
|
64
66
|
func
|
|
65
67
|
.toString()
|
|
66
|
-
.match(/function\s*\w*\((
|
|
68
|
+
.match(/function\s*\w*\(([^)]*?)\)\s*\{/)?.[1]
|
|
67
69
|
?.split(',')
|
|
68
|
-
.map((name) => name.replace(
|
|
70
|
+
.map((name) => name.replace(/=.*$|\/\*.*?\*\//g, '').trim()) || [];
|
|
69
71
|
const args = argNames.map((name) => body[name]);
|
|
70
72
|
result = func.call(obj, ...args);
|
|
71
73
|
}
|
|
@@ -89,12 +91,14 @@ class AppHandler {
|
|
|
89
91
|
enabled: true,
|
|
90
92
|
initLogic: this.initLogic,
|
|
91
93
|
};
|
|
92
|
-
window.LcapVueRouterConfig = {
|
|
93
|
-
mode: 'abstract'
|
|
94
|
-
};
|
|
95
94
|
let app = await window.cloudAdminDesigner.init(platformConfig.appConfig, platformConfig, routes, { ...metaData, backendApp: window.backendApp, override });
|
|
96
95
|
app.use(window.Cw_chart_js);
|
|
97
96
|
app.use(window.ElementPlus);
|
|
97
|
+
window.frontendApp = app;
|
|
98
|
+
|
|
99
|
+
app.config.globalProperties.$utils.__proto__.isArrayInBounds = function (arr, index, canLast) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
98
102
|
} catch (error) {
|
|
99
103
|
console.error('Failed to initialize: sandbox:\n', error);
|
|
100
104
|
}
|