{"id":13515197,"url":"https://github.com/lukasalvarezdev/imports-duplicator","last_synced_at":"2025-06-19T01:38:17.231Z","repository":{"id":125884631,"uuid":"497087825","full_name":"lukasalvarezdev/imports-duplicator","owner":"lukasalvarezdev","description":"A blazingly fast tool that lets you to copy imported files to another directory","archived":false,"fork":false,"pushed_at":"2022-05-28T06:41:54.000Z","size":3507,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T17:50:43.170Z","etag":null,"topics":["golang","typescript"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukasalvarezdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-05-27T17:46:57.000Z","updated_at":"2024-09-17T20:49:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"87e3bb00-7bdf-48e6-8e9f-e2a42eb4bb2c","html_url":"https://github.com/lukasalvarezdev/imports-duplicator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lukasalvarezdev/imports-duplicator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasalvarezdev%2Fimports-duplicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasalvarezdev%2Fimports-duplicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasalvarezdev%2Fimports-duplicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasalvarezdev%2Fimports-duplicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukasalvarezdev","download_url":"https://codeload.github.com/lukasalvarezdev/imports-duplicator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasalvarezdev%2Fimports-duplicator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260664806,"owners_count":23044242,"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":["golang","typescript"],"created_at":"2024-08-01T05:01:07.429Z","updated_at":"2025-06-19T01:38:12.216Z","avatar_url":"https://github.com/lukasalvarezdev.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Welcome to Imports Duplicator!\nA blazingly fast tool that allows you to copy imported files to another directory.\n\n## Get started\n1. Clone this repository.\n2. Set up golang (v1.18)\n3. Run `go test`\n4. Run `go run . \u003csource_path\u003e \u003coutput_file_name\u003e`\n\nIf all that worked, you should have now a directory `/out` with all the files that are being referenced in `\u003csource_path\u003e`\nand a file `\u003coutput_file_name\u003e.ts` with all the info in `\u003csource_path\u003e` but with the imports updated.\n\nThat's it!, now it's time to rock!\n\n## How to use\nVery easy, just run:\n```\ngo build .\n```\n\nNow you should have a binary file `imports-duplicator` in the root directory.\n\n## Usage\n\nThis will execute the binary file, you can use your favorite terminal\n ```\nimports-duplicator \u003csource_path\u003e \u003coutput_file_name\u003e\n ```\n \n ## Example\n \n Your folder structure looks like this:\n \n- `components/...`\n- `types.ts`\n \nThe file `types.ts` that looks like this:\n ```typescript\n import type { User } from '../dir_outside_root/user'\n import type { Address } from '../dir_outside_root/address'\n \n export type { User, Address }\n ```\n \n And your code works just fine in dev, but in the build step for some reason you don't have access\n to `../dir_outside_root`. So to have `dir_outside_root/user.ts` \n and `dir_outside_root/address.ts` avaliable in the build step you would do it like this:\n \n \n```sh\ngo build .\nimports-duplicator types.ts import-from-here\n    \n# Your build step\nnpm run build\n```\n\nIn the build, `import-from-here.ts` would look like this:\n```typescript\n import type { User } from './out/user'\n import type { Address } from './out/address'\n \n export type { User, Address }\n ```\n \n And your folder structure would look like this:\n \n- `components/...`\n- `types.ts`\n- `import-from-here.ts`\n- `out/user.ts`\n- `out/address.ts`\n\n## Known limitations\n- This tool only copies the files that are referenced in the file that you provide, if those files have imports from another\nfiles, it won't copy them.\n- It only works `.ts` files.\n\n## Why would I use this?\nThis helped my team to solve a  * **really** *  specific case (just temporarily), but it's not intended to have a real use, maybe in the future.\n\n## Extra\nI built this project as a part of my learning journey of golang, so you may find this code a bit awful, but I'm open\nand would love any suggestions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasalvarezdev%2Fimports-duplicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukasalvarezdev%2Fimports-duplicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasalvarezdev%2Fimports-duplicator/lists"}