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

Surface configuration errors to the client #5273

Merged
merged 6 commits into from
Nov 3, 2022
Merged

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Nov 1, 2022

Changes

  • This is a bit of a refactor of how dev restarts take place. It moves the code out of the CLI and into core/dev. There it watches for changes to the astro config and restarts the vite server, etc. when that occurs.
  • Closes HMR: Errors in Astro config do not surface #5159

Testing

  • Tested the new functionality via unit tests. This is a slow test so we should be careful about adding too many.

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2022

🦋 Changeset detected

Latest commit: 68c1ed6

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 the pkg: astro Related to the core `astro` package (scope) label Nov 1, 2022
@matthewp
Copy link
Contributor Author

matthewp commented Nov 1, 2022

!preview config-errors

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2022

 > [email protected] release /home/runner/work/astro/astro > pnpm run build && changeset publish "--tag" "next--config-errors" > [email protected] build /home/runner/work/astro/astro > turbo run build --output-logs=new-only --no-deps --filter=astro --filter=create-astro --filter="@astrojs/*" �[2m• Packages in scope: @astrojs/alpinejs, @astrojs/cloudflare, @astrojs/deno, @astrojs/image, @astrojs/lit, @astrojs/markdown-component, @astrojs/markdown-remark, @astrojs/mdx, @astrojs/netlify, @astrojs/node, @astrojs/partytown, @astrojs/preact, @astrojs/prefetch, @astrojs/prism, @astrojs/react, @astrojs/rss, @astrojs/sitemap, @astrojs/solid-js, @astrojs/svelte, @astrojs/tailwind, @astrojs/telemetry, @astrojs/turbolinks, @astrojs/vercel, @astrojs/vue, @astrojs/webapi, astro, create-astro�[0m �[2m• Running�[0m �[2m�[1mbuild�[0m�[0m �[2min 27 packages�[0m �[2m• Remote computation caching enabled (experimental)�[0m �[35m@astrojs/webapi:build: �[0mcache hit, suppressing output �[2m13347967c5d0cdee�[0m �[33m@astrojs/telemetry:build: �[0mcache hit, suppressing output �[2md25a0afd9a4dd933�[0m �[34mcreate-astro:build: �[0mcache hit, suppressing output �[2ma7de77b9b7379481�[0m �[36m@astrojs/prism:build: �[0mcache hit, suppressing output �[2m752bac8c8e84aa37�[0m �[35m@astrojs/markdown-remark:build: �[0mcache hit, suppressing output �[2m689c3e1715fe37f2�[0m �[32mastro:build: �[0mcache miss, executing �[2m8e8f0feb650e33e7�[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> [email protected] build /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> pnpm run prebuild && astro-scripts build "src/**/*.ts" && tsc �[32mastro:build: �[0m �[32mastro:build: �[0m �[32mastro:build: �[0m> [email protected] prebuild /home/runner/work/astro/astro/packages/astro �[32mastro:build: �[0m> astro-scripts prebuild --to-string "src/runtime/server/astro-island.ts" "src/runtime/client/{idle,load,media,only,visible}.ts" �[32mastro:build: �[0m �[32m@astrojs/netlify:build: �[0mcache miss, executing �[2mf7da37ac964357ba�[0m �[35m@astrojs/vue:build: �[0mcache miss, executing �[2mbbab88e510d58621�[0m �[34m@astrojs/solid-js:build: �[0mcache miss, executing �[2m1630323f458de703�[0m �[35m@astrojs/cloudflare:build: �[0mcache miss, executing �[2m89b54e157653279f�[0m �[33m@astrojs/lit:build: �[0mcache miss, executing �[2m9e848c69ad47a9de�[0m �[32m@astrojs/tailwind:build: �[0mcache miss, executing �[2m78bcc113f76b5f9e�[0m �[36m@astrojs/node:build: �[0mcache miss, executing �[2m0b319ada45fe9712�[0m �[34m@astrojs/svelte:build: �[0mcache miss, executing �[2maa6e2b2be8f6ad8e�[0m �[36m@astrojs/deno:build: �[0mcache miss, executing �[2m82766f6ea56c5912�[0m �[35m@astrojs/vue:build: �[0m �[35m@astrojs/vue:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vue �[35m@astrojs/vue:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[35m@astrojs/vue:build: �[0m �[34m@astrojs/solid-js:build: �[0m �[34m@astrojs/solid-js:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/solid �[34m@astrojs/solid-js:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/solid-js:build: �[0m �[33m@astrojs/lit:build: �[0m �[33m@astrojs/lit:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/lit �[33m@astrojs/lit:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/lit:build: �[0m �[32m@astrojs/netlify:build: �[0m �[32m@astrojs/netlify:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/netlify �[32m@astrojs/netlify:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/netlify:build: �[0m �[33m@astrojs/react:build: �[0mcache miss, executing �[2mad6952a64cf75e75�[0m �[36m@astrojs/node:build: �[0m �[36m@astrojs/node:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/node �[36m@astrojs/node:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/node:build: �[0m �[32m@astrojs/tailwind:build: �[0m �[32m@astrojs/tailwind:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/tailwind �[32m@astrojs/tailwind:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/tailwind:build: �[0m �[35m@astrojs/cloudflare:build: �[0m �[35m@astrojs/cloudflare:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/cloudflare �[35m@astrojs/cloudflare:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/cloudflare:build: �[0m �[34m@astrojs/svelte:build: �[0m �[34m@astrojs/svelte:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/svelte �[34m@astrojs/svelte:build: �[0m> astro-scripts build "src/index.ts" && astro-scripts build "src/editor.cts" --force-cjs --no-clean-dist && tsc �[34m@astrojs/svelte:build: �[0m �[36m@astrojs/deno:build: �[0m �[36m@astrojs/deno:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/deno �[36m@astrojs/deno:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/deno:build: �[0m �[33m@astrojs/react:build: �[0m �[33m@astrojs/react:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/react �[33m@astrojs/react:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/react:build: �[0m �[33m@astrojs/mdx:build: �[0mcache miss, executing �[2m7fb832db41d3f76c�[0m �[34m@astrojs/turbolinks:build: �[0mcache miss, executing �[2m57b31186559e460e�[0m �[35m@astrojs/alpinejs:build: �[0mcache miss, executing �[2mbe10db29dd00b5d2�[0m �[32m@astrojs/rss:build: �[0mcache miss, executing �[2m31054e04ed155792�[0m �[34m@astrojs/image:build: �[0mcache miss, executing �[2mec61c6a1d753fcec�[0m �[33m@astrojs/vercel:build: �[0mcache miss, executing �[2mae6a37f89128032d�[0m �[36m@astrojs/partytown:build: �[0mcache miss, executing �[2m9a5937ee3c014112�[0m �[35m@astrojs/prefetch:build: �[0mcache miss, executing �[2md048cf997c941388�[0m �[33m@astrojs/mdx:build: �[0m �[33m@astrojs/mdx:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/mdx �[33m@astrojs/mdx:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/mdx:build: �[0m �[32m@astrojs/preact:build: �[0mcache miss, executing �[2m240fdcdcac0839d6�[0m �[34m@astrojs/turbolinks:build: �[0m �[34m@astrojs/turbolinks:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/turbolinks �[34m@astrojs/turbolinks:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[34m@astrojs/turbolinks:build: �[0m �[35m@astrojs/alpinejs:build: �[0m �[35m@astrojs/alpinejs:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/alpinejs �[35m@astrojs/alpinejs:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/alpinejs:build: �[0m �[33m@astrojs/sitemap:build: �[0mcache miss, executing �[2mc941473c782d3397�[0m �[32m@astrojs/rss:build: �[0m �[32m@astrojs/rss:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/astro-rss �[32m@astrojs/rss:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/rss:build: �[0m �[33m@astrojs/vercel:build: �[0m �[33m@astrojs/vercel:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/vercel �[33m@astrojs/vercel:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/vercel:build: �[0m �[34m@astrojs/image:build: �[0m �[34m@astrojs/image:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/image �[34m@astrojs/image:build: �[0m> astro-scripts build "src/**/*.ts" && tsc && pnpm run postbuild �[34m@astrojs/image:build: �[0m �[36m@astrojs/partytown:build: �[0m �[36m@astrojs/partytown:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/partytown �[36m@astrojs/partytown:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[36m@astrojs/partytown:build: �[0m �[35m@astrojs/prefetch:build: �[0m �[35m@astrojs/prefetch:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/prefetch �[35m@astrojs/prefetch:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[35m@astrojs/prefetch:build: �[0m �[32m@astrojs/preact:build: �[0m �[32m@astrojs/preact:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/preact �[32m@astrojs/preact:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[32m@astrojs/preact:build: �[0m �[33m@astrojs/sitemap:build: �[0m �[33m@astrojs/sitemap:build: �[0m> @astrojs/[email protected] build /home/runner/work/astro/astro/packages/integrations/sitemap �[33m@astrojs/sitemap:build: �[0m> astro-scripts build "src/**/*.ts" && tsc �[33m@astrojs/sitemap:build: �[0m �[34m@astrojs/image:build: �[0m �[34m@astrojs/image:build: �[0m> @astrojs/[email protected] postbuild /home/runner/work/astro/astro/packages/integrations/image �[34m@astrojs/image:build: �[0m> astro-scripts copy "src/**/*.wasm" �[34m@astrojs/image:build: �[0m Tasks: 26 successful, 26 total Cached: 5 cached, 26 total Time: 1m0.882s 🦋 �[33mwarn�[39m �[31m===============================IMPORTANT!===============================�[39m 🦋 �[33mwarn�[39m Packages will be released under the next--config-errors tag 🦋 �[33mwarn�[39m �[31m----------------------------------------------------------------------�[39m 🦋 �[36minfo�[39m npm info astro 🦋 �[36minfo�[39m npm info @astrojs/prism 🦋 �[36minfo�[39m npm info @astrojs/rss 🦋 �[36minfo�[39m npm info create-astro 🦋 �[36minfo�[39m npm info @astrojs/alpinejs 🦋 �[36minfo�[39m npm info @astrojs/cloudflare 🦋 �[36minfo�[39m npm info @astrojs/deno 🦋 �[36minfo�[39m npm info @astrojs/image 🦋 �[36minfo�[39m npm info @astrojs/lit 🦋 �[36minfo�[39m npm info @astrojs/mdx 🦋 �[36minfo�[39m npm info @astrojs/netlify 🦋 �[36minfo�[39m npm info @astrojs/node 🦋 �[36minfo�[39m npm info @astrojs/partytown 🦋 �[36minfo�[39m npm info @astrojs/preact 🦋 �[36minfo�[39m npm info @astrojs/prefetch 🦋 �[36minfo�[39m npm info @astrojs/react 🦋 �[36minfo�[39m npm info @astrojs/sitemap 🦋 �[36minfo�[39m npm info @astrojs/solid-js 🦋 �[36minfo�[39m npm info @astrojs/svelte 🦋 �[36minfo�[39m npm info @astrojs/tailwind 🦋 �[36minfo�[39m npm info @astrojs/turbolinks 🦋 �[36minfo�[39m npm info @astrojs/vercel 🦋 �[36minfo�[39m npm info @astrojs/vue 🦋 �[36minfo�[39m npm info @astrojs/markdown-component 🦋 �[36minfo�[39m npm info @astrojs/markdown-remark 🦋 �[36minfo�[39m npm info @astrojs/telemetry 🦋 �[36minfo�[39m npm info @astrojs/webapi 🦋 �[36minfo�[39m astro is being published because our local version (0.0.0-config-errors-20221101194733) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/prism is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/rss is not being published because version 1.0.3 is already published on npm 🦋 �[33mwarn�[39m create-astro is not being published because version 1.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/alpinejs is not being published because version 0.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/cloudflare is not being published because version 3.1.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/deno is not being published because version 1.2.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/image is being published because our local version (0.0.0-config-errors-20221101194733) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/lit is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/mdx is not being published because version 0.11.5 is already published on npm 🦋 �[33mwarn�[39m @astrojs/netlify is not being published because version 1.2.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/node is not being published because version 2.0.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/partytown is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/preact is not being published because version 1.2.0 is already published on npm 🦋 �[36minfo�[39m @astrojs/prefetch is being published because our local version (0.0.0-config-errors-20221101194733) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/react is not being published because version 1.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/sitemap is not being published because version 1.0.0 is already published on npm 🦋 �[33mwarn�[39m @astrojs/solid-js is not being published because version 1.2.2 is already published on npm 🦋 �[33mwarn�[39m @astrojs/svelte is not being published because version 1.0.2 is already published on npm 🦋 �[36minfo�[39m @astrojs/tailwind is being published because our local version (0.0.0-config-errors-20221101194733) has not been published on npm 🦋 �[33mwarn�[39m @astrojs/turbolinks is not being published because version 0.1.4 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vercel is not being published because version 2.3.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/vue is not being published because version 1.2.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-component is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/markdown-remark is not being published because version 1.1.3 is already published on npm 🦋 �[33mwarn�[39m @astrojs/telemetry is not being published because version 1.0.1 is already published on npm 🦋 �[33mwarn�[39m @astrojs/webapi is not being published because version 1.1.1 is already published on npm 🦋 �[36minfo�[39m Publishing �[36m"astro"�[39m at �[32m"0.0.0-config-errors-20221101194733"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/image"�[39m at �[32m"0.0.0-config-errors-20221101194733"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/prefetch"�[39m at �[32m"0.0.0-config-errors-20221101194733"�[39m 🦋 �[36minfo�[39m Publishing �[36m"@astrojs/tailwind"�[39m at �[32m"0.0.0-config-errors-20221101194733"�[39m 🦋 �[32msuccess�[39m packages published successfully: 🦋 [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]

@matthewp matthewp marked this pull request as ready for review November 2, 2022 15:37
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@matthewp matthewp merged commit c7b9b14 into main Nov 3, 2022
@matthewp matthewp deleted the surface-config-errors branch November 3, 2022 12:04
@astrobot-houston astrobot-houston mentioned this pull request Nov 3, 2022
bholmesdev pushed a commit that referenced this pull request Nov 3, 2022
* Surface configuration errors to the client

* Actually start the container on restart

* Add beforeRestart to clear the console

* Some minor changes, restarted() returns an Error maybe

* Refactor testing code

* Adding a changeset
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HMR: Errors in Astro config do not surface
2 participants