{"id":18355425,"url":"https://github.com/charto/autodts","last_synced_at":"2025-04-06T12:32:01.709Z","repository":{"id":35852317,"uuid":"40136580","full_name":"charto/autodts","owner":"charto","description":"DEPRECATED (TypeScript 1.8 includes all functionality)","archived":false,"fork":false,"pushed_at":"2015-11-28T12:12:48.000Z","size":9,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T23:51:15.553Z","etag":null,"topics":[],"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/charto.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}},"created_at":"2015-08-03T16:49:08.000Z","updated_at":"2017-05-31T18:05:20.000Z","dependencies_parsed_at":"2022-09-03T17:01:04.055Z","dependency_job_id":null,"html_url":"https://github.com/charto/autodts","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fautodts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charto","download_url":"https://codeload.github.com/charto/autodts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247484352,"owners_count":20946384,"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":[],"created_at":"2024-11-05T22:06:52.904Z","updated_at":"2025-04-06T12:32:01.435Z","avatar_url":"https://github.com/charto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"DEPRECATED\n==========\n\nThis module will no longer be updated, since TypeScript 1.8 already includes the same functionality.\n\nautodts\n=======\n\n[![npm version](https://img.shields.io/npm/v/autodts.svg)](https://www.npmjs.com/package/autodts) [![dependency status](https://david-dm.org/charto/autodts.svg)](https://david-dm.org/charto/autodts)\n\n`autodts` generates `.d.ts` files for publishing TypeScript projects on npm.\n\nUsage\n-----\n\nIt's best to run `autodts` from the `package.json` file of a Node.js module. Here's an example:\n\n```json\n{\n  \"name\": \"example\",\n  \"version\": \"0.0.1\",\n  \"description\": \"Example of a TypeScript-based package\",\n  \"scripts\": {\n    \"preinstall\": \"npm install autodts\",\n    \"postinstall\": \"autodts link\",\n    \"prepublish\": \"tsc \u0026\u0026 autodts generate\"\n  },\n  \"typescript\": {\n    \"definition\": \"index.d.ts\"\n  },\n  \"dependencies\": {\n    \"autodts\": \"~0.0.6\",\n    \"@lib/dependency-example\": \"0.0.3\"\n  },\n  \"devDependencies\": {\n    \"@lib/autodts-generator\": \"~0.0.1\",\n    \"typescript\": \"~1.5.3\"\n  }\n}\n```\n\nThe `preinstall` command is needed to work around [npm issue #5001](https://github.com/npm/npm/issues/5001).\n\n`autodts link` checks all packages listed in `dependencies`. If their `package.json` file contains a `typescript` section with a `definition` setting, a reference is added to the output file `typings/auto.d.ts`, for example:\n\n```typescript\n// Automatically generated file. Edits will be lost.\n/// \u003creference path=\"../node_modules/@lib/dependency-example/index.d.ts\" /\u003e\n```\n\nThis allows pulling the type information of all required modules into a TypeScript source file with a single `/// \u003creference path = \"typings/auto.d.ts\" /\u003e` statement.\n\nAn entire tree of npm packages written in TypeScript can be installed with correct references to typings if packages referencing types from others add the above `preinstall` and `postinstall` sections in their `package.json`.\n\nIt's possible to change the output file path using the `--out` parameter, for example: `autodts link --out typings/tsd.d.ts`.\n\n`autodts generate` calls [autodts-generator](https://www.npmjs.com/package/@lib/autodts-generator) to produce a single `.d.ts` file with all type information in the package. It will be automatically written to the path defined in the `definition` setting in the `typescript` section of your `package.json` file. Using it requires a particular package structure, otherwise it's better to use [dts-generator](https://www.npmjs.com/package/dts-generator) directly.\n\nTo use the `generate` command, you should add `@lib/autodts-generator` to your `devDependencies`. `autodts` doesn't automatically require it, because it pulls the entire TypeScript compiler and is not needed for the `link` command.\n\n`autodts link` is meant for the common case of installing TypeScript-based npm packages, `autodts generate` for the rarer event of publishing them.\n\nLicense\n=======\n\n[The MIT License](https://raw.githubusercontent.com/charto/autodts/master/LICENSE)\nCopyright (c) 2015 BusFaster Ltd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fautodts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharto%2Fautodts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fautodts/lists"}