Skip to main content

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:

  1. Finds the pntos-cobra-frontend source repository
  2. Runs npm install and npm run build
  3. 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.

Metadata

Release files for pntos-cobra-frontend 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pntos-cobra-frontend 0.1.0
File Interpreter ABI Platform
pntos_cobra_frontend-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / pntos_cobra_frontend-0.1.0-py3-none-any.whl

Download URL pntos_cobra_frontend-0.1.0-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
78ff417f3825a4d626deac3852e7841bb98159c88b3b6a8e55a30fc823310b05
BLAKE2b-256 checksum
How to use checksums
89e095d21277cdc32ae3e97621a1bc5b3ed6edbbe53164ea5afe1e60bbe89358
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page