Skip to content

Commit

Permalink
Merge pull request #29 from tolking/dev
Browse files Browse the repository at this point in the history
releases v2.1.1
  • Loading branch information
tolking authored Sep 4, 2022
2 parents 433aad5 + 94419a0 commit 7738f20
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 22 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### 2.1.1

feat

- add config reWebTypesType
- improve types for web-types

### 2.1.0

feat
Expand Down
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ then in package.json

<details>
<summary>TOC</summary>

- [entry (required)](#entry)
- [outDir (required)](#outdir)
- [name (required)](#name)
Expand All @@ -57,6 +56,7 @@ then in package.json
- [reAttribute](#reattribute)
- [reVeturDescription](#reveturdescription)
- [reWebTypesSource](#rewebtypessource)
- [reWebTypesType](#rewebtypestype)
- [tags](#tags)
- [attributes](#attributes)
- [webTypes](#webtypes)
Expand All @@ -80,7 +80,6 @@ then in package.json
- [titleRegExp](#titleregexp)
- [tableRegExp](#tableregexp)
- [fileNameRegExp](#filenameregexp)

</details>

### entry
Expand All @@ -93,16 +92,14 @@ entry path, refer: [fast-glob](https://github.com/mrmlnc/fast-glob#pattern-synta
for example:
- `docs/*.md` -- matches all files in the docs
- `docs/(a|b).md` -- matches files `a.md` and `b.md`
- `docs/!(a|b).md` -- matches files except `a.md` and `b.md`
- `docs/!(a|b).md` -- matches files except for `a.md` and `b.md`

### outDir

- Required: `true`
- Type: `string`

outDir path

For example: `lib`
outDir path, For example `lib`

### name

Expand All @@ -116,7 +113,7 @@ name of the component library.
- Required: `true`
- Type: `string`

version of the component library.
the version of the component library.

### space

Expand All @@ -138,7 +135,7 @@ the separator for propsOptions, slotsSubtags, type ...

rewriting the name of the component

for example: `(title) => 'prefix-' + title.replace(/\B([A-Z])/g, '-$1').toLowerCase()`
for example `(title) => 'prefix-' + title.replace(/\B([A-Z])/g, '-$1').toLowerCase()`

### reDocUrl

Expand Down Expand Up @@ -168,10 +165,15 @@ rewriting the description of vetur

### reWebTypesSource

- Type: `(title: string, fileName: string, path: string) => { module?: string; symbol: string } | { file: string; offset: number }`
- Default: `{ symbol: title }`
- Type: `(title: string, fileName: string, path: string) => Source`

rewriting the source of web-types. (the name of export from the component library)

### reWebTypesType

- Type: `(type: string) => undefined | string | BaseContribution`

rewriting the source of web-types. (the name of export from conmonents library)
Only 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

### tags

Expand Down Expand Up @@ -206,7 +208,7 @@ name of props table. **other string in the header will be identified as sub-comp
- Type: `string`
- Default: `Name`

name for props header name
name for the props header name

### propsDescription

Expand Down Expand Up @@ -248,7 +250,7 @@ name of events table. **other string in the header will be identified as sub-com
- Type: `string`
- Default: `Name`

name for events header name
name for the events header name

### eventsDescription

Expand All @@ -269,7 +271,7 @@ name of slots table. **other string in the header will be identified as sub-comp
- Type: `string`
- Default: `Name`

name for slots header name
name for the slots header name

### slotsDescription

Expand Down Expand Up @@ -297,7 +299,7 @@ name of directives table. **other string in the header will be identified as sub
- Type: `string`
- Default: `Name`

name for directives header name
name for the directives header name

### directivesDescription

Expand Down Expand Up @@ -325,14 +327,14 @@ matches the title and description information from docs
- Type: `RegExp` | `string` (**This is a regular string.**)
- Default: `/#+\s+(.*)\n+(\|?.+\|.+)\n\|?\s*:?-+:?\s*\|.+((\n\|?.+\|.+)+)/g`

matches the title and table header and table content information from docs
matches the title and table header and the table contains information from docs

### fileNameRegExp

- Type: `RegExp` | `string` (**This is a regular string.**)
- Default: `/\/((\w|-)+)\.\w+$/`

matches the file name from path
matches the file name from the path

## Advancement

Expand Down Expand Up @@ -386,7 +388,7 @@ and
<div><code>| column |</code></div>
</div>

by default matches all table, Optimize it through tableRegExp, For example:
by default matches all tables, Optimize it through tableRegExp, For example:

/#+\s+(`.*\s*Props|.*\s*Events|.*\s*Slots|.*\s*Directives`)\n+(`\|?.+\|.+`)\n\|?\s*:?-+:?\s*\|.+(`(\n\|?.+\|.+)+`)/g

Expand All @@ -410,7 +412,7 @@ and

### other

- When this docs not included the primary title or `Props` `Events` `Slots` and `Directives`, this component are not created.
When this document does not include the primary title or `Props` `Events` `Slots` and `Directives`, this component is not created.

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "components-helper",
"version": "2.1.0",
"version": "2.1.1",
"description": "Based on the docs to provide code prompt files for vue component library",
"main": "lib/index.js",
"module": "lib/index.es.js",
Expand Down
6 changes: 6 additions & 0 deletions test/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ This is a description of the Demo component
| v-model | bind value | string | top / bottom ||

<!-- The header of the table can be configured -->
<!--
The type support TypeScript writing, but in order to generate better code hints, there are some requirements for reference types
recommend: `VNode[]`, `VNode[] / Array<string>`
not recommend: `Array<VNode>`, `Array<VNode \| string>`
-->

## Events

Expand Down
4 changes: 2 additions & 2 deletions test/mult.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is a description of the Third component

| Name | Description | Type | Options | Default |
|----- |------------ |----- |-------- | ------- |
| v-model | bind value | string | top / bottom | top |
| v-model | bind value | string / number || top |

## First Slots

Expand All @@ -30,7 +30,7 @@ This is a description of the Third component

| Name | Description | Type | Options | Default |
|----- |------------ |----- |-------- | ------- |
| v-model | bind value | string | top / bottom ||
| v-model | bind value | string / number |||

## Third Events

Expand Down

0 comments on commit 7738f20

Please sign in to comment.