Skip to content

Commit c08cb19

Browse files
committed
simplify vite config
1 parent 6c8250f commit c08cb19

File tree

13 files changed

+35
-61
lines changed

13 files changed

+35
-61
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ package-lock.json
3030
*.parquet
3131
/coverage/
3232

33-
/es
33+
/lib

demo/demo.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

demo/index.html renamed to index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>hyperparam</title>
6-
<link rel="stylesheet" href="./styles.css">
76
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Mulish:wght@400;600&display=swap"/>
87
<link href="favicon.png" rel="icon" />
98
<meta name="description" content="demo for the Hyperparam components" />
109
<meta name="theme-color" content="#6b00ff">
1110
<meta name="viewport" content="width=device-width, initial-scale=1" />
1211
</head>
1312
<body>
14-
<div id="app"></div>
15-
<script type="module" src="./demo.ts"></script>
13+
<div id="root"></div>
14+
<script type="module" src="./src/demo.tsx"></script>
1615
</body>
1716
</html>

package.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,27 @@
1515
"directory": "packages/components"
1616
},
1717
"type": "module",
18-
"main": "dist/index.umd.min.js",
19-
"unpkg": "dist/index.umd.min.js",
20-
"module": "dist/index.es.min.js",
21-
"types": "es/index.d.ts",
18+
"types": "lib/index.d.ts",
2219
"exports": {
2320
".": {
24-
"types": "./es/index.d.ts",
25-
"import": "./dist/index.es.min.js",
26-
"require": "./dist/index.umd.min.js"
21+
"types": "./lib/index.d.ts",
22+
"import": "./dist/index.min.js"
2723
},
2824
"./components.css": "./dist/components.css"
2925
},
3026
"files": [
3127
"dist",
32-
"es"
28+
"lib"
3329
],
3430
"scripts": {
35-
"build": "tsc && vite build",
31+
"build": "tsc -b && vite build",
3632
"coverage": "vitest run --coverage --coverage.include=src",
37-
"dev": "vite ./demo",
33+
"dev": "vite",
3834
"lint": "eslint .",
39-
"prepare": "npm run build",
35+
"prepublishOnly": "npm run build",
4036
"test": "vitest run",
41-
"typecheck": "tsc"
37+
"typecheck": "tsc --noEmit",
38+
"preview": "vite preview"
4239
},
4340
"dependencies": {
4441
"hightable": "0.11.0",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

demo/App.tsx renamed to src/components/DemoApp.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import 'hightable/src/HighTable.css'
2-
import React from 'react'
3-
import { Page } from '../src/index.js'
4-
5-
import { getHttpSource } from '../src/index.ts'
1+
import { getHttpSource } from '../lib/sources/httpSource.js'
2+
import Page from './Page.js'
63
export interface Navigation {
74
col?: number
85
row?: number

src/demo.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import 'hightable/src/HighTable.css'
2+
import { StrictMode } from 'react'
3+
import { createRoot } from 'react-dom/client'
4+
import DemoApp from './components/DemoApp.js'
5+
import './styles/demo.css'
6+
7+
const root = document.getElementById('root')
8+
if (!root) throw new Error('missing root element')
9+
createRoot(root).render(
10+
<StrictMode>
11+
<DemoApp />
12+
</StrictMode>,
13+
)

0 commit comments

Comments
 (0)