Skip to content

Commit

Permalink
add scripts and github action to run root test + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Dec 13, 2024
1 parent ccc1266 commit 3b9ba5a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci_root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: root
on:
push:
paths:
- './*'
- './test/**'
- '.github/workflows/ci_root.yml'
- 'eslint.config.js'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm run test
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
This is a monorepo for the Hyperparam project.

It contains the following packages, published to npm:

- [`@hyparam/components`](./packages/components): a library of React components and utilities for building Hyperparam UIs.
- [`hyperparam`](./packages/cli): a cli tool for viewing arbitrarily large datasets in the browser.

It also contains the following applications:

- [`hightable-demo`](./apps/hightable-demo): an example project showing how to use [hightable](https://github.com/hyparam/hightable).
- [`hyparquet-demo`](./apps/hyparquet-demo): an example project showing how to use [hyparquet](https://github.com/hyparam/hyparquet).

Expand All @@ -21,25 +23,25 @@ npm install
Lint all the workspaces:

```bash
npm run lint
npm run lint -ws
```

Test all the workspaces:

```bash
npm test
npm test -ws
```

Compute the coverage for all the workspaces:

```bash
npm run coverage
npm run coverage -ws
```

Build all the workspaces (they are built in order, so the dependencies are built first - it's defined manually by the order of the workspaces in the `package.json`):

```bash
npm run build
npm run build -ws
```

Run an app:
Expand Down Expand Up @@ -78,4 +80,4 @@ It means that if you make a change to `@hyparam/components`, you need to rebuild

Also, if you increment the version of `@hyparam/components`, you need to update the version of `@hyparam/components` in the `package.json` of `hyperparam` and `hyparquet-demo`, as we use exact versions in the `package.json` of the workspaces. Note that we don't have to increment the version after every change, only when we want to publish a new version with a significant batch of changes.

The root package.json contains a special field, `overrides`, which sets the shared dependencies versions we want to have in all the workspaces. The "check_dependencies" GitHub action checks that the dependencies are the same in all the workspaces (`npm ls` would fail if dependency version mismatch).
The root package.json contains a special field, `overrides`, which sets the shared dependencies versions we want to have in all the workspaces. The "check_dependencies" GitHub action checks that the dependencies are the same in all the workspaces (`npm ls` would fail if dependency version mismatch).
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
"apps/hyparquet-demo"
],
"scripts": {
"build": "npm run build -ws",
"coverage": "npm run coverage -ws",
"lint": "npm run lint -ws",
"test": "npm test -ws"
"lint": "eslint .",
"test": "vitest run"
},
"overrides": {
"highlight.js": "11.10.0",
Expand Down

0 comments on commit 3b9ba5a

Please sign in to comment.