From 48ff7855b238536a3df17cb29335c90029fc41a4 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:52:13 +0200 Subject: [PATCH 01/48] fix: make sharp an optional dep (#8416) * fix: make sharp an optional dep * chore: lockfile * chore: changeset --------- Co-authored-by: Nate Moore --- .changeset/sweet-icons-stare.md | 5 ++ packages/astro/package.json | 4 +- packages/astro/src/core/errors/errors-data.ts | 5 +- pnpm-lock.yaml | 52 +++++++++++++++++-- 4 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 .changeset/sweet-icons-stare.md diff --git a/.changeset/sweet-icons-stare.md b/.changeset/sweet-icons-stare.md new file mode 100644 index 000000000..a041fccf4 --- /dev/null +++ b/.changeset/sweet-icons-stare.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Installing will no longer fail when Sharp can't be installed diff --git a/packages/astro/package.json b/packages/astro/package.json index a2cddd217..f80b96f69 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -162,7 +162,6 @@ "resolve": "^1.22.4", "semver": "^7.5.4", "server-destroy": "^1.0.1", - "sharp": "^0.32.5", "shiki": "^0.14.3", "string-width": "^6.1.0", "strip-ansi": "^7.1.0", @@ -176,6 +175,9 @@ "yargs-parser": "^21.1.1", "zod": "3.21.1" }, + "optionalDependencies": { + "sharp": "^0.32.5" + }, "devDependencies": { "@astrojs/check": "^0.1.0", "@playwright/test": "^1.37.1", diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts index 60e78adf6..d63fc8852 100644 --- a/packages/astro/src/core/errors/errors-data.ts +++ b/packages/astro/src/core/errors/errors-data.ts @@ -814,8 +814,9 @@ export const InvalidDynamicRoute = { export const MissingSharp = { name: 'MissingSharp', title: 'Could not find Sharp.', - message: 'Could not find Sharp. Please install Sharp (`sharp`) manually into your project.', - hint: "See Sharp's installation instructions for more information: https://sharp.pixelplumbing.com/install. If you are not relying on `astro:assets` to optimize, transform, or process any images, you can configure a passthrough image service instead of installing Sharp. See https://docs.astro.build/en/reference/errors/missing-sharp for more information.", + message: + 'Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.', + hint: "See Sharp's installation instructions for more information: https://sharp.pixelplumbing.com/install. If you are not relying on `astro:assets` to optimize, transform, or process any images, you can configure a passthrough image service instead of installing Sharp. See https://docs.astro.build/en/reference/errors/missing-sharp for more information.\n\nSee https://docs.astro.build/en/guides/images/#default-image-service for more information on how to migrate to another image service.", }; // No headings here, that way Vite errors are merged with Astro ones in the docs, which makes more sense to users. // Vite Errors - 4xxx diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2f3c68e7..1ca06eef2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -611,9 +611,6 @@ importers: server-destroy: specifier: ^1.0.1 version: 1.0.1 - sharp: - specifier: ^0.32.5 - version: 0.32.5 shiki: specifier: ^0.14.3 version: 0.14.3 @@ -650,6 +647,10 @@ importers: zod: specifier: 3.21.1 version: 3.21.1 + optionalDependencies: + sharp: + specifier: ^0.32.5 + version: 0.32.5 devDependencies: '@astrojs/check': specifier: ^0.1.0 @@ -9742,7 +9743,9 @@ packages: /b4a@1.6.4: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} + requiresBuild: true dev: false + optional: true /babel-plugin-jsx-dom-expressions@0.36.10(@babel/core@7.22.10): resolution: {integrity: sha512-QA2k/14WGw+RgcGGnEuLWwnu4em6CGhjeXtjvgOYyFHYS2a+CzPeaVQHDOlfuiBcjq/3hWMspHMIMnPEOIzdBg==} @@ -9874,6 +9877,7 @@ packages: /bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + requiresBuild: true dependencies: buffer: 5.7.1 inherits: 2.0.4 @@ -9991,6 +9995,7 @@ packages: /buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + requiresBuild: true dependencies: base64-js: 1.5.1 ieee754: 1.2.1 @@ -10231,6 +10236,7 @@ packages: /chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + requiresBuild: true /chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} @@ -10350,13 +10356,16 @@ packages: /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + requiresBuild: true /color-string@1.9.1: resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + requiresBuild: true dependencies: color-name: 1.1.4 simple-swizzle: 0.2.2 dev: false + optional: true /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} @@ -10366,10 +10375,12 @@ packages: /color@4.2.3: resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} engines: {node: '>=12.5.0'} + requiresBuild: true dependencies: color-convert: 2.0.1 color-string: 1.9.1 dev: false + optional: true /colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -10675,6 +10686,7 @@ packages: /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} + requiresBuild: true dependencies: mimic-response: 3.1.0 @@ -10691,6 +10703,7 @@ packages: /deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} + requiresBuild: true /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -10937,6 +10950,7 @@ packages: /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + requiresBuild: true dependencies: once: 1.4.0 @@ -11452,6 +11466,7 @@ packages: /expand-template@2.0.3: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} + requiresBuild: true /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} @@ -11524,7 +11539,9 @@ packages: /fast-fifo@1.3.2: resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} + requiresBuild: true dev: false + optional: true /fast-glob@3.3.1: resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} @@ -11687,6 +11704,7 @@ packages: /fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + requiresBuild: true /fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} @@ -11849,6 +11867,7 @@ packages: /github-from-package@0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + requiresBuild: true /github-slugger@2.0.0: resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==} @@ -12422,6 +12441,7 @@ packages: /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + requiresBuild: true /inline-style-parser@0.1.1: resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} @@ -12462,7 +12482,9 @@ packages: /is-arrayish@0.3.2: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + requiresBuild: true dev: false + optional: true /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} @@ -13963,6 +13985,7 @@ packages: /mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} + requiresBuild: true /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -14064,6 +14087,7 @@ packages: /mkdirp-classic@0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + requiresBuild: true /mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} @@ -14173,6 +14197,7 @@ packages: /napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + requiresBuild: true /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -14217,12 +14242,15 @@ packages: /node-abi@3.40.0: resolution: {integrity: sha512-zNy02qivjjRosswoYmPi8hIKJRr8MpQyeKT6qlcq/OnOgA3Rhoae+IYOqsM9V5+JnHWmxKnWOT2GxvtqdtOCXA==} engines: {node: '>=10'} + requiresBuild: true dependencies: semver: 7.5.4 /node-addon-api@6.1.0: resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} + requiresBuild: true dev: false + optional: true /node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} @@ -15281,6 +15309,7 @@ packages: /pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + requiresBuild: true dependencies: end-of-stream: 1.4.4 once: 1.4.0 @@ -15305,7 +15334,9 @@ packages: /queue-tick@1.0.1: resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==} + requiresBuild: true dev: false + optional: true /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} @@ -15334,6 +15365,7 @@ packages: /rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true + requiresBuild: true dependencies: deep-extend: 0.6.0 ini: 1.3.8 @@ -16026,6 +16058,7 @@ packages: tar-fs: 3.0.4 tunnel-agent: 0.6.0 dev: false + optional: true /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} @@ -16111,9 +16144,11 @@ packages: /simple-concat@1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + requiresBuild: true /simple-get@4.0.1: resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + requiresBuild: true dependencies: decompress-response: 6.0.0 once: 1.4.0 @@ -16121,9 +16156,11 @@ packages: /simple-swizzle@0.2.2: resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + requiresBuild: true dependencies: is-arrayish: 0.3.2 dev: false + optional: true /sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -16314,10 +16351,12 @@ packages: /streamx@2.15.1: resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==} + requiresBuild: true dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 dev: false + optional: true /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -16627,6 +16666,7 @@ packages: /tar-fs@2.1.1: resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + requiresBuild: true dependencies: chownr: 1.1.4 mkdirp-classic: 0.5.3 @@ -16635,15 +16675,18 @@ packages: /tar-fs@3.0.4: resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==} + requiresBuild: true dependencies: mkdirp-classic: 0.5.3 pump: 3.0.0 tar-stream: 3.1.6 dev: false + optional: true /tar-stream@2.2.0: resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} engines: {node: '>=6'} + requiresBuild: true dependencies: bl: 4.1.0 end-of-stream: 1.4.4 @@ -16653,11 +16696,13 @@ packages: /tar-stream@3.1.6: resolution: {integrity: sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==} + requiresBuild: true dependencies: b4a: 1.6.4 fast-fifo: 1.3.2 streamx: 2.15.1 dev: false + optional: true /tar@6.1.15: resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==} @@ -16883,6 +16928,7 @@ packages: /tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + requiresBuild: true dependencies: safe-buffer: 5.2.1 From 1947ef7a99ce3d1d6ea797842edd31d5edffa5de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9l=C3=A9my=20Ledoux?= Date: Wed, 6 Sep 2023 15:01:01 +0200 Subject: [PATCH 02/48] fix: no asset plugin w/ img is imported with query (#8353) * fix: no asset plugin w/ img is imported with query * add changeset * add test for the new feature * remove exp * use removeQueryString instead of `includes('?')` it's more explicit --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> --- .changeset/disable-asset-with-query.md | 13 +++++ .../astro/src/assets/vite-plugin-assets.ts | 12 ++--- .../vue/test/app-entrypoint.test.js | 8 +++ .../fixtures/app-entrypoint/astro.config.mjs | 8 ++- .../test/fixtures/app-entrypoint/package.json | 5 +- .../app-entrypoint/src/components/Circle.svg | 3 ++ .../app-entrypoint/src/components/Foo.vue | 5 ++ pnpm-lock.yaml | 54 ++++++++++++++++++- 8 files changed, 95 insertions(+), 13 deletions(-) create mode 100644 .changeset/disable-asset-with-query.md create mode 100644 packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Circle.svg diff --git a/.changeset/disable-asset-with-query.md b/.changeset/disable-asset-with-query.md new file mode 100644 index 000000000..3eca21a62 --- /dev/null +++ b/.changeset/disable-asset-with-query.md @@ -0,0 +1,13 @@ +--- +'astro': patch +--- + +Astro will now skip asset optimization when there is a query in the import. Instead, it will let vite deal with it using plugins. + +```vue + +``` + diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index f194e5288..d91d0e492 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -14,9 +14,6 @@ import { hashTransform, propsToFilename } from './utils/transformToPath.js'; const resolvedVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; -const rawRE = /(?:\?|&)raw(?:&|$)/; -const urlRE = /(\?|&)url(?:&|$)/; - export default function assets({ settings, mode, @@ -119,13 +116,12 @@ export default function assets({ resolvedConfig = viteConfig; }, async load(id) { - // If our import has the `?raw` or `?url` Vite query params, we'll let Vite handle it - if (rawRE.test(id) || urlRE.test(id)) { + // If our import has any query params, we'll let Vite handle it + // See https://github.com/withastro/astro/issues/8333 + if (id !== removeQueryString(id)) { return; } - - const cleanedUrl = removeQueryString(id); - if (/\.(jpeg|jpg|png|tiff|webp|gif|svg)$/.test(cleanedUrl)) { + if (/\.(jpeg|jpg|png|tiff|webp|gif|svg)$/.test(id)) { const meta = await emitESMImage(id, this.meta.watchMode, this.emitFile); return `export default ${JSON.stringify(meta)}`; } diff --git a/packages/integrations/vue/test/app-entrypoint.test.js b/packages/integrations/vue/test/app-entrypoint.test.js index 5c9ea840c..4f4f389d1 100644 --- a/packages/integrations/vue/test/app-entrypoint.test.js +++ b/packages/integrations/vue/test/app-entrypoint.test.js @@ -30,4 +30,12 @@ describe('App Entrypoint', () => { const js = await fixture.readFile(client); expect(js).to.match(/\w+\.component\(\"Bar\"/gm); }); + + it('loads svg components without transforming them to assets', async () => { + const data = await fixture.readFile('/index.html'); + const { document } = parseHTML(data); + const client = document.querySelector('astro-island svg'); + + expect(client).not.to.be.undefined; + }); }); diff --git a/packages/integrations/vue/test/fixtures/app-entrypoint/astro.config.mjs b/packages/integrations/vue/test/fixtures/app-entrypoint/astro.config.mjs index 0bf5fd95d..fa04f9c8b 100644 --- a/packages/integrations/vue/test/fixtures/app-entrypoint/astro.config.mjs +++ b/packages/integrations/vue/test/fixtures/app-entrypoint/astro.config.mjs @@ -1,8 +1,14 @@ import { defineConfig } from 'astro/config'; import vue from '@astrojs/vue'; +import ViteSvgLoader from 'vite-svg-loader' export default defineConfig({ integrations: [vue({ appEntrypoint: '/src/pages/_app' - })] + })], + vite: { + plugins: [ + ViteSvgLoader(), + ], + }, }) diff --git a/packages/integrations/vue/test/fixtures/app-entrypoint/package.json b/packages/integrations/vue/test/fixtures/app-entrypoint/package.json index 3cb7d419b..abdab9e4c 100644 --- a/packages/integrations/vue/test/fixtures/app-entrypoint/package.json +++ b/packages/integrations/vue/test/fixtures/app-entrypoint/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "astro": "workspace:*", - "@astrojs/vue": "workspace:*" + "@astrojs/vue": "workspace:*", + "vite-svg-loader": "4.0.0" } -} +} \ No newline at end of file diff --git a/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Circle.svg b/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Circle.svg new file mode 100644 index 000000000..1b207e41a --- /dev/null +++ b/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Circle.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Foo.vue b/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Foo.vue index 3e648808c..e07193d36 100644 --- a/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Foo.vue +++ b/packages/integrations/vue/test/fixtures/app-entrypoint/src/components/Foo.vue @@ -1,5 +1,10 @@ + + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ca06eef2..feec7faa1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4888,6 +4888,9 @@ importers: astro: specifier: workspace:* version: link:../../../../../astro + vite-svg-loader: + specifier: 4.0.0 + version: 4.0.0 packages/internal-helpers: devDependencies: @@ -8589,6 +8592,11 @@ packages: engines: {node: '>= 10'} dev: true + /@trysound/sax@0.2.0: + resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} + engines: {node: '>=10.13.0'} + dev: false + /@ts-morph/common@0.20.0: resolution: {integrity: sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q==} dependencies: @@ -10402,6 +10410,11 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} + /commander@7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} + dev: false + /commander@8.3.0: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} @@ -10541,7 +10554,6 @@ packages: domhandler: 5.0.3 domutils: 3.1.0 nth-check: 2.1.1 - dev: true /css-selector-parser@1.4.1: resolution: {integrity: sha512-HYPSb7y/Z7BNDCOrakL4raGO2zltZkbeXyAd6Tg9obzix6QhzxCotdBl6VT0Dv4vZfJGVz3WL/xaEI9Ly3ul0g==} @@ -10551,6 +10563,14 @@ packages: resolution: {integrity: sha512-JjnG6/pdLJh3iqipq7kteNVtbIczsU2A1cNxb+VAiniSuNmrB/NI3us4rSCfArvlwRXYly+jZhUUfEoInSH9Qg==} dev: false + /css-tree@2.2.1: + resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + dependencies: + mdn-data: 2.0.28 + source-map-js: 1.0.2 + dev: false + /css-tree@2.3.1: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} @@ -10561,7 +10581,6 @@ packages: /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} - dev: true /cssdb@7.7.1: resolution: {integrity: sha512-kM+Fs0BFyhJNeE6wbOrlnRsugRdL6vn7QcON0aBDZ7XRd7RI2pMlk+nxoHuTb4Et+aBobXgK0I+6NGLA0LLgTw==} @@ -10572,6 +10591,13 @@ packages: engines: {node: '>=4'} hasBin: true + /csso@5.0.5: + resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} + dependencies: + css-tree: 2.2.1 + dev: false + /cssom@0.3.8: resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} dev: true @@ -13482,6 +13508,10 @@ packages: unist-util-visit: 4.1.2 dev: true + /mdn-data@2.0.28: + resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} + dev: false + /mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} @@ -16617,6 +16647,19 @@ packages: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} dev: false + /svgo@3.0.2: + resolution: {integrity: sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==} + engines: {node: '>=14.0.0'} + hasBin: true + dependencies: + '@trysound/sax': 0.2.0 + commander: 7.2.0 + css-select: 5.1.0 + css-tree: 2.3.1 + csso: 5.0.5 + picocolors: 1.0.0 + dev: false + /symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true @@ -17505,6 +17548,13 @@ packages: - supports-color dev: false + /vite-svg-loader@4.0.0: + resolution: {integrity: sha512-0MMf1yzzSYlV4MGePsLVAOqXsbF5IVxbn4EEzqRnWxTQl8BJg/cfwIzfQNmNQxZp5XXwd4kyRKF1LytuHZTnqA==} + dependencies: + '@vue/compiler-sfc': 3.3.4 + svgo: 3.0.2 + dev: false + /vite@4.4.9(@types/node@18.17.8)(sass@1.66.1): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} From 67e83485949cf21de62831731111413abf57718c Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 6 Sep 2023 21:13:36 +0800 Subject: [PATCH 03/48] Fix React dev mode using a base (#8428) --- .changeset/cold-knives-peel.md | 5 +++++ packages/integrations/react/package.json | 1 - packages/integrations/react/src/index.ts | 5 ++--- pnpm-lock.yaml | 3 --- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 .changeset/cold-knives-peel.md diff --git a/.changeset/cold-knives-peel.md b/.changeset/cold-knives-peel.md new file mode 100644 index 000000000..56ef2aff0 --- /dev/null +++ b/.changeset/cold-knives-peel.md @@ -0,0 +1,5 @@ +--- +'@astrojs/react': patch +--- + +Fix React dev mode using a base diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 2b9558e31..94814bdd2 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -45,7 +45,6 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "@astrojs/internal-helpers": "0.2.0", "@vitejs/plugin-react": "^4.0.4", "ultrahtml": "^1.3.0" }, diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts index a09544baf..2a78ce9cd 100644 --- a/packages/integrations/react/src/index.ts +++ b/packages/integrations/react/src/index.ts @@ -1,4 +1,3 @@ -import { appendForwardSlash } from '@astrojs/internal-helpers/path'; import react, { type Options as ViteReactPluginOptions } from '@vitejs/plugin-react'; import type { AstroIntegration } from 'astro'; import { version as ReactVersion } from 'react-dom'; @@ -94,7 +93,7 @@ export default function ({ return { name: '@astrojs/react', hooks: { - 'astro:config:setup': ({ config, command, addRenderer, updateConfig, injectScript }) => { + 'astro:config:setup': ({ command, addRenderer, updateConfig, injectScript }) => { addRenderer(getRenderer()); updateConfig({ vite: getViteConfiguration({ include, exclude, experimentalReactChildren }), @@ -102,7 +101,7 @@ export default function ({ if (command === 'dev') { const preamble = FAST_REFRESH_PREAMBLE.replace( `__BASE__`, - appendForwardSlash(config.base) + '/' ); injectScript('before-hydration', preamble); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index feec7faa1..1ab1a07e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4515,9 +4515,6 @@ importers: packages/integrations/react: dependencies: - '@astrojs/internal-helpers': - specifier: 0.2.0 - version: link:../../internal-helpers '@vitejs/plugin-react': specifier: ^4.0.4 version: 4.0.4(vite@4.4.9) From 2272f8d3c4f4c5c836a5ef356c8bfd29bb801382 Mon Sep 17 00:00:00 2001 From: matthewp Date: Wed, 6 Sep 2023 13:15:40 +0000 Subject: [PATCH 04/48] [ci] format --- packages/integrations/react/src/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts index 2a78ce9cd..d5f696522 100644 --- a/packages/integrations/react/src/index.ts +++ b/packages/integrations/react/src/index.ts @@ -99,10 +99,7 @@ export default function ({ vite: getViteConfiguration({ include, exclude, experimentalReactChildren }), }); if (command === 'dev') { - const preamble = FAST_REFRESH_PREAMBLE.replace( - `__BASE__`, - '/' - ); + const preamble = FAST_REFRESH_PREAMBLE.replace(`__BASE__`, '/'); injectScript('before-hydration', preamble); } }, From b81ff8fcefe6c30312d7b2050a63b1520d79b25f Mon Sep 17 00:00:00 2001 From: aswind7 Date: Wed, 6 Sep 2023 21:22:18 +0800 Subject: [PATCH 05/48] trim project name of the user input (#8427) * fix: remove duplicate import * project name should be trimed * update changeset --- .changeset/eighty-gifts-speak.md | 5 +++++ packages/create-astro/src/actions/project-name.ts | 2 +- packages/create-astro/test/project-name.test.js | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/eighty-gifts-speak.md diff --git a/.changeset/eighty-gifts-speak.md b/.changeset/eighty-gifts-speak.md new file mode 100644 index 000000000..38f64ac00 --- /dev/null +++ b/.changeset/eighty-gifts-speak.md @@ -0,0 +1,5 @@ +--- +'create-astro': patch +--- + +trim project name of the user input diff --git a/packages/create-astro/src/actions/project-name.ts b/packages/create-astro/src/actions/project-name.ts index 943de91bf..b7099d9bb 100644 --- a/packages/create-astro/src/actions/project-name.ts +++ b/packages/create-astro/src/actions/project-name.ts @@ -31,7 +31,7 @@ export async function projectName(ctx: Pick { expect(context.projectName).to.eq('foobar'); }); + + it('blank space', async () => { + const context = { projectName: '', cwd: '', prompt: () => ({ name: 'foobar ' }) }; + await projectName(context); + + expect(context.cwd).to.eq('foobar'); + expect(context.projectName).to.eq('foobar'); + }); + it('normalize', async () => { const context = { projectName: '', cwd: '', prompt: () => ({ name: 'Invalid Name' }) }; await projectName(context); From 59672ad4e7405a250a3d7b2afecd20fc21753711 Mon Sep 17 00:00:00 2001 From: matthewp Date: Wed, 6 Sep 2023 13:24:09 +0000 Subject: [PATCH 06/48] [ci] format --- packages/create-astro/test/project-name.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/create-astro/test/project-name.test.js b/packages/create-astro/test/project-name.test.js index a78207369..4b8cdce7f 100644 --- a/packages/create-astro/test/project-name.test.js +++ b/packages/create-astro/test/project-name.test.js @@ -62,7 +62,6 @@ describe('project name', () => { expect(context.projectName).to.eq('foobar'); }); - it('blank space', async () => { const context = { projectName: '', cwd: '', prompt: () => ({ name: 'foobar ' }) }; await projectName(context); From bd8aa9a996c8a9f9283995360fd495c291d1f766 Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger Date: Wed, 6 Sep 2023 10:26:27 -0300 Subject: [PATCH 07/48] [docs] Typo fix in Cloudflare README (#8429) Co-authored-by: Chris Swithinbank --- .changeset/lovely-shoes-scream.md | 5 +++++ packages/integrations/cloudflare/README.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/lovely-shoes-scream.md diff --git a/.changeset/lovely-shoes-scream.md b/.changeset/lovely-shoes-scream.md new file mode 100644 index 000000000..d510fc1fd --- /dev/null +++ b/.changeset/lovely-shoes-scream.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Update code sample in the README to use uppercase `GET`. diff --git a/packages/integrations/cloudflare/README.md b/packages/integrations/cloudflare/README.md index 99b2d7528..f49824cd9 100644 --- a/packages/integrations/cloudflare/README.md +++ b/packages/integrations/cloudflare/README.md @@ -149,7 +149,7 @@ See Cloudflare's documentation for [working with environment variables](https:// ```js // pages/[id].json.js -export function get({ params }) { +export function GET({ params }) { // Access environment variables per request inside a function const serverUrl = import.meta.env.SERVER_URL; const result = await fetch(serverUrl + "/user/" + params.id); From fa826f84b2c70c255e3defba5d9bcf76b438edc7 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 6 Sep 2023 21:33:00 +0800 Subject: [PATCH 08/48] Temporarily pin Node 20 version in CI (#8431) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01c573e10..cab1fd79f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: strategy: matrix: OS: [ubuntu-latest] - NODE_VERSION: [18, 20] + NODE_VERSION: [18, 20.5.1] include: - os: macos-latest NODE_VERSION: 18 From 14273d8f448d2f0daac5e1563131b093b5aa1da3 Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Wed, 6 Sep 2023 06:56:58 -0700 Subject: [PATCH 09/48] [ci] release (#8415) Co-authored-by: github-actions[bot] --- .changeset/chatty-walls-happen.md | 5 -- .changeset/cold-knives-peel.md | 5 -- .changeset/disable-asset-with-query.md | 13 ---- .changeset/eighty-gifts-speak.md | 5 -- .changeset/empty-rings-bow.md | 5 -- .changeset/fair-countries-admire.md | 5 -- .changeset/friendly-clocks-act.md | 6 -- .changeset/hip-cats-jump.md | 5 -- .changeset/lovely-shoes-scream.md | 5 -- .changeset/modern-guests-float.md | 5 -- .changeset/spotty-glasses-grin.md | 5 -- .changeset/sweet-icons-stare.md | 5 -- .changeset/twelve-cars-tell.md | 5 -- .changeset/weak-kids-roll.md | 5 -- examples/basics/package.json | 2 +- examples/blog/package.json | 4 +- examples/component/package.json | 2 +- examples/deno/package.json | 2 +- examples/framework-alpine/package.json | 2 +- examples/framework-lit/package.json | 2 +- examples/framework-multiple/package.json | 6 +- examples/framework-preact/package.json | 2 +- examples/framework-react/package.json | 4 +- examples/framework-solid/package.json | 2 +- examples/framework-svelte/package.json | 4 +- examples/framework-vue/package.json | 2 +- examples/hackernews/package.json | 2 +- examples/integration/package.json | 2 +- examples/middleware/package.json | 2 +- examples/minimal/package.json | 2 +- examples/non-html-pages/package.json | 2 +- examples/portfolio/package.json | 2 +- examples/ssr/package.json | 4 +- examples/with-markdoc/package.json | 2 +- examples/with-markdown-plugins/package.json | 2 +- examples/with-markdown-shiki/package.json | 2 +- examples/with-mdx/package.json | 4 +- examples/with-nanostores/package.json | 2 +- examples/with-tailwindcss/package.json | 4 +- examples/with-vite-plugin-pwa/package.json | 2 +- examples/with-vitest/package.json | 2 +- packages/astro/CHANGELOG.md | 27 +++++++ packages/astro/package.json | 2 +- packages/create-astro/CHANGELOG.md | 8 +++ packages/create-astro/package.json | 2 +- packages/integrations/cloudflare/CHANGELOG.md | 10 +++ packages/integrations/cloudflare/package.json | 4 +- packages/integrations/deno/package.json | 2 +- packages/integrations/markdoc/package.json | 2 +- packages/integrations/mdx/CHANGELOG.md | 9 +++ packages/integrations/mdx/package.json | 4 +- packages/integrations/netlify/package.json | 2 +- packages/integrations/node/package.json | 2 +- packages/integrations/react/CHANGELOG.md | 6 ++ packages/integrations/react/package.json | 2 +- packages/integrations/svelte/CHANGELOG.md | 9 +++ packages/integrations/svelte/package.json | 4 +- packages/integrations/tailwind/package.json | 2 +- packages/integrations/vercel/CHANGELOG.md | 9 +++ packages/integrations/vercel/package.json | 4 +- packages/integrations/vue/package.json | 2 +- pnpm-lock.yaml | 70 +++++++++---------- 62 files changed, 165 insertions(+), 166 deletions(-) delete mode 100644 .changeset/chatty-walls-happen.md delete mode 100644 .changeset/cold-knives-peel.md delete mode 100644 .changeset/disable-asset-with-query.md delete mode 100644 .changeset/eighty-gifts-speak.md delete mode 100644 .changeset/empty-rings-bow.md delete mode 100644 .changeset/fair-countries-admire.md delete mode 100644 .changeset/friendly-clocks-act.md delete mode 100644 .changeset/hip-cats-jump.md delete mode 100644 .changeset/lovely-shoes-scream.md delete mode 100644 .changeset/modern-guests-float.md delete mode 100644 .changeset/spotty-glasses-grin.md delete mode 100644 .changeset/sweet-icons-stare.md delete mode 100644 .changeset/twelve-cars-tell.md delete mode 100644 .changeset/weak-kids-roll.md diff --git a/.changeset/chatty-walls-happen.md b/.changeset/chatty-walls-happen.md deleted file mode 100644 index 58fe5e6ed..000000000 --- a/.changeset/chatty-walls-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixed a case where dynamic imports tried to preload inlined stylesheets. diff --git a/.changeset/cold-knives-peel.md b/.changeset/cold-knives-peel.md deleted file mode 100644 index 56ef2aff0..000000000 --- a/.changeset/cold-knives-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/react': patch ---- - -Fix React dev mode using a base diff --git a/.changeset/disable-asset-with-query.md b/.changeset/disable-asset-with-query.md deleted file mode 100644 index 3eca21a62..000000000 --- a/.changeset/disable-asset-with-query.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'astro': patch ---- - -Astro will now skip asset optimization when there is a query in the import. Instead, it will let vite deal with it using plugins. - -```vue - -``` - diff --git a/.changeset/eighty-gifts-speak.md b/.changeset/eighty-gifts-speak.md deleted file mode 100644 index 38f64ac00..000000000 --- a/.changeset/eighty-gifts-speak.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'create-astro': patch ---- - -trim project name of the user input diff --git a/.changeset/empty-rings-bow.md b/.changeset/empty-rings-bow.md deleted file mode 100644 index fd928d548..000000000 --- a/.changeset/empty-rings-bow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes remote assets caching logic to not use expired assets diff --git a/.changeset/fair-countries-admire.md b/.changeset/fair-countries-admire.md deleted file mode 100644 index 1868ab016..000000000 --- a/.changeset/fair-countries-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/svelte': patch ---- - -Removed vite warnings. diff --git a/.changeset/friendly-clocks-act.md b/.changeset/friendly-clocks-act.md deleted file mode 100644 index 43c694880..000000000 --- a/.changeset/friendly-clocks-act.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'create-astro': patch -'astro': patch ---- - -Support detecting Bun when logging messages with package manager information. diff --git a/.changeset/hip-cats-jump.md b/.changeset/hip-cats-jump.md deleted file mode 100644 index f728408a0..000000000 --- a/.changeset/hip-cats-jump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fix missing type for `imageConfig` export from `astro:assets` diff --git a/.changeset/lovely-shoes-scream.md b/.changeset/lovely-shoes-scream.md deleted file mode 100644 index d510fc1fd..000000000 --- a/.changeset/lovely-shoes-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/cloudflare': patch ---- - -Update code sample in the README to use uppercase `GET`. diff --git a/.changeset/modern-guests-float.md b/.changeset/modern-guests-float.md deleted file mode 100644 index cda74642a..000000000 --- a/.changeset/modern-guests-float.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/vercel': patch ---- - -Fix serverless function naming conflicts for routes with identical filenames but different directory structures diff --git a/.changeset/spotty-glasses-grin.md b/.changeset/spotty-glasses-grin.md deleted file mode 100644 index 3a903b79d..000000000 --- a/.changeset/spotty-glasses-grin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/mdx': patch ---- - -Add location data to MDX compile errors diff --git a/.changeset/sweet-icons-stare.md b/.changeset/sweet-icons-stare.md deleted file mode 100644 index a041fccf4..000000000 --- a/.changeset/sweet-icons-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Installing will no longer fail when Sharp can't be installed diff --git a/.changeset/twelve-cars-tell.md b/.changeset/twelve-cars-tell.md deleted file mode 100644 index a1812d637..000000000 --- a/.changeset/twelve-cars-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fix markdown page HMR diff --git a/.changeset/weak-kids-roll.md b/.changeset/weak-kids-roll.md deleted file mode 100644 index 7d6d61f42..000000000 --- a/.changeset/weak-kids-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fix scroll position when navigating back from page w/o ViewTransitions diff --git a/examples/basics/package.json b/examples/basics/package.json index 8bca8d927..d0a0d8f7b 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 347540e05..b3c524f4c 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^1.0.0", + "@astrojs/mdx": "^1.0.1", "@astrojs/rss": "^3.0.0", "@astrojs/sitemap": "^3.0.0", - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/component/package.json b/examples/component/package.json index 39290c2b5..b2b270543 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/deno/package.json b/examples/deno/package.json index ac233a386..973ebdca8 100644 --- a/examples/deno/package.json +++ b/examples/deno/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" }, "devDependencies": { "@astrojs/deno": "^5.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index 9e933f622..a96093c5e 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.3.0", "@types/alpinejs": "^3.7.2", "alpinejs": "^3.12.3", - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index 0596fbd8d..404fe4c8d 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^3.0.0", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^3.0.8", + "astro": "^3.0.9", "lit": "^2.8.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 4246c6c1c..5b024a4a3 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -12,11 +12,11 @@ }, "dependencies": { "@astrojs/preact": "^3.0.0", - "@astrojs/react": "^3.0.0", + "@astrojs/react": "^3.0.1", "@astrojs/solid-js": "^3.0.0", - "@astrojs/svelte": "^4.0.0", + "@astrojs/svelte": "^4.0.1", "@astrojs/vue": "^3.0.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "preact": "^10.17.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index a97ff70e2..a17431e75 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.0", "@preact/signals": "^1.2.1", - "astro": "^3.0.8", + "astro": "^3.0.9", "preact": "^10.17.1" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 562a551ce..f0b5b5f98 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^3.0.0", + "@astrojs/react": "^3.0.1", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "astro": "^3.0.8", + "astro": "^3.0.9", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index f00813c91..e0f2f9b45 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^3.0.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "solid-js": "^1.7.11" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index c232e9e15..31b9f0ac1 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/svelte": "^4.0.0", - "astro": "^3.0.8", + "@astrojs/svelte": "^4.0.1", + "astro": "^3.0.9", "svelte": "^4.2.0" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 34fc9a29e..97d7e6037 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^3.0.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "vue": "^3.3.4" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 305b50d6e..01f246380 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^6.0.0", - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 6a6998105..f8f6a7a14 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index f0c83d7d9..4375233e3 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^6.0.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "html-minifier": "^4.0.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 13ea2c026..edd0a11e6 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 4cd01cc55..b3ee60a10 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 65d29e849..1b71525c2 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 87f03eec0..d6a72b463 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -13,8 +13,8 @@ }, "dependencies": { "@astrojs/node": "^6.0.0", - "@astrojs/svelte": "^4.0.0", - "astro": "^3.0.8", + "@astrojs/svelte": "^4.0.1", + "astro": "^3.0.9", "svelte": "^4.2.0" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 635710f2e..19c667974 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.5.0", - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 85f4f8ee6..7beb4eb38 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^3.0.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "hast-util-select": "^5.0.5", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.1.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 006e746d8..7b59b817b 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8" + "astro": "^3.0.9" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 1cf49e0db..ff9ecdb5d 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^1.0.0", + "@astrojs/mdx": "^1.0.1", "@astrojs/preact": "^3.0.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "preact": "^10.17.1" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 44367493b..880586df2 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.0", "@nanostores/preact": "^0.5.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "nanostores": "^0.9.3", "preact": "^10.17.1" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 4a349691e..1bda2e29f 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^1.0.0", + "@astrojs/mdx": "^1.0.1", "@astrojs/tailwind": "^5.0.0", "@types/canvas-confetti": "^1.6.0", - "astro": "^3.0.8", + "astro": "^3.0.9", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.6.0", "postcss": "^8.4.28", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index c8ae50043..55009fa4e 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.8", + "astro": "^3.0.9", "vite-plugin-pwa": "0.16.4", "workbox-window": "^7.0.0" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 2590af626..fdbead58f 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^3.0.8", + "astro": "^3.0.9", "vitest": "^0.34.2" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index dedc966a9..5bd2e69d3 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,32 @@ # astro +## 3.0.9 + +### Patch Changes + +- [#8351](https://github.com/withastro/astro/pull/8351) [`7d95bd9ba`](https://github.com/withastro/astro/commit/7d95bd9baaf755239fd7d35e4813861b2dbccf42) Thanks [@lilnasy](https://github.com/lilnasy)! - Fixed a case where dynamic imports tried to preload inlined stylesheets. + +- [#8353](https://github.com/withastro/astro/pull/8353) [`1947ef7a9`](https://github.com/withastro/astro/commit/1947ef7a99ce3d1d6ea797842edd31d5edffa5de) Thanks [@elevatebart](https://github.com/elevatebart)! - Astro will now skip asset optimization when there is a query in the import. Instead, it will let vite deal with it using plugins. + + ```vue + + ``` + +- [#8424](https://github.com/withastro/astro/pull/8424) [`61ad70fdc`](https://github.com/withastro/astro/commit/61ad70fdc52035964c43ecdb4cf7468f6c2b61e7) Thanks [@itsmatteomanf](https://github.com/itsmatteomanf)! - Fixes remote assets caching logic to not use expired assets + +- [#8306](https://github.com/withastro/astro/pull/8306) [`d2f2a11cd`](https://github.com/withastro/astro/commit/d2f2a11cdb42b0de79be21c798eda8e7e7b2a277) Thanks [@jacobthesheep](https://github.com/jacobthesheep)! - Support detecting Bun when logging messages with package manager information. + +- [#8414](https://github.com/withastro/astro/pull/8414) [`5126c6a40`](https://github.com/withastro/astro/commit/5126c6a40f88bff66ee5d3c3a21eea8c4a44ce7a) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix missing type for `imageConfig` export from `astro:assets` + +- [#8416](https://github.com/withastro/astro/pull/8416) [`48ff7855b`](https://github.com/withastro/astro/commit/48ff7855b238536a3df17cb29335c90029fc41a4) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Installing will no longer fail when Sharp can't be installed + +- [#8418](https://github.com/withastro/astro/pull/8418) [`923a443cb`](https://github.com/withastro/astro/commit/923a443cb060a0e936a0e1cc87c0360232f77914) Thanks [@bluwy](https://github.com/bluwy)! - Fix markdown page HMR + +- [#8332](https://github.com/withastro/astro/pull/8332) [`8935b3b46`](https://github.com/withastro/astro/commit/8935b3b4672d6c54c7b79e6c4575298f75eeb9f4) Thanks [@martrapp](https://github.com/martrapp)! - Fix scroll position when navigating back from page w/o ViewTransitions + ## 3.0.8 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index f80b96f69..4d45d722a 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "3.0.8", + "version": "3.0.9", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/create-astro/CHANGELOG.md b/packages/create-astro/CHANGELOG.md index 6788b6086..a74291c27 100644 --- a/packages/create-astro/CHANGELOG.md +++ b/packages/create-astro/CHANGELOG.md @@ -1,5 +1,13 @@ # create-astro +## 4.0.2 + +### Patch Changes + +- [#8427](https://github.com/withastro/astro/pull/8427) [`b81ff8fce`](https://github.com/withastro/astro/commit/b81ff8fcefe6c30312d7b2050a63b1520d79b25f) Thanks [@aswind7](https://github.com/aswind7)! - trim project name of the user input + +- [#8306](https://github.com/withastro/astro/pull/8306) [`d2f2a11cd`](https://github.com/withastro/astro/commit/d2f2a11cdb42b0de79be21c798eda8e7e7b2a277) Thanks [@jacobthesheep](https://github.com/jacobthesheep)! - Support detecting Bun when logging messages with package manager information. + ## 4.0.1 ### Patch Changes diff --git a/packages/create-astro/package.json b/packages/create-astro/package.json index a64f44187..0eb08cdc7 100644 --- a/packages/create-astro/package.json +++ b/packages/create-astro/package.json @@ -1,6 +1,6 @@ { "name": "create-astro", - "version": "4.0.1", + "version": "4.0.2", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/integrations/cloudflare/CHANGELOG.md b/packages/integrations/cloudflare/CHANGELOG.md index 212a67277..2785752eb 100644 --- a/packages/integrations/cloudflare/CHANGELOG.md +++ b/packages/integrations/cloudflare/CHANGELOG.md @@ -1,5 +1,15 @@ # @astrojs/cloudflare +## 7.0.2 + +### Patch Changes + +- [#8429](https://github.com/withastro/astro/pull/8429) [`bd8aa9a99`](https://github.com/withastro/astro/commit/bd8aa9a996c8a9f9283995360fd495c291d1f766) Thanks [@sarah11918](https://github.com/sarah11918)! - Update code sample in the README to use uppercase `GET`. + +- Updated dependencies [[`7d95bd9ba`](https://github.com/withastro/astro/commit/7d95bd9baaf755239fd7d35e4813861b2dbccf42), [`1947ef7a9`](https://github.com/withastro/astro/commit/1947ef7a99ce3d1d6ea797842edd31d5edffa5de), [`61ad70fdc`](https://github.com/withastro/astro/commit/61ad70fdc52035964c43ecdb4cf7468f6c2b61e7), [`d2f2a11cd`](https://github.com/withastro/astro/commit/d2f2a11cdb42b0de79be21c798eda8e7e7b2a277), [`5126c6a40`](https://github.com/withastro/astro/commit/5126c6a40f88bff66ee5d3c3a21eea8c4a44ce7a), [`48ff7855b`](https://github.com/withastro/astro/commit/48ff7855b238536a3df17cb29335c90029fc41a4), [`923a443cb`](https://github.com/withastro/astro/commit/923a443cb060a0e936a0e1cc87c0360232f77914), [`8935b3b46`](https://github.com/withastro/astro/commit/8935b3b4672d6c54c7b79e6c4575298f75eeb9f4)]: + - astro@3.0.9 + - @astrojs/underscore-redirects@0.3.0 + ## 7.0.1 ### Patch Changes diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 66b5e248d..6cc0ac32d 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/cloudflare", "description": "Deploy your site to Cloudflare Workers/Pages", - "version": "7.0.1", + "version": "7.0.2", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", @@ -45,7 +45,7 @@ "tiny-glob": "^0.2.9" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json index 1d25c9206..b941f976f 100644 --- a/packages/integrations/deno/package.json +++ b/packages/integrations/deno/package.json @@ -36,7 +36,7 @@ "esbuild": "^0.19.2" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index 1bcbdbd0f..49b05d19f 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -75,7 +75,7 @@ "zod": "3.21.1" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "@astrojs/markdown-remark": "workspace:*", diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index f509c2015..67031990b 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/mdx +## 1.0.1 + +### Patch Changes + +- [#8405](https://github.com/withastro/astro/pull/8405) [`93a1231f1`](https://github.com/withastro/astro/commit/93a1231f14d97339e38d8a67cf541337960e7d5e) Thanks [@delucis](https://github.com/delucis)! - Add location data to MDX compile errors + +- Updated dependencies [[`7d95bd9ba`](https://github.com/withastro/astro/commit/7d95bd9baaf755239fd7d35e4813861b2dbccf42), [`1947ef7a9`](https://github.com/withastro/astro/commit/1947ef7a99ce3d1d6ea797842edd31d5edffa5de), [`61ad70fdc`](https://github.com/withastro/astro/commit/61ad70fdc52035964c43ecdb4cf7468f6c2b61e7), [`d2f2a11cd`](https://github.com/withastro/astro/commit/d2f2a11cdb42b0de79be21c798eda8e7e7b2a277), [`5126c6a40`](https://github.com/withastro/astro/commit/5126c6a40f88bff66ee5d3c3a21eea8c4a44ce7a), [`48ff7855b`](https://github.com/withastro/astro/commit/48ff7855b238536a3df17cb29335c90029fc41a4), [`923a443cb`](https://github.com/withastro/astro/commit/923a443cb060a0e936a0e1cc87c0360232f77914), [`8935b3b46`](https://github.com/withastro/astro/commit/8935b3b4672d6c54c7b79e6c4575298f75eeb9f4)]: + - astro@3.0.9 + ## 1.0.0 ### Major Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 979399f9a..ddd2925fd 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/mdx", "description": "Add support for MDX pages in your Astro site", - "version": "1.0.0", + "version": "1.0.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", @@ -54,7 +54,7 @@ "vfile": "^5.3.7" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "@types/chai": "^4.3.5", diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json index 68d735c71..3445d9f96 100644 --- a/packages/integrations/netlify/package.json +++ b/packages/integrations/netlify/package.json @@ -43,7 +43,7 @@ "esbuild": "^0.19.2" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "@netlify/edge-functions": "^2.0.0", diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index e804c8c7d..12b1833f9 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -37,7 +37,7 @@ "server-destroy": "^1.0.1" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "@types/node": "^18.17.8", diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index d780a421e..cdd827987 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/react +## 3.0.1 + +### Patch Changes + +- [#8428](https://github.com/withastro/astro/pull/8428) [`67e834859`](https://github.com/withastro/astro/commit/67e83485949cf21de62831731111413abf57718c) Thanks [@matthewp](https://github.com/matthewp)! - Fix React dev mode using a base + ## 3.0.0 ### Major Changes diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 94814bdd2..d74e97465 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/react", "description": "Use React components within Astro", - "version": "3.0.0", + "version": "3.0.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md index 63b7a753d..12f1e38a6 100644 --- a/packages/integrations/svelte/CHANGELOG.md +++ b/packages/integrations/svelte/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/svelte +## 4.0.1 + +### Patch Changes + +- [#8351](https://github.com/withastro/astro/pull/8351) [`7d95bd9ba`](https://github.com/withastro/astro/commit/7d95bd9baaf755239fd7d35e4813861b2dbccf42) Thanks [@lilnasy](https://github.com/lilnasy)! - Removed vite warnings. + +- Updated dependencies [[`7d95bd9ba`](https://github.com/withastro/astro/commit/7d95bd9baaf755239fd7d35e4813861b2dbccf42), [`1947ef7a9`](https://github.com/withastro/astro/commit/1947ef7a99ce3d1d6ea797842edd31d5edffa5de), [`61ad70fdc`](https://github.com/withastro/astro/commit/61ad70fdc52035964c43ecdb4cf7468f6c2b61e7), [`d2f2a11cd`](https://github.com/withastro/astro/commit/d2f2a11cdb42b0de79be21c798eda8e7e7b2a277), [`5126c6a40`](https://github.com/withastro/astro/commit/5126c6a40f88bff66ee5d3c3a21eea8c4a44ce7a), [`48ff7855b`](https://github.com/withastro/astro/commit/48ff7855b238536a3df17cb29335c90029fc41a4), [`923a443cb`](https://github.com/withastro/astro/commit/923a443cb060a0e936a0e1cc87c0360232f77914), [`8935b3b46`](https://github.com/withastro/astro/commit/8935b3b4672d6c54c7b79e6c4575298f75eeb9f4)]: + - astro@3.0.9 + ## 4.0.0 ### Major Changes diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index a1f599f04..a6161eaaa 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/svelte", - "version": "4.0.0", + "version": "4.0.1", "description": "Use Svelte components within Astro", "type": "module", "types": "./dist/index.d.ts", @@ -48,7 +48,7 @@ "vite": "^4.4.9" }, "peerDependencies": { - "astro": "workspace:^3.0.8", + "astro": "workspace:^3.0.9", "svelte": "^3.55.0 || ^4.0.0" }, "engines": { diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index c80d82735..b0a2b0126 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -43,7 +43,7 @@ "vite": "^4.4.9" }, "peerDependencies": { - "astro": "workspace:^3.0.8", + "astro": "workspace:^3.0.9", "tailwindcss": "^3.0.24" } } diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md index c6a1cf30b..0906aa23d 100644 --- a/packages/integrations/vercel/CHANGELOG.md +++ b/packages/integrations/vercel/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/vercel +## 4.0.4 + +### Patch Changes + +- [#8408](https://github.com/withastro/astro/pull/8408) [`9ffa1a84e`](https://github.com/withastro/astro/commit/9ffa1a84e81f52d55ffe07826b8b1f10fc023ee9) Thanks [@slawekkolodziej](https://github.com/slawekkolodziej)! - Fix serverless function naming conflicts for routes with identical filenames but different directory structures + +- Updated dependencies [[`7d95bd9ba`](https://github.com/withastro/astro/commit/7d95bd9baaf755239fd7d35e4813861b2dbccf42), [`1947ef7a9`](https://github.com/withastro/astro/commit/1947ef7a99ce3d1d6ea797842edd31d5edffa5de), [`61ad70fdc`](https://github.com/withastro/astro/commit/61ad70fdc52035964c43ecdb4cf7468f6c2b61e7), [`d2f2a11cd`](https://github.com/withastro/astro/commit/d2f2a11cdb42b0de79be21c798eda8e7e7b2a277), [`5126c6a40`](https://github.com/withastro/astro/commit/5126c6a40f88bff66ee5d3c3a21eea8c4a44ce7a), [`48ff7855b`](https://github.com/withastro/astro/commit/48ff7855b238536a3df17cb29335c90029fc41a4), [`923a443cb`](https://github.com/withastro/astro/commit/923a443cb060a0e936a0e1cc87c0360232f77914), [`8935b3b46`](https://github.com/withastro/astro/commit/8935b3b4672d6c54c7b79e6c4575298f75eeb9f4)]: + - astro@3.0.9 + ## 4.0.3 ### Patch Changes diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index 950680e23..85132c1fe 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/vercel", "description": "Deploy your site to Vercel", - "version": "4.0.3", + "version": "4.0.4", "type": "module", "author": "withastro", "license": "MIT", @@ -60,7 +60,7 @@ "web-vitals": "^3.4.0" }, "peerDependencies": { - "astro": "workspace:^3.0.8" + "astro": "workspace:^3.0.9" }, "devDependencies": { "@types/set-cookie-parser": "^2.4.3", diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 4c63835cf..60d34634b 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -56,7 +56,7 @@ "vue": "^3.3.4" }, "peerDependencies": { - "astro": "workspace:^3.0.8", + "astro": "workspace:^3.0.9", "vue": "^3.2.30" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ab1a07e0..67fb5c391 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,13 +125,13 @@ importers: examples/basics: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/blog: dependencies: '@astrojs/mdx': - specifier: ^1.0.0 + specifier: ^1.0.1 version: link:../../packages/integrations/mdx '@astrojs/rss': specifier: ^3.0.0 @@ -140,19 +140,19 @@ importers: specifier: ^3.0.0 version: link:../../packages/integrations/sitemap astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/deno: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro devDependencies: '@astrojs/deno': @@ -171,7 +171,7 @@ importers: specifier: ^3.12.3 version: 3.12.3 astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/framework-lit: @@ -183,7 +183,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro lit: specifier: ^2.8.0 @@ -195,19 +195,19 @@ importers: specifier: ^3.0.0 version: link:../../packages/integrations/preact '@astrojs/react': - specifier: ^3.0.0 + specifier: ^3.0.1 version: link:../../packages/integrations/react '@astrojs/solid-js': specifier: ^3.0.0 version: link:../../packages/integrations/solid '@astrojs/svelte': - specifier: ^4.0.0 + specifier: ^4.0.1 version: link:../../packages/integrations/svelte '@astrojs/vue': specifier: ^3.0.0 version: link:../../packages/integrations/vue astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro preact: specifier: ^10.17.1 @@ -237,7 +237,7 @@ importers: specifier: ^1.2.1 version: 1.2.1(preact@10.17.1) astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro preact: specifier: ^10.17.1 @@ -246,7 +246,7 @@ importers: examples/framework-react: dependencies: '@astrojs/react': - specifier: ^3.0.0 + specifier: ^3.0.1 version: link:../../packages/integrations/react '@types/react': specifier: ^18.2.21 @@ -255,7 +255,7 @@ importers: specifier: ^18.2.7 version: 18.2.7 astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -270,7 +270,7 @@ importers: specifier: ^3.0.0 version: link:../../packages/integrations/solid astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro solid-js: specifier: ^1.7.11 @@ -279,10 +279,10 @@ importers: examples/framework-svelte: dependencies: '@astrojs/svelte': - specifier: ^4.0.0 + specifier: ^4.0.1 version: link:../../packages/integrations/svelte astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro svelte: specifier: ^4.2.0 @@ -294,7 +294,7 @@ importers: specifier: ^3.0.0 version: link:../../packages/integrations/vue astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro vue: specifier: ^3.3.4 @@ -306,13 +306,13 @@ importers: specifier: ^6.0.0 version: link:../../packages/integrations/node astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/middleware: @@ -321,7 +321,7 @@ importers: specifier: ^6.0.0 version: link:../../packages/integrations/node astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -330,19 +330,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/ssr: @@ -351,10 +351,10 @@ importers: specifier: ^6.0.0 version: link:../../packages/integrations/node '@astrojs/svelte': - specifier: ^4.0.0 + specifier: ^4.0.1 version: link:../../packages/integrations/svelte astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro svelte: specifier: ^4.2.0 @@ -366,7 +366,7 @@ importers: specifier: ^0.5.0 version: link:../../packages/integrations/markdoc astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/with-markdown-plugins: @@ -375,7 +375,7 @@ importers: specifier: ^3.0.0 version: link:../../packages/markdown/remark astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro hast-util-select: specifier: ^5.0.5 @@ -396,19 +396,19 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro examples/with-mdx: dependencies: '@astrojs/mdx': - specifier: ^1.0.0 + specifier: ^1.0.1 version: link:../../packages/integrations/mdx '@astrojs/preact': specifier: ^3.0.0 version: link:../../packages/integrations/preact astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro preact: specifier: ^10.17.1 @@ -423,7 +423,7 @@ importers: specifier: ^0.5.0 version: 0.5.0(nanostores@0.9.3)(preact@10.17.1) astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro nanostores: specifier: ^0.9.3 @@ -435,7 +435,7 @@ importers: examples/with-tailwindcss: dependencies: '@astrojs/mdx': - specifier: ^1.0.0 + specifier: ^1.0.1 version: link:../../packages/integrations/mdx '@astrojs/tailwind': specifier: ^5.0.0 @@ -444,7 +444,7 @@ importers: specifier: ^1.6.0 version: 1.6.0 astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -462,7 +462,7 @@ importers: examples/with-vite-plugin-pwa: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro vite-plugin-pwa: specifier: 0.16.4 @@ -474,7 +474,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^3.0.8 + specifier: ^3.0.9 version: link:../../packages/astro vitest: specifier: ^0.34.2 From c06b41a6b86a41ba4b1ffa4bdecafac9b7299768 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 6 Sep 2023 10:23:44 -0500 Subject: [PATCH 10/48] Update Prettier (#8420) * chore: fix prettier config * chore: format * chore(prettier): format `.astro` files --- .prettierignore | 7 ------- .prettierrc.cjs | 24 ------------------------ package.json | 5 +++-- pnpm-lock.yaml | 34 +++++++++++++++++----------------- prettier.config.js | 24 ++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 50 deletions(-) delete mode 100644 .prettierrc.cjs create mode 100644 prettier.config.js diff --git a/.prettierignore b/.prettierignore index f53f92086..af84e3433 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,10 +1,3 @@ -# Ignoring these files for now due to https://github.com/withastro/compiler/issues/585 -examples/basics/src/layouts -examples/with-nanostores/src/layouts - -# Ignoring this file for now due to https://github.com/withastro/compiler/issues/485 -packages/markdown/component/Markdown.astro - # Benchmark artifacts benchmark/projects/ benchmark/results/ diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index 39911db2c..000000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,24 +0,0 @@ -// Heads up: This file should be renamed to `.cjs`, however if we did that, changesets wouldn't be able to load it -module.exports = { - printWidth: 100, - semi: true, - singleQuote: true, - tabWidth: 2, - trailingComma: 'es5', - useTabs: true, - plugins: ['prettier-plugin-astro'], - overrides: [ - { - files: ['.*', '*.json', '*.md', '*.toml', '*.yml'], - options: { - useTabs: false, - }, - }, - { - files: ['**/*.astro'], - options: { - parser: 'astro', - }, - }, - ], -}; diff --git a/package.json b/package.json index 00b74e02f..8bf7dc459 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "root", + "type": "module", "version": "0.0.0", "private": true, "repository": { @@ -14,7 +15,7 @@ "dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"", "format": "pnpm run format:code", "format:ci": "pnpm run format:imports && pnpm run format:code", - "format:code": "prettier -w . --cache", + "format:code": "prettier -w \"**/*\" --ignore-unknown --cache", "format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json", "test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", "test:match": "cd packages/astro && pnpm run test:match", @@ -89,7 +90,7 @@ "eslint-plugin-prettier": "^5.0.0", "only-allow": "^1.1.1", "organize-imports-cli": "^0.10.0", - "prettier": "^3.0.2", + "prettier": "^3.0.3", "prettier-plugin-astro": "^0.12.0", "tiny-glob": "^0.2.9", "turbo": "^1.10.12", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67fb5c391..ee6c198e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,7 @@ importers: devDependencies: '@astrojs/check': specifier: ^0.1.0 - version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6) + version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6) '@changesets/changelog-github': specifier: ^0.4.8 version: 0.4.8 @@ -50,7 +50,7 @@ importers: version: 3.1.0 eslint-plugin-prettier: specifier: ^5.0.0 - version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2) + version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.3) only-allow: specifier: ^1.1.1 version: 1.1.1 @@ -58,8 +58,8 @@ importers: specifier: ^0.10.0 version: 0.10.0 prettier: - specifier: ^3.0.2 - version: 3.0.2 + specifier: ^3.0.3 + version: 3.0.3 prettier-plugin-astro: specifier: ^0.12.0 version: 0.12.0 @@ -654,7 +654,7 @@ importers: devDependencies: '@astrojs/check': specifier: ^0.1.0 - version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6) + version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6) '@playwright/test': specifier: ^1.37.1 version: 1.37.1 @@ -5156,13 +5156,13 @@ packages: lite-youtube-embed: 0.2.0 dev: false - /@astrojs/check@0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6): + /@astrojs/check@0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6): resolution: {integrity: sha512-tgjq+Vehgv0dwdsRlT4ai3QgT3etn8W5C4E4dvQ0Xe9ccwjKdMTWmpty5exfBtHLLAAOvwe5/OkYQsQ9OyKoVw==} hasBin: true peerDependencies: typescript: ^5.0.0 dependencies: - '@astrojs/language-server': 2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6) + '@astrojs/language-server': 2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6) chokidar: 3.5.3 fast-glob: 3.3.1 kleur: 4.1.5 @@ -5193,7 +5193,7 @@ packages: resolution: {integrity: sha512-DfBR7Cf+tOgQ4n7TIgTtU5x5SEA/08DNshpEPcT+91A0KbBlmUOYMBM/O6qAaHkmVo1KIoXQYhAmfdTT1zx9PQ==} dev: false - /@astrojs/language-server@2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6): + /@astrojs/language-server@2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6): resolution: {integrity: sha512-NFSzszjR4+f0+fTUCuFKXrLWusJFqWvHMrIzHB0lXUE8dt3Dm1Ok9Emrdj3s3BvlguJz05MV9xSIz1puMvomtQ==} hasBin: true peerDependencies: @@ -5215,12 +5215,12 @@ packages: '@volar/typescript': 1.10.0 fast-glob: 3.3.1 muggle-string: 0.3.1 - prettier: 3.0.2 + prettier: 3.0.3 prettier-plugin-astro: 0.12.0 volar-service-css: 0.0.11(@volar/language-service@1.10.0) volar-service-emmet: 0.0.11(@volar/language-service@1.10.0) volar-service-html: 0.0.11(@volar/language-service@1.10.0) - volar-service-prettier: 0.0.11(@volar/language-service@1.10.0)(prettier@3.0.2) + volar-service-prettier: 0.0.11(@volar/language-service@1.10.0)(prettier@3.0.3) volar-service-typescript: 0.0.11(@volar/language-service@1.10.0)(@volar/typescript@1.10.0) volar-service-typescript-twoslash-queries: 0.0.11(@volar/language-service@1.10.0) vscode-html-languageservice: 5.0.6 @@ -11262,7 +11262,7 @@ packages: engines: {node: '>=5.0.0'} dev: true - /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2): + /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.3): resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -11278,7 +11278,7 @@ packages: dependencies: eslint: 8.47.0 eslint-config-prettier: 9.0.0(eslint@8.47.0) - prettier: 3.0.2 + prettier: 3.0.3 prettier-linter-helpers: 1.0.0 synckit: 0.8.5 dev: true @@ -15247,7 +15247,7 @@ packages: engines: {node: ^14.15.0 || >=16.0.0} dependencies: '@astrojs/compiler': 1.8.2 - prettier: 3.0.2 + prettier: 3.0.3 sass-formatter: 0.7.7 dev: true @@ -15257,8 +15257,8 @@ packages: hasBin: true dev: true - /prettier@3.0.2: - resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} engines: {node: '>=14'} hasBin: true dev: true @@ -17739,7 +17739,7 @@ packages: vscode-uri: 3.0.7 dev: true - /volar-service-prettier@0.0.11(@volar/language-service@1.10.0)(prettier@3.0.2): + /volar-service-prettier@0.0.11(@volar/language-service@1.10.0)(prettier@3.0.3): resolution: {integrity: sha512-A4vEU5BUitNNAySb+t/fCjEoL01uYUkoe/Fe5UxR3JJbdgr2nTeXb5IlW90/1vzmnTKZznadJV4i1SoAf2CRbg==} peerDependencies: '@volar/language-service': ~1.10.0 @@ -17751,7 +17751,7 @@ packages: optional: true dependencies: '@volar/language-service': 1.10.0 - prettier: 3.0.2 + prettier: 3.0.3 dev: true /volar-service-typescript-twoslash-queries@0.0.11(@volar/language-service@1.10.0): diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 000000000..b28486608 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,24 @@ +/** @type {import("prettier").Config} */ +export default { + printWidth: 100, + semi: true, + singleQuote: true, + tabWidth: 2, + trailingComma: 'es5', + useTabs: true, + plugins: ['prettier-plugin-astro'], + overrides: [ + { + files: ['.*', '*.json', '*.md', '*.toml', '*.yml'], + options: { + useTabs: false, + }, + }, + { + files: ['**/*.astro'], + options: { + parser: 'astro', + }, + }, + ], +}; From eb7615f25a88c25dc6db50b199877a8f79597a74 Mon Sep 17 00:00:00 2001 From: natemoo-re Date: Wed, 6 Sep 2023 15:25:56 +0000 Subject: [PATCH 11/48] [ci] format --- examples/basics/src/layouts/Layout.astro | 26 +++++++--- examples/blog/src/pages/blog/index.astro | 2 +- examples/blog/src/pages/index.astro | 10 ++-- examples/deno/src/components/Layout.astro | 13 +++-- examples/framework-lit/src/pages/index.astro | 2 +- .../hackernews/src/pages/stories/[id].astro | 2 +- examples/middleware/src/components/Card.astro | 4 +- examples/middleware/src/layouts/Layout.astro | 13 +++-- examples/minimal/src/pages/index.astro | 1 + examples/portfolio/src/components/Nav.astro | 6 ++- .../src/components/ThemeToggle.astro | 4 +- .../portfolio/src/layouts/BaseLayout.astro | 11 ++-- examples/portfolio/src/pages/about.astro | 7 +-- examples/portfolio/src/pages/index.astro | 6 ++- .../with-markdoc/src/layouts/Layout.astro | 13 +++-- .../with-nanostores/src/layouts/Layout.astro | 51 ++++++++++--------- .../src/pages/index.astro | 1 + examples/with-vitest/src/pages/index.astro | 1 + .../astro/components/ViewTransitions.astro | 28 +++++----- 19 files changed, 127 insertions(+), 74 deletions(-) diff --git a/examples/basics/src/layouts/Layout.astro b/examples/basics/src/layouts/Layout.astro index 3345b887c..7b552be19 100644 --- a/examples/basics/src/layouts/Layout.astro +++ b/examples/basics/src/layouts/Layout.astro @@ -1,4 +1,4 @@ ---- +--- interface Props { title: string; } @@ -6,11 +6,11 @@ interface Props { const { title } = Astro.props; --- - + - + @@ -25,15 +25,27 @@ const { title } = Astro.props; --accent: 136, 58, 234; --accent-light: 224, 204, 250; --accent-dark: 49, 10, 101; - --accent-gradient: linear-gradient(45deg, rgb(var(--accent)), rgb(var(--accent-light)) 30%, white 60%); + --accent-gradient: linear-gradient( + 45deg, + rgb(var(--accent)), + rgb(var(--accent-light)) 30%, + white 60% + ); } html { font-family: system-ui, sans-serif; - background: #13151A; + background: #13151a; background-size: 224px; } code { - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; + font-family: + Menlo, + Monaco, + Lucida Console, + Liberation Mono, + DejaVu Sans Mono, + Bitstream Vera Sans Mono, + Courier New, + monospace; } diff --git a/examples/blog/src/pages/blog/index.astro b/examples/blog/src/pages/blog/index.astro index a5c329a87..ebbcd3042 100644 --- a/examples/blog/src/pages/blog/index.astro +++ b/examples/blog/src/pages/blog/index.astro @@ -11,7 +11,7 @@ const posts = (await getCollection('blog')).sort( ); --- - + diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index 26f070da5..1c8be6135 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -5,7 +5,7 @@ import Footer from '../components/Footer.astro'; import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; --- - + @@ -16,14 +16,14 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';

🧑‍🚀 Hello, Astronaut!

Welcome to the official Astro blog starter template. This - template serves as a lightweight, minimally-styled starting point for anyone looking to build - a personal website, blog, or portfolio with Astro. + template serves as a lightweight, minimally-styled starting point for anyone looking to + build a personal website, blog, or portfolio with Astro.

This template comes with a few integrations already configured in your astro.config.mjs file. You can customize your setup with - Astro Integrations to add tools like Tailwind, - React, or Vue to your project. + Astro Integrations to add tools like + Tailwind, React, or Vue to your project.

Here are a few ideas on how to get started with the template:

    diff --git a/examples/deno/src/components/Layout.astro b/examples/deno/src/components/Layout.astro index 7d329d0a4..7bcbd218c 100644 --- a/examples/deno/src/components/Layout.astro +++ b/examples/deno/src/components/Layout.astro @@ -6,7 +6,7 @@ interface Props { const { title } = Astro.props as Props; --- - + @@ -46,8 +46,15 @@ const { title } = Astro.props as Props; } :global(code) { - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; + font-family: + Menlo, + Monaco, + Lucida Console, + Liberation Mono, + DejaVu Sans Mono, + Bitstream Vera Sans Mono, + Courier New, + monospace; } diff --git a/examples/framework-lit/src/pages/index.astro b/examples/framework-lit/src/pages/index.astro index a351b8248..5ef314f6f 100644 --- a/examples/framework-lit/src/pages/index.astro +++ b/examples/framework-lit/src/pages/index.astro @@ -7,7 +7,7 @@ import { MyCounter } from '../components/my-counter.js'; // https://docs.astro.build/core-concepts/astro-components/ --- - + diff --git a/examples/hackernews/src/pages/stories/[id].astro b/examples/hackernews/src/pages/stories/[id].astro index 84383aa9e..9cfad36fd 100644 --- a/examples/hackernews/src/pages/stories/[id].astro +++ b/examples/hackernews/src/pages/stories/[id].astro @@ -25,7 +25,7 @@ const story = (await fetchAPI(`item/${id}`)) as IStory; {story.user} -  {story.time_ago} +  {story.time_ago}

    diff --git a/examples/middleware/src/components/Card.astro b/examples/middleware/src/components/Card.astro index a1e0ccf6e..1ff16e5fb 100644 --- a/examples/middleware/src/components/Card.astro +++ b/examples/middleware/src/components/Card.astro @@ -30,7 +30,9 @@ const { href, title, body } = Astro.props; border-radius: 0.6rem; background-position: 100%; transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1); - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); + box-shadow: + 0 4px 6px -1px rgba(0, 0, 0, 0.1), + 0 2px 4px -2px rgba(0, 0, 0, 0.1); } .link-card > a { diff --git a/examples/middleware/src/layouts/Layout.astro b/examples/middleware/src/layouts/Layout.astro index b3def2637..90d2fb715 100644 --- a/examples/middleware/src/layouts/Layout.astro +++ b/examples/middleware/src/layouts/Layout.astro @@ -6,7 +6,7 @@ interface Props { const { title } = Astro.props; --- - + @@ -29,7 +29,14 @@ const { title } = Astro.props; background-color: #f6f6f6; } code { - font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, - Bitstream Vera Sans Mono, Courier New, monospace; + font-family: + Menlo, + Monaco, + Lucida Console, + Liberation Mono, + DejaVu Sans Mono, + Bitstream Vera Sans Mono, + Courier New, + monospace; } diff --git a/examples/minimal/src/pages/index.astro b/examples/minimal/src/pages/index.astro index 7264ff502..2d1410736 100644 --- a/examples/minimal/src/pages/index.astro +++ b/examples/minimal/src/pages/index.astro @@ -1,4 +1,5 @@ --- + --- diff --git a/examples/portfolio/src/components/Nav.astro b/examples/portfolio/src/components/Nav.astro index bf9ac7869..d0a5857b1 100644 --- a/examples/portfolio/src/components/Nav.astro +++ b/examples/portfolio/src/components/Nav.astro @@ -25,7 +25,7 @@ const iconLinks: { label: string; href: string; icon: keyof typeof iconPaths }[]