Skip to content

Commit 7812e90

Browse files
nikolailehbrinkwebpro
authored andcommitted
feat(astro-db): add astro-db plugin with configuration and tests
1 parent 19067d9 commit 7812e90

File tree

15 files changed

+116
-0
lines changed

15 files changed

+116
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
4+
import db from '@astrojs/db';
5+
6+
// https://astro.build/config
7+
export default defineConfig({
8+
integrations: [db()]
9+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineDb } from 'astro:db';
2+
3+
// https://astro.build/db/config
4+
export default defineDb({
5+
tables: {}
6+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { db } from 'astro:db';
2+
3+
// https://astro.build/db/seed
4+
export default async function seed() {
5+
// TODO
6+
}

packages/knip/fixtures/plugins/astro-db/node_modules/astro/index.js

Whitespace-only changes.

packages/knip/fixtures/plugins/astro-db/node_modules/astro/package.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@plugins/astro-db",
3+
"type": "module",
4+
"scripts": {
5+
"dev": "astro dev",
6+
"build": "astro build",
7+
"preview": "astro preview",
8+
"astro": "astro"
9+
},
10+
"dependencies": {
11+
"@astrojs/db": "^0.18.2",
12+
"astro": "^5.15.3"
13+
}
14+
}
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
---
4+
5+
<html lang="en">
6+
<head>
7+
<meta charset="utf-8" />
8+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
9+
<meta name="viewport" content="width=device-width" />
10+
<meta name="generator" content={Astro.generator} />
11+
<title>Astro</title>
12+
</head>
13+
<body>
14+
<h1>Astro</h1>
15+
</body>
16+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "astro/tsconfigs/strict",
3+
"include": [".astro/types.d.ts", "**/*"],
4+
"exclude": ["dist"]
5+
}

packages/knip/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@
334334
"title": "astro plugin configuration (https://knip.dev/reference/plugins/astro)",
335335
"$ref": "#/definitions/plugin"
336336
},
337+
"astro-db": {
338+
"title": "astro-db plugin configuration (https://knip.dev/reference/plugins/astro-db)",
339+
"$ref": "#/definitions/plugin"
340+
},
337341
"ava": {
338342
"title": "ava plugin configuration (https://knip.dev/reference/plugins/ava)",
339343
"$ref": "#/definitions/plugin"

0 commit comments

Comments
 (0)