Skip to content

Commit a5ded07

Browse files
committed
rename Hyparam to Hyperparam
1 parent fe55a9b commit a5ded07

File tree

10 files changed

+24
-32
lines changed

10 files changed

+24
-32
lines changed

.github/workflows/deploy_pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
- name: Move the build outputs to a folder
3030
run: |
3131
mkdir -p build_outputs_folder/apps
32-
echo "<h1 id="hyparam">Hyparam</h1>" > build_outputs_folder/index.html
32+
echo "<h1 id="hyparam">Hyperparam</h1>" > build_outputs_folder/index.html
3333
echo "<ul>" >> build_outputs_folder/index.html
3434
echo "<li><a href="./apps/hyparquet-demo">hyparquet demo</a></li>" >> build_outputs_folder/index.html
3535
echo "<li><a href="./apps/hightable-demo">hightable demo</a></li>" >> build_outputs_folder/index.html
3636
echo "</ul>" >> build_outputs_folder/index.html
37-
echo "<h1 id="hyparam">Hyparam</h1>" > build_outputs_folder/apps/index.html
37+
echo "<h1 id="hyparam">Hyperparam</h1>" > build_outputs_folder/apps/index.html
3838
echo "<ul>" >> build_outputs_folder/apps/index.html
3939
echo "<li><a href="./hyparquet-demo">hyparquet demo</a></li>" >> build_outputs_folder/apps/index.html
4040
echo "<li><a href="./hightable-demo">hightable demo</a></li>" >> build_outputs_folder/apps/index.html

packages/components/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link rel="stylesheet" href="./HighTable.css">
88
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"/>
99
<link href="favicon.png" rel="icon" />
10-
<meta name="description" content="demo for the Hyparam components" />
10+
<meta name="description" content="demo for the Hyperparam components" />
1111
<meta name="theme-color" content="#6b00ff">
1212
<meta name="viewport" content="width=device-width, initial-scale=1" />
1313
</head>

packages/components/src/lib/filesystem.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ export class HttpFileSystem extends FileSystem {
115115
}
116116
}
117117

118-
export interface HyparamFileMetadata {
118+
export interface HyperparamFileMetadata {
119119
key: string
120120
eTag?: string
121121
fileSize?: number
122122
lastModified: string
123123
}
124124

125-
export class HyparamFileSystem extends FileSystem {
125+
export class HyperparamFileSystem extends FileSystem {
126126
fsId = 'hyparam' as const
127127
endpoint: string
128128
constructor({ endpoint }: {endpoint: string}) {
@@ -164,12 +164,12 @@ export class HyparamFileSystem extends FileSystem {
164164
}),
165165
]
166166
}
167-
async _fetchFilesList(prefix: string): Promise<HyparamFileMetadata[]> {
167+
async _fetchFilesList(prefix: string): Promise<HyperparamFileMetadata[]> {
168168
const url = new URL('/api/store/list', this.endpoint)
169169
url.searchParams.append('prefix', encodeURIComponent(prefix))
170170
const res = await fetch(url)
171171
if (res.ok) {
172-
return await res.json() as HyparamFileMetadata[]
172+
return await res.json() as HyperparamFileMetadata[]
173173
} else {
174174
throw new Error(await res.text())
175175
}
@@ -186,12 +186,3 @@ export class HyparamFileSystem extends FileSystem {
186186
}))
187187
}
188188
}
189-
190-
191-
192-
193-
// TODO
194-
// add tests
195-
// select the class by looping until one of the classes can parse the URL
196-
// pass the Url to the components
197-
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
export { DirSource, FileSource, FileSystem, HttpFileSystem, HyparamFileSystem, Source } from './filesystem.js'
1+
export { DirSource, FileSource, FileSystem, HttpFileSystem, HyperparamFileSystem, Source } from './filesystem.js'
22
export type { FileKind, FileMetadata, SourcePart } from './filesystem.js'
33
export { appendSearchParams, replaceSearchParams } from './routes.js'
44
export type { RoutesConfig } from './routes.js'
55
export { parquetDataFrame } from './tableProvider.js'
66
export { asyncBufferFrom, cn, contentTypes, formatFileSize, getFileDate, getFileDateShort, getFileName, imageTypes, parseFileSize } from './utils.js'
77
export { parquetQueryWorker } from './workers/parquetWorkerClient.js'
88
export type { AsyncBufferFrom, Row } from './workers/types.js'
9+

packages/components/test/components/File.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { strict as assert } from 'assert'
33
import React, { act } from 'react'
44
import { describe, expect, it, vi } from 'vitest'
55
import File from '../../src/components/File.js'
6-
import { HttpFileSystem, HyparamFileSystem } from '../../src/lib/filesystem.js'
6+
import { HttpFileSystem, HyperparamFileSystem } from '../../src/lib/filesystem.js'
77
import { RoutesConfig } from '../../src/lib/routes.js'
88

9-
const hyparamFileSystem = new HyparamFileSystem({ endpoint: 'http://localhost:3000' })
9+
const hyparamFileSystem = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' })
1010
const httpFileSystem = new HttpFileSystem()
1111

1212

packages/components/test/components/Folder.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { strict as assert } from 'assert'
33
import React from 'react'
44
import { describe, expect, it, vi } from 'vitest'
55
import Folder from '../../src/components/Folder.js'
6-
import { HyparamFileMetadata, HyparamFileSystem } from '../../src/lib/filesystem.js'
6+
import { HyperparamFileMetadata, HyperparamFileSystem } from '../../src/lib/filesystem.js'
77
import { RoutesConfig } from '../../src/lib/routes.js'
88

9-
const hyparamFileSystem = new HyparamFileSystem({ endpoint: 'http://localhost:3000' })
9+
const hyparamFileSystem = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' })
1010
// hyparamFileSystem._fetchFilesList = () => Promise.resolve([
1111
// { key: 'folder1/', lastModified: '2023-01-01T00:00:00Z' },
1212
// { key: 'file1.txt', fileSize: 8196, lastModified: '2023-01-01T00:00:00Z' },
1313
// ])
1414

15-
const mockFiles: HyparamFileMetadata[] = [
15+
const mockFiles: HyperparamFileMetadata[] = [
1616
{ key: 'folder1/', lastModified: '2023-01-01T00:00:00Z' },
1717
{ key: 'file1.txt', fileSize: 8196, lastModified: '2023-01-01T00:00:00Z' },
1818
]

packages/components/test/components/viewers/ImageView.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { strict as assert } from 'assert'
33
import React from 'react'
44
import { describe, expect, it, vi } from 'vitest'
55
import ImageView from '../../../src/components/viewers/ImageView.js'
6-
import { HyparamFileSystem } from '../../../src/lib/filesystem.js'
6+
import { HyperparamFileSystem } from '../../../src/lib/filesystem.js'
77

8-
const hyparamFileSystem = new HyparamFileSystem({ endpoint: 'http://localhost:3000' })
8+
const hyparamFileSystem = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' })
99

1010
global.fetch = vi.fn()
1111

packages/components/test/components/viewers/MarkdownView.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { strict as assert } from 'assert'
33
import React from 'react'
44
import { describe, expect, it, vi } from 'vitest'
55
import MarkdownView from '../../../src/components/viewers/MarkdownView.js'
6-
import { HyparamFileSystem } from '../../../src/lib/filesystem.js'
6+
import { HyperparamFileSystem } from '../../../src/lib/filesystem.js'
77

8-
const hyparamFileSystem = new HyparamFileSystem({ endpoint: 'http://localhost:3000' })
8+
const hyparamFileSystem = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' })
99

1010
global.fetch = vi.fn()
1111

packages/components/test/lib/filesystem.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { describe, expect, it, test } from 'vitest'
2-
import { HttpFileSystem, HyparamFileSystem } from '../../src/lib/filesystem.js'
2+
import { HttpFileSystem, HyperparamFileSystem } from '../../src/lib/filesystem.js'
33

4-
describe('HyparamFileSystem', () => {
4+
describe('HyperparamFileSystem', () => {
55
test.for([
66
'test.txt',
77
'no-extension',
88
'folder/subfolder/test.txt',
99
])('recognizes a local file path', (key: string) => {
10-
const source = new HyparamFileSystem({ endpoint: 'http://localhost:3000' }).getSource(key)
10+
const source = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' }).getSource(key)
1111
expect(source?.kind).toBe('file')
1212
})
1313

@@ -16,15 +16,15 @@ describe('HyparamFileSystem', () => {
1616
'folder1/',
1717
'folder1/folder2/',
1818
])('recognizes a folder', (key: string) => {
19-
const source = new HyparamFileSystem({ endpoint: 'http://localhost:3000' }).getSource(key)
19+
const source = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' }).getSource(key)
2020
expect(source?.kind).toBe('directory')
2121
})
2222

2323
test.for([
2424
'/',
2525
'////',
2626
])('does not support a heading slash', (key: string) => {
27-
const source = new HyparamFileSystem({ endpoint: 'http://localhost:3000' }).getSource(key)
27+
const source = new HyperparamFileSystem({ endpoint: 'http://localhost:3000' }).getSource(key)
2828
expect(source?.kind).toBeUndefined()
2929
})
3030
})

packages/components/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineConfig({
1212
lib: {
1313
entry: resolve(__dirname, 'src/index.ts'),
1414
formats: ['es', 'umd'],
15-
name: 'HyparamComponents',
15+
name: 'HyperparamComponents',
1616
fileName: (format) => `index.${format}.min.js`,
1717
},
1818
rollupOptions: {

0 commit comments

Comments
 (0)