Skip to content

Commit

Permalink
Merge pull request #87 from open-wc/feat/custom-kinds
Browse files Browse the repository at this point in the history
customize export kinds in markdown
  • Loading branch information
thepassle authored Jul 12, 2021
2 parents 5b418b6 + 5a96a12 commit d084439
Show file tree
Hide file tree
Showing 37 changed files with 679 additions and 384 deletions.
12 changes: 6 additions & 6 deletions packages/to-markdown/fixtures/css-parts/EXPECTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

### CSS Parts

| Name | Description |
| ---- | --------------- |
| bar | the bar element |
| Name | Description |
| ----- | --------------- |
| `bar` | the bar element |

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | ---------- | ----------- | -------------------------------------- | ------- |
| custom-element-definition | my-element | MyElement | ./fixtures/-TEST/package/my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ------------ | ----------- | -------------------------------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./fixtures/-TEST/package/my-element.js | |
12 changes: 6 additions & 6 deletions packages/to-markdown/fixtures/css-parts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

### CSS Parts

| Name | Description |
| ---- | --------------- |
| bar | the bar element |
| Name | Description |
| ----- | --------------- |
| `bar` | the bar element |

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | ---------- | ----------- | -------------------------------------- | ------- |
| custom-element-definition | my-element | MyElement | ./fixtures/-TEST/package/my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ------------ | ----------- | -------------------------------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./fixtures/-TEST/package/my-element.js | |
34 changes: 17 additions & 17 deletions packages/to-markdown/fixtures/details-private/EXPECTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@

### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ---- | ------- | ---------- | ---------- | ----------- | -------------- |
| pub | public | `'public'` | `'public'` | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ----- | ------- | ---------- | ---------- | ----------- | -------------- |
| `pub` | public | `'public'` | `'public'` | | |

### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| ------------ | ------- | ----------- | ---------- | ------ | -------------- |
| publicMethod | public | | | `void` | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| -------------- | ------- | ----------- | ---------- | ------ | -------------- |
| `publicMethod` | public | | | `void` | |

<details><summary>Private API</summary>

### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ---- | --------- | ------------- | ------------- | ----------- | -------------- |
| prot | protected | `'protected'` | `'protected'` | | |
| priv | private | `'private'` | `'private'` | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ------ | --------- | ------------- | ------------- | ----------- | -------------- |
| `prot` | protected | `'protected'` | `'protected'` | | |
| `priv` | private | `'private'` | `'private'` | | |

### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| --------------- | --------- | ----------- | ---------- | ------ | -------------- |
| protectedMethod | protected | | | `void` | |
| privateMethod | private | | | `void` | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| ----------------- | --------- | ----------- | ---------- | ------ | -------------- |
| `protectedMethod` | protected | | | `void` | |
| `privateMethod` | private | | | `void` | |

</details>

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | ---------- | ----------- | --------------- | ------- |
| custom-element-definition | my-element | MyElement | ./my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ------------ | ----------- | --------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
34 changes: 17 additions & 17 deletions packages/to-markdown/fixtures/details-private/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@

### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ---- | ------- | ---------- | ---------- | ----------- | -------------- |
| pub | public | `'public'` | `'public'` | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ----- | ------- | ---------- | ---------- | ----------- | -------------- |
| `pub` | public | `'public'` | `'public'` | | |

### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| ------------ | ------- | ----------- | ---------- | ------ | -------------- |
| publicMethod | public | | | `void` | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| -------------- | ------- | ----------- | ---------- | ------ | -------------- |
| `publicMethod` | public | | | `void` | |

<details><summary>Private API</summary>

### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ---- | --------- | ------------- | ------------- | ----------- | -------------- |
| prot | protected | `'protected'` | `'protected'` | | |
| priv | private | `'private'` | `'private'` | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ------ | --------- | ------------- | ------------- | ----------- | -------------- |
| `prot` | protected | `'protected'` | `'protected'` | | |
| `priv` | private | `'private'` | `'private'` | | |

### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| --------------- | --------- | ----------- | ---------- | ------ | -------------- |
| protectedMethod | protected | | | `void` | |
| privateMethod | private | | | `void` | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| ----------------- | --------- | ----------- | ---------- | ------ | -------------- |
| `protectedMethod` | protected | | | `void` | |
| `privateMethod` | private | | | `void` | |

</details>

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | ---------- | ----------- | --------------- | ------- |
| custom-element-definition | my-element | MyElement | ./my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ------------ | ----------- | --------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
20 changes: 20 additions & 0 deletions packages/to-markdown/fixtures/export-kinds/EXPECTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# `custom-kinds.js`:

## class: `MyElement`, `my-element`

<hr/>

## Variables

| Name | Description | Type |
| ---- | ----------- | --------- |
| `js` | | `boolean` |

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | -------------------------------------- | ------- |
| ![custom-element-definition](https://raw.githubusercontent.com/webcomponents/webcomponents.org/master/client/assets/logo.svg) | `MyElement` | MyElement | ./fixtures/-TEST/package/my-element.js | |
| JavaScript | `js` | js | ./fixtures/-TEST/package/my-element.js | |
20 changes: 20 additions & 0 deletions packages/to-markdown/fixtures/export-kinds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# `custom-kinds.js`:

## class: `MyElement`, `my-element`

<hr/>

## Variables

| Name | Description | Type |
| ---- | ----------- | --------- |
| `js` | | `boolean` |

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------- | -------------------------------------- | ------- |
| ![custom-element-definition](https://raw.githubusercontent.com/webcomponents/webcomponents.org/master/client/assets/logo.svg) | `MyElement` | MyElement | ./fixtures/-TEST/package/my-element.js | |
| JavaScript | `js` | js | ./fixtures/-TEST/package/my-element.js | |
42 changes: 42 additions & 0 deletions packages/to-markdown/fixtures/export-kinds/custom-elements.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"schemaVersion": "1.0.0",
"readme": "",
"modules": [
{
"kind": "javascript-module",
"path": "custom-kinds.js",
"declarations": [
{
"kind": "class",
"name": "MyElement",
"tagName": "my-element"
},
{
"kind": "variable",
"name": "js",
"type": {
"text": "boolean"
}
}
],
"exports": [
{
"kind": "custom-element-definition",
"name": "MyElement",
"declaration": {
"name": "MyElement",
"module": "./fixtures/-TEST/package/my-element.js"
}
},
{
"kind": "js",
"name": "js",
"declaration": {
"name": "js",
"module": "./fixtures/-TEST/package/my-element.js"
}
}
]
}
]
}
38 changes: 19 additions & 19 deletions packages/to-markdown/fixtures/heading-offset-2/EXPECTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@

##### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ----- | ------- | ---- | ------- | ----------- | -------------- |
| prop1 | public | | | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ------- | ------- | ---- | ------- | ----------- | -------------- |
| `prop1` | public | | | | |

##### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| -------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
| instanceMethod | public | Some description of the method here | `e: Event, a: string` | | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| ---------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
| `instanceMethod` | public | Some description of the method here | `e: Event, a: string` | | |

##### Events

| Name | Type | Description | Inherited From |
| -------- | ------- | ----------- | -------------- |
| my-event | `Event` | | |
| Name | Type | Description | Inherited From |
| ---------- | ------- | ----------- | -------------- |
| `my-event` | `Event` | | |

##### CSS Properties

| Name | Default | Description |
| ------------------ | --------------- | ------------------------- |
| --background-color | `rebeccapurple` | Controls the color of bar |
| Name | Default | Description |
| -------------------- | --------------- | ------------------------- |
| `--background-color` | `rebeccapurple` | Controls the color of bar |

<hr/>

#### Functions

| Name | Description | Parameters | Return |
| -------------- | ------------------------- | ----------------------- | --------- |
| functionExport | This is a function export | `a: string, b: boolean` | `boolean` |
| Name | Description | Parameters | Return |
| ---------------- | ------------------------- | ----------------------- | --------- |
| `functionExport` | This is a function export | `a: string, b: boolean` | `boolean` |

<hr/>

#### Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | -------------- | -------------- | --------------- | ------- |
| custom-element-definition | my-element | MyElement | ./my-element.js | |
| js | functionExport | functionExport | ./my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ---------------- | -------------- | --------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
| `js` | `functionExport` | functionExport | ./my-element.js | |
38 changes: 19 additions & 19 deletions packages/to-markdown/fixtures/heading-offset-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,41 @@

##### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ----- | ------- | ---- | ------- | ----------- | -------------- |
| prop1 | public | | | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ------- | ------- | ---- | ------- | ----------- | -------------- |
| `prop1` | public | | | | |

##### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| -------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
| instanceMethod | public | Some description of the method here | `e: Event, a: string` | | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| ---------------- | ------- | ----------------------------------- | --------------------- | ------ | -------------- |
| `instanceMethod` | public | Some description of the method here | `e: Event, a: string` | | |

##### Events

| Name | Type | Description | Inherited From |
| -------- | ------- | ----------- | -------------- |
| my-event | `Event` | | |
| Name | Type | Description | Inherited From |
| ---------- | ------- | ----------- | -------------- |
| `my-event` | `Event` | | |

##### CSS Properties

| Name | Default | Description |
| ------------------ | --------------- | ------------------------- |
| --background-color | `rebeccapurple` | Controls the color of bar |
| Name | Default | Description |
| -------------------- | --------------- | ------------------------- |
| `--background-color` | `rebeccapurple` | Controls the color of bar |

<hr/>

#### Functions

| Name | Description | Parameters | Return |
| -------------- | ------------------------- | ----------------------- | --------- |
| functionExport | This is a function export | `a: string, b: boolean` | `boolean` |
| Name | Description | Parameters | Return |
| ---------------- | ------------------------- | ----------------------- | --------- |
| `functionExport` | This is a function export | `a: string, b: boolean` | `boolean` |

<hr/>

#### Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | -------------- | -------------- | --------------- | ------- |
| custom-element-definition | my-element | MyElement | ./my-element.js | |
| js | functionExport | functionExport | ./my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ---------------- | -------------- | --------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
| `js` | `functionExport` | functionExport | ./my-element.js | |
22 changes: 11 additions & 11 deletions packages/to-markdown/fixtures/hide-private/EXPECTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ---- | --------- | ------------- | ------------- | ----------- | -------------- |
| pub | public | `'public'` | `'public'` | | |
| prot | protected | `'protected'` | `'protected'` | | |
| Name | Privacy | Type | Default | Description | Inherited From |
| ------ | --------- | ------------- | ------------- | ----------- | -------------- |
| `pub` | public | `'public'` | `'public'` | | |
| `prot` | protected | `'protected'` | `'protected'` | | |

### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| --------------- | --------- | ----------- | ---------- | ------ | -------------- |
| publicMethod | public | | | `void` | |
| protectedMethod | protected | | | `void` | |
| Name | Privacy | Description | Parameters | Return | Inherited From |
| ----------------- | --------- | ----------- | ---------- | ------ | -------------- |
| `publicMethod` | public | | | `void` | |
| `protectedMethod` | protected | | | `void` | |

<hr/>

## Exports

| Kind | Name | Declaration | Module | Package |
| ------------------------- | ---------- | ----------- | --------------- | ------- |
| custom-element-definition | my-element | MyElement | ./my-element.js | |
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ------------ | ----------- | --------------- | ------- |
| `custom-element-definition` | `my-element` | MyElement | ./my-element.js | |
Loading

0 comments on commit d084439

Please sign in to comment.