pntOS Cobra Frontend
This project contains the front-end for the Cobra UI plugin in pntOS-Cobra.
The front-end consists of Vue components which are compiled into a
dist/ directory containing index.html and an assets/ directory which contains all
javascript, CSS, and other static assets for the Cobra UI plugin to serve in downstream
projects.
These compiled components are packaged such that if the pntos-cobra-frontend package
is in the Python environment, the following will return the path to the dist/
directory for easy deployment in downstream projects:
python -c "from pntos_cobra_frontend import get_dist_path; print(get_dist_path())"
NOTE: This project has a build-time dependency on nodejs>=20.19.0. If not installing
from a wheel (e.g., editable install or via git URL), Node.js is
required for expected behavior. If it is not available, the build system will fail
gracefully and no frontend assets will be built.
Build Locally
To build the Vue components into a dist/ folder locally, first set up the Python
environment:
uv sync
Then build the frontend:
uv run rebuild-cobra-frontend
Development Instructions
When developing this project in tandem with the pntos-cobra repository (or other
downstream repositories), in order to avoid a longer development cycle of pushing and
pulling changes in this project, there are a few tools to help.
Editable Install
To work on the frontend while developing in a downstream project, configure an editable
install in the downstream project's pyproject.toml (assuming both project workspaces
share the same parent folder):
[project]
dependencies = [
# ... other dependencies
- "pntos-cobra-frontend>=2.1.0",
+ "pntos-cobra-frontend",
]
[tool.uv.sources]
+pntos-cobra-frontend = { path = "../pntos-cobra-frontend", editable = true }
Then sync the downstream project:
cd path/to/pntos-cobra # or your downstream project
uv sync
The frontend will be built automatically during the initial sync and installed in
editable mode. Python code changes in pntos-cobra-frontend will be immediately
reflected without reinstalling.
To revert back to using the published wheel from the package registry, simply reverse
the above diff then run uv sync --no-cache to reinstall from the registry.
Rebuild Command
When you make changes to Vue components or other frontend source files (.vue, .ts,
.js, etc.), you need to rebuild the frontend assets. From your downstream project:
rebuild-cobra-frontend
This command:
- Finds the
pntos-cobra-frontendsource repository - Runs
npm installandnpm run build - Copies the built assets to the installed package location
The rebuilt assets will be immediately available to your downstream application without needing to reinstall the package.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pntos_cobra_frontend-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pntos_cobra_frontend-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.0.1 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78ff417f3825a4d626deac3852e7841bb98159c88b3b6a8e55a30fc823310b05
|
|
| MD5 |
c20418dd46c6f12aaa45889202a78981
|
|
| BLAKE2b-256 |
89e095d21277cdc32ae3e97621a1bc5b3ed6edbbe53164ea5afe1e60bbe89358
|