@bcgov/design-system-react-components 0.5.2 → 0.6.0-pr622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -33
- package/dist/cjs/index.cjs +20515 -10016
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +20504 -10017
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +74 -9
- package/package.json +56 -43
- package/dist/cjs/types/components/Accordion/Accordion.d.ts +0 -6
- package/dist/cjs/types/components/Accordion/index.d.ts +0 -2
- package/dist/cjs/types/components/AccordionGroup/AccordionGroup.d.ts +0 -7
- package/dist/cjs/types/components/AccordionGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/AlertBanner/AlertBanner.d.ts +0 -10
- package/dist/cjs/types/components/AlertBanner/index.d.ts +0 -2
- package/dist/cjs/types/components/AlertDialog/AlertDialog.d.ts +0 -11
- package/dist/cjs/types/components/AlertDialog/AlertDialog.test.d.ts +0 -1
- package/dist/cjs/types/components/AlertDialog/index.d.ts +0 -2
- package/dist/cjs/types/components/Button/Button.d.ts +0 -21
- package/dist/cjs/types/components/Button/Button.test.d.ts +0 -1
- package/dist/cjs/types/components/Button/index.d.ts +0 -2
- package/dist/cjs/types/components/ButtonGroup/ButtonGroup.d.ts +0 -7
- package/dist/cjs/types/components/ButtonGroup/ButtonGroup.test.d.ts +0 -1
- package/dist/cjs/types/components/ButtonGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/Callout/Callout.d.ts +0 -10
- package/dist/cjs/types/components/Callout/index.d.ts +0 -2
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/cjs/types/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/cjs/types/components/Checkbox/index.d.ts +0 -2
- package/dist/cjs/types/components/CheckboxGroup/CheckboxGroup.d.ts +0 -11
- package/dist/cjs/types/components/CheckboxGroup/CheckboxGroup.test.d.ts +0 -1
- package/dist/cjs/types/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/Dialog/Dialog.d.ts +0 -11
- package/dist/cjs/types/components/Dialog/Dialog.test.d.ts +0 -1
- package/dist/cjs/types/components/Dialog/index.d.ts +0 -2
- package/dist/cjs/types/components/Footer/Footer.d.ts +0 -62
- package/dist/cjs/types/components/Footer/Footer.test.d.ts +0 -1
- package/dist/cjs/types/components/Footer/index.d.ts +0 -2
- package/dist/cjs/types/components/Form/Form.d.ts +0 -2
- package/dist/cjs/types/components/Form/Form.test.d.ts +0 -1
- package/dist/cjs/types/components/Form/index.d.ts +0 -2
- package/dist/cjs/types/components/Header/Header.d.ts +0 -29
- package/dist/cjs/types/components/Header/Header.test.d.ts +0 -1
- package/dist/cjs/types/components/Header/index.d.ts +0 -2
- package/dist/cjs/types/components/Heading/Heading.d.ts +0 -7
- package/dist/cjs/types/components/Heading/index.d.ts +0 -2
- package/dist/cjs/types/components/Icons/SvgBcLogo/SvgBcLogo.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgBcLogo/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgBcOutlineIcon/SvgBcOutlineIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgBcOutlineIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgBetaIcon/SvgBetaIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgBetaIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgCheckCircleIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgCheckIcon/SvgCheckIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgCheckIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgChevronDownIcon/SvgChevronDownIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgChevronDownIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgChevronUpIcon/SvgChevronUpIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgChevronUpIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgCloseIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgDashIcon/SvgDashIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgDashIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgExclamationIcon/SvgExclamationIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgExclamationIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgInfoIcon/index.d.ts +0 -1
- package/dist/cjs/types/components/Icons/SvgTooltipArrowUp/SvgTooltipArrowUp.d.ts +0 -3
- package/dist/cjs/types/components/Icons/SvgTooltipArrowUp/index.d.ts +0 -1
- package/dist/cjs/types/components/InlineAlert/InlineAlert.d.ts +0 -12
- package/dist/cjs/types/components/InlineAlert/InlineAlert.test.d.ts +0 -1
- package/dist/cjs/types/components/InlineAlert/index.d.ts +0 -2
- package/dist/cjs/types/components/Link/Link.d.ts +0 -15
- package/dist/cjs/types/components/Link/index.d.ts +0 -2
- package/dist/cjs/types/components/Modal/Modal.d.ts +0 -3
- package/dist/cjs/types/components/Modal/Modal.test.d.ts +0 -1
- package/dist/cjs/types/components/Modal/index.d.ts +0 -2
- package/dist/cjs/types/components/Radio/Radio.d.ts +0 -3
- package/dist/cjs/types/components/Radio/Radio.test.d.ts +0 -1
- package/dist/cjs/types/components/Radio/index.d.ts +0 -2
- package/dist/cjs/types/components/RadioGroup/RadioGroup.d.ts +0 -12
- package/dist/cjs/types/components/RadioGroup/RadioGroup.test.d.ts +0 -1
- package/dist/cjs/types/components/RadioGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/Select/Select.d.ts +0 -39
- package/dist/cjs/types/components/Select/index.d.ts +0 -2
- package/dist/cjs/types/components/Switch/Switch.d.ts +0 -6
- package/dist/cjs/types/components/Switch/Switch.test.d.ts +0 -1
- package/dist/cjs/types/components/Switch/index.d.ts +0 -2
- package/dist/cjs/types/components/Tag/Tag.d.ts +0 -21
- package/dist/cjs/types/components/Tag/index.d.ts +0 -2
- package/dist/cjs/types/components/TagGroup/TagGroup.d.ts +0 -17
- package/dist/cjs/types/components/TagGroup/index.d.ts +0 -2
- package/dist/cjs/types/components/TagList/TagList.d.ts +0 -11
- package/dist/cjs/types/components/TagList/index.d.ts +0 -2
- package/dist/cjs/types/components/Text/Text.d.ts +0 -8
- package/dist/cjs/types/components/Text/index.d.ts +0 -2
- package/dist/cjs/types/components/TextArea/TextArea.d.ts +0 -8
- package/dist/cjs/types/components/TextArea/index.d.ts +0 -2
- package/dist/cjs/types/components/TextField/TextField.d.ts +0 -11
- package/dist/cjs/types/components/TextField/index.d.ts +0 -2
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +0 -5
- package/dist/cjs/types/components/Tooltip/index.d.ts +0 -2
- package/dist/cjs/types/components/index.d.ts +0 -42
- package/dist/cjs/types/index.d.ts +0 -1
- package/dist/esm/types/components/Accordion/Accordion.d.ts +0 -6
- package/dist/esm/types/components/Accordion/index.d.ts +0 -2
- package/dist/esm/types/components/AccordionGroup/AccordionGroup.d.ts +0 -7
- package/dist/esm/types/components/AccordionGroup/index.d.ts +0 -2
- package/dist/esm/types/components/AlertBanner/AlertBanner.d.ts +0 -10
- package/dist/esm/types/components/AlertBanner/index.d.ts +0 -2
- package/dist/esm/types/components/AlertDialog/AlertDialog.d.ts +0 -11
- package/dist/esm/types/components/AlertDialog/AlertDialog.test.d.ts +0 -1
- package/dist/esm/types/components/AlertDialog/index.d.ts +0 -2
- package/dist/esm/types/components/Button/Button.d.ts +0 -21
- package/dist/esm/types/components/Button/Button.test.d.ts +0 -1
- package/dist/esm/types/components/Button/index.d.ts +0 -2
- package/dist/esm/types/components/ButtonGroup/ButtonGroup.d.ts +0 -7
- package/dist/esm/types/components/ButtonGroup/ButtonGroup.test.d.ts +0 -1
- package/dist/esm/types/components/ButtonGroup/index.d.ts +0 -2
- package/dist/esm/types/components/Callout/Callout.d.ts +0 -10
- package/dist/esm/types/components/Callout/index.d.ts +0 -2
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/esm/types/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -2
- package/dist/esm/types/components/CheckboxGroup/CheckboxGroup.d.ts +0 -11
- package/dist/esm/types/components/CheckboxGroup/CheckboxGroup.test.d.ts +0 -1
- package/dist/esm/types/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/esm/types/components/Dialog/Dialog.d.ts +0 -11
- package/dist/esm/types/components/Dialog/Dialog.test.d.ts +0 -1
- package/dist/esm/types/components/Dialog/index.d.ts +0 -2
- package/dist/esm/types/components/Footer/Footer.d.ts +0 -62
- package/dist/esm/types/components/Footer/Footer.test.d.ts +0 -1
- package/dist/esm/types/components/Footer/index.d.ts +0 -2
- package/dist/esm/types/components/Form/Form.d.ts +0 -2
- package/dist/esm/types/components/Form/Form.test.d.ts +0 -1
- package/dist/esm/types/components/Form/index.d.ts +0 -2
- package/dist/esm/types/components/Header/Header.d.ts +0 -29
- package/dist/esm/types/components/Header/Header.test.d.ts +0 -1
- package/dist/esm/types/components/Header/index.d.ts +0 -2
- package/dist/esm/types/components/Heading/Heading.d.ts +0 -7
- package/dist/esm/types/components/Heading/index.d.ts +0 -2
- package/dist/esm/types/components/Icons/SvgBcLogo/SvgBcLogo.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgBcLogo/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgBcOutlineIcon/SvgBcOutlineIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgBcOutlineIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgBetaIcon/SvgBetaIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgBetaIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgCheckCircleIcon/SvgCheckCircleIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgCheckCircleIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgCheckIcon/SvgCheckIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgCheckIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgChevronDownIcon/SvgChevronDownIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgChevronDownIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgChevronUpIcon/SvgChevronUpIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgChevronUpIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgCloseIcon/SvgCloseIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgCloseIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgDashIcon/SvgDashIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgDashIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/SvgExclamationCircleIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgExclamationCircleIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgExclamationIcon/SvgExclamationIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgExclamationIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgInfoIcon/SvgInfoIcon.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgInfoIcon/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/SvgTooltipArrowUp/SvgTooltipArrowUp.d.ts +0 -3
- package/dist/esm/types/components/Icons/SvgTooltipArrowUp/index.d.ts +0 -1
- package/dist/esm/types/components/InlineAlert/InlineAlert.d.ts +0 -12
- package/dist/esm/types/components/InlineAlert/InlineAlert.test.d.ts +0 -1
- package/dist/esm/types/components/InlineAlert/index.d.ts +0 -2
- package/dist/esm/types/components/Link/Link.d.ts +0 -15
- package/dist/esm/types/components/Link/index.d.ts +0 -2
- package/dist/esm/types/components/Modal/Modal.d.ts +0 -3
- package/dist/esm/types/components/Modal/Modal.test.d.ts +0 -1
- package/dist/esm/types/components/Modal/index.d.ts +0 -2
- package/dist/esm/types/components/Radio/Radio.d.ts +0 -3
- package/dist/esm/types/components/Radio/Radio.test.d.ts +0 -1
- package/dist/esm/types/components/Radio/index.d.ts +0 -2
- package/dist/esm/types/components/RadioGroup/RadioGroup.d.ts +0 -12
- package/dist/esm/types/components/RadioGroup/RadioGroup.test.d.ts +0 -1
- package/dist/esm/types/components/RadioGroup/index.d.ts +0 -2
- package/dist/esm/types/components/Select/Select.d.ts +0 -39
- package/dist/esm/types/components/Select/index.d.ts +0 -2
- package/dist/esm/types/components/Switch/Switch.d.ts +0 -6
- package/dist/esm/types/components/Switch/Switch.test.d.ts +0 -1
- package/dist/esm/types/components/Switch/index.d.ts +0 -2
- package/dist/esm/types/components/Tag/Tag.d.ts +0 -21
- package/dist/esm/types/components/Tag/index.d.ts +0 -2
- package/dist/esm/types/components/TagGroup/TagGroup.d.ts +0 -17
- package/dist/esm/types/components/TagGroup/index.d.ts +0 -2
- package/dist/esm/types/components/TagList/TagList.d.ts +0 -11
- package/dist/esm/types/components/TagList/index.d.ts +0 -2
- package/dist/esm/types/components/Text/Text.d.ts +0 -8
- package/dist/esm/types/components/Text/index.d.ts +0 -2
- package/dist/esm/types/components/TextArea/TextArea.d.ts +0 -8
- package/dist/esm/types/components/TextArea/index.d.ts +0 -2
- package/dist/esm/types/components/TextField/TextField.d.ts +0 -11
- package/dist/esm/types/components/TextField/index.d.ts +0 -2
- package/dist/esm/types/components/Tooltip/Tooltip.d.ts +0 -5
- package/dist/esm/types/components/Tooltip/index.d.ts +0 -2
- package/dist/esm/types/components/index.d.ts +0 -42
- package/dist/esm/types/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bcgov/design-system-react-components
|
|
2
2
|
|
|
3
|
-
This package contains a library of React components built using [React Aria
|
|
3
|
+
This package contains a library of React components built using [React Aria](https://react-aria.adobe.com) to implement the [B.C. Design System](https://gov.bc.ca/designsystem).
|
|
4
4
|
|
|
5
5
|
Questions? Please email the <a href="mailto:DesignSystem@gov.bc.ca">GDX OSS Design Team</a>.
|
|
6
6
|
|
|
@@ -66,36 +66,40 @@ export default function App() {
|
|
|
66
66
|
|
|
67
67
|
## Component list
|
|
68
68
|
|
|
69
|
-
| Component | React Aria
|
|
70
|
-
| ----------------------- |
|
|
71
|
-
| AlertBanner | N/A
|
|
72
|
-
| AlertDialog | N/A
|
|
73
|
-
| Accordion | https://react-
|
|
74
|
-
| AccordionGroup | https://react-
|
|
75
|
-
| Button | https://react-
|
|
76
|
-
| ButtonGroup | N/A
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
69
|
+
| Component | React Aria docs link |
|
|
70
|
+
| ----------------------- | ---------------------------------------------- |
|
|
71
|
+
| AlertBanner | N/A |
|
|
72
|
+
| AlertDialog | N/A |
|
|
73
|
+
| Accordion | https://react-aria.adobe.com/Disclosure |
|
|
74
|
+
| AccordionGroup | https://react-aria.adobe.com/DisclosureGroup |
|
|
75
|
+
| Button | https://react-aria.adobe.com/Button |
|
|
76
|
+
| ButtonGroup | N/A |
|
|
77
|
+
| Calendar | https://react-aria.adobe.com/Calendar |
|
|
78
|
+
| Callout | N/A |
|
|
79
|
+
| Checkbox | https://react-aria.adobe.com/Checkbox |
|
|
80
|
+
| CheckboxGroup | https://react-aria.adobe.com/CheckboxGroup |
|
|
81
|
+
| DatePicker | https://react-aria.adobe.com/DatePicker |
|
|
82
|
+
| Dialog | https://react-aria.adobe.com/Dialog |
|
|
83
|
+
| Footer | N/A |
|
|
84
|
+
| Form | https://react-aria.adobe.com/Form |
|
|
85
|
+
| Header | N/A |
|
|
86
|
+
| Heading | https://react-spectrum.adobe.com/v3/Heading |
|
|
87
|
+
| InlineAlert | N/A |
|
|
88
|
+
| Modal | https://react-aria.adobe.com/Modal |
|
|
89
|
+
| Link | https://react-spectrum.adobe.com/v3/Link |
|
|
90
|
+
| RadioGroup, Radio | https://react-aria.adobe.com/RadioGroup |
|
|
91
|
+
| Select | https://react-aria.adobe.com/Select |
|
|
92
|
+
| Switch | https://react-aria.adobe.com/Switch |
|
|
93
|
+
| TagGroup, TagList, Tag | https://react-aria.adobe.com/TagGroup |
|
|
94
|
+
| Text | https://react-spectrum.adobe.com/v3/Text |
|
|
95
|
+
| TextArea, TextField | https://react-aria.adobe.com/TextField |
|
|
96
|
+
| ToggleButton | https://react-aria.adobe.com/ToggleButton |
|
|
97
|
+
| ToggleButtonGroup | https://react-aria.adobe.com/ToggleButtonGroup |
|
|
98
|
+
| Tooltip, TooltipTrigger | https://react-aria.adobe.com/Tooltip |
|
|
95
99
|
|
|
96
100
|
## Supported React versions
|
|
97
101
|
|
|
98
|
-
This package has a peer dependency on `react` and `react-dom` at these versions: `"^16.14.0 || ^17.0.0-rc.1 || ^18.0.0"`
|
|
102
|
+
This package has a peer dependency on `react` and `react-dom` at these versions: `"^16.14.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"`
|
|
99
103
|
|
|
100
104
|
By targeting v16.14.0 as a minimum, we get to use [React's modern JSX transformation](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) in `tsconfig.json`:
|
|
101
105
|
|
|
@@ -115,9 +119,9 @@ This project follows semantic versioning. See [CHANGELOG.md](./CHANGELOG.md) for
|
|
|
115
119
|
|
|
116
120
|
Components live in `./src/components` and are targeted by the build process with an export in `./src/index.ts`.
|
|
117
121
|
|
|
118
|
-
#### Testing components with
|
|
122
|
+
#### Testing components with Vitest
|
|
119
123
|
|
|
120
|
-
Unit tests can be run with
|
|
124
|
+
Unit tests can be run with Vitest using `npm run test`. Use `npm run test:watch` to run Vitest in watch mode.
|
|
121
125
|
|
|
122
126
|
### Storybook
|
|
123
127
|
|
|
@@ -137,9 +141,9 @@ oc tag ed91fb-tools/design-system-react-components-storybook:develop ed91fb-tool
|
|
|
137
141
|
oc tag ed91fb-tools/design-system-react-components-storybook:develop ed91fb-tools/design-system-react-components-storybook:production
|
|
138
142
|
```
|
|
139
143
|
|
|
140
|
-
#### Testing
|
|
144
|
+
#### Testing Storybook with Vitest
|
|
141
145
|
|
|
142
|
-
With Storybook running locally, use the `npm run test-storybook` script to
|
|
146
|
+
With Storybook running locally, use the `npm run test-storybook` script to test Storybook with Vitest's browser mode. This script uses the configuration defined in `./vite.config.ts`. [Learn more about Storybook's Vitest addon.](https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon).
|
|
143
147
|
|
|
144
148
|
### Vite kitchen sink application
|
|
145
149
|
|
|
@@ -147,6 +151,36 @@ Vite uses the components code directly from `./src/components` in groups of cont
|
|
|
147
151
|
|
|
148
152
|
Run `npm run vite-dev` to access the Vite React demo app.
|
|
149
153
|
|
|
154
|
+
### Build library code for publishing
|
|
155
|
+
|
|
156
|
+
#### Build scripts
|
|
157
|
+
|
|
158
|
+
Scripts are included in `package.json` for building the component library for publishing:
|
|
159
|
+
|
|
160
|
+
- `clean` removes any existing local `dist` directory
|
|
161
|
+
- `build:js` uses Rollup to create ESM and CJS versions of the components in `dist/esm` and `dist/cjs`
|
|
162
|
+
- `build:types` uses the TypeScript compiler `tsc` to generate type declarations in `dist/types`
|
|
163
|
+
- `build:dts` uses Rollup to bundle the `.d.ts` files from `dist/types` into a single `dist/index.d.ts` file
|
|
164
|
+
- `build` runs all of the scripts above in sequence
|
|
165
|
+
|
|
166
|
+
The files that get published are specified in the `files` section of `package.json`. The `dist/types` folder isn't included in this bundle in favor of publishing just the single aggregated `dist/index.d.ts` file.
|
|
167
|
+
|
|
168
|
+
#### Check files to be published
|
|
169
|
+
|
|
170
|
+
Use `npm pack --dry-run` to see the files that will be published in the package tarball. See [npm-pack documentation](https://docs.npmjs.com/cli/v11/commands/npm-pack).
|
|
171
|
+
|
|
172
|
+
#### Testing a local build
|
|
173
|
+
|
|
174
|
+
Use `npm link` to test a build of the component library locally. See [npm-link documentation](https://docs.npmjs.com/cli/v11/commands/npm-link).
|
|
175
|
+
|
|
176
|
+
In your `./packages/react-components` folder, run `npm link`.
|
|
177
|
+
|
|
178
|
+
Then in a local React project folder, use `npm link @bcgov/design-system-react-components` to link the test build into your test project.
|
|
179
|
+
|
|
180
|
+
### Linting
|
|
181
|
+
|
|
182
|
+
ESLint is used for linting. See configuration file `eslint.config.js`.
|
|
183
|
+
|
|
150
184
|
### Publish new versions
|
|
151
185
|
|
|
152
186
|
#### npm package
|
|
@@ -156,7 +190,7 @@ Publishing new versions of the package to npm is done via GitHub Actions.
|
|
|
156
190
|
GitHub Actions are located in `/.github/workflows` in the project root. Actions are included to:
|
|
157
191
|
|
|
158
192
|
- Build the Storybook and Vite applications on merge to `main`
|
|
159
|
-
- Test (
|
|
193
|
+
- Test (Vitest and Playwright) on pull request
|
|
160
194
|
- Publish new versions of the library on npm (`next` tag) on merge to `main`
|
|
161
195
|
- Publish new versions of the library on npm (`latest` tag) when a GitHub release is published
|
|
162
196
|
|