-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
plopfile.js
Outdated
plop.setGenerator('Add-on component', { | ||
description: 'Create a new add-on component', | ||
description: 'Create a new add-on/experimentall component', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
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}}'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Deploy preview for lightspeed-flame ready! Built with commit 41570c9 |
|
||
const stories = storiesOf('{{pascalCase name}}', module); | ||
|
||
stories.add('Story', () => ( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.github/CONTRIBUTING.md
Outdated
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
.github/CONTRIBUTING.md
Outdated
|
||
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. |
There was a problem hiding this comment.
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:
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. |
.github/CONTRIBUTING.md
Outdated
|
||
#### 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. |
There was a problem hiding this comment.
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:
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. |
There was a problem hiding this comment.
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:
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. |
There was a problem hiding this comment.
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:
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.
There was a problem hiding this 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.
Thanks for the review @xdrdak and @kshahani. Ready for another check! |
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:
yarn generate
yarn dev
Checklist