Skip to content

Commit 8cd859a

Browse files
authored
remove npm workspaces + use published utils package (#53)
* remove npm workspaces + use published utils package * fix CI * fix CI * transform to a commonjs module * fix * fix ci * add missing dev dependency (it was installed globally when using workspaces) * install react + depend on published package, not relative one
1 parent 31df2aa commit 8cd859a

19 files changed

+52
-86
lines changed

.github/workflows/ci_apps_cli.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ on:
33
push:
44
paths:
55
- 'packages/components/**'
6-
- 'packages/utils/**'
76
- 'apps/cli/**'
87
- '.github/workflows/ci_apps_cli.yml'
8+
- 'shared.eslint.config.js'
99

1010
defaults:
1111
run:
@@ -17,49 +17,41 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- run: npm i
20-
- run: npm run build
21-
working-directory: ./packages/utils
22-
- run: npm run build
20+
- run: |
21+
npm i
22+
npm run build
2323
working-directory: ./packages/components
2424
- run: npm run lint
2525

2626
typecheck:
2727
runs-on: ubuntu-latest
28-
defaults:
29-
run:
30-
working-directory: ./
3128
steps:
3229
- uses: actions/checkout@v4
3330
- run: npm i
34-
- run: npm run build
35-
working-directory: ./packages/utils
36-
- run: npm run build
31+
- run: |
32+
npm i
33+
npm run build
3734
working-directory: ./packages/components
3835
- run: tsc
39-
working-directory: ./apps/cli
4036

4137
test:
4238
runs-on: ubuntu-latest
4339
steps:
4440
- uses: actions/checkout@v4
4541
- run: npm i
46-
- run: npm run build
47-
working-directory: ./packages/utils
48-
- run: npm run build
42+
- run: |
43+
npm i
44+
npm run build
4945
working-directory: ./packages/components
5046
- run: npm run coverage
5147

5248
buildcheck:
5349
runs-on: ubuntu-latest
54-
defaults:
55-
run:
56-
working-directory: ./
5750
steps:
5851
- uses: actions/checkout@v4
5952
- run: npm i
60-
- run: npm run build
61-
working-directory: ./packages/utils
62-
- run: npm run build
53+
- run: |
54+
npm i
55+
npm run build
6356
working-directory: ./packages/components
6457
- run: npm run build
65-
working-directory: ./apps/cli

.github/workflows/ci_apps_hightable_demo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
paths:
55
- 'apps/hightable-demo/**'
66
- '.github/workflows/ci_apps_hightable_demo.yml'
7+
- 'shared.eslint.config.js'
78

89
defaults:
910
run:

.github/workflows/ci_apps_hyparquet_demo.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: apps/hyparquet-demo
22
on:
33
push:
44
paths:
5-
- 'packages/utils/**'
65
- 'apps/hyparquet-demo/**'
76
- '.github/workflows/ci_apps_hyparquet_demo.yml'
7+
- 'shared.eslint.config.js'
88

99
defaults:
1010
run:
@@ -16,33 +16,25 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- run: npm i
19-
- run: npm run build
20-
working-directory: ./packages/utils
2119
- run: npm run lint
2220

2321
typecheck:
2422
runs-on: ubuntu-latest
2523
steps:
2624
- uses: actions/checkout@v4
2725
- run: npm i
28-
- run: npm run build
29-
working-directory: ./packages/utils
3026
- run: tsc
3127

3228
test:
3329
runs-on: ubuntu-latest
3430
steps:
3531
- uses: actions/checkout@v4
3632
- run: npm i
37-
- run: npm run build
38-
working-directory: ./packages/utils
3933
- run: npm run coverage
4034

4135
buildcheck:
4236
runs-on: ubuntu-latest
4337
steps:
4438
- uses: actions/checkout@v4
4539
- run: npm i
46-
- run: npm run build
47-
working-directory: ./packages/utils
4840
- run: npm run build

.github/workflows/ci_packages_components.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
push:
44
paths:
55
- 'packages/components/**'
6-
- 'packages/utils/**'
76
- '.github/workflows/ci_packages_components.yml'
7+
- 'shared.eslint.config.js'
88

99
defaults:
1010
run:
@@ -16,26 +16,20 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- run: npm i
19-
- run: npm run build
20-
working-directory: ./packages/utils
2119
- run: npm run lint
2220

2321
typecheck:
2422
runs-on: ubuntu-latest
2523
steps:
2624
- uses: actions/checkout@v4
2725
- run: npm i
28-
- run: npm run build
29-
working-directory: ./packages/utils
3026
- run: tsc
3127

3228
test:
3329
runs-on: ubuntu-latest
3430
steps:
3531
- uses: actions/checkout@v4
3632
- run: npm i
37-
- run: npm run build
38-
working-directory: ./packages/utils
3933
- run: npm run coverage
4034

4135
buildcheck:
@@ -44,5 +38,3 @@ jobs:
4438
- uses: actions/checkout@v4
4539
- run: npm i
4640
- run: npm run build
47-
working-directory: ./packages/utils
48-
- run: npm run build

.github/workflows/ci_packages_utils.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
paths:
55
- 'packages/utils/**'
66
- '.github/workflows/ci_packages_utils.yml'
7+
- 'shared.eslint.config.js'
78

89
defaults:
910
run:

.github/workflows/deploy_pages.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,16 @@ jobs:
1717
steps:
1818
- name: Checkout the repository
1919
uses: actions/checkout@v4
20-
- name: Install dependencies
21-
run: npm i
22-
- name: Build @hyparam/utils package
23-
run: npm run build
24-
working-directory: ./packages/utils
2520
- name: Build hyparquet demo
26-
run: npm run build
21+
run: |
22+
npm i
23+
npm run build
2724
working-directory: ./apps/hyparquet-demo
2825
- name: Build hightable demo
29-
run: npm run build
30-
working-directory: ./apps/hightable-demo
31-
- name: Create index file content
3226
run: |
33-
34-
id: index_content
27+
npm i
28+
npm run build
29+
working-directory: ./apps/hightable-demo
3530
- name: Move the build outputs to a folder
3631
run: |
3732
mkdir -p build_outputs_folder/apps

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ It also contains the following applications:
1010
- [`hyperparam`](./apps/cli): a cli tool for viewing arbitrarily large datasets in the browser.
1111
- [`hightable-demo`](./apps/hightable-demo): an example project showing how to use [hightable](https://github.com/hyparam/hightable).
1212
- [`hyparquet-demo`](./apps/hyparquet-demo): an example project showing how to use [hyparquet](https://github.com/hyparam/hyparquet).
13+
14+
## Development
15+
16+
The dependencies between the packages and applications of this monorepo are pinned, and the packages are published to npm. It means that the changes in a dependency are not automatically reflected in the dependent package or application.
17+
18+
To make the development easier, you can locally replace the npm dependencies with the local packages, replacing the pinned versions (eg `"@hyparam/utils": "0.1.0",`) with a relative path (`"@hyparam/utils": "file:../../packages/utils",`). It's not ideal, we might switch to pnpm or yarn workspaces in the future.

apps/cli/eslint.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import javascript from '@eslint/js'
22
import globals from 'globals'
33
import typescript from 'typescript-eslint'
4-
import { sharedJsRules } from '../../shared.eslint.config.js'
4+
import sharedEslintRules from '../../shared.eslint.config.js'
5+
const { sharedJsRules } = sharedEslintRules
56

67
export default [
78
{

apps/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
},
2424
"dependencies": {
2525
"highlight.js": "11.10.0",
26-
"@hyparam/components": "file:../../packages/components"
26+
"@hyparam/components": "0.1.0",
27+
"react": "18.3.1",
28+
"react-dom": "18.3.1"
2729
},
2830
"devDependencies": {
2931
"@rollup/plugin-commonjs": "28.0.1",

apps/cli/public/build/app.min.js

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)