Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: withastro/astro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: astro@4.10.2
Choose a base ref
...
head repository: withastro/astro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: astro@4.10.3
Choose a head ref

Commits on Jun 11, 2024

  1. In Vercel Edge, include cookies set by Astro.cookies.set (#11227)

    matthewp authored Jun 11, 2024
    Copy the full SHA
    24ce898 View commit details
  2. [ci] format

    matthewp authored and astrobot-houston committed Jun 11, 2024
    Copy the full SHA
    ebe01c7 View commit details
  3. feat: upgrade pnpm (#11146)

    florian-lefebvre authored Jun 11, 2024
    Copy the full SHA
    02e5617 View commit details
  4. feat(astro): address astro env rfc feedback (#11213)

    Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
    florian-lefebvre and sarah11918 authored Jun 11, 2024
    Copy the full SHA
    94ac7ef View commit details
  5. [ci] format

    florian-lefebvre authored and astrobot-houston committed Jun 11, 2024
    Copy the full SHA
    769f11f View commit details

Commits on Jun 12, 2024

  1. fix: provide a plugin to resolve the virtual module (#11242)

    ematipico authored Jun 12, 2024
    Copy the full SHA
    e4fc2a0 View commit details
  2. [ci] format

    ematipico authored and astrobot-houston committed Jun 12, 2024
    Copy the full SHA
    a8c7cec View commit details
  3. fix(astro): ignore query params when matching .astro extension (#11240)

    * fix: ignore query params when matching .astro extension
    
    * Changeset
    
    * Add test
    ascorbic authored Jun 12, 2024
    Copy the full SHA
    2851b0a View commit details
  4. fix(astro): handle symlinked content collection directories (#11236)

    * fix(astro): handle symlinked content collection directories
    
    * CHeck content dir exists and is a dir
    
    * Handle symlinks when generating chunk names
    
    * wip windows log
    
    * Use posix paths
    
    * Fix normalisation
    
    * :old-man-yells-at-windows-paths:
    
    * Update .changeset/fifty-clouds-clean.md
    
    Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
    
    * Changes from review
    
    * Add logging
    
    ---------
    
    Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
    ascorbic and ematipico authored Jun 12, 2024
    Copy the full SHA
    39bc3a5 View commit details
  5. [ci] format

    ascorbic authored and astrobot-houston committed Jun 12, 2024
    Copy the full SHA
    8036b9a View commit details

Commits on Jun 13, 2024

  1. fix: better DX for 500.astro in local development (#11244)

    * wip
    
    * catch error in route.ts
    
    * catch error in route.ts
    
    * chore: tidy up error cases
    
    * log the original error
    
    * rebase
    
    * chore: reduce the scope of the 500 handling
    
    * we should not have a default 500
    
    * remove props
    
    * remove unsure  function, not needed
    
    * Update packages/astro/src/core/routing/astro-designed-error-pages.ts
    
    Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
    
    * Update packages/astro/src/core/constants.ts
    
    Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
    
    * changeset
    
    * relax the assertion
    
    * Update packages/astro/src/vite-plugin-astro-server/route.ts
    
    Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
    
    * relax the assertion
    
    ---------
    
    Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
    ematipico and florian-lefebvre authored Jun 13, 2024
    Copy the full SHA
    d07d2f7 View commit details
  2. feat(@astrojs/react): export renderer for easy loading (#11234)

    * wip
    
    * feat(@astrojs/react): export `renderer` for easy loading
    
    * restore change
    
    * chore: address feedback
    
    * revert changes
    
    * revert changes to react integration
    
    * update changeset
    ematipico authored Jun 13, 2024
    Copy the full SHA
    4385bf7 View commit details
  3. [ci] format

    ematipico authored and astrobot-houston committed Jun 13, 2024
    Copy the full SHA
    a6df7e8 View commit details

Commits on Jun 14, 2024

  1. fix(markdown-remark): mark prism package as an internal dependency (#…

    V3RON authored Jun 14, 2024
    Copy the full SHA
    1b42229 View commit details
  2. feat: refine container APIs for renderers (#11251)

    ematipico authored Jun 14, 2024
    3
    Copy the full SHA
    fd9da98 View commit details
  3. [ci] format

    ematipico authored and astrobot-houston committed Jun 14, 2024
    Copy the full SHA
    d4336a5 View commit details
  4. chore: fix CI badge (#11256)

    ematipico authored Jun 14, 2024
    Copy the full SHA
    914d95e View commit details
  5. fix typo in changeset (#11255)

    * fix typo in changeset
    
    * update typo import
    liruifengv authored Jun 14, 2024
    Copy the full SHA
    5484114 View commit details
  6. Copy the full SHA
    773828a View commit details
  7. Copy the full SHA
    de60c69 View commit details
  8. [ci] format

    ematipico authored and astrobot-houston committed Jun 14, 2024
    Copy the full SHA
    537e971 View commit details
  9. fix: throw error if rewrite is attempted after body is used (#11258)

    * fix: throw error if rewrite is attempted after body is used
    
    * Apply suggestions from code review
    
    Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
    
    ---------
    
    Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
    ascorbic and sarah11918 authored Jun 14, 2024
    Copy the full SHA
    d996db6 View commit details
  10. [ci] format

    ascorbic authored and astrobot-houston committed Jun 14, 2024
    Copy the full SHA
    ec94bb4 View commit details
  11. Copy the full SHA
    dffb765 View commit details
  12. [ci] format

    ematipico authored and astrobot-houston committed Jun 14, 2024
    Copy the full SHA
    6582811 View commit details
  13. fix(astro): prerendering issue when path contains underscore (#11243)

    * fix(astro): prerendering issue when path contains underscore
    
    * chore: add missing files
    
    * Update .changeset/honest-ravens-double.md
    
    Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
    
    ---------
    
    Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
    Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
    3 people authored Jun 14, 2024
    Copy the full SHA
    ba2b14c View commit details
  14. [ci] format

    matthewp authored and astrobot-houston committed Jun 14, 2024
    Copy the full SHA
    6b541ec View commit details
  15. Import Database type from correct file (#11262)

    * Import Database type from correct file
    
    * Add changeset
    nezouse authored Jun 14, 2024
    Copy the full SHA
    9b03023 View commit details
  16. Copy the full SHA
    f5f8ed2 View commit details
  17. [ci] format

    matthewp authored and astrobot-houston committed Jun 14, 2024
    Copy the full SHA
    1296cb9 View commit details

Commits on Jun 15, 2024

  1. Add config object to the remarkToc plugin in the astro config (#11087)

    Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
    nibble0101 and sarah11918 authored Jun 15, 2024
    Copy the full SHA
    233fee9 View commit details

Commits on Jun 17, 2024

  1. fix(deps): update dependency @vitejs/plugin-vue-jsx to v4 (#11270)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jun 17, 2024
    Copy the full SHA
    67d5a73 View commit details
  2. chore(deps): update all non-major dependencies (#11269)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jun 17, 2024
    Copy the full SHA
    68f1d0d View commit details
  3. Copy the full SHA
    e22be22 View commit details
  4. [ci] format

    bluwy authored and astrobot-houston committed Jun 17, 2024
    Copy the full SHA
    6fcc246 View commit details
  5. Copy the full SHA
    7d59750 View commit details
  6. [ci] release (#11233)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    astrobot-houston and github-actions[bot] authored Jun 17, 2024
    Copy the full SHA
    83c565b View commit details
Showing with 10,533 additions and 12,511 deletions.
  1. +56 −1 CONTRIBUTING.md
  2. +1 −1 README.md
  3. +1 −1 examples/basics/package.json
  4. +3 −3 examples/blog/package.json
  5. +1 −1 examples/component/package.json
  6. +2 −2 examples/container-with-vitest/package.json
  7. +1 −1 examples/framework-alpine/package.json
  8. +2 −2 examples/framework-lit/package.json
  9. +7 −7 examples/framework-multiple/package.json
  10. +2 −2 examples/framework-preact/package.json
  11. +2 −2 examples/framework-react/package.json
  12. +2 −2 examples/framework-solid/package.json
  13. +2 −2 examples/framework-svelte/package.json
  14. +3 −3 examples/framework-vue/package.json
  15. +2 −2 examples/hackernews/package.json
  16. +1 −1 examples/integration/package.json
  17. +2 −2 examples/middleware/package.json
  18. +1 −1 examples/minimal/package.json
  19. +1 −1 examples/non-html-pages/package.json
  20. +1 −1 examples/portfolio/package.json
  21. +3 −3 examples/ssr/package.json
  22. +2 −2 examples/starlog/package.json
  23. +1 −1 examples/toolbar-app/package.json
  24. +2 −2 examples/view-transitions/package.json
  25. +1 −1 examples/with-markdoc/package.json
  26. +1 −1 examples/with-markdown-plugins/package.json
  27. +1 −1 examples/with-markdown-shiki/package.json
  28. +3 −3 examples/with-mdx/package.json
  29. +2 −2 examples/with-nanostores/package.json
  30. +2 −2 examples/with-tailwindcss/package.json
  31. +1 −1 examples/with-vitest/package.json
  32. +3 −4 package.json
  33. +71 −0 packages/astro/CHANGELOG.md
  34. +2 −2 packages/astro/e2e/fixtures/actions-react-19/package.json
  35. +1 −1 packages/astro/e2e/fixtures/astro-envs/package.json
  36. +1 −1 packages/astro/e2e/fixtures/client-only/package.json
  37. +1 −1 packages/astro/e2e/fixtures/error-sass/package.json
  38. +2 −2 packages/astro/e2e/fixtures/errors/package.json
  39. +1 −1 packages/astro/e2e/fixtures/hmr/package.json
  40. +1 −1 packages/astro/e2e/fixtures/multiple-frameworks/package.json
  41. +1 −1 packages/astro/e2e/fixtures/nested-in-preact/package.json
  42. +1 −1 packages/astro/e2e/fixtures/nested-in-react/package.json
  43. +1 −1 packages/astro/e2e/fixtures/nested-in-solid/package.json
  44. +1 −1 packages/astro/e2e/fixtures/nested-in-svelte/package.json
  45. +1 −1 packages/astro/e2e/fixtures/nested-in-vue/package.json
  46. +1 −1 packages/astro/e2e/fixtures/nested-recursive/package.json
  47. +1 −1 packages/astro/e2e/fixtures/view-transitions/package.json
  48. +1 −1 packages/astro/e2e/fixtures/vue-component/package.json
  49. +6 −6 packages/astro/package.json
  50. +45 −39 packages/astro/src/@types/astro.ts
  51. +60 −2 packages/astro/src/container/index.ts
  52. +15 −0 packages/astro/src/container/vite-plugin-container.ts
  53. +31 −33 packages/astro/src/content/types-generator.ts
  54. +62 −1 packages/astro/src/content/utils.ts
  55. +18 −3 packages/astro/src/content/vite-plugin-content-imports.ts
  56. +1 −1 packages/astro/src/core/base-pipeline.ts
  57. +6 −0 packages/astro/src/core/build/internal.ts
  58. +0 −2 packages/astro/src/core/build/page-data.ts
  59. +9 −0 packages/astro/src/core/build/plugins/plugin-chunks.ts
  60. +89 −71 packages/astro/src/core/build/plugins/plugin-prerender.ts
  61. +18 −13 packages/astro/src/core/build/plugins/plugin-ssr.ts
  62. +44 −61 packages/astro/src/core/build/static-build.ts
  63. +0 −1 packages/astro/src/core/build/types.ts
  64. +5 −0 packages/astro/src/core/constants.ts
  65. +3 −1 packages/astro/src/core/create-vite.ts
  66. +23 −0 packages/astro/src/core/errors/errors-data.ts
  67. +3 −0 packages/astro/src/core/render-context.ts
  68. +15 −1 packages/astro/src/core/routing/astro-designed-error-pages.ts
  69. +13 −2 packages/astro/src/core/util.ts
  70. +0 −1 packages/astro/src/env/constants.ts
  71. +9 −1 packages/astro/src/env/runtime.ts
  72. +6 −24 packages/astro/src/env/schema.ts
  73. +16 −21 packages/astro/src/env/vite-plugin-env.ts
  74. +5 −1 packages/astro/src/jsx/server.ts
  75. +22 −1 packages/astro/src/vite-plugin-astro-server/route.ts
  76. +1 −1 packages/astro/src/vite-plugin-astro/index.ts
  77. +14 −5 packages/astro/templates/env/module.mjs
  78. +1 −12 packages/astro/templates/env/types.d.ts
  79. +16 −0 packages/astro/test/astro-assets-prefix.test.js
  80. +20 −0 packages/astro/test/before-hydration.test.js
  81. +33 −1 packages/astro/test/container.test.js
  82. +22 −0 packages/astro/test/content-collections.test.js
  83. +18 −2 packages/astro/test/core-image.test.js
  84. +18 −0 packages/astro/test/css-inline-stylesheets.test.js
  85. +9 −0 packages/astro/test/experimental-content-collections-css-inline-stylesheets.test.js
  86. +24 −0 packages/astro/test/extension-matching.test.js
  87. +1 −1 packages/astro/test/fixtures/0-css/package.json
  88. +8 −0 packages/astro/test/fixtures/_underscore in folder name/astro.config.mjs
  89. +4 −0 packages/astro/test/fixtures/_underscore in folder name/node_modules/fake-astro-library/404.astro
  90. +16 −0 packages/astro/test/fixtures/_underscore in folder name/node_modules/fake-astro-library/index.ts
  91. +12 −0 packages/astro/test/fixtures/_underscore in folder name/node_modules/fake-astro-library/package.json
  92. +11 −0 packages/astro/test/fixtures/_underscore in folder name/src/pages/index.astro
  93. +1 −1 packages/astro/test/fixtures/astro-children/package.json
  94. +1 −1 packages/astro/test/fixtures/astro-env-server-fail/astro.config.mjs
  95. +1 −1 packages/astro/test/fixtures/astro-env-server-fail/src/pages/index.astro
  96. +1 −2 packages/astro/test/fixtures/astro-env-server-secret/src/pages/index.astro
  97. +3 −3 packages/astro/test/fixtures/astro-env/astro.config.mjs
  98. +6 −6 packages/astro/test/fixtures/astro-env/src/pages/index.astro
  99. +1 −1 packages/astro/test/fixtures/astro-envs/package.json
  100. +1 −1 packages/astro/test/fixtures/astro-slots-nested/package.json
  101. +8 −0 packages/astro/test/fixtures/container-custom-renderers/astro.config.mjs
  102. +14 −0 packages/astro/test/fixtures/container-custom-renderers/package.json
  103. +5 −0 packages/astro/test/fixtures/container-custom-renderers/src/components/button.jsx
  104. +3 −0 packages/astro/test/fixtures/container-custom-renderers/src/components/button.vue
  105. +10 −0 packages/astro/test/fixtures/container-custom-renderers/src/pages/react.ts
  106. +10 −0 packages/astro/test/fixtures/container-custom-renderers/src/pages/vue.ts
  107. BIN packages/astro/test/fixtures/content-collections/src/assets/the-future.jpg
  108. +21 −2 packages/astro/test/fixtures/content-collections/src/content/config.ts
  109. +1 −0 packages/astro/test/fixtures/content-collections/src/content/with-symlinked-content
  110. +1 −0 packages/astro/test/fixtures/content-collections/src/content/with-symlinked-data
  111. +3 −1 packages/astro/test/fixtures/content-collections/src/pages/collections.json.js
  112. +6 −0 packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/first.md
  113. +6 −0 packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/second.md
  114. +6 −0 packages/astro/test/fixtures/content-collections/symlinked-collections/content-collection/third.md
  115. +4 −0 packages/astro/test/fixtures/content-collections/symlinked-collections/data-collection/welcome.json
  116. +38 −0 packages/astro/test/fixtures/extension-matching/astro.config.mjs
  117. +16 −0 packages/astro/test/fixtures/extension-matching/package.json
  118. +12 −0 packages/astro/test/fixtures/extension-matching/src/pages/index.astro
  119. +1 −1 packages/astro/test/fixtures/fetch/package.json
  120. +1 −1 packages/astro/test/fixtures/jsx/package.json
  121. +1 −1 packages/astro/test/fixtures/postcss/package.json
  122. +9 −0 packages/astro/test/fixtures/rewrite-runtime-error-custom500/astro.config.mjs
  123. +8 −0 packages/astro/test/fixtures/rewrite-runtime-error-custom500/package.json
  124. +4 −0 packages/astro/test/fixtures/rewrite-runtime-error-custom500/src/pages/500.astro
  125. +3 −0 packages/astro/test/fixtures/rewrite-runtime-error-custom500/src/pages/errors/start.astro
  126. +3 −0 packages/astro/test/fixtures/rewrite-runtime-error-custom500/src/pages/errors/throw.astro
  127. +7 −0 packages/astro/test/fixtures/rewrite-server/src/pages/post/index.astro
  128. +15 −0 packages/astro/test/fixtures/rewrite-server/src/pages/post/post-b.astro
  129. +17 −0 packages/astro/test/fixtures/rewrite-server/src/pages/post/post-body-used.astro
  130. +1 −1 packages/astro/test/fixtures/slots-vue/package.json
  131. +10 −0 packages/astro/test/fixtures/ssr-prerender-chunks/astro.config.mjs
  132. +85 −0 packages/astro/test/fixtures/ssr-prerender-chunks/deps/test-adapter/index.js
  133. +10 −0 packages/astro/test/fixtures/ssr-prerender-chunks/deps/test-adapter/package.json
  134. +65 −0 packages/astro/test/fixtures/ssr-prerender-chunks/deps/test-adapter/server.js
  135. +14 −0 packages/astro/test/fixtures/ssr-prerender-chunks/package.json
  136. +26 −0 packages/astro/test/fixtures/ssr-prerender-chunks/src/components/Counter.tsx
  137. +13 −0 packages/astro/test/fixtures/ssr-prerender-chunks/src/pages/index.astro
  138. +7 −0 packages/astro/test/fixtures/ssr-prerender-chunks/tsconfig.json
  139. +1 −1 packages/astro/test/fixtures/vue-component/package.json
  140. +1 −1 packages/astro/test/fixtures/vue-jsx/package.json
  141. +1 −1 packages/astro/test/fixtures/vue-with-multi-renderer/package.json
  142. +15 −0 packages/astro/test/i18n-routing.test.js
  143. +104 −4 packages/astro/test/rewrite.test.js
  144. +45 −7 packages/astro/test/ssr-hoisted-script.test.js
  145. +21 −0 packages/astro/test/ssr-prerender-chunks.test.js
  146. +15 −1 packages/astro/test/ssr-prerender.test.js
  147. +4 −0 packages/astro/test/test-utils.js
  148. +25 −0 packages/astro/test/underscore-in-folder-name.test.js
  149. +0 −42 packages/astro/test/units/config/config-validate.test.js
  150. +9 −0 packages/db/CHANGELOG.md
  151. +2 −2 packages/db/package.json
  152. +0 −5,266 packages/db/test/fixtures/ticketing-example/pnpm-lock.yaml
  153. +1 −1 packages/db/virtual.d.ts
  154. +1 −1 packages/integrations/alpinejs/package.json
  155. +37 −0 packages/integrations/lit/CHANGELOG.md
  156. +7 −3 packages/integrations/lit/package.json
  157. +2 −0 packages/integrations/lit/server.d.ts
  158. +1 −0 packages/integrations/lit/server.js
  159. +1 −1 packages/integrations/markdoc/package.json
  160. +6 −0 packages/integrations/mdx/CHANGELOG.md
  161. +3 −3 packages/integrations/mdx/package.json
  162. +16 −6 packages/integrations/mdx/src/index.ts
  163. +6 −6 packages/integrations/mdx/src/utils.ts
  164. +8 −0 packages/integrations/node/CHANGELOG.md
  165. +1 −1 packages/integrations/node/package.json
  166. +3 −3 packages/integrations/node/src/index.ts
  167. +5 −2 packages/integrations/node/src/server.ts
  168. +2 −9 packages/integrations/node/test/node-middleware.test.js
  169. +24 −11 packages/integrations/node/test/prerender-404-500.test.js
  170. +35 −9 packages/integrations/node/test/prerender.test.js
  171. +36 −13 packages/integrations/node/test/trailing-slash.test.js
  172. +37 −0 packages/integrations/preact/CHANGELOG.md
  173. +1 −1 packages/integrations/preact/package.json
  174. +5 −2 packages/integrations/preact/src/server.ts
  175. +37 −0 packages/integrations/react/CHANGELOG.md
  176. +12 −4 packages/integrations/react/package.json
  177. +1 −0 packages/integrations/react/server-v17.js
  178. +2 −0 packages/integrations/react/server.d.ts
  179. +1 −0 packages/integrations/react/server.js
  180. +2 −0 packages/integrations/react/server17.d.ts
  181. +20 −47 packages/integrations/react/src/index.ts
  182. +34 −0 packages/integrations/react/src/version.ts
  183. +1 −1 packages/integrations/react/test/fixtures/react-component/package.json
  184. +6 −0 packages/integrations/sitemap/CHANGELOG.md
  185. +1 −1 packages/integrations/sitemap/package.json
  186. +1 −9 packages/integrations/sitemap/src/index.ts
  187. +37 −0 packages/integrations/solid/CHANGELOG.md
  188. +2 −2 packages/integrations/solid/package.json
  189. +5 −1 packages/integrations/solid/src/server.ts
  190. +37 −0 packages/integrations/svelte/CHANGELOG.md
  191. +13 −5 packages/integrations/svelte/package.json
  192. +2 −0 packages/integrations/svelte/server-v5.d.ts
  193. +2 −0 packages/integrations/svelte/server.d.ts
  194. +1 −1 packages/integrations/tailwind/package.json
  195. +8 −0 packages/integrations/vercel/CHANGELOG.md
  196. +3 −3 packages/integrations/vercel/package.json
  197. +1 −0 packages/integrations/vercel/src/serverless/adapter.ts
  198. +5 −2 packages/integrations/vercel/src/serverless/entrypoint.ts
  199. +17 −6 packages/integrations/vercel/src/serverless/middleware.ts
  200. +12 −0 packages/integrations/vercel/test/edge-middleware.test.js
  201. +1 −0 packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/middleware.js
  202. +1 −1 packages/integrations/vercel/test/serverless-prerender.test.js
  203. +37 −0 packages/integrations/vue/CHANGELOG.md
  204. +11 −7 packages/integrations/vue/package.json
  205. +2 −0 packages/integrations/vue/server.d.ts
  206. +1 −0 packages/integrations/vue/server.js
  207. +2 −2 packages/markdown/remark/package.json
  208. +1 −1 packages/studio/package.json
  209. +8,299 −6,612 pnpm-lock.yaml
57 changes: 56 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -12,10 +12,12 @@ We welcome contributions of any size and skill level. As an open source project,

```shell
node: "^>=18.17.1"
pnpm: "^8.6.12"
pnpm: "^9.3.0"
# otherwise, your build will fail
```

We recommend using Corepack, [read PNPM docs](https://pnpm.io/installation#using-corepack).

### Setting up your local repo

Astro uses pnpm workspaces, so you should **always run `pnpm install` from the top-level project directory**. Running `pnpm install` in the top-level project root will install dependencies for `astro`, and every package in the repo.
@@ -109,6 +111,53 @@ pnpm run test -m "$STRING_MATCH"
node --test ./test/foo.test.js
```

#### Running a single test

Sometimes you want to run a single test case (`it` or `describe`) or a single test file. You can do so by using Node.js.

To run a single test file, for example `test/astro-basic.test.js`:

```shell
node --test test/astro-basic.test.js
```

If you wish to run a single test case, you have to postfix `it` and `describe` functions with `.only`:

```diff
// test/astro-basic.test.js
- describe("description", () => {
+ describe.only("description", () => {
- it("description", () => {
+ it.only("description", () => {})
})
```

Then, you have to pass the `--test-only` option to the Node.js:

```shell
node --test --test-only test/astro-basic.test.js
```

> [!WARNING]
>
> 1. If you have nested `describe`, all of them must postfix with `.only`
> 2. `--test-only` and `--test` must be placed **before** declaring the path to the file. Failing to do so will test all files
#### Debugging tests in CI

There might be occasions where some tests fail in certain CI runs due to some timeout issue. If this happens, it will be very difficult to understand which file cause the timeout. That's caused by come quirks of the Node.js test runner combined with our architecture.

To understand which file causes the issue, you can modify the `test` script inside the `package.json` by adding the `--parallel` option:

```diff
{
- "test": "astro-scripts test \"test/**/*.test.js\"",
+ "test": "astro-scripts test --parallel \"test/**/*.test.js\"",
}
```

Save the change and **push it** to your PR. This change will make the test CI slower, but it will allow to see which files causes the timeout. Once you fixed the issue **revert the change and push it**.

#### E2E tests

Certain features, like HMR and client hydration, need end-to-end tests to verify functionality in the dev server. [Playwright](https://playwright.dev/) is used to test against the dev server.
@@ -127,6 +176,12 @@ Any tests for `astro build` output should use the main `mocha` tests rather than

If a test needs to validate what happens on the page after it's loading in the browser, that's a perfect use for E2E dev server tests, i.e. to verify that hot-module reloading works in `astro dev` or that components were client hydrated and are interactive.

#### Creating tests

When creating new tests, it's best to reference other existing test files and replicate the same setup. Some other tips include:

- When re-using a fixture multiple times with different configurations, you should also configure unique `outDir`, `build.client`, and `build.server` values so the build output runtime isn't cached and shared by ESM between test runs.

### Other useful commands

```shell
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

<div align="center">

![Build Status](https://github.com/withastro/astro/actions/workflows/ci.yml/badge.svg)
[![CI](https://github.com/withastro/astro/actions/workflows/ci.yml/badge.svg)](https://github.com/withastro/astro/actions/workflows/ci.yml)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/withastro/astro/blob/main/LICENSE)
[![npm version](https://badge.fury.io/js/astro.svg)](https://badge.fury.io/js/astro)

2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
6 changes: 3 additions & 3 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^3.1.0",
"@astrojs/mdx": "^3.1.1",
"@astrojs/rss": "^4.0.6",
"@astrojs/sitemap": "^3.1.5",
"astro": "^4.10.2"
"@astrojs/sitemap": "^3.1.6",
"astro": "^4.10.3"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
},
"peerDependencies": {
"astro": "^4.0.0"
4 changes: 2 additions & 2 deletions examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@
"test": "vitest run"
},
"dependencies": {
"astro": "^4.10.2",
"@astrojs/react": "^3.5.0",
"astro": "^4.10.3",
"@astrojs/react": "^3.6.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^1.6.0"
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
@@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.0",
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
4 changes: 2 additions & 2 deletions examples/framework-lit/package.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/lit": "^4.2.0",
"@astrojs/lit": "^4.3.0",
"@webcomponents/template-shadowroot": "^0.2.1",
"astro": "^4.10.2",
"astro": "^4.10.3",
"lit": "^3.1.4"
}
}
14 changes: 7 additions & 7 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
@@ -11,19 +11,19 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.4.0",
"@astrojs/react": "^3.5.0",
"@astrojs/solid-js": "^4.3.0",
"@astrojs/svelte": "^5.5.0",
"@astrojs/vue": "^4.4.0",
"@astrojs/preact": "^3.5.0",
"@astrojs/react": "^3.6.0",
"@astrojs/solid-js": "^4.4.0",
"@astrojs/svelte": "^5.6.0",
"@astrojs/vue": "^4.5.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.10.2",
"astro": "^4.10.3",
"preact": "^10.22.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"solid-js": "^1.8.17",
"svelte": "^4.2.18",
"vue": "^3.4.27"
"vue": "^3.4.29"
}
}
4 changes: 2 additions & 2 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.4.0",
"@astrojs/preact": "^3.5.0",
"@preact/signals": "^1.2.3",
"astro": "^4.10.2",
"astro": "^4.10.3",
"preact": "^10.22.0"
}
}
4 changes: 2 additions & 2 deletions examples/framework-react/package.json
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^3.5.0",
"@astrojs/react": "^3.6.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^4.10.2",
"astro": "^4.10.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
4 changes: 2 additions & 2 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/solid-js": "^4.3.0",
"astro": "^4.10.2",
"@astrojs/solid-js": "^4.4.0",
"astro": "^4.10.3",
"solid-js": "^1.8.17"
}
}
4 changes: 2 additions & 2 deletions examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/svelte": "^5.5.0",
"astro": "^4.10.2",
"@astrojs/svelte": "^5.6.0",
"astro": "^4.10.3",
"svelte": "^4.2.18"
}
}
6 changes: 3 additions & 3 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vue": "^4.4.0",
"astro": "^4.10.2",
"vue": "^3.4.27"
"@astrojs/vue": "^4.5.0",
"astro": "^4.10.3",
"vue": "^3.4.29"
}
}
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^8.3.0",
"astro": "^4.10.2"
"@astrojs/node": "^8.3.1",
"astro": "^4.10.3"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
},
"peerDependencies": {
"astro": "^4.0.0"
4 changes: 2 additions & 2 deletions examples/middleware/package.json
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^8.3.0",
"astro": "^4.10.2",
"@astrojs/node": "^8.3.1",
"astro": "^4.10.3",
"html-minifier": "^4.0.0"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
6 changes: 3 additions & 3 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
@@ -12,9 +12,9 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^8.3.0",
"@astrojs/svelte": "^5.5.0",
"astro": "^4.10.2",
"@astrojs/node": "^8.3.1",
"@astrojs/svelte": "^5.6.0",
"astro": "^4.10.3",
"svelte": "^4.2.18"
}
}
4 changes: 2 additions & 2 deletions examples/starlog/package.json
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.2",
"sass": "^1.77.4",
"astro": "^4.10.3",
"sass": "^1.77.5",
"sharp": "^0.33.3"
}
}
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
@@ -15,6 +15,6 @@
"./app": "./dist/app.js"
},
"devDependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
4 changes: 2 additions & 2 deletions examples/view-transitions/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"devDependencies": {
"@astrojs/tailwind": "^5.1.0",
"@astrojs/node": "^8.3.0",
"astro": "^4.10.2"
"@astrojs/node": "^8.3.1",
"astro": "^4.10.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.11.0",
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^5.1.0",
"astro": "^4.10.2",
"astro": "^4.10.3",
"hast-util-select": "^6.0.2",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
2 changes: 1 addition & 1 deletion examples/with-markdown-shiki/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.10.2"
"astro": "^4.10.3"
}
}
6 changes: 3 additions & 3 deletions examples/with-mdx/package.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^3.1.0",
"@astrojs/preact": "^3.4.0",
"astro": "^4.10.2",
"@astrojs/mdx": "^3.1.1",
"@astrojs/preact": "^3.5.0",
"astro": "^4.10.3",
"preact": "^10.22.0"
}
}
4 changes: 2 additions & 2 deletions examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^3.4.0",
"@astrojs/preact": "^3.5.0",
"@nanostores/preact": "^0.5.1",
"astro": "^4.10.2",
"astro": "^4.10.3",
"nanostores": "^0.10.3",
"preact": "^10.22.0"
}
4 changes: 2 additions & 2 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^3.1.0",
"@astrojs/mdx": "^3.1.1",
"@astrojs/tailwind": "^5.1.0",
"@types/canvas-confetti": "^1.6.4",
"astro": "^4.10.2",
"astro": "^4.10.3",
"autoprefixer": "^10.4.19",
"canvas-confetti": "^1.9.3",
"postcss": "^8.4.38",
Loading