Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc75f76

Browse files
feat: ✨ add license and version fields to project configuration and update related documentation
1 parent e5ec166 commit dc75f76

File tree

8 files changed

+98
-9
lines changed

8 files changed

+98
-9
lines changed

‎README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ The extension provides predefined templates for various Vue.js file types, makin
110110
],
111111
"vuejs.generator.project.author": "Manuel Gil",
112112
"vuejs.generator.project.owner": "Vue JS Colombia",
113-
"vuejs.generator.project.maintainers": "VueJS Team"
113+
"vuejs.generator.project.maintainers": "VueJS Team",
114+
"vuejs.generator.project.license": "MIT",
115+
"vuejs.generator.project.version": "1.0.0"
114116
}
115117
```
116118

@@ -129,6 +131,8 @@ You can customize **VueJS File Generator** by modifying its settings in `.vscode
129131
- `vuejs.generator.project.author`: Set the author name for the project.
130132
- `vuejs.generator.project.owner`: Set the owner name for the project.
131133
- `vuejs.generator.project.maintainers`: Set the maintainers name for the project.
134+
- `vuejs.generator.project.license`: Set the license for the project.
135+
- `vuejs.generator.project.version`: Set the version for the project.
132136

133137
The following variables can be used in the template:
134138

‎package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,23 @@
242242
"scope": "resource",
243243
"description": "%vuejs.generator.project.owner%"
244244
},
245-
"vuejs.generator.project.maintainer": {
245+
"vuejs.generator.project.maintainers": {
246246
"type": "string",
247247
"default": "",
248248
"scope": "resource",
249-
"description": "%vuejs.generator.project.maintainer%"
249+
"description": "%vuejs.generator.project.maintainers%"
250+
},
251+
"vuejs.generator.project.license": {
252+
"type": "string",
253+
"default": "MIT",
254+
"scope": "resource",
255+
"description": "%vuejs.generator.project.license%"
256+
},
257+
"vuejs.generator.project.version": {
258+
"type": "string",
259+
"default": "1.0.0",
260+
"scope": "resource",
261+
"description": "%vuejs.generator.project.version%"
250262
}
251263
}
252264
},

‎package.nls.es.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"vuejs.generator.templates.customComponents": "Templates de componentes personalizados",
99
"vuejs.generator.project.author": "Autor",
1010
"vuejs.generator.project.owner": "Propietario",
11-
"vuejs.generator.project.maintainer": "Mantenedor",
11+
"vuejs.generator.project.maintainers": "Mantenedores",
12+
"vuejs.generator.project.license": "Licencia",
13+
"vuejs.generator.project.version": "Versión",
1214
"vuejs.generator.generateCustomComponent": "Generar componente personalizado",
1315
"vuejs.generator.generateComponent": "Generar componente",
1416
"vuejs.generator.generatePage": "Generar página",

‎package.nls.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"vuejs.generator.templates.customComponents": "Custom components templates",
99
"vuejs.generator.project.author": "Author",
1010
"vuejs.generator.project.owner": "Owner",
11-
"vuejs.generator.project.maintainer": "Maintainer",
11+
"vuejs.generator.project.maintainers": "Maintainers",
12+
"vuejs.generator.project.license": "License",
13+
"vuejs.generator.project.version": "Version",
1214
"vuejs.generator.generateCustomComponent": "Generate Custom Component",
1315
"vuejs.generator.generateComponent": "Generate Component",
1416
"vuejs.generator.generatePage": "Generate Page",

‎schemas/config.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,17 @@
126126
"default": "",
127127
"scope": "resource",
128128
"description": "Maintainer"
129+
},
130+
"vuejs.generator.project.license": {
131+
"type": "string",
132+
"default": "MIT",
133+
"scope": "resource",
134+
"description": "License"
135+
},
136+
"vuejs.generator.project.version": {
137+
"type": "string",
138+
"default": "1.0.0",
139+
"scope": "resource",
140+
"description": "Version"
129141
}
130142
}

‎src/app/configs/constants.config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,27 @@ export const DEFAULT_OWNER: string = '';
249249
* @returns {string} - The default maintainer of the extension
250250
*/
251251
export const DEFAULT_MAINTAINER: string = '';
252+
253+
/**
254+
* DEFAULT_LICENSE: The default license of the extension.
255+
* @type {string}
256+
* @public
257+
* @memberof Constants
258+
* @example
259+
* console.log(DEFAULT_LICENSE);
260+
*
261+
* @returns {string} - The default license of the extension
262+
*/
263+
export const DEFAULT_LICENSE: string = 'MIT';
264+
265+
/**
266+
* DEFAULT_VERSION: The default version of the extension.
267+
* @type {string}
268+
* @public
269+
* @memberof Constants
270+
* @example
271+
* console.log(DEFAULT_VERSION);
272+
*
273+
* @returns {string} - The default version of the extension
274+
*/
275+
export const DEFAULT_VERSION: string = '1.0.0';

‎src/app/configs/extension.config.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import {
99
DEFAULT_EXCLUDE_SEMI_COLON_AT_END_OF_LINE,
1010
DEFAULT_HEADER_COMMENT_TEMPLATE,
1111
DEFAULT_INSERT_FINAL_NEWLINE,
12+
DEFAULT_LICENSE,
1213
DEFAULT_MAINTAINER,
1314
DEFAULT_OWNER,
1415
DEFAULT_SKIP_FOLDER_CONFIRMATION,
16+
DEFAULT_VERSION,
1517
} from './constants.config';
1618

1719
/**
@@ -158,6 +160,30 @@ export class ExtensionConfig {
158160
*/
159161
maintainers: string;
160162

163+
/**
164+
* The license.
165+
* @type {string}
166+
* @public
167+
* @memberof ExtensionConfig
168+
* @example
169+
* const config = new ExtensionConfig(workspace.getConfiguration());
170+
* console.log(config.license);
171+
* @default ''
172+
*/
173+
license: string;
174+
175+
/**
176+
* The version.
177+
* @type {string}
178+
* @public
179+
* @memberof ExtensionConfig
180+
* @example
181+
* const config = new ExtensionConfig(workspace.getConfiguration());
182+
* console.log(config.version);
183+
* @default ''
184+
*/
185+
version: string;
186+
161187
// -----------------------------------------------------------------
162188
// Constructor
163189
// -----------------------------------------------------------------
@@ -202,6 +228,8 @@ export class ExtensionConfig {
202228
'project.maintainers',
203229
DEFAULT_MAINTAINER,
204230
);
231+
this.license = config.get<string>('project.license', DEFAULT_LICENSE);
232+
this.version = config.get<string>('project.version', DEFAULT_VERSION);
205233
}
206234

207235
// -----------------------------------------------------------------
@@ -248,6 +276,11 @@ export class ExtensionConfig {
248276
);
249277
this.author = config.get<string>('project.author', this.author);
250278
this.owner = config.get<string>('project.owner', this.owner);
251-
this.maintainers = config.get<string>('project.maintainers', this.maintainers);
279+
this.maintainers = config.get<string>(
280+
'project.maintainers',
281+
this.maintainers,
282+
);
283+
this.license = config.get<string>('project.license', this.license);
284+
this.version = config.get<string>('project.version', this.version);
252285
}
253286
}

‎src/app/services/file-generator.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ export class FileGeneratorService {
488488
componentName: string,
489489
fileExtension: string,
490490
): Record<string, any> {
491-
const { author, owner, maintainers } = this.config;
491+
const { author, owner, maintainers, license, version } = this.config;
492492

493493
return {
494494
fileName: componentName,
@@ -520,8 +520,8 @@ export class FileGeneratorService {
520520
author,
521521
owner,
522522
maintainers,
523-
// license,
524-
// version,
523+
license,
524+
version,
525525
};
526526
}
527527

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /