@vtj/parser 0.12.55 → 0.12.57
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/index.cjs +27 -8
- package/dist/index.mjs +1159 -709
- package/package.json +5 -3
- package/types/index.d.ts +1 -0
- package/types/shared/utils.d.ts +2 -0
- package/types/tools/fixer.d.ts +7 -0
- package/types/tools/icons.d.ts +4 -0
- package/types/tools/index.d.ts +2 -0
- package/types/tools/state.d.ts +14 -0
- package/types/tools/validator.d.ts +16 -0
- package/types/version.d.ts +2 -2
- package/types/vue/utils.d.ts +2 -2
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vtj/parser",
|
3
3
|
"private": false,
|
4
|
-
"version": "0.12.
|
4
|
+
"version": "0.12.57",
|
5
5
|
"type": "module",
|
6
6
|
"keywords": [
|
7
7
|
"低代码引擎",
|
@@ -21,17 +21,19 @@
|
|
21
21
|
"author": "chenhuachun",
|
22
22
|
"license": "MIT",
|
23
23
|
"dependencies": {
|
24
|
+
"@babel/core": "~7.28.0",
|
24
25
|
"@babel/generator": "~7.28.0",
|
25
26
|
"@babel/parser": "~7.28.0",
|
26
27
|
"@babel/traverse": "~7.28.0",
|
28
|
+
"@babel/types": "~7.28.0",
|
27
29
|
"@vue/compiler-dom": "~3.5.13",
|
28
30
|
"@vue/compiler-sfc": "~3.5.13",
|
29
31
|
"htmlparser2": "~10.0.0",
|
30
32
|
"postcss": "~8.5.0",
|
31
33
|
"sass": "~1.89.0",
|
34
|
+
"@vtj/coder": "~0.12.57",
|
32
35
|
"@vtj/base": "~0.12.2",
|
33
|
-
"@vtj/
|
34
|
-
"@vtj/core": "~0.12.55"
|
36
|
+
"@vtj/core": "~0.12.57"
|
35
37
|
},
|
36
38
|
"devDependencies": {
|
37
39
|
"@vtj/cli": "~0.12.8"
|
package/types/index.d.ts
CHANGED
package/types/shared/utils.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Visitor } from '@babel/core';
|
1
2
|
import { Node, File } from '@babel/types';
|
2
3
|
import { TraverseOptions } from '@babel/traverse';
|
3
4
|
import { JSExpression, JSFunction, NodeSchema } from '@vtj/core';
|
@@ -14,3 +15,4 @@ export declare function isJSExpression(data: any): data is JSExpression;
|
|
14
15
|
export declare function isJSFunction(x: any): x is JSFunction;
|
15
16
|
export declare function isJSCode(data: unknown): data is JSExpression | JSFunction;
|
16
17
|
export declare function isNodeSchema(node: NodeSchema | JSExpression | string | null): node is NodeSchema;
|
18
|
+
export declare function transformScript(script: string, visitor: Visitor): string;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
interface FixResult {
|
2
|
+
fixed: boolean;
|
3
|
+
originalCode: string;
|
4
|
+
fixedCode: string;
|
5
|
+
changes: Array<{
|
6
|
+
line: number;
|
7
|
+
column: number;
|
8
|
+
original: string;
|
9
|
+
fixed: string;
|
10
|
+
message: string;
|
11
|
+
}>;
|
12
|
+
}
|
13
|
+
export declare function checkAndFixStatePrefix(vueCode: string): FixResult;
|
14
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export type ValidationResult = {
|
2
|
+
valid: boolean;
|
3
|
+
errors: string[];
|
4
|
+
illegalVantIcons: string[];
|
5
|
+
illegalVtjIcons: string[];
|
6
|
+
};
|
7
|
+
export declare class ComponentValidator {
|
8
|
+
validate(code: string): ValidationResult;
|
9
|
+
private isCompleteSFC;
|
10
|
+
private checkSetup;
|
11
|
+
private findVantIcons;
|
12
|
+
private checkVantIcons;
|
13
|
+
private findVtjIcons;
|
14
|
+
private checkVtjIcons;
|
15
|
+
private hasUnchangedComment;
|
16
|
+
}
|
package/types/version.d.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
3
3
|
* @name @vtj/parser
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
5
|
-
* @version 0.12.
|
5
|
+
* @version 0.12.56
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
7
|
*/
|
8
|
-
export declare const version = "0.12.
|
8
|
+
export declare const version = "0.12.56";
|
package/types/vue/utils.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { JSExpression, JSFunction, PlatformType } from '@vtj/core';
|
1
|
+
import { JSExpression, JSFunction, PlatformType, DataSourceSchema } from '@vtj/core';
|
2
2
|
export interface ExpressionOptions {
|
3
3
|
platform: PlatformType;
|
4
4
|
context: Record<string, Set<string>>;
|
@@ -18,5 +18,5 @@ export declare function isUniTags(tag: string, platform?: PlatformType): boolean
|
|
18
18
|
export declare function formatTagName(tag: string, platform?: PlatformType): string;
|
19
19
|
export declare function isScss(source: string): boolean;
|
20
20
|
export declare function styleToJson(style: string): Record<string, string>;
|
21
|
-
export declare function validate(content: string): string[];
|
22
21
|
export declare function mergeClass(staticClass: string, expSource: string, type: 'ObjectExpression' | 'ArrayExpression'): string | undefined;
|
22
|
+
export declare function extractDataSource(comment?: string): DataSourceSchema | null;
|