Skip to content

Commit 0d43e36

Browse files
authored
prepare the contents of the npm package (#34)
* prepare the contents of the npm package tsc populates the new es/ directory with transpiled files (ts/tsx -> js + d.ts) vite generates minified bundled files (es and umd) in dist/, with their source maps package.json should point to the appropriate files in the npm package. Contents of the npm package > npm publish --dry-run > @hyparam/components@0.1.0 prepublishOnly > npm run build > @hyparam/components@0.1.0 build > tsc && vite build vite v5.4.10 building for production... ✓ 42 modules transformed. dist/index.es.min.js 236.69 kB │ gzip: 123.91 kB │ map: 126.18 kB dist/index.umd.min.js 225.15 kB │ gzip: 122.52 kB │ map: 122.83 kB ✓ built in 747ms npm notice npm notice 📦 @hyparam/components@0.1.0 npm notice Tarball Contents npm notice 1.0kB LICENSE npm notice 101B README.md npm notice 408.4kB dist/assets/parquetWorker-zWrM-10F.js.map npm notice 236.7kB dist/index.es.min.js npm notice 126.2kB dist/index.es.min.js.map npm notice 225.2kB dist/index.umd.min.js npm notice 122.8kB dist/index.umd.min.js.map npm notice 72B es/components/App.d.ts npm notice 142B es/components/App.js npm notice 265B es/components/Breadcrumb.d.ts npm notice 989B es/components/Breadcrumb.js npm notice 322B es/components/Cell.d.ts npm notice 3.5kB es/components/Cell.js npm notice 242B es/components/File.d.ts npm notice 607B es/components/File.js npm notice 243B es/components/Folder.d.ts npm notice 2.3kB es/components/Folder.js npm notice 416B es/components/index.d.ts npm notice 416B es/components/index.js npm notice 824B es/components/Layout.d.ts npm notice 1.6kB es/components/Layout.js npm notice 197B es/components/Markdown.d.ts npm notice 3.7kB es/components/Markdown.js npm notice 73B es/components/Page.d.ts npm notice 873B es/components/Page.js npm notice 428B es/components/Viewer.d.ts npm notice 1.0kB es/components/Viewer.js npm notice 416B es/components/viewers/ContentHeader.d.ts npm notice 456B es/components/viewers/ContentHeader.js npm notice 321B es/components/viewers/ImageView.d.ts npm notice 2.8kB es/components/viewers/ImageView.js npm notice 290B es/components/viewers/index.d.ts npm notice 290B es/components/viewers/index.js npm notice 327B es/components/viewers/MarkdownView.d.ts npm notice 2.1kB es/components/viewers/MarkdownView.js npm notice 389B es/components/viewers/ParquetView.d.ts npm notice 3.0kB es/components/viewers/ParquetView.js npm notice 376B es/components/viewers/TextView.d.ts npm notice 2.4kB es/components/viewers/TextView.js npm notice 1.7kB es/lib/files.d.ts npm notice 2.7kB es/lib/files.js npm notice 432B es/lib/key.d.ts npm notice 698B es/lib/key.js npm notice 301B es/lib/tableProvider.d.ts npm notice 4.2kB es/lib/tableProvider.js npm notice 125B es/lib/utils.d.ts npm notice 125B es/lib/utils.js npm notice 11B es/workers/parquetWorker.d.ts npm notice 2.7kB es/workers/parquetWorker.js npm notice 641B es/workers/parquetWorkerClient.d.ts npm notice 2.8kB es/workers/parquetWorkerClient.js npm notice 1.9kB package.json npm notice Tarball Details npm notice name: @hyparam/components npm notice version: 0.1.0 npm notice filename: hyparam-components-0.1.0.tgz npm notice package size: 472.3 kB npm notice unpacked size: 1.2 MB npm notice shasum: 41eba030a842e4fc1b13f8990d5accba4d1cf431 npm notice integrity: sha512-89CuWNs2a/I8z[...]4Jk4kJmwUb8lA== npm notice total files: 52 npm notice npm warn This command requires you to be logged in to https://registry.npmjs.org/ (dry-run) npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run) + @hyparam/components@0.1.0 * remove aliases
1 parent d1c467b commit 0d43e36

File tree

20 files changed

+82
-76
lines changed

20 files changed

+82
-76
lines changed

packages/components/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ package-lock.json
2929
.vscode
3030
*.parquet
3131
/coverage/
32+
33+
/es

packages/components/package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,23 @@
1515
"directory": "packages/components"
1616
},
1717
"type": "module",
18-
"main": "dist/index.umd.js",
19-
"module": "dist/index.es.js",
18+
"main": "dist/index.umd.min.js",
19+
"unpkg": "dist/index.umd.min.js",
20+
"module": "dist/index.es.min.js",
21+
"types": "es/components/index.d.ts",
2022
"exports": {
2123
".": {
22-
"import": "./dist/index.es.js",
23-
"require": "./dist/index.umd.js",
24-
"types": "./dist/components/index.d.ts"
25-
}
24+
"import": "./es/components/index.js",
25+
"require": "./dist/index.umd.min.js",
26+
"types": "./es/components/index.d.ts"
27+
},
28+
"./components/*": "./es/components/*.js",
29+
"./lib/*": "./es/lib/*.js",
30+
"./workers/*": "./es/workers/*.js"
2631
},
27-
"types": "dist/components/index.d.ts",
2832
"files": [
29-
"dist"
33+
"dist",
34+
"es"
3035
],
3136
"scripts": {
3237
"build": "tsc && vite build",
@@ -61,7 +66,6 @@
6166
"typescript": "5.6.3",
6267
"typescript-eslint": "8.13.0",
6368
"vite": "5.4.10",
64-
"vite-plugin-dts": "4.3.0",
6569
"vitest": "2.1.4"
6670
}
6771
}

packages/components/src/components/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Page from './Page.tsx'
1+
import Page from './Page.js'
22

33
export default function App() {
44
return (

packages/components/src/components/Breadcrumb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FileKey, UrlKey } from '../lib/key.ts'
1+
import { FileKey, UrlKey } from '../lib/key.js'
22

33
interface BreadcrumbProps {
44
parsedKey: UrlKey | FileKey

packages/components/src/components/Cell.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { asyncRows } from 'hightable'
22
import { asyncBufferFromUrl, parquetMetadataAsync } from 'hyparquet'
33
import { useEffect, useState } from 'react'
4-
import { FileKey, UrlKey } from '../lib/key.ts'
4+
import { FileKey, UrlKey } from '../lib/key.js'
55
import { parquetDataFrame } from '../lib/tableProvider.js'
6-
import Breadcrumb from './Breadcrumb.tsx'
7-
import Layout from './Layout.tsx'
6+
import Breadcrumb from './Breadcrumb.js'
7+
import Layout from './Layout.js'
88

99
interface CellProps {
1010
parsedKey: FileKey | UrlKey;

packages/components/src/components/File.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useState } from 'react'
2-
import { FileKey, UrlKey } from '../lib/key.ts'
3-
import Breadcrumb from './Breadcrumb.tsx'
4-
import Layout from './Layout.tsx'
5-
import Viewer from './Viewer.tsx'
2+
import { FileKey, UrlKey } from '../lib/key.js'
3+
import Breadcrumb from './Breadcrumb.js'
4+
import Layout from './Layout.js'
5+
import Viewer from './Viewer.js'
66

77
interface FileProps {
88
parsedKey: UrlKey | FileKey

packages/components/src/components/Folder.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useCallback, useEffect, useRef, useState } from 'react'
2-
import { FileMetadata, getFileDate, getFileDateShort, getFileSize, listFiles } from '../lib/files.ts'
3-
import type { FolderKey } from '../lib/key.ts'
4-
import { cn } from '../lib/utils.ts'
5-
import Layout, { Spinner } from './Layout.tsx'
2+
import { FileMetadata, getFileDate, getFileDateShort, getFileSize, listFiles } from '../lib/files.js'
3+
import type { FolderKey } from '../lib/key.js'
4+
import { cn } from '../lib/utils.js'
5+
import Layout, { Spinner } from './Layout.js'
66

77
interface FolderProps {
88
folderKey: FolderKey

packages/components/src/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactNode, useEffect } from 'react'
2-
import { cn } from '../lib/utils.ts'
2+
import { cn } from '../lib/utils.js'
33

44
interface LayoutProps {
55
children: ReactNode

packages/components/src/components/Page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { parseKey } from '../lib/key.ts'
2-
import Cell from './Cell.tsx'
3-
import File from './File.tsx'
4-
import Folder from './Folder.tsx'
1+
import { parseKey } from '../lib/key.js'
2+
import Cell from './Cell.js'
3+
import File from './File.js'
4+
import Folder from './Folder.js'
55

66
export default function Page() {
77
const search = new URLSearchParams(location.search)

packages/components/src/components/Viewer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { imageTypes } from '../lib/files.ts'
2-
import { FileKey, UrlKey } from '../lib/key.ts'
3-
import ImageView from './viewers/ImageView.tsx'
4-
import MarkdownView from './viewers/MarkdownView.tsx'
5-
import TableView from './viewers/ParquetView.tsx'
6-
import TextView from './viewers/TextView.tsx'
1+
import { imageTypes } from '../lib/files.js'
2+
import { FileKey, UrlKey } from '../lib/key.js'
3+
import ImageView from './viewers/ImageView.js'
4+
import MarkdownView from './viewers/MarkdownView.js'
5+
import TableView from './viewers/ParquetView.js'
6+
import TextView from './viewers/TextView.js'
77

88
interface ViewerProps {
99
parsedKey: FileKey | UrlKey;

0 commit comments

Comments
 (0)