Update to Astro v3

This commit is contained in:
Nikita Karamov 2023-09-02 22:15:57 +02:00
parent dedb96ba91
commit 2bc66c7f04
No known key found for this signature in database
GPG key ID: 41D6F71EE78E77CD
5 changed files with 700 additions and 691 deletions

View file

@ -19,10 +19,9 @@ let adapterConfig = {};
if (process.env.VERCEL) { if (process.env.VERCEL) {
console.info("Using Vercel (serverless) adapter..."); console.info("Using Vercel (serverless) adapter...");
adapterConfig = { adapterConfig = {
adapter: vercel(), adapter: vercel({
build: { functionPerRoute: true,
split: true, }),
},
}; };
} else if (process.env.CF_PAGES) { } else if (process.env.CF_PAGES) {
console.info("Using Cloudflare adapter..."); console.info("Using Cloudflare adapter...");
@ -52,8 +51,6 @@ if (process.env.VERCEL) {
export default defineConfig({ export default defineConfig({
site: "https://s2f.kytta.dev", site: "https://s2f.kytta.dev",
compressHTML: true,
output: "server", output: "server",
...adapterConfig, ...adapterConfig,

View file

@ -32,33 +32,34 @@
}, },
"browserslist": "cover 95%, last 2 versions, Firefox ESR, not dead", "browserslist": "cover 95%, last 2 versions, Firefox ESR, not dead",
"dependencies": { "dependencies": {
"@astrojs/cloudflare": "^6.8.1", "@astrojs/cloudflare": "^7.0.1",
"@astrojs/deno": "^4.3.0", "@astrojs/deno": "^5.0.0",
"@astrojs/netlify": "^2.6.0", "@astrojs/netlify": "^3.0.1",
"@astrojs/node": "^5.3.6", "@astrojs/node": "^6.0.0",
"@astrojs/vercel": "^3.8.2", "@astrojs/vercel": "^4.0.3",
"@nanostores/persistent": "^0.9.1", "@nanostores/persistent": "^0.9.1",
"astro": "^2.10.14", "astro": "^3.0.7",
"nanostores": "^0.9.3" "nanostores": "^0.9.3"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.17.11", "@astrojs/check": "^0.2.0",
"@typescript-eslint/eslint-plugin": "^6.4.1", "@types/node": "^18.17.14",
"@typescript-eslint/parser": "^6.4.1", "@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0", "eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
"eslint-plugin-astro": "^0.29.0", "eslint-plugin-astro": "^0.29.0",
"eslint-plugin-unicorn": "^48.0.1", "eslint-plugin-unicorn": "^48.0.1",
"husky": "^8.0.0", "husky": "^8.0.0",
"lint-staged": "^14.0.1", "lint-staged": "^14.0.1",
"prettier": "^3.0.2", "prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0", "prettier-plugin-astro": "^0.12.0",
"sass": "^1.66.1", "sass": "^1.66.1",
"sharp": "^0.32.5", "sharp": "^0.32.5",
"stylelint": "^15.10.3", "stylelint": "^15.10.3",
"stylelint-config-standard-scss": "^10.0.0", "stylelint-config-standard-scss": "^10.0.0",
"svgo": "^3.0.2", "svgo": "^3.0.2",
"typescript": "^5.0.2", "typescript": "^5.2.2",
"vite-plugin-lightningcss": "^0.0.5" "vite-plugin-lightningcss": "^0.0.5"
}, },
"lint-staged": { "lint-staged": {

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@
*/ */
import { getSoftwareName } from "@lib/nodeinfo"; import { getSoftwareName } from "@lib/nodeinfo";
import { ProjectPublishConfig, supportedProjects } from "@lib/project"; import { type ProjectPublishConfig, supportedProjects } from "@lib/project";
import { error, json } from "@lib/response"; import { error, json } from "@lib/response";
import type { APIRoute } from "astro"; import type { APIRoute } from "astro";
@ -16,7 +16,7 @@ export type Detection = {
project: keyof typeof supportedProjects; project: keyof typeof supportedProjects;
} & ProjectPublishConfig; } & ProjectPublishConfig;
export const get: APIRoute = async ({ params }) => { export const GET: APIRoute = async ({ params }) => {
const domain = params.domain as string; const domain = params.domain as string;
const softwareName = await getSoftwareName(domain); const softwareName = await getSoftwareName(domain);

View file

@ -10,7 +10,7 @@ import type { APIRoute } from "astro";
import { getPopularInstanceDomains } from "@lib/instance"; import { getPopularInstanceDomains } from "@lib/instance";
import { json } from "@lib/response"; import { json } from "@lib/response";
export const get: APIRoute = async () => { export const GET: APIRoute = async () => {
const popularInstanceDomains = await getPopularInstanceDomains(); const popularInstanceDomains = await getPopularInstanceDomains();
return json(popularInstanceDomains, 200, { return json(popularInstanceDomains, 200, {