Skip to content

Commit fffc2f9

Browse files
authored
Feat/step 2 doc (#286)
* feat(doc): add github logo & architecture Signed-off-by: aurore.stagnol <[email protected]> * feat(doc): full doc rework Signed-off-by: aurore.stagnol <[email protected]> * feat(doc): rm starters dependencies Signed-off-by: aurore.stagnol <[email protected]> * feat(doc): fix release selector, review feedback & github readme Signed-off-by: aurore.stagnol <[email protected]> --------- Signed-off-by: aurore.stagnol <[email protected]>
1 parent 3cc09b9 commit fffc2f9

File tree

176 files changed

+1967
-14001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+1967
-14001
lines changed

README.md

+41-40
Original file line numberDiff line numberDiff line change
@@ -37,64 +37,65 @@
3737
## Quick links
3838
* [**Storybook (current version)**](https://ovh.github.io/design-system/latest/)
3939
* [**All ODS versions**](https://ovh.github.io/design-system/)
40+
* [**What's new**](https://ovh.github.io/design-system/latest/?path=/story/ovhcloud-design-system-what-s-new-what-s-new--page)
4041
* [**Changelog**](https://ovh.github.io/design-system/latest/?path=/story/ovhcloud-design-system-what-s-new-changelog--page)
4142
* [**Global Documentation 🔗**](https://zeroheight.com/6fc8a63f7/p/533db0-ovhcloud-design-system)
4243

43-
### Requirements
44-
* [**Node.js**](https://nodejs.org/en/) with version ">= 14.15 && < 16"
45-
* [**Yarn**](https://yarnpkg.com/) with version ">= 2"
44+
### Requirements (only for contributing)
45+
* [**Node.js**](https://nodejs.org/en/) with version ">= 18.17"
46+
* [**Yarn**](https://yarnpkg.com/) with version ">= 2.4"
4647

4748
## Installation
48-
Clone and install `ods` by using yarn.
49+
All the OVHcloud Design System packages are available on [**NPM**](https://www.npmjs.com/).
50+
51+
```sh
52+
yarn add @ovhcloud/ods-components @ovhcloud/ods-theme-blue-jeans
4953
```
50-
git clone https://github.com/ovh/design-system.git
51-
cd design-system
52-
yarn
54+
or
55+
```sh
56+
npm install --save @ovhcloud/ods-components @ovhcloud/ods-theme-blue-jeans
5357
```
5458

5559
## Usage
60+
To start using ODS, you'll need to import the components.
5661

57-
Please read `getting-started` guide into `packages/contributing/contributing-getting-started`
58-
to start using ODS.
62+
Add a dependency to either:
63+
* `@ovhcloud/ods-components` to import all components
64+
* `@ovhcloud/ods-components-<component>` to import a specific component
5965

60-
## Development
61-
After preparing this repository, you can launch the Storybook UI containing all built components with:
62-
```
63-
yarn build:prod && yarn doc && yarn start
66+
Components can be imported using one of:
67+
```typescript
68+
import { Osds<Component> } from '@ovhcloud/ods-component-<component>'
69+
import { Osds<Component> } from '@ovhcloud/ods-component-<component>/react'
70+
import { Osds<Component> } from '@ovhcloud/ods-component-<component>/vue'
6471
```
65-
Then choose the right component in the list if you want to edit it (if not, just choose whatever you want)
66-
67-
## Contribute
68-
You've developed a new cool feature ? Fixed an annoying bug ? We'd be happy to hear from you !
69-
70-
Have a look in [CONTRIBUTING.md](https://github.com/ovh/design-system/blob/master/CONTRIBUTING.md) 😃
7172

72-
## Migration
73-
Please read [Migration pages](https://ovh.github.io/design-system/latest/?path=/story/ovhcloud-design-system-what-s-new-migration-guide-introduction--page) to help you to manage the migration guides between each version of ODS.
73+
You can import enums directly from the component:
74+
```typescript
75+
import { ODS_%COMPONENT%_SIZE, ODS_%COMPONENT%_SIZES } from '@ovhcloud/ods-component-<component>'
76+
```
7477

75-
## Run the tests
76-
Tests are individually created for each UI component, but every test can be launch globally.
78+
Same goes for interfaces:
79+
```typescript
80+
import type { Ods<Component>Attribute } from '@ovhcloud/ods-component-<component>'
81+
```
7782

78-
### Scripts
79-
We created multiple test suites to test the different aspects of each UI component :
80-
* All testing : `yarn test`
81-
* Unit testing : `yarn test:spec`
82-
* E2E testing : `yarn test:e2e`
83-
* Screenshot testing : `yarn test:e2e:screenshot`
83+
Then, in your view, you can start using ODS components. For instance:
84+
```html
85+
<osds-button>
86+
My Button
87+
</osds-button>
88+
```
8489

85-
All testing scripts are also available with a `ci` alternative (i.e, `yarn test:ci:screenshot`).
90+
For more detail, see our global [Get Started](https://ovh.github.io/design-system/latest/?path=/story/ovhcloud-design-system-get-started--page) guide
8691

87-
### Global testing
88-
They are shortcuts that will test all components in the root directory. You can launch them with the previous described scripts.
92+
## Contribute
93+
You've developed a new cool feature ? Fixed an annoying bug ? We'd be happy to hear from you !
8994

90-
### Single component testing
91-
You can also test a single component.
95+
Please read [Get Started](https://ovh.github.io/design-system/latest/?path=/story/contributing-get-started--page) guide for contributing and [CONTRIBUTING.md](https://github.com/ovh/design-system/blob/master/CONTRIBUTING.md) 😃
9296

93-
For instance, for the Button Stencil component, you can browse to it and launch what command you want:
94-
```
95-
cd packages/stencil/components/button
96-
yarn test:e2e:screenshot
97-
```
97+
## Migration
98+
Please read [Migration pages](https://ovh.github.io/design-system/latest/?path=/story/ovhcloud-design-system-what-s-new-migration-guide-12-x-to-13-x--page) to help you to manage the migration guides between each version of ODS.
9899

99100
# Related links
100101
* Contribute: [https://github.com/ovh/design-system/blob/master/CONTRIBUTING.md](https://github.com/ovh/design-system/blob/master/CONTRIBUTING.md)
@@ -104,7 +105,7 @@ yarn test:e2e:screenshot
104105
* Get latest version: [https://github.com/ovh/ods](https://github.com/ovh/ods)
105106

106107
# License
107-
Copyright 2022 OVH SAS
108+
Copyright 2023 OVH SAS
108109

109110
Licensed under the Apache License, Version 2.0 (the "License");
110111
you may not use this file except in compliance with the License.

RELEASING.md

+179-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,180 @@
1+
# Deployment and versioning
12

2-
Please find all the documentation about contributions in the directory `packages/contributing`.
3-
You can start with the Getting Started in `packages/contributing/contributing-getting-started.mdx`.
3+
**NB:** releases process is handled by ODS core team but you can still have a look here about our process.
4+
5+
<!-- TOC -->
6+
7+
* [Deployment and versioning](#deployment-and-versioning)
8+
* [Deployment](#deployment)
9+
* [Releases](#releases)
10+
* [Versioning commands: what level of tag to use?](#versioning-commands--what-level-of-tag-to-use)
11+
* [Patch: fix a bug](#patch--fix-a-bug)
12+
* [Minor: add extra features](#minor--add-extra-features)
13+
* [Major: breaking changes](#major--breaking-changes)
14+
* [PRE-patch: prepare a future patch release](#pre-patch--prepare-a-future-patch-release)
15+
* [PRE-minor: prepare a future release without breaking changes](#pre-minor--prepare-a-future-release-without-breaking-changes)
16+
* [PRE-major: prepare a future release with breaking changes](#pre-major--prepare-a-future-release-with-breaking-changes)
17+
* [PRE-release: prepare a new pre-release](#pre-release--prepare-a-new-pre-release)
18+
* [Graduate a release](#graduate-a-release)
19+
20+
<!-- TOC -->
21+
22+
## Deployment
23+
24+
release/next acts as our main branch, then for major and minor versioning a new release/* branch is created.
25+
26+
For patch versioning, it can be added in the specific release/* or release/next, depending on its scope.
27+
28+
## Releases
29+
30+
In order to make a new release of the `ODS` packages, you must:
31+
32+
- be sure that you are on a release branch like `release/next` or `release/X.Y`
33+
- no local changes to commit
34+
- your local branch is up-to-date
35+
- add a migration guide when there are breaking changes
36+
37+
Then, to make a release, you have to execute the npm script `yarn ods:<VERSION_TYPE>`
38+
where `<VERSION_TYPE>` can be `patch`, `minor`, `major`, `premajor` `prerelase` or `graduate`.
39+
40+
### Versioning commands: what level of tag to use?
41+
42+
Here's a summed up table of which command to launch to create the appropriate tag:
43+
44+
| Command | Target | Usage | version before | version after |
45+
|-----------------------|--------------|--------------------------------------|------------------|-----------------|
46+
| `yarn ods:prepatch` | `testing` | Prepare patch release | `1.0.0` | `1.0.1-alpha.0` |
47+
| `yarn ods:preminor` | `testing` | Prepare minor release | `1.0.0` | `1.1.0-alpha.0` |
48+
| `yarn ods:premajor` | `testing` | Prepare major release | `1.0.0` | `2.0.0-alpha.0` |
49+
| `yarn ods:prerelease` | `testing` | Prepare a new pre-release | `1.2.3-alpha.2` | `1.2.3-alpha.3` |
50+
| `yarn ods:patch` | `production` | Fix a bug | `1.0.0` | `1.0.1` |
51+
| `yarn ods:minor` | `production` | Add features without breaking change | `1.0.0` | `1.1.0` |
52+
| `yarn ods:major` | `production` | Add breaking change | `1.0.0` | `2.0.0` |
53+
| `yarn ods:graduate` | `production` | From `-alpha` versions to plain tag | `3.1.2-alpha.21` | `3.1.2` |
54+
55+
You can find all explanations for these commands below:
56+
57+
### Patch: fix a bug
58+
59+
You fixed a bug **(without any other breaking changes)** for a released version in the branch `release/X.Y`.
60+
You have to release it from the same branch:
61+
62+
```bash
63+
yarn ods:patch
64+
```
65+
66+
### Minor: add extra features
67+
68+
You added one or several features **without any breaking changes** in the branch `release/next`.
69+
Create a release branch from up-to-date `release/next` that corresponds to the version you are going to release like `release/X.Y`.
70+
71+
Then, you have to generate a minor version from your branch.
72+
73+
```bash
74+
yarn ods:minor
75+
```
76+
77+
The release branch will be used for bugfixes later (patch).
78+
It will be used for bug fixes later (patch).
79+
Once the support for the version has ended, the branch will be un-referenced.
80+
81+
### Major: breaking changes
82+
83+
You added breaking changes in the `release/next` branch:
84+
85+
Create a release branch from up-to-date `release/next` that corresponds to the version you are going to release like `release/X.Y`.
86+
In `docs/migration`, rename the migration guide previously created according to the version like `MIGRATION-x.y-to-next.mdx` to `MIGRATION-x.y-to-z.y.mdx`.
87+
Create a new empty migration guide for future release: `MIGRATION-x.y-to-next.mdx`.
88+
89+
Then, in `packages/tools/storybook/stories/code/migration`, create a stories for the version you are going to release.
90+
And add the following imports and Meta title:
91+
```typescript
92+
import { Meta, Description } from '@storybook/addon-docs';
93+
import MigrationXxToYx from '../../../../../../packages/doc/src/migration/MIGRATION-X.x-to-Y.x.mdx';
94+
95+
<Meta title="Code/Migration guide/X.x to Y.x" />
96+
97+
<MigrationXxToYx />
98+
```
99+
100+
Then, you have to generate a major version from your branch.
101+
102+
```bash
103+
yarn ods:major
104+
```
105+
106+
The release branch will be used for bugfixes later (patch).
107+
Once the support for the version has ended, the branch will be unreferenced.
108+
109+
### PRE-patch: prepare a future patch release
110+
111+
You fixed a bug in the `release/next` branch, and you want to release it as a candidate for testing purpose only **(not
112+
production)**.
113+
114+
You can generate a PRE-patch version from `release/next` branch:
115+
116+
```bash
117+
yarn ods:prepatch
118+
```
119+
120+
Once this version is finalized, you will have to graduate the release: see graduate release below.
121+
122+
### PRE-minor: prepare a future release without breaking changes
123+
124+
You added features in the `release/next` branch, and you want to release it as a candidate for testing purpose only **(
125+
not production)**.
126+
127+
You can generate a PRE-minor version from `release/next` branch:
128+
129+
```bash
130+
yarn ods:preminor
131+
```
132+
133+
Once this version is finalized, you will have to graduate the release: see Graduate a release below.
134+
135+
### PRE-major: prepare a future release with breaking changes
136+
137+
You added features in the `release/next` branch, and you want to release it as a candidate for testing purpose only **(
138+
not production)**.
139+
140+
You can generate a PRE-major version from `release/next` branch:
141+
142+
```bash
143+
yarn ods:premajor
144+
```
145+
146+
Then create a release branch from the commit tag that correspond to the version like `release/X.Y-alpha`.
147+
It will be used later in case of modification (fix, features, breaking changes).
148+
Once this version is finalized, you will have to graduate the release: see Graduate a release below.
149+
150+
### PRE-release: prepare a new pre-release
151+
152+
You already are in a prerelease version with `alpha.x` (meaning you previously made a `pre-major`, `pre-minor`
153+
or `pre-patch`).
154+
155+
You want to prerelease a new one and increment the `alpha` number. You want to continue prerelease for testing purpose
156+
only **(not production)**.
157+
158+
You have to generate a new PRE-release version from `release/X.Y-alpha` branch:
159+
160+
```bash
161+
yarn ods:prerelease
162+
```
163+
164+
Once this version is finalized, you will have to graduate the release: see Graduate a release below.
165+
166+
### Graduate a release
167+
168+
You already released a `pre-major/minor/patch` or a `pre-release`.
169+
170+
All tests are valid, you want to release the final version like from `1.2.0-alpha-X` to `1.2.0`.
171+
172+
You have to graduate the version from `release/X.Y-alpha` branch:
173+
174+
```bash
175+
yarn ods:graduate
176+
```
177+
178+
Then, create a release branch from the commit tag that correspond to the version like `release/X.Y`.
179+
It will be used for bug fixes later (patch).
180+
Once the support for the version has ended, the branch will be un-referenced.

0 commit comments

Comments
 (0)