Skip to content

Commit

Permalink
Move to components folder
Browse files Browse the repository at this point in the history
  • Loading branch information
platypii committed Jun 8, 2024
1 parent 4c5a225 commit dac22b3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "rollup -c",
"lint": "eslint src",
"serve": "node src/cli.js",
"url": "node src/cli.js https://huggingface.co/datasets/codeparrot/github-code/resolve/main/data/train-00000-of-01126.parquet?download=true",
"url": "node src/cli.js https://hyperparam.blob.core.windows.net/hyperparam/starcoderdata-js-00000-of-00065.parquet",
"test": "vitest run"
},
"devDependencies": {
Expand All @@ -27,9 +27,9 @@
"@typescript-eslint/eslint-plugin": "7.12.0",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "48.2.8",
"eslint-plugin-jsdoc": "48.2.9",
"hightable": "0.2.1",
"hyparquet": "0.9.8",
"hyparquet": "0.9.9",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-monaco-editor": "0.55.0",
Expand Down
10 changes: 5 additions & 5 deletions public/build/render.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Cell.tsx → src/components/Cell.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { stringify } from 'hightable'
import React, { useEffect, useState } from 'react'
import MonacoEditor from 'react-monaco-editor'
import { parquetDataFrame } from '../tableProvider.js'
import Layout from './Layout.js'
import { parquetDataFrame } from './tableProvider.js'
import 'monaco-editor/esm/vs/basic-languages/javascript/javascript'

enum LoadingState {
Expand Down
2 changes: 1 addition & 1 deletion src/File.tsx → src/components/File.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import HighTable, { DataFrame } from 'hightable'
import React, { useEffect, useState } from 'react'
import { parquetDataFrame } from '../tableProvider.js'
import Layout, { Spinner } from './Layout.js'
import { parquetDataFrame } from './tableProvider.js'

/**
* File viewer page
Expand Down
2 changes: 1 addition & 1 deletion src/Folder.tsx → src/components/Folder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from 'react'
import { FileMetadata, getFileDate, getFileDateShort, getFileSize, listFiles } from './files.js'
import { FileMetadata, getFileDate, getFileDateShort, getFileSize, listFiles } from '../files.js'
import Layout, { Spinner, cn } from './Layout.js'

/**
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Url.tsx → src/components/Url.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import HighTable, { DataFrame } from 'hightable'
import React, { useEffect, useState } from 'react'
import { parquetDataFrame } from '../tableProvider.js'
import Layout, { Spinner } from './Layout.js'
import { parquetDataFrame } from './tableProvider.js'

/**
* Url viewer page
Expand Down
16 changes: 8 additions & 8 deletions src/render.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import ReactDOM from 'react-dom'
import Cell from './Cell.js'
import File from './File.js'
import Folder from './Folder.js'
import Url from './Url.js'
import Cell from './components/Cell.js'
import File from './components/File.js'
import Folder from './components/Folder.js'
import Url from './components/Url.js'

function render() {
const app = document.getElementById('app')
Expand All @@ -13,16 +13,16 @@ function render() {
// @ts-expect-error TODO: fix react createRoot type
const root = ReactDOM.createRoot(app)
if (location.pathname.endsWith('/')) {
// Render folder view
// folder view
root.render(React.createElement(Folder))
} else if (location.pathname.startsWith('/url/')) {
// Render url view
// url view
root.render(React.createElement(Url))
} else if (location.search) {
// Render cell view
// local cell view
root.render(React.createElement(Cell))
} else {
// Render file view
// local file view
root.render(React.createElement(File))
}

Expand Down

0 comments on commit dac22b3

Please sign in to comment.