nyxa-assets
Vite asset pipeline for Nyxa — dev-server proxying with HMR, manifest
resolution for production builds, a vite()/@vite tag helper, and a
nyxa build hook that runs the frontend build.
Features
AssetsManager(app.assets) —assets.resolve(entry)returns the asset URL:<dev_server>/<entry>in dev, the fingerprinted file from the Vite manifest in production (missing entries raiseLookupError— fail closed, no silent 404s).vite()/@vitehelper — emits<script type="module">and<link rel="stylesheet">tags for entries; injects the Vite HMR client in dev. Registered intonyxa-viewautomatically when both are installed (@vite("resources/app.ts")).- Dev proxy —
AssetsProxyMiddlewareforwards/_vite/*to the configured dev server whileassets.dev(debug on,NYXA_ASSETS_PRODunset); production never proxies. - Dev detection —
assets.dev=app.debugandNYXA_ASSETS_PROD != "1"(set the env var to test manifest mode in debug). - CDN support —
assets.urlprefixes resolved URLs for external hosts; empty serves from/build. nyxa buildhook — runsnpm run buildwhen the app has apackage.json(warns, never fails the build).- Starter kit —
web_kitscaffolds a Vite + forms + views demo app vianyxa add. - Telemetry — emits
assets.manifest(hit/miss) per lookup.
Install
nyxa add nyxa-assets # writes config/assets.py
Usage
# in a template (nyxa-view):
# @vite("resources/app.css")
# @vite("resources/app.ts")
# or directly:
tags = app.assets.vite("resources/app.css", "resources/app.ts")
url = app.assets.resolve("resources/app.ts")
Public API
AssetsManager— bound asapp.assets:manager.dev -> bool,manager.manifest() -> dict,manager.resolve(entry) -> str,manager.vite(*entries) -> str(HTML tags); config mirrors:build_dir,manifest_name,url,dev_server.AssetsProxyMiddleware— proxies/_vite/*to the dev server in assets-dev mode:AssetsProxyMiddleware(prefix="/_vite"); installed globally by the provider.AssetsProvider— bindsapp.assets, installs the proxy, registers theviteview helper, contributes thenpm run buildnyxa buildhook, and writesconfig/assets.pyonnyxa add.
Configuration
nyxa add nyxa-assets writes config/assets.py:
config = {
"build_dir": "build/assets",
"manifest": "manifest.json",
"url": "", # CDN prefix ("" → /build)
"dev_server": "http://localhost:5173",
}
NYXA_ASSETS_PROD=1 forces manifest mode even under debug=True.
License
MIT
Metadata
Release files for nyxa-assets 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nyxa_assets-0.0.1.tar.gz | 10.9 kB | Without provenance | Details for nyxa_assets-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nyxa_assets-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for nyxa_assets-0.0.1-py3-none-any.whl |
Total release size: 21.7 kB
Release files / nyxa_assets-0.0.1.tar.gz
| Download URL | nyxa_assets-0.0.1.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb3876d5f50daa6f6f952eeab4a5dd3347bcf3c7e038b5044fa9f8b00718ca93
|
|
BLAKE2b-256 checksum How to use checksums |
4e00b8ed3ab75a188597bbd7a2d527338ec34100867c5addd0e67d2714a12eed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / nyxa_assets-0.0.1-py3-none-any.whl
| Download URL | nyxa_assets-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c684cc83287235b2bd063d0f1bba6c65591c49cda38373794b12f5425a7d7b96
|
|
BLAKE2b-256 checksum How to use checksums |
ca63103ef241c618e66da42935397972ec10885aca8e7eca5cca60a5780603b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for nyxa-assets 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.