1
Fork 0

Add miscellaneous project files.

This commit is contained in:
Bauke 2023-07-19 17:43:46 +02:00
parent 75d65a95d5
commit f80ba026b5
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
5 changed files with 106 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.netlify/
.vscode/
node_modules/
public/
target/
Cargo.lock
pnpm-lock.yaml

20
Makefile.toml Normal file
View File

@ -0,0 +1,20 @@
[tasks.build]
clear = true
command = "pnpm"
args = ["astro", "build"]
[tasks.clean]
clear = true
command = "pnpm"
args = ["trash", "public/"]
[tasks.dev]
clear = true
command = "pnpm"
args = ["astro", "dev"]
[tasks.publish]
clear = true
dependencies = ["clean", "build"]
command = "pnpm"
args = ["netlify", "deploy", "-p", "-d", "public/", "-s", "tildes.community"]

30
astro.config.ts Normal file
View File

@ -0,0 +1,30 @@
import path from "node:path";
// eslint-disable-next-line n/file-extension-in-import
import {defineConfig} from "astro/config";
import mdxIntegration from "@astrojs/mdx";
import preactIntegration from "@astrojs/preact";
/**
* Create an absolute path from a given relative one, using the directory
* this file is located in as the base.
*
* @param relative The relative path to make absolute.
* @returns The absolute path.
*/
function toAbsolutePath(relative: string): string {
return new URL(relative, import.meta.url).pathname;
}
// Create absolute paths to various directories.
const buildDir = toAbsolutePath("./public");
const sourceDir = toAbsolutePath("./source");
export default defineConfig({
// eslint-disable-next-line @typescript-eslint/naming-convention
compressHTML: true,
integrations: [mdxIntegration(), preactIntegration()],
outDir: buildDir,
publicDir: path.join(sourceDir, "assets/"),
site: "https://tildes.community",
srcDir: sourceDir,
});

29
package.json Normal file
View File

@ -0,0 +1,29 @@
{
"private": "true",
"dependencies": {
"@astrojs/mdx": "^0.19.7",
"@astrojs/preact": "^2.2.1",
"@bauke/eslint-config": "^0.1.4",
"@bauke/prettier-config": "^0.1.4",
"@bauke/stylelint-config": "^0.1.4",
"@types/node": "^20.4.2",
"astro": "^2.8.3",
"modern-normalize": "^2.0.0",
"netlify-cli": "^15.9.0",
"preact": "^10.16.0",
"sass": "^1.63.6",
"stylelint": "^15.10.1",
"trash-cli": "^5.0.0",
"typescript": "^5.1.6",
"xo": "^0.55.0"
},
"prettier": "@bauke/prettier-config",
"stylelint": {
"extends": "@bauke/stylelint-config"
},
"xo": {
"extends": "@bauke/eslint-config",
"prettier": true,
"space": true
}
}

19
tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"esModuleInterop": true,
"jsx": "react-jsx",
"jsxImportSource": "preact",
"lib": [
"DOM",
"ES2022"
],
"module": "ES2022",
"moduleResolution": "Node",
"resolveJsonModule": true,
"strict": true,
"target": "ES2022"
},
"include": [
"source"
]
}