-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🐛 BUG: Can't pass renderers to create-astro #2045
Comments
Have you tried with an extra
|
No, I tried with This is the code in const cleanArgv = process.argv.filter((arg) => arg !== '--');
const args = yargs(cleanArgv);
prompts.override(args); Since |
It looks like we can pass a Another solution would be to format the |
A simple solution would be to modify const cleanArgv = process.argv.filter((arg) => arg !== '--');
- const args = yargs(cleanArgv);
+ const args = yargs(cleanArgv, { array: ['renderers'] });
prompts.override(args); That way |
Ah, thanks for the explanation! I skimmed the issue and didn't grok the whole problem. I'm happy to review a PR, that would be much appreciated! |
What version of
astro
are you using?[email protected]
What package manager are you using?
yarn
What operating system are you using?
Mac
Describe the Bug
Trying to create an application passing all the expected arguments fails.
Steps to reproduce
Running:
Fails with:
I debugged it a bit and it seems the underlying
prompts
package doesn't format the overrides based on the question type. Therefore, therenderers
value ends up being"@astrojs/renderer-preact"
instead of["@astrojs/renderer-preact"]
. Any non-string argument won't be formatted to the expected format.The
prompts
package itself should support this and the best solution might be to solve this there. But given the usage of it, it's an implementation detail for consumers of this CLI, it still is an issue with thecreate-astro
CLI. If it's not solved inprompts
, thecreate-astro
package can still provide a workaround by formatting therenderers
appropriately or by choosing a different library for prompts that might support this.Link to Minimal Reproducible Example
Can't provide as it happens with the
create-astro
package when creating an Astro app.The text was updated successfully, but these errors were encountered: