Files
pkgs.lux/README.md
Brandon Lucas 3df037cebb feat: initialize Lux package registry
- Add registry README with API documentation
- Add initial packages: json, http-client, testing
- Add package index.json for registry server

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 04:35:00 -05:00

2.2 KiB

Lux Package Registry

The official package registry for Lux packages.

Using Packages

Add packages to your project:

# 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 1.0.0 JSON parsing and serialization
http-client 0.1.0 HTTP client utilities
testing 0.1.0 Testing utilities and assertions

Publishing Packages

  1. Create a lux.toml in your package:
[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
  1. Ensure you have a lib.lux entry point:
// lib.lux
pub fn myFunction(x: Int): Int = x * 2
  1. Submit via pull request or use the registry API:
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

# 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.