{"id":17912409,"url":"https://github.com/tolking/components-helper","last_synced_at":"2025-03-23T22:34:32.251Z","repository":{"id":44636468,"uuid":"351006715","full_name":"tolking/components-helper","owner":"tolking","description":"Based on the docs to provide code prompt files for vue component library","archived":false,"fork":false,"pushed_at":"2023-11-28T03:47:57.000Z","size":102,"stargazers_count":36,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T00:05:39.274Z","etag":null,"topics":["attributes","component-library","components","helper","tags","vetur","vue","web-types","webstrom"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tolking.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-24T08:44:28.000Z","updated_at":"2025-03-17T01:34:11.000Z","dependencies_parsed_at":"2024-01-02T23:39:59.186Z","dependency_job_id":"567c54ed-4925-44d1-b1b7-10bac5b3c287","html_url":"https://github.com/tolking/components-helper","commit_stats":{"total_commits":74,"total_committers":3,"mean_commits":"24.666666666666668","dds":0.09459459459459463,"last_synced_commit":"b390f5fbfd6d8541514bc76d2da3716cbd4e286a"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolking%2Fcomponents-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolking%2Fcomponents-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolking%2Fcomponents-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolking%2Fcomponents-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tolking","download_url":"https://codeload.github.com/tolking/components-helper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245180166,"owners_count":20573620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attributes","component-library","components","helper","tags","vetur","vue","web-types","webstrom"],"created_at":"2024-10-28T19:44:55.692Z","updated_at":"2025-03-23T22:34:31.942Z","avatar_url":"https://github.com/tolking.png","language":"TypeScript","funding_links":[],"categories":["Components \u0026 Libraries"],"sub_categories":["Dev Tools"],"readme":":warning: This library is no longer maintained.\n\nWith the [WebStorm](https://blog.jetbrains.com/webstorm/2023/05/webstorm-2023-2-eap2/#volar_support_for_vue) support of [Volar](https://github.com/vuejs/language-tools#readme), you may no longer need this library.\n\nIt is more recommended that you use Volar's code prompt by improving the type declaration.\n\nIf you still need this library, you can continue to use it, but this library will no longer have new feature updates.\n\n---\n\n# components-helper\n\n\u003e Based on the documents to provide code prompt files for vue component library\n\nReference documents format reference test files\n\n[Changelog](./CHANGELOG.md)\n\n## Installation\n\n``` sh\nyarn add components-helper -D\n# or\nnpm i components-helper --save-dev\n```\n\n## Usage\n\n``` js\nconst { main } = require('components-helper')\n\nmain({\n  // Options\n})\n```\n\n[example](./test/index.js)\n\nthen in package.json\n\n``` diff\n{\n  \"scripts\": {\n+    \"build:helper\": \"node helper/file.js\"\n  },\n+  \"vetur\": {\n+    \"tags\": \"config outDir/tags.json\",\n+    \"attributes\": \"config outDir/attributes.json\"\n+  },\n+  \"web-types\": \"config outDir/web-types.json\"\n}\n```\n\n## Options\n\n\u003cdetails\u003e\n\u003csummary\u003eTOC\u003c/summary\u003e\n\n- [entry (required)](#entry)\n- [fastGlobConfig](#fastglobconfig)\n- [outDir (required)](#outdir)\n- [name (required)](#name)\n- [version (required)](#version)\n- [space](#space)\n- [separator](#separator)\n- [reComponentName](#recomponentname)\n- [reDocUrl](#redocurl)\n- [reAttribute](#reattribute)\n- [reVeturDescription](#reveturdescription)\n- [reWebTypesSource](#rewebtypessource)\n- [reWebTypesType](#rewebtypestype)\n- [tags](#tags)\n- [attributes](#attributes)\n- [webTypes](#webtypes)\n- [props](#props)\n- [propsName](#propsname)\n- [propsDescription](#propsdescription)\n- [propsType](#propstype)\n- [propsOptions](#propsoptions)\n- [propsDefault](#propsdefault)\n- [events](#events)\n- [eventsName](#eventsname)\n- [eventsDescription](#eventsdescription)\n- [slots](#slots)\n- [slotsName](#slotsname)\n- [slotsDescription](#slotsdescription)\n- [slotsType](#slotsType)\n- [slotsSubtags](#slotssubtags)\n- [directives](#directives)\n- [directivesName](#directivesname)\n- [directivesDescription](#directivesdescription)\n- [directivesType](#directivestype)\n- [titleRegExp](#titleregexp)\n- [tableRegExp](#tableregexp)\n- [fileNameRegExp](#filenameregexp)\n\n\u003c/details\u003e\n\n### entry\n\n- Required: `true`\n- Type: `string` | `string[]`\n\nSpecify the entry directory. refer: [fast-glob](https://github.com/mrmlnc/fast-glob#pattern-syntax)\n\nfor example:\n  - `docs/*.md` -- matches all files in the docs\n  - `docs/(a|b).md` -- matches files `a.md` and `b.md`\n  - `docs/!(a|b).md` -- matches files except for `a.md` and `b.md`\n\n### fastGlobConfig\n\n- Type: `object`\n\nThe config of [fast-glob](https://github.com/mrmlnc/fast-glob#options-3)\n\n### outDir\n\n- Required: `true`\n- Type: `string`\n\nSpecify the output directory. For example, `lib``\n\n### name\n\n- Required: `true`\n- Type: `string`\n\nname of the component library. \n\n### version\n\n- Required: `true`\n- Type: `string`\n\nthe version of the component library. \n\n### space\n\n- Type: `number` | `string`\n\nAdds indentation, white space, and line break characters to the return-value JSON text to make it easier to read\n\n### separator\n\n- Type: `string`\n- Default: `/`\n\nthe separator for propsOptions, slotsSubtags, type ...\n\n### reComponentName\n\n- Type: `(title: string, fileName: string, path: string) =\u003e string`\n- Defult: `hyphenate(title || fileName)`\n\nrewriting the name of the component\n\nfor example `(title) =\u003e 'prefix-' + title.replace(/\\B([A-Z])/g, '-$1').toLowerCase()`\n\n### reDocUrl\n\n- Type: `(fileName: string, header?: string, path: string) =\u003e string | undefind`\n\nrewriting the doc url of the component\n\n### reAttribute\n\n- Type: `(value: string, key: string, row: string[], title: string) =\u003e string | undefined`\n\n##### arg\n\n- value: current value\n- key: the key value of the current column\n- row: all values of the current row\n- title: the title of current tabel\n\nrewriting the attribute of the component\n\n### reVeturDescription\n\n- Type: `(description?: string, defaultValue?: string, docUrl?: string) =\u003e string`\n- Default: same like `${description}, default: ${defaultValue}.\\n\\n[Docs](${docUrl})`\n\nrewriting the description of vetur\n\n### reWebTypesSource\n\n- Type: `(title: string, fileName: string, path: string) =\u003e Source`\n\nrewriting the source of web-types. (the name of export from the component library)\n\n### reWebTypesType\n\n- Type: `(type: string) =\u003e undefined | string | BaseContribution`\n\nOnly some common types are processed internally, and the rest are exported from the component library by default. If your document also references types in third-party libraries, you can choose to override the relevant behavior through this function\n\n### tags\n\n- Type: `string`\n- Default: `tags.json`\n\nname for tags of the vetur\n\n### attributes\n\n- Type: `string`\n- Default: `attributes.json`\n\nname for attributes of the Vetur\n\n### webTypes\n\n- Type: `string`\n- Default: `web-types.json`\n\nname for web-types of the WebStorm\n\n### props\n\n- Type: `string` (**This is a regular string and ignores case.**)\n- Default: `props`\n\nThe title of the props table. **other string in the header will be identified as sub-component**\n\n### propsName\n\n- Type: `string`\n- Default: `Name`\n\nThe header name of the `Name` in the props table\n\n### propsDescription\n\n- Type: `string`\n- Default: `Description`\n\nThe header name of the `Description` in the props table\n\n### propsType\n\n- Type: `string`\n- Default: `Type`\n\nThe header name of the `Type` in the props table\n\n### propsOptions\n\n- Type: `string`\n- Default: `Options`\n\nThe header name of the `Options` in the props table\n\n### propsDefault\n\n- Type: `string`\n- Default: `Default`\n\nThe header name of the `Default` in the props table\n\n### events\n\n- Type: `string` (**This is a regular string and ignores case.**)\n- Default: `events`\n\nThe title of the events table. **other string in the header will be identified as sub-component**\n\n### eventsName\n\n- Type: `string`\n- Default: `Name`\n\nThe header name of the `Name` in the events table\n\n### eventsDescription\n\n- Type: `string`\n- Default: `Description`\n\nThe header name of the `Description` in the events table\n\n### slots\n\n- Type: `string` (**This is a regular string and ignores case.**)\n- Default: `slots`\n\nThe title of the slots table. **other string in the header will be identified as sub-component**\n\n### slotsName\n\n- Type: `string`\n- Default: `Name`\n\nThe header name of the `Name` in the slots table\n\n### slotsDescription\n\n- Type: `string`\n- Default: `Description`\n\nThe header name of the `Description` in the slots table\n\n### slotsType\n\n- Type: `string`\n- Default: `Type`\n\nThe header name of the `Type` in the slots table\n\n### slotsSubtags\n\n- Type: `string`\n- Default: `Subtags`\n\nThe header name of the `Subtags` in the slots table\n\n### directives\n\n- Type: `string` (**This is a regular string and ignores case.**)\n- Default: `directives`\n\nThe title of the directives table. **other string in the header will be identified as sub-component**\n\n### directivesName\n\n- Type: `string`\n- Default: `Name`\n\nThe header name of the `Name` in the directives table\n\n### directivesDescription\n\n- Type: `string`\n- Default: `Description`\n\nThe header name of the `Description` in the directives table\n\n### directivesType\n\n- Type: `string`\n- Default: `Type`\n\nThe header name of the `Type` in the directives table\n\n### titleRegExp\n\n- Type: `RegExp` | `string` (**This is a regular string.**)\n- Default: `/#+\\s+(.*)\\n+([^(#|\\n)]*)/g`\n\nmatches the title and description information from docs\n\n### tableRegExp\n\n- Type: `RegExp` | `string` (**This is a regular string.**)\n- Default: `/#+\\s+(.*)\\n+(\\|?.+\\|.+)\\n\\|?\\s*:?-+:?\\s*\\|.+((\\n\\|?.+\\|.+)+)/g`\n\nmatches the title and table header and the table contains information from docs\n\n### fileNameRegExp\n\n- Type: `RegExp` | `string` (**This is a regular string.**)\n- Default: `/\\/((\\w|-)+)\\.\\w+$/`\n\nmatches the file name from the path\n\n## Advancement\n\n### about titleRegExp\n\nmatches the first format information in the docs\n\n/#+\\s+(`.*`)\\n+(`[^(#|\\n)]*`)/\n\n\u003cdiv\u003e\n# \u003ccode\u003etitle\u003c/code\u003e\n\u003cdiv\u003e\u003ccode\u003edescription\u003c/code\u003e\u003c/div\u003e\n\u003c/div\u003e\n\nand\n\n\u003cdiv\u003e\n## \u003ccode\u003etitle\u003c/code\u003e\n\u003c/div\u003e\n\nmatches other formats, For example:\n\n/#+\\s+(`.*`)\\n+\u003e\\s*(`[^(#|\\n)]*`)/g\n\n\u003cdiv\u003e\n# \u003ccode\u003etitle\u003c/code\u003e\n\u003cdiv\u003e\u003e \u003ccode\u003edescription\u003c/code\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n### about tableRegExp\n\nmatches the format information in the docs\n\n/#+\\s+(`.*`)\\n+(`\\|?.+\\|.+`)\\n\\|?\\s*:?-+:?\\s*\\|.+(`(\\n\\|?.+\\|.+)+`)/g\n\n\u003cdiv\u003e\n### \u003ccode\u003etitle\u003c/code\u003e\n\u003cdiv\u003e\u003ccode\u003e| header |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e| ------ |\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003c/div\u003e\n\nand\n\n\u003cdiv\u003e\n### \u003ccode\u003esub-component title\u003c/code\u003e\n\u003cdiv\u003e\u003ccode\u003e| header |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e| :----- |\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003c/div\u003e\n\nby default matches all tables, Optimize it through tableRegExp, For example:\n\n/#+\\s+(`.*\\s*Props|.*\\s*Events|.*\\s*Slots|.*\\s*Directives`)\\n+(`\\|?.+\\|.+`)\\n\\|?\\s*:?-+:?\\s*\\|.+(`(\\n\\|?.+\\|.+)+`)/g\n\n\u003cdiv\u003e\n### \u003ccode\u003eProps / Events / Slots / Directives\u003c/code\u003e\n\u003cdiv\u003e\u003ccode\u003e| header |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e| ------ |\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003c/div\u003e\n\nand\n\n\u003cdiv\u003e\n### \u003ccode\u003esub-component Props\u003c/code\u003e\n\u003cdiv\u003e\u003ccode\u003e| header |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e| ------ |\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003ccode\u003e| column |\u003c/code\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n### other\n\nWhen this document does not include the primary title or `Props` `Events` `Slots` and `Directives`, this component is not created.\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolking%2Fcomponents-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolking%2Fcomponents-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolking%2Fcomponents-helper/lists"}