Static site generator utilities extracted from blu-site, providing reusable post/tag types, content reading, date sorting, and file I/O. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
108 lines
2.7 KiB
Markdown
108 lines
2.7 KiB
Markdown
# 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 |
|
|
| [markdown](./packages/markdown/) | 0.1.0 | Markdown to HTML converter |
|
|
| [frontmatter](./packages/frontmatter/) | 0.1.0 | YAML-like frontmatter parser |
|
|
| [path](./packages/path/) | 0.1.0 | File path utilities |
|
|
| [xml](./packages/xml/) | 0.1.0 | XML builder |
|
|
| [rss](./packages/rss/) | 0.1.0 | RSS 2.0 feed generator |
|
|
| [web](./packages/web/) | 0.1.0 | Full-stack web framework |
|
|
| [ssg](./packages/ssg/) | 0.1.0 | Static site generator utilities |
|
|
|
|
## 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 <you@example.com>"]
|
|
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.
|