Gathering detailed insights and metrics for vscode-ext-gen
Gathering detailed insights and metrics for vscode-ext-gen
Generate TypeScript meta info for VS Code extension from package.json
npm install vscode-ext-gen
Typescript
Module System
Node Version
NPM Version
69.3
Supply Chain
99.3
Quality
90.7
Maintenance
100
Vulnerability
100
License
TypeScript (99.93%)
JavaScript (0.07%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
7,677
Last Day
38
Last Week
576
Last Month
1,760
Last Year
7,677
MIT License
64 Stars
59 Commits
8 Forks
1 Watchers
1 Branches
7 Contributors
Updated on Feb 17, 2025
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
vscode-ext-gen@1.0.0
Unpacked Size
22.71 kB
Size
6.95 kB
File Count
10
NPM Version
10.9.0
Node Version
22.12.0
Published on
Jan 20, 2025
Cumulative downloads
Total Downloads
Last Day
58.3%
38
Compared to previous day
Last Week
67%
576
Compared to previous week
Last Month
2.1%
1,760
Compared to previous month
Last Year
0%
7,677
Compared to previous year
Generate TypeScript meta info and Markdown tables for VS Code extension from package.json
1npx vscode-ext-gen
Under the VS Code extension project root
We recommend using the Run on Save extension with the following config in your .vscode/settings.json
to always generate the meta file on save:
1{ 2 "emeraldwalk.runonsave": { 3 "commands": [ 4 { 5 "match": "package.json", 6 "isAsync": true, 7 "cmd": "npm run update" 8 } 9 ] 10 } 11}
Generates src/generated-meta.ts
file with the following content which syncs with your package.json
:
1export namespace ExtensionMeta { 2 // Meta info 3 export const publisher = 'antfu' 4 export const name = 'iconify' 5 export const version = '0.8.1' 6 export const displayName = 'Iconify IntelliSense' 7 export const description = 'Intelligent Iconify previewing and searching for VS Code' 8 export const extensionId = `${publisher}.${name}` 9 10 /** 11 * Type union of all commands 12 */ 13 export type CommandKey = 14 | 'iconify.toggle-annotations' 15 | 'iconify.clear-cache' 16 // ... 17 18 /** 19 * Commands map registed by `antfu.iconify` 20 */ 21 export const commands = { 22 /** 23 * Toggle Annotations 24 * @value `iconify.toggle-annotations` 25 */ 26 toggleAnnotations: 'iconify.toggle-annotations', 27 // ... 28 } satisfies Record<string, CommandId> 29 30 /** 31 * Type union of all configs 32 */ 33 export type ConfigKey = 34 | 'iconify.annotations' 35 | 'iconify.position' 36 // ... 37 38 export interface ConfigKeyTypeMap { 39 'iconify.annotations': boolean 40 'iconify.position': ('before' | 'after') 41 // ... 42 } 43 44 export interface ConfigMeta<T extends keyof ConfigKeyTypeMap> { 45 key: T 46 default: ConfigKeyTypeMap[T] 47 } 48 49 /** 50 * Configs map registed by `antfu.iconify` 51 */ 52 export const configs = { 53 /** 54 * Enabled Iconify inline annotations 55 * @key `iconify.annotations` 56 * @default `true` 57 * @type `boolean` 58 */ 59 annotations: { 60 key: 'iconify.annotations', 61 default: true, 62 } as ConfigMeta<'iconify.annotations'>, 63 /** 64 * Position the icon before or after the icon name 65 * @key `iconify.position` 66 * @default `"before"` 67 * @type `string` 68 */ 69 position: { 70 key: 'iconify.position', 71 default: 'before', 72 } as ConfigMeta<'iconify.position'>, 73 74 // ... 75 } 76} 77 78export default ExtensionMeta
On usage:
1import { commands, workspace } from 'vscode' 2import * as meta from './generated-meta' 3 4export function activate() { 5 console.log(meta.displayName, meta.extensionId) 6 7 const config = workspace 8 .getConfiguration() 9 .get(meta.configs.position.key, meta.configs.position.default) 10 11 commands.registerCommand(meta.commands.toggleAnnontations, () => { 12 // ... 13 }) 14}
For a full example, check this file
Add comments <!-- commands -->
and <!-- configs -->
as the slots in your README.md:
1# Your Extension 2 3## Commands 4 5<!-- commands --> 6<!-- commands --> 7 8## Configurations 9 10<!-- configs --> 11<!-- configs -->
They will be replaced with the generated tables when you run npx vscode-ext-gen
.
MIT License © 2023-PRESENT Anthony Fu
No vulnerabilities found.
No security vulnerabilities found.