Metadata-Version: 2.5
Name: lucent-pack
Version: 0.1.0
Summary: Pack a Shiny app and a WebAssembly R environment into a static Lucent site
Project-URL: Homepage, https://github.com/IsabelParedes/lucent-pack
Project-URL: Repository, https://github.com/IsabelParedes/lucent-pack
Author: Isabel Paredes
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: emscripten,lucent,r,shiny,wasm
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.10
Requires-Dist: empack<7,>=6
Description-Content-Type: text/markdown

# Lucent-Pack

Pack a Shiny app and a WebAssembly R environment into a static site.

## Installation

```bash
pip install lucent-pack
# OR
micromamba install lucent-pack
```

## Usage

1. Create a wasm environment with your favorite package manager.

```bash
micromamba create -f environment.yaml --platform=emscripten-wasm32
```

```yaml
# Sample environment.yaml
name: shinyapp-env
channels:
- https://repo.prefix.dev/emscripten-forge-4x
- conda-forge
dependencies:
# Minimum requirements
- r-main
- r-shiny
# Any additional packages required for the app
- r-bslib
- r-plotly
```

2. Build the site.

```bash
lucent build --prefix-dir /path/to/wasm/env/ --app /path/to/app --outdir ./_site
```

3. Check results.
```bash
lucent serve ./_site # the output directory
```

## Development

Requirements:
- python
- pip
- nodejs

```bash
pip install -e .

# Browser runtime — required before `python -m build` (wheel)
cd js && npm ci && npm run build
mkdir -p ../src/lucent_pack/static/lucent/dist
cp -a dist/. ../src/lucent_pack/static/lucent/dist/
```

The hatch wheel hook fails the build if the bundles (`src/lucent_pack/static/lucent/dist/`) are missing.

## CLI

| Command | Purpose |
|---------|---------|
| `lucent build` | Pack an existing `--prefix-dir` + `--app` into `--outdir` |
| `lucent serve` | Serve a built site directory (`python -m http.server` style) |
