@vue-godot/cli 0.0.1
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 +112 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +188 -0
- package/dist/create.d.ts +5 -0
- package/dist/create.js +77 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +129 -0
- package/dist/integrate.d.ts +13 -0
- package/dist/integrate.js +153 -0
- package/package.json +37 -0
- package/templates/godot/.editorconfig +4 -0
- package/templates/godot/.gitattributes +2 -0
- package/templates/godot/app.tscn +12 -0
- package/templates/godot/icon.svg +1 -0
- package/templates/godot/project.godot +16 -0
- package/templates/typings/.gdignore +1 -0
- package/templates/typings/app.nodes.gen.d.ts +5 -0
- package/templates/typings/godot.minimal.d.ts +282 -0
- package/templates/typings/godot.mix.d.ts +257 -0
- package/templates/typings/godot.vue-components.gen.d.ts +216 -0
- package/templates/typings/godot.worker.d.ts +32 -0
- package/templates/typings/godot0.gen.d.ts +9973 -0
- package/templates/typings/godot1.gen.d.ts +9254 -0
- package/templates/typings/godot2.gen.d.ts +9279 -0
- package/templates/typings/godot3.gen.d.ts +9210 -0
- package/templates/typings/godot4.gen.d.ts +9253 -0
- package/templates/typings/godot5.gen.d.ts +9265 -0
- package/templates/typings/godot6.gen.d.ts +9508 -0
- package/templates/typings/godot7.gen.d.ts +9310 -0
- package/templates/typings/godot8.gen.d.ts +8552 -0
- package/templates/typings/jsb.editor.bundle.d.ts +73 -0
- package/templates/typings/jsb.runtime.bundle.d.ts +91 -0
- package/templates/vue/src/.gdignore +0 -0
- package/templates/vue/src/App.vue +5 -0
- package/templates/vue/src/env.d.ts +7 -0
- package/templates/vue/src/main.ts +10 -0
- package/templates/vue/tsconfig.json +17 -0
- package/templates/vue/vite.config.ts +38 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare module "jsb.editor.codegen" {
|
|
2
|
+
import * as jsb from "godot-jsb";
|
|
3
|
+
export class TypeDB {
|
|
4
|
+
singletons: {
|
|
5
|
+
[name: string]: jsb.editor.SingletonInfo;
|
|
6
|
+
};
|
|
7
|
+
classes: {
|
|
8
|
+
[name: string]: jsb.editor.ClassInfo;
|
|
9
|
+
};
|
|
10
|
+
primitive_types: {
|
|
11
|
+
[name: string]: jsb.editor.PrimitiveClassInfo;
|
|
12
|
+
};
|
|
13
|
+
primitive_type_names: {
|
|
14
|
+
[type: number]: string;
|
|
15
|
+
};
|
|
16
|
+
globals: {
|
|
17
|
+
[name: string]: jsb.editor.GlobalConstantInfo;
|
|
18
|
+
};
|
|
19
|
+
utilities: {
|
|
20
|
+
[name: string]: jsb.editor.MethodBind;
|
|
21
|
+
};
|
|
22
|
+
class_docs: {
|
|
23
|
+
[name: string]: jsb.editor.ClassDoc | false;
|
|
24
|
+
};
|
|
25
|
+
constructor();
|
|
26
|
+
find_doc(class_name: string): jsb.editor.ClassDoc | undefined;
|
|
27
|
+
is_primitive_type(name: string): boolean;
|
|
28
|
+
is_valid_method_name(name: string): boolean;
|
|
29
|
+
make_classname(class_name: string, used_as_input: boolean): string;
|
|
30
|
+
make_typename(info: jsb.editor.PropertyInfo, used_as_input: boolean): string;
|
|
31
|
+
make_arg(info: jsb.editor.PropertyInfo, type_replacer?: (name: string) => string): string;
|
|
32
|
+
make_literal_value(value: jsb.editor.DefaultArgumentInfo): string;
|
|
33
|
+
replace_type_inplace(name: string | undefined, type_replacer?: (name: string) => string): string;
|
|
34
|
+
make_arg_default_value(method_info: jsb.editor.MethodBind, index: number, type_replacer?: (name: string) => string): string;
|
|
35
|
+
make_args(method_info: jsb.editor.MethodBind, type_replacer?: (name: string) => string): string;
|
|
36
|
+
make_return(method_info: jsb.editor.MethodBind, type_replacer?: (name: string) => string): string;
|
|
37
|
+
make_signal_type(method_info: jsb.editor.MethodBind): string;
|
|
38
|
+
}
|
|
39
|
+
export class TSDCodeGen {
|
|
40
|
+
private _split_index;
|
|
41
|
+
private _outDir;
|
|
42
|
+
private _splitter;
|
|
43
|
+
private _types;
|
|
44
|
+
constructor(outDir: string);
|
|
45
|
+
private make_path;
|
|
46
|
+
private new_splitter;
|
|
47
|
+
private split;
|
|
48
|
+
private cleanup;
|
|
49
|
+
has_class(name?: string): boolean;
|
|
50
|
+
emit(): Promise<void>;
|
|
51
|
+
private emit_utility;
|
|
52
|
+
private emit_global;
|
|
53
|
+
private emit_mock;
|
|
54
|
+
private emit_singleton;
|
|
55
|
+
private emit_godot_primitive;
|
|
56
|
+
private emit_godot_class;
|
|
57
|
+
}
|
|
58
|
+
export class SceneTSDCodeGen {
|
|
59
|
+
private _out_dir;
|
|
60
|
+
private _scene_paths;
|
|
61
|
+
private _types;
|
|
62
|
+
constructor(out_dir: string, scene_paths: string[]);
|
|
63
|
+
private make_path;
|
|
64
|
+
emit(): Promise<void>;
|
|
65
|
+
private emit_children_node_types;
|
|
66
|
+
private emit_scene_node_types;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
declare module "jsb.editor.main" {
|
|
70
|
+
import { PackedStringArray } from "godot";
|
|
71
|
+
export function auto_complete(pattern: string): PackedStringArray;
|
|
72
|
+
export function run_npm_install(): void;
|
|
73
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
declare module "godot.annotations" {
|
|
2
|
+
import { PropertyHint, PropertyUsageFlags, Variant, MultiplayerAPI, MultiplayerPeer } from "godot";
|
|
3
|
+
import * as jsb from "godot-jsb";
|
|
4
|
+
export interface EnumPlaceholder {
|
|
5
|
+
}
|
|
6
|
+
export interface TypePairPlaceholder {
|
|
7
|
+
}
|
|
8
|
+
export function EnumType(type: any): EnumPlaceholder;
|
|
9
|
+
export function TypePair(key: ClassDescriptor, value: ClassDescriptor): TypePairPlaceholder;
|
|
10
|
+
export type ClassDescriptor = Function | Symbol | EnumPlaceholder | TypePairPlaceholder;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export function signal(): (target: any, key: string) => void;
|
|
15
|
+
export function export_multiline(): (target: any, key: string) => void;
|
|
16
|
+
export function export_range(min: number, max: number, step?: number, ...extra_hints: string[]): (target: any, key: string) => void;
|
|
17
|
+
export function export_range_i(min: number, max: number, step?: number, ...extra_hints: string[]): (target: any, key: string) => void;
|
|
18
|
+
/** String as a path to a file, custom filter provided as hint. */
|
|
19
|
+
export function export_file(filter: string): (target: any, key: string) => void;
|
|
20
|
+
export function export_dir(filter: string): (target: any, key: string) => void;
|
|
21
|
+
export function export_global_file(filter: string): (target: any, key: string) => void;
|
|
22
|
+
export function export_global_dir(filter: string): (target: any, key: string) => void;
|
|
23
|
+
export function export_exp_easing(hint?: "" | "attenuation" | "positive_only" | "attenuation,positive_only"): (target: any, key: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* A Shortcut for `export_(Variant.Type.TYPE_ARRAY, { class_: clazz })`
|
|
26
|
+
*/
|
|
27
|
+
export function export_array(clazz: ClassDescriptor): (target: any, key: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* A Shortcut for `export_(Variant.Type.TYPE_DICTIONARY, { class_: [key_class, value_class] })`
|
|
30
|
+
*/
|
|
31
|
+
export function export_dictionary(key_class: ClassDescriptor, value_class: ClassDescriptor): (target: any, key: string) => void;
|
|
32
|
+
export function export_object(class_: ClassDescriptor): (target: any, key: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* [low level export]
|
|
35
|
+
*/
|
|
36
|
+
export function export_(type: Variant.Type, details?: {
|
|
37
|
+
class_?: ClassDescriptor;
|
|
38
|
+
hint?: PropertyHint;
|
|
39
|
+
hint_string?: string;
|
|
40
|
+
usage?: PropertyUsageFlags;
|
|
41
|
+
}): (target: any, key: string) => void;
|
|
42
|
+
/**
|
|
43
|
+
* In Godot, class members can be exported.
|
|
44
|
+
* This means their value gets saved along with the resource (such as the scene) they're attached to.
|
|
45
|
+
* They will also be available for editing in the property editor.
|
|
46
|
+
* Exporting is done by using the `@export_var` (or `@export_`) annotation.
|
|
47
|
+
*/
|
|
48
|
+
export function export_var(type: Variant.Type, details?: {
|
|
49
|
+
class_?: ClassDescriptor;
|
|
50
|
+
hint?: PropertyHint;
|
|
51
|
+
hint_string?: string;
|
|
52
|
+
usage?: PropertyUsageFlags;
|
|
53
|
+
}): (target: any, key: string) => void;
|
|
54
|
+
/**
|
|
55
|
+
* NOTE only int value enums are allowed
|
|
56
|
+
*/
|
|
57
|
+
export function export_enum(enum_type: any): (target: any, key: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* NOTE only int value enums are allowed
|
|
60
|
+
*/
|
|
61
|
+
export function export_flags(enum_type: any): (target: any, key: string) => void;
|
|
62
|
+
export interface RPCConfig {
|
|
63
|
+
mode?: MultiplayerAPI.RPCMode;
|
|
64
|
+
sync?: "call_remote" | "call_local";
|
|
65
|
+
transfer_mode?: MultiplayerPeer.TransferMode;
|
|
66
|
+
transfer_channel?: number;
|
|
67
|
+
}
|
|
68
|
+
export function rpc(config?: RPCConfig): (target: any, propertyKey?: PropertyKey, descriptor?: PropertyDescriptor) => void;
|
|
69
|
+
/**
|
|
70
|
+
* auto initialized on ready (before _ready called)
|
|
71
|
+
* @param evaluator for now, only string is accepted
|
|
72
|
+
*/
|
|
73
|
+
export function onready(evaluator: string | jsb.internal.OnReadyEvaluatorFunc): (target: any, key: string) => void;
|
|
74
|
+
export function tool(): (target: any) => void;
|
|
75
|
+
export function icon(path: string): (target: any) => void;
|
|
76
|
+
export function deprecated(message?: string): (target: any, propertyKey?: PropertyKey, descriptor?: PropertyDescriptor) => void;
|
|
77
|
+
export function experimental(message?: string): (target: any, propertyKey?: PropertyKey, descriptor?: PropertyDescriptor) => void;
|
|
78
|
+
export function help(message?: string): (target: any, propertyKey?: PropertyKey, descriptor?: PropertyDescriptor) => void;
|
|
79
|
+
}
|
|
80
|
+
declare module "godot.typeloader" {
|
|
81
|
+
/**
|
|
82
|
+
* @param type the loaded type or function in godot module
|
|
83
|
+
*/
|
|
84
|
+
export type TypeLoadedCallback = (type: any) => void;
|
|
85
|
+
export function on_type_loaded(type_name: string | string[], callback: TypeLoadedCallback): void;
|
|
86
|
+
}
|
|
87
|
+
declare module "jsb.core" { }
|
|
88
|
+
declare const ProxyTarget: unique symbol;
|
|
89
|
+
declare const proxy_unwrap: (value: any) => any;
|
|
90
|
+
declare const proxyable_prototypes: any[];
|
|
91
|
+
declare const proxy_wrap: (value: any) => any;
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"paths": {
|
|
12
|
+
"vue": ["{{NODE_MODULES}}/@vue/runtime-core/dist/runtime-core.d.ts"],
|
|
13
|
+
"godot": ["../typings/godot.mix.d.ts"]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts", "src/**/*.vue", "../typings/**/*.d.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import vue from '@vitejs/plugin-vue'
|
|
2
|
+
import { defineConfig } from 'vite'
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
plugins: [
|
|
6
|
+
vue({
|
|
7
|
+
template: {
|
|
8
|
+
compilerOptions: {
|
|
9
|
+
// treat all tags with uppercase letters as custom elements
|
|
10
|
+
isCustomElement: (tag) => tag[0] === tag[0].toUpperCase(),
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
],
|
|
15
|
+
define: {
|
|
16
|
+
'process.env': {},
|
|
17
|
+
},
|
|
18
|
+
resolve: {
|
|
19
|
+
// `vue` → `@vue/runtime-core` so the DOM renderer is tree-shaken
|
|
20
|
+
alias: { vue: '@vue/runtime-core' },
|
|
21
|
+
},
|
|
22
|
+
build: {
|
|
23
|
+
lib: {
|
|
24
|
+
entry: 'vue/src/main.ts',
|
|
25
|
+
formats: ['cjs'],
|
|
26
|
+
fileName: () => 'app.js',
|
|
27
|
+
},
|
|
28
|
+
// everything provided by the engine/runtime stays external
|
|
29
|
+
rollupOptions: {
|
|
30
|
+
external: ['godot'],
|
|
31
|
+
output: {
|
|
32
|
+
exports: 'named',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
target: 'es2020',
|
|
36
|
+
minify: false,
|
|
37
|
+
},
|
|
38
|
+
})
|