Skip to content

Commit

Permalink
move the app to apps/cli/ (#38)
Browse files Browse the repository at this point in the history
* move the app to apps/cli/

* fix ci

* fix CI

* try to fix the CI
  • Loading branch information
severo authored Nov 12, 2024
1 parent 02d9477 commit 3b159f3
Show file tree
Hide file tree
Showing 27 changed files with 160 additions and 120 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/ci_cli.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: CI
name: CI in the cli app
on:
push:
paths:
- 'packages/components/**'
- 'apps/cli/**'
- '.github/workflows/ci_cli.yml'

defaults:
run:
working-directory: ./apps/cli

jobs:
lint:
Expand All @@ -12,12 +20,16 @@ jobs:

typecheck:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm run build
working-directory: ./packages/components
- run: tsc
working-directory: ./apps/cli

test:
runs-on: ubuntu-latest
Expand All @@ -28,9 +40,13 @@ jobs:

buildcheck:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm run build
working-directory: ./packages/components
- run: npm run build
working-directory: ./apps/cli
74 changes: 6 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,10 @@
# hyperparam
# Hyperparam monorepo

[![npm](https://img.shields.io/npm/v/hyperparam)](https://www.npmjs.com/package/hyperparam)
[![workflow status](https://github.com/hyparam/hyperparam-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/hyparam/hyperparam-cli/actions)
[![mit license](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![coverage](https://img.shields.io/badge/Coverage-35-darkred)
This is a monorepo for the Hyperparam project.

This is the hyperparam cli tool.
It contains the following package:
- [`@hyparam/components`](./packages/components): a library of React components for building Hyperparam UIs.

The hyperparam cli tool is for viewing arbitrarily large datasets in the browser.
It also contains the following application:
- [`hyperparam`](./apps/cli): a cli tool for viewing arbitrarily large datasets in the browser.

## Viewer

To open a file browser in your current local directory run:

```sh
npx hyperparam
```

You can also pass a specific file, folder, or url:

```sh
npx hyperparam example.parquet
npx hyperparam directory/
npx hyperparam https://hyperparam-public.s3.amazonaws.com/bunnies.parquet
```

## Chat

To start a chat with hyperparam:

```sh
npx hyperparam chat
```

## Installation

Install for all users:

```sh
sudo npm i -g hyperparam
```

Now you can just run:

```sh
hyperparam
```

or:

```sh
hyp
```

## Developers

To develop the CLI locally:

```sh
npm i
npm run build
npm run serve
```

When you make changes, make sure to rebuild:

```sh
npm run build
```

Then refresh the browser.
7 changes: 7 additions & 0 deletions apps/cli/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
72 changes: 72 additions & 0 deletions apps/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# hyperparam

[![npm](https://img.shields.io/npm/v/hyperparam)](https://www.npmjs.com/package/hyperparam)
[![workflow status](https://github.com/hyparam/hyperparam-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/hyparam/hyperparam-cli/actions)
[![mit license](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![coverage](https://img.shields.io/badge/Coverage-35-darkred)

This is the hyperparam cli tool.

The hyperparam cli tool is for viewing arbitrarily large datasets in the browser.

## Viewer

To open a file browser in your current local directory run:

```sh
npx hyperparam
```

You can also pass a specific file, folder, or url:

```sh
npx hyperparam example.parquet
npx hyperparam directory/
npx hyperparam https://hyperparam-public.s3.amazonaws.com/bunnies.parquet
```

## Chat

To start a chat with hyperparam:

```sh
npx hyperparam chat
```

## Installation

Install for all users:

```sh
sudo npm i -g hyperparam
```

Now you can just run:

```sh
hyperparam
```

or:

```sh
hyp
```

## Developers

To develop the CLI locally:

```sh
npm i
npm run build
npm run serve
```

When you make changes, make sure to rebuild:

```sh
npm run build
```

Then refresh the browser.
2 changes: 1 addition & 1 deletion eslint.config.js → apps/cli/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import typescript from 'typescript-eslint'

export default [
{
ignores: ['public/build/', 'packages/', 'coverage/'],
ignores: ['public/build/', 'coverage/'],
},
{
plugins: {
Expand Down
52 changes: 52 additions & 0 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "hyperparam",
"version": "0.1.18",
"description": "Hyperparam CLI",
"license": "MIT",
"main": "src/cli.js",
"type": "module",
"bin": {
"hyp": "src/cli.js",
"hyperparam": "src/cli.js"
},
"files": [
"public",
"src"
],
"scripts": {
"build": "rollup -c",
"coverage": "vitest run --coverage --coverage.include=src",
"lint": "eslint",
"serve": "node src/cli.js",
"url": "node src/cli.js https://hyperparam.blob.core.windows.net/hyperparam/starcoderdata-js-00000-of-00065.parquet",
"test": "vitest run --dir test"
},
"dependencies": {
"highlight.js": "11.10.0",
"@hyparam/components": "file:../../packages/components"
},
"devDependencies": {
"@rollup/plugin-commonjs": "28.0.1",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-replace": "6.0.1",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.1",
"@testing-library/react": "16.0.1",
"@types/node": "22.8.4",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.4",
"eslint": "9.13.0",
"globals": "15.11.0",
"jsdom": "25.0.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"rollup": "4.24.3",
"rollup-plugin-postcss": "4.0.2",
"tslib": "2.8.0",
"typescript": "5.6.3",
"typescript-eslint": "8.12.2",
"vitest": "2.1.4"
}
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions apps/cli/public/build/app.min.js.map

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 4 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,10 @@
{
"name": "hyperparam",
"version": "0.1.18",
"description": "Hyperparam CLI",
"name": "hyperparam-monorepo",
"private": true,
"description": "Hyperparam apps and packages",
"license": "MIT",
"main": "src/cli.js",
"type": "module",
"bin": {
"hyp": "src/cli.js",
"hyperparam": "src/cli.js"
},
"files": [
"public",
"src"
],
"scripts": {
"build": "rollup -c",
"coverage": "vitest run --coverage --coverage.include=src",
"lint": "eslint",
"serve": "node src/cli.js",
"url": "node src/cli.js https://hyperparam.blob.core.windows.net/hyperparam/starcoderdata-js-00000-of-00065.parquet",
"test": "vitest run --dir test"
},
"dependencies": {
"highlight.js": "11.10.0",
"@hyparam/components": "file:packages/components"
},
"devDependencies": {
"@rollup/plugin-commonjs": "28.0.1",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-replace": "6.0.1",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.1",
"@testing-library/react": "16.0.1",
"@types/node": "22.8.4",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.4",
"eslint": "9.13.0",
"globals": "15.11.0",
"jsdom": "25.0.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"rollup": "4.24.3",
"rollup-plugin-postcss": "4.0.2",
"tslib": "2.8.0",
"typescript": "5.6.3",
"typescript-eslint": "8.12.2",
"vitest": "2.1.4"
},
"workspaces": [
"apps/cli",
"packages/components"
]
}
1 change: 0 additions & 1 deletion public/build/app.min.js.map

This file was deleted.

0 comments on commit 3b159f3

Please sign in to comment.