Skip to content

Commit e6df1e3

Browse files
feat: use new lib @bearstudio/astro-typed-routes
1 parent 3740578 commit e6df1e3

File tree

6 files changed

+19
-78
lines changed

6 files changed

+19
-78
lines changed

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-check
12
import { defineConfig, envField } from "astro/config";
23
import react from "@astrojs/react";
34
import tailwind from "@astrojs/tailwind";
@@ -9,6 +10,8 @@ import vercel from "@astrojs/vercel";
910
import { getSiteUrl } from "./src/lib/getSiteURL";
1011
import astrobook from "astrobook";
1112

13+
import bearstudiotypedRoutes from "@bearstudio/astro-typed-routes";
14+
1215
// https://astro.build/config
1316
export default defineConfig({
1417
site: getSiteUrl(),
@@ -60,6 +63,7 @@ export default defineConfig({
6063
css: ["./src/styles/globals.css"],
6164
title: "Components | Fork it! Community",
6265
}),
66+
bearstudiotypedRoutes(),
6367
],
6468

6569
adapter: vercel({ isr: true }),

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
"type": "module",
44
"version": "0.0.2",
55
"scripts": {
6-
"postinstall": "pnpm build:routes",
76
"dev": "astro dev",
87
"start": "astro dev",
98
"build": "astro check && astro build",
10-
"build:routes": "tsx scripts/generate-routes.ts && prettier -w ./src/routes.gen.ts",
119
"lint": "astro check",
1210
"preview": "astro preview",
1311
"astro": "astro",
@@ -24,6 +22,7 @@
2422
"@astrojs/sitemap": "3.4.2",
2523
"@astrojs/tailwind": "6.0.2",
2624
"@astrojs/vercel": "8.2.5",
25+
"@bearstudio/astro-typed-routes": "0.1.1",
2726
"@bearstudio/lunalink": "0.3.1",
2827
"@fontsource-variable/inter": "5.2.6",
2928
"@fontsource/tomorrow": "5.2.6",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generate-routes.ts

Lines changed: 0 additions & 72 deletions
This file was deleted.

src/lib/people.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export async function getPeopleFromReference(
44
people: Array<ReferenceDataEntry<"people">>,
55
) {
66
return Promise.all(
7-
await people.map(async (organizer) => await getEntry(organizer)),
7+
people.map(async (organizer) => await getEntry(organizer)),
88
);
99
}

src/routes.gen.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
// This file was automatically generated by pnpm build:routes
1+
// This file was automatically generated by @bearstudio/astro-typed-routes
22
// You should NOT make any changes in this file as it will be overwritten.
33

4-
import { assignPaths } from "@/lib/routes";
4+
import { assignPaths } from "@bearstudio/astro-typed-routes";
55

66
const ROUTES_CONFIG = {
77
"404": {},
88
about: {},
99
"code-of-conduct": {},
10-
conferences: {},
10+
conferences: {
11+
"[...page]": {},
12+
},
1113
events: {
1214
":id": {
1315
assets: {

0 commit comments

Comments
 (0)