Skip to content

Commit 051e79e

Browse files
authored
Upgrade dependencies (#100)
* upgrade dependencies in apps * adapt code to components@0.1.5 * decode the key parameter in the backend * upgrade components to 0.1.6 * fix linter
1 parent fb3903c commit 051e79e

File tree

8 files changed

+80
-52
lines changed

8 files changed

+80
-52
lines changed

apps/hightable-demo/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
"react-dom": "18.3.1"
1919
},
2020
"devDependencies": {
21-
"@eslint/js": "9.14.0",
21+
"@eslint/js": "9.16.0",
2222
"@types/react": "18.3.12",
2323
"@types/react-dom": "18.3.1",
24-
"@vitejs/plugin-react": "4.3.3",
25-
"@vitest/coverage-v8": "2.1.4",
26-
"eslint": "9.14.0",
24+
"@vitejs/plugin-react": "4.3.4",
25+
"@vitest/coverage-v8": "2.1.8",
26+
"eslint": "9.16.0",
2727
"eslint-plugin-react": "7.37.2",
2828
"eslint-plugin-react-hooks": "5.0.0",
29-
"eslint-plugin-react-refresh": "0.4.14",
30-
"globals": "15.11.0",
31-
"typescript": "5.6.3",
32-
"typescript-eslint": "8.13.0",
33-
"vite": "5.4.10",
34-
"vitest": "2.1.4"
29+
"eslint-plugin-react-refresh": "0.4.16",
30+
"globals": "15.13.0",
31+
"typescript": "5.7.2",
32+
"typescript-eslint": "8.17.0",
33+
"vite": "5.4.11",
34+
"vitest": "2.1.8"
3535
}
3636
}

apps/hyparquet-demo/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
"test": "vitest run --dir test"
1414
},
1515
"dependencies": {
16-
"@hyparam/components": "0.1.4",
17-
"hyparquet": "1.6.1",
16+
"@hyparam/components": "0.1.6",
17+
"hightable": "0.7.2",
18+
"hyparquet": "1.6.3",
1819
"hyparquet-compressors": "0.1.4",
19-
"hightable": "0.7.0",
2020
"react": "18.3.1",
2121
"react-dom": "18.3.1"
2222
},
2323
"devDependencies": {
24-
"@eslint/js": "9.14.0",
24+
"@eslint/js": "9.16.0",
2525
"@types/react": "18.3.12",
2626
"@types/react-dom": "18.3.1",
27-
"@vitejs/plugin-react": "4.3.3",
28-
"@vitest/coverage-v8": "2.1.4",
29-
"eslint": "9.14.0",
27+
"@vitejs/plugin-react": "4.3.4",
28+
"@vitest/coverage-v8": "2.1.8",
29+
"eslint": "9.16.0",
3030
"eslint-plugin-react": "7.37.2",
3131
"eslint-plugin-react-hooks": "5.0.0",
32-
"eslint-plugin-react-refresh": "0.4.14",
33-
"globals": "15.11.0",
34-
"typescript": "5.6.3",
35-
"typescript-eslint": "8.13.0",
36-
"vite": "5.4.10",
37-
"vitest": "2.1.4"
32+
"eslint-plugin-react-refresh": "0.4.16",
33+
"globals": "15.13.0",
34+
"typescript": "5.7.2",
35+
"typescript-eslint": "8.17.0",
36+
"vite": "5.4.11",
37+
"vitest": "2.1.8"
3838
}
3939
}

packages/cli/package.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"highlight.js": "11.10.0",
27-
"@hyparam/components": "0.1.4",
27+
"@hyparam/components": "0.1.6",
2828
"react": "18.3.1",
2929
"react-dom": "18.3.1"
3030
},
@@ -35,21 +35,19 @@
3535
"@rollup/plugin-terser": "0.4.4",
3636
"@rollup/plugin-typescript": "12.1.1",
3737
"@testing-library/react": "16.0.1",
38-
"@types/node": "22.8.4",
38+
"@types/node": "22.10.1",
3939
"@types/react": "18.3.12",
4040
"@types/react-dom": "18.3.1",
41-
"@vitejs/plugin-react": "4.3.3",
42-
"@vitest/coverage-v8": "2.1.4",
43-
"eslint": "9.13.0",
44-
"globals": "15.11.0",
41+
"@vitejs/plugin-react": "4.3.4",
42+
"@vitest/coverage-v8": "2.1.8",
43+
"eslint": "9.16.0",
44+
"globals": "15.13.0",
4545
"jsdom": "25.0.1",
46-
"react": "18.3.1",
47-
"react-dom": "18.3.1",
48-
"rollup": "4.24.3",
46+
"rollup": "4.28.0",
4947
"rollup-plugin-postcss": "4.0.2",
50-
"tslib": "2.8.0",
51-
"typescript": "5.6.3",
52-
"typescript-eslint": "8.12.2",
53-
"vitest": "2.1.4"
48+
"tslib": "2.8.1",
49+
"typescript": "5.7.2",
50+
"typescript-eslint": "8.17.0",
51+
"vitest": "2.1.8"
5452
}
5553
}

packages/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.

packages/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.

packages/cli/src/AppComponent.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { HttpFileSystem, HyperparamFileSystem, Page } from '@hyparam/components'
2+
import React from 'react'
3+
4+
const fileSystems = [
5+
new HttpFileSystem(),
6+
new HyperparamFileSystem({ endpoint: location.origin }),
7+
]
8+
9+
export default function App() {
10+
const search = new URLSearchParams(location.search)
11+
const url = search.get('key') ?? ''
12+
const row = search.get('row') === null ? undefined : Number(search.get('row'))
13+
const col = search.get('col') === null ? undefined : Number(search.get('col'))
14+
15+
let source = undefined
16+
for (const fileSystem of fileSystems) {
17+
const fsSource = fileSystem.getSource(url)
18+
if (fsSource) {
19+
source = fsSource
20+
break
21+
}
22+
}
23+
24+
if (!source) {
25+
return React.createElement('div', { children: 'Could not load a data source. You have to pass a valid source in the url.' })
26+
}
27+
return React.createElement(Page, {
28+
source,
29+
navigation: { row, col },
30+
config: {
31+
slidePanel: { minWidth: 250, maxWidth: 750 },
32+
routes: {
33+
getSourceRouteUrl: ({ source }) => `/files?key=${source}`,
34+
getCellRouteUrl: ({ source, col, row }) => `/files?key=${source}&col=${col}&row=${row}`,
35+
},
36+
},
37+
})
38+
}
39+

packages/cli/src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { App } from '@hyparam/components'
21
import React from 'react'
32
import ReactDOM from 'react-dom/client'
3+
import App from './AppComponent.js'
44

55
const app = document.getElementById('app')
66
if (!app) throw new Error('missing app element')
77

88
const root = ReactDOM.createRoot(app)
9-
root.render(React.createElement(App, { apiBaseUrl: location.origin }))
9+
root.render(React.createElement(App))

packages/cli/src/serve.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ function handleRequest(req, serveDirectory) {
9595
// serve file list
9696
const prefix = parsedUrl.query.prefix || ''
9797
if (Array.isArray(prefix)) return { status: 400, content: 'bad request' }
98-
const perfixPath = `${serveDirectory}/${prefix}`
98+
const perfixPath = `${serveDirectory}/${decodeURIComponent(prefix)}`
9999
return handleListing(perfixPath)
100100
} else if (serveDirectory && pathname === '/api/store/get') {
101101
// serve file content
102102
const key = parsedUrl.query.key || ''
103103
if (Array.isArray(key)) return { status: 400, content: 'bad request' }
104-
const filePath = `${serveDirectory}/${key}`
104+
const filePath = `${serveDirectory}/${decodeURIComponent(key)}`
105105
if (req.method === 'HEAD') {
106106
return handleHead(filePath)
107107
}

0 commit comments

Comments
 (0)