Skip to content

Commit ddff97d

Browse files
authored
Factor common code in @hyparam/utils (#44)
* demo for hyparquet * remove todo * move html to Welcome.tsx + fix p > ul * extract to a function * remove typo * fix worker * fix dropzone * add github ci * add missing dependency * add column information in parquet layout * factor code in packages/utils * try to fix ci * use the utils package * fix mock * fix readme * fix two comments in PR review
1 parent a78392a commit ddff97d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+391
-294
lines changed

.github/workflows/ci_apps_cli.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- run: npm i
19+
- run: npm run build
20+
working-directory: ./packages/utils
21+
- run: npm run build
22+
working-directory: ./packages/components
1923
- run: npm run lint
2024

2125
typecheck:
@@ -26,6 +30,8 @@ jobs:
2630
steps:
2731
- uses: actions/checkout@v4
2832
- run: npm i
33+
- run: npm run build
34+
working-directory: ./packages/utils
2935
- run: npm run build
3036
working-directory: ./packages/components
3137
- run: tsc
@@ -36,6 +42,10 @@ jobs:
3642
steps:
3743
- uses: actions/checkout@v4
3844
- run: npm i
45+
- run: npm run build
46+
working-directory: ./packages/utils
47+
- run: npm run build
48+
working-directory: ./packages/components
3949
- run: npm run coverage
4050

4151
buildcheck:
@@ -46,6 +56,8 @@ jobs:
4656
steps:
4757
- uses: actions/checkout@v4
4858
- run: npm i
59+
- run: npm run build
60+
working-directory: ./packages/utils
4961
- run: npm run build
5062
working-directory: ./packages/components
5163
- run: npm run build

.github/workflows/ci_apps_hyparquet_demo.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,24 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- run: npm i
18+
- run: npm run build
19+
working-directory: ./packages/utils
1820
- run: npm run lint
1921

2022
typecheck:
2123
runs-on: ubuntu-latest
2224
steps:
2325
- uses: actions/checkout@v4
2426
- run: npm i
27+
- run: npm run build
28+
working-directory: ./packages/utils
2529
- run: tsc
2630

2731
buildcheck:
2832
runs-on: ubuntu-latest
2933
steps:
3034
- uses: actions/checkout@v4
3135
- run: npm i
36+
- run: npm run build
37+
working-directory: ./packages/utils
3238
- run: npm run build

.github/workflows/ci_packages_components.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,26 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- run: npm i
18+
- run: npm run build
19+
working-directory: ./packages/utils
1820
- run: npm run lint
1921

2022
typecheck:
2123
runs-on: ubuntu-latest
2224
steps:
2325
- uses: actions/checkout@v4
2426
- run: npm i
27+
- run: npm run build
28+
working-directory: ./packages/utils
2529
- run: tsc
2630

2731
test:
2832
runs-on: ubuntu-latest
2933
steps:
3034
- uses: actions/checkout@v4
3135
- run: npm i
36+
- run: npm run build
37+
working-directory: ./packages/utils
3238
- run: npm run coverage
3339

3440
buildcheck:
@@ -37,3 +43,5 @@ jobs:
3743
- uses: actions/checkout@v4
3844
- run: npm i
3945
- run: npm run build
46+
working-directory: ./packages/utils
47+
- run: npm run build
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: packages/utils
2+
on:
3+
push:
4+
paths:
5+
- 'packages/utils/**'
6+
- '.github/workflows/ci_packages_utils.yml'
7+
8+
defaults:
9+
run:
10+
working-directory: ./packages/utils
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- run: npm i
18+
- run: npm run lint
19+
20+
typecheck:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- run: npm i
25+
- run: tsc
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- run: npm i
32+
- run: npm run coverage
33+
34+
buildcheck:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- run: npm i
39+
- run: npm run build

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This is a monorepo for the Hyperparam project.
44

55
It contains the following package:
66
- [`@hyparam/components`](./packages/components): a library of React components for building Hyperparam UIs.
7+
- [`@hyparam/utils`](./packages/utils): a library of utils.
78

89
It also contains the following applications:
910
- [`hyperparam`](./apps/cli): a cli tool for viewing arbitrarily large datasets in the browser.

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

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

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/hyparquet-demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@hyparam/utils": "file:../../packages/utils",
1314
"hyparquet": "1.5.0",
1415
"hyparquet-compressors": "0.1.4",
1516
"hightable": "0.7.0",

apps/hyparquet-demo/src/App.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { ReactNode } from 'react'
22
import Page, { PageProps } from './Page.js'
33
import Welcome from './Welcome.js'
44

5+
import { AsyncBufferFrom, Row, asyncBufferFrom, parquetQueryWorker } from '@hyparam/utils'
56
import { DataFrame, rowCache } from 'hightable'
67
import { FileMetaData, byteLengthFromUrl, parquetMetadataAsync, parquetSchema } from 'hyparquet'
78
import { useCallback, useEffect, useState } from 'react'
89
import Dropzone from './Dropzone.js'
910
import Layout from './Layout.js'
10-
import { asyncBufferFrom } from './utils.js'
11-
import { parquetQueryWorker } from './workers/parquetWorkerClient.js'
12-
import { AsyncBufferFrom, Row } from './workers/types.js'
1311

1412
export default function App(): ReactNode {
1513
const params = new URLSearchParams(location.search)

apps/hyparquet-demo/src/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { cn } from '@hyparam/utils'
12
import { ReactNode, useEffect, useRef, useState } from 'react'
2-
import { cn } from './utils.js'
33

44
interface DropdownProps {
55
label?: string

0 commit comments

Comments
 (0)