mirror of
https://github.com/prdlk/prdlk.git
synced 2026-11-02 13:12:49 +00:00
feat(config): add initial project configuration files
This commit is contained in:
1 parent
a0e21c1b78
commit
de2b371f3a
15 files changed
+9332
No files matched your search
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
# build output
|
||||
dist/
|
||||
.output/
|
||||
.crush
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
|
||||
# logs
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
|
||||
# environment variables
|
||||
.env
|
||||
.env.production
|
||||
|
||||
# macOS-specific files
|
||||
.DS_Store
|
||||
|
||||
# misc
|
||||
*.pem
|
||||
.cache
|
||||
.astro
|
||||
tmp/
|
||||
.vercel
|
||||
.env*.local
|
||||
@@ -0,0 +1,8 @@
|
||||
*.min.js
|
||||
node_modules
|
||||
|
||||
# cache-dirs
|
||||
**/.cache
|
||||
|
||||
pnpm-lock.yaml
|
||||
dist
|
||||
@@ -0,0 +1,23 @@
|
||||
/** @type {import("@types/prettier").Options} */
|
||||
export default {
|
||||
printWidth: 100,
|
||||
semi: true,
|
||||
singleQuote: false,
|
||||
tabWidth: 2,
|
||||
useTabs: true,
|
||||
plugins: ["prettier-plugin-astro", "prettier-plugin-tailwindcss" /* Must come last */],
|
||||
overrides: [
|
||||
{
|
||||
files: "**/*.astro",
|
||||
options: {
|
||||
parser: "astro",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["*.mdx", "*.md"],
|
||||
options: {
|
||||
printWidth: 80,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
import fs from "node:fs";
|
||||
import { rehypeHeadingIds } from "@astrojs/markdown-remark";
|
||||
import mdx from "@astrojs/mdx";
|
||||
import sitemap from "@astrojs/sitemap";
|
||||
import tailwind from "@tailwindcss/vite";
|
||||
import { defineConfig, envField } from "astro/config";
|
||||
import expressiveCode from "astro-expressive-code";
|
||||
import icon from "astro-icon";
|
||||
import robotsTxt from "astro-robots-txt";
|
||||
import webmanifest from "astro-webmanifest";
|
||||
import rehypeAutolinkHeadings from "rehype-autolink-headings";
|
||||
import rehypeExternalLinks from "rehype-external-links";
|
||||
import rehypeUnwrapImages from "rehype-unwrap-images";
|
||||
import remarkDirective from "remark-directive"; /* Handle ::: directives as nodes */
|
||||
import { remarkAdmonitions } from "./src/plugins/remark-admonitions";
|
||||
import { remarkGithubCard } from "./src/plugins/remark-github-card";
|
||||
import { remarkReadingTime } from "./src/plugins/remark-reading-time";
|
||||
import { expressiveCodeOptions, siteConfig } from "./src/site.config";
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: siteConfig.url,
|
||||
image: {
|
||||
domains: ["webmention.io"],
|
||||
},
|
||||
integrations: [
|
||||
expressiveCode(expressiveCodeOptions),
|
||||
icon(),
|
||||
sitemap(),
|
||||
mdx(),
|
||||
robotsTxt(),
|
||||
webmanifest({
|
||||
// See: https://github.com/alextim/astro-lib/blob/main/packages/astro-webmanifest/README.md
|
||||
name: siteConfig.title,
|
||||
description: siteConfig.description,
|
||||
lang: siteConfig.lang,
|
||||
icon: "public/icon.svg", // the source for generating favicon & icons
|
||||
icons: [
|
||||
{
|
||||
src: "icons/apple-touch-icon.png", // used in src/components/BaseHead.astro L:26
|
||||
sizes: "180x180",
|
||||
type: "image/png",
|
||||
},
|
||||
{
|
||||
src: "icons/icon-192.png",
|
||||
sizes: "192x192",
|
||||
type: "image/png",
|
||||
},
|
||||
{
|
||||
src: "icons/icon-512.png",
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
},
|
||||
],
|
||||
start_url: "/",
|
||||
background_color: "#1d1f21",
|
||||
theme_color: "#2bbc8a",
|
||||
display: "standalone",
|
||||
config: {
|
||||
insertFaviconLinks: false,
|
||||
insertThemeColorMeta: false,
|
||||
insertManifestLink: false,
|
||||
},
|
||||
}),
|
||||
],
|
||||
markdown: {
|
||||
rehypePlugins: [
|
||||
rehypeHeadingIds,
|
||||
[rehypeAutolinkHeadings, { behavior: "wrap", properties: { className: ["not-prose"] } }],
|
||||
[
|
||||
rehypeExternalLinks,
|
||||
{
|
||||
rel: ["noreferrer", "noopener"],
|
||||
target: "_blank",
|
||||
},
|
||||
],
|
||||
rehypeUnwrapImages,
|
||||
],
|
||||
remarkPlugins: [remarkReadingTime, remarkDirective, remarkGithubCard, remarkAdmonitions],
|
||||
remarkRehype: {
|
||||
footnoteLabelProperties: {
|
||||
className: [""],
|
||||
},
|
||||
},
|
||||
},
|
||||
vite: {
|
||||
plugins: [tailwind(), rawFonts([".ttf", ".woff"])],
|
||||
},
|
||||
env: {
|
||||
schema: {
|
||||
WEBMENTION_API_KEY: envField.string({ context: "server", access: "secret", optional: true }),
|
||||
WEBMENTION_URL: envField.string({ context: "client", access: "public", optional: true }),
|
||||
WEBMENTION_PINGBACK: envField.string({ context: "client", access: "public", optional: true }),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function rawFonts(ext: string[]) {
|
||||
return {
|
||||
name: "vite-plugin-raw-fonts",
|
||||
// @ts-expect-error:next-line
|
||||
transform(_, id) {
|
||||
if (ext.some((e) => id.endsWith(e))) {
|
||||
const buffer = fs.readFileSync(id);
|
||||
return {
|
||||
code: `export default ${JSON.stringify(buffer)}`,
|
||||
map: null,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
||||
"files": {
|
||||
"includes": [
|
||||
"**",
|
||||
"!**/build",
|
||||
"!**/dist",
|
||||
"!**/node_modules",
|
||||
"!**/.vercel",
|
||||
"!**/.netlify",
|
||||
"!**/.vscode",
|
||||
"!**/.astro"
|
||||
]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab",
|
||||
"lineEnding": "lf",
|
||||
"lineWidth": 100,
|
||||
"expand": "auto"
|
||||
},
|
||||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
|
||||
"assist": {
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on"
|
||||
}
|
||||
}
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"a11y": {
|
||||
"noSvgWithoutTitle": "off"
|
||||
},
|
||||
"style": {
|
||||
"noParameterAssign": "error",
|
||||
"useAsConstAssertion": "error",
|
||||
"useDefaultParameterLast": "error",
|
||||
"useEnumInitializers": "error",
|
||||
"useSelfClosingElements": "error",
|
||||
"useSingleVarDeclarator": "error",
|
||||
"noUnusedTemplateLiteral": "error",
|
||||
"useNumberNamespace": "error",
|
||||
"noInferrableTypes": "error",
|
||||
"noUselessElse": "error",
|
||||
"useImportType": "error"
|
||||
},
|
||||
"suspicious": { "noExplicitAny": "warn" }
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"trailingCommas": "all",
|
||||
"semicolons": "always",
|
||||
"bracketSameLine": false
|
||||
}
|
||||
},
|
||||
"html": { "formatter": { "selfCloseVoidElements": "always" } },
|
||||
"css": {
|
||||
"parser": {
|
||||
"tailwindDirectives": true
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"includes": ["**/*.astro"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"style": {
|
||||
"useConst": "off",
|
||||
"useImportType": "off"
|
||||
},
|
||||
"correctness": {
|
||||
"noUnusedVariables": "off",
|
||||
"noUnusedImports": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "prd.lk",
|
||||
"type": "module",
|
||||
"version": "7.2.0",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"postinstall": "npm rebuild sharp --force",
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"build": "astro build",
|
||||
"postbuild": "pagefind --site dist",
|
||||
"preview": "astro preview",
|
||||
"check": "astro check && biome check",
|
||||
"lint": "biome check --write",
|
||||
"format": "prettier -w . --cache"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdown-remark": "^7.1.2",
|
||||
"@astrojs/mdx": "5.0.6",
|
||||
"@astrojs/rss": "4.0.18",
|
||||
"@astrojs/sitemap": "3.7.2",
|
||||
"@pagefind/component-ui": "^1.5.2",
|
||||
"@tailwindcss/vite": "4.3.0",
|
||||
"@vercel/analytics": "^2.0.1",
|
||||
"astro": "6.3.3",
|
||||
"astro-expressive-code": "^0.42.0",
|
||||
"astro-icon": "^1.1.5",
|
||||
"astro-robots-txt": "^1.0.0",
|
||||
"astro-webmanifest": "^1.0.0",
|
||||
"cssnano": "^8.0.1",
|
||||
"hastscript": "^9.0.0",
|
||||
"mdast-util-directive": "^3.0.0",
|
||||
"mdast-util-to-markdown": "^2.1.2",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
"rehype-external-links": "^3.0.0",
|
||||
"rehype-unwrap-images": "^1.0.0",
|
||||
"remark-directive": "^4.0.0",
|
||||
"satori": "0.26.0",
|
||||
"sharp": "^0.34.5",
|
||||
"tailwindcss": "^4.3.0",
|
||||
"unified": "^11.0.5",
|
||||
"unist-util-visit": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/check": "^0.9.9",
|
||||
"@biomejs/biome": "^2.4.15",
|
||||
"@iconify-json/lucide": "^1.2.115",
|
||||
"@iconify-json/simple-icons": "^1.2.88",
|
||||
"@pagefind/default-ui": "^1.5.2",
|
||||
"@tailwindcss/typography": "^0.5.19",
|
||||
"@types/hast": "^3.0.4",
|
||||
"@types/mdast": "^4.0.4",
|
||||
"@types/node": "^25.8.0",
|
||||
"autoprefixer": "^10.5.0",
|
||||
"pagefind": "^1.5.2",
|
||||
"prettier": "^3.8.3",
|
||||
"prettier-plugin-astro": "0.14.1",
|
||||
"prettier-plugin-tailwindcss": "^0.8.0",
|
||||
"reading-time": "^1.5.0",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"overrides": {
|
||||
"sharp": "^0.34.5"
|
||||
},
|
||||
"trustedDependencies": ["@biomejs/biome", "@tailwindcss/oxide", "esbuild", "sharp"]
|
||||
}
|
||||
Generated
+7307
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
||||
allowBuilds:
|
||||
'@biomejs/biome': true
|
||||
'@tailwindcss/oxide': true
|
||||
esbuild: true
|
||||
sharp: true
|
||||
@@ -0,0 +1,93 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
export default {
|
||||
plugins: [require("@tailwindcss/typography")],
|
||||
theme: {
|
||||
extend: {
|
||||
typography: () => ({
|
||||
DEFAULT: {
|
||||
css: {
|
||||
a: {
|
||||
textUnderlineOffset: "2px",
|
||||
"&:hover": {
|
||||
"@media (hover: hover)": {
|
||||
textDecorationColor: "var(--color-link)",
|
||||
textDecorationThickness: "2px",
|
||||
},
|
||||
},
|
||||
},
|
||||
blockquote: {
|
||||
borderLeftWidth: "0",
|
||||
},
|
||||
code: {
|
||||
border: "1px dotted #666",
|
||||
borderRadius: "2px",
|
||||
},
|
||||
kbd: {
|
||||
"&:where([data-theme='dark'], [data-theme='dark'] *)": {
|
||||
background: "var(--color-global-text)",
|
||||
},
|
||||
},
|
||||
hr: {
|
||||
borderTopStyle: "dashed",
|
||||
},
|
||||
strong: {
|
||||
fontWeight: "700",
|
||||
},
|
||||
sup: {
|
||||
marginInlineStart: "calc(var(--spacing) * 0.5)",
|
||||
a: {
|
||||
"&:after": {
|
||||
content: "']'",
|
||||
},
|
||||
"&:before": {
|
||||
content: "'['",
|
||||
},
|
||||
"&:hover": {
|
||||
"@media (hover: hover)": {
|
||||
color: "var(--color-link)",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
/* Table */
|
||||
"tbody tr": {
|
||||
borderBottomWidth: "none",
|
||||
},
|
||||
tfoot: {
|
||||
borderTop: "1px dashed #666",
|
||||
},
|
||||
thead: {
|
||||
borderBottomWidth: "none",
|
||||
},
|
||||
"thead th": {
|
||||
borderBottom: "1px dashed #666",
|
||||
fontWeight: "700",
|
||||
},
|
||||
'th[align="center"], td[align="center"]': {
|
||||
"text-align": "center",
|
||||
},
|
||||
'th[align="right"], td[align="right"]': {
|
||||
"text-align": "right",
|
||||
},
|
||||
'th[align="left"], td[align="left"]': {
|
||||
"text-align": "left",
|
||||
},
|
||||
".expressive-code, .admonition, .github-card": {
|
||||
marginTop: "calc(var(--spacing)*4)",
|
||||
marginBottom: "calc(var(--spacing)*4)",
|
||||
},
|
||||
},
|
||||
},
|
||||
sm: {
|
||||
css: {
|
||||
code: {
|
||||
fontSize: "var(--text-sm)",
|
||||
fontWeight: "400",
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
} satisfies Config;
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strictest",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["node_modules", "**/node_modules/*", ".vscode", "dist"]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "https://openapi.vercel.sh/vercel.json",
|
||||
"framework": "astro",
|
||||
"installCommand": "bun install",
|
||||
"buildCommand": "bun run build",
|
||||
"outputDirectory": "dist",
|
||||
"redirects": [{ "source": "/sitemap.xml", "destination": "/sitemap-index.xml", "permanent": true }]
|
||||
}
|
||||
Reference in new issue
Block a user