Skip to content

Commit eb5dd76

Browse files
committed
Improve REAMDE
1 parent 1708aca commit eb5dd76

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed

README.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ bun install
66

77
To run:
88

9-
```bash
9+
```
1010
bun run src/index.ts
1111
1212
Usage: index [options] [command]
@@ -15,22 +15,38 @@ Options:
1515
-h, --help display help for command
1616
1717
Commands:
18-
fix-package-use [options] [directory] Find unused packages in a project directory
19-
move-file-package <source-file> <target-directory> Move a file to a package directory and update its
20-
exports
18+
service-glide <repo-path> Do everything to remove indirect imports
19+
parse-file <file>
20+
fix-package-use [options] <directory> Add/remove Glide package imports from a package, depending
21+
on whether they are used
22+
move-file-package <source-file> <target-directory> Move a file to a package directory and update its exports
2123
barrel-export <package-dir> <source-paths...> Generate a barrel export for a package
2224
rewrite-imports <name> <from-path> <to-path> <source-paths...> Rewrite import paths in a project
23-
count-dependency-imports [directory] Iterates through each package dependencies with nx
24-
output and counts the imports of each one. Useful
25-
for finding instances of light imports where
26-
dependencies could be moved.
27-
dedup-imports <source-paths...> Rewrites multiple imports of the same package to a
28-
single import
29-
verbatim-imports <source-paths...> Rewrites imports to use the verbatim import syntax
30-
with explicit extensions
25+
count-dependency-imports [directory] Iterates through each package dependencies with nx output
26+
and counts the imports of each one. Useful for finding
27+
instances of light imports where dependencies could be
28+
moved.
29+
dedup-imports [options] <source-paths...> Rewrites multiple imports of the same package to a single
30+
import
31+
verbatim-imports <source-paths...> Rewrites imports to use the verbatim import syntax with
32+
explicit extensions
33+
resolve-imports [options] <packages-path> <source-paths...> Resolve imports of re-exported symbols
34+
count-imports <source-paths...> Count the number of imports of each symbol
35+
remove-re-exports <source-paths...> Remove re-exports of symbols
3136
help [command] display help for command
3237
```
3338

39+
## service-glide
40+
41+
This is what you want to use if you're moving stuff between packages and need
42+
to clean up. Please watch the video first:
43+
44+
https://www.loom.com/share/3995cb910caf4f3b85113ff4e957d2d9
45+
46+
```sh
47+
bun run service-glide ~/Work/glide
48+
```
49+
3450
## fix-package-use
3551

3652
Finds and removes unused packages from `package.json`.

src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ import { serviceGlide } from "./service-glide";
1414

1515
const program = new Command();
1616

17+
program
18+
.command("service-glide")
19+
.argument("<repo-path>", "Path to the Glide repository")
20+
.description("Do everything to remove indirect imports")
21+
.action(async (repoPath) => {
22+
serviceGlide(repoPath);
23+
});
24+
1725
program
1826
.command("parse-file")
1927
.argument("<file>")
@@ -138,12 +146,4 @@ program
138146
removeReExports(sourceFilePaths);
139147
});
140148

141-
program
142-
.command("service-glide")
143-
.argument("<repo-path>", "Path to the Glide repository")
144-
.description("Do everything to remove indirect imports")
145-
.action(async (repoPath) => {
146-
serviceGlide(repoPath);
147-
});
148-
149149
await program.parseAsync(process.argv);

0 commit comments

Comments
 (0)