{"id":13660547,"url":"https://github.com/ef-carbon/tspm","last_synced_at":"2025-04-24T19:31:10.159Z","repository":{"id":57110742,"uuid":"120443394","full_name":"ef-carbon/tspm","owner":"ef-carbon","description":"A TypeScript path (re-)mapper","archived":true,"fork":false,"pushed_at":"2020-04-30T16:26:38.000Z","size":480,"stargazers_count":66,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-20T16:40:16.737Z","etag":null,"topics":["typescript"],"latest_commit_sha":null,"homepage":"https://ef-carbon.github.io/tspm/","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/ef-carbon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-06T11:10:19.000Z","updated_at":"2024-07-10T15:19:58.000Z","dependencies_parsed_at":"2022-08-20T18:21:05.187Z","dependency_job_id":null,"html_url":"https://github.com/ef-carbon/tspm","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef-carbon%2Ftspm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef-carbon%2Ftspm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef-carbon%2Ftspm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef-carbon%2Ftspm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ef-carbon","download_url":"https://codeload.github.com/ef-carbon/tspm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250693543,"owners_count":21472274,"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":["typescript"],"created_at":"2024-08-02T05:01:22.863Z","updated_at":"2025-04-24T19:31:09.749Z","avatar_url":"https://github.com/ef-carbon.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# EF TypeScript Path Mapper\n\n[![CircleCI][circleci-badge]][circleci]\n[![Code Coverage][codecov-badge]][codecov]\n[![Greenkeeper][greenkeeper-badge]][greenkeeper]\n[![NPM Version][npm-version-badge]][npm]\n[![License][license-badge]][license]\n[![NPM Weekly Downloads][npm-downloads-week-badge]][npm]\n[![NPM Monthly Downloads][npm-downloads-month-badge]][npm]\n[![NPM Yearly Downloads][npm-downloads-year-badge]][npm]\n[![NPM Total Downloads][npm-downloads-total-badge]][npm]\n[![Node Version][node-version-badge]][node-version]\n[![Semantic Release][semantic-release-badge]][semantic-release]\n[![Commitizen friendly][commitizen-badge]][commitizen]\n[![Conventional Commits][coventional-commits-badge]][coventional-commits]\n[![GitHub Commits Since Last Release][github-commits-badge]][github]\n\n\u003e A binary that converts TypeScript path mappings in the compiled output\n\n## Usage\n\n`tsconfig.json`\n```json\n{\n  \"compilerOptions\": {\n    \"outDir\": \"dist\",\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@lib/*\": [\"lib/*\"]\n    }\n  }\n}\n```\n\n```\nyarn add -D @ef-carbon/tspm\n```\n\n`package.json`\n```json\n{\n  \"scripts\": {\n    \"postbuild\": \"ef-tspm\"\n  }\n}\n```\n\n`@lib` will be updated to the correct relative import in the JavaScript files\n\n### JSX\n\nTo process projects that use JSX, install the optional ES parsing and generation modules:\n\n```\nyarn add -D acorn-jsx escodegen-wallaby estraverse-fb\n```\n\n### Library\n\n```typescript\nimport convert, { IOptions, File } from '@ef-carbon/tspm'\n\nconst options: IOptions = {\n  tsconfig: './tsconfig.json'\n};\nconst files = new Set\u003cFile\u003e();\nfor await (const mapped of convert(options)) {\n  files.add(mapped.file);\n}\nfor (const file of files) {\n  await file.write();\n}\n```\n\nRead the [documentation][docs] for library API guidance.\n\n## Development\n\nThe project attempts to make the workflow as frictionless as possible. Any suggestions to improve the work processes are\nwelcomed :metal:\n\n### Getting Started\n\nGet up and running using [yarn][yarn]:\n\n```\nyarn install\nyarn build\n```\n\n### IDE\n\nInstall [Atom][atom] [IDE][atom-ide] with the [TypeScript][atom-ide-typescript] and [XTerm][atom-xterm] plugins\n\n### Hacking\n\nRun `yarn watch:test`. Unit tests will re-run after any changes to the source code.\n\n### Testing\n\nThe unit tests use [Jest][jest].\n\n### Releases\n\nReleases are performed automatically via [`semantic-release`][semantic-release]. When commits are merged to `master`\nthe [Conventional Commits][coventional-commits] are read and version number determined automatically.\n\n### Scripts\n\nThere are various scripts available that provide the workflow steps for the project:\n\n| Name               | Description                                                                                     |\n| ------------------ | ----------------------------------------------------------------------------------------------- |\n| `commit`           | Starts the [commitizen][commitizen] CLI                                                         |\n| `distclean`        | Returns the project to initial state                                                            |\n| `clean`            | Returns the project to postinstall state                                                        |\n| `build`            | Builds the project                                                                              |\n| `build:ts`         | Builds the TypeScript files into the JavaScript output                                          |\n| `format`           | Formats the project                                                                             |\n| `lint`             | Lints the project                                                                               |\n| `lint:fix`         | Fixes up simple linting rule violations automatically                                           |\n| `lint:ci`          | Validates the CI configuration file                                                             |\n| `lint:ts`          | Performs linting of TypeScript files                                                            |\n| `lint:ts:fix`      | Fixes up simple rule violations in TypeScript files                                             |\n| `lint:format`      | Checks the formatting of the TypeScript source code                                             |\n| `lint:format:fix`  | Automatically fixes up formatting violations                                                    |\n| `lint:commit`      | Makes sure the commits follow the [conventional commits][coventional-commits] style             |\n| `watch:ts`         | Watches the TypeScript source files for changes                                                 |\n| `watch:test`       | Re-runs unit tests on any file changes                                                          |\n| `test`             | Tests the project                                                                               |\n| `coverage`         | Provides test coverage statistics for the project                                               |\n| `ci`               | Runs a set of commands that are needed to pass the CI workflow                                  |\n| `fix`              | Performs formatting and linting fixes                                                           |\n| `docs`             | Builds API documentation                                                                        |\n| `docs:open`        | Opens up the built API documentation in the default browser                                     |\n\n## Reports\n\n### Coverage\n\n[![Code Coverage Graph][codecov-graph]][codecov]\n\n\n[greenkeeper]: https://greenkeeper.io/\n[greenkeeper-badge]: https://badges.greenkeeper.io/ef-carbon/tspm.svg\n[docs]: https://ef-carbon.github.io/tspm/\n[yarn]: https://yarnpkg.com\n[npm]: https://www.npmjs.com/package/@ef-carbon/tspm\n[codecov]: https://codecov.io/gh/ef-carbon/tspm\n[codecov-badge]: https://img.shields.io/codecov/c/token/Re0IsMvcF1/github/ef-carbon/tspm.svg\n[codecov-graph]: https://codecov.io/gh/ef-carbon/tspm/branch/master/graphs/commits.svg?token=Re0IsMvcF1\n[npm-version-badge]: https://img.shields.io/npm/v/@ef-carbon/tspm.svg\n[npm-downloads-week-badge]: https://img.shields.io/npm/dw/@ef-carbon/tspm.svg\n[npm-downloads-month-badge]: https://img.shields.io/npm/dm/@ef-carbon/tspm.svg\n[npm-downloads-year-badge]: https://img.shields.io/npm/dy/@ef-carbon/tspm.svg\n[npm-downloads-total-badge]: https://img.shields.io/npm/dt/@ef-carbon/tspm.svg\n[license]: https://choosealicense.com/licenses/mit/\n[license-badge]: https://img.shields.io/npm/l/@ef-carbon/tspm.svg\n[node-version]: https://nodejs.org/en/download/releases/\n[node-version-badge]: https://img.shields.io/node/v/@ef-carbon/tspm.svg\n[github]: https://github.com/ef-carbon/tspm\n[github-commits-badge]: https://img.shields.io/github/commits-since/ef-carbon/tspm/latest.svg\n[atom]: https://atom.io/\n[atom-ide]: https://ide.atom.io/\n[jest]: https://facebook.github.io/jest/\n[atom-ide-typescript]: https://github.com/atom/ide-typescript\n[atom-xterm]: https://atom.io/packages/atom-xterm\n[circleci]: https://circleci.com/gh/ef-carbon/tspm/tree/master\n[circleci-badge]: https://img.shields.io/circleci/project/github/ef-carbon/tspm.svg\n[semantic-release]: https://github.com/semantic-release/semantic-release\n[semantic-release-badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[commitizen]: http://commitizen.github.io/cz-cli/\n[commitizen-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n[coventional-commits]: https://conventionalcommits.org\n[coventional-commits-badge]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fef-carbon%2Ftspm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fef-carbon%2Ftspm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fef-carbon%2Ftspm/lists"}