7
7
[ ![ GitHub Repo stars] ( https://img.shields.io/github/stars/vuejsco/vscode-vuejs-generator?style=for-the-badge&logo=github )] ( https://github.com/vuejsco/vscode-vuejs-generator )
8
8
[ ![ GitHub license] ( https://img.shields.io/github/license/vuejsco/vscode-vuejs-generator?style=for-the-badge&logo=github )] ( https://github.com/vuejsco/vscode-vuejs-generator/blob/main/LICENSE )
9
9
10
- ** VueJS File Generator** is a Visual Studio Code extension designed to streamline the creation of Vue.js files. It generates boilerplate code based on customizable templates, allowing you to quickly create components, services, and other project files according to your needs.
10
+ ** VueJS File Generator** is a Visual Studio Code extension designed to simplify the creation of Vue.js files. It generates boilerplate code from customizable templates, enabling you to quickly create components, services, and other project files according to your needs.
11
11
12
12
[ ![ VueJS File Generator] ( https://raw.githubusercontent.com/vuejsco/vscode-vuejs-generator/main/images/demo.gif )] ( https://marketplace.visualstudio.com/items?itemName=imgildev.vscode-vuejs-generator )
13
13
14
- ## Table of Contents
14
+ ## Index
15
15
16
16
- [ VueJS File Generator] ( #vuejs-file-generator )
17
- - [ Table of Contents ] ( #table-of-contents )
17
+ - [ Index ] ( #index )
18
18
- [ Key Features] ( #key-features )
19
19
- [ Supported File Templates] ( #supported-file-templates )
20
20
- [ Requirements] ( #requirements )
21
+ - [ Requirements] ( #requirements-1 )
21
22
- [ Setup] ( #setup )
23
+ - [ Step 1: Open Command Palette in VS Code] ( #step-1-open-command-palette-in-vs-code )
24
+ - [ Step 2: Add Configuration to ` settings.json ` ] ( #step-2-add-configuration-to-settingsjson )
25
+ - [ Step 3: Restart VS Code] ( #step-3-restart-vs-code )
22
26
- [ Configuration] ( #configuration )
27
+ - [ Variables Table] ( #variables-table )
23
28
- [ Community] ( #community )
24
29
- [ Contributing] ( #contributing )
25
30
- [ Code of Conduct] ( #code-of-conduct )
29
34
## Key Features
30
35
31
36
- ** Customizable Templates** : Define TypeScript and Vue.js file templates tailored to your project.
32
- - ** Project-Level Configuration** : Set up file formatting, naming conventions, and more.
33
- - ** Open Source** : Contribute and benefit from the community-driven development.
37
+ - ** Project-Level Configuration** : Configure file formatting, naming conventions, and more.
38
+ - ** Open Source** : Contribute to and benefit from community-driven development.
34
39
35
40
## Supported File Templates
36
41
37
42
The extension provides predefined templates for various Vue.js file types, making it easy to generate structured and consistent files for your project.
38
43
39
44
| File Type | Description | Example Filename |
40
- | -------------| -------------| ------------------|
41
- | ` component ` | Vue.js Component (Single File Component) | ` MyComponent.vue ` |
42
- | ` page ` | Vue.js Page (Common in frameworks like Nuxt) | ` HomePage.vue ` |
43
- | ` store ` | Pinia Store Module | ` useAuthStore.ts ` |
44
- | ` composable ` | Vue 3 Composable (Reusable function) | ` useFetch.ts ` |
45
- | ` directive ` | Vue Directive | ` v-focus.ts ` |
46
- | ` middleware ` | Middleware for Nuxt.js | ` auth.ts ` |
47
- | ` model ` | TypeScript Model (Interface or Type) | ` UserModel.ts ` |
48
- | ` layout ` | Layout Component (Nuxt.js) | ` DefaultLayout.vue ` |
49
- | ` service ` | API Service (For Axios or Fetch wrappers) | ` AuthService.ts ` |
50
- | ` test ` | Unit Test File (Jest/Vitest) | ` MyComponent.spec.ts ` |
51
- | ` enum ` | TypeScript Enum | ` UserRoles.ts ` |
52
- | ` constant ` | Constants File | ` constants.ts ` |
53
- | ` hook ` | Custom React Hook | ` useAuth.ts ` |
54
- | ` route ` | Route Configuration File | ` routes.ts ` |
45
+ | --------------| -------------| ------------------|
46
+ | ` component ` | Vue.js Component (Single File Component) | ` MyComponent.vue ` |
47
+ | ` page ` | Vue.js Page (Common in frameworks like Nuxt) | ` HomePage.vue ` |
48
+ | ` store ` | Pinia Store Module | ` useAuthStore.ts ` |
49
+ | ` composable ` | Vue 3 Composable (Reusable function) | ` useFetch.ts ` |
50
+ | ` directive ` | Vue Directive | ` v-focus.ts ` |
51
+ | ` middleware ` | Middleware for Nuxt.js | ` auth.ts ` |
52
+ | ` model ` | TypeScript Model (Interface or Type) | ` UserModel.ts ` |
53
+ | ` layout ` | Layout Component (Nuxt.js) | ` DefaultLayout.vue ` |
54
+ | ` service ` | API Service (For Axios or Fetch wrappers) | ` AuthService.ts ` |
55
+ | ` test ` | Unit Test File (Jest/Vitest) | ` MyComponent.spec.ts ` |
56
+ | ` enum ` | TypeScript Enum | ` UserRoles.ts ` |
57
+ | ` constant ` | Constants File | ` constants.ts ` |
58
+ | ` hook ` | Custom React Hook | ` useAuth.ts ` |
59
+ | ` route ` | Route Configuration File | ` routes.ts ` |
60
+
61
+ ## Requirements
62
+
63
+ - ** VS Code 1.88.0** or higher.
55
64
56
65
## Requirements
57
66
58
67
- ** VS Code 1.88.0** or higher.
59
68
60
69
## Setup
61
70
62
- 1 . ** Open the VS Code Command Palette** :
71
+ ### Step 1: Open Command Palette in VS Code
72
+
73
+ 1 . Open the ** Command Palette** in VS Code:
63
74
- Windows: ` CTRL + SHIFT + P `
64
- - MacOS : ` CMD + SHIFT + P `
75
+ - macOS : ` CMD + SHIFT + P `
65
76
66
- 2 . ** Open Workspace Settings** :
77
+ 2 . Open the ** Workspace Settings** :
67
78
- Type ` Preferences: Open Workspace Settings (JSON) ` .
68
79
69
- 3 . ** Add Configuration to ` settings.json ` ** :
70
- Copy the following settings into your ` .vscode/settings.json ` file:
71
-
72
- ``` json
73
- {
74
- "vuejs.generator.enable" : true ,
75
- "vuejs.generator.files.skipFolderConfirmation" : false ,
76
- "vuejs.generator.formatting.excludeSemiColonAtEndOfLine" : false ,
77
- "vuejs.generator.formatting.endOfLine" : " lf" ,
78
- "vuejs.generator.formatting.insertFinalNewline" : true ,
79
- "vuejs.generator.templates.customComponents" : [
80
- {
81
- "name" : " Vue Component" ,
82
- "description" : " The Vue component" ,
83
- "type" : " vue" ,
84
- "template" : [
85
- " <template>" ,
86
- " <div id=\" {{fileName}}\" >" ,
87
- " <!-- Your code here -->" ,
88
- " </div>" ,
89
- " </template>" ,
90
- " " ,
91
- " <script lang=\" ts\" >" ,
92
- " import { defineComponent } from \" vue\" ;" ,
93
- " " ,
94
- " export default defineComponent({" ,
95
- " name: \" {{fileName}}\" ," ,
96
- " props: {" ,
97
- " // Your props here" ,
98
- " }," ,
99
- " setup() {" ,
100
- " // Your code here" ,
101
- " }" ,
102
- " });" ,
103
- " </script>" ,
104
- " " ,
105
- " <style scoped>" ,
106
- " /* Your styles here */" ,
107
- " </style>"
108
- ]
109
- }
110
- ],
111
- "vuejs.generator.project.author" : " Manuel Gil" ,
112
- "vuejs.generator.project.owner" : " Vue JS Colombia" ,
113
- "vuejs.generator.project.maintainers" : " VueJS Team" ,
114
- "vuejs.generator.project.license" : " MIT" ,
115
- "vuejs.generator.project.version" : " 1.0.0"
116
- }
117
- ```
118
-
119
- 4 . **Restart VS Code** to apply the settings.
80
+ ### Step 2: Add Configuration to ` settings.json `
81
+
82
+ Copy the following configuration into your ` .vscode/settings.json ` file:
83
+
84
+ ``` json
85
+ {
86
+ "vuejs.generator.enable" : true ,
87
+ "vuejs.generator.files.skipFolderConfirmation" : false ,
88
+ "vuejs.generator.formatting.excludeSemiColonAtEndOfLine" : false ,
89
+ "vuejs.generator.formatting.endOfLine" : " lf" ,
90
+ "vuejs.generator.formatting.insertFinalNewline" : true ,
91
+ "vuejs.generator.templates.customComponents" : [
92
+ {
93
+ "name" : " Vue Component" ,
94
+ "description" : " Vue component template" ,
95
+ "type" : " vue" ,
96
+ "template" : [
97
+ " <template>" ,
98
+ " <div id=\" {{fileName}}\" >" ,
99
+ " <!-- Your code here -->" ,
100
+ " </div>" ,
101
+ " </template>" ,
102
+ " " ,
103
+ " <script lang=\" ts\" >" ,
104
+ " import { defineComponent } from \" vue\" ;" ,
105
+ " " ,
106
+ " export default defineComponent({" ,
107
+ " name: \" {{fileName}}\" ," ,
108
+ " props: {" ,
109
+ " // Your props here" ,
110
+ " }," ,
111
+ " setup() {" ,
112
+ " // Your code here" ,
113
+ " }" ,
114
+ " });" ,
115
+ " </script>" ,
116
+ " " ,
117
+ " <style scoped>" ,
118
+ " /* Your styles here */" ,
119
+ " </style>"
120
+ ]
121
+ }
122
+ ],
123
+ "vuejs.generator.project.author" : " Manuel Gil" ,
124
+ "vuejs.generator.project.owner" : " Vue JS Colombia" ,
125
+ "vuejs.generator.project.maintainers" : " VueJS Team" ,
126
+ "vuejs.generator.project.license" : " MIT" ,
127
+ "vuejs.generator.project.version" : " 1.0.0"
128
+ }
129
+ ```
130
+
131
+ ### Step 3: Restart VS Code
132
+
133
+ Restart VS Code to apply the settings.
120
134
121
135
## Configuration
122
136
123
- You can customize **VueJS File Generator** by modifying its settings in `.vscode/settings.json`:
137
+ You can customize ** VueJS File Generator** by modifying its settings in ` .vscode/settings.json ` . Some of the available settings are :
124
138
125
139
- ` vuejs.generator.enable ` : Enable or disable the extension (default: ` true ` ).
126
140
- ` vuejs.generator.files.skipFolderConfirmation ` : Skip folder selection when creating files (default: ` false ` ).
@@ -136,6 +150,12 @@ You can customize **VueJS File Generator** by modifying its settings in `.vscode
136
150
137
151
The following variables can be used in the template:
138
152
153
+ For the full list of customizable variables in the template, check the [ Variables Table] ( #variables-table ) .
154
+
155
+ ## Variables Table
156
+
157
+ The following variables can be used in the template:
158
+
139
159
| Variable | Description |
140
160
| ----------------------------------| -------------|
141
161
| ` fileName ` | The unmodified file name. Example: ` "MyComponent" ` |
@@ -179,12 +199,12 @@ This extension is maintained by the **Vue JS Colombia Meetup Community**. Stay u
179
199
180
200
## Contributing
181
201
182
- We welcome community contributions! To get started:
202
+ We welcome contributions from the community ! To get started:
183
203
184
204
1 . Fork the [ GitHub repository] ( https://github.com/vuejsco/vscode-vuejs-generator ) .
185
205
2 . Make your changes and submit a pull request.
186
206
187
- For guidelines, refer to the [Contribution Guide](./CONTRIBUTING.md).
207
+ For contribution guidelines, refer to the [ Contribution Guide] ( ./CONTRIBUTING.md ) .
188
208
189
209
## Code of Conduct
190
210
0 commit comments