Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshinotsuyoshi committed Nov 8, 2024
1 parent 2ccf588 commit 7bcd8d2
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions frontend/packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
# @liam/cli

`liam-cli` is a command-line tool designed to generate a web application that displays ER diagrams.

```bash
$ liam-cli build --input {your .sql}
# Outputs the web application to the ./public and ./dist directories

$ liam-cli preview
# Launches the web application for preview
```

## Building and Installing the Standalone CLI for Development

To build the CLI for development purposes, run:

```bash
pnpm run build:cli
# The executable will be output to dist-cli/bin/cli.js.
```

After building, you can invoke it locally with:

```bash
node ./dist-cli/bin/cli.js build --input ./fixtures/input.sql
```

To make it globally accessible as `liam-cli`, use:

```bash
pnpm link --global
```

## Explanation of npm Scripts for Development

### Commands

1. **Build**
```bash
pnpm run build
```
- Internally, `./fixtures/input.sql` is passed as the `build --input` argument.
- Runs Vite's build process.

2. **Dev**
```bash
pnpm run dev
```
- Internally, `./fixtures/input.sql` is passed as the `dev --input` argument.
- Starts the Vite development server.

3. **Preview**
```bash
pnpm run preview
```
- Previews the production build using Vite's built-in preview functionality.

## File Structure

- **bin/cli.ts**: The main CLI script.
- **fixtures/input.sql**: A sample `.sql` file for testing purposes.
- **src/**: The web application that displays ER diagrams.

0 comments on commit 7bcd8d2

Please sign in to comment.