{"id":14862056,"url":"https://github.com/igorissen/angular-env-builder","last_synced_at":"2025-09-18T15:30:57.924Z","repository":{"id":252692195,"uuid":"841144089","full_name":"igorissen/angular-env-builder","owner":"igorissen","description":"Builder to generate \"src/environments/environment.ts\" file based on your environment variables","archived":false,"fork":false,"pushed_at":"2025-05-01T08:57:09.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T09:36:53.868Z","etag":null,"topics":["angular","builder","environment"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igorissen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-08-11T19:09:33.000Z","updated_at":"2025-05-01T08:53:31.000Z","dependencies_parsed_at":"2024-08-11T20:50:23.089Z","dependency_job_id":"3bdb2199-788d-4da4-b9bf-38d24e2915cb","html_url":"https://github.com/igorissen/angular-env-builder","commit_stats":null,"previous_names":["igorissen/angular-env-builder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/igorissen/angular-env-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorissen%2Fangular-env-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorissen%2Fangular-env-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorissen%2Fangular-env-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorissen%2Fangular-env-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorissen","download_url":"https://codeload.github.com/igorissen/angular-env-builder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorissen%2Fangular-env-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275789270,"owners_count":25528712,"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","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"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":["angular","builder","environment"],"created_at":"2024-09-19T20:01:28.895Z","updated_at":"2025-09-18T15:30:57.648Z","avatar_url":"https://github.com/igorissen.png","language":"TypeScript","funding_links":[],"categories":["Angular"],"sub_categories":["Builders"],"readme":"# angular-env-builder\n\n[![Build and test](https://github.com/igorissen/angular-env-builder/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/igorissen/angular-env-builder/actions/workflows/build-and-test.yml)\n\nCustom angular builder to generate \"src/environments/environment.ts\" file based on your environment variables.\n\n## Installation\n\n```bash\nnpm install --save-dev @igorissen/angular-env-builder\n```\n\nYou must install the dotenv package in version 16.4.x as it is a peer dependency.\n\n```bash\nnpm install --save-dev dotenv@16.4\n```\n\n## Configuration\n\nAfter installation, you need to configure the builder in your Angular project. Update your angular.json file to include angular-env-builder.\n\n1. Open the angular.json file in your project's root directory.\n2. Add the builder to the desired architect target\n```json5\n{\n  // ...\n  \"projects\": {\n    \"[your-app-name]\": {\n      \"architect\": {\n        \"[target-name]\": {\n          \"builder\": \"@igorissen/angular-env-builder:generate\",\n          \"options\": {\n            \"destination\": \"src/environments/environment.ts\",\n            \"variables\": [\n              {\n                \"envKey\": \"apiUrl\",\n                \"processEnvKey\": \"API_URL\",\n                \"valueType\": \"string\"\n              },\n              {\n                \"envKey\": \"apiPayload\",\n                \"processEnvKey\": \"API_PAYLOAD\",\n                \"valueType\": \"object\"\n              },\n              {\n                \"envKey\": \"apiPort\",\n                \"processEnvKey\": \"API_PORT\",\n                \"valueType\": \"number\"\n              },\n              {\n                \"envKey\": \"apiEnabled\",\n                \"processEnvKey\": \"API_ENABLED\",\n                \"valueType\": \"boolean\"\n              }\n            ]\n          }\n        }\n      }\n    }\n  }\n  // ...\n}\n```\n3. Replace `[target-name]` with the target you are customizing (e.g., _build_, _serve_, etc.), and provide necessary options as needed by the builder.\n\n## Builder Options\n\nThis table provides a structured overview of each property and its intended type and purpose within the `options` object.\n\n| Property    | Type   | Description                                                    |\n|-------------|--------|----------------------------------------------------------------|\n| **destination** | string | The file path where the environment variables will be written. |\n| **variables** | array of objects | An array containing objects that define each environment variable to process. |\n\nEach object within the `variables` array has the following properties:\n\n| Property                                                                                                                 | Type   | Description                                                                                             |\n|--------------------------------------------------------------------------------------------------------------------------|--------|---------------------------------------------------------------------------------------------------------|\n| **envKey** | string | The key to be used in the output environment file (environment.ts) to access the environment variable.  |\n| **processEnvKey** | string | The key used to reference the environment variable from the Node.js process (process.env).              |\n| **valueType** | string | The expected data type of the environment variable value. It can be string, object, number, or boolean. |\n\n\n## Usage\n\nOnce configured, you can run the builder using Angular CLI:\n\n```bash\nng run [project-name]:[target-name]\n```\n\nReplace `[project-name]` with the name of your Angular project and `[target-name]` with the target you configured.\n\n## Support\n\nIf you encounter any issues, feel free to [create an issue](https://github.com/igorissen/angular-env-builder/issues).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorissen%2Fangular-env-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorissen%2Fangular-env-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorissen%2Fangular-env-builder/lists"}