# Lux Package Registry The official package registry for Lux packages. ## Using Packages Add packages to your project: ```bash # From this registry (when LUX_REGISTRY_URL is set) lux pkg add json 1.0.0 # From git lux pkg add mylib --git https://github.com/user/mylib # From local path lux pkg add locallib --path ../mylib ``` ## Package Index | Package | Version | Description | |---------|---------|-------------| | [json](./packages/json/) | 1.0.0 | JSON parsing and serialization | | [http-client](./packages/http-client/) | 0.1.0 | HTTP client utilities | | [testing](./packages/testing/) | 0.1.0 | Testing utilities and assertions | ## Publishing Packages 1. Create a `lux.toml` in your package: ```toml [project] name = "my-package" version = "1.0.0" description = "A useful Lux package" authors = ["Your Name "] license = "MIT" [dependencies] # Your dependencies here ``` 2. Ensure you have a `lib.lux` entry point: ```lux // lib.lux pub fn myFunction(x: Int): Int = x * 2 ``` 3. Submit via pull request or use the registry API: ```bash lux pkg publish ``` ## Package Structure Packages must have: ``` my-package/ ├── lux.toml # Package manifest ├── lib.lux # Entry point (or src/lib.lux) ├── README.md # Documentation └── src/ # Optional: additional source files ``` ## Running the Registry Server ```bash # Start the registry server lux registry -s ./data -b 0.0.0.0:8080 # Or with environment variables LUX_REGISTRY_STORAGE=./data lux registry ``` ## API Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/api/v1/packages` | List all packages | | GET | `/api/v1/packages/:name` | Get package info | | GET | `/api/v1/packages/:name/:version` | Get version metadata | | GET | `/api/v1/download/:name/:version` | Download package tarball | | GET | `/api/v1/search?q=query` | Search packages | | POST | `/api/v1/publish` | Publish a package | ## Contributing 1. Fork this repository 2. Add your package to `packages/` 3. Update the index in this README 4. Submit a pull request ## License Packages in this registry are licensed under their respective licenses. The registry infrastructure is MIT licensed.