Skip to content

feat(docs): Allow sub-components to show reference info for slots and events #2132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 108 commits into from
Nov 5, 2018

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented Nov 4, 2018

Description of PR:

Allow component's package.json to support an array of objects for the components entry of meta, as well as adding any aliases to the component reference:

{
  "meta" : {
    "component": "bComponent",
    "aliases": [
       "b-comp" // or could be camelCase
    ],
    "components" : [
      "bSubComponentA",
      {
        "component": "bSubComponentB",
        "aliases": [
           "b-sub-b", // or could be camelCase
           "b-s-b"
        ],
        "events": [
          {
            "event": "foo",
            "description": "Foo event",
            "args": [
              { "name": "x", "description": "X description" }
            ]
          }
        ],
        "slots": [
          {
            "name": "bar",
            "description": "Bar slot"
          }
        ]
      }
    ]
  }
}

Backwards compatible with existing format.

Includes generation of TOC entries for Component Reference sections


PR checklist:

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Enhancement to an existing feature
  • ARIA accessibility
  • Documentation update
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fixes #xxxx[,#xxxx], where "xxxx" is the issue number)

If new features/enhancement/fixes are added or changed:

  • Includes documentation updates
  • New/updated tests are included and passing (if required)
  • Existing test suites are passing
  • The changes have not impacted the functionality of other components or directives
  • ARIA Accessibility has been taken into consideration (does it affect screen reader users or keyboard only users?)

If adding a new feature, or changing the functionality of an existing feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

PR titles should following the Conventional Commits naming convention

…events

Allow component's package.json to support an array of objects for the `components` entry of `meta`:

```json
{
  "meta" : {
    "component": "bComponent",
    "components" : [
      "bSubComponentA",
      {
        "component": "bSubComponentB",
        "events": [
          {
            "event": "foo",
            "description": "Foo event",
            "args": [
              { "name": "x", "description": "X description" }
            ]
          }
        },
        "slots": [
          {
            "name": "bar",
            "description": "Bar slot"
          }
        ]
      }
    }
  }
}
```
@codecov
Copy link

codecov bot commented Nov 4, 2018

Codecov Report

Merging #2132 into dev will increase coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev   #2132      +/-   ##
=========================================
+ Coverage   64.97%     65%   +0.02%     
=========================================
  Files         158     158              
  Lines        2958    2960       +2     
  Branches      811     812       +1     
=========================================
+ Hits         1922    1924       +2     
  Misses        749     749              
  Partials      287     287
Impacted Files Coverage Δ
src/components/button/button-close.js 75% <ø> (ø) ⬆️
src/components/navbar/navbar-toggle.js 83.33% <0%> (ø) ⬆️
src/components/carousel/carousel-slide.js 66.66% <100%> (+5.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afe1cd0...8e43dff. Read the comment docs.

…rray

`v-if`/`v-else` test no longer needed since we normalize to array of object form when importing the meta data
handle sub components in new array of objects form
Update meta.components to new format
@tmorehouse tmorehouse requested a review from pi0 November 4, 2018 21:34
@tmorehouse tmorehouse changed the title [WIP] feat(docs): Allow sub-components to show reference info for slots and events feat(docs): Allow sub-components to show reference info for slots and events Nov 5, 2018
@tmorehouse tmorehouse merged commit 52c960b into dev Nov 5, 2018
@tmorehouse tmorehouse deleted the tmorehouse/docs branch November 5, 2018 08:38
@tmorehouse tmorehouse mentioned this pull request Nov 14, 2018
89 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant