@aiao/rxdb-client-generator 0.0.1 → 0.0.2
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/RxDBClientGenerator.d.ts +9 -6
- package/RxDBClientGenerator.utils.d.ts +2 -2
- package/cli.d.ts +2 -0
- package/cli.js +94 -0
- package/generator_entity_definition.d.ts +1 -1
- package/generator_entity_properties.d.ts +1 -1
- package/generator_entity_relations.d.ts +1 -1
- package/generator_repository_methods.d.ts +1 -1
- package/generator_tree_repository_methods.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +497 -292
- package/package.json +25 -8
- package/ts-morph-browser.d.ts +124 -0
- package/vite.d.ts +6 -0
- package/vite.js +11 -0
package/package.json
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiao/rxdb-client-generator",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"@aiao/rxdb": "0.0.1",
|
|
9
|
-
"ts-morph-browser": "^25.0.3"
|
|
6
|
+
"bin": {
|
|
7
|
+
"rxdb-client-generator": "./cli.js"
|
|
10
8
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"@aiao/utils": "0.0.2",
|
|
11
|
+
"@aiao/rxdb": "0.0.2",
|
|
12
|
+
"type-fest": "^4.41.0",
|
|
13
|
+
"glob": "^11.0.3"
|
|
14
|
+
},
|
|
15
|
+
"optionalDependencies": {
|
|
16
|
+
"vite": "^7.1.2",
|
|
17
|
+
"ts-morph": "^26.0.0"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./index.js",
|
|
22
|
+
"types": "./index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./cli": {
|
|
25
|
+
"import": "./cli.js"
|
|
26
|
+
},
|
|
27
|
+
"./vite": {
|
|
28
|
+
"import": "./vite.js",
|
|
29
|
+
"types": "./vite.d.ts"
|
|
30
|
+
}
|
|
14
31
|
},
|
|
15
32
|
"publishConfig": {
|
|
16
33
|
"access": "public"
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 轻量级 TypeScript 解析器实现
|
|
3
|
+
* 用于替代 ts-morph 在浏览器上的生成,减少包大小
|
|
4
|
+
*/
|
|
5
|
+
export declare enum VariableDeclarationKind {
|
|
6
|
+
Var = "var",
|
|
7
|
+
Let = "let",
|
|
8
|
+
Const = "const"
|
|
9
|
+
}
|
|
10
|
+
export type OptionalKind<T> = T;
|
|
11
|
+
export interface PropertyDeclarationStructure {
|
|
12
|
+
name: string;
|
|
13
|
+
type?: string;
|
|
14
|
+
initializer?: string;
|
|
15
|
+
docs?: string[];
|
|
16
|
+
isReadonly?: boolean;
|
|
17
|
+
isStatic?: boolean;
|
|
18
|
+
hasQuestionToken?: boolean;
|
|
19
|
+
hasExclamationToken?: boolean;
|
|
20
|
+
scope?: any;
|
|
21
|
+
}
|
|
22
|
+
export interface MethodDeclarationStructure {
|
|
23
|
+
name: string;
|
|
24
|
+
returnType?: string;
|
|
25
|
+
parameters?: any[];
|
|
26
|
+
docs?: string[];
|
|
27
|
+
isStatic?: boolean;
|
|
28
|
+
isAsync?: boolean;
|
|
29
|
+
hasQuestionToken?: boolean;
|
|
30
|
+
scope?: any;
|
|
31
|
+
statements?: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface ClassDeclarationStructure {
|
|
34
|
+
name: string;
|
|
35
|
+
extends?: string;
|
|
36
|
+
implements?: string[];
|
|
37
|
+
docs?: string[];
|
|
38
|
+
isExported?: boolean;
|
|
39
|
+
hasDeclareKeyword?: boolean;
|
|
40
|
+
properties?: PropertyDeclarationStructure[];
|
|
41
|
+
methods?: MethodDeclarationStructure[];
|
|
42
|
+
decorators?: any[];
|
|
43
|
+
}
|
|
44
|
+
export interface InterfaceDeclarationStructure {
|
|
45
|
+
name: string;
|
|
46
|
+
extends?: string[];
|
|
47
|
+
docs?: string[];
|
|
48
|
+
isExported?: boolean;
|
|
49
|
+
properties?: PropertyDeclarationStructure[];
|
|
50
|
+
}
|
|
51
|
+
export interface ModuleDeclarationStructure {
|
|
52
|
+
name: string;
|
|
53
|
+
hasDeclareKeyword?: boolean;
|
|
54
|
+
docs?: string[];
|
|
55
|
+
interfaces?: InterfaceDeclarationStructure[];
|
|
56
|
+
}
|
|
57
|
+
export interface TypeAliasDeclarationStructure {
|
|
58
|
+
name: string;
|
|
59
|
+
type: string;
|
|
60
|
+
docs?: string[];
|
|
61
|
+
isExported?: boolean;
|
|
62
|
+
hasDeclareKeyword?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ImportDeclarationStructure {
|
|
65
|
+
namedImports?: string[];
|
|
66
|
+
moduleSpecifier: string;
|
|
67
|
+
isTypeOnly?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface VariableStatementStructure {
|
|
70
|
+
declarationKind: VariableDeclarationKind;
|
|
71
|
+
hasDeclareKeyword?: boolean;
|
|
72
|
+
isExported?: boolean;
|
|
73
|
+
declarations: Array<{
|
|
74
|
+
name: string;
|
|
75
|
+
type?: string;
|
|
76
|
+
initializer?: string;
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
79
|
+
export interface Node {
|
|
80
|
+
getDecorators(): Decorator[];
|
|
81
|
+
getName(): string | undefined;
|
|
82
|
+
getBaseClass(): Node | undefined;
|
|
83
|
+
getImplements(): Node[];
|
|
84
|
+
getText(): string;
|
|
85
|
+
getArguments?(): Node[];
|
|
86
|
+
}
|
|
87
|
+
export interface Decorator {
|
|
88
|
+
getName(): string;
|
|
89
|
+
getExpression(): Node;
|
|
90
|
+
}
|
|
91
|
+
export interface ClassDeclaration extends Node {
|
|
92
|
+
addJsDoc(doc: string): void;
|
|
93
|
+
addProperties(properties: PropertyDeclarationStructure[]): void;
|
|
94
|
+
addConstructor(constructor: any): void;
|
|
95
|
+
addMethods(methods: MethodDeclarationStructure[]): void;
|
|
96
|
+
properties?: PropertyDeclarationStructure[];
|
|
97
|
+
methods?: MethodDeclarationStructure[];
|
|
98
|
+
constructorData?: any;
|
|
99
|
+
jsDoc?: string[];
|
|
100
|
+
}
|
|
101
|
+
export interface SourceFile {
|
|
102
|
+
addClass(structure: ClassDeclarationStructure): ClassDeclaration;
|
|
103
|
+
addInterface(structure: InterfaceDeclarationStructure): any;
|
|
104
|
+
addModule(structure: ModuleDeclarationStructure): any;
|
|
105
|
+
addTypeAlias(structure: TypeAliasDeclarationStructure): any;
|
|
106
|
+
addImportDeclaration(structure: ImportDeclarationStructure): void;
|
|
107
|
+
addVariableStatement(structure: VariableStatementStructure): void;
|
|
108
|
+
getClasses(): ClassDeclaration[];
|
|
109
|
+
getFilePath(): string;
|
|
110
|
+
getText(): string;
|
|
111
|
+
setContent(content: string): void;
|
|
112
|
+
save(): Promise<void>;
|
|
113
|
+
saveSync(): void;
|
|
114
|
+
}
|
|
115
|
+
export declare class Project {
|
|
116
|
+
private files;
|
|
117
|
+
createSourceFile(filePath: string, content?: string): SourceFile;
|
|
118
|
+
addSourceFileAtPath(filePath: string): SourceFile;
|
|
119
|
+
getSourceFiles(): SourceFile[];
|
|
120
|
+
}
|
|
121
|
+
export declare const Node: {
|
|
122
|
+
isDecoratable(node: any): node is Node;
|
|
123
|
+
isCallExpression(node: any): boolean;
|
|
124
|
+
};
|
package/vite.d.ts
ADDED