Skip to content

Commit 94586ab

Browse files
authored
Move to a flat directories structure (#191)
* remove subdirectory viewers/ in components, styles and test * move each component + its CSS module to a subdirectory * move component tests to component subdirectory * fix paths
1 parent 1cfbbd0 commit 94586ab

Some content is hidden

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

62 files changed

+154
-157
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
"scripts": {
3232
"build:types": "tsc -b",
33-
"build:lib": "vite build -c vite.lib.config.ts && cp src/styles/global.css lib/global.css",
33+
"build:lib": "vite build -c vite.lib.config.ts && cp src/assets/global.css lib/global.css",
3434
"build:app": "vite build",
3535
"build": "run-s build:lib build:types build:app",
3636
"coverage": "vitest run --coverage --coverage.include=src --coverage.include=bin",

src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { StrictMode } from 'react'
22
import { createRoot } from 'react-dom/client'
3-
import App from './components/App.js'
4-
import './styles/global.css'
3+
import './assets/global.css'
4+
import App from './components/App/App.js'
55

66
const root = document.getElementById('app')
77
if (!root) throw new Error('missing root element')
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useMemo } from 'react'
2-
import { Config, ConfigProvider } from '../hooks/useConfig.js'
3-
import { getHttpSource } from '../lib/sources/httpSource.js'
4-
import { getHyperparamSource } from '../lib/sources/hyperparamSource.js'
5-
import Page from './Page.js'
2+
import { Config, ConfigProvider } from '../../hooks/useConfig.js'
3+
import { getHttpSource } from '../../lib/sources/httpSource.js'
4+
import { getHyperparamSource } from '../../lib/sources/hyperparamSource.js'
5+
import Page from '../Page/Page.js'
66

77
export default function App() {
88
const search = new URLSearchParams(location.search)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { avroData, avroMetadata } from 'icebird'
22
import { useEffect, useState } from 'react'
33
import type { FileSource } from '../../lib/sources/types.js'
44
import { parseFileSize } from '../../lib/utils.js'
5-
import styles from '../../styles/Json.module.css'
6-
import Json from '../Json.js'
7-
import ContentWrapper, { ContentSize } from './ContentWrapper.js'
5+
import ContentWrapper, { ContentSize } from '../ContentWrapper/ContentWrapper.js'
6+
import Json from '../Json/Json.js'
7+
import styles from '../Json/Json.module.css'
88

99
interface ViewerProps {
1010
source: FileSource
File renamed without changes.

test/components/Breadcrumb.test.tsx renamed to src/components/Breadcrumb/Breadcrumb.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { render } from '@testing-library/react'
22
import { strict as assert } from 'assert'
3-
import React from 'react'
43
import { describe, expect, it } from 'vitest'
5-
import { Config, ConfigProvider } from '../../src/hooks/useConfig.js'
6-
import { Breadcrumb, getHyperparamSource } from '../../src/index.js'
4+
import { Config, ConfigProvider } from '../../hooks/useConfig.js'
5+
import { getHyperparamSource } from '../../lib/sources/hyperparamSource.js'
6+
import Breadcrumb from './Breadcrumb.js'
77

88
const endpoint = 'http://localhost:3000'
99

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { ReactNode } from 'react'
2-
import { useConfig } from '../hooks/useConfig.js'
3-
import type { Source } from '../lib/sources/types.js'
4-
import { cn } from '../lib/utils.js'
5-
import styles from '../styles/Breadcrumb.module.css'
2+
import { useConfig } from '../../hooks/useConfig.js'
3+
import type { Source } from '../../lib/sources/types.js'
4+
import { cn } from '../../lib/utils.js'
5+
import styles from './Breadcrumb.module.css'
66

77
interface BreadcrumbProps {
88
source: Source,
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { stringify } from 'hightable'
22
import { asyncBufferFromUrl, parquetMetadataAsync } from 'hyparquet'
33
import { useEffect, useState } from 'react'
4-
import type { FileSource } from '../lib/sources/types.js'
5-
import { parquetDataFrame } from '../lib/tableProvider.js'
6-
import Breadcrumb from './Breadcrumb.js'
7-
import Layout from './Layout.js'
4+
import type { FileSource } from '../../lib/sources/types.js'
5+
import { parquetDataFrame } from '../../lib/tableProvider.js'
6+
import Breadcrumb from '../Breadcrumb/Breadcrumb.js'
7+
import Layout from '../Layout/Layout.js'
88

99
interface CellProps {
1010
source: FileSource;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DataFrame, stringify } from 'hightable'
22
import { useEffect, useState } from 'react'
3-
import SlideCloseButton from '../SlideCloseButton.js'
4-
import ContentWrapper from './ContentWrapper.js'
3+
import ContentWrapper from '../ContentWrapper/ContentWrapper.js'
4+
import SlideCloseButton from '../SlideCloseButton/SlideCloseButton.js'
55

66
interface ViewerProps {
77
df: DataFrame

0 commit comments

Comments
 (0)