-
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
feat: profile
option
#201
feat: profile
option
#201
Conversation
🦋 Changeset detectedLatest commit: 8f9afe0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Any update on this? |
This PR doesn’t implement anything like the direction I said I’d like to go in #112 (comment), isn’t tested, and doesn’t have any effect on the exit code. Since I don’t have a ton of time to commit to this myself, I’m willing to accept a contribution, but it will have to be a contribution where we collaborate on speccing out exactly what the desired behavior is. |
Is true. This is proposal to resolve the most immediate request that I and others have run into. The recommendation for profiles is not hashed out. It would be possible to build that support on top of these changes. I am unsure of the value gained from just doing profiles to specific things curated versus having the option of full control. Middle ground maybe to have a custom profile option that enables ugly ignore to options.?
I locally modified testing but was getting a bunch of what seemed unrelated failures. I then tried testing without any changes and got similar results. This is on Windows system. I don't know what exactly I should expect and it looked too gnarly to investigate. I ran into other problems trying to use repo as configured and expect the config is not robust. For example, pnpm engine versus lockfile. So, I left out any test changes and hoped for some collaboration if there is any value here. I probably should have started a comment thread in here.
Well, apparently these changes are garbage... Clearly, we need things to be tested. I thought I manually confirmed a good exit result, but we shouldn't trust humans (I know I fail when I trust myself too often.) Looking at the code I can see a way to adjust.
I don't know that I can handle test updates though. Maybe I need Linux + node 20+. My Ubuntu is on 18 and there appears to be an issue with nodejs.org today preventing me from even trying 20. Currently I have v18 (which root package.json claims is okay). Below is my attempt to install, build, and test on fresh Ubuntu clone:
|
I figured out the test running limitations. The test command syntax is using glob which requires node version 22. The execution errors then stop on Windows, but no tests are run. With node 22 I was able to fully run tests on Ubuntu. |
Add option to ignore resolution modes such as `Node10`. Via config: `ignoreResolutions` Via cli: `--ignoreResolutions` Option to skip validation for Node10 arethetypeswrong#112
Add four profiles: - `strict` - same as today; all resolutions - `node16` - ignores node10 resolution failures - `esm-only` - ignores CJS resolution failures - `node16-only` - strictly node16 resolutions
and add profile test cases Defects (and general results) ignored because of resolution being ignored by profile are shown with "(ignored)" qualifier.
acca169
to
2378133
Compare
FYI, I’ll be on vacation without a computer until mid-October. This may take some time for me to get to, but I’m excited about this work! Thanks for your patience! |
@andrewbranch, how was your vacation? Just adding a little nudge for review of this work. |
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.
Sorry for the delay! Let’s get this merged soon 👍
packages/cli/src/profiles.ts
Outdated
"esm-only": { | ||
ignoreResolutions: ["node10", "node16-cjs"], | ||
}, | ||
"node16-only": { |
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.
Can we remove this one? I can’t think of a good reason why something should pass node16
but fail bundler
.
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.
It will be your call. I don't know when bundler might not work for something. I would expect that there are some packages that never intend to be bundled and "node16-only" lets that intent be specified.
Add
profile
option for classes of resolution (and rules) support.Via config:
profile
Via cli:
--profile
Currently profiles only list resolutions that are ignored.
Four profiles added:
strict
- same as before; all resolutionsnode16
- ignores node10 resolution failuresesm-only
- ignores CJS resolution failuresnode16-only
- strictly node16 resolutionsAnalysis is unchanged. Rendered output (excluding json) and exit codes reflect resolutions ignored by profile. Defects (and general results) are qualified by "(ignored)" or similar when they are not required by profile.
Resolves: #112 Option to skip validation for Node10