Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ubugeeei/vue-global-type-gen
generate global vue components types.
https://github.com/ubugeeei/vue-global-type-gen
codegen nuxt typescript vue
Last synced: 3 days ago
JSON representation
generate global vue components types.
- Host: GitHub
- URL: https://github.com/ubugeeei/vue-global-type-gen
- Owner: ubugeeei
- License: mit
- Created: 2022-11-10T13:41:18.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-12T09:31:03.000Z (almost 2 years ago)
- Last Synced: 2024-09-21T10:06:17.008Z (7 days ago)
- Topics: codegen, nuxt, typescript, vue
- Language: TypeScript
- Homepage:
- Size: 199 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Vue Global Type Generator
generate global vue components types.
ex.)```ts
declare module '@vue/runtime-core' {
export interface GlobalComponents {
TextBtn: typeof import('example/components/TextBtn.vue').default
LazyTextBtn: typeof import('example/components/TextBtn.vue').default
}
}
```# Usage
installation
```sh
$ npm install -D vue-global-type-gen
# or
$ yarn add -D vue-global-type-gen
# or
$ pnpm install -D vue-global-type-gen
```configure your npm scripts
```json
{
"scripts": {
"vue-global-type-gen": "vue-global-type-gen"
}
}
```# CLI Options
| option | default | description |
| ------------- | ---------- | -------------------- |
| --config, -c | vue-gt.yml | your config yml path |
| --version, -v | - | print version |# Configuration
setting vue-gt.yml
```yml
# vue-gt.yml
# default
config:
out: auto-import.d.ts
includes: [components/**/*.vue, pages/**/*.vue]
excludes: [node_modules]
stdout: false # when true, print type definition to std out
lazyComponents: true # when true, generate prefix 'Lazy' component
```