Skip to content
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

Improve contributing guide #53

Merged
merged 3 commits into from
Nov 26, 2019
Merged

Improve contributing guide #53

merged 3 commits into from
Nov 26, 2019

Conversation

glambert
Copy link
Collaborator

@glambert glambert commented Nov 26, 2019

Description

Our contributing guide needed a bit of ❤️, especially for external contributors. I've also added a yarn generate command for mainline components.

How to test?

See changed files for the contributing guide updates.

For the new generate script:

  • Pull branch
  • Run yarn generate
  • Choose "Mainline component"
  • Choose a name or use the default one ("Component")
  • Run yarn dev
  • You should see the newly generated component story within Storybook

Checklist

@glambert glambert requested a review from a team as a code owner November 26, 2019 18:38
plopfile.js Outdated
plop.setGenerator('Add-on component', {
description: 'Create a new add-on component',
description: 'Create a new add-on/experimentall component',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: 'Create a new add-on/experimentall component',
description: 'Create a new add-on/experimental component',

describe('{{pascalCase name}}', () => {
it('should be tested', () => {
const { container } = customRender(<{{pascalCase name}}>children</{{pascalCase name}}>);
expect(container).toBeDefined();
Copy link
Contributor

Choose a reason for hiding this comment

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

Funny enough, we could also fail the test to force folks to write something valid.

@@ -0,0 +1,3 @@
import { {{pascalCase name}}, {{pascalCase name}}Props } from './{{pascalCase name}}';
Copy link
Contributor

Choose a reason for hiding this comment

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

We might need to add isolated modules in our tsconfig. Should protect us from importing things that get stripped at build time.

What that means is the {{pascalCase name}}Props will not be valid. So it should be removed.

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 the case with our latest tsconfig, should we update?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

@netlify
Copy link

netlify bot commented Nov 26, 2019

Deploy preview for lightspeed-flame ready!

Built with commit 41570c9

https://deploy-preview-53--lightspeed-flame.netlify.com


const stories = storiesOf('{{pascalCase name}}', module);

stories.add('Story', () => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we swap this out to the new storybook api?

see https://storybook.js.org/docs/basics/writing-stories/#basic-story, which does not use the stories.add api

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason couldn't get it to work. Let's scope this in another PR and update all stories to use the new Component Story Format (CSF).

Issue created: #54


The main purpose of working on it open-source is to be transparent on what we bring to our customers, but also to be able to get valuable feedback and contribution from the community. We believe open-source is vital to software development as most of the libraries we rely on are built in the open space.

As our journey begins in the open-source world, we are accepting [bug reports](https://github.com/lightspeed/flame/issues/new?template=BUG_REPORT.md), [feature request](https://github.com/lightspeed/flame/issues/new?template=FEATURE_REQUEST.md) as well as pull requests for improvements, but no additions or breaking changes until we have a proper process to accept and treat those accordingly.
Copy link
Contributor

@immasandwich immasandwich Nov 26, 2019

Choose a reason for hiding this comment

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

Suggested change
As our journey begins in the open-source world, we are accepting [bug reports](https://github.com/lightspeed/flame/issues/new?template=BUG_REPORT.md), [feature request](https://github.com/lightspeed/flame/issues/new?template=FEATURE_REQUEST.md) as well as pull requests for improvements, but no additions or breaking changes until we have a proper process to accept and treat those accordingly.
As our journey begins in the open-source world, we are accepting [bug reports](https://github.com/lightspeed/flame/issues/new?template=BUG_REPORT.md), [feature requests](https://github.com/lightspeed/flame/issues/new?template=FEATURE_REQUEST.md) and pull requests for improvements. We are not accepting additions or breaking changes until we have a proper process to triage and approve these changes accordingly.


As our journey begins in the open-source world, we are accepting [bug reports](https://github.com/lightspeed/flame/issues/new?template=BUG_REPORT.md), [feature request](https://github.com/lightspeed/flame/issues/new?template=FEATURE_REQUEST.md) as well as pull requests for improvements, but no additions or breaking changes until we have a proper process to accept and treat those accordingly.

We still encourage anyone to fork and play around Flame for personal usage. Read our [LICENSE](../LICENSE) in case of uncertainty on what we allow in this regard.
Copy link
Contributor

Choose a reason for hiding this comment

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

The second sentence is a little vague, but I guess the license only pertains to users who would like to use Flame commercially. If I'm correct, consider the following suggestion:

Suggested change
We still encourage anyone to fork and play around Flame for personal usage. Read our [LICENSE](../LICENSE) in case of uncertainty on what we allow in this regard.
We still encourage anyone to fork and play around Flame for personal usage. Read our [LICENSE](../LICENSE) in the case of commercial use.


#### Mainline component

Mainline components will be created under `packages/flame/src/{ComponentName}`, where all other components are located. This will create the base component structure ready for development, including README for docs, story for Storybook development and visual regression test, tests and TypeScript component file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually, when we create a comma separated list, we aim to have three separate items that are fairly similar in length. The flow helps with readability. Consider the following suggestion:

Suggested change
Mainline components will be created under `packages/flame/src/{ComponentName}`, where all other components are located. This will create the base component structure ready for development, including README for docs, story for Storybook development and visual regression test, tests and TypeScript component file.
Mainline components will be created under `packages/flame/src/{ComponentName}`, where all other components are located. The base component structure includes a storybook file, a test file, and a component file.


#### Add-on component

Add-on component will be created under the `packages/flame-{component-name}`. It should be used for add-on/experimental components that are not ready to go into the [mainline package](https://github.com/lightspeed/flame/tree/master/packages/flame) or are considered as "extras" and don't fit our component library.
Copy link
Contributor

Choose a reason for hiding this comment

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

Restructured to explain what is defined as an "add-on" component:

Suggested change
Add-on component will be created under the `packages/flame-{component-name}`. It should be used for add-on/experimental components that are not ready to go into the [mainline package](https://github.com/lightspeed/flame/tree/master/packages/flame) or are considered as "extras" and don't fit our component library.
Add-on components will be created under the `packages/flame-{component-name}`. These components are either experimental in implementation, or compositions that do not fit our essential component library.


Add-on component will be created under the `packages/flame-{component-name}`. It should be used for add-on/experimental components that are not ready to go into the [mainline package](https://github.com/lightspeed/flame/tree/master/packages/flame) or are considered as "extras" and don't fit our component library.

Add-on components are a completely separate package with their own version and have `@lightspeed/flame` and all its required dependencies as `peerDependencies`. They include the same base component structure as a mainline component, but also have a `tsconfig` to output types as well as their own LICENSE and CHANGELOG files.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to be too granular in the component structure (re: CHANGELOG and LICENSE) if you word this section as follows:

Suggested change
Add-on components are a completely separate package with their own version and have `@lightspeed/flame` and all its required dependencies as `peerDependencies`. They include the same base component structure as a mainline component, but also have a `tsconfig` to output types as well as their own LICENSE and CHANGELOG files.
Add-on components are a completely separate package which are versioned independently, licensed independently, and have `@lightspeed/flame` and all its required dependencies as `peerDependencies`. They include the same base component structure as a mainline component.

Independent versioning and licensing implies that the package has its own LICENSE and CHANGELOG.

Copy link
Contributor

@immasandwich immasandwich left a comment

Choose a reason for hiding this comment

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

Some documentation suggestions, see what suits your needs.

@glambert
Copy link
Collaborator Author

Thanks for the review @xdrdak and @kshahani. Ready for another check!

@glambert glambert merged commit 596b897 into master Nov 26, 2019
@glambert glambert deleted the contributing-updates branch November 26, 2019 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants