-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ccf588
commit 7bcd8d2
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |