mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
This reverts commit 76c21b19d2
.
This commit is contained in:
parent
76c21b19d2
commit
b6ccaa6dc7
42 changed files with 161 additions and 151 deletions
16
.changeset/bright-students-worry.md
Normal file
16
.changeset/bright-students-worry.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
"@astrojs/db": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Changes the seed file format to require exporting a default function instead of running seed code at the top level.
|
||||||
|
|
||||||
|
To migrate a seed file, wrap your existing code in a default function export:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
// db/seed.ts
|
||||||
|
import { db, Table } from 'astro:db';
|
||||||
|
|
||||||
|
+ export default async function() {
|
||||||
|
await db.insert(Table).values({ foo: 'bar' });
|
||||||
|
+ }
|
||||||
|
```
|
5
.changeset/chilly-cherries-appear.md
Normal file
5
.changeset/chilly-cherries-appear.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@astrojs/db": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix runtime export error when building with the node adapter
|
5
.changeset/empty-bees-help.md
Normal file
5
.changeset/empty-bees-help.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"create-astro": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes an issue where TypeScript and `@astrojs/check` versions would occassionally print as `undefined`.
|
5
.changeset/fluffy-bobcats-arrive.md
Normal file
5
.changeset/fluffy-bobcats-arrive.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@astrojs/db": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Rename `experimentalVersion` to `version`
|
5
.changeset/healthy-taxis-applaud.md
Normal file
5
.changeset/healthy-taxis-applaud.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@astrojs/db": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Introduce `astro build --remote` to build with a remote database connection. Running `astro build` plain will use a local database file, and `--remote` will authenticate with a studio app token.
|
58
.changeset/purple-poets-sin.md
Normal file
58
.changeset/purple-poets-sin.md
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
---
|
||||||
|
"@astrojs/db": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Adds support for integrations providing `astro:db` configuration and seed files, using the new `astro:db:setup` hook.
|
||||||
|
|
||||||
|
To get TypeScript support for the `astro:db:setup` hook, wrap your integration object in the `defineDbIntegration()` utility:
|
||||||
|
|
||||||
|
```js
|
||||||
|
import { defineDbIntegration } from '@astrojs/db/utils';
|
||||||
|
|
||||||
|
export default function MyDbIntegration() {
|
||||||
|
return defineDbIntegration({
|
||||||
|
name: 'my-astro-db-powered-integration',
|
||||||
|
hooks: {
|
||||||
|
'astro:db:setup': ({ extendDb }) => {
|
||||||
|
extendDb({
|
||||||
|
configEntrypoint: '@astronaut/my-package/config',
|
||||||
|
seedEntrypoint: '@astronaut/my-package/seed',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the `extendDb` method to register additional `astro:db` config and seed files.
|
||||||
|
|
||||||
|
Integration config and seed files follow the same format as their user-defined equivalents. However, often while working on integrations, you may not be able to benefit from Astro’s generated table types exported from `astro:db`. For full type safety and autocompletion support, use the `asDrizzleTable()` utility to wrap your table definitions in the seed file.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// config.ts
|
||||||
|
import { defineTable, column } from 'astro:db';
|
||||||
|
|
||||||
|
export const Pets = defineTable({
|
||||||
|
columns: {
|
||||||
|
name: column.text(),
|
||||||
|
age: column.number(),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
```js
|
||||||
|
// seed.ts
|
||||||
|
import { asDrizzleTable } from '@astrojs/db/utils';
|
||||||
|
import { db } from 'astro:db';
|
||||||
|
import { Pets } from './config';
|
||||||
|
|
||||||
|
export default async function() {
|
||||||
|
// Convert the Pets table into a format ready for querying.
|
||||||
|
const typeSafePets = asDrizzleTable('Pets', Pets);
|
||||||
|
|
||||||
|
await db.insert(typeSafePets).values([
|
||||||
|
{ name: 'Palomita', age: 7 },
|
||||||
|
{ name: 'Pan', age: 3.5 },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
```
|
5
.changeset/thick-geckos-design.md
Normal file
5
.changeset/thick-geckos-design.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"astro": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes an issue where elements slotted within interactive framework components disappeared after hydration.
|
5
.changeset/weak-weeks-pump.md
Normal file
5
.changeset/weak-weeks-pump.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@astrojs/db": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add support for batch queries with `db.batch()`. This includes an internal bump to Drizzle v0.29.
|
|
@ -11,6 +11,6 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,6 @@
|
||||||
"@astrojs/mdx": "^2.1.1",
|
"@astrojs/mdx": "^2.1.1",
|
||||||
"@astrojs/rss": "^4.0.5",
|
"@astrojs/rss": "^4.0.5",
|
||||||
"@astrojs/sitemap": "^3.1.1",
|
"@astrojs/sitemap": "^3.1.1",
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
],
|
],
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"astro": "^4.0.0"
|
"astro": "^4.0.0"
|
||||||
|
|
|
@ -14,6 +14,6 @@
|
||||||
"@astrojs/alpinejs": "^0.4.0",
|
"@astrojs/alpinejs": "^0.4.0",
|
||||||
"@types/alpinejs": "^3.13.5",
|
"@types/alpinejs": "^3.13.5",
|
||||||
"alpinejs": "^3.13.3",
|
"alpinejs": "^3.13.3",
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/lit": "^4.0.1",
|
"@astrojs/lit": "^4.0.1",
|
||||||
"@webcomponents/template-shadowroot": "^0.2.1",
|
"@webcomponents/template-shadowroot": "^0.2.1",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"lit": "^3.1.2"
|
"lit": "^3.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"@astrojs/solid-js": "^4.0.1",
|
"@astrojs/solid-js": "^4.0.1",
|
||||||
"@astrojs/svelte": "^5.2.0",
|
"@astrojs/svelte": "^5.2.0",
|
||||||
"@astrojs/vue": "^4.0.8",
|
"@astrojs/vue": "^4.0.8",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"preact": "^10.19.2",
|
"preact": "^10.19.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/preact": "^3.1.1",
|
"@astrojs/preact": "^3.1.1",
|
||||||
"@preact/signals": "^1.2.1",
|
"@preact/signals": "^1.2.1",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"preact": "^10.19.2"
|
"preact": "^10.19.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"@astrojs/react": "^3.0.10",
|
"@astrojs/react": "^3.0.10",
|
||||||
"@types/react": "^18.2.37",
|
"@types/react": "^18.2.37",
|
||||||
"@types/react-dom": "^18.2.15",
|
"@types/react-dom": "^18.2.15",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/solid-js": "^4.0.1",
|
"@astrojs/solid-js": "^4.0.1",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"solid-js": "^1.8.5"
|
"solid-js": "^1.8.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/svelte": "^5.2.0",
|
"@astrojs/svelte": "^5.2.0",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"svelte": "^4.2.5"
|
"svelte": "^4.2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/vue": "^4.0.8",
|
"@astrojs/vue": "^4.0.8",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"vue": "^3.3.8"
|
"vue": "^3.3.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/node": "^8.2.3",
|
"@astrojs/node": "^8.2.3",
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
],
|
],
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"astro": "^4.0.0"
|
"astro": "^4.0.0"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/node": "^8.2.3",
|
"@astrojs/node": "^8.2.3",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"html-minifier": "^4.0.0"
|
"html-minifier": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/node": "^8.2.3",
|
"@astrojs/node": "^8.2.3",
|
||||||
"@astrojs/svelte": "^5.2.0",
|
"@astrojs/svelte": "^5.2.0",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"svelte": "^4.2.5"
|
"svelte": "^4.2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.69.5",
|
||||||
"sharp": "^0.32.6"
|
"sharp": "^0.32.6"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/tailwind": "^5.1.0",
|
"@astrojs/tailwind": "^5.1.0",
|
||||||
"@astrojs/node": "^8.2.3",
|
"@astrojs/node": "^8.2.3",
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/markdoc": "^0.9.1",
|
"@astrojs/markdoc": "^0.9.1",
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/markdown-remark": "^4.2.1",
|
"@astrojs/markdown-remark": "^4.2.1",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"hast-util-select": "^6.0.2",
|
"hast-util-select": "^6.0.2",
|
||||||
"rehype-autolink-headings": "^7.1.0",
|
"rehype-autolink-headings": "^7.1.0",
|
||||||
"rehype-slug": "^6.0.0",
|
"rehype-slug": "^6.0.0",
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15"
|
"astro": "^4.4.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^2.1.1",
|
"@astrojs/mdx": "^2.1.1",
|
||||||
"@astrojs/preact": "^3.1.1",
|
"@astrojs/preact": "^3.1.1",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"preact": "^10.19.2"
|
"preact": "^10.19.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/preact": "^3.1.1",
|
"@astrojs/preact": "^3.1.1",
|
||||||
"@nanostores/preact": "^0.5.0",
|
"@nanostores/preact": "^0.5.0",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"nanostores": "^0.9.5",
|
"nanostores": "^0.9.5",
|
||||||
"preact": "^10.19.2"
|
"preact": "^10.19.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"@astrojs/mdx": "^2.1.1",
|
"@astrojs/mdx": "^2.1.1",
|
||||||
"@astrojs/tailwind": "^5.1.0",
|
"@astrojs/tailwind": "^5.1.0",
|
||||||
"@types/canvas-confetti": "^1.6.3",
|
"@types/canvas-confetti": "^1.6.3",
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.15",
|
||||||
"canvas-confetti": "^1.9.1",
|
"canvas-confetti": "^1.9.1",
|
||||||
"postcss": "^8.4.28",
|
"postcss": "^8.4.28",
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"test": "vitest"
|
"test": "vitest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"astro": "^4.4.15",
|
"astro": "^4.4.14",
|
||||||
"vitest": "^1.3.1"
|
"vitest": "^1.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
# astro
|
# astro
|
||||||
|
|
||||||
## 4.4.15
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- [#10317](https://github.com/withastro/astro/pull/10317) [`33583e8b31ee8a33e26cf57f30bb422921f4745d`](https://github.com/withastro/astro/commit/33583e8b31ee8a33e26cf57f30bb422921f4745d) Thanks [@lilnasy](https://github.com/lilnasy)! - Fixes an issue where elements slotted within interactive framework components disappeared after hydration.
|
|
||||||
|
|
||||||
## 4.4.14
|
## 4.4.14
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "astro",
|
"name": "astro",
|
||||||
"version": "4.4.15",
|
"version": "4.4.14",
|
||||||
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "withastro",
|
"author": "withastro",
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
# create-astro
|
# create-astro
|
||||||
|
|
||||||
## 4.7.4
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- [#10255](https://github.com/withastro/astro/pull/10255) [`2aec2cdc21f48f9b4f1dd82e2fd16fa3d653ccc5`](https://github.com/withastro/astro/commit/2aec2cdc21f48f9b4f1dd82e2fd16fa3d653ccc5) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Fixes an issue where TypeScript and `@astrojs/check` versions would occassionally print as `undefined`.
|
|
||||||
|
|
||||||
## 4.7.3
|
## 4.7.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "create-astro",
|
"name": "create-astro",
|
||||||
"version": "4.7.4",
|
"version": "4.7.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "withastro",
|
"author": "withastro",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -1,87 +1,5 @@
|
||||||
# @astrojs/db
|
# @astrojs/db
|
||||||
|
|
||||||
## 0.7.0
|
|
||||||
|
|
||||||
### Minor Changes
|
|
||||||
|
|
||||||
- [#10334](https://github.com/withastro/astro/pull/10334) [`bad9b583a267e239ba52237d45a89063ea277200`](https://github.com/withastro/astro/commit/bad9b583a267e239ba52237d45a89063ea277200) Thanks [@delucis](https://github.com/delucis)! - Changes the seed file format to require exporting a default function instead of running seed code at the top level.
|
|
||||||
|
|
||||||
To migrate a seed file, wrap your existing code in a default function export:
|
|
||||||
|
|
||||||
```diff
|
|
||||||
// db/seed.ts
|
|
||||||
import { db, Table } from 'astro:db';
|
|
||||||
|
|
||||||
+ export default async function() {
|
|
||||||
await db.insert(Table).values({ foo: 'bar' });
|
|
||||||
+ }
|
|
||||||
```
|
|
||||||
|
|
||||||
- [#10352](https://github.com/withastro/astro/pull/10352) [`06fe94e29de97290cb41c4f862ab88f48cda3d4a`](https://github.com/withastro/astro/commit/06fe94e29de97290cb41c4f862ab88f48cda3d4a) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Introduce `astro build --remote` to build with a remote database connection. Running `astro build` plain will use a local database file, and `--remote` will authenticate with a studio app token.
|
|
||||||
|
|
||||||
- [#10321](https://github.com/withastro/astro/pull/10321) [`2e4958c8a75dc9836efcc7dd272fb8ed4187c000`](https://github.com/withastro/astro/commit/2e4958c8a75dc9836efcc7dd272fb8ed4187c000) Thanks [@delucis](https://github.com/delucis)! - Adds support for integrations providing `astro:db` configuration and seed files, using the new `astro:db:setup` hook.
|
|
||||||
|
|
||||||
To get TypeScript support for the `astro:db:setup` hook, wrap your integration object in the `defineDbIntegration()` utility:
|
|
||||||
|
|
||||||
```js
|
|
||||||
import { defineDbIntegration } from '@astrojs/db/utils';
|
|
||||||
|
|
||||||
export default function MyDbIntegration() {
|
|
||||||
return defineDbIntegration({
|
|
||||||
name: 'my-astro-db-powered-integration',
|
|
||||||
hooks: {
|
|
||||||
'astro:db:setup': ({ extendDb }) => {
|
|
||||||
extendDb({
|
|
||||||
configEntrypoint: '@astronaut/my-package/config',
|
|
||||||
seedEntrypoint: '@astronaut/my-package/seed',
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the `extendDb` method to register additional `astro:db` config and seed files.
|
|
||||||
|
|
||||||
Integration config and seed files follow the same format as their user-defined equivalents. However, often while working on integrations, you may not be able to benefit from Astro’s generated table types exported from `astro:db`. For full type safety and autocompletion support, use the `asDrizzleTable()` utility to wrap your table definitions in the seed file.
|
|
||||||
|
|
||||||
```js
|
|
||||||
// config.ts
|
|
||||||
import { defineTable, column } from 'astro:db';
|
|
||||||
|
|
||||||
export const Pets = defineTable({
|
|
||||||
columns: {
|
|
||||||
name: column.text(),
|
|
||||||
age: column.number(),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
// seed.ts
|
|
||||||
import { asDrizzleTable } from '@astrojs/db/utils';
|
|
||||||
import { db } from 'astro:db';
|
|
||||||
import { Pets } from './config';
|
|
||||||
|
|
||||||
export default async function () {
|
|
||||||
// Convert the Pets table into a format ready for querying.
|
|
||||||
const typeSafePets = asDrizzleTable('Pets', Pets);
|
|
||||||
|
|
||||||
await db.insert(typeSafePets).values([
|
|
||||||
{ name: 'Palomita', age: 7 },
|
|
||||||
{ name: 'Pan', age: 3.5 },
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- [#10361](https://github.com/withastro/astro/pull/10361) [`988aad6705e5ee129cf3a28da80aca4229052bb3`](https://github.com/withastro/astro/commit/988aad6705e5ee129cf3a28da80aca4229052bb3) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Add support for batch queries with `db.batch()`. This includes an internal bump to Drizzle v0.29.
|
|
||||||
|
|
||||||
### Patch Changes
|
|
||||||
|
|
||||||
- [#10357](https://github.com/withastro/astro/pull/10357) [`5a9dab286f3f436f3dce18f3b13a2cd9b774a8ef`](https://github.com/withastro/astro/commit/5a9dab286f3f436f3dce18f3b13a2cd9b774a8ef) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Fix runtime export error when building with the node adapter
|
|
||||||
|
|
||||||
- [#10348](https://github.com/withastro/astro/pull/10348) [`9f422e9bd338c1f6deee8f727143bf801a6b1651`](https://github.com/withastro/astro/commit/9f422e9bd338c1f6deee8f727143bf801a6b1651) Thanks [@matthewp](https://github.com/matthewp)! - Rename `experimentalVersion` to `version`
|
|
||||||
|
|
||||||
## 0.6.5
|
## 0.6.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@astrojs/db",
|
"name": "@astrojs/db",
|
||||||
"version": "0.7.0",
|
"version": "0.6.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -134,7 +134,7 @@ importers:
|
||||||
examples/basics:
|
examples/basics:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/blog:
|
examples/blog:
|
||||||
|
@ -149,13 +149,13 @@ importers:
|
||||||
specifier: ^3.1.1
|
specifier: ^3.1.1
|
||||||
version: link:../../packages/integrations/sitemap
|
version: link:../../packages/integrations/sitemap
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/component:
|
examples/component:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/framework-alpine:
|
examples/framework-alpine:
|
||||||
|
@ -170,7 +170,7 @@ importers:
|
||||||
specifier: ^3.13.3
|
specifier: ^3.13.3
|
||||||
version: 3.13.3
|
version: 3.13.3
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/framework-lit:
|
examples/framework-lit:
|
||||||
|
@ -182,7 +182,7 @@ importers:
|
||||||
specifier: ^0.2.1
|
specifier: ^0.2.1
|
||||||
version: 0.2.1
|
version: 0.2.1
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
lit:
|
lit:
|
||||||
specifier: ^3.1.2
|
specifier: ^3.1.2
|
||||||
|
@ -206,7 +206,7 @@ importers:
|
||||||
specifier: ^4.0.8
|
specifier: ^4.0.8
|
||||||
version: link:../../packages/integrations/vue
|
version: link:../../packages/integrations/vue
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
preact:
|
preact:
|
||||||
specifier: ^10.19.2
|
specifier: ^10.19.2
|
||||||
|
@ -236,7 +236,7 @@ importers:
|
||||||
specifier: ^1.2.1
|
specifier: ^1.2.1
|
||||||
version: 1.2.1(preact@10.19.3)
|
version: 1.2.1(preact@10.19.3)
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
preact:
|
preact:
|
||||||
specifier: ^10.19.2
|
specifier: ^10.19.2
|
||||||
|
@ -254,7 +254,7 @@ importers:
|
||||||
specifier: ^18.2.15
|
specifier: ^18.2.15
|
||||||
version: 18.2.18
|
version: 18.2.18
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
react:
|
react:
|
||||||
specifier: ^18.2.0
|
specifier: ^18.2.0
|
||||||
|
@ -269,7 +269,7 @@ importers:
|
||||||
specifier: ^4.0.1
|
specifier: ^4.0.1
|
||||||
version: link:../../packages/integrations/solid
|
version: link:../../packages/integrations/solid
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
solid-js:
|
solid-js:
|
||||||
specifier: ^1.8.5
|
specifier: ^1.8.5
|
||||||
|
@ -281,7 +281,7 @@ importers:
|
||||||
specifier: ^5.2.0
|
specifier: ^5.2.0
|
||||||
version: link:../../packages/integrations/svelte
|
version: link:../../packages/integrations/svelte
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
svelte:
|
svelte:
|
||||||
specifier: ^4.2.5
|
specifier: ^4.2.5
|
||||||
|
@ -293,7 +293,7 @@ importers:
|
||||||
specifier: ^4.0.8
|
specifier: ^4.0.8
|
||||||
version: link:../../packages/integrations/vue
|
version: link:../../packages/integrations/vue
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
vue:
|
vue:
|
||||||
specifier: ^3.3.8
|
specifier: ^3.3.8
|
||||||
|
@ -305,13 +305,13 @@ importers:
|
||||||
specifier: ^8.2.3
|
specifier: ^8.2.3
|
||||||
version: link:../../packages/integrations/node
|
version: link:../../packages/integrations/node
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/integration:
|
examples/integration:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/middleware:
|
examples/middleware:
|
||||||
|
@ -320,7 +320,7 @@ importers:
|
||||||
specifier: ^8.2.3
|
specifier: ^8.2.3
|
||||||
version: link:../../packages/integrations/node
|
version: link:../../packages/integrations/node
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
html-minifier:
|
html-minifier:
|
||||||
specifier: ^4.0.0
|
specifier: ^4.0.0
|
||||||
|
@ -333,19 +333,19 @@ importers:
|
||||||
examples/minimal:
|
examples/minimal:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/non-html-pages:
|
examples/non-html-pages:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/portfolio:
|
examples/portfolio:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/ssr:
|
examples/ssr:
|
||||||
|
@ -357,7 +357,7 @@ importers:
|
||||||
specifier: ^5.2.0
|
specifier: ^5.2.0
|
||||||
version: link:../../packages/integrations/svelte
|
version: link:../../packages/integrations/svelte
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
svelte:
|
svelte:
|
||||||
specifier: ^4.2.5
|
specifier: ^4.2.5
|
||||||
|
@ -366,7 +366,7 @@ importers:
|
||||||
examples/starlog:
|
examples/starlog:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
sass:
|
sass:
|
||||||
specifier: ^1.69.5
|
specifier: ^1.69.5
|
||||||
|
@ -384,7 +384,7 @@ importers:
|
||||||
specifier: ^5.1.0
|
specifier: ^5.1.0
|
||||||
version: link:../../packages/integrations/tailwind
|
version: link:../../packages/integrations/tailwind
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/with-markdoc:
|
examples/with-markdoc:
|
||||||
|
@ -393,7 +393,7 @@ importers:
|
||||||
specifier: ^0.9.1
|
specifier: ^0.9.1
|
||||||
version: link:../../packages/integrations/markdoc
|
version: link:../../packages/integrations/markdoc
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/with-markdown-plugins:
|
examples/with-markdown-plugins:
|
||||||
|
@ -402,7 +402,7 @@ importers:
|
||||||
specifier: ^4.2.1
|
specifier: ^4.2.1
|
||||||
version: link:../../packages/markdown/remark
|
version: link:../../packages/markdown/remark
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
hast-util-select:
|
hast-util-select:
|
||||||
specifier: ^6.0.2
|
specifier: ^6.0.2
|
||||||
|
@ -423,7 +423,7 @@ importers:
|
||||||
examples/with-markdown-shiki:
|
examples/with-markdown-shiki:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
|
|
||||||
examples/with-mdx:
|
examples/with-mdx:
|
||||||
|
@ -435,7 +435,7 @@ importers:
|
||||||
specifier: ^3.1.1
|
specifier: ^3.1.1
|
||||||
version: link:../../packages/integrations/preact
|
version: link:../../packages/integrations/preact
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
preact:
|
preact:
|
||||||
specifier: ^10.19.2
|
specifier: ^10.19.2
|
||||||
|
@ -450,7 +450,7 @@ importers:
|
||||||
specifier: ^0.5.0
|
specifier: ^0.5.0
|
||||||
version: 0.5.0(nanostores@0.9.5)(preact@10.19.3)
|
version: 0.5.0(nanostores@0.9.5)(preact@10.19.3)
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
nanostores:
|
nanostores:
|
||||||
specifier: ^0.9.5
|
specifier: ^0.9.5
|
||||||
|
@ -471,7 +471,7 @@ importers:
|
||||||
specifier: ^1.6.3
|
specifier: ^1.6.3
|
||||||
version: 1.6.4
|
version: 1.6.4
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
autoprefixer:
|
autoprefixer:
|
||||||
specifier: ^10.4.15
|
specifier: ^10.4.15
|
||||||
|
@ -489,7 +489,7 @@ importers:
|
||||||
examples/with-vitest:
|
examples/with-vitest:
|
||||||
dependencies:
|
dependencies:
|
||||||
astro:
|
astro:
|
||||||
specifier: ^4.4.15
|
specifier: ^4.4.14
|
||||||
version: link:../../packages/astro
|
version: link:../../packages/astro
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^1.3.1
|
specifier: ^1.3.1
|
||||||
|
|
Loading…
Reference in a new issue