T
tscircuit3mo ago
Abse

CLI update snapshot

@Seve CLI update snapshot
30 Replies
Abse
AbseOP3mo ago
I have no idea what is wrong
Seve
Seve3mo ago
😭
Abse
AbseOP3mo ago
I tried AI help and it's going crazy on me
Seve
Seve3mo ago
Can you replicate in a test Whats the issue exactly?
Abse
AbseOP3mo ago
the issue when you use it in another repo like corpus it say
No description
Abse
AbseOP3mo ago
even If it's installed the dynamic import not working chat gpt saying I need to use const resolvedPath = import.meta.resolve("looks-same") to fix it but idk
Seve
Seve3mo ago
Does bun setup help you quickly test? That should install a custom cli globally If I had to guess I think the problem has to do with multiple tsci versions running a global installation might not know about your local installations version of looks-same You can use “which tsci” to determime which is being run bunx tsci will execute a local version (ie the one corpus has installed)
Abse
AbseOP3mo ago
abse@DESKTOP-DJTK2QV:~/cli$ which tsci /home/abse/.bun/bin/tsci
Seve
Seve3mo ago
Yea thats the global install right
Abse
AbseOP3mo ago
yeah
Abse
AbseOP3mo ago
No description
Abse
AbseOP3mo ago
bunx
Seve
Seve3mo ago
So would require a global version of looks-same Yea this one should work Try bunx —bun tsci snapshot too I can take a look in ~15 but a bit of a busy morning
Abse
AbseOP3mo ago
No description
Seve
Seve3mo ago
We can also try to make looks-same a dependency
Abse
AbseOP3mo ago
a dev dep ? in cli ?
Seve
Seve3mo ago
Regular dep i think
Abse
AbseOP3mo ago
in cli we have a ci to preven that
Seve
Seve3mo ago
Idk why we didn’t cant remember I think there is a way to say “ignore this dep”
Abse
AbseOP3mo ago
ok
Seve
Seve3mo ago
You will need to specify for bun build that looks-same is external https://bun.sh/docs/bundler#external
Bun
Bun.build – Bundler | Bun Docs
Bundle code for consumption in the browser with Bun's native bundler.
Seve
Seve3mo ago
We bundle the entire cli but we cant bundle looks-same or more specifically sharp Idk your approach should also work tbh
Abse
AbseOP3mo ago
@Seve "build:bun": "bun build ./cli/main.ts --target node --outfile ./dist/main.js --external looks-same" can we do this.
Seve
Seve3mo ago
If it works then yes!!!
Abse
AbseOP3mo ago
how can I test it ?
Seve
Seve3mo ago
You should verify that the dist directory size is different
Abse
AbseOP3mo ago
ok the smoke test is not failing now + all tests passed (the dist sile size didn't chagne tho) @Seve
Abse
AbseOP3mo ago
there is also this cli/entrypoint.js file idk what changed in it , I didn't touch it @Seve IT WORKSSSSS 🎉
Seve
Seve3mo ago
awesome!!!!

Did you find this page helpful?