From 713f99e849b26edb831ea6527b7103ad7a6b200f Mon Sep 17 00:00:00 2001 From: Arsh <69170106+lilnasy@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:07:28 +0530 Subject: [PATCH 01/16] fix(db): isolate AstroDbError from core utils (#10646) * fix(db): isolate AstroDbError from core utils * add changeset --- .changeset/dull-news-grab.md | 5 +++++ packages/db/src/core/integration/index.ts | 2 +- packages/db/src/runtime/db-client.ts | 3 +-- packages/db/src/runtime/seed-local.ts | 2 +- packages/db/src/runtime/utils.ts | 6 ++++++ packages/db/src/utils.ts | 6 ------ 6 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 .changeset/dull-news-grab.md diff --git a/.changeset/dull-news-grab.md b/.changeset/dull-news-grab.md new file mode 100644 index 000000000000..293dc6fc6945 --- /dev/null +++ b/.changeset/dull-news-grab.md @@ -0,0 +1,5 @@ +--- +"@astrojs/db": patch +--- + +Fixes an issue astro:db could not be used on serverless platforms. diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index c6ebf6ff3195..5c40c85214bf 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -7,7 +7,7 @@ import { blue, yellow } from 'kleur/colors'; import { loadEnv } from 'vite'; import parseArgs from 'yargs-parser'; import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js'; -import { AstroDbError } from '../../utils.js'; +import { AstroDbError } from '../../runtime/utils.js'; import { CONFIG_FILE_NAMES, DB_PATH } from '../consts.js'; import { resolveDbConfig } from '../load-file.js'; import { type ManagedAppToken, getManagedAppTokenOrExit } from '../tokens.js'; diff --git a/packages/db/src/runtime/db-client.ts b/packages/db/src/runtime/db-client.ts index 7eddd60604e6..d52af72fce95 100644 --- a/packages/db/src/runtime/db-client.ts +++ b/packages/db/src/runtime/db-client.ts @@ -4,8 +4,7 @@ import type { LibSQLDatabase } from 'drizzle-orm/libsql'; import { drizzle as drizzleLibsql } from 'drizzle-orm/libsql'; import { type SqliteRemoteDatabase, drizzle as drizzleProxy } from 'drizzle-orm/sqlite-proxy'; import { z } from 'zod'; -import { AstroDbError } from '../utils.js'; -import { safeFetch } from './utils.js'; +import { AstroDbError, safeFetch } from './utils.js'; const isWebContainer = !!process.versions?.webcontainer; diff --git a/packages/db/src/runtime/seed-local.ts b/packages/db/src/runtime/seed-local.ts index 83e3acad5a53..1d16204a5407 100644 --- a/packages/db/src/runtime/seed-local.ts +++ b/packages/db/src/runtime/seed-local.ts @@ -3,7 +3,7 @@ import { type SQL, sql } from 'drizzle-orm'; import type { LibSQLDatabase } from 'drizzle-orm/libsql'; import { SQLiteAsyncDialect } from 'drizzle-orm/sqlite-core'; import { type DBTables } from '../core/types.js'; -import { AstroDbError } from '../utils.js'; +import { AstroDbError } from './utils.js'; import { SEED_DEFAULT_EXPORT_ERROR } from './errors.js'; import { getCreateIndexQueries, getCreateTableQuery } from './queries.js'; diff --git a/packages/db/src/runtime/utils.ts b/packages/db/src/runtime/utils.ts index 29160b22df16..ac6cfeda6efb 100644 --- a/packages/db/src/runtime/utils.ts +++ b/packages/db/src/runtime/utils.ts @@ -1,3 +1,5 @@ +import { AstroError } from 'astro/errors'; + /** * Small wrapper around fetch that throws an error if the response is not OK. Allows for custom error handling as well through the onNotOK callback. */ @@ -16,3 +18,7 @@ export async function safeFetch( return response; } + +export class AstroDbError extends AstroError { + name = 'Astro DB Error'; +} diff --git a/packages/db/src/utils.ts b/packages/db/src/utils.ts index 1e7b00b12698..4e1a18685ebf 100644 --- a/packages/db/src/utils.ts +++ b/packages/db/src/utils.ts @@ -1,8 +1,2 @@ -import { AstroError } from 'astro/errors'; - export { defineDbIntegration } from './core/utils.js'; export { asDrizzleTable } from './runtime/index.js'; - -export class AstroDbError extends AstroError { - name = 'Astro DB Error'; -} From 953695ec2db8ed16234357495b0378fee4a6c95f Mon Sep 17 00:00:00 2001 From: Arsh Date: Tue, 2 Apr 2024 15:38:27 +0000 Subject: [PATCH 02/16] [ci] format --- packages/db/src/runtime/seed-local.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/src/runtime/seed-local.ts b/packages/db/src/runtime/seed-local.ts index 1d16204a5407..3fb6c61d0c6b 100644 --- a/packages/db/src/runtime/seed-local.ts +++ b/packages/db/src/runtime/seed-local.ts @@ -3,9 +3,9 @@ import { type SQL, sql } from 'drizzle-orm'; import type { LibSQLDatabase } from 'drizzle-orm/libsql'; import { SQLiteAsyncDialect } from 'drizzle-orm/sqlite-core'; import { type DBTables } from '../core/types.js'; -import { AstroDbError } from './utils.js'; import { SEED_DEFAULT_EXPORT_ERROR } from './errors.js'; import { getCreateIndexQueries, getCreateTableQuery } from './queries.js'; +import { AstroDbError } from './utils.js'; const sqlite = new SQLiteAsyncDialect(); From fd18a5dda981c1b13c0a585d174ed2f09a2e9218 Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Tue, 2 Apr 2024 09:11:32 -0700 Subject: [PATCH 03/16] [ci] release (#10647) Co-authored-by: github-actions[bot] --- .changeset/calm-spiders-listen.md | 5 --- .changeset/dull-news-grab.md | 5 --- examples/framework-multiple/package.json | 2 +- examples/framework-svelte/package.json | 2 +- examples/ssr/package.json | 2 +- packages/db/CHANGELOG.md | 6 ++++ packages/db/package.json | 2 +- packages/integrations/svelte/CHANGELOG.md | 6 ++++ packages/integrations/svelte/package.json | 2 +- pnpm-lock.yaml | 38 +++++++++++++++++++++-- 10 files changed, 52 insertions(+), 18 deletions(-) delete mode 100644 .changeset/calm-spiders-listen.md delete mode 100644 .changeset/dull-news-grab.md diff --git a/.changeset/calm-spiders-listen.md b/.changeset/calm-spiders-listen.md deleted file mode 100644 index 3503c5010314..000000000000 --- a/.changeset/calm-spiders-listen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@astrojs/svelte": minor ---- - -Bumps Svelte 5 peer dependency to `^5.0.0-next.90` and support its latest breaking changes diff --git a/.changeset/dull-news-grab.md b/.changeset/dull-news-grab.md deleted file mode 100644 index 293dc6fc6945..000000000000 --- a/.changeset/dull-news-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@astrojs/db": patch ---- - -Fixes an issue astro:db could not be used on serverless platforms. diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index e8993d0d858d..fb31221c572d 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -14,7 +14,7 @@ "@astrojs/preact": "^3.1.2", "@astrojs/react": "^3.1.0", "@astrojs/solid-js": "^4.0.1", - "@astrojs/svelte": "^5.2.0", + "@astrojs/svelte": "^5.3.0", "@astrojs/vue": "^4.0.10", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 44ab912ad8fc..fbc85b989e8b 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/svelte": "^5.2.0", + "@astrojs/svelte": "^5.3.0", "astro": "^4.5.13", "svelte": "^4.2.5" } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 7dd9ffe1baa2..415e3c7a3570 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^8.2.5", - "@astrojs/svelte": "^5.2.0", + "@astrojs/svelte": "^5.3.0", "astro": "^4.5.13", "svelte": "^4.2.5" } diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index e362cd8ae94c..f64a6af241ba 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/db +## 0.9.10 + +### Patch Changes + +- [#10646](https://github.com/withastro/astro/pull/10646) [`713f99e849b26edb831ea6527b7103ad7a6b200f`](https://github.com/withastro/astro/commit/713f99e849b26edb831ea6527b7103ad7a6b200f) Thanks [@lilnasy](https://github.com/lilnasy)! - Fixes an issue astro:db could not be used on serverless platforms. + ## 0.9.9 ### Patch Changes diff --git a/packages/db/package.json b/packages/db/package.json index 90dc7e198772..5ee71a3cfb63 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/db", - "version": "0.9.9", + "version": "0.9.10", "description": "", "license": "MIT", "type": "module", diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md index 2a3500ed132e..a532cc744ccd 100644 --- a/packages/integrations/svelte/CHANGELOG.md +++ b/packages/integrations/svelte/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/svelte +## 5.3.0 + +### Minor Changes + +- [#10645](https://github.com/withastro/astro/pull/10645) [`51112ab3f1b134740e8307743bbb15cb0d8bdbb3`](https://github.com/withastro/astro/commit/51112ab3f1b134740e8307743bbb15cb0d8bdbb3) Thanks [@mingjunlu](https://github.com/mingjunlu)! - Bumps Svelte 5 peer dependency to `^5.0.0-next.90` and support its latest breaking changes + ## 5.2.0 ### Minor Changes diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index ce2f2f40108c..d20d3c5a27eb 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/svelte", - "version": "5.2.0", + "version": "5.3.0", "description": "Use Svelte components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5c54e72166b..3558c882ff52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -200,7 +200,7 @@ importers: specifier: ^4.0.1 version: link:../../packages/integrations/solid '@astrojs/svelte': - specifier: ^5.2.0 + specifier: ^5.3.0 version: link:../../packages/integrations/svelte '@astrojs/vue': specifier: ^4.0.10 @@ -284,7 +284,7 @@ importers: examples/framework-svelte: dependencies: '@astrojs/svelte': - specifier: ^5.2.0 + specifier: ^5.3.0 version: link:../../packages/integrations/svelte astro: specifier: ^4.5.13 @@ -360,7 +360,7 @@ importers: specifier: ^8.2.5 version: link:../../packages/integrations/node '@astrojs/svelte': - specifier: ^5.2.0 + specifier: ^5.3.0 version: link:../../packages/integrations/svelte astro: specifier: ^4.5.13 @@ -9191,6 +9191,7 @@ packages: /b4a@1.6.6: resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==} + requiresBuild: true dev: false /babel-plugin-jsx-dom-expressions@0.37.19(@babel/core@7.24.3): @@ -9302,6 +9303,7 @@ packages: /bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + requiresBuild: true dependencies: buffer: 5.7.1 inherits: 2.0.4 @@ -9593,6 +9595,7 @@ packages: /chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + requiresBuild: true dev: false /chownr@2.0.0: @@ -9717,9 +9720,11 @@ 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 @@ -9733,6 +9738,7 @@ 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 @@ -10067,6 +10073,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 dev: false @@ -10088,6 +10095,7 @@ packages: /deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} + requiresBuild: true dev: false /deep-is@0.1.4: @@ -10423,6 +10431,7 @@ packages: /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + requiresBuild: true dependencies: once: 1.4.0 dev: false @@ -10869,6 +10878,7 @@ packages: /expand-template@2.0.3: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} + requiresBuild: true dev: false /express@4.19.2: @@ -10943,6 +10953,7 @@ packages: /fast-fifo@1.3.2: resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} + requiresBuild: true dev: false /fast-glob@3.3.2: @@ -11105,6 +11116,7 @@ packages: /fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + requiresBuild: true dev: false /fs-extra@10.1.0: @@ -11258,6 +11270,7 @@ packages: /github-from-package@0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + requiresBuild: true dev: false /github-slugger@2.0.0: @@ -11842,6 +11855,7 @@ packages: /ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + requiresBuild: true dev: false /inline-style-parser@0.1.1: @@ -11889,6 +11903,7 @@ packages: /is-arrayish@0.3.2: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + requiresBuild: true dev: false /is-bigint@1.0.4: @@ -13249,6 +13264,7 @@ packages: /mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} + requiresBuild: true dev: false /min-indent@1.0.1: @@ -13336,6 +13352,7 @@ packages: /mkdirp-classic@0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + requiresBuild: true dev: false /mkdirp@1.0.4: @@ -13433,6 +13450,7 @@ packages: /napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + requiresBuild: true dev: false /natural-compare@1.4.0: @@ -13470,12 +13488,14 @@ packages: /node-abi@3.57.0: resolution: {integrity: sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==} engines: {node: '>=10'} + requiresBuild: true dependencies: semver: 7.6.0 dev: false /node-addon-api@6.1.0: resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} + requiresBuild: true dev: false /node-domexception@1.0.0: @@ -14450,6 +14470,7 @@ packages: resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} engines: {node: '>=10'} hasBin: true + requiresBuild: true dependencies: detect-libc: 2.0.3 expand-template: 2.0.3 @@ -14567,6 +14588,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 @@ -14624,6 +14646,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 @@ -15367,10 +15390,12 @@ packages: /simple-concat@1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + requiresBuild: true dev: false /simple-get@4.0.1: resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + requiresBuild: true dependencies: decompress-response: 6.0.0 once: 1.4.0 @@ -15394,6 +15419,7 @@ 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 @@ -15559,6 +15585,7 @@ packages: /streamx@2.16.1: resolution: {integrity: sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==} + requiresBuild: true dependencies: fast-fifo: 1.3.2 queue-tick: 1.0.1 @@ -15883,6 +15910,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 @@ -15892,6 +15920,7 @@ packages: /tar-fs@3.0.5: resolution: {integrity: sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==} + requiresBuild: true dependencies: pump: 3.0.0 tar-stream: 3.1.7 @@ -15903,6 +15932,7 @@ packages: /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 @@ -15913,6 +15943,7 @@ packages: /tar-stream@3.1.7: resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} + requiresBuild: true dependencies: b4a: 1.6.6 fast-fifo: 1.3.2 @@ -16112,6 +16143,7 @@ packages: /tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + requiresBuild: true dependencies: safe-buffer: 5.2.1 dev: false From ce985631129e49f7ea90e6ea690ef9f9cf0e6987 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Tue, 2 Apr 2024 19:52:49 +0200 Subject: [PATCH 04/16] feat: make 3rd party integration warning less scary (#10496) * feat: make 3rd party integration warning less scary * Create light-bikes-study.md * Update light-bikes-study.md --- .changeset/light-bikes-study.md | 5 +++++ packages/astro/src/cli/add/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/light-bikes-study.md diff --git a/.changeset/light-bikes-study.md b/.changeset/light-bikes-study.md new file mode 100644 index 000000000000..5d6e1c9e3c4b --- /dev/null +++ b/.changeset/light-bikes-study.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Makes the warning less scary when adding 3rd-party integrations using `astro add` diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index bc01d2f50d8d..8e2ae31c99b2 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -860,7 +860,7 @@ export async function validateIntegrations(integrations: string[]): Promise Date: Tue, 2 Apr 2024 17:53:55 +0000 Subject: [PATCH 05/16] [ci] format --- packages/astro/src/cli/add/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index 8e2ae31c99b2..d1c7eec2e9ca 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -859,9 +859,7 @@ export async function validateIntegrations(integrations: string[]): Promise Date: Wed, 3 Apr 2024 02:02:07 +0800 Subject: [PATCH 06/16] improves `client:only` error message (#10470) * improves `client:only` error message * add changeset * Fix condition for rendering component * Update rendererAliases in component.ts * Update changeset --- .changeset/calm-hotels-kiss.md | 5 ++ .../src/runtime/server/render/component.ts | 62 ++++++++++++++----- 2 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 .changeset/calm-hotels-kiss.md diff --git a/.changeset/calm-hotels-kiss.md b/.changeset/calm-hotels-kiss.md new file mode 100644 index 000000000000..4b565fd9e3ea --- /dev/null +++ b/.changeset/calm-hotels-kiss.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +improves `client:only` error message diff --git a/packages/astro/src/runtime/server/render/component.ts b/packages/astro/src/runtime/server/render/component.ts index b74fac9a64a6..70224ce9d466 100644 --- a/packages/astro/src/runtime/server/render/component.ts +++ b/packages/astro/src/runtime/server/render/component.ts @@ -32,6 +32,7 @@ import { formatList, internalSpreadAttributes, renderElement, voidElementNames } const needsHeadRenderingSymbol = Symbol.for('astro.needsHeadRendering'); const rendererAliases = new Map([['solid', 'solid-js']]); +const clientOnlyValues = new Set(['solid-js', 'react', 'preact', 'vue', 'svelte', 'lit']); function guessRenderers(componentUrl?: string): string[] { const extname = componentUrl?.split('.').pop(); @@ -80,7 +81,7 @@ async function renderFrameworkComponent( _props: Record, slots: any = {} ): Promise { - if (!Component && !_props['client:only']) { + if (!Component && "client:only" in _props === false) { throw new Error( `Unable to render ${displayName} because it is ${Component}!\nDid you forget to import the component or is it possible there is a typo?` ); @@ -164,13 +165,14 @@ async function renderFrameworkComponent( } else { // Attempt: use explicitly passed renderer name if (metadata.hydrateArgs) { - const passedName = metadata.hydrateArgs; - const rendererName = rendererAliases.has(passedName) - ? rendererAliases.get(passedName) - : passedName; - renderer = renderers.find( - ({ name }) => name === `@astrojs/${rendererName}` || name === rendererName - ); + const rendererName = rendererAliases.has(metadata.hydrateArgs) + ? rendererAliases.get(metadata.hydrateArgs) + : metadata.hydrateArgs; + if (clientOnlyValues.has(rendererName)) { + renderer = renderers.find( + ({ name }) => name === `@astrojs/${rendererName}` || name === rendererName + ); + } } // Attempt: user only has a single renderer, default to that if (!renderer && validRenderers.length === 1) { @@ -189,13 +191,34 @@ async function renderFrameworkComponent( // If no one claimed the renderer if (!renderer) { if (metadata.hydrate === 'only') { - throw new AstroError({ - ...AstroErrorData.NoClientOnlyHint, - message: AstroErrorData.NoClientOnlyHint.message(metadata.displayName), - hint: AstroErrorData.NoClientOnlyHint.hint( - probableRendererNames.map((r) => r.replace('@astrojs/', '')).join('|') - ), - }); + const rendererName = rendererAliases.has(metadata.hydrateArgs) + ? rendererAliases.get(metadata.hydrateArgs) + : metadata.hydrateArgs; + if (clientOnlyValues.has(rendererName)) { + // throw an error if provide correct client:only directive but not find the renderer + const plural = validRenderers.length > 1; + throw new AstroError({ + ...AstroErrorData.NoMatchingRenderer, + message: AstroErrorData.NoMatchingRenderer.message( + metadata.displayName, + metadata?.componentUrl?.split('.').pop(), + plural, + validRenderers.length + ), + hint: AstroErrorData.NoMatchingRenderer.hint( + formatList(probableRendererNames.map((r) => '`' + r + '`')) + ), + }); + } else { + // throw an error if an invalid hydration directive was provided + throw new AstroError({ + ...AstroErrorData.NoClientOnlyHint, + message: AstroErrorData.NoClientOnlyHint.message(metadata.displayName), + hint: AstroErrorData.NoClientOnlyHint.hint( + probableRendererNames.map((r) => r.replace('@astrojs/', '')).join('|') + ), + }); + } } else if (typeof Component !== 'string') { const matchingRenderers = validRenderers.filter((r) => probableRendererNames.includes(r.name) @@ -241,6 +264,15 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr } } else { if (metadata.hydrate === 'only') { + const rendererName = rendererAliases.has(metadata.hydrateArgs) + ? rendererAliases.get(metadata.hydrateArgs) + : metadata.hydrateArgs; + if (!clientOnlyValues.has(rendererName)) { + // warning if provide incorrect client:only directive but find the renderer by guess + console.warn( + `The client:only directive for ${metadata.displayName} is not recognized. The renderer ${renderer.name} will be used. If you intended to use a different renderer, please provide a valid client:only directive.` + ); + } html = await renderSlotToString(result, slots?.fallback); } else { const componentRenderStartTime = performance.now(); From a29b0a3d69ef46ab8eeaf2f91233c9af21a43606 Mon Sep 17 00:00:00 2001 From: liruifengv Date: Tue, 2 Apr 2024 18:05:42 +0000 Subject: [PATCH 07/16] [ci] format --- packages/astro/src/runtime/server/render/component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/runtime/server/render/component.ts b/packages/astro/src/runtime/server/render/component.ts index 70224ce9d466..cff798e9024b 100644 --- a/packages/astro/src/runtime/server/render/component.ts +++ b/packages/astro/src/runtime/server/render/component.ts @@ -81,7 +81,7 @@ async function renderFrameworkComponent( _props: Record, slots: any = {} ): Promise { - if (!Component && "client:only" in _props === false) { + if (!Component && 'client:only' in _props === false) { throw new Error( `Unable to render ${displayName} because it is ${Component}!\nDid you forget to import the component or is it possible there is a typo?` ); @@ -265,8 +265,8 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr } else { if (metadata.hydrate === 'only') { const rendererName = rendererAliases.has(metadata.hydrateArgs) - ? rendererAliases.get(metadata.hydrateArgs) - : metadata.hydrateArgs; + ? rendererAliases.get(metadata.hydrateArgs) + : metadata.hydrateArgs; if (!clientOnlyValues.has(rendererName)) { // warning if provide incorrect client:only directive but find the renderer by guess console.warn( From daef0e394a102ffdfd08d7984159a80e7bdbf015 Mon Sep 17 00:00:00 2001 From: Arsh <69170106+lilnasy@users.noreply.github.com> Date: Wed, 3 Apr 2024 00:30:36 +0530 Subject: [PATCH 08/16] chore: remove console.log from test (#10653) --- packages/integrations/vercel/test/serverless-prerender.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/integrations/vercel/test/serverless-prerender.test.js b/packages/integrations/vercel/test/serverless-prerender.test.js index c5b074f80080..537eef77cd79 100644 --- a/packages/integrations/vercel/test/serverless-prerender.test.js +++ b/packages/integrations/vercel/test/serverless-prerender.test.js @@ -23,7 +23,6 @@ describe('Serverless prerender', () => { '../.vercel/output/functions/_render.func/packages/integrations/vercel/test/fixtures/serverless-prerender/.vercel/output/_functions/chunks/pages/generic_*.mjs' ); const contents = await fixture.readFile(file); - console.log(contents); assert.ok(!contents.includes('const outDir ='), "outDir is tree-shaken if it's not imported"); }); From 195f51f82a44df32be73865949aabee0d46ffe61 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 2 Apr 2024 15:38:15 -0400 Subject: [PATCH 09/16] Mark @material-tailwind/react as noExternal (#10654) --- .changeset/tall-apples-turn.md | 5 +++++ packages/integrations/react/src/index.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/tall-apples-turn.md diff --git a/.changeset/tall-apples-turn.md b/.changeset/tall-apples-turn.md new file mode 100644 index 000000000000..46b87fb0450c --- /dev/null +++ b/.changeset/tall-apples-turn.md @@ -0,0 +1,5 @@ +--- +"@astrojs/react": patch +--- + +Mark @material-tailwind/react as noExternal diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts index d5f6965224e4..a238e9ad6c1d 100644 --- a/packages/integrations/react/src/index.ts +++ b/packages/integrations/react/src/index.ts @@ -80,6 +80,7 @@ function getViteConfiguration({ '@babel/runtime', 'redoc', 'use-immer', + '@material-tailwind/react' ], }, }; From a79e6b12fad1e43d3c06dbd86ac9b9cbf43f6f04 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 2 Apr 2024 19:39:22 +0000 Subject: [PATCH 10/16] [ci] format --- packages/integrations/react/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts index a238e9ad6c1d..30781396f9ae 100644 --- a/packages/integrations/react/src/index.ts +++ b/packages/integrations/react/src/index.ts @@ -80,7 +80,7 @@ function getViteConfiguration({ '@babel/runtime', 'redoc', 'use-immer', - '@material-tailwind/react' + '@material-tailwind/react', ], }, }; From b1eda3dc5c33c1c6d50d5ee8a2a08d34851dc253 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 2 Apr 2024 16:07:18 -0400 Subject: [PATCH 11/16] Fix building static sites with Astro DB (#10655) * Fix building static sites with Astro DB * Adding a changeset * Try a different port range --- .changeset/serious-elephants-push.md | 5 +++ .../db/src/core/cli/commands/execute/index.ts | 1 + packages/db/src/core/integration/index.ts | 2 ++ .../db/src/core/integration/vite-plugin-db.ts | 15 ++++++-- .../fixtures/static-remote/astro.config.ts | 6 ++++ .../test/fixtures/static-remote/db/config.ts | 12 +++++++ .../db/test/fixtures/static-remote/db/seed.ts | 9 +++++ .../test/fixtures/static-remote/package.json | 16 +++++++++ .../static-remote/src/pages/index.astro | 20 +++++++++++ packages/db/test/static-remote.test.js | 34 +++++++++++++++++++ packages/db/test/test-utils.js | 2 +- pnpm-lock.yaml | 9 +++++ 12 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 .changeset/serious-elephants-push.md create mode 100644 packages/db/test/fixtures/static-remote/astro.config.ts create mode 100644 packages/db/test/fixtures/static-remote/db/config.ts create mode 100644 packages/db/test/fixtures/static-remote/db/seed.ts create mode 100644 packages/db/test/fixtures/static-remote/package.json create mode 100644 packages/db/test/fixtures/static-remote/src/pages/index.astro create mode 100644 packages/db/test/static-remote.test.js diff --git a/.changeset/serious-elephants-push.md b/.changeset/serious-elephants-push.md new file mode 100644 index 000000000000..4721d89f3aed --- /dev/null +++ b/.changeset/serious-elephants-push.md @@ -0,0 +1,5 @@ +--- +"@astrojs/db": patch +--- + +Pass through appToken on static sites with Astro DB diff --git a/packages/db/src/core/cli/commands/execute/index.ts b/packages/db/src/core/cli/commands/execute/index.ts index 44a2c44fd6b7..05a04ad61e85 100644 --- a/packages/db/src/core/cli/commands/execute/index.ts +++ b/packages/db/src/core/cli/commands/execute/index.ts @@ -45,6 +45,7 @@ export async function cmd({ tables: dbConfig.tables ?? {}, appToken: appToken.token, isBuild: false, + output: 'server', }); } else { virtualModContents = getLocalVirtualModContents({ diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index 5c40c85214bf..2e3c1f2ea174 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -59,6 +59,7 @@ function astroDBIntegration(): AstroIntegration { tables, root: config.root, srcDir: config.srcDir, + output: config.output, }); } else { dbPlugin = vitePluginDb({ @@ -67,6 +68,7 @@ function astroDBIntegration(): AstroIntegration { seedFiles, root: config.root, srcDir: config.srcDir, + output: config.output, }); } diff --git a/packages/db/src/core/integration/vite-plugin-db.ts b/packages/db/src/core/integration/vite-plugin-db.ts index 769070976b98..9d9d50ca120e 100644 --- a/packages/db/src/core/integration/vite-plugin-db.ts +++ b/packages/db/src/core/integration/vite-plugin-db.ts @@ -4,6 +4,7 @@ import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js'; import { DB_PATH, RUNTIME_CONFIG_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js'; import type { DBTables } from '../types.js'; import { type VitePlugin, getDbDirectoryUrl, getRemoteDatabaseUrl } from '../utils.js'; +import type { AstroConfig } from 'astro'; const WITH_SEED_VIRTUAL_MODULE_ID = 'astro:db:seed'; @@ -26,6 +27,7 @@ type VitePluginDBParams = seedFiles: LateSeedFiles; srcDir: URL; root: URL; + output: AstroConfig['output']; } | { connectToStudio: true; @@ -33,6 +35,7 @@ type VitePluginDBParams = appToken: string; srcDir: URL; root: URL; + output: AstroConfig['output']; }; export function vitePluginDb(params: VitePluginDBParams): VitePlugin { @@ -66,6 +69,7 @@ export function vitePluginDb(params: VitePluginDBParams): VitePlugin { appToken: params.appToken, tables: params.tables.get(), isBuild: command === 'build', + output: params.output, }); } return getLocalVirtualModContents({ @@ -141,15 +145,22 @@ export function getStudioVirtualModContents({ tables, appToken, isBuild, + output, }: { tables: DBTables; appToken: string; isBuild: boolean; + output: AstroConfig['output']; }) { function appTokenArg() { if (isBuild) { - // In production build, always read the runtime environment variable. - return 'process.env.ASTRO_STUDIO_APP_TOKEN'; + if(output === 'server') { + // In production build, always read the runtime environment variable. + return 'process.env.ASTRO_STUDIO_APP_TOKEN'; + } else { + // Static mode or prerendering needs the local app token. + return `process.env.ASTRO_STUDIO_APP_TOKEN ?? ${JSON.stringify(appToken)}`; + } } else { return JSON.stringify(appToken); } diff --git a/packages/db/test/fixtures/static-remote/astro.config.ts b/packages/db/test/fixtures/static-remote/astro.config.ts new file mode 100644 index 000000000000..bd6088769ffa --- /dev/null +++ b/packages/db/test/fixtures/static-remote/astro.config.ts @@ -0,0 +1,6 @@ +import astroDb from '@astrojs/db'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + integrations: [astroDb()], +}); diff --git a/packages/db/test/fixtures/static-remote/db/config.ts b/packages/db/test/fixtures/static-remote/db/config.ts new file mode 100644 index 000000000000..8df4674d8f97 --- /dev/null +++ b/packages/db/test/fixtures/static-remote/db/config.ts @@ -0,0 +1,12 @@ +import { column, defineDb, defineTable } from 'astro:db'; + +const User = defineTable({ + columns: { + id: column.number({ primaryKey: true }), + name: column.text(), + }, +}); + +export default defineDb({ + tables: { User }, +}); diff --git a/packages/db/test/fixtures/static-remote/db/seed.ts b/packages/db/test/fixtures/static-remote/db/seed.ts new file mode 100644 index 000000000000..7d88d1ec410a --- /dev/null +++ b/packages/db/test/fixtures/static-remote/db/seed.ts @@ -0,0 +1,9 @@ +import { User, db } from 'astro:db'; + +export default async function () { + await db.insert(User).values([ + { + name: 'Houston' + } + ]); +} diff --git a/packages/db/test/fixtures/static-remote/package.json b/packages/db/test/fixtures/static-remote/package.json new file mode 100644 index 000000000000..aa2c9c23cb83 --- /dev/null +++ b/packages/db/test/fixtures/static-remote/package.json @@ -0,0 +1,16 @@ +{ + "name": "@test/db-static-remote", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@astrojs/db": "workspace:*", + "astro": "workspace:*" + } +} diff --git a/packages/db/test/fixtures/static-remote/src/pages/index.astro b/packages/db/test/fixtures/static-remote/src/pages/index.astro new file mode 100644 index 000000000000..7956b482cc6b --- /dev/null +++ b/packages/db/test/fixtures/static-remote/src/pages/index.astro @@ -0,0 +1,20 @@ +--- +import { User, db } from 'astro:db'; + +const users = await db.select().from(User); +--- + + + Testing + + +

Testing

+ +

Users

+
    + {users.map(user => ( +
  • {user.name}
  • + ))} +
+ + diff --git a/packages/db/test/static-remote.test.js b/packages/db/test/static-remote.test.js new file mode 100644 index 000000000000..7adcf6976121 --- /dev/null +++ b/packages/db/test/static-remote.test.js @@ -0,0 +1,34 @@ +import { expect } from 'chai'; +import { load as cheerioLoad } from 'cheerio'; +import { loadFixture } from '../../astro/test/test-utils.js'; +import { setupRemoteDbServer } from './test-utils.js'; + +describe('astro:db', () => { + let fixture; + before(async () => { + fixture = await loadFixture({ + root: new URL('./fixtures/static-remote/', import.meta.url), + output: 'static', + }); + }); + + describe('static build --remote', () => { + let remoteDbServer; + + before(async () => { + remoteDbServer = await setupRemoteDbServer(fixture.config); + await fixture.build(); + }); + + after(async () => { + await remoteDbServer?.stop(); + }); + + it('Can render page', async () => { + const html = await fixture.readFile('/index.html'); + const $ = cheerioLoad(html); + + expect($('li').length).to.equal(1); + }); + }); +}); diff --git a/packages/db/test/test-utils.js b/packages/db/test/test-utils.js index 860033756281..2ff59e552e44 100644 --- a/packages/db/test/test-utils.js +++ b/packages/db/test/test-utils.js @@ -12,7 +12,7 @@ const singleQuerySchema = z.object({ const querySchema = singleQuerySchema.or(z.array(singleQuerySchema)); -let portIncrementer = 8081; +let portIncrementer = 8030; /** * @param {import('astro').AstroConfig} astroConfig diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3558c882ff52..fc37e93b07cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3996,6 +3996,15 @@ importers: specifier: workspace:* version: link:../../../../astro + packages/db/test/fixtures/static-remote: + dependencies: + '@astrojs/db': + specifier: workspace:* + version: link:../../.. + astro: + specifier: workspace:* + version: link:../../../../astro + packages/db/test/fixtures/ticketing-example: dependencies: '@astrojs/check': From 5f5176b2448a42d4a3d2ab88bd2a9389c574cf0a Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Tue, 2 Apr 2024 20:08:38 +0000 Subject: [PATCH 12/16] [ci] format --- packages/db/src/core/integration/vite-plugin-db.ts | 4 ++-- packages/db/test/fixtures/static-remote/db/seed.ts | 4 ++-- .../db/test/fixtures/static-remote/src/pages/index.astro | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/db/src/core/integration/vite-plugin-db.ts b/packages/db/src/core/integration/vite-plugin-db.ts index 9d9d50ca120e..76f37473696f 100644 --- a/packages/db/src/core/integration/vite-plugin-db.ts +++ b/packages/db/src/core/integration/vite-plugin-db.ts @@ -1,10 +1,10 @@ import { fileURLToPath } from 'node:url'; +import type { AstroConfig } from 'astro'; import { normalizePath } from 'vite'; import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js'; import { DB_PATH, RUNTIME_CONFIG_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js'; import type { DBTables } from '../types.js'; import { type VitePlugin, getDbDirectoryUrl, getRemoteDatabaseUrl } from '../utils.js'; -import type { AstroConfig } from 'astro'; const WITH_SEED_VIRTUAL_MODULE_ID = 'astro:db:seed'; @@ -154,7 +154,7 @@ export function getStudioVirtualModContents({ }) { function appTokenArg() { if (isBuild) { - if(output === 'server') { + if (output === 'server') { // In production build, always read the runtime environment variable. return 'process.env.ASTRO_STUDIO_APP_TOKEN'; } else { diff --git a/packages/db/test/fixtures/static-remote/db/seed.ts b/packages/db/test/fixtures/static-remote/db/seed.ts index 7d88d1ec410a..2c86f02a1004 100644 --- a/packages/db/test/fixtures/static-remote/db/seed.ts +++ b/packages/db/test/fixtures/static-remote/db/seed.ts @@ -3,7 +3,7 @@ import { User, db } from 'astro:db'; export default async function () { await db.insert(User).values([ { - name: 'Houston' - } + name: 'Houston', + }, ]); } diff --git a/packages/db/test/fixtures/static-remote/src/pages/index.astro b/packages/db/test/fixtures/static-remote/src/pages/index.astro index 7956b482cc6b..849e65d18fd7 100644 --- a/packages/db/test/fixtures/static-remote/src/pages/index.astro +++ b/packages/db/test/fixtures/static-remote/src/pages/index.astro @@ -3,6 +3,7 @@ import { User, db } from 'astro:db'; const users = await db.select().from(User); --- + Testing @@ -12,9 +13,7 @@ const users = await db.select().from(User);

Users

    - {users.map(user => ( -
  • {user.name}
  • - ))} + {users.map((user) =>
  • {user.name}
  • )}
From c3916b5206f7e99c8be301f12881931ea4f61b01 Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:15:27 -0700 Subject: [PATCH 13/16] [ci] release (#10651) Co-authored-by: github-actions[bot] --- .changeset/calm-hotels-kiss.md | 5 -- .changeset/light-bikes-study.md | 5 -- .changeset/serious-elephants-push.md | 5 -- .changeset/tall-apples-turn.md | 5 -- examples/basics/package.json | 2 +- examples/blog/package.json | 2 +- examples/component/package.json | 2 +- examples/framework-alpine/package.json | 2 +- examples/framework-lit/package.json | 2 +- examples/framework-multiple/package.json | 4 +- examples/framework-preact/package.json | 2 +- examples/framework-react/package.json | 4 +- examples/framework-solid/package.json | 2 +- examples/framework-svelte/package.json | 2 +- 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 | 2 +- examples/starlog/package.json | 2 +- examples/view-transitions/package.json | 2 +- 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 | 2 +- examples/with-nanostores/package.json | 2 +- examples/with-tailwindcss/package.json | 2 +- examples/with-vitest/package.json | 2 +- packages/astro/CHANGELOG.md | 8 +++ packages/astro/package.json | 2 +- packages/db/CHANGELOG.md | 6 +++ packages/db/package.json | 2 +- packages/integrations/react/CHANGELOG.md | 6 +++ packages/integrations/react/package.json | 2 +- pnpm-lock.yaml | 58 ++++++++++----------- 38 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 .changeset/calm-hotels-kiss.md delete mode 100644 .changeset/light-bikes-study.md delete mode 100644 .changeset/serious-elephants-push.md delete mode 100644 .changeset/tall-apples-turn.md diff --git a/.changeset/calm-hotels-kiss.md b/.changeset/calm-hotels-kiss.md deleted file mode 100644 index 4b565fd9e3ea..000000000000 --- a/.changeset/calm-hotels-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -improves `client:only` error message diff --git a/.changeset/light-bikes-study.md b/.changeset/light-bikes-study.md deleted file mode 100644 index 5d6e1c9e3c4b..000000000000 --- a/.changeset/light-bikes-study.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -Makes the warning less scary when adding 3rd-party integrations using `astro add` diff --git a/.changeset/serious-elephants-push.md b/.changeset/serious-elephants-push.md deleted file mode 100644 index 4721d89f3aed..000000000000 --- a/.changeset/serious-elephants-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@astrojs/db": patch ---- - -Pass through appToken on static sites with Astro DB diff --git a/.changeset/tall-apples-turn.md b/.changeset/tall-apples-turn.md deleted file mode 100644 index 46b87fb0450c..000000000000 --- a/.changeset/tall-apples-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@astrojs/react": patch ---- - -Mark @material-tailwind/react as noExternal diff --git a/examples/basics/package.json b/examples/basics/package.json index 2684239ac4db..130b710310f6 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 6d81b8e2da25..91f5ead996f0 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -14,6 +14,6 @@ "@astrojs/mdx": "^2.2.3", "@astrojs/rss": "^4.0.5", "@astrojs/sitemap": "^3.1.2", - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/component/package.json b/examples/component/package.json index 112bf6131b04..2548dcedc72c 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index e4ce38067b4c..5ba809e2ad57 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.4.0", "@types/alpinejs": "^3.13.5", "alpinejs": "^3.13.3", - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index ade66c882ac1..de35ba7545bd 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^4.0.1", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^4.5.13", + "astro": "^4.5.14", "lit": "^3.1.2" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index fb31221c572d..fa9c4ca776f5 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -12,13 +12,13 @@ }, "dependencies": { "@astrojs/preact": "^3.1.2", - "@astrojs/react": "^3.1.0", + "@astrojs/react": "^3.1.1", "@astrojs/solid-js": "^4.0.1", "@astrojs/svelte": "^5.3.0", "@astrojs/vue": "^4.0.10", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^4.5.13", + "astro": "^4.5.14", "preact": "^10.19.2", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index 5db2c89558d1..851e4489ac5b 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.1.2", "@preact/signals": "^1.2.1", - "astro": "^4.5.13", + "astro": "^4.5.14", "preact": "^10.19.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 9ed179a17c2c..1f3460d64ffd 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^3.1.0", + "@astrojs/react": "^3.1.1", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^4.5.13", + "astro": "^4.5.14", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index cc1fd141440c..15797eca2e41 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^4.0.1", - "astro": "^4.5.13", + "astro": "^4.5.14", "solid-js": "^1.8.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index fbc85b989e8b..dea98b62f1b7 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^5.3.0", - "astro": "^4.5.13", + "astro": "^4.5.14", "svelte": "^4.2.5" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 9748b7936527..93dcd2f86ba9 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^4.0.10", - "astro": "^4.5.13", + "astro": "^4.5.14", "vue": "^3.3.8" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index df33b58a9d4f..67425a3c3f10 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^8.2.5", - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 27457cded2c9..eb1d4232098b 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index c56341afcb6a..1a7de9e843af 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^8.2.5", - "astro": "^4.5.13", + "astro": "^4.5.14", "html-minifier": "^4.0.0" }, "devDependencies": { diff --git a/examples/minimal/package.json b/examples/minimal/package.json index d1798a17dd86..7bd25da0d6d1 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 83d9a859745a..11392ba6c169 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 4ad564cd4556..d67c6b8aed02 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 415e3c7a3570..0d6d2339f52b 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^8.2.5", "@astrojs/svelte": "^5.3.0", - "astro": "^4.5.13", + "astro": "^4.5.14", "svelte": "^4.2.5" } } diff --git a/examples/starlog/package.json b/examples/starlog/package.json index af491f381e64..e3e9f7c5b89c 100644 --- a/examples/starlog/package.json +++ b/examples/starlog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.5.13", + "astro": "^4.5.14", "sass": "^1.69.5", "sharp": "^0.32.6" } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index 7d4ca9a5f92f..c1f8a1571906 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@astrojs/tailwind": "^5.1.0", "@astrojs/node": "^8.2.5", - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 99eebc4c6423..f0e9a36699cc 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.9.4", - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 45be29ce5cb6..b4d1e87322ae 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^5.0.0", - "astro": "^4.5.13", + "astro": "^4.5.14", "hast-util-select": "^6.0.2", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 6a3aa2f90b29..7baa2967ce8f 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.5.13" + "astro": "^4.5.14" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 7928e5e21043..ea4f8cacaa2e 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/mdx": "^2.2.3", "@astrojs/preact": "^3.1.2", - "astro": "^4.5.13", + "astro": "^4.5.14", "preact": "^10.19.2" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 25cc1d52af67..b806204deb1d 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.1.2", "@nanostores/preact": "^0.5.0", - "astro": "^4.5.13", + "astro": "^4.5.14", "nanostores": "^0.9.5", "preact": "^10.19.2" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 2cb6b36ff557..24ce25837d8b 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,7 +14,7 @@ "@astrojs/mdx": "^2.2.3", "@astrojs/tailwind": "^5.1.0", "@types/canvas-confetti": "^1.6.3", - "astro": "^4.5.13", + "astro": "^4.5.14", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.9.1", "postcss": "^8.4.28", diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index eb70738edf37..41791c20e676 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^4.5.13", + "astro": "^4.5.14", "vitest": "^1.3.1" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 8cba54eb0cbd..b7fdf6f26bb5 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,13 @@ # astro +## 4.5.14 + +### Patch Changes + +- [#10470](https://github.com/withastro/astro/pull/10470) [`320c309ca9fbe51c40e6ba846d04a0cb49aced5f`](https://github.com/withastro/astro/commit/320c309ca9fbe51c40e6ba846d04a0cb49aced5f) Thanks [@liruifengv](https://github.com/liruifengv)! - improves `client:only` error message + +- [#10496](https://github.com/withastro/astro/pull/10496) [`ce985631129e49f7ea90e6ea690ef9f9cf0e6987`](https://github.com/withastro/astro/commit/ce985631129e49f7ea90e6ea690ef9f9cf0e6987) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Makes the warning less scary when adding 3rd-party integrations using `astro add` + ## 4.5.13 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index ecfee0e70ef7..0bce5131ef8b 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "4.5.13", + "version": "4.5.14", "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/db/CHANGELOG.md b/packages/db/CHANGELOG.md index f64a6af241ba..c93755c4df8c 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/db +## 0.9.11 + +### Patch Changes + +- [#10655](https://github.com/withastro/astro/pull/10655) [`b1eda3dc5c33c1c6d50d5ee8a2a08d34851dc253`](https://github.com/withastro/astro/commit/b1eda3dc5c33c1c6d50d5ee8a2a08d34851dc253) Thanks [@matthewp](https://github.com/matthewp)! - Pass through appToken on static sites with Astro DB + ## 0.9.10 ### Patch Changes diff --git a/packages/db/package.json b/packages/db/package.json index 5ee71a3cfb63..d7d28205499c 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/db", - "version": "0.9.10", + "version": "0.9.11", "description": "", "license": "MIT", "type": "module", diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index eb1d9f7235ca..534a314b5669 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/react +## 3.1.1 + +### Patch Changes + +- [#10654](https://github.com/withastro/astro/pull/10654) [`195f51f82a44df32be73865949aabee0d46ffe61`](https://github.com/withastro/astro/commit/195f51f82a44df32be73865949aabee0d46ffe61) Thanks [@matthewp](https://github.com/matthewp)! - Mark @material-tailwind/react as noExternal + ## 3.1.0 ### Minor Changes diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 6d89ff7f5592..574740d991fe 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.1.0", + "version": "3.1.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc37e93b07cd..b0db54548a10 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,7 +134,7 @@ importers: examples/basics: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/blog: @@ -149,13 +149,13 @@ importers: specifier: ^3.1.2 version: link:../../packages/integrations/sitemap astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/framework-alpine: @@ -170,7 +170,7 @@ importers: specifier: ^3.13.3 version: 3.13.7 astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/framework-lit: @@ -182,7 +182,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro lit: specifier: ^3.1.2 @@ -194,7 +194,7 @@ importers: specifier: ^3.1.2 version: link:../../packages/integrations/preact '@astrojs/react': - specifier: ^3.1.0 + specifier: ^3.1.1 version: link:../../packages/integrations/react '@astrojs/solid-js': specifier: ^4.0.1 @@ -212,7 +212,7 @@ importers: specifier: ^18.2.15 version: 18.2.23 astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -242,7 +242,7 @@ importers: specifier: ^1.2.1 version: 1.2.1(preact@10.20.1) astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -251,7 +251,7 @@ importers: examples/framework-react: dependencies: '@astrojs/react': - specifier: ^3.1.0 + specifier: ^3.1.1 version: link:../../packages/integrations/react '@types/react': specifier: ^18.2.37 @@ -260,7 +260,7 @@ importers: specifier: ^18.2.15 version: 18.2.23 astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -275,7 +275,7 @@ importers: specifier: ^4.0.1 version: link:../../packages/integrations/solid astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro solid-js: specifier: ^1.8.5 @@ -287,7 +287,7 @@ importers: specifier: ^5.3.0 version: link:../../packages/integrations/svelte astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -299,7 +299,7 @@ importers: specifier: ^4.0.10 version: link:../../packages/integrations/vue astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro vue: specifier: ^3.3.8 @@ -311,13 +311,13 @@ importers: specifier: ^8.2.5 version: link:../../packages/integrations/node astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/middleware: @@ -326,7 +326,7 @@ importers: specifier: ^8.2.5 version: link:../../packages/integrations/node astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -339,19 +339,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/ssr: @@ -363,7 +363,7 @@ importers: specifier: ^5.3.0 version: link:../../packages/integrations/svelte astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -372,7 +372,7 @@ importers: examples/starlog: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro sass: specifier: ^1.69.5 @@ -390,7 +390,7 @@ importers: specifier: ^5.1.0 version: link:../../packages/integrations/tailwind astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/with-markdoc: @@ -399,7 +399,7 @@ importers: specifier: ^0.9.4 version: link:../../packages/integrations/markdoc astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/with-markdown-plugins: @@ -408,7 +408,7 @@ importers: specifier: ^5.0.0 version: link:../../packages/markdown/remark astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro hast-util-select: specifier: ^6.0.2 @@ -429,7 +429,7 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro examples/with-mdx: @@ -441,7 +441,7 @@ importers: specifier: ^3.1.2 version: link:../../packages/integrations/preact astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -456,7 +456,7 @@ importers: specifier: ^0.5.0 version: 0.5.1(nanostores@0.9.5)(preact@10.20.1) astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro nanostores: specifier: ^0.9.5 @@ -477,7 +477,7 @@ importers: specifier: ^1.6.3 version: 1.6.4 astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -495,7 +495,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^4.5.13 + specifier: ^4.5.14 version: link:../../packages/astro vitest: specifier: ^1.3.1 From 4f5dc14f315eba7ea6ec5cc8e5dacb0cb81288dd Mon Sep 17 00:00:00 2001 From: Oliver Speir <115520730+OliverSpeir@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:24:02 -0600 Subject: [PATCH 14/16] Move format option from LocalImageProps to ImageSharedProps (#10642) * move format to ImageSharedProps * add changeset * move quality to shared * Update lovely-trees-wait.md Co-authored-by: Florian Lefebvre --------- Co-authored-by: Florian Lefebvre --- .changeset/lovely-trees-wait.md | 5 ++++ packages/astro/src/assets/types.ts | 44 +++++++++++++++--------------- 2 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 .changeset/lovely-trees-wait.md diff --git a/.changeset/lovely-trees-wait.md b/.changeset/lovely-trees-wait.md new file mode 100644 index 000000000000..2a7511d8a066 --- /dev/null +++ b/.changeset/lovely-trees-wait.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes typing issues when using `format` and `quality` options with remote images diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 29cf1ef9ee8a..89610b05b05c 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -118,6 +118,28 @@ type ImageSharedProps = T & { * ``` */ height?: number | `${number}`; + /** + * Desired output format for the image. Defaults to `webp`. + * + * **Example**: + * ```astro + * ... + * ``` + */ + format?: ImageOutputFormat; + /** + * Desired quality for the image. Value can either be a preset such as `low` or `high`, or a numeric value from 0 to 100. + * + * The perceptual quality of the output image is service-specific. + * For instance, a certain service might decide that `high` results in a very beautiful image, but another could choose for it to be at best passable. + * + * **Example**: + * ```astro + * ... + * ... + * ``` + */ + quality?: ImageQuality; } & ( | { /** @@ -153,28 +175,6 @@ export type LocalImageProps = ImageSharedProps & { * ``` */ src: ImageMetadata | Promise<{ default: ImageMetadata }>; - /** - * Desired output format for the image. Defaults to `webp`. - * - * **Example**: - * ```astro - * ... - * ``` - */ - format?: ImageOutputFormat; - /** - * Desired quality for the image. Value can either be a preset such as `low` or `high`, or a numeric value from 0 to 100. - * - * The perceptual quality of the output image is service-specific. - * For instance, a certain service might decide that `high` results in a very beautiful image, but another could choose for it to be at best passable. - * - * **Example**: - * ```astro - * ... - * ... - * ``` - */ - quality?: ImageQuality; }; export type RemoteImageProps = From f395ebcc08279515f8d53bb82edeee288d8579db Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Tue, 2 Apr 2024 18:13:18 -0400 Subject: [PATCH 15/16] refactor: rename "config" file to "virtual" (#10638) * refactor: rename "config" file to "virtual" * chore: changeset * fix(test): config import --- .changeset/plenty-owls-wait.md | 5 +++++ packages/db/package.json | 8 ++++---- packages/db/src/core/consts.ts | 2 +- packages/db/src/core/integration/vite-plugin-db.ts | 8 ++++---- packages/db/src/runtime/{config.ts => virtual.ts} | 0 packages/db/test/unit/column-queries.test.js | 2 +- packages/db/test/unit/index-queries.test.js | 2 +- packages/db/test/unit/reference-queries.test.js | 2 +- packages/db/test/unit/reset-queries.test.js | 2 +- packages/db/tsconfig.json | 2 +- .../{tsconfig.config-types.json => tsconfig.virtual.json} | 4 ++-- packages/db/virtual.d.ts | 4 ++-- 12 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 .changeset/plenty-owls-wait.md rename packages/db/src/runtime/{config.ts => virtual.ts} (100%) rename packages/db/{tsconfig.config-types.json => tsconfig.virtual.json} (78%) diff --git a/.changeset/plenty-owls-wait.md b/.changeset/plenty-owls-wait.md new file mode 100644 index 000000000000..4a34636bd4f1 --- /dev/null +++ b/.changeset/plenty-owls-wait.md @@ -0,0 +1,5 @@ +--- +"@astrojs/db": minor +--- + +Rename internal import from `runtime/config` to `runtime/virtual` diff --git a/packages/db/package.json b/packages/db/package.json index d7d28205499c..3455a9247660 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -20,8 +20,8 @@ "types": "./dist/runtime/index.d.ts", "import": "./dist/runtime/index.js" }, - "./dist/runtime/config.js": { - "import": "./dist/runtime/config.js" + "./dist/runtime/virtual.js": { + "import": "./dist/runtime/virtual.js" }, "./types": { "types": "./dist/core/types.d.ts", @@ -55,8 +55,8 @@ "astro-integration" ], "scripts": { - "types:config": "tsc -p ./tsconfig.config-types.json", - "build": "astro-scripts build \"src/**/*.ts\" && tsc && pnpm types:config", + "types:virtual": "tsc -p ./tsconfig.virtual.json", + "build": "astro-scripts build \"src/**/*.ts\" && tsc && pnpm types:virtual", "build:ci": "astro-scripts build \"src/**/*.ts\"", "dev": "astro-scripts dev \"src/**/*.ts\"", "test": "mocha --exit --timeout 20000 \"test/*.js\" \"test/unit/**/*.js\"", diff --git a/packages/db/src/core/consts.ts b/packages/db/src/core/consts.ts index 3ba7b43d74ae..c37f1b99dc43 100644 --- a/packages/db/src/core/consts.ts +++ b/packages/db/src/core/consts.ts @@ -6,7 +6,7 @@ export const PACKAGE_NAME = JSON.parse( export const RUNTIME_IMPORT = JSON.stringify(`${PACKAGE_NAME}/runtime`); -export const RUNTIME_CONFIG_IMPORT = JSON.stringify(`${PACKAGE_NAME}/dist/runtime/config.js`); +export const RUNTIME_VIRTUAL_IMPORT = JSON.stringify(`${PACKAGE_NAME}/dist/runtime/virtual.js`); export const DB_TYPES_FILE = 'db-types.d.ts'; diff --git a/packages/db/src/core/integration/vite-plugin-db.ts b/packages/db/src/core/integration/vite-plugin-db.ts index 76f37473696f..dffe26e15936 100644 --- a/packages/db/src/core/integration/vite-plugin-db.ts +++ b/packages/db/src/core/integration/vite-plugin-db.ts @@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url'; import type { AstroConfig } from 'astro'; import { normalizePath } from 'vite'; import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js'; -import { DB_PATH, RUNTIME_CONFIG_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js'; +import { DB_PATH, RUNTIME_VIRTUAL_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js'; import type { DBTables } from '../types.js'; import { type VitePlugin, getDbDirectoryUrl, getRemoteDatabaseUrl } from '../utils.js'; @@ -83,7 +83,7 @@ export function vitePluginDb(params: VitePluginDBParams): VitePlugin { } export function getConfigVirtualModContents() { - return `export * from ${RUNTIME_CONFIG_IMPORT}`; + return `export * from ${RUNTIME_VIRTUAL_IMPORT}`; } export function getLocalVirtualModContents({ @@ -136,7 +136,7 @@ ${ : '' } -export * from ${RUNTIME_CONFIG_IMPORT}; +export * from ${RUNTIME_VIRTUAL_IMPORT}; ${getStringifiedTableExports(tables)}`; } @@ -177,7 +177,7 @@ import {asDrizzleTable, createRemoteDatabaseClient} from ${RUNTIME_IMPORT}; export const db = await createRemoteDatabaseClient(${appTokenArg()}, ${dbUrlArg()}); -export * from ${RUNTIME_CONFIG_IMPORT}; +export * from ${RUNTIME_VIRTUAL_IMPORT}; ${getStringifiedTableExports(tables)} `; diff --git a/packages/db/src/runtime/config.ts b/packages/db/src/runtime/virtual.ts similarity index 100% rename from packages/db/src/runtime/config.ts rename to packages/db/src/runtime/virtual.ts diff --git a/packages/db/test/unit/column-queries.test.js b/packages/db/test/unit/column-queries.test.js index 68b018aecc17..ef4ac9693716 100644 --- a/packages/db/test/unit/column-queries.test.js +++ b/packages/db/test/unit/column-queries.test.js @@ -6,7 +6,7 @@ import { } from '../../dist/core/cli/migration-queries.js'; import { MIGRATION_VERSION } from '../../dist/core/consts.js'; import { tableSchema } from '../../dist/core/schemas.js'; -import { NOW, column, defineTable } from '../../dist/runtime/config.js'; +import { NOW, column, defineTable } from '../../dist/runtime/virtual.js'; const TABLE_NAME = 'Users'; diff --git a/packages/db/test/unit/index-queries.test.js b/packages/db/test/unit/index-queries.test.js index 5af1b8489c8a..ce0894d27453 100644 --- a/packages/db/test/unit/index-queries.test.js +++ b/packages/db/test/unit/index-queries.test.js @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { describe, it } from 'mocha'; import { getTableChangeQueries } from '../../dist/core/cli/migration-queries.js'; import { dbConfigSchema, tableSchema } from '../../dist/core/schemas.js'; -import { column } from '../../dist/runtime/config.js'; +import { column } from '../../dist/runtime/virtual.js'; const userInitial = tableSchema.parse({ columns: { diff --git a/packages/db/test/unit/reference-queries.test.js b/packages/db/test/unit/reference-queries.test.js index 2321ef507d66..76f6341e164c 100644 --- a/packages/db/test/unit/reference-queries.test.js +++ b/packages/db/test/unit/reference-queries.test.js @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { describe, it } from 'mocha'; import { getTableChangeQueries } from '../../dist/core/cli/migration-queries.js'; import { tablesSchema } from '../../dist/core/schemas.js'; -import { column, defineTable } from '../../dist/runtime/config.js'; +import { column, defineTable } from '../../dist/runtime/virtual.js'; const BaseUser = defineTable({ columns: { diff --git a/packages/db/test/unit/reset-queries.test.js b/packages/db/test/unit/reset-queries.test.js index 4d74e01482d7..4e91d1d8d7ed 100644 --- a/packages/db/test/unit/reset-queries.test.js +++ b/packages/db/test/unit/reset-queries.test.js @@ -3,7 +3,7 @@ import { describe, it } from 'mocha'; import { getMigrationQueries } from '../../dist/core/cli/migration-queries.js'; import { MIGRATION_VERSION } from '../../dist/core/consts.js'; import { tableSchema } from '../../dist/core/schemas.js'; -import { column, defineTable } from '../../dist/runtime/config.js'; +import { column, defineTable } from '../../dist/runtime/virtual.js'; const TABLE_NAME = 'Users'; diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json index 96407d1d114a..7592ad8a1774 100644 --- a/packages/db/tsconfig.json +++ b/packages/db/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "include": ["src"], - "exclude": ["src/runtime/config.ts"], + "exclude": ["src/runtime/virtual.ts"], "compilerOptions": { "outDir": "./dist" } diff --git a/packages/db/tsconfig.config-types.json b/packages/db/tsconfig.virtual.json similarity index 78% rename from packages/db/tsconfig.config-types.json rename to packages/db/tsconfig.virtual.json index f21f8445d573..41d2aef4a11b 100644 --- a/packages/db/tsconfig.config-types.json +++ b/packages/db/tsconfig.virtual.json @@ -1,11 +1,11 @@ { // We want to avoid defineTable() and defineDb() import hints // from the runtime config export instead of astro:db. - // We exclude runtime/config from the base types, + // We exclude runtime/virtual from the base types, // and generate to a separate _internal/ directory // for our virtual module (virtual.d.ts) to reference. "extends": "../../tsconfig.base.json", - "files": ["./src/runtime/config.ts"], + "files": ["./src/runtime/virtual.ts"], "compilerOptions": { "outDir": "./dist/_internal" } diff --git a/packages/db/virtual.d.ts b/packages/db/virtual.d.ts index bea4990a0efa..efe9e8387d30 100644 --- a/packages/db/virtual.d.ts +++ b/packages/db/virtual.d.ts @@ -1,7 +1,7 @@ declare module 'astro:db' { - type RuntimeConfig = typeof import('./dist/_internal/runtime/config.js'); + type RuntimeConfig = typeof import('./dist/_internal/runtime/virtual.js'); - export const db: import('./dist/_internal/runtime/config.js').Database; + export const db: import('./dist/_internal/runtime/virtual.js').Database; export const dbUrl: string; export const sql: RuntimeConfig['sql']; From 57959e607e81ec3b13bc55db6daa253a63485a97 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Tue, 2 Apr 2024 22:14:21 +0000 Subject: [PATCH 16/16] [ci] format --- packages/db/src/core/integration/vite-plugin-db.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/db/src/core/integration/vite-plugin-db.ts b/packages/db/src/core/integration/vite-plugin-db.ts index dffe26e15936..f1dc3ea7b015 100644 --- a/packages/db/src/core/integration/vite-plugin-db.ts +++ b/packages/db/src/core/integration/vite-plugin-db.ts @@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url'; import type { AstroConfig } from 'astro'; import { normalizePath } from 'vite'; import { SEED_DEV_FILE_NAME } from '../../runtime/queries.js'; -import { DB_PATH, RUNTIME_VIRTUAL_IMPORT, RUNTIME_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js'; +import { DB_PATH, RUNTIME_IMPORT, RUNTIME_VIRTUAL_IMPORT, VIRTUAL_MODULE_ID } from '../consts.js'; import type { DBTables } from '../types.js'; import { type VitePlugin, getDbDirectoryUrl, getRemoteDatabaseUrl } from '../utils.js';