UNPKG

1.94 kBMarkdownView Raw
1# d4sd-components
2
3This is the component library for [D4SD](https://d4sd.org/)
4
5It is an extension of Ant Design, so all non-overided components remain purely Ant Design components
6
7To see/test our components, go to master branch and run `npm run storybook`
8
9## How to publish components library
10
11First, make your components in the `components` folder
12
13Then, in `index.tsx` in the root folder, add a
14```js
15export { YourComponent } from "./components/YourComponent";
16```
17before the `export * from "antd"`
18
19Then, running
20```bash
21npm run storybook
22```
23Will load the current code and show your components in `stories` on a locally hosted website that will eventually automatically open.
24
25
26Then run the following to **prepare/build** the component library for publishing
27
28```bash
29npm run build
30```
31
32This essentially removes the old package and then runs webpack to pack our code into a library.
33
34This will eventually open a website displaying the contents of the package just built and its size, you can quit this process anytime. The package contents should contain `index.js` and `main.css`.
35
36After running the build, make sure to **commit** all changes and push them to the remote (GitHub) and then **update the package version**
37
38```bash
39npm version patch
40```
41
42Then we finally **publish** the library with
43
44```bash
45npm publish
46```
47
48Once published, make sure to run
49```bash
50npm install @d4sd/components
51```
52
53in whichever repository is using our components to update it.
54
55## Development Workflow / Tips
56
57The master branch should **always** be in sync with what is published. E.g, if you ran `npm run build`, the built package is the same as what is being hosted on npm.
58
59With this in mind, make changes by branching off of master and test those changes using `npm run storybook`. Commit/push those changes to your branch and merge your branch into `master` once it is ready. After each merge, **make sure** to follow the publishing steps above.
60