chore(deps): Upgrade packages & fix typings + formatting
This commit is contained in:
parent
00903dbf57
commit
77adc92a40
11 changed files with 5386 additions and 2898 deletions
|
@ -1,22 +1,22 @@
|
|||
module.exports = {
|
||||
extends: ["@clickbar/typescript", "plugin:astro/recommended"],
|
||||
overrides: [
|
||||
{
|
||||
"extends": ["@clickbar/typescript", "plugin:astro/recommended"],
|
||||
"overrides": [
|
||||
{
|
||||
// Define the configuration for `.astro` file.
|
||||
files: ["*.astro"],
|
||||
"files": ["*.astro"],
|
||||
// Allows Astro components to be parsed.
|
||||
parser: "astro-eslint-parser",
|
||||
"parser": "astro-eslint-parser",
|
||||
// Parse the script in `.astro` as TypeScript by adding the following configuration.
|
||||
// It's the setting you need when using TypeScript.
|
||||
parserOptions: {
|
||||
parser: "@typescript-eslint/parser",
|
||||
extraFileExtensions: [".astro"],
|
||||
"parserOptions": {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extraFileExtensions": [".astro"]
|
||||
},
|
||||
rules: {
|
||||
"rules": {
|
||||
// override/add rules settings here, such as:
|
||||
// Does not work well with typescript
|
||||
"no-undef": "off",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
"no-undef": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
module.exports = {
|
||||
plugins: [require.resolve("prettier-plugin-astro")],
|
||||
overrides: [
|
||||
{
|
||||
files: "*.astro",
|
||||
options: {
|
||||
parser: "astro",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
28
package.json
28
package.json
|
@ -15,19 +15,19 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^1.0.0",
|
||||
"@astrojs/rss": "^3.0.0",
|
||||
"@astrojs/sitemap": "^3.0.0",
|
||||
"@astrojs/tailwind": "^5.0.0",
|
||||
"@clickbar/eslint-config-typescript": "^9.0.0",
|
||||
"@fontsource/fira-code": "^5.0.8",
|
||||
"@fontsource/inter": "^5.0.8",
|
||||
"@tailwindcss/typography": "^0.5.9",
|
||||
"astro": "^3.0.7",
|
||||
"eslint": "^8.48.0",
|
||||
"eslint-plugin-astro": "^0.29.0",
|
||||
"prettier-plugin-astro": "^0.12.0",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"typescript": "^5.2.2"
|
||||
"@astrojs/mdx": "^2.1.1",
|
||||
"@astrojs/rss": "^4.0.5",
|
||||
"@astrojs/sitemap": "^3.1.0",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@clickbar/eslint-config-typescript": "^10.0.0",
|
||||
"@fontsource/fira-code": "^5.0.16",
|
||||
"@fontsource/inter": "^5.0.16",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"astro": "^4.4.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-plugin-astro": "^0.31.4",
|
||||
"prettier-plugin-astro": "^0.13.0",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
|
|
8086
pnpm-lock.yaml
generated
8086
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
10
src/env.d.ts
vendored
10
src/env.d.ts
vendored
|
@ -1 +1,11 @@
|
|||
/// <reference types="astro/client" />
|
||||
|
||||
import "astro/astro-jsx";
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
type Element = HTMLElement;
|
||||
// type Element = astroHTML.JSX.Element // We want to use this, but it is defined as any.
|
||||
type IntrinsicElements = astroHTML.JSX.IntrinsicElements;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ const { pageTitle, description } = Astro.props
|
|||
<html lang="en">
|
||||
<head>
|
||||
<BaseHead
|
||||
title={((pageTitle && pageTitle + ' - ') || '') + SITE_TITLE}
|
||||
description={(description && description) || SITE_DESCRIPTION}
|
||||
title={((pageTitle && pageTitle + ' - ') ?? '') + SITE_TITLE}
|
||||
description={(description && description) ?? SITE_DESCRIPTION}
|
||||
/>
|
||||
</head>
|
||||
<body
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
---
|
||||
import Base from '../layouts/Base.astro'
|
||||
|
||||
const rawPosts = await Astro.glob('./posts/**/*.{md,mdx}')
|
||||
interface Frontmatter {
|
||||
title: string
|
||||
description?: string
|
||||
pubDate: string
|
||||
draft?: boolean
|
||||
}
|
||||
|
||||
const rawPosts = await Astro.glob<Frontmatter>('./posts/**/*.md')
|
||||
const posts = rawPosts
|
||||
.filter((post) => !post.frontmatter.draft)
|
||||
.sort(
|
||||
|
|
|
@ -2,12 +2,17 @@ import rss, { pagesGlobToRssItems } from "@astrojs/rss";
|
|||
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../config";
|
||||
|
||||
export async function GET() {
|
||||
import type { RSSFeedItem } from "@astrojs/rss";
|
||||
import type { APIContext } from "astro";
|
||||
|
||||
export async function GET(context: APIContext) {
|
||||
return rss({
|
||||
title: SITE_TITLE,
|
||||
description: SITE_DESCRIPTION,
|
||||
site: import.meta.env.SITE,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-argument
|
||||
items: await pagesGlobToRssItems(import.meta.glob("./posts/**/*.{md,mdx}")),
|
||||
site: context.site ?? "",
|
||||
|
||||
items: (await pagesGlobToRssItems(
|
||||
import.meta.glob("./posts/**/*.md"),
|
||||
)) as RSSFeedItem[],
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const defaultTheme = require("tailwindcss/defaultTheme");
|
||||
import typographyPlugin from "@tailwindcss/typography";
|
||||
import defaultTheme from "tailwindcss/defaultTheme";
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
export default {
|
||||
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
|
||||
theme: {
|
||||
extend: {
|
||||
|
@ -12,5 +12,5 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
},
|
||||
plugins: [require("@tailwindcss/typography")],
|
||||
plugins: [typographyPlugin],
|
||||
};
|
|
@ -7,5 +7,6 @@
|
|||
"@components/*": ["src/components/*"],
|
||||
"@images/*": ["src/images/*"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*", "astro.config.js", "tailwind.config.js"]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue