vscode-code-generator
generate code from ts interface
json to ts
fork from https://github.com/MariusAlch/json-to-ts
input
{
"cats": [
{"name": "Kittin"},
{"name": "Mittin"}
],
"favoriteNumber": 42,
"favoriteWord": "Hello"
}
ouput
interface RootObject {
cats: Cat[];
favoriteNumber: number;
favoriteWord: string;
}
interface Cat {
name: string;
}
ts to scheam code
input
interface RootObject {
cats: string;
favoriteNumber: number;
favoriteWord: string;
}
output
特定业务下的schema 代码
export const columns: BasicColumn<>[] = [
// ...
]
export const searchFormSchema: FormSchema<>[] = [
// ...
]
export const formSchema: FormSchema<>[] = [
// ...
]
build
npm run package
publish
需要提前注册vscode extension publisher的角色,参考#[1]
npm run publish
链接
| |