Skip to content

Commit

Permalink
Merge pull request #58 from Jak2k/statuses
Browse files Browse the repository at this point in the history
Add Statuses
  • Loading branch information
Jak2k authored Mar 23, 2024
2 parents 41a359c + 9eb3c0d commit 8369886
Show file tree
Hide file tree
Showing 11 changed files with 2,861 additions and 1,988 deletions.
8 changes: 5 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
import { defineConfig } from "astro/config";
import UnoCSS from "unocss/astro";
import sitemap from "astro-sitemap";
import vercel from "@astrojs/vercel/static";
import vercel from "@astrojs/vercel/serverless";
import vue from "@astrojs/vue";

import mdx from "@astrojs/mdx";
import icon from "astro-icon";
import db from "@astrojs/db";

// https://astro.build/config
export default defineConfig({
integrations: [UnoCSS({
injectReset: true // or a path to the reset file
}), sitemap(), vue(), mdx()],
}), sitemap(), vue(), mdx(), db(), icon()],
server: {
port: 3000
},
output: "hybrid",
site: "https://jak2k.schwanenberg.name",
adapter: vercel()
});
24 changes: 24 additions & 0 deletions db/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineDb, defineTable, column } from 'astro:db';

const Status = defineTable({
columns: {
id: column.number({ primaryKey: true }),
text: column.text(),
timestamp: column.date(),
replyTo: column.text(),
likeOf: column.text(),
repostOf: column.text(),
},
indexes: {
column: {
on: 'id',
unique: true,
}
}
})

export default defineDb({
tables: {
Status,
},
})
10 changes: 10 additions & 0 deletions db/seed.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { db, Status } from 'astro:db';

export default async function () {
// await db.insert(Status).values([
// { id: 1, text: 'Hello, world!', timestamp: new Date(), likeOf: '', repostOf: '', replyTo: '' },
// { id: 2, text: 'This is a reply', timestamp: new Date(), likeOf: '', repostOf: '', replyTo: 'https://example.com' },
// { id: 3, text: 'This is a repost', timestamp: new Date(), likeOf: '', repostOf: 'https://example.com', replyTo: '' },
// { id: 4, text: 'This is a like', timestamp: new Date(), likeOf: 'https://example.com', repostOf: '', replyTo: '' },
// ])
}
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^1.1.3",
"@astrojs/rss": "^3.0.0",
"@astrojs/vercel": "^5.1.0",
"@astrojs/vue": "^3.0.2",
"astro": "^3.4.0",
"astro-seo": "^0.8.0",
"@astrojs/db": "^0.8.5",
"@astrojs/mdx": "^2.2.0",
"@astrojs/rss": "^4.0.5",
"@astrojs/vercel": "^7.3.6",
"@astrojs/vue": "^4.0.9",
"astro": "^4.5.4",
"astro-seo": "^0.8.3",
"astro-sitemap": "^1.0.0",
"vue": "^3.3.7"
"vue": "^3.4.21"
},
"devDependencies": {
"@unocss/reset": "^0.57.1",
"astro-icon": "^0.8.1",
"unocss": "^0.57.1"
"@iconify-json/mdi": "^1.1.64",
"@unocss/reset": "^0.58.6",
"astro-icon": "^1.1.0",
"unocss": "^0.58.6"
}
}
Loading

0 comments on commit 8369886

Please sign in to comment.