-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CLI Package #26
Add CLI Package #26
Conversation
I think on second thought it's probably not a good idea to add a loading state for requests; looking over command line tools that send requests I haven't found one that does that, and it seems like it would be annoying with piping and redirecting STDOUT. The tool is a little slow, but it's at a relatively similar speed to the site, from what I've been able to check on my machine. At some point I will consider looking at possible optimizations, particularly with handling the But I consider this basically ready? @andrewbranch, would love for you to review the code and possibly publish to NPM 🦊 |
Co-authored-by: Tom Ballinger <[email protected]>
This is super cool, thank you for working on this @ej-shafran! I will take a closer look soon, but one note is I’d like to build with tsc instead of esbuild. |
@andrewbranch sure thing - I was mainly using esbuild because waiting for tsc was getting annoying :) |
If you don't mind, though - is there any reason you'd prefer not to use esbuild? |
|
@andrewbranch makes sense! I've made the change 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! I have some additional thoughts on ignore
that I haven’t fully worked out, and maybe you’ll have input on. I think we also need to be able to ignore entrypoints and resolution kinds, and I’m trying to predict whether I’ll want the flexibility to ignore specific combinations of rules, entrypoints, and resolution kinds, or if blanket ignores in each of the three categories will be sufficient.
I’m thinking about introducing the concept of “profiles” in the future, which will essentially be presets for ignore
. An author of an older library with lots of existing users might want a profile like max-compat
that validates against everything that could be a problem for any user, but I want new libraries to be able to use a profile like esm-only
to ignore the CJS entrypoint, or modern
to ignore the soft-deprecated node10
resolution mode. Those examples don’t require ignoring specific rules in specific entrypoints in specific resolution kinds, so maybe an API like --ignore-rules
, --ignore-entrypoints
, --ignore-resolution-kinds
will be flexible enough.
What do you think?
I do quite like the idea of separating the ability to ignore things by rules, entrypoints, etc. I can start by changing the current As for the profiles - seems like a useful idea; I will try to get to those in a bit. If you have any profiles you'd like me to try and implement, let me know |
Hold off on the profiles for now, because I’m actually halfway through an API change in core, and will eventually backport some of the |
Will do 🙃 |
I've fixed most of the comments you left, @andrewbranch, but I have two questions:
|
|
Will implement 1 when I can As for 2 - the It might be feasible to read |
Oh, that makes sense. I don’t know why I was thinking the tarball stream could be piped. Oh well. |
Alright then - I think this is good? Lmk if there's anything else to change, and if not give it the ol' merge and publish 🙃 |
I added a couple commits:
I think I’m also going to add some snapshot tests just to exercise all the code paths and make sure I don’t inadvertently break anything in the future. I can’t currently push commits to the PR, I think because it’s on the Thanks so much for doing this! I’m really happy with the result. 🌟 |
Still WIP - a CLI for
attw
I've been thinking of writing it in something other than TS, since it feels a little slow, but I'll probably try and add features before doing some sort of rewrite.
Currently supports:
TODOS
cli-table
-E
option)Long Term TODOs
@types
when no types are present