# miso Scaffolding

`miso` is a CLI tool designed for Salesforce LWC (Lightning Web Components) development, integrating modern frontend technologies like React and Vite to help developers quickly initialize, develop, and build LWC projects.

## Installation

It is recommended to install globally using pnpm, npm, or yarn:

```bash
npm install -g @sugerio/miso-cli
# or
pnpm add -g @sugerio/miso-cli
# or
yarn global add @sugerio/miso-cli
```

## Quick Start

1. Initialize miso configuration in your Salesforce project root directory:

   ```bash
   miso init
   ```

   - This will generate a `.miso` directory and a `miso.config.mjs` configuration file.
   - You can customize the React sub-application directory name.

2. Log in to Salesforce:

   ```bash
   miso login [alias]
   ```

   - The `alias` parameter specifies the organization alias.

3. Start the development server:

   ```bash
   miso dev
   ```

   - Launches a local development environment with hot reloading.

4. Build for production:

   ```bash
   miso build
   ```

   - Outputs the build artifacts to the `force-app/main/default/lwc` directory.

## Supported Commands

- `miso init`  
  Initializes miso configuration and template files, with support for overwriting existing configurations.

- `miso login [alias]`  
  Logs in to a Salesforce organization and saves session information.

- `miso dev`  
  Starts a local development server, automatically proxying the `/aura` interface.

- `miso build`  
  Builds production-ready code, outputting to the Salesforce LWC directory.

## Directory Structure After Initialization

```
.miso/
  ├── index.html
  ├── App.tsx
  ├── main.tsx
  ├── eslint.config.js
  ├── public/
  └── components/
miso.config.mjs
```

## Dependencies

- Node.js 16+
- Vite
- React
- Salesforce CLI (recommended)

## Development Recommendations

- It is recommended to use alongside the official Salesforce CLI tools.
- Supports TypeScript; see `tsconfig.json` for type configurations.
- You can customize the template content in the `.miso` directory according to your needs.

---

If you need badges, contribution guidelines, FAQs, or any other additions, please let me know! 