{"id":21905036,"url":"https://github.com/poviolabs/spa-deploy-cli","last_synced_at":"2025-06-23T23:32:29.429Z","repository":{"id":240504368,"uuid":"802810788","full_name":"poviolabs/spa-deploy-cli","owner":"poviolabs","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-01T09:52:16.000Z","size":239,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v4","last_synced_at":"2025-06-19T06:43:49.603Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/poviolabs.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}},"created_at":"2024-05-19T10:37:49.000Z","updated_at":"2025-06-03T11:20:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b429bf9-6fc7-40dc-9d06-3c04f8c6e8fd","html_url":"https://github.com/poviolabs/spa-deploy-cli","commit_stats":{"total_commits":91,"total_committers":3,"mean_commits":"30.333333333333332","dds":"0.17582417582417587","last_synced_commit":"a6cfbf0b9b0a41b9abf2a478ea5160907667bc03"},"previous_names":["povio/spa-deploy-cli"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/poviolabs/spa-deploy-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poviolabs%2Fspa-deploy-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poviolabs%2Fspa-deploy-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poviolabs%2Fspa-deploy-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poviolabs%2Fspa-deploy-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poviolabs","download_url":"https://codeload.github.com/poviolabs/spa-deploy-cli/tar.gz/refs/heads/v4","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poviolabs%2Fspa-deploy-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261575355,"owners_count":23179504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","react","tool"],"created_at":"2024-11-28T16:20:13.260Z","updated_at":"2025-06-23T23:32:29.420Z","avatar_url":"https://github.com/poviolabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SPA Deploy CLI\n\nUse this tool to deploy and configure an SPA.\n\nFeatures:\n\nStatic SPA deploy:\n- Deploy to AWS S3\n- Targeted CloudFront invalidation and caching\n- Embed environment variables into HTML\n\nNext.js Configuration:\n- From SSM Parameter Store\n\nExamples:\n\n- [Vue Basic](./examples/vue-basic)\n\n# Setup\n\nRunning without installing. Make sure to lock the version, check the latest version on npm.\n\n```\nyarn dlx @povio/spa-deploy-cli@4.2\n```\n\nIf using yarn cache, you can install the package:\n\n```bash\nyarn add @povio/spa-deploy-cli\n```\n\n# Configure\n\n```yaml\naccountId: \"000000000000\"\nregion: us-east-1\n\n# Static SPA deploy config\ndeploy:\n    buildPath: \"./dist\"\n      \n    # only include local files matching this glob\n    #includeGlob: \n    # - glob: \"**.css\"\n    #   cacheControl: \"max-age=2628000, public\"\n      \n    # exclude local and remote files matching this glob\n    #ignoreGlob: \"**.css\"\n        \n    s3:\n        bucket: myapp-dev-website\n        \n        # prefix to upload to, default is root\n        #prefix:\n        \n        # delete all ignored/unknown files\n        #  use `--dry-run` to see what would be deleted\n        #purge: false\n        \n        # re-upload even if the file is the same (also updates cacheControl)\n        #force: false\n\n        # changes should not invalidate cloudfront cache\n        #skipChangesInvalidation: false\n        \n        # default cache control\n        #cacheControl: \"max-age=2628000, public\"\n        \n        # pattern match cache control, first match wins, default is cacheControl\n        #cacheControlGlob:\n        # - glob: \"*.html\"\n        #   cacheControl: \"no-cache, no-store, must-revalidate\"\n        \n        # @deprecated - set matching files to \"public, must-revalidate\"\n        #invalidateGlob: \"*.html\"\n        \n        # set ACL, not needed if using bucket policy\n        #acl: \"public-read\"\n          \n    cloudfront:\n        distributionId: CF000000000000\n        invalidatePaths: \"/*\"\n\n# Environment file config\nconfigs:\n    # Write into env file (Next.js)\n    #  destination: ./.env.local\n    \n    # Write into yaml\n    #  destination: ./production.yaml\n    \n    # Write into .html, in the head section or \u003cscript id=\"env-data\"\u003e\u003c/script\u003e\n    # Warning: all values will be public\n    #  destination: ./dist/index.html\n\n    \n    values:\n        # load config from ./.config/${stage}.base.template.env\n        # and interpolate ${arn:aws:ssm..} and ${env:ENV_VALUE} values\n        # load them onto the root\n      - name: \"@\"\n        configFrom: base.template\n    \n        # simple value mapping\n      - name: database__password\n        valueFrom: arn:aws:ssm:::parameter/myapp-dev/database/password\n    \n        # JSON object mapping\n      - name: database\n        valueFrom: arn:aws:ssm:::parameter/myapp-dev/database\n    \n      - name: database__host\n        valueFrom: env:DATABASE_HOST\n```\n\n### Example\n\nWhere `configFrom: base.template` and the config file is `.config/${stage}.base.template.yml`:\n\n```yaml\nAPP_RELEASE: ${func:release}\nAPP_STAGE: ${func:stage}\nAPP_VERSION: ${env:APP_VERSION}\nSTATIC_URL: https://static.example.com\nNEXT_PUBLIC_SENTRY_CDN: https://public@sentry.example.com/1\n```\n\nthe output will be at the set destination, for example `.env.local`:\n\n```\nAPP_RELEASE=61be6e2c61be6e2c61be6e2c61be6e2c\nAPP_STAGE=myapp-stg\nAPP_VERSION=0.0.1\nSTATIC_URL: https://static.example.com\nNEXT_PUBLIC_SENTRY_DSN=https://public@sentry.example.com/1\n```\n\n## Injecting the environment\n\n```bash\nyarn spa-deploy bootstrap --stage myapp-stg\n```\n\n### Pure SPA or after build time configuration\n\nUsing the `destination: ./dist/index.html` option, you can inject the environment into the HTML file.\n\nThe file will be edited in place, with the following content inserted into\nthe `\u003chead\u003e` section, replacing any existing `\u003cscript id=\"env-data\"\u003e`:\n\n```html\n\u003cscript id=\"env-data\"\u003e\n  // you can add local testing variables here,\n  // this will get overwritten at build\n  window.APP_STAGE = \"myapp-stg\";\n\u003c/script\u003e\n```\n\n## Static SPA Deploy\n\n```bash\nyarn spa-deploy deploy --stage myapp-stg\n```\n\n# Development\n\n## Test locally\n\n```bash\n# prerequisites\ncorepack install\nyarn\n\n# run tests\nyarn test\n\n# run sources with tsx\nyarn start --help\nyarn start bootstrap --pwd ./test --stage myapp-dev\n\n# build new version\nyarn build\n\n# test build\nyarn start:prod --help\nyarn start:dist bootstrap --pwd ./test --stage myapp-dev\n\n# test deploy\nyarn start:dist deploy --pwd ./test --stage myapp-dev\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoviolabs%2Fspa-deploy-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoviolabs%2Fspa-deploy-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoviolabs%2Fspa-deploy-cli/lists"}