Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f6bf39

Browse files
authored
Create the space (#2)
* setup GitHub Action* install python* github action env vars* gitignore* use vite to generate the app + update action* apply recommendations and fix errors* copy and adapt (ts) hyperparam-cli codeonly enable a Parquet URL, hardcoded* move assets to src/assets* fix css by renaming id* fix height down caret in sortable* add workers* update tsbuildinfo* enable Cell view* fix url* try this* specific code for hf space* fix urls* intercept click on link when staying in the app* use and set the 'key' query param* parse the HF urls* rename query param key to url* url->raw, prepare breadcrumb for file view* add action field + use in Cell* show content for all the routes + error, and fix %2F in branch name* fix query param* fix viewer and cell for 'blob' urls* add Folder view* fix text, markdown and image views* clean* change project url* add repository view, to select a branch* add home page* add home link + no view for 'base url'* namespace dataset sends to home* simplify code* add dependency to huggingface.js to remove codewe will need it anyway later to enable authentication* add unstyled dataset search on home* add some style* test OAuth (requires space)* fix type* fix ts* comment out oauth for now* fix scroll on home* fix link* comment* upgrade hyparquet* remove unused code* upgrade hightable* upgrade hightable and style (row placeholder)* upgrade hightable and use cachedAsyncBuffer* Fix parquetQueryWorker for parallel requests* Optionally send chunks back from parquet worker* Parquet aware table provider* repository view: the main branch root path* test oauth* always try to get log in HF* refactor* use context to pass auth + return if auth not ready* remove traces* handle redirect + login/logout links* add debug* test* test* test* more logs* more debug* test* test* clean* fix token expiration + fix redirection + better UI for login/logout* hack css* handle gated datasets* fix private/gated for parquet / head requests* add fix for cell view:hyparam/hyperparam-cli@2fa7382* add branch dropdown* update hightable* remove sidebar + change color + pass url to create breadcrumb* Revert "remove sidebar + change color + pass url to create breadcrumb"This reverts commit68610c1.* move branch selector to the right + fix path parts* css tweak to have text and icon better aligned* add link to open the url* fix branch (refs/convert/parquet) in external link* handle middle mouse button on parquet view* refactoring to fix linter* move to folders hierarchy* update tests* fix file size* fix links in the HF space* fix Home link, to remove the ?url= param* upgrade hightable* Revamp the space with @hyparam/components. Temporarily without HF specifics* add CI* ignore coverage in eslint* upgrade packages, in particular @hyparam/components* add parseHuggingFaceUrl function* implement HF filesystem* upgrade components to 0.1.8* enable auth - WARNING: relies on unreleased 0.1.10seehyparam/hyperparam-cli#114* fix lint* remove commented code* no need to stop the event propagation* remove commented code
1 parent47eb002 commit5f6bf39

37 files changed

+2116
-0
lines changed

‎.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name:Checks
2+
on:
3+
push:
4+
jobs:
5+
lint:
6+
runs-on:ubuntu-latest
7+
steps:
8+
-uses:actions/checkout@v4
9+
-run:npm i
10+
-run:npm run lint
11+
12+
typecheck:
13+
runs-on:ubuntu-latest
14+
steps:
15+
-uses:actions/checkout@v4
16+
-run:npm i
17+
-run:npx tsc
18+
19+
test:
20+
runs-on:ubuntu-latest
21+
steps:
22+
-uses:actions/checkout@v4
23+
-run:npm i
24+
-run:npm run coverage
25+
26+
buildcheck:
27+
runs-on:ubuntu-latest
28+
steps:
29+
-uses:actions/checkout@v4
30+
-run:npm i
31+
-run:npm run build
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name:Deploy to Hugging Face
2+
on:
3+
push:
4+
branches:
5+
-main
6+
workflow_dispatch:
7+
8+
env:
9+
STATIC_SPACE:"severo/parquet-viewer"
10+
DIRECTORY:"dist"
11+
12+
jobs:
13+
deploy:
14+
# inspired by https://huggingface.co/blog/severo/build-static-html-spaces
15+
runs-on:ubuntu-latest
16+
steps:
17+
-name:Set up Python 3.12
18+
uses:actions/setup-python@v5
19+
with:
20+
python-version:"3.12"
21+
-name:Install huggingface_hub
22+
run:pip install --upgrade "huggingface_hub[cli]"
23+
-name:Checkout the code
24+
uses:actions/checkout@v4
25+
-name:Set up Node.js
26+
uses:actions/setup-node@v4
27+
with:
28+
node-version:"20"
29+
-name:build the app
30+
run:npm install && npm run build
31+
-name:Copy the README.md from the space to the public folder
32+
run:huggingface-cli download --token=${{ secrets.HF_TOKEN }} --repo-type=space --local-dir=${{env.DIRECTORY}} ${{env.STATIC_SPACE}} README.md
33+
-name:Delete hfh cache
34+
run:rm -rf ${{env.DIRECTORY}}/.cache
35+
-name:Push to HF space (deleting the previous files)
36+
run:huggingface-cli upload --token=${{ secrets.HF_TOKEN }} --repo-type=space ${{env.STATIC_SPACE}} ${{env.DIRECTORY}} . --delete "*"

‎.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
# the dependencies are exact
27+
package-lock.json
28+
pnpm-lock.yaml
29+
yarn.lock
30+
31+
coverage

‎LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#View Parquet files on Hugging Face
2+
3+
This app allows you to view Parquet files hosted in a Hugging Face dataset. It hardcoded for now:https://huggingface.co/datasets/codeparrot/github-code/resolve/main/data/train-00000-of-01126.parquet
4+
5+
The app is static and is currently deployed with a[GitHub Action](./github/workflows/ci.yml) to a Hugging Face space:https://huggingface.co/spaces/severo/parquet-viewer.
6+
7+
Created with`npm create vite@latest parquet-viewer -- --template react-ts`. Seehttps://blog.rednegra.net/2024/10/14/create-a-static-huggingface-space-with-react.

‎eslint.config.js

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
importjsfrom'@eslint/js'
2+
importreactfrom'eslint-plugin-react'
3+
importreactHooksfrom'eslint-plugin-react-hooks'
4+
importreactRefreshfrom'eslint-plugin-react-refresh'
5+
importglobalsfrom'globals'
6+
importtseslintfrom'typescript-eslint'
7+
8+
// Copy from https://github.com/hyparam/hyperparam-cli/blob/87b516bbcaadc0ffacb9914c4ba7a8d827e65469/shared.eslint.config.js
9+
constsharedJsRules={
10+
'arrow-spacing':'error',
11+
camelcase:'off',
12+
'comma-spacing':'error',
13+
'comma-dangle':['error','always-multiline'],
14+
'eol-last':'error',
15+
eqeqeq:'error',
16+
'func-style':['error','declaration'],
17+
indent:['error',2],
18+
'no-constant-condition':'off',
19+
'no-extra-parens':'error',
20+
'no-multi-spaces':'error',
21+
'no-trailing-spaces':'error',
22+
'no-unused-vars':'off',
23+
'no-useless-concat':'error',
24+
'no-useless-rename':'error',
25+
'no-useless-return':'error',
26+
'no-var':'error',
27+
'object-curly-spacing':['error','always'],
28+
'prefer-const':'warn',
29+
'prefer-destructuring':['warn',{
30+
object:true,
31+
array:false,
32+
}],
33+
'prefer-promise-reject-errors':'error',
34+
quotes:['error','single'],
35+
'require-await':'warn',
36+
semi:['error','never'],
37+
38+
'sort-imports':['error',{
39+
ignoreDeclarationSort:true,
40+
ignoreMemberSort:false,
41+
memberSyntaxSortOrder:['none','all','multiple','single'],
42+
}],
43+
44+
'space-infix-ops':'error',
45+
}
46+
constsharedTsRules={
47+
'@typescript-eslint/restrict-template-expressions':'off',
48+
'@typescript-eslint/no-unused-vars':'warn',
49+
}
50+
51+
exportdefaulttseslint.config(
52+
{ignores:['dist','coverage']},
53+
{
54+
extends:[js.configs.recommended, ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked],
55+
// Set the react version
56+
settings:{react:{version:'18.3'}},
57+
files:['{test,src}/**/*.{ts,tsx}'],
58+
languageOptions:{
59+
ecmaVersion:2023,
60+
globals:globals.browser,
61+
parserOptions:{
62+
project:'./tsconfig.json',
63+
tsconfigRootDir:import.meta.dirname,
64+
},
65+
},
66+
plugins:{
67+
react,
68+
'react-hooks':reactHooks,
69+
'react-refresh':reactRefresh,
70+
},
71+
rules:{
72+
...react.configs.recommended.rules,
73+
...react.configs['jsx-runtime'].rules,
74+
...reactHooks.configs.recommended.rules,
75+
'react-refresh/only-export-components':[
76+
'warn',
77+
{allowConstantExport:true},
78+
],
79+
...js.configs.recommended.rules,
80+
...tseslint.configs.recommended.rules,
81+
...sharedJsRules,
82+
...sharedTsRules,
83+
},
84+
},
85+
)

‎index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<htmllang="en">
3+
<head>
4+
<metacharset="UTF-8">
5+
<title>Hyperparam Parquet Viewer</title>
6+
<linkrel="stylesheet"href="https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"/>
7+
<metaname="description"content="hyperparam is the missing UI for machine learning"/>
8+
<linkhref="/favicon.png"rel="icon"/>
9+
<linkrel="icon"type="image/svg+xml"href="/logo.svg"/>
10+
<metaname="theme-color"content="#6b00ff">
11+
<metaname="viewport"content="width=device-width, initial-scale=1.0"/>
12+
</head>
13+
<body>
14+
<divid="app"></div>
15+
<scripttype="module"src="/src/main.tsx"></script>
16+
</body>
17+
</html>

‎package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name":"parquet-viewer",
3+
"private":true,
4+
"version":"0.0.0",
5+
"license":"MIT",
6+
"type":"module",
7+
"scripts": {
8+
"coverage":"vitest run --coverage --coverage.include=src",
9+
"dev":"vite",
10+
"build":"tsc -b && vite build",
11+
"lint":"eslint .",
12+
"preview":"vite preview",
13+
"test":"vitest"
14+
},
15+
"dependencies": {
16+
"@huggingface/hub":"0.21.0",
17+
"@hyparam/components":"0.1.10",
18+
"react":"18.3.1",
19+
"react-dom":"18.3.1"
20+
},
21+
"devDependencies": {
22+
"@eslint/js":"9.16.0",
23+
"@types/react":"18.3.12",
24+
"@types/react-dom":"18.3.1",
25+
"@vitejs/plugin-react":"4.3.4",
26+
"@vitest/coverage-v8":"2.1.8",
27+
"eslint":"9.16.0",
28+
"eslint-plugin-react":"7.37.2",
29+
"eslint-plugin-react-hooks":"5.0.0",
30+
"eslint-plugin-react-refresh":"0.4.16",
31+
"globals":"15.13.0",
32+
"typescript":"5.7.2",
33+
"typescript-eslint":"8.17.0",
34+
"vite":"5.4.11",
35+
"vitest":"2.1.8"
36+
}
37+
}

‎public/audio.svg

Lines changed: 3 additions & 0 deletions
Loading

‎public/favicon.png

1.04 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp