{"_id":"ts-transform-import-path-rewrite","_rev":"168929","name":"ts-transform-import-path-rewrite","description":"TS AST transformer to rewrite import path","dist-tags":{"latest":"0.3.0"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"time":{"modified":"2021-06-03T11:49:31.000Z","created":"2018-11-28T18:52:04.657Z","0.3.0":"2020-11-03T19:11:00.652Z","0.2.1":"2019-06-04T18:32:02.818Z","0.2.0":"2019-05-17T13:38:58.121Z","0.1.4":"2019-03-23T03:29:35.243Z","0.1.3":"2019-03-14T01:21:34.408Z","0.1.2":"2019-02-08T14:17:25.283Z","0.1.1":"2018-11-30T21:34:49.652Z","0.1.0":"2018-11-28T18:52:04.657Z"},"users":{},"author":{"name":"Long Ho","email":"longho@dropbox.com"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"versions":{"0.3.0":{"name":"ts-transform-import-path-rewrite","version":"0.3.0","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"4"},"devDependencies":{"@types/chai":"^4.2.14","@types/fs-extra":"^9.0.3","@types/glob":"^7.1.1","@types/mocha":"^8.0.0","@types/node":"^14.14.6","chai":"^4.2.0","fs-extra":"^9.0.1","glob":"^7.1.3","mocha":"^8.2.1","pre-commit":"^1.2.2","prettier":"^2.1.2","ts-node":"^9.0.0","ttypescript":"^2.5.2"},"gitHead":"12480c3a7c03caed3a3df7cfc4cf772e29759624","_id":"ts-transform-import-path-rewrite@0.3.0","_nodeVersion":"14.12.0","_npmVersion":"6.14.8","dist":{"shasum":"447e95e63e64de43f2ecf9322364f0392f6a60d6","size":9242,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.3.0.tgz"},"_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"directories":{},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.3.0_1604430660523_0.5384705404825159"},"_hasShrinkwrap":false,"publish_time":1604430660652,"_cnpm_publish_time":1604430660652},"0.2.1":{"name":"ts-transform-import-path-rewrite","version":"0.2.1","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"3"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^7.0.0","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^12.0.2","chai":"^4.2.0","fs-extra":"^8.0.1","glob":"^7.1.3","mocha":"^6.1.4","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^8.1.0","ttypescript":"^1.5.6"},"gitHead":"a17ec1818d1ce9b3567958af85d5a37b245bc413","_id":"ts-transform-import-path-rewrite@0.2.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"ca38fd47731bd8e8ef6175eccd5058ab44ed5713","size":8433,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.2.1.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.2.1_1559673122669_0.5677322804493417"},"_hasShrinkwrap":false,"publish_time":1559673122818,"_cnpm_publish_time":1559673122818},"0.2.0":{"name":"ts-transform-import-path-rewrite","version":"0.2.0","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"3"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^10.12.10","chai":"^4.2.0","fs-extra":"^7.0.1","glob":"^7.1.3","mocha":"^5.2.0","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^7.0.1","ttypescript":"^1.5.6"},"gitHead":"a6f89f4bf6cc2a08337973ab4afdd265757c7887","_id":"ts-transform-import-path-rewrite@0.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"dist":{"shasum":"beaebdd9d2f0a6867fc1790c8c247a69f8b870c5","size":8396,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.2.0.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.2.0_1558100337979_0.781542893138615"},"_hasShrinkwrap":false,"publish_time":1558100338121,"_cnpm_publish_time":1558100338121},"0.1.4":{"name":"ts-transform-import-path-rewrite","version":"0.1.4","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"3"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^10.12.10","chai":"^4.2.0","fs-extra":"^7.0.1","glob":"^7.1.3","mocha":"^5.2.0","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^7.0.1"},"gitHead":"c6a3e83ed94095e2199208ffcf327dc556ddc192","_id":"ts-transform-import-path-rewrite@0.1.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"dist":{"shasum":"a43a119454bc72970b89f1131b1b4924b81def1c","size":8430,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.1.4.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.1.4_1553311775103_0.5049046077157089"},"_hasShrinkwrap":false,"publish_time":1553311775243,"_cnpm_publish_time":1553311775243},"0.1.3":{"name":"ts-transform-import-path-rewrite","version":"0.1.3","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"3"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^10.12.10","chai":"^4.2.0","fs-extra":"^7.0.1","glob":"^7.1.3","mocha":"^5.2.0","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^7.0.1"},"gitHead":"72124af94de040fe1f1397986f078864c0a3170b","_id":"ts-transform-import-path-rewrite@0.1.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"dist":{"shasum":"88002c29c3683cc2bac30ad5d384cf0016d6c964","size":8194,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.1.3.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.1.3_1552526494242_0.9858689120892381"},"_hasShrinkwrap":false,"publish_time":1552526494408,"_cnpm_publish_time":1552526494408},"0.1.2":{"name":"ts-transform-import-path-rewrite","version":"0.1.2","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"3"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^10.12.10","chai":"^4.2.0","fs-extra":"^7.0.1","glob":"^7.1.3","mocha":"^5.2.0","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^7.0.1"},"gitHead":"6e011eae6bc84d90bd915608e86f4075a354211f","_id":"ts-transform-import-path-rewrite@0.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"dist":{"shasum":"c166734aa43ac9acdcdc0728c4e9f432cd78cdad","size":7903,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.1.2.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.1.2_1549635445172_0.7811566730193269"},"_hasShrinkwrap":false,"publish_time":1549635445283,"_cnpm_publish_time":1549635445283},"0.1.1":{"name":"ts-transform-import-path-rewrite","version":"0.1.1","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"longho@dropbox.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"3"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^10.12.10","chai":"^4.2.0","fs-extra":"^7.0.1","glob":"^7.1.3","mocha":"^5.2.0","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^7.0.1"},"gitHead":"4f5003e98e9824690545accb01fc60d3b45eea87","_id":"ts-transform-import-path-rewrite@0.1.1","_npmVersion":"5.10.0","_nodeVersion":"8.12.0","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"dist":{"shasum":"f5a249875ca8991eeacaceb69415b58fc33fdd7a","size":7835,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.1.1.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.1.1_1543613689519_0.8304829980742994"},"_hasShrinkwrap":false,"publish_time":1543613689652,"_cnpm_publish_time":1543613689652},"0.1.0":{"name":"ts-transform-import-path-rewrite","version":"0.1.0","description":"TS AST transformer to rewrite import path","main":"dist/index.js","scripts":{"test":"rm -rf test/fixture/*.js && tsc && mocha --require ts-node/register test/*.test.ts","prettier":"prettier --print-width=120 --tab-width=4 --single-quote --trailing-comma=es5 --no-semi --parser=typescript --write 'src/**/*.ts*' || true","prepublishOnly":"tsc","semantic-release":"semantic-release"},"repository":{"type":"git","url":"git+https://github.com/dropbox/ts-transform-import-path-rewrite.git"},"keywords":["typescript","ast","compiler","import","es6","path","rewrite","transformer"],"author":{"name":"Long Ho","email":"holevietlong@gmail.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","dependencies":{"typescript":"^3.1.6"},"devDependencies":{"@types/chai":"^4.1.7","@types/fs-extra":"^5.0.4","@types/glob":"^7.1.1","@types/mocha":"^5.2.5","@types/node":"^10.12.10","chai":"^4.2.0","fs-extra":"^7.0.1","glob":"^7.1.3","mocha":"^5.2.0","pre-commit":"^1.2.2","prettier":"^1.15.2","ts-node":"^7.0.1"},"gitHead":"85b1df9c2b730206578041d588436e5b6bba1882","_id":"ts-transform-import-path-rewrite@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"longlho","email":"holevietlong@gmail.com"},"dist":{"shasum":"3db90161313ed9c2cbb9e499e5a44ad141cad617","size":4213,"noattachment":false,"key":"/ts-transform-import-path-rewrite/-/ts-transform-import-path-rewrite-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ts-transform-import-path-rewrite/download/ts-transform-import-path-rewrite-0.1.0.tgz"},"maintainers":[{"name":"longlho","email":"holevietlong@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transform-import-path-rewrite_0.1.0_1543431124498_0.747465658398244"},"_hasShrinkwrap":false,"publish_time":1543431124657,"_cnpm_publish_time":1543431124657}},"readme":"# ts-transform-import-path-rewrite\n\n![build status](https://travis-ci.org/dropbox/ts-transform-import-path-rewrite.svg?branch=master)\n\nThis is a TypeScript AST Transformer that allows you to rewrite import path in output JS & `d.ts` files accordingly. The primary use case for this is to mitigate different build system import structure, such as relative vs absolute `import` and aliasing output `import` paths.\n\n## Usage\n\n### ttypescript\nExample for ttypescript usage is in `examples/ttypescript`. Run `npx ttsc`.\n\n### Compiler Wrapper\nFirst of all, you need some level of familiarity with the [TypeScript Compiler API](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API).\n\n`compile.ts` & tests should have examples of how this works. The available options are:\n\n### `projectBaseDir: string`\nThis is the base directory of your project folder. This is primarily used to determine the correct path when rewriting relative `import` to `absolute` import.\n\n### `project?: string`\nProject name to rewrite relative `import` to. For example:\n```ts\nimport foo from './foo'\n// Becomes\nimport foo from 'my-project-name/foo'\n```\n \n### `rewrite?(importPath: string, sourceFilePath: string): string`\nCustom rewrite function to rewrite any `import` path we encounter to any new `import` path.\n\n### `alias?: Record<string, string>`\nAlias regex map to replace, e.g:\n```json\n{\n    \"^(foo)$\": \"external/$1\"\n}\n```\n\n## License\n\nCopyright (c) 2018 Dropbox, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","_attachments":{},"homepage":"https://github.com/dropbox/ts-transform-import-path-rewrite#readme","bugs":{"url":"https://github.com/dropbox/ts-transform-import-path-rewrite/issues"},"license":"Apache-2.0"}