Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dsi-hug/ngx-components into…
Browse files Browse the repository at this point in the history
… demo

# Conflicts:
#	.github/workflows/ci_release.yml
#	.github/workflows/ci_test_core.yml
#	.github/workflows/ci_test_layout.yml
#	.github/workflows/ci_test_list-loader.yml
#	.github/workflows/ci_test_message-box-dialog.yml
#	.github/workflows/ci_test_message-box.yml
#	.github/workflows/ci_test_numeric-stepper.yml
#	.github/workflows/ci_test_overlay.yml
#	.github/workflows/ci_test_search-container.yml
#	.github/workflows/ci_test_sidenav.yml
#	.github/workflows/ci_test_snackbar.yml
#	.github/workflows/ci_test_splitter.yml
#	.github/workflows/ci_test_status.yml
#	.github/workflows/ci_test_time-picker.yml
#	.github/workflows/ci_test_tooltip.yml
#	.github/workflows/ci_test_user-card.yml
#	.github/workflows/ci_test_user-tooltip.yml
#	DEVELOPER.md
#	README.md
#	tsconfig.base.json
#	tsconfig.json
  • Loading branch information
vapkse committed Jul 15, 2024
2 parents f17fd8a + 88b12c4 commit c07d0d9
Show file tree
Hide file tree
Showing 36 changed files with 349 additions and 43 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
options:
- -- all --
- core
- date-picker
- layout
- list-loader
- message-box
Expand All @@ -37,13 +38,16 @@ env:

jobs:
ci_release:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
secrets:
GH_USER_NAME: 'dsi-hug-bot'
GH_USER_EMAIL: '[email protected]'
GIT_USER_NAME: 'dsi-hug-bot'
GIT_USER_EMAIL: '[email protected]'
GH_TOKEN: ${{ secrets.DSI_HUG_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.DSI_HUG_NPM_TOKEN }}
with:
working-directory: ${{ (inputs.package == '-- all --') && '.' || format('projects/{0}', inputs.package) }}
dry-run: ${{ inputs.dry-run }}
lint: true
test: true
build: true
release: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ concurrency:

jobs:
ci_test_core:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/core
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

#
# Not needed here because it will be triggered by `ci_test_sidenav`
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci_test_date-picker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test date-picker

on:
workflow_dispatch:
workflow_call:
push:
branches:
- '**'
tags-ignore:
- '**'
paths:
- '.github/workflows/ci_test_date-picker.yml'
- 'projects/date-picker/**'

concurrency:
group: ci-test-date-picker-group-${{ github.ref }}
cancel-in-progress: true

jobs:
ci_test_date-picker:
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/date-picker
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_layout.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_layout:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/layout
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_list-loader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ concurrency:

jobs:
ci_test_list-loader:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/list-loader
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_message-box-dialog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_message-box-dialog:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/message-box-dialog
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_message-box.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ concurrency:

jobs:
ci_test_message-box:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/message-box
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

ci_test_status:
needs: ci_test_message-box
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_numeric-stepper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ concurrency:

jobs:
ci_test_numeric-stepper:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/numeric-stepper
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

ci_test_time-picker:
needs: ci_test_numeric-stepper
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_overlay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_overlay:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/overlay
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_search-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_search-container:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/search-container
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_sidenav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ concurrency:

jobs:
ci_test_sidenav:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/sidenav
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

ci_test_layout:
needs: ci_test_sidenav
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_snackbar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ concurrency:

jobs:
ci_test_snackbar:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/snackbar
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

ci_test_status:
needs: ci_test_snackbar
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_splitter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_splitter:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/splitter
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_status:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/status
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_time-picker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_time-picker:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/time-picker
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_tooltip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ concurrency:

jobs:
ci_test_tooltip:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/tooltip
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

ci_test_user-tooltip:
needs: ci_test_tooltip
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_user-card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ concurrency:

jobs:
ci_test_user-card:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/user-card
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true

ci_test_user-tooltip:
needs: ci_test_user-card
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci_test_user-tooltip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ concurrency:

jobs:
ci_test_user-tooltip:
uses: dsi-hug/action/.github/workflows/action.yml@v1
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
working-directory: projects/user-tooltip
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
lint: true
test: true
39 changes: 19 additions & 20 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ npm install

## Creating a new package

Create a new package using the built-in schematic tool:
1. Create a new package using the built-in schematic tool:

```sh
run run new-package
```
```sh
npm run new-package
```

If this new package has any other internal packages as peer dependencies:
2. Reorder alphabetically what was generated in `README.md` and `.github/workflows/ci_release.yml`.

- make sure that this new package is also tested during the tests of the other packages

_(have a look at [ci_test_core.yml](https://github.com/DSI-HUG/ngx-components/blob/main/.github/workflows/ci_test_core.yml#L27-L29) for examples)_
3. If this new package has any other internal packages as peer dependencies:
- Make sure that this new package is also tested during the tests of the other packages<br/> _(have a look at [ci_test_core.yml](https://github.com/DSI-HUG/ngx-components/blob/main/.github/workflows/ci_test_core.yml#L27-L29) for examples)_

## Linting/verifying source code

Expand All @@ -42,23 +41,23 @@ npm run lint
You can also verify it per package:

```sh
npm run lint -w=projects/<package_name>
npm run lint -w projects/<package_name>
```

## Unit testing a package

Unit testing a package can be executed with the following command:

```sh
npm run test -w=projects/<package_name>
npm run test -w projects/<package_name>
```

## Building a package

Building a package can be executed with the following command:

```sh
npm run build -w=projects/<package_name>
npm run build -w projects/<package_name>
```

## Publishing a package to NPM repository
Expand All @@ -67,26 +66,26 @@ This project comes with automatic continuous delivery (CD) using _GitHub Actions

To publish a package:

1. Trigger a new: [Workflow release](https://github.com/dsi-hug/ngx-components/actions/workflows/ci_release.yml)
1. Trigger a new [workflow release](https://github.com/dsi-hug/ngx-components/actions/workflows/ci_release.yml)
2. Watch the results in: [Actions](https://github.com/dsi-hug/ngx-components/actions)

### ⚠️ First release

> A previous tag needs to be found to compute the next semver version.

So when you publish a package for the first time, you will have to do the following:
When you publish a package for the first time, you will have to do the following:

1. Commit and push the package, using this commit message:

```sh
feat(<package_name>): first commit
```
```sh
feat(<package_name>): first commit
```

2. Add a tag to the commit prior the one you just created, and push it:
2. Add a tag to the commit prior to the one you just created, and push it:

```sh
@hug/ngx-<package_name>@1.0.0
```
```sh
@hug/ngx-<package_name>@1.0.0
```

3. Trigger a new release

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
| [@hug/ngx-tooltip](/projects/tooltip) | [![npm version][npm-logo-tooltip]][npm-tooltip] | [![npm downloads][npm-dl-logo-tooltip]][npm-dl-tooltip] | [![build status][tests-logo-tooltip]][tests-tooltip] |
| [@hug/ngx-user-card](/projects/user-card) | [![npm version][npm-logo-user-card]][npm-user-card] | [![npm downloads][npm-dl-logo-user-card]][npm-dl-user-card] | [![build status][tests-logo-user-card]][tests-user-card] |
| [@hug/ngx-user-tooltip](/projects/user-tooltip) | [![npm version][npm-logo-user-tooltip]][npm-user-tooltip] | [![npm downloads][npm-dl-logo-user-tooltip]][npm-dl-user-tooltip] | [![build status][tests-logo-user-tooltip]][tests-user-tooltip] |
| [@hug/ngx-date-picker](/projects/date-picker) | [![npm version][npm-logo-date-picker]][npm-date-picker] | [![npm downloads][npm-dl-logo-date-picker]][npm-dl-date-picker] | [![build status][tests-logo-date-picker]][tests-date-picker] |

</div>

Expand Down Expand Up @@ -79,6 +80,12 @@ Copyright (C) 2024 [HUG - Hôpitaux Universitaires Genève][dsi-hug]
[npm-dl-logo-core]: https://img.shields.io/npm/dw/@hug/ngx-core.svg?color=7986CB&logo=npm&label=npm
[tests-core]: https://github.com/dsi-hug/ngx-components/actions/workflows/ci_test_core.yml
[tests-logo-core]: https://github.com/dsi-hug/ngx-components/actions/workflows/ci_test_core.yml/badge.svg
[npm-date-picker]: https://www.npmjs.com/package/@hug/ngx-date-picker
[npm-logo-date-picker]: https://img.shields.io/npm/v/@hug/ngx-date-picker.svg?color=blue&logo=npm
[npm-dl-date-picker]: https://npmcharts.com/compare/@hug/ngx-date-picker?minimal=true
[npm-dl-logo-date-picker]: https://img.shields.io/npm/dw/@hug/ngx-date-picker.svg?color=7986CB&logo=npm&label=npm
[tests-date-picker]: https://github.com/dsi-hug/ngx-components/actions/workflows/ci_test_date-picker.yml
[tests-logo-date-picker]: https://github.com/dsi-hug/ngx-components/actions/workflows/ci_test_date-picker.yml/badge.svg
[npm-layout]: https://www.npmjs.com/package/@hug/ngx-layout
[npm-logo-layout]: https://img.shields.io/npm/v/@hug/ngx-layout.svg?color=blue&logo=npm
[npm-dl-layout]: https://npmcharts.com/compare/@hug/ngx-layout?minimal=true
Expand Down
Loading

0 comments on commit c07d0d9

Please sign in to comment.