@lcap/nasl-language-server-helper 4.3.0-beta.10
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 +57 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @lcap/nasl-language-server-helper
|
|
2
|
+
|
|
3
|
+
这个包包含了用于NASL语言服务器开发和测试的辅助工具,主要用于生成fixture和测试数据。
|
|
4
|
+
|
|
5
|
+
## 使用方式
|
|
6
|
+
|
|
7
|
+
### 交互式UI模式(默认)
|
|
8
|
+
```bash
|
|
9
|
+
pnpm cli
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### 命令行模式
|
|
13
|
+
```bash
|
|
14
|
+
# 生成OQL测试用例
|
|
15
|
+
pnpm cli generate oql-testcases
|
|
16
|
+
|
|
17
|
+
# 查看帮助
|
|
18
|
+
pnpm cli --help
|
|
19
|
+
pnpm cli generate oql-testcases --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
详细使用说明请参考 [USAGE.md](./USAGE.md)
|
|
23
|
+
|
|
24
|
+
## 功能
|
|
25
|
+
|
|
26
|
+
### OQL相关工具
|
|
27
|
+
|
|
28
|
+
- `generate-all-apps-typescript.ts` - 生成所有应用的TypeScript代码并合并到一个文件
|
|
29
|
+
- `collect-oql.ts` - 收集应用中的OQL节点
|
|
30
|
+
- `process-app-oql.ts` - 处理单个应用的OQL节点,生成TypeScript代码
|
|
31
|
+
- `helper.ts` - OQL测试环境设置工具
|
|
32
|
+
|
|
33
|
+
### TypeScript分析工具
|
|
34
|
+
|
|
35
|
+
- `analyze-syntax-kinds.ts` - 分析TypeScript文件中的SyntaxKind统计
|
|
36
|
+
- `typescript-debug-helper.ts` - TypeScript调试辅助工具
|
|
37
|
+
|
|
38
|
+
### 平台API工具
|
|
39
|
+
|
|
40
|
+
- `app-dumper.ts` - 平台内部API封装,用于获取应用数据
|
|
41
|
+
- `utils.ts` - 通用工具函数
|
|
42
|
+
|
|
43
|
+
## 使用方法
|
|
44
|
+
|
|
45
|
+
这些工具主要用于开发和测试阶段,用于生成测试fixture和分析代码结构。它们与测试本身无关,但可以在不同的测试场景中复用。
|
|
46
|
+
|
|
47
|
+
## 构建
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pnpm build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 开发
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pnpm dev
|
|
57
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lcap/nasl-language-server-helper",
|
|
3
|
+
"description": "Helper utilities for NASL language server development and testing",
|
|
4
|
+
"version": "4.3.0-beta.10",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"nasl-helper": "./out/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./out",
|
|
10
|
+
"types": "./out",
|
|
11
|
+
"source": "./src",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"files": [
|
|
14
|
+
"out",
|
|
15
|
+
"README.md",
|
|
16
|
+
"package.json"
|
|
17
|
+
],
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@rsbuild/core": "^1.0.0",
|
|
20
|
+
"@types/crypto-js": "4.1.1",
|
|
21
|
+
"@types/lodash": "4.17.0",
|
|
22
|
+
"@types/node": "18.11.9",
|
|
23
|
+
"@types/semver": "7.7.1",
|
|
24
|
+
"axios": "1.6.8",
|
|
25
|
+
"commander": "^12.1.0",
|
|
26
|
+
"husky": "^8.0.3",
|
|
27
|
+
"lint-staged": "^13.2.3",
|
|
28
|
+
"lodash": "4.17.21",
|
|
29
|
+
"p-limit": "6.2.0",
|
|
30
|
+
"prettier": "^3.0.0",
|
|
31
|
+
"react-devtools-core": "6.1.5",
|
|
32
|
+
"rimraf": "5.0.5",
|
|
33
|
+
"tsx": "4.10.3",
|
|
34
|
+
"typescript": "5.4.4",
|
|
35
|
+
"@lcap/nasl-concepts": "4.3.0-beta.10",
|
|
36
|
+
"@lcap/nasl-tsconfig": "1.0.1",
|
|
37
|
+
"@lcap/nasl-types": "4.3.0-beta.10",
|
|
38
|
+
"@lcap/nasl-utils": "4.3.0-beta.10"
|
|
39
|
+
},
|
|
40
|
+
"lint-staged": {
|
|
41
|
+
"*.{ts,tsx}": [
|
|
42
|
+
"prettier --write",
|
|
43
|
+
"git add"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@types/react": "19.1.12",
|
|
48
|
+
"crypto-js": "4.1.1",
|
|
49
|
+
"ink": "5.2.1",
|
|
50
|
+
"ink-select-input": "6.2.0",
|
|
51
|
+
"ink-spinner": "5.0.0",
|
|
52
|
+
"ink-text-input": "6.0.0",
|
|
53
|
+
"react": "19.1.1",
|
|
54
|
+
"semver": "7.6.0",
|
|
55
|
+
"@lcap/nasl": "4.3.0-beta.10"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"clear": "rimraf ./out",
|
|
59
|
+
"cli": "tsx src/cli/index.tsx",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"format": "prettier --write .",
|
|
62
|
+
"format:check": "prettier --check .",
|
|
63
|
+
"build": "rsbuild build",
|
|
64
|
+
"dev": "pnpm run cli",
|
|
65
|
+
"build:cli": "rsbuild build"
|
|
66
|
+
}
|
|
67
|
+
}
|