{"_id":"@bobfrankston/reloc","_rev":"4-47d35b9d16088ec9ca1a299489f8fcad","name":"@bobfrankston/reloc","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"name":"@bobfrankston/reloc","version":"1.0.1","keywords":["npm","rescope","rename","relocate"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/reloc@1.0.1","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/reloc#readme","bugs":{"url":"https://github.com/BobFrankston/reloc/issues"},"bin":{"reloc":"cli.js"},"dist":{"shasum":"8bd3352d879a7088e96dea3c9589abd733b9e6d3","tarball":"https://registry.npmjs.org/@bobfrankston/reloc/-/reloc-1.0.1.tgz","fileCount":5,"integrity":"sha512-vMWu1y13ZnHZdtkTLKU+DR/ZHeuym5W38thTHBRc9bwxZ2kwaCbp0QHDNz+UWyyXuO++T9uzpXVXJ0fyB+xR9g==","signatures":[{"sig":"MEUCIQD4772dNi1DQ3vRNzV5WyvnQTY2eOWe66cKOzUbf8xRvQIgO940canvUMyqBJiLMYW4GKEwutVEWBZLZruwRPnl0nw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34420},"main":"lib.js","type":"module","_from":"file:bobfrankston-reloc-1.0.1.tgz","types":"./lib.d.ts","scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"y:\\dev\\utils\\reloc\\bobfrankston-reloc-1.0.1.tgz","_integrity":"sha512-vMWu1y13ZnHZdtkTLKU+DR/ZHeuym5W38thTHBRc9bwxZ2kwaCbp0QHDNz+UWyyXuO++T9uzpXVXJ0fyB+xR9g==","repository":{"url":"git+https://github.com/BobFrankston/reloc.git","type":"git"},"_npmVersion":"11.7.0","description":"Rescope and relocate npm packages across a dev tree","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/rmfc":"^1.0.295"},".dependencies":{"@bobfrankston/rmfc":"file:../../projects/npm/rmfc"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/reloc_1.0.1_1771464528049_0.7307446894213414","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bobfrankston/reloc","version":"1.0.2","keywords":["npm","rescope","rename","relocate"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/reloc@1.0.2","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/reloc#readme","bugs":{"url":"https://github.com/BobFrankston/reloc/issues"},"bin":{"reloc":"cli.js"},"dist":{"shasum":"90c89fb564555c8b2d2052474671d46f966824d2","tarball":"https://registry.npmjs.org/@bobfrankston/reloc/-/reloc-1.0.2.tgz","fileCount":5,"integrity":"sha512-fo8USZDBMLDC0LweCZBgYlVIwLd3Wpa85itrllEqRbb6YdIFAVFIkorBwtTDVgSZf29Gt/u20x6RNr4I4ekl4w==","signatures":[{"sig":"MEUCIQCxyGAcbwWukq8uUS+ZqS23QY6TV05D5PMXwZEfJ0tEIgIgffSqOtf2aG4ISrpkb51wNrKMrfjRshBFPqfYQZ2zq6E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34420},"main":"lib.js","type":"module","_from":"file:bobfrankston-reloc-1.0.2.tgz","types":"./lib.d.ts","scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"y:\\dev\\utils\\reloc\\bobfrankston-reloc-1.0.2.tgz","_integrity":"sha512-fo8USZDBMLDC0LweCZBgYlVIwLd3Wpa85itrllEqRbb6YdIFAVFIkorBwtTDVgSZf29Gt/u20x6RNr4I4ekl4w==","repository":{"url":"git+https://github.com/BobFrankston/reloc.git","type":"git"},"_npmVersion":"11.7.0","description":"Rescope and relocate npm packages across a dev tree","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/rmfc":"^1.0.295"},".dependencies":{"@bobfrankston/rmfc":"file:../../projects/npm/rmfc"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/reloc_1.0.2_1771472780886_0.2728834110895315","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bobfrankston/reloc","version":"1.0.3","keywords":["npm","rescope","rename","relocate"],"author":{"name":"Bob Frankston"},"license":"MIT","_id":"@bobfrankston/reloc@1.0.3","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"homepage":"https://github.com/BobFrankston/reloc#readme","bugs":{"url":"https://github.com/BobFrankston/reloc/issues"},"bin":{"reloc":"cli.js"},"dist":{"shasum":"01da934b7f329c9e35fcabba5cd13965fbdeaac7","tarball":"https://registry.npmjs.org/@bobfrankston/reloc/-/reloc-1.0.3.tgz","fileCount":6,"integrity":"sha512-8teVDelQXlCP+EumufkFyNe0p+y2tWQcjKX3pjHD222UOsMoW2dRxAWj9haiZIie+OD3AMPmG4cQBIS3u1gIfQ==","signatures":[{"sig":"MEUCIQDIC0L220zjJqqqTzeNJks6aYcA/iA5kLzKAM0Qi8IIyAIgcxMdWD96uTRvvN807comWhXM/82xa8ednRbDBGamEyI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46982},"main":"lib.js","type":"module","_from":"file:bobfrankston-reloc-1.0.3.tgz","types":"./lib.d.ts","scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"_resolved":"y:\\dev\\utils\\reloc\\bobfrankston-reloc-1.0.3.tgz","_integrity":"sha512-8teVDelQXlCP+EumufkFyNe0p+y2tWQcjKX3pjHD222UOsMoW2dRxAWj9haiZIie+OD3AMPmG4cQBIS3u1gIfQ==","repository":{"url":"git+https://github.com/BobFrankston/reloc.git","type":"git"},"_npmVersion":"11.7.0","description":"Rescope and relocate npm packages across a dev tree","directories":{},"_nodeVersion":"25.3.0","dependencies":{"@bobfrankston/rmfc":"^1.0.295"},".dependencies":{"@bobfrankston/rmfc":"file:../../projects/npm/rmfc"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/reloc_1.0.3_1771479208056_0.1974631160698297","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bobfrankston/reloc","version":"1.0.4","description":"Rescope and relocate npm packages across a dev tree","main":"lib.js","type":"module","bin":{"reloc":"cli.js"},"scripts":{"build":"tsc","watch":"tsc -w","release":"npmglobalize"},"keywords":["npm","rescope","rename","relocate"],"author":{"name":"Bob Frankston"},"license":"MIT","dependencies":{"@bobfrankston/rmfc":"^1.0.295"},"devDependencies":{"@types/node":"^25.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/BobFrankston/reloc.git"},".dependencies":{"@bobfrankston/rmfc":"file:../../projects/npm/rmfc"},"types":"./lib.d.ts","_id":"@bobfrankston/reloc@1.0.4","bugs":{"url":"https://github.com/BobFrankston/reloc/issues"},"homepage":"https://github.com/BobFrankston/reloc#readme","_integrity":"sha512-iLzdS8s2Uel6qHWr1ycvcaUpWPlL/lGuMhBKLaRZ0FflXlCCWBdBoN4MenMNLiW3GfWkCQWuL7wuL0hIIFjA1g==","_resolved":"Y:\\dev\\utils\\reloc\\bobfrankston-reloc-1.0.4.tgz","_from":"file:bobfrankston-reloc-1.0.4.tgz","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-iLzdS8s2Uel6qHWr1ycvcaUpWPlL/lGuMhBKLaRZ0FflXlCCWBdBoN4MenMNLiW3GfWkCQWuL7wuL0hIIFjA1g==","shasum":"1816099f5f84a671767a739a46c8d78dbc18708f","tarball":"https://registry.npmjs.org/@bobfrankston/reloc/-/reloc-1.0.4.tgz","fileCount":7,"unpackedSize":66149,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBe0A8MZLSBWzvrKM/Mfh6OTYaE73LS0/KlPhtCTVvh6AiEA0bw8gzDVnyObd3hWob1doNgGCEdZclX0j4MroVFDA5c="}]},"_npmUser":{"name":"bobfrankston","email":"npm@bob.ma"},"directories":{},"maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/reloc_1.0.4_1771772380665_0.4813060003578724"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-19T01:28:47.949Z","modified":"2026-02-22T14:59:41.293Z","1.0.1":"2026-02-19T01:28:48.193Z","1.0.2":"2026-02-19T03:46:21.018Z","1.0.3":"2026-02-19T05:33:28.214Z","1.0.4":"2026-02-22T14:59:40.811Z"},"bugs":{"url":"https://github.com/BobFrankston/reloc/issues"},"author":{"name":"Bob Frankston"},"license":"MIT","homepage":"https://github.com/BobFrankston/reloc#readme","keywords":["npm","rescope","rename","relocate"],"repository":{"type":"git","url":"git+https://github.com/BobFrankston/reloc.git"},"description":"Rescope and relocate npm packages across a dev tree","maintainers":[{"name":"bobfrankston","email":"npm@bob.ma"}],"readme":"# reloc\n\nRescope and relocate npm packages across a dev tree.\n\nHandles renaming unscoped packages (e.g., `dbx10` -> `@bobfrankston/dbx10`) and moving package directories to new locations, updating all `file:` references and `.ts` imports in consumers.\n\n## Install\n\n```\nnpm install -g @bobfrankston/reloc\n```\n\n## Modes\n\n### `-bridge` (gradual migration)\n\nCreates a copy of the package with the new scoped name, archives the original to `prev/`, and leaves a re-export shim in the original location. Existing consumers keep working via the shim while you migrate them one at a time.\n\n```\nreloc dbx10 @bobfrankston/dbx10 -bridge\n```\n\nWhat happens:\n1. Copies `dbx10/` to `dbx10b/` with name `@bobfrankston/dbx10`\n2. Archives original `dbx10/` to `prev/dbx10-MMDDYY`\n3. Creates a shim at `dbx10/` that re-exports from `@bobfrankston/dbx10`\n4. Writes `consumers.txt` in the bridge dir listing all consumers\n\nUse `-target <dir>` to override the bridge directory (default: `<olddir>b`).\n\n### `-inplace` (rename in place)\n\nRenames the package in its existing directory. No bridge, no shim. Consumers break until migrated.\n\n```\nreloc dbx10 @bobfrankston/dbx10 -inplace\n```\n\n### `-scan`\n\nFinds all consumers of a package across directory trees and writes `consumers.txt`.\n\n```\nreloc dbx10 @bobfrankston/dbx10 -scan\nreloc dbx10 @bobfrankston/dbx10 -scan -dirs y:\\dev\\homecontrol\n```\n\n### `-apply <dir>`\n\nMigrates consumers to the package in `<dir>`. Reads old/new names from `consumers.txt` in that directory. For each consumer: uninstalls old name, installs new name (preserving `file:` paths), updates `.ts` imports, recompiles.\n\n```\nreloc -apply y:\\dev\\homecontrol\\utils\\dbx10b -dirs y:\\dev\\homecontrol\n```\n\nRequires `-dirs` to specify which trees to scan/migrate.\n\n### `-back <dir>`\n\nReverses a bridge. Moves real code from the bridge dir back to the original location, bridge becomes a shim. Generates `consumers.bat` to reinstall in each consumer.\n\n```\nreloc -back y:\\dev\\homecontrol\\utils\\dbx10b\n```\n\n`<dir>` must end in `b` (the bridge convention).\n\n### `-move <from> <to> [newname]`\n\nPreview moving a package directory. Shows what consumers have `file:` refs pointing to the old location and what paths would change. Dry run by default.\n\n```\nreloc -move y:\\dev\\projects\\nodejs\\sql\\sqllib y:\\dev\\projects\\sql\\sqllib\nreloc -move y:\\dev\\projects\\nodejs\\sql\\sqllib y:\\dev\\projects\\sql\\sqllib @bobfrankston/sqllib\n```\n\nIf the package name is unscoped (no `@`), a warning is shown since rescoping is often the reason for a move.\n\n### `-apply-move <from> <to> [newname]`\n\nActually executes the move: copies to new location, updates all `file:` refs in consumers, generates `cleanup.bat` (archive old dir after reboot) and `reinstall.bat` (npm install in each consumer).\n\n```\nreloc -apply-move y:\\dev\\projects\\nodejs\\sql\\sqllib y:\\dev\\projects\\sql\\sqllib\nreloc -apply -move y:\\dev\\projects\\nodejs\\sql\\sqllib y:\\dev\\projects\\sql\\sqllib\nreloc -move y:\\dev\\projects\\nodejs\\sql\\sqllib y:\\dev\\projects\\sql\\sqllib -apply\n```\n\n`-apply` and `-move` can be separate flags in any order — they combine to mean \"live move\". `-apply-move` as a single flag also works.\n\nIf `[newname]` is provided, also renames the package (updates `name` in package.json, renames dep keys in consumers, updates `.ts` imports).\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `-dirs <d1> [d2 ...]` | Directory trees to scan/migrate (default: `y:\\dev`) |\n| `-target <dir>` | Override bridge directory (default: `<olddir>b`) |\n| `-tree <dir>` | Root of dev tree (default: `y:\\dev`) |\n| `-verbose`, `-v` | Show detailed output |\n| `-help`, `-h` | Show help |\n\n## Workflow Example\n\nRescoping `dbx10` to `@bobfrankston/dbx10` across a large tree:\n\n```bash\n# 1. Create bridge (copies package, archives original, leaves shim)\nreloc dbx10 @bobfrankston/dbx10 -bridge\n\n# 2. Migrate one subtree at a time\nreloc -apply y:\\dev\\homecontrol\\utils\\dbx10b -dirs y:\\dev\\homecontrol\\utils\nreloc -apply y:\\dev\\homecontrol\\utils\\dbx10b -dirs y:\\dev\\homecontrol\\Others\n\n# 3. When all consumers migrated, reverse the bridge\nreloc -back y:\\dev\\homecontrol\\utils\\dbx10b\n\n# 4. Run the generated consumers.bat to npm install everywhere\n```\n\n## Key Behaviors\n\n- **Dry run by default** for `-move` and `-scan`. Use `-apply` or `-apply-move` to execute.\n- **Idempotent**: skips consumers already using the new name; cleans up stale old-name entries.\n- **Preserves `file:` refs**: when renaming deps, the relative path is recomputed, not lost.\n- **Honors `noEmit`**: projects with `noEmit: true` in tsconfig skip the `tsc` step (e.g., bun projects).\n- **Skips generated files**: when copying, `.js`, `.d.ts`, `.map` files are skipped if a corresponding `.ts` source exists.\n- **Skips `node_modules/`, `prev/`, `.git/`, `cruft/`** when scanning.\n- **Marks consumers.txt**: `✓` for success, `✗` with error note for failures.\n\n## Files Generated\n\n| File | When | Purpose |\n|------|------|---------|\n| `consumers.txt` | `-bridge`, `-scan` | Lists all consumers with status marks |\n| `consumers.bat` | `-back` | Reinstalls package in each consumer |\n| `cleanup.bat` | `-apply-move` | Archives old directory after reboot |\n| `reinstall.bat` | `-apply-move` | Runs npm install in each consumer |\n","readmeFilename":"README.md"}