{"id":30196312,"url":"https://github.com/ebayclassifiedsgroup/update-ts-references","last_synced_at":"2026-04-01T19:39:56.620Z","repository":{"id":43021782,"uuid":"288856031","full_name":"eBayClassifiedsGroup/update-ts-references","owner":"eBayClassifiedsGroup","description":"Helper for multi-package repository with TypeScript","archived":false,"fork":false,"pushed_at":"2025-07-14T06:55:14.000Z","size":922,"stargazers_count":61,"open_issues_count":3,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-09T18:21:52.326Z","etag":null,"topics":["lerna","npm","pnpm","pnpm-workspaces","tool","tsconfig","typescript","typescript-project-references","utility","worspaces","yarn","yarn-workspaces"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/eBayClassifiedsGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-08-19T23:06:31.000Z","updated_at":"2025-08-09T10:36:26.000Z","dependencies_parsed_at":"2024-01-15T15:47:45.041Z","dependency_job_id":"4bd4f22d-3336-427a-b718-67a980076064","html_url":"https://github.com/eBayClassifiedsGroup/update-ts-references","commit_stats":{"total_commits":37,"total_committers":8,"mean_commits":4.625,"dds":0.5405405405405406,"last_synced_commit":"86f6fd3a5eae06c198005f9a07898ad2229c4ffe"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/eBayClassifiedsGroup/update-ts-references","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBayClassifiedsGroup%2Fupdate-ts-references","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBayClassifiedsGroup%2Fupdate-ts-references/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBayClassifiedsGroup%2Fupdate-ts-references/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBayClassifiedsGroup%2Fupdate-ts-references/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eBayClassifiedsGroup","download_url":"https://codeload.github.com/eBayClassifiedsGroup/update-ts-references/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBayClassifiedsGroup%2Fupdate-ts-references/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270183606,"owners_count":24541341,"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-08-13T02:00:09.904Z","response_time":66,"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":["lerna","npm","pnpm","pnpm-workspaces","tool","tsconfig","typescript","typescript-project-references","utility","worspaces","yarn","yarn-workspaces"],"created_at":"2025-08-13T05:17:52.476Z","updated_at":"2026-04-01T19:39:56.608Z","avatar_url":"https://github.com/eBayClassifiedsGroup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test](https://github.com/eBayClassifiedsGroup/update-ts-references/actions/workflows/node.js.yml/badge.svg)](https://github.com/eBayClassifiedsGroup/update-ts-references/actions/workflows/node.js.yml)\n\n# update-ts-references\nIf your repository is a multi package repository (via [lerna.js](https://lerna.js.org/), [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/), [pnpm workspaces](https://pnpm.js.org/workspaces) or since v7 [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces)) in combination with [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) from TypeScript, this tool will be very helpful by reading dependencies out of the _package.json_ and applying them to the _tsconfig.json_ as references.\n\nThere's a blog post that's a good introduction to it [Optimizing multi-package apps with TypeScript Project References](https://medium.com/berlin-tech-blog/optimizing-multi-package-apps-with-typescript-project-references-d5c57a3b4440).\n\n## Usage\n\nYou can just use it via npx\n\n```\nnpx update-ts-references --help\n\n  Usage: update-ts-references [options]\n\n  Options:\n    --configName    The name of the config files which needs to be updated. Default: tsconfig.json \n    --rootConfigName    The name of the root config file which needs to be updated. Default: tsconfig.json\n    --withoutRootConfig  If you will not have a tsconfig in the root directory or don't want to update it. Default: false\n    --check         Checks if updates would be necessary (without applying them)\n    --help          Show help\n    --createTsConfig  Create default TS configs for packages where the main entry in the package.json have a ts|tsx extension (Note: respects the --configName parameter)\n    --createPathMappings Create paths mappings under compilerOptions for a better IDE support. It respects the rootDir if no rootDir available it falls back to \"src\"\n    --cwd           Set working directory. Default: /Users/john-doe/projects/my-project\n    --verbose       Show verbose output. Default: false\n    --usecase       Use a specific usecase configuration. Default: update-ts-references.yaml\n    --strict    Expects always a tsconfig.json in the package directory. Default: false\n```\n\nor you add it as dev dependency and include it in the `postinstall` script in the package.json\n\n`yarn add update-ts-references --dev -W`\n\n```\n \"scripts\": {\n   \"postinstall\": \"update-ts-references\"\n },\n \"husky\": {\n    \"hooks\": {\n      \"pre-push\": \"update-ts-references --check\"\n    }\n  },\n```\n\nenable pre-push via husky\n```\nnpx husky add .husky/pre-push \"npx update-ts-references --check\"\ngit add .husky/pre-push\n```\n\n## using --createTsConfig\nCreates a basic tsconfig file for each package where the main entry in the package.json have a `.ts` or `.tsx` extension. It will respect the `--configName` parameter.\n\nThe output for the created file looks like the following\n\n```json\n{\n  \"extends\": \"../tsconfig.base.json\", // add's extends in case you have a base config in the root directory \n  \"compilerOptions\": {\n    \"outDir\": \"dist\",\n    \"rootDir\": \"src\"\n  },\n  \"references\": [ // will be added after running update-ts-references \n    {\n      \"path\": \"../some-other-package\"\n    }\n  ]\n}\n```\n\n## using --createPathMappings\nwill create path mappings under `compilerOptions` for a better IDE support. The generated mappings respect the `rootDir` defined in the referenced `tsconfig.json` or `jsconfig.json` and only fall back to `src` when no `rootDir` is provided.\n\n```json\n{\n  \"extends\": \"../tsconfig.base.json\", // add's extends in case you have a base config in the root directory \n  \"compilerOptions\": {\n    \"outDir\": \"dist\",\n    \"rootDir\": \"src\",\n    \"paths\": { // will be added after running update-ts-references with --createPathMappings\n      \"@my-project/some-other-package\": [\"../some-other-package/src\"]\n    }\n  },\n  \"references\": [ // will be added after running update-ts-references \n    {\n      \"path\": \"../some-other-package\"\n    }\n  ]\n}\n```\n\n\n## using update-ts-references.yaml for configurations\nYou can configure workspace paths via the _update-ts-references.yaml_ file. This is useful if your repo is having **no** _package.json_ or _pnp-workspace.yaml_ in the root folder. Additional to that it can also being used to extend the paths config next to the normal workspace setup via npm, pnpm, yarn and lerna so you can include or exclude some packages.\n\nAdditional to that you can configure also the following options:\n- configName (default: tsconfig.json)\n- rootConfigName (default: tsconfig.json)\n- createPathMappings (default: false)\n- withoutRootConfig (default: false)\n- ignorePathMappings (default: [])\n\nExample configuration see [here](./test-scenarios/ts-options-yaml/update-ts-references.yaml)\n\n### using multiple configurations for different usecases\nExecuting update-ts-references with different configurations via the parameter `--usecase`.\n\n## about jsconfig.json support \nWhen a dependency does not ship a `tsconfig.json` but provides a `jsconfig.json`, the reference automatically targets that file and the path mappings pick up its `rootDir` as well, if `--createPathMappings` is enabled. `jsconfig.json` files participate in package-level `references`, but they stay out of the root `tsconfig.json`.\n\n### in combination with the --configName argument\nCurrently the name of the config file derives from the the configName which is `tsconfig.json` and would look for `jsconfig.json`. \n\nExample: ` --configName tsconfig.test.json` would look for `jsconfig.test.json`\n\n## FAQ\n### Why is my pnpm workspace alias not working?\n\n_update-ts-references_ is currently not supporting [Referencing workspace packages through aliases](https://pnpm.js.org/workspaces#referencing-workspace-packages-through-aliases) yet. See issue #13\n\n# License\n\nCopyright 2026 mobile.de\nDeveloper: Mirko Kruschke\n\nUse of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febayclassifiedsgroup%2Fupdate-ts-references","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febayclassifiedsgroup%2Fupdate-ts-references","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febayclassifiedsgroup%2Fupdate-ts-references/lists"}