Skip to content

Commit

Permalink
ui-core: add build instructions to readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
turnerian2004 committed Jul 11, 2024
1 parent 9b03a64 commit 2f49615
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
44 changes: 10 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,19 @@

Icons, fonts, colors, components and all user interface items for OSRD project.

## Development
# Build Instructions

Development will leverage preconstruct. **Documentation yet to come**.
1. Run `npm install`
2. Run `npm run build`
3. Run `npm run storybook`

## Publishing versions
# Tests

In a nutshell: we consider our version numbers metadata of the project. We use [Semantic Versioning](https://semver.org/).
1. Run `npm run test`

### Implications
## TODO

We do not change the version on local package versions, we keep the file to the version `0.0.1-dev` which is not a real version and can be easily identified as a development version.
We should write a README to explain the goal of the `osrd-ui` repository and the design system as
the whole.

The version numbers for our releases are solely managed through git tags. It implies that when we update a single package, we release all the project together : even if there are no changes between two release (let's say we update ui-icons but nothing else, we would make a release that would publish all packages anyway).

It's the tradeoff we make to keep the project simple and easy to manage, and to avoid the complexity of managing multiple compatible versions of the project.

In summary : we consider a version number as being an indivisible release of all the subpackages of the repository.

### Making a release

1. Create a annotated git tag (let's say `0.0.30`, you would do a `git tag -a 0.0.30`) on the `dev` branch and push it. **Note: we do not tag with a V in front of the version number, on our example the tag would be 0.0.30 and not v0.0.30**.
2. Create a github release (By convention, we use the same name as the tag with the letter `v` in front of it, `v0.0.30`. You can give fancy names to release if you want to : `0.0.30 : Camembert`, it will only appear in the release page of GitHub).

### Adding a new package to the monorepo

Create a folder and follow the structure of other packages (refer to the Development section for more information).

The package will be picked up automatically as long as it is included in the workspaces of the `package.json` file at the root of the project and that a section is added to the `package.json` in the package itself:

```jsonc
{
// ...
"publishConfig": {
"access": "public"
},
// ...
}
```

If this section is not added, the package will not be published. Having a `"private": true` in the package.json will also prevent the package from being published.
We should also explain how it is related to the `osrd-design` repository.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
"@rollup/plugin-eslint": "^9.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-postcss": "^4.0.2",
"@types/react": "^18.2.40",
"@types/react-dom": "^18.2.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
Expand All @@ -54,6 +52,11 @@
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"rollup": "^4.13.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-postcss": "^4.0.2",
"typescript": "^5.4.2"
},
"dependencies": {
"@nx/nx-darwin-x64": "^19.4.1"
}
}

0 comments on commit 2f49615

Please sign in to comment.