{"id":20065726,"url":"https://github.com/inflectra/spiraapp-package-generator","last_synced_at":"2026-06-08T12:31:52.918Z","repository":{"id":241118431,"uuid":"577937848","full_name":"Inflectra/spiraapp-package-generator","owner":"Inflectra","description":"Used to create a *.spiraapp file bundle from a manifest file for use in Spira","archived":false,"fork":false,"pushed_at":"2026-05-14T13:16:17.000Z","size":135,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-14T15:28:51.756Z","etag":null,"topics":["soc2","spira","spiraapps"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Inflectra.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-13T21:51:39.000Z","updated_at":"2026-04-28T13:54:26.000Z","dependencies_parsed_at":"2024-05-22T14:41:39.992Z","dependency_job_id":"1a08a574-4344-434e-ab41-9825c83f7ae4","html_url":"https://github.com/Inflectra/spiraapp-package-generator","commit_stats":null,"previous_names":["inflectra/spiraapp-package-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Inflectra/spiraapp-package-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inflectra%2Fspiraapp-package-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inflectra%2Fspiraapp-package-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inflectra%2Fspiraapp-package-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inflectra%2Fspiraapp-package-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inflectra","download_url":"https://codeload.github.com/Inflectra/spiraapp-package-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inflectra%2Fspiraapp-package-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34063149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["soc2","spira","spiraapps"],"created_at":"2024-11-13T13:52:28.100Z","updated_at":"2026-06-08T12:31:52.913Z","avatar_url":"https://github.com/Inflectra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpiraApp Package Generator\n\nThis repo takes a SpiraApp `manifest.yaml` and its associated files and converts them into a valid `.spiraapp` package file. It also includes an optional automation script that can build, upload, and manage SpiraApps on a Spira instance using browser automation.\n\n---\n\n## Table of Contents\n\n- [Setup](#setup)\n- [Building a Package Manually (index.js)](#building-a-package-manually)\n- [Automation Script (bundle-automation.js)](#automation-script)\n  - [Environment Configuration](#environment-configuration)\n  - [Running the Script](#running-the-script)\n  - [Available Flags](#available-flags)\n  - [What Each Mode Does](#what-each-mode-does)\n  - [Important Notes](#important-notes)\n\n---\n\n## Setup\n\n1. Clone this repo\n2. Open a terminal in the repo directory\n3. Run `npm install` to install dependencies\n4. If using the automation script, copy `.env.example` to `.env` and fill in your Spira credentials\n\n---\n\n## Building a Package Manually\n\nThe `index.js` script packages a SpiraApp source folder into a `.spiraapp` file. Use this if you only want to build — no Spira instance or credentials required.\n\n```bash\nnpm run build --input=/path/to/SpiraApp --output=/path/to/output\n```\n\n**Example:**\n```bash\nnpm run build --input=/Users/yourname/MySpiraApp --output=/Users/yourname/Bundles\n```\n\n- `--input` — path to the folder containing `manifest.yaml` (required)\n- `--output` — path to the folder where the `.spiraapp` file will be saved (required)\n- `--debug` — disables JS minification, useful for inspecting the output:\n  ```bash\n  npm run build --input=/path/to/SpiraApp --output=/path/to/output --debug\n  ```\n\nThe package file is named automatically using the SpiraApp's `guid` from `manifest.yaml`. Any validation errors in the manifest are printed to the console.\n\n\u003e **Note:** Inflectra will never ask you for your `.spiraapp` file — only ever the source code used to generate it.\n\n---\n\n## Automation Script\n\n`bundle-automation.js` automates the full development workflow: building the package, uploading it to a Spira instance, and managing its activation state. It uses Playwright to drive a browser session against your Spira instance.\n\nThis script is designed for developers who want to quickly iterate and test SpiraApps without manually uploading through the UI each time.\n\n### Environment Configuration\n\nCopy `.env.example` to `.env` and fill in your values:\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `SPIRA_BASE_URL` | Yes | — | Base URL of your Spira instance |\n| `SPIRA_USERNAME` | Yes | — | Your Spira username |\n| `SPIRA_PASSWORD` | Yes | — | Your Spira password |\n| `SPIRA_ENABLE_PROJECT_IDS` | No | _(none)_ | Comma-separated project IDs to enable the SpiraApp for |\n| `SPIRA_DISABLE_PROJECT_IDS` | No | _(none)_ | Comma-separated project IDs to disable the SpiraApp for |\n| `PLAYWRIGHT_HEADLESS` | No | `true` | Set to `false` to run the browser in headed mode (visible window). Default is headless (no visible browser). |\n| `SPIRA_ENABLE_DEV_MODE` | No | `false` | Set to `true` to enable Developer Mode in Spira General Settings before uploading. Only needed the first time or if Developer Mode has been turned off. |\n| `SPIRA_INCREMENT_VERSION` | No | `false` | Set to `true` to auto-increment the patch version in `manifest.yaml` before each build (e.g. `1.0` → `1.1`). Default is off — the version in `manifest.yaml` is used as-is. |\n\n### Running the Script\n\n```bash\nnode bundle-automation.js --input=/path/to/SpiraApp\n```\n\n**Example:**\n```bash\nnode bundle-automation.js --input=/Users/yourname/MySpiraApp\n```\n\nWithout any mode flags, the script prompts you to choose what to do:\n\n```\nWhat would you like to do?\n  1. Build, upload and enable\n  2. Enable only (no build/upload)\n  3. Disable only\n```\n\n### Available Flags\n\nYou can skip the prompt by passing a flag directly:\n\n```bash\n# Build, upload, and enable system-wide (default of full workflow)\nnode bundle-automation.js --input=/path/to/SpiraApp\n# then choose option 1 at the prompt\n\n# Build and upload only — no system-wide activation\nnode bundle-automation.js --input=/path/to/SpiraApp --upload\n\n# Enable only (no build or upload)\nnode bundle-automation.js --input=/path/to/SpiraApp --enable\n\n# Disable only\nnode bundle-automation.js --input=/path/to/SpiraApp --disable\n```\n\n### What Each Mode Does\n\n**Build, upload and enable (default / option 1)**\n1. Optionally bumps the patch version in `manifest.yaml` (if `SPIRA_INCREMENT_VERSION=true`)\n2. Builds the `.spiraapp` package file\n3. Logs into Spira using browser automation\n4. Optionally enables Developer Mode (if `SPIRA_ENABLE_DEV_MODE=true`)\n5. Uploads the `.spiraapp` file to the SpiraApps administration page\n6. Activates the SpiraApp system-wide (if not already active)\n7. Enables the SpiraApp for any projects listed in `SPIRA_ENABLE_PROJECT_IDS`\n\n**Build and upload only (`--upload`)**\n\nSame as above but stops after step 5 — the SpiraApp is uploaded but not activated system-wide. Use this when you want to control activation separately.\n\n**Enable only (`--enable`)**\n\nLogs into Spira and enables the SpiraApp for the projects listed in `SPIRA_ENABLE_PROJECT_IDS`. No build or upload is performed.\n\n**Disable only (`--disable`)**\n\nLogs into Spira and disables the SpiraApp for the projects listed in `SPIRA_DISABLE_PROJECT_IDS`. No build or upload is performed.\n\n### Important Notes\n\n**Activation is enabled/disabled — it does not toggle**\n\nRunning the enable/activate script when the SpiraApp is already enabled will not disable it. The script checks the current state first and only acts if a change is needed.\n\nLikewise, running the disable script when the SpiraApp is already disabled will not re-enable it.\n\nTo disable a SpiraApp, you must explicitly run the disable script (`--disable`). Running the enable script again will not undo it, and vice versa. The two operations are fully independent.\n\n**Developer Mode**\n\nDeveloper Mode only needs to be enabled once per Spira instance. After that, you can leave `SPIRA_ENABLE_DEV_MODE` unset (or set to `false`) to skip that step on every subsequent run, making the workflow faster.\n\n**Version incrementing**\n\nBy default, the version in `manifest.yaml` is not changed. Set `SPIRA_INCREMENT_VERSION=true` if you want the patch version bumped automatically before each build. Note that Spira does not require a version change to replace an uploaded SpiraApp — the upload will overwrite the existing package regardless.\n\n**Headless mode**\n\nBy default the browser runs in headed mode (you can see it). Set `PLAYWRIGHT_HEADLESS=true` to run silently. In headless mode, errors are still reported to the terminal with clear, actionable messages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finflectra%2Fspiraapp-package-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finflectra%2Fspiraapp-package-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finflectra%2Fspiraapp-package-generator/lists"}