@royaloperahouse/chord 1.3.1-e-chord-development → 1.3.1
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.GIT +122 -0
- package/README.md +44 -99
- package/package.json +1 -1
package/README.GIT
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Royal Opera House - Front End Design System
|
|
2
|
+
|
|
3
|
+
Welcome to the Royal Opera House Front End Design System, `@royaloperahouse/chord`.
|
|
4
|
+
|
|
5
|
+
This package is a library of UI components intended to be used in the ROH website.
|
|
6
|
+
|
|
7
|
+
It uses React, TypeScript, TSDX and Storybook.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
The required package dependencies need to be insalled using `yarn`. Once ready you can issue the following:
|
|
12
|
+
|
|
13
|
+
To run Lint on the package use:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn lint # you can also use the --fix option to perform automatic fixes
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
To run the unit tests (using Jest) use:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn test # you can also use the -u option to update snapshots if needed
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To run the unit tests (using Jest) and store them for display in storybook use:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
yarn test-storybook # you can also use the -u option to update snapshots if needed
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To run storybook use:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn storybook
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
To build a static version of storybook use:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
yarn build-storybook
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This will create a static copy in `./storybook-static`, and there is an index.html page inside the core directory. This allows the site to be previewed directly in the git repository via serving pages (it needs to be configured for that branch).
|
|
44
|
+
|
|
45
|
+
To deploy the storybook publically:
|
|
46
|
+
|
|
47
|
+
### Prerequisites
|
|
48
|
+
|
|
49
|
+
Make sure you have credentials for the *parent* 'Royal Opera House' AWS account in your `~/.aws/credentials` file. The deploy script expects these to be called `[parent]`.
|
|
50
|
+
|
|
51
|
+
You can get these values at:
|
|
52
|
+
|
|
53
|
+
AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' ->
|
|
54
|
+
'Command line or programmatic access'
|
|
55
|
+
|
|
56
|
+
### Deployment
|
|
57
|
+
|
|
58
|
+
To deploy, first *build* the storybook as above
|
|
59
|
+
|
|
60
|
+
then use:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
yarn deploy-storybook
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This will deploy the contents of `./storybook-static` to S3 as a static site accessible at [chord.roh.org.uk](chord.roh.org.uk)
|
|
67
|
+
|
|
68
|
+
To build the package use:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
yarn build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
To release a new version.
|
|
75
|
+
|
|
76
|
+
Release will be published in npm (NPM_TOKEN will be required)
|
|
77
|
+
Storybook will be pushed to bitbucket. *** Push will be done Ensure you don't have things pendint to push
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
MORE INFO TO FOLLOW - PARTICULARLY FOR THE CI SETUP AND HOW PACKAGES ARE PUSHED.
|
|
85
|
+
|
|
86
|
+
# Recommended Use of Package
|
|
87
|
+
|
|
88
|
+
The package is deployed to NPM, and can be installed using yarn or npm:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm i --save @royaloperahouse/chord
|
|
92
|
+
```
|
|
93
|
+
```bash
|
|
94
|
+
yarn add @royaloperahouse/chord
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
# Processes to follow prior to commits
|
|
98
|
+
|
|
99
|
+
Before a commit is made you need to do the following:
|
|
100
|
+
|
|
101
|
+
- Make sure that you are in your own work branch (properly named, including the JIRA ticket number and a short description)
|
|
102
|
+
- `yarn lint` - ensure that you are not introducing errors
|
|
103
|
+
- `yarn test` - ensure that tests are running as expected
|
|
104
|
+
- `yarn test-storybook` - Save the test results to for the static site
|
|
105
|
+
- `yarn build-storybook` - Update the static site
|
|
106
|
+
- Commit your changes in your branch locally
|
|
107
|
+
|
|
108
|
+
Next, if you are ready to merge into the main development branch then:
|
|
109
|
+
|
|
110
|
+
- _*ensure that you pull the latest changes from that branch into your new branch, resolving any merge conflicts that may arise*_
|
|
111
|
+
- Commit any merge changes locally
|
|
112
|
+
- Push your branch changes to the origin repo
|
|
113
|
+
- Raise a Pull Request to merge back into the main development branch, AND ensure that the required reviewers are assigned.
|
|
114
|
+
- The reviewers may raise issues, and once resolved, they will be responsible for performing the merge.
|
|
115
|
+
|
|
116
|
+
### Example
|
|
117
|
+
|
|
118
|
+
There is an example implementation in the example folder. Alternatively there are also integration examples in storybook. Make sure to keep these updated so as to showcase the current components available.
|
|
119
|
+
|
|
120
|
+
### Bundle analysis
|
|
121
|
+
|
|
122
|
+
Calculates the real cost of your library using [size-limit](https://github.com/ai/size-limit) with `yarn size` and visulize it with `yarn analyze`.
|
package/README.md
CHANGED
|
@@ -1,122 +1,67 @@
|
|
|
1
|
-
# Royal Opera House -
|
|
1
|
+
# Royal Opera House - chord
|
|
2
2
|
|
|
3
|
-
Welcome to the Royal Opera House
|
|
3
|
+
Welcome to the Royal Opera House library components `@royaloperahouse/chord`.
|
|
4
4
|
|
|
5
5
|
This package is a library of UI components intended to be used in the ROH website.
|
|
6
6
|
|
|
7
|
-
It uses React, TypeScript, TSDX and Storybook.
|
|
8
7
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
The required package dependencies need to be insalled using `yarn`. Once ready you can issue the following:
|
|
12
|
-
|
|
13
|
-
To run Lint on the package use:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
yarn lint # you can also use the --fix option to perform automatic fixes
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
To run the unit tests (using Jest) use:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
yarn test # you can also use the -u option to update snapshots if needed
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To run the unit tests (using Jest) and store them for display in storybook use:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
yarn test-storybook # you can also use the -u option to update snapshots if needed
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
To run storybook use:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
yarn storybook
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
To build a static version of storybook use:
|
|
8
|
+
## Install
|
|
38
9
|
|
|
39
10
|
```bash
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
This will create a static copy in `./storybook-static`, and there is an index.html page inside the core directory. This allows the site to be previewed directly in the git repository via serving pages (it needs to be configured for that branch).
|
|
44
|
-
|
|
45
|
-
To deploy the storybook publically:
|
|
46
|
-
|
|
47
|
-
### Prerequisites
|
|
48
|
-
|
|
49
|
-
Make sure you have credentials for the *parent* 'Royal Opera House' AWS account in your `~/.aws/credentials` file. The deploy script expects these to be called `[parent]`.
|
|
50
|
-
|
|
51
|
-
You can get these values at:
|
|
52
|
-
|
|
53
|
-
AWS 'Your Applications' page -> 'Royal Opera House' -> 'Developer Access' ->
|
|
54
|
-
'Command line or programmatic access'
|
|
55
|
-
|
|
56
|
-
### Deployment
|
|
57
|
-
|
|
58
|
-
To deploy, first *build* the storybook as above
|
|
59
|
-
|
|
60
|
-
then use:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
yarn deploy-storybook
|
|
11
|
+
npm i --save @royaloperahouse/chord
|
|
64
12
|
```
|
|
65
|
-
|
|
66
|
-
This will deploy the contents of `./storybook-static` to S3 as a static site accessible at [chord.roh.org.uk](chord.roh.org.uk)
|
|
67
|
-
|
|
68
|
-
To build the package use:
|
|
69
|
-
|
|
70
13
|
```bash
|
|
71
|
-
yarn
|
|
14
|
+
yarn add @royaloperahouse/chord
|
|
72
15
|
```
|
|
73
16
|
|
|
74
|
-
|
|
17
|
+
## Usage
|
|
75
18
|
|
|
76
|
-
|
|
77
|
-
|
|
19
|
+
```javascript
|
|
20
|
+
import {
|
|
21
|
+
Footer, GlobalStyles, ThemeProvider, ThemeType,
|
|
22
|
+
} from '@royaloperahouse/chord';
|
|
78
23
|
|
|
79
|
-
```bash
|
|
80
|
-
NPM_ROH_TOKEN={NPM_TOKEN} RELEASE_VERSION={RELEASE_VERSION} yarn publish-release
|
|
81
24
|
```
|
|
25
|
+
## Sample
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
Footer, GlobalStyles, ThemeProvider, ThemeType,
|
|
31
|
+
} from '@royaloperahouse/chord';
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const App = ({ children }: InnerProps): React.ReactElement => (
|
|
35
|
+
<ErrorBoundary>
|
|
36
|
+
<ThemeProvider theme={ThemeType.Core}>
|
|
37
|
+
<GlobalStyles />
|
|
38
|
+
<Wrapper>
|
|
39
|
+
<Header />
|
|
40
|
+
<GlobalStyle />
|
|
41
|
+
<HealthBanner />
|
|
42
|
+
<ErrorBoundary>
|
|
43
|
+
<Content>
|
|
44
|
+
{children}
|
|
45
|
+
</Content>
|
|
46
|
+
</ErrorBoundary>
|
|
47
|
+
<LiveChat />
|
|
48
|
+
</Wrapper>
|
|
49
|
+
<Footer data={footerData} />
|
|
50
|
+
</ThemeProvider>
|
|
51
|
+
</ErrorBoundary>
|
|
52
|
+
);
|
|
82
53
|
|
|
83
|
-
|
|
84
|
-
MORE INFO TO FOLLOW - PARTICULARLY FOR THE CI SETUP AND HOW PACKAGES ARE PUSHED.
|
|
85
|
-
|
|
86
|
-
# Recommended Use of Package
|
|
87
|
-
|
|
88
|
-
The package is deployed to NPM, and can be installed using yarn or npm:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
npm i --save @royaloperahouse/chord
|
|
92
54
|
```
|
|
93
|
-
```bash
|
|
94
|
-
yarn add @royaloperahouse/chord
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
# Processes to follow prior to commits
|
|
98
|
-
|
|
99
|
-
Before a commit is made you need to do the following:
|
|
100
55
|
|
|
101
|
-
|
|
102
|
-
- `yarn lint` - ensure that you are not introducing errors
|
|
103
|
-
- `yarn test` - ensure that tests are running as expected
|
|
104
|
-
- `yarn test-storybook` - Save the test results to for the static site
|
|
105
|
-
- `yarn build-storybook` - Update the static site
|
|
106
|
-
- Commit your changes in your branch locally
|
|
56
|
+
## Components
|
|
107
57
|
|
|
108
|
-
|
|
58
|
+
Accordion, Accordions, AltHeader, AnchorTapBar, AnnouncementBanner, BodyText, Card, Cards, Carousel, CinemaBadge, ContactCard, ControlledDropdown, devices, Editorial, Footer, GlobalStyles, Grid, GridItem, Header, HighlightsCarousel, HighlightsCarouselCinema, HighlightsCarouselCore, HighlightsCarouselStream, Icon, ImageWithCaption, Navigation, Overline, PageHeadingCinema, PageHeadingCore, PageHeadingImpact, PageHeadingStream, PeopleListing, PrimaryButton, PromoWithTags, PromoWithTitle, RotatorButtons, SecondaryButton, SecondaryLogo, SectionSplitter, SectionTitle, Sponsorship, StickyBar, StreamBadge, Subtitle, Tab, TabLink, Tabs, TertiaryButton, TextLink, TextOnly, Tickbox, TitleWithCTA, ThemeProvider, TypeTags, Quote
|
|
109
59
|
|
|
110
|
-
|
|
111
|
-
- Commit any merge changes locally
|
|
112
|
-
- Push your branch changes to the origin repo
|
|
113
|
-
- Raise a Pull Request to merge back into the main development branch, AND ensure that the required reviewers are assigned.
|
|
114
|
-
- The reviewers may raise issues, and once resolved, they will be responsible for performing the merge.
|
|
60
|
+
## Types
|
|
115
61
|
|
|
116
|
-
|
|
62
|
+
AspectRatio, CarouselType, Colors, FooterData, INavigationProps, INavTopProps, TickboxMode, ThemeType
|
|
117
63
|
|
|
118
|
-
There is an example implementation in the example folder. Alternatively there are also integration examples in storybook. Make sure to keep these updated so as to showcase the current components available.
|
|
119
64
|
|
|
120
|
-
|
|
65
|
+
## Documentation
|
|
121
66
|
|
|
122
|
-
|
|
67
|
+
See Storybook as a reference
|