Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(docs): adding 'behaviors' section to menu #119

Merged
merged 35 commits into from
Sep 4, 2018

Conversation

kolaps33
Copy link
Collaborator

@kolaps33 kolaps33 commented Aug 21, 2018

Accessibility description

Changes done in this PR:

  • adding section 'Behaviors' into the menu under the 'Components' section
  • in section 'Behaviors' all existing behaviors are listed
  • inside the particular Behavior all different behaviors for the component are listed
  • particular description for behavior will be stored in behavior file with tag '@description' - description it will be added in next PR

Please see screenshot with changes:
image

@kolaps33 kolaps33 changed the title Feat/356641 acc behaviour section Accessibility documentation - structured Aug 21, 2018
@kolaps33 kolaps33 changed the title Accessibility documentation - structured Accessibility documentation - structured based on behavior Aug 21, 2018
@kolaps33 kolaps33 changed the title Accessibility documentation - structured based on behavior Accessibility documentation - structured, based on behavior Aug 21, 2018
Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure this PR contains as few changes as possible. It seems that is contains a lot of changes not directly related to it.

{ key: 'editorials', content: 'Editorials' },
{ key: 'review', content: 'Reviews' },
{ key: 'events', content: 'Upcoming Events' },
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this debug changes

@@ -0,0 +1,35 @@
import * as React from 'react'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changed tests are not part of 'Accessibility documentation', these should be a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually is a separate PR (https://github.com/stardust-ui/react/pull/74/files) - once that gets merged, the change should disappear from this PR.

@codecov
Copy link

codecov bot commented Aug 22, 2018

Codecov Report

Merging #119 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #119   +/-   ##
=======================================
  Coverage   68.02%   68.02%           
=======================================
  Files         101      101           
  Lines        1370     1370           
  Branches      260      269    +9     
=======================================
  Hits          932      932           
  Misses        436      436           
  Partials        2        2

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 ca435ed...1f646ed. Read the comment docs.

@kolaps33 kolaps33 changed the title Accessibility documentation - structured, based on behavior Accessibility documentation - adding 'behaviors' section to menu Aug 28, 2018
if (!_.isEmpty(blockComments)) {
const commentTokens = doctrine.parse(blockComments[0].raw, { unwrap: true }).tags
const descriptionToken = commentTokens.find(token => token.title === 'description')
description = descriptionToken.description
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check descriptionToken is defined. Now if there is a block comment without @description build crashes.

@@ -78,7 +91,12 @@ task('build:docs:example-menu', () =>

task(
'build:docs:json',
parallel('build:docs:docgen', 'build:docs:component-menu', 'build:docs:example-menu'),
parallel(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch (yarn start) does not reflect changes if Behavior description changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point :)
I was trying to implement that watch will rebuild either behaviors file, but was not able to find how to do it.
@miroslavstastny or @kuzhelov pleae if you could help me with it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added watch for behaviours. Watch currently does not work on Windows (not caused by this PR), I will address that in #172 once this PR is merged.

@@ -55,6 +61,7 @@ task(
// ----------------------------------------

const componentsSrc = [`${config.paths.src()}/components/*/[A-Z]*.tsx`]
const behaviorSrc = [`${config.paths.src()}/lib/accessibility/Behaviors/*/[A-Z]*.ts`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about DefaultBehavior.ts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not real behavior which would need documentation, so it doesn't need be included

@miroslavstastny
Copy link
Member

Also add docs/src/componentMenuBehaviors.json to .gitignore

@kolaps33 kolaps33 changed the title Accessibility documentation - adding 'behaviors' section to menu feat(accessibility documentation): adding 'behaviors' section to menu Sep 3, 2018
}

getNameFromFileName(fileName: string) {
const divided = _.startCase(fileName.replace('ts', ''))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is better to introduce more descriptive name for this variable (like baseName)

@@ -12,10 +12,10 @@ import { getComponentPathname, typeOrder, repoURL } from 'docs/src/utils'

const pkg = require('../../../../package.json')
const componentMenu = require('docs/src/componentMenu')
const behaviorMenuItems = require('docs/src/componentMenuBehaviors')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather suggest to use behaviorMenu as a file name (and behaviorMenu as a variable name):

const behaviorMenu = require('docs/src/behaviorMenu')

This will result in consistent pattern with the line above:

const componentMenu = require('docs/src/componentMenu')

@kuzhelov
Copy link
Contributor

kuzhelov commented Sep 4, 2018

Couple of minor comments - please, take a look.

Also, please, consider to review changes that were reported by Screener.

Thank you!

@kuzhelov kuzhelov changed the title feat(accessibility documentation): adding 'behaviors' section to menu feat(docs): adding 'behaviors' section to menu Sep 4, 2018
@kuzhelov kuzhelov added needs author feedback Author's opinion is asked and removed 🚀 ready for review labels Sep 4, 2018
@kolaps33 kolaps33 added 🚀 ready for review and removed needs author feedback Author's opinion is asked labels Sep 4, 2018
@kolaps33 kolaps33 merged commit a26e33b into master Sep 4, 2018
@levithomason levithomason deleted the feat/356641-acc-behaviour-section branch October 29, 2019 22:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants