-
Notifications
You must be signed in to change notification settings - Fork 43
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
Can I run npx arethetypeswrong
(CLI for library authors)
#15
Comments
npx arethetypeswrong
No, but I’d like to make a CLI eventually. |
maybe via https://github.com/natemoo-re/clack? 🧐 |
npx arethetypeswrong
npx arethetypeswrong
(CLI for library authors)
Have you seen the web UI of this project? clack looks way too pretty 🤪 |
I just got this working, and added it to Redux Toolkit's "check published artifact in CI" job: edit And now I've got that suite of examples being used over in the |
That looks great! I would take a PR for it. I have some vague ideas for making the CLI experience different from the web experience, but since it’s low on my priority list, I’d be happy to run with this in the meantime since a few people have asked for it. I think the only thing I would need to add for the minimum bar is a severity system and a way to expect or ignore violations (for exit code purposes). I’ve had to tell people a few times already that the info the site shows you is just information and there are cases where it’s ok for a package not to show all green checks. Being ESM-only is an important enough compatibility restriction to show in the tool, but by showing it I don’t mean to prescribe that no package should ever be ESM-only. |
Just found this (thanks @karlhorky), and indeed, a CLI and/or github action would be absolutely wonderful. Would also be great to get a README badge for this so projects can p[roudly show off their standard compliance! |
Yeah, I'm pretty sure that the code I've got in https://github.com/reduxjs/redux-toolkit/tree/master/examples/publish-ci/are-the-types-wrong can be turned into both a standalone CI tool and a Github Action pretty straightforwardly! But someone else needs to do it :) I've got entirely too many other things on my mind atm. |
Happy to take over if you don't mind. It'd be a few days before I can get to it too but I think this would be immensely useful! |
This has helped me so much already. I still got quite a few question marks around how things work in some scenarios, for instance that which @markerikson is also describing with publishing of CJS & ESM in parallel. My situation is slightly different though because I'm trying to stay as close as possible to Anyways, thanks for putting this together @andrewbranch and for starting that CLI @markerikson. I can't promise when I can get to it yet (probably right after easter), but I'll definitely turn this into a github action & standalone cli. Will report back here. |
This is fantastic. I think it's an excellent idea to make use of TypeScripts understanding of module resolution. Thanks for the work @andrewbranch! A CLI with a meaningful exit code and the option to ignore violations would be very helpful. I would love to run this in CI, either by giving a path to a package, or by doing an Ignoring violations by ProblemKind, and optionally narrowing to a specific ResolutionKind and entrypoint seems useful. |
Here is a small piece of code that does the analysis on a package in the local file system instead of a tarball: https://gist.github.com/timostamm/3797825096a418b1f4c97d979e2d4ae7 Running |
I'd love to use the cli as well. @fubhy are you still interested? Would be so awesome |
If no one is working on the CLI I'd love to take it on 😃 Or, if work is still being done, I'd love to help! @timostamm @fubhy |
Sorry I completely forgot about this. I don't have time for it in the next few weeks so feel free to take it on! <3 |
@ej-shafran @fubhy fwiw as far as I'm concerned the CLI is basically written already :) Someone needs to take that and officially publish it as a package or something. (Probably with @timostamm 's changes for analyzing a |
@markerikson wish I'd seen that this morning 😆 I've opened a WIP PR with what I've done already - I'll take a look at your work when I have a minute and see what I can apply from it |
@ej-shafran yep, feel free to grab whatever looks useful out of that! Biggest thing I noticed from a quick glance is you're using a table lib or something, and I used the Looking forward to whatever gets pulled together and published! |
woah, happy to see all this progress (even as recent as 3 hours ago!) I'm using turborepo to lint my packages:
I'm super excited to add a ya'll are awesome 🥳 |
@ej-shafran’s PR at #26 looks really awesome! I just put up my initial review with some suggestions about config options and thoughts on |
@arethetypeswrong/cli is published 🥳 Thanks @ej-shafran! |
@andrewbranch will you add something to the readme ? I'd love to know how to use the CLI : ) |
@mesqueeb I do think adding something to the README would be nice, but for the meanwhile you can look at the |
You can run the CLI in a local project like this: npx @arethetypeswrong/cli $(npm pack) This seems to work in a Linux shell but also Windows PowerShell (haven't tried any others). A nice improvement would be to automate the Thank you for the work on this :) |
For folks using Yarn:
|
Can I run
npx are-the-types-wrong
in my library, or pointed to a package.json, or to an npm URL, or a project, andbe told if I am doing it right
so I don’t have to read that long README.md 🙈
The text was updated successfully, but these errors were encountered: