From 8e94eb27b3905ff4ff4765adef350d54e8c12b64 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 9 Oct 2020 17:42:05 -0700 Subject: [PATCH] docs(contributing): update component guidance --- CONTRIBUTING.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e31a4609..9b759e9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,6 +59,8 @@ yarn link "carbon-components-svelte" yarn install ``` +If linked correctly, any change to a component in the `src` folder should be reflected in the `docs` site. + --- ## Development workflow @@ -73,9 +75,7 @@ yarn dev The site should be served at `http://localhost:3000/` (or the next available port). -### Editing a component - -#### Component Format +### Component Format Each component should adopt the following structure: @@ -87,9 +87,35 @@ src/Component └───index.js // export components (e.g. `Component.svelte`, `Component.Skeleton.svelte`) ``` +### Editing a component + +If adding or editing an exported component prop, be sure to annotate its value using [JSDoc](https://jsdoc.app/) conventions. + +```js +/** + * Set to `true` to disable the tab + * @type {boolean} [disabled=false] + */ +export let disabled = false; +``` + ### Creating a component -[Submit an issue](https://github.com/IBM/carbon-components-svelte/issues). +First, [submit an issue](https://github.com/IBM/carbon-components-svelte/issues). + +If creating a new component, don't forget it from `src/index.js`: + +```diff +export { CopyButton } from "./CopyButton"; +export { ComboBox } from "./ComboBox"; ++ export { FixedComboBox } from "./FixedComboBox"; +export { + ComposedModal, + ModalHeader, + ModalBody, + ModalFooter, +} from "./ComposedModal"; +``` ### Build