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

Ensure astro add only installs stable versions #9387

Merged
merged 2 commits into from
Dec 11, 2023
Merged

Conversation

natemoo-re
Copy link
Member

Changes

  • We didn't have an issue to track this but it's come up a few times in Discord
  • astro add svelte would install 5.0.0-next.22, which is not a stable version
  • This PR refactors astro add installation logic to actually resolve the most recent stable version of packages before installing. We do this by querying the registry for all versions and filtering out any prereleases.
  • The custom peerDependency parser regex has also been removed in favor of semver! It was already a dependency, so we might as well use it.
  • If users do want to install a prerelease, they can do so manually.

Testing

Tested manually because astro add has almost no test coverage. Woooooo!

Docs

Bug fix only

Copy link

changeset-bot bot commented Dec 8, 2023

🦋 Changeset detected

Latest commit: 85f85e1

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: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review labels Dec 8, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Dec 8, 2023

!preview add-stable

Copy link
Contributor

github-actions bot commented Dec 8, 2023

Snapshots have been released for the following packages:

  • @astrojs/svelte@experimental--add-stable
  • @astrojs/markdown-remark@experimental--add-stable
  • @astrojs/node@experimental--add-stable
  • @astrojs/mdx@experimental--add-stable
  • @astrojs/vue@experimental--add-stable
  • @astrojs/vercel@experimental--add-stable
  • astro@experimental--add-stable
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--add-stable tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info astro
🦋  info npm info @astrojs/prism
🦋  info npm info @astrojs/rss
🦋  info npm info create-astro
🦋  info npm info @astrojs/alpinejs
🦋  info npm info @astrojs/lit
🦋  info npm info @astrojs/markdoc
🦋  info npm info @astrojs/mdx
🦋  info npm info @astrojs/node
🦋  info npm info @astrojs/partytown
🦋  info npm info @astrojs/preact
🦋  info npm info @astrojs/react
🦋  info npm info @astrojs/sitemap
🦋  info npm info @astrojs/solid-js
🦋  info npm info @astrojs/svelte
🦋  info npm info @astrojs/tailwind
🦋  info npm info @astrojs/vercel
🦋  info npm info @astrojs/vue
🦋  info npm info @astrojs/internal-helpers
🦋  info npm info @astrojs/markdown-remark
🦋  info npm info @astrojs/telemetry
🦋  info npm info @astrojs/underscore-redirects
🦋  info npm info @astrojs/upgrade
🦋  info astro is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  warn @astrojs/prism is not being published because version 3.0.0 is already published on npm
🦋  warn @astrojs/rss is not being published because version 4.0.1 is already published on npm
🦋  warn create-astro is not being published because version 4.5.2 is already published on npm
🦋  warn @astrojs/alpinejs is not being published because version 0.3.1 is already published on npm
🦋  warn @astrojs/lit is not being published because version 3.0.3 is already published on npm
🦋  warn @astrojs/markdoc is not being published because version 0.8.0 is already published on npm
🦋  info @astrojs/mdx is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  info @astrojs/node is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  warn @astrojs/partytown is not being published because version 2.0.2 is already published on npm
🦋  warn @astrojs/preact is not being published because version 3.0.1 is already published on npm
🦋  warn @astrojs/react is not being published because version 3.0.7 is already published on npm
🦋  warn @astrojs/sitemap is not being published because version 3.0.3 is already published on npm
🦋  warn @astrojs/solid-js is not being published because version 3.0.2 is already published on npm
🦋  info @astrojs/svelte is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  warn @astrojs/tailwind is not being published because version 5.0.3 is already published on npm
🦋  info @astrojs/vercel is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  info @astrojs/vue is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  warn @astrojs/internal-helpers is not being published because version 0.2.1 is already published on npm
🦋  info @astrojs/markdown-remark is being published because our local version (0.0.0-add-stable-20231208215901) has not been published on npm
🦋  warn @astrojs/telemetry is not being published because version 3.0.4 is already published on npm
🦋  warn @astrojs/underscore-redirects is not being published because version 0.3.3 is already published on npm
🦋  warn @astrojs/upgrade is not being published because version 0.2.1 is already published on npm
🦋  info Publishing "astro" at "0.0.0-add-stable-20231208215901"
🦋  info Publishing "@astrojs/mdx" at "0.0.0-add-stable-20231208215901"
🦋  info Publishing "@astrojs/node" at "0.0.0-add-stable-20231208215901"
🦋  info Publishing "@astrojs/svelte" at "0.0.0-add-stable-20231208215901"
🦋  info Publishing "@astrojs/vercel" at "0.0.0-add-stable-20231208215901"
🦋  info Publishing "@astrojs/vue" at "0.0.0-add-stable-20231208215901"
🦋  info Publishing "@astrojs/markdown-remark" at "0.0.0-add-stable-20231208215901"
🦋  success packages published successfully:
🦋  [email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  @astrojs/[email protected]
🦋  Creating git tags...
🦋  New tag:  [email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
🦋  New tag:  @astrojs/[email protected]
Build Log

> [email protected] build /home/runner/work/astro/astro
> turbo run build --filter=astro --filter=create-astro --filter="@astrojs/*" --filter="@benchmark/*"

• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/internal-helpers, @astrojs/lit, @astrojs/markdoc, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/underscore-redirects, @astrojs/upgrade, @astrojs/vercel, @astrojs/vue, @benchmark/timer, astro, create-astro
• Running build in 26 packages
• Remote caching enabled
::group::@astrojs/internal-helpers:build
cache miss, executing eac91336501ec7d9

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/internal-helpers
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@astrojs/prism:build
cache miss, executing 81bed5c056d4b29d

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-prism
> astro-scripts build "src/**/*.ts" && tsc -p ./tsconfig.json

::endgroup::
::group::@astrojs/upgrade:build
cache miss, executing 2a93542d95491830

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/upgrade
> astro-scripts build "src/index.ts" --bundle && tsc

::endgroup::
::group::@astrojs/telemetry:build
cache miss, executing 20dce2800041ecab

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/telemetry
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::create-astro:build
cache miss, executing a26580f945cb8884

> [email protected] build /home/runner/work/astro/astro/packages/create-astro
> astro-scripts build "src/index.ts" --bundle && tsc

::endgroup::
::group::@astrojs/markdown-remark:build
cache miss, executing 936ffd8888af924d

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/markdown/remark
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::astro:build
cache miss, executing 53b1d19e5ae6e270

> [email protected] build /home/runner/work/astro/astro/packages/astro
> pnpm run prebuild && astro-scripts build "src/**/*.{ts,js}" && tsc && pnpm run postbuild


> [email protected] prebuild /home/runner/work/astro/astro/packages/astro
> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts"


> [email protected] postbuild /home/runner/work/astro/astro/packages/astro
> astro-scripts copy "src/**/*.astro" && astro-scripts copy "src/**/*.wasm"

::endgroup::
::group::@astrojs/alpinejs:build
cache miss, executing 4182a825670907ff

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/alpinejs
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@benchmark/timer:build
cache miss, executing 5182238e4ae8fbaf

> @benchmark/[email protected] build /home/runner/work/astro/astro/benchmark/packages/timer
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/react:build
cache miss, executing 4ed7b998be16351c

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/react
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/rss:build
cache miss, executing 4fca76b5b22205e6

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-rss
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/tailwind:build
cache miss, executing b285773306c85afb

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/tailwind
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/node:build
cache miss, executing 3224c7a43ef20b91

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/node
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/solid-js:build
cache miss, executing 173bf74ba5c3c94e

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/solid
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vercel:build
cache miss, executing 37ed449feccdc6f4

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vercel
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/svelte:build
cache miss, executing 7c1e96b522b22619

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/svelte
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::
::group::@astrojs/markdoc:build
cache miss, executing 7dc4d984daa43cdc

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/markdoc
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/partytown:build
cache miss, executing 3cc2ebcb4b94f780

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/partytown
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/underscore-redirects:build
cache miss, executing ac5edf0b22c4de22

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/underscore-redirects
> astro-scripts build "src/**/*.ts" && tsc -p tsconfig.json

::endgroup::
::group::@astrojs/lit:build
cache miss, executing 0039b048f58e5eaf

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/lit
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/preact:build
cache miss, executing b2965dea933fa254

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/preact
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/sitemap:build
cache miss, executing de3a1a28d626905c

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/sitemap
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/mdx:build
cache miss, executing 797bc94def869e12

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/mdx
> astro-scripts build "src/**/*.ts" && tsc

::endgroup::
::group::@astrojs/vue:build
cache miss, executing 23d712b0cbf7e43b

> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vue
> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc

::endgroup::

 Tasks:    24 successful, 24 total
Cached:    0 cached, 24 total
  Time:    45.257s 

Copy link
Contributor

@lilnasy lilnasy 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 to me! Thanks for the much needed cleanup.

@ematipico ematipico merged commit a7c75b3 into main Dec 11, 2023
13 checks passed
@ematipico ematipico deleted the fix/add-stable branch December 11, 2023 10:47
@astrobot-houston astrobot-houston mentioned this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants