@cruk/chakra-components 4.0.0-dev.7 → 4.0.0-dev.8
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 +35 -71
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# CRUK Chakra Components 🎨
|
|
2
|
-
|
|
3
1
|

|
|
4
2
|
|
|
3
|
+
# CRUK Chakra Components 🎨
|
|
4
|
+
|
|
5
5
|
A [Chakra UI v2](https://v2.chakra-ui.com/docs/) based component library that provides styled components following the [Cancer Research UK Helix design system](https://zeroheight.com/721bd94bd/p/074a6c-helix-design-system---cancer-research-uk) 🧬.
|
|
6
6
|
It is a Work In Progress.
|
|
7
7
|
|
|
@@ -18,15 +18,11 @@ It is a Work In Progress.
|
|
|
18
18
|
|
|
19
19
|
Depending on your project, you might install the library in the project root directory, or in `client`:
|
|
20
20
|
|
|
21
|
-
## Install the package
|
|
22
|
-
|
|
23
21
|
```bash
|
|
22
|
+
# Install the package
|
|
24
23
|
npm install @cruk/chakra-components
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Install peer dependencies (if you don't already have them)
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
# Install peer dependencies (if you don't already have them)
|
|
30
26
|
npm install @chakra-ui/react @emotion/react @emotion/styled framer-motion
|
|
31
27
|
```
|
|
32
28
|
|
|
@@ -36,7 +32,7 @@ npm install @chakra-ui/react @emotion/react @emotion/styled framer-motion
|
|
|
36
32
|
|
|
37
33
|
Once added to the project, you can use the `ChakraBaseProvider` to wrap your application and provide styled based on the `crukBrand` theme.
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
```typescript
|
|
40
36
|
import type { AppProps } from "next/app";
|
|
41
37
|
import { ChakraBaseProvider, crukBrand } from "@cruk/chakra-components";
|
|
42
38
|
|
|
@@ -47,7 +43,7 @@ const App = ({ Component, pageProps }: AppProps) => (
|
|
|
47
43
|
);
|
|
48
44
|
|
|
49
45
|
export default App;
|
|
50
|
-
```
|
|
46
|
+
```
|
|
51
47
|
|
|
52
48
|
- 📖 [Styling documentation](https://super-succotash-wg8qmo1.pages.github.io/styling)
|
|
53
49
|
- 📖 [Theming documentation](https://super-succotash-wg8qmo1.pages.github.io/theming)
|
|
@@ -58,32 +54,28 @@ export default App;
|
|
|
58
54
|
|
|
59
55
|
After cloning the repository, install the dependencies:
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
```bash
|
|
62
58
|
# Clone and setup
|
|
63
59
|
git clone https://github.com/CRUKorg/cruk-chakra-components
|
|
64
60
|
cd cruk-chakra-components
|
|
65
61
|
npm ci
|
|
66
62
|
|
|
67
63
|
# Start Storybook
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
nvm use && npm run storybook
|
|
71
|
-
`````
|
|
64
|
+
npm run storybook
|
|
65
|
+
```
|
|
72
66
|
|
|
73
67
|
### Quick Test
|
|
74
68
|
|
|
75
|
-
Ensure right version of node and run tests.
|
|
76
|
-
|
|
77
69
|
```bash
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
npm run test # Unit tests
|
|
71
|
+
npm run test-ct # Component tests
|
|
80
72
|
```
|
|
81
73
|
|
|
82
74
|
## Deployment and Releases 🚀
|
|
83
75
|
|
|
84
76
|
### Release Process
|
|
85
77
|
|
|
86
|
-
This library uses [semantic-release](https://github.com/semantic-release/semantic-release) to automate versioning and package publishing
|
|
78
|
+
This library uses [semantic-release](https://github.com/semantic-release/semantic-release) with **GitHub PR labels** to automate versioning and package publishing.
|
|
87
79
|
|
|
88
80
|
#### Branch Strategy
|
|
89
81
|
|
|
@@ -92,54 +84,33 @@ This library uses [semantic-release](https://github.com/semantic-release/semanti
|
|
|
92
84
|
|
|
93
85
|
#### Release Requirements
|
|
94
86
|
|
|
95
|
-
**Important:** Only pull requests with `
|
|
87
|
+
**Important:** Only pull requests with the `release` label will trigger a release. The version type is determined by additional labels.
|
|
96
88
|
|
|
97
89
|
#### Creating a Release
|
|
98
90
|
|
|
99
|
-
1. **Create your pull request
|
|
91
|
+
1. **Create your pull request and add labels:**
|
|
100
92
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
RELEASE: Fix accessibility issues
|
|
104
|
-
Feature update - RELEASE v2.1.0
|
|
105
|
-
```
|
|
93
|
+
**Required label:**
|
|
94
|
+
- `release` - Must be present to trigger any release
|
|
106
95
|
|
|
107
|
-
|
|
96
|
+
**Version labels (choose one):**
|
|
97
|
+
- `breaking` or `major` - Major release (v1.0.0 → v2.0.0)
|
|
98
|
+
- `minor` - Minor release (v1.0.0 → v1.1.0)
|
|
99
|
+
- `patch` - Patch release (v1.0.0 → v1.0.1)
|
|
108
100
|
|
|
109
|
-
|
|
101
|
+
If only the `release` label is present, it defaults to a patch release.
|
|
110
102
|
|
|
111
|
-
|
|
112
|
-
fix: resolve Button focus state issue
|
|
113
|
-
docs: update component documentation
|
|
114
|
-
test: add missing unit tests
|
|
115
|
-
refactor: improve component structure
|
|
116
|
-
```
|
|
103
|
+
2. **For main branch releases: Obtain ServiceNow approval**
|
|
117
104
|
|
|
118
|
-
**
|
|
105
|
+
**Important:** All releases to the `main` branch require an approved ServiceNow change request before merging. This is mandatory for production deployments.
|
|
119
106
|
|
|
120
|
-
|
|
107
|
+
3. **Merge your PR** to the appropriate branch:
|
|
121
108
|
|
|
122
|
-
|
|
123
|
-
|
|
109
|
+
- Merge to `dev` for prerelease versions (no ServiceNow required)
|
|
110
|
+
- Merge to `main` for standard releases (ServiceNow approval required)
|
|
124
111
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
**Major Release** (v1.0.0 → v2.0.0):
|
|
128
|
-
|
|
129
|
-
```none
|
|
130
|
-
|
|
131
|
-
feat: redesign Button component API
|
|
132
|
-
|
|
133
|
-
BREAKING CHANGE: The Button component no longer accepts 'size' prop, use 'buttonSize' instead.
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
1. **Merge your PR** to the appropriate branch:
|
|
138
|
-
- Merge to `dev` for prerelease versions
|
|
139
|
-
- Merge to `main` for standard releases
|
|
140
|
-
|
|
141
|
-
2. The semantic-release system will automatically:
|
|
142
|
-
- Analyse the PR title and commit content
|
|
112
|
+
4. The semantic-release system will automatically:
|
|
113
|
+
- Read the PR labels
|
|
143
114
|
- Determine the appropriate version bump
|
|
144
115
|
- Generate release notes
|
|
145
116
|
- Publish to npm
|
|
@@ -148,24 +119,17 @@ This library uses [semantic-release](https://github.com/semantic-release/semanti
|
|
|
148
119
|
#### Examples
|
|
149
120
|
|
|
150
121
|
✅ **Will trigger a minor release:**
|
|
151
|
-
|
|
152
|
-
- PR title: "RELEASE: Add new components"
|
|
153
|
-
- Contains commit: "feat: add new Button variant"
|
|
122
|
+
- Labels: `release`, `minor`
|
|
154
123
|
|
|
155
124
|
✅ **Will trigger a patch release:**
|
|
156
|
-
|
|
157
|
-
-
|
|
158
|
-
- Contains commit: "fix: resolve styling issue"
|
|
125
|
+
- Labels: `release`, `patch`
|
|
126
|
+
- Labels: `release` (defaults to patch)
|
|
159
127
|
|
|
160
128
|
✅ **Will trigger a major release:**
|
|
161
|
-
|
|
162
|
-
- PR title: "RELEASE: Breaking API changes"
|
|
163
|
-
- Contains commit with: "BREAKING CHANGE: removed deprecated props"
|
|
129
|
+
- Labels: `release`, `breaking`
|
|
164
130
|
|
|
165
131
|
❌ **Will NOT trigger any release:**
|
|
166
|
-
|
|
167
|
-
- PR title: "Add new components" (missing "RELEASE")
|
|
168
|
-
- Even with commits like "feat: new component"
|
|
132
|
+
- No `release` label present
|
|
169
133
|
|
|
170
134
|
#### Manual Release
|
|
171
135
|
|
|
@@ -175,12 +139,12 @@ If needed, you can manually trigger a release:
|
|
|
175
139
|
npm run release
|
|
176
140
|
```
|
|
177
141
|
|
|
178
|
-
|
|
142
|
+
## Resources 📖
|
|
179
143
|
|
|
180
144
|
- [Component Examples (Storybook)](https://helix-components.cms.app.crnet.org)
|
|
181
145
|
- [Full Documentation (Style guide, Theming, Testing and more)](https://super-succotash-wg8qmo1.pages.github.io/)
|
|
182
146
|
- [Need help? Message us on Slack](https://cruk.slack.com/archives/C07BNR9FY4E)
|
|
183
147
|
|
|
184
|
-
|
|
148
|
+
## 📄 Licence
|
|
185
149
|
|
|
186
150
|
MIT © Cancer Research UK
|