Skip to content

Commit

Permalink
Upgrade dependencies (#100)
Browse files Browse the repository at this point in the history
* upgrade dependencies in apps

* adapt code to [email protected]

* decode the key parameter in the backend

* upgrade components to 0.1.6

* fix linter
  • Loading branch information
severo authored Dec 2, 2024
1 parent fb3903c commit 051e79e
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 52 deletions.
20 changes: 10 additions & 10 deletions apps/hightable-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"react-dom": "18.3.1"
},
"devDependencies": {
"@eslint/js": "9.14.0",
"@eslint/js": "9.16.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.4",
"eslint": "9.14.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "2.1.8",
"eslint": "9.16.0",
"eslint-plugin-react": "7.37.2",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-react-refresh": "0.4.14",
"globals": "15.11.0",
"typescript": "5.6.3",
"typescript-eslint": "8.13.0",
"vite": "5.4.10",
"vitest": "2.1.4"
"eslint-plugin-react-refresh": "0.4.16",
"globals": "15.13.0",
"typescript": "5.7.2",
"typescript-eslint": "8.17.0",
"vite": "5.4.11",
"vitest": "2.1.8"
}
}
26 changes: 13 additions & 13 deletions apps/hyparquet-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@
"test": "vitest run --dir test"
},
"dependencies": {
"@hyparam/components": "0.1.4",
"hyparquet": "1.6.1",
"@hyparam/components": "0.1.6",
"hightable": "0.7.2",
"hyparquet": "1.6.3",
"hyparquet-compressors": "0.1.4",
"hightable": "0.7.0",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@eslint/js": "9.14.0",
"@eslint/js": "9.16.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.4",
"eslint": "9.14.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "2.1.8",
"eslint": "9.16.0",
"eslint-plugin-react": "7.37.2",
"eslint-plugin-react-hooks": "5.0.0",
"eslint-plugin-react-refresh": "0.4.14",
"globals": "15.11.0",
"typescript": "5.6.3",
"typescript-eslint": "8.13.0",
"vite": "5.4.10",
"vitest": "2.1.4"
"eslint-plugin-react-refresh": "0.4.16",
"globals": "15.13.0",
"typescript": "5.7.2",
"typescript-eslint": "8.17.0",
"vite": "5.4.11",
"vitest": "2.1.8"
}
}
24 changes: 11 additions & 13 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"highlight.js": "11.10.0",
"@hyparam/components": "0.1.4",
"@hyparam/components": "0.1.6",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand All @@ -35,21 +35,19 @@
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.1",
"@testing-library/react": "16.0.1",
"@types/node": "22.8.4",
"@types/node": "22.10.1",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.4",
"eslint": "9.13.0",
"globals": "15.11.0",
"@vitejs/plugin-react": "4.3.4",
"@vitest/coverage-v8": "2.1.8",
"eslint": "9.16.0",
"globals": "15.13.0",
"jsdom": "25.0.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"rollup": "4.24.3",
"rollup": "4.28.0",
"rollup-plugin-postcss": "4.0.2",
"tslib": "2.8.0",
"typescript": "5.6.3",
"typescript-eslint": "8.12.2",
"vitest": "2.1.4"
"tslib": "2.8.1",
"typescript": "5.7.2",
"typescript-eslint": "8.17.0",
"vitest": "2.1.8"
}
}
13 changes: 2 additions & 11 deletions packages/cli/public/build/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cli/public/build/app.min.js.map

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions packages/cli/src/AppComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { HttpFileSystem, HyperparamFileSystem, Page } from '@hyparam/components'
import React from 'react'

const fileSystems = [
new HttpFileSystem(),
new HyperparamFileSystem({ endpoint: location.origin }),
]

export default function App() {
const search = new URLSearchParams(location.search)
const url = search.get('key') ?? ''
const row = search.get('row') === null ? undefined : Number(search.get('row'))
const col = search.get('col') === null ? undefined : Number(search.get('col'))

let source = undefined
for (const fileSystem of fileSystems) {
const fsSource = fileSystem.getSource(url)
if (fsSource) {
source = fsSource
break
}
}

if (!source) {
return React.createElement('div', { children: 'Could not load a data source. You have to pass a valid source in the url.' })
}
return React.createElement(Page, {
source,
navigation: { row, col },
config: {
slidePanel: { minWidth: 250, maxWidth: 750 },
routes: {
getSourceRouteUrl: ({ source }) => `/files?key=${source}`,
getCellRouteUrl: ({ source, col, row }) => `/files?key=${source}&col=${col}&row=${row}`,
},
},
})
}

4 changes: 2 additions & 2 deletions packages/cli/src/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { App } from '@hyparam/components'
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './AppComponent.js'

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

const root = ReactDOM.createRoot(app)
root.render(React.createElement(App, { apiBaseUrl: location.origin }))
root.render(React.createElement(App))
4 changes: 2 additions & 2 deletions packages/cli/src/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ function handleRequest(req, serveDirectory) {
// serve file list
const prefix = parsedUrl.query.prefix || ''
if (Array.isArray(prefix)) return { status: 400, content: 'bad request' }
const perfixPath = `${serveDirectory}/${prefix}`
const perfixPath = `${serveDirectory}/${decodeURIComponent(prefix)}`
return handleListing(perfixPath)
} else if (serveDirectory && pathname === '/api/store/get') {
// serve file content
const key = parsedUrl.query.key || ''
if (Array.isArray(key)) return { status: 400, content: 'bad request' }
const filePath = `${serveDirectory}/${key}`
const filePath = `${serveDirectory}/${decodeURIComponent(key)}`
if (req.method === 'HEAD') {
return handleHead(filePath)
}
Expand Down

0 comments on commit 051e79e

Please sign in to comment.