Add Flox package build configuration for publishing#2
Merged
billlevine merged 9 commits intomainfrom Feb 5, 2026
Merged
Conversation
Reorganize project structure to enable building and publishing spdx-to-mermaid as a standalone Flox package: - Move Python source to package/ subdirectory to isolate from .flox environment directory - Add [build.spdx-to-mermaid] section to manifest.toml with build commands that create a Python wheel and bundle dependencies - Update .gitignore to exclude build artifacts while keeping .flox - Update Justfile to reference package/ directory - Configure runtime dependency on python3 only The built package can now be published to Flox Catalog and installed in any environment with: flox install spdx-to-mermaid Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add a separate spdx-viewer/ environment that can be pushed to FloxHub for easy sharing with teams: - New Flox environment in spdx-viewer/ subdirectory - Installs published spdx-to-mermaid package from catalog - Includes visualization tools: mermaid-cli, chromium, HTTP server - Comes with viewer.html, configs, and convenience Justfile - Lightweight - no build tools or source code - Can be shared via: flox push This separates the development environment (build/publish) from the runtime/visualization environment (consume published package). Users can pull this environment from FloxHub and immediately start visualizing SPDX files without needing the full development setup. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Collaborator
Author
Update: Added Viewer EnvironmentAdded a standalone environment that can be shared via FloxHub: What's NewStandalone Viewer Environment in :
Two EnvironmentsThe repository now has two distinct environments:
Usage After PublishingOnce the package is published:
This makes it easy for teams to use the visualization tools without needing the full development environment. |
Replace Justfile with bash functions defined in manifest profile: - Remove `just` dependency - Add bash functions in [profile.common] section: - spdx-show: View SPDX file as interactive diagram - spdx-svg: Convert to SVG file - spdx-serve: Start HTTP server - spdx-stop: Stop services - Install published flox/spdx-to-mermaid package - Update README with new function-based usage - Add welcome message on activation Benefits: - Fewer dependencies (no just required) - More portable (works in any bash/zsh shell) - Self-contained (everything in manifest.toml) - Better discoverability (shows available commands on activate) Functions are available when running `flox activate` in interactive mode. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Collaborator
Author
Update: Simplified Viewer EnvironmentThe viewer environment has been simplified based on feedback: ChangesRemoved dependencies:
Added bash functions in profile: # After flox activate, these functions are available:
spdx-show <file> [options] # View SPDX as interactive diagram
spdx-svg <file> [out] [opts] # Convert to SVG file
spdx-serve # Start HTTP server
spdx-stop # Stop servicesPublished package installed:
Benefits
Usagecd spdx-viewer
flox activate
# Functions are now available
spdx-show myfile.spdx.json --compact
spdx-svg myfile.spdx.json output.svgThe functions work in interactive shell mode. The environment is now ready to push to FloxHub. |
Embed viewer.html, mermaid-config.json, and puppeteer-config.json as heredocs in the manifest's on-activate hook. Files are written to $FLOX_ENV_PROJECT on first activation, making the environment fully self-contained and shareable via FloxHub without external dependencies. The hook is idempotent - it checks for file existence before writing, preserving any user modifications on subsequent activations. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add proper error checking to prevent cryptic "UnknownDiagramError" when spdx-to-mermaid fails or produces no output. The functions now: - Check if spdx-to-mermaid command succeeds - Verify the mermaid file has content before processing - Check if mmdc conversion succeeds - Display clear error messages for each failure point - Clean up temp files on error This helps users diagnose issues when visualization fails instead of seeing a confusing mermaid-cli error about no diagram type detected. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Show the simplest way to get started with the published FloxHub environment - just activate from remote and run spdx-show. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Prominently feature the SPDX Viewer environment at the top of the main README with a quick usage example showing how to activate from FloxHub and visualize SPDX files. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add CI/CD pipeline that builds and publishes spdx-to-mermaid package to FloxHub on multiple platforms (Ubuntu, macOS). Workflow includes change detection for efficient builds and automatic publishing on main branch pushes. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
devusb
approved these changes
Feb 5, 2026
Add ubuntu-22.04-arm64 to the CI matrix to build and publish packages for aarch64-linux architecture alongside existing x86_64-linux and macOS builds. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR reorganizes the project structure and adds build configuration to enable publishing
spdx-to-mermaidas a standalone Flox package that can be installed in any environment.Changes
Project Reorganization
package/subdirectory - This isolates the Python package from the.flox/environment directory, preventing symlink issues during package buildsgit mvto maintain full file history during reorganizationBuild Configuration
[build.spdx-to-mermaid]section to.flox/env/manifest.toml:uv buildpython3as runtime dependency.gitignoreto exclude build artifacts while preserving.flox/directoryJustfileto reference the newpackage/directoryPackage Details
spdx-to-mermaid0.1.0python3only (all Python deps bundled)/bin/spdx-to-mermaidCLI toolTesting
Build tested successfully:
Publishing
After merge, the package can be published with:
Users will then be able to install it:
Notes
The visualization features (HTTP server, mermaid-cli, chromium) remain in the development environment. The published package is the core CLI tool only, which keeps it lightweight and widely usable.