Skip to content
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

fix(create-astro): TypeScript installation failure with yarn #8939

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

wktk
Copy link
Contributor

@wktk wktk commented Oct 28, 2023

Changes

To fix the installation issue on TypeScript with yarn since v4.4.0, added the following changes:

  • Use the add subcommand to add dependencies
    • While npm and pnpm support both install and add for adding dependencies, yarn requires to use add to do it.
  • Fixed a minor typo
  • Add .changelog
output from `yarn create astro foo --template minimal --install --git --typescript strict`

$ yarn create astro foo --template minimal --install --git --typescript strict

yarn create v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Installed "create-astro@4.4.1" with binaries:
      - create-astro
[########################################] 40/40
 astro   Launch sequence initiated.

      ◼  dir Using foo as project directory
      ◼  tmpl Using minimal as project template
      ✔  Template copied
      ✔  Dependencies installed
      ◼  ts Using strict TypeScript configuration
      ▲  error Error
error Command failed.
Exit code: 1
Command: /usr/local/bin/create-astro
Arguments: foo --template minimal --install --git --typescript strict
Directory: /private/var/folders/83/90s7fs2956s9kr_l3gc32pjr0000gn/T/tmp.XwhTguO2
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Testing

Tested manually if the following commands succeed

create-astro test-npm --template minimal --install --git --typescript strict
npm_config_user_agent='yarn/1.22.19 npm/? node/v20.9.0 darwin x64' create-astro test-yarn --template minimal --install --git --typescript strict
npm_config_user_agent='pnpm/8.10.0 npm/? node/v20.9.0 darwin x64' create-astro test-pnpm --template minimal --install --git --typescript strict

Docs

bugfix only

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2023

🦋 Changeset detected

Latest commit: b97904d

The changes in this PR will be included in the next version bump.

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

@github-actions github-actions bot added pkg: create-astro Related to the `create-astro` package (scope) docs pr A PR that includes documentation for review labels Oct 28, 2023
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updating the verb tense of the changeset! Otherwise, docs is happy if this is accepted. 🙌

.changeset/young-avocados-wink.md Outdated Show resolved Hide resolved
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Copy link
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@Princesseuh Princesseuh merged commit 71455c1 into withastro:main Oct 30, 2023
4 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Oct 30, 2023
@wktk wktk deleted the fix-creating-with-ts-yarn branch October 30, 2023 14:36
natemoo-re pushed a commit that referenced this pull request Nov 22, 2023
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr A PR that includes documentation for review pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants