# @idlizer/ui2abc

CLI wrapper for UI2ABC compiler (UI to ArkTS Bytecode).

## Installation

```bash
npm install @idlizer/ui2abc
```

The package is fully self-contained and includes all necessary compiler artifacts, Panda SDK, and OHOS SDK headers. No external dependencies required.

## Usage

```bash
ui2abc [options] [file]
```

See `ui2abc --help` for full usage.

## Development

This package is part of the Koala monorepo. To build a self-contained distribution:

```bash
cd sdk
npm run assemble
```

The `assemble` script will:

1. Prepare OHOS SDK headers (runs `npm run sdk:all` in root) – *enabled*
2. Copy absolute SDK from `absolute-sdk-patched` to `dest/ohos_sdk` and create compatibility symlink `dest/absolute-sdk-patched`
3. Compile fast-arktsc (required for building other components)
4. Compile libarkts, ui-plugins-ng, memo-plugin-ng
5. Copy compiled artifacts into `dest/`
6. Copy Panda SDK packages into `dest/panda-sdk` (fully self-contained, no external dependency on `@panda/sdk`)
7. Compile arkoala-arkts framework for headless execution
8. Copy arkoala-arkts build folder (only build directory needed)
9. Compile incremental harness (legacy, needed for tests)

**Note:** The SDK copy ensures the package is fully self-contained. The check script uses the copied SDK from `dest/`.

After assembly, the package becomes self‑contained and can be published or archived.

## Testing

To verify the assembled compiler works, run the check script:

```bash
npm run check
```

This will compile the trivial test application in `tests/trivial/` using the assembled artifacts.

**Note:** The check requires OHOS SDK headers. If the SDK is not prepared, the check will skip compilation with a warning. Enable `sdk:all` in the assemble script first.

## License

Apache 2.0