-
-
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
feat(cli): scaffold out astro add
command
#2849
Conversation
🦋 Changeset detectedLatest commit: 6e0eed5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
e7830ca
to
4a9f257
Compare
@natemoo-re I love the logging you've made! I've added some spinners, what do you think? |
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.
The interactive prompt is great! I've added some comments
A few of us just got a demo of this and I can confirm it's awesome. Thank you again @JuanM04 for kicking this effort off, and @natemoo-re for helping to carry it over the line. I chatted with some of the other core maintainers, and the plan is to release this as "experimental" in the docs and any READMEs that reference the command. We'll use the next couple of weeks to gather feedback from users before formalizing support. |
33f538c
to
6e0eed5
Compare
* feat(cli): scaffold out `astro add` command * added first babel transforms * Format output * Added changes confirmation * Error flow * Add dependencies * feat(cli): astro add cleanup pass * feat: add support for tailwind * chore: update lockfile * fix: types * chore: rever @proload/core bump * chore: add changeset * chore: rollback dep update * Added spinners * chore: remove extra deps * Removed extra argument * Use `execa` instead of `exec` * Changed how lines are trimmed within diffLines * refactor: move add to core * refactor: remove old add entrypoint * refactor: simplify wording * feat: improve diff * feat: improve diff and logging, add interactive prompt when no args passed * Formatted files * Added --yes * feat: improve logging for install command * Fixed execa * Added help message to add * refactor: extract consts to own file * feat: remove implicit projectRoot behavior * feat: improve error handling, existing integrations * fix(tailwind): ensure existing tailwind config is not overwritten * refactor: prefer cwd to projectRoot flag * chore: add refactor notes * refactor: throw createPrettyError > implicit bail * refactor: cleanup language * feat(cli): prompt user before generating tailwind config * fix(cli): update config generation to use cwd * fix: resolve root from cwd * chore: update changelog Co-authored-by: JuanM04 <[email protected]>
Changes
Introduces a new
astro add
command to automatically configureintegrations
.astro add preact --yes
will skip any prompts, automatically make changes. Thanks @JuanM04!astro add --help
will print help instructions. Thanks @JuanM04!See demo below:
npx astro add tailwind
is already installed, so wizard stops earlynpx astro add preact
is not installed, configuration is updated and dependencies installednpx astro add
has no arguments, so an interactive wizard prompts users to select frameworks then other integrationsastro-add-2.mov
Testing
Manually tested, interactive CLI
Docs
Integrations Guide updated