{"id":21627868,"url":"https://github.com/eliasdarruda/nx-config-splitter","last_synced_at":"2025-04-11T12:50:40.482Z","repository":{"id":42919421,"uuid":"247168584","full_name":"eliasdarruda/nx-config-splitter","owner":"eliasdarruda","description":"Allows you to split your angular.json, nx.json and tsconfig.json files into multiple directories","archived":false,"fork":false,"pushed_at":"2023-01-06T02:39:57.000Z","size":254,"stargazers_count":6,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T09:11:15.329Z","etag":null,"topics":["angular","angular-cli","monorepo","nx","tools"],"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/eliasdarruda.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}},"created_at":"2020-03-13T22:01:40.000Z","updated_at":"2023-11-05T11:30:04.000Z","dependencies_parsed_at":"2023-02-05T03:31:17.310Z","dependency_job_id":null,"html_url":"https://github.com/eliasdarruda/nx-config-splitter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasdarruda%2Fnx-config-splitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasdarruda%2Fnx-config-splitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasdarruda%2Fnx-config-splitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliasdarruda%2Fnx-config-splitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliasdarruda","download_url":"https://codeload.github.com/eliasdarruda/nx-config-splitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248402656,"owners_count":21097338,"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":["angular","angular-cli","monorepo","nx","tools"],"created_at":"2024-11-25T01:17:49.262Z","updated_at":"2025-04-11T12:50:40.448Z","avatar_url":"https://github.com/eliasdarruda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/eliasdarruda/ngx-config-splitter.svg?branch=master)](https://travis-ci.com/eliasdarruda/ngx-config-splitter)\n[![Coverage Status](https://coveralls.io/repos/github/eliasdarruda/nx-config-splitter/badge.svg?branch=master)](https://coveralls.io/github/eliasdarruda/nx-config-splitter?branch=master)\n\n# What is this for?\n\nThis repository allows you to split your `angular.json`, `workspace.json`, `nx.json` and `tsconfig.json` into multiple files in many directories (apps, libs, etc). This is meant to avoid multiple lines of code on the same file and conflicts.\n\n### Package deprecated for NX v12+, you should take advantage of the builtin project.json splitting from NX.\n### For angular apps, this will become deprecated when this is merged https://github.com/angular/angular-cli/issues/22655\n\n## Installation\n\n```\nnpm install nx-config-splitter --save\n```\n\n## How does it work?\n\nIn your project root, you'll need to configure `*.base.json` files.\n\n- `angular.base.json`\n- `workspace.base.json` - only if needed\n- `nx.base.json`\n- `tsconfig.base.json`\n\nEssentially, these files will be a copy of your current respective files. This base file is meant to hold everything that won't change adding a lib or an app, configurations and so on.\n\n### **IMPORTANT:** To avoid further conflicts on the original files, you should put `tsconfig.json`, `nx.json` and `angular.json` files on `.gitignore`\n\nAfter configuring base files, you'll need to create inside the lib/app directory a file called `project.config.json`, if your lib is called **ui-kit**, then here's a example of a `project.config.json` for your lib\n\n```\n{\n  \"angular\": {\n    \"ui-kit\": {\n      // angular.json stuff inside 'projects'\n    }\n  },\n  \"nx\": {\n    \"ui-kit: { \"tags\": [] }\n  },\n  \"tsconfig\": {\n    // stuff inside `compilerOptions.paths`\n    \"@org/ui-kit\": [ \"paths/ui-kit/index\" ]\n  },\n  workspace: {\n    \"ui-kit\": {\n      // workspace.json stuff inside 'projects'\n    }\n  }\n}\n```\n\nNote that `workspace` key is used only on NX non-angular projects, if your project doesn't use `angular.json` file, you should leave the `angular` key empty as: angular: {},\n\n## **Finally**,\n\nTo concatenate every `project.config.json` into `nx.json`, `workspace.json`, `angular.json` and `tsconfig.json` files run the schematic command:\n\n```\nschematics nx-config-splitter:merge\n```\n**NOTE**: if you don't have schematics installed, add `@angular-devkit/schematics` to your package dependencies\n\nI recommend you to run this command before any `serve`, `build`, `generate` command to ensure you'll always have your configuration files updated.\n\n## Adding `project.config.json` in your projects automatically\n\nYou need to use `writeProjectConfigFiles` function in a custom schematic after your lib/app generate schematic.\n\nNote that this is based on a custom schematic provided by NX, you can read more about it here: https://auth0.com/blog/create-custom-schematics-with-nx/\n\n\n\n```TYPESCRIPT\nimport { writeProjectConfigFiles } from 'nx-config-splitter';\n\nfunction writeProjectConfigFiles(\n  schema: any,\n  rootDirectory: string,\n  fileName: string,\n  keyPath: string = 'projects'\n)\n\nexport default function(schema: any): Rule {\n  return chain([\n    externalSchematic('@nrwl/angular', 'lib', {\n      name: schema.name\n    }),\n    writeProjectConfigFiles(schema, 'libs', 'nx'),\n    // If it is for app schematic use 'apps' folder\n    writeProjectConfigFiles(schema, 'apps', 'angular', 'projects'),\n    writeProjectConfigFiles(schema, 'libs', 'tsconfig', 'compilerOptions.paths'),\n\n    // For nx-react projects\n    writeProjectConfigFiles(schema, 'apps', 'workspace', 'projects'),\n  ]);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliasdarruda%2Fnx-config-splitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliasdarruda%2Fnx-config-splitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliasdarruda%2Fnx-config-splitter/lists"}