Skip to content

Commit 72ac22d

Browse files
committed
ci: remove lerna, leverage basic shell script
1 parent e873017 commit 72ac22d

File tree

14 files changed

+89
-79
lines changed

14 files changed

+89
-79
lines changed

.github/scripts/publish.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Helper function to update the version and publish the package
5+
# Note : we are in the CI triggered by a release, we do not need to create a tag nor commit
6+
version_and_publish() {
7+
local dir=$1
8+
local version=$2
9+
pushd $dir
10+
npm version $version --no-git-tag-version
11+
npm publish
12+
popd
13+
}
14+
15+
# Get the version from the tag
16+
VERSION=${GITHUB_REF/refs\/tags\//}
17+
18+
# List of packages to publish
19+
PACKAGES=(
20+
"ui-icons"
21+
"ui-core"
22+
"ui-speedspacechart"
23+
"ui-spacetimechart"
24+
"ui-manchette"
25+
)
26+
27+
# Resolve dependencies
28+
npm ci
29+
30+
# Publish each package
31+
for dir in "${PACKAGES[@]}"; do
32+
version_and_publish $dir $VERSION
33+
done

.github/workflows/osrd-ui-publish.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@ jobs:
3232

3333
- name: Publish
3434
run: |
35-
VERSION=${GITHUB_REF/refs\/tags\//}
36-
npm ci
37-
npm run lerna -- publish ${VERSION} --force-publish --yes --no-push --no-git-tag-version
35+
./.github/scripts/publish.sh

README.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

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

5-
## TODO
5+
## Developing
66

7-
We should write a README to explain the goal of the `osrd-ui` repository and the design system as
8-
the whole.
7+
Development will leverage preconstruct. **Documentation yet to come**.
98

10-
We should also explain how it is related to the `osrd-design` repository.
9+
## Publishing versions
1110

12-
## Credits
11+
In a nutshell: we consider our version numbers metadata of the project. We use [Semantic Versioning](https://semver.org/).
1312

14-
### ui-icons
13+
### Implication
14+
15+
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.
16+
17+
The version number for our release 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).
18+
19+
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.
20+
21+
In summary : we conside a version number as being an indivisible release of all the subpackages of the repository.
22+
23+
### Making a release
24+
25+
1. Create a git tag (let's say `0.0.30`) on the `dev` branch and push it. **Note: we do not tag with a V in front of the semver, IT'S 0.0.30 AND NOT v0.0.30**.
26+
2. Create a github release (By convention, we use the same name as the tag with a 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).

flake.lock

+15-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,36 @@
44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
66
flake-utils.url = "github:numtide/flake-utils";
7-
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
87
alejandra = {
98
url = "github:kamadorueda/alejandra/3.0.0";
109
inputs.nixpkgs.follows = "nixpkgs";
1110
};
1211
};
1312

14-
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
13+
outputs = { self, nixpkgs, flake-utils, alejandra, ... }@inputs:
1514
flake-utils.lib.eachDefaultSystem (system:
1615
let
1716
pkgs = import nixpkgs {
1817
inherit system;
1918
overlays = [];
2019
};
21-
fixedNode = pkgs.nodejs-18_x;
20+
fixedNode = pkgs.nodejs_22;
2221
fixedNodePackages = pkgs.nodePackages.override {
2322
nodejs = fixedNode;
2423
};
2524
in
2625
{
2726
devShell = pkgs.mkShell {
2827
buildInputs = with pkgs; [
28+
# Nix formatter
29+
alejandra.defaultPackage.${system}
30+
31+
# Node version
2932
fixedNode
3033
fixedNodePackages.npm
3134
fixedNodePackages.yarn
3235
];
3336
};
3437
}
3538
);
36-
}
39+
}

lerna.json

-7
This file was deleted.

package.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osrd-project/root",
3-
"version": "0.1.0",
3+
"version": "0.0.1-dev",
44
"homepage": "https://github.com/osrd-project/osrd-ui#readme",
55
"repository": {
66
"type": "git",
@@ -25,11 +25,7 @@
2525
"clean": "npm run clean --workspaces --if-present",
2626
"build": "npm run build --workspaces --if-present",
2727
"test": "npm run test --workspaces --if-present",
28-
"storybook": "npm start --workspace='@osrd-project/storybook'",
29-
"lerna:changed": "lerna changed",
30-
"lerna:diff": "lerna diff",
31-
"lerna": "lerna",
32-
"lerna:publish": "lerna publish from-package --no-private --yes"
28+
"storybook": "npm start --workspace='@osrd-project/storybook'"
3329
},
3430
"type": "module",
3531
"devDependencies": {
@@ -48,12 +44,11 @@
4844
"eslint-plugin-react": "^7.33.2",
4945
"eslint-plugin-react-hooks": "^4.6.0",
5046
"eslint-plugin-storybook": "^0.6.15",
51-
"lerna": "^8.1.2",
5247
"prettier": "^3.2.5",
5348
"react": "^18.2.0",
5449
"react-dom": "^18.2.0",
5550
"rimraf": "^5.0.5",
5651
"rollup": "^4.13.0",
5752
"typescript": "^5.4.2"
5853
}
59-
}
54+
}

shell.nix

-14
This file was deleted.

ui-core/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osrd-project/ui-core",
3-
"version": "0.0.27",
3+
"version": "0.0.1-dev",
44
"license": "LGPL-3.0-or-later",
55
"bugs": "https://github.com/osrd-project/osrd-ui/issues",
66
"repository": {
@@ -52,4 +52,4 @@
5252
"rollup-plugin-serve": "^1.1.1"
5353
},
5454
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
55-
}
55+
}

ui-icons/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osrd-project/ui-icons",
3-
"version": "0.0.27",
3+
"version": "0.0.1-dev",
44
"license": "LGPL-3.0-or-later",
55
"bugs": "https://github.com/osrd-project/osrd-ui/issues",
66
"repository": {
@@ -37,4 +37,4 @@
3737
"svgo": "3.2.0"
3838
},
3939
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
40-
}
40+
}

ui-manchette/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osrd-project/ui-manchette",
3-
"version": "0.0.27",
3+
"version": "0.0.1-dev",
44
"license": "LGPL-3.0-or-later",
55
"bugs": "https://github.com/osrd-project/osrd-ui/issues",
66
"repository": {
@@ -53,4 +53,4 @@
5353
"rollup-plugin-serve": "^1.1.1"
5454
},
5555
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
56-
}
56+
}

ui-spacetimechart/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osrd-project/ui-spacetimechart",
3-
"version": "0.0.27",
3+
"version": "0.0.1-dev",
44
"license": "LGPL-3.0-or-later",
55
"bugs": "https://github.com/osrd-project/osrd-ui/issues",
66
"repository": {
@@ -43,4 +43,4 @@
4343
"lodash": "^4.17.21",
4444
"vitest": "^1.5.0"
4545
}
46-
}
46+
}

ui-speedspacechart/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osrd-project/ui-speedspacechart",
3-
"version": "0.0.27",
3+
"version": "0.0.1-dev",
44
"license": "LGPL-3.0-or-later",
55
"bugs": "https://github.com/osrd-project/osrd-ui/issues",
66
"repository": {
@@ -54,4 +54,4 @@
5454
"rollup-plugin-serve": "^1.1.1"
5555
},
5656
"gitHead": "973ad1478be4544e1c97303b844903247d9a9cd7"
57-
}
57+
}

ui-warped-map/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@osrd-project/ui-warped-map",
33
"description": "A React component to display MapLibre maps warped along a given path.",
4-
"version": "0.0.18",
4+
"version": "0.0.1-dev",
55
"license": "LGPL-3.0-or-later",
66
"private": true,
77
"homepage": "https://github.com/osrd-project/osrd-ui#readme",
@@ -63,4 +63,4 @@
6363
"peerDependencies": {
6464
"react": ">=18.0"
6565
}
66-
}
66+
}

0 commit comments

Comments
 (0)