GeezerVison is showing github.com — refactor: Update calls to prettier functions to account for latest async API by jdalrymple · Pull Request #403 · all-contributors/cli
Conversation
jdalrymple
commented
Jan 25, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What: Due to the prettier update, the API has changed - now exposing async functions
Why: API changes with latest dep version no longer support sync functions
How: Went through each related function and updated them accordingly
Checklist:
- Documentation
- Tests
- Ready to be merged
- Added myself to contributors table
Related to #375
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts:
# package.json
# src/init/__tests__/__snapshots__/add-contributors-list.js.snap
Uh oh!
There was an error while loading. Please reload this page.
jdalrymple
changed the title
[WIP] Testing fixes for prettier update
refactor: Update calls to prettier functions to account for latest async API
Jan 25, 2026
|
|
|
|
|
const absentFile = './abc'
|
|
|
const absentConfileFileExpected = `Configuration file not found: ${absentFile}`
|
|
|
const absentConfigFileExpected = `Configuration file not found: ${absentFile}`
|
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, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jdalrymple reacted with laugh emoji
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.
I try to keep my clean up scope creeps to a minimum, but somethings i just hadddd to fix haha
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
JoshuaKGoldberg reacted with laugh emoji
lwasser reacted with hooray emoji
All reactions
-
😄
1 reaction
-
🎉
1 reaction
|
Once this is in, ill look at the next blocked PR 🫡
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@jdalrymple thank you for this refactor! I have a few questions!
With these refactors we are moving towards ES modules (yay!) ✨
But when i build the package, link/install and run this locally i get an error:
❯ all-contributors init
file:///Users/lblablabla/allcontributors/cli/dist/cli.js:4
const path = require('path');
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '[/[[Users/lblablabla](file:///Users/lblablabla/)](file:///Users/lblablabla/)](file:///Users/lblablabla/allcontributors/cli/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///[Users/lblablabla](file:///Users/lblablabla/)/allcontributors/cli/dist/cli.js:4:14
at ModuleJob.run (node:internal/modules/esm/module_job:343:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
- As we refactor, do we need to add
"type": "module" to support this in our package.json ? But if we add that then how do we manage the older syntax? neither work for me locally when i run all-contributors init . (adding it or not adding it) but it seems like something is off. If this is a larger dependency issue then maybe we do have to merge as is
- If not, am i doing something wrong when i build and install locally:
npm run build
npm link
We could also merge this and just add that in a separate pr (if needed) bare with me!
I ask this seeing that tests pass. And i'm fine with smaller quicker iterations
and if this is what others see, we probably need to add a test or two to catch it. but please let's start with making sure you can see the same issue that I see locally! THANK YOU!!
|
jdalrymple reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ok so when i don't add type:module (maybe the build system standardizes things? i haven't looked yet... i get a TYPEERROR related to yargs
TypeError: yargs.scriptName is not a function
at getArgs (/Users/leahawasser/Documents/GitHub/allcontributors/cli/dist/cli.js:16:16)
at run (/Users/leahawasser/Documents/GitHub/allcontributors/cli/dist/cli.js:99:18)
at Object.<anonymous> (/Users/leahawasser/Documents/GitHub/allcontributors/cli/dist/cli.js:119:1)
at Module._compile (node:internal/modules/cjs/loader:1706:14)
at Object..js (node:internal/modules/cjs/loader:1839:10)
at Module.load (node:internal/modules/cjs/loader:1441:32)
at Function._load (node:internal/modules/cjs/loader:1263:12)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Function.e
I think this might be a yargs version error . I looked at the tests when i merged pr's but i didn't test the CLI each time assuming test coverage.
|
jdalrymple reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ok it was bugging me - the fix is actually pinning yargs back to "yargs": "17.7.2". This is indeed a dependency issue. And the api was already broken and i missed it. thank goodness it's not deploying. I propose that we merge this. And we will have a larger set of fixes as we upgrade dependencies.
|
jdalrymple reacted with laugh emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
opening a quick pr to modify yargs
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jdalrymple reacted with thumbs up emoji
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Mar 6, 2026
This was referenced Oct 23, 2026
Reviewers
lwasser
lwasser approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|