chore: development setup

Signed-off-by: Ryan Wang <i@ryanc.cc>
This commit is contained in:
Ryan Wang
2022-10-05 23:26:16 +08:00
parent 0014a1a802
commit d8769ce58c
14 changed files with 1797 additions and 2 deletions

12
.editorconfig Normal file
View File

@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

14
.eslintrc.cjs Normal file
View File

@@ -0,0 +1,14 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
env: {
node: true,
},
};

23
.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

30
package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "@halo-dev/theme-default",
"private": true,
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "vite build --watch",
"build": "tsc && vite build",
"lint": "eslint ./src --ext .js,.cjs,.mjs,.ts,.cts,.mts --ignore-path .gitignore",
"prettier": "prettier --write './src/**/*.{js,ts,css,json,ml,yaml,html}' './templates/**/*.html'"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "16",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"autoprefixer": "^10.4.12",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"postcss": "^8.4.17",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"tailwindcss": "^3.1.8",
"typescript": "^4.6.4",
"vite": "^3.1.4"
}
}

1639
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

6
postcss.config.js Normal file
View File

@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

3
prettier.config.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
plugins: [require("prettier-plugin-tailwindcss")],
};

3
src/main.ts Normal file
View File

@@ -0,0 +1,3 @@
import "./styles/tailwind.css";
console.log("dd");

3
src/styles/tailwind.css Normal file
View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind utilities;
@tailwind components;

8
tailwind.config.js Normal file
View File

@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./templates/**/*.html"],
theme: {
extend: {},
},
plugins: [],
}

19
templates/index.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Halo</title>
<link
rel="stylesheet"
th:href="@{/assets/dist/style.css}"
href="./assets/dist/style.css"
/>
</head>
<body>
<span class="flex items-center justify-center font-serif text-red-600">
Halo
</span>
</body>
</html>

View File

@@ -1,7 +1,7 @@
apiVersion: theme.halo.run/v1alpha1
kind: Theme
metadata:
name: default
name: theme-default
spec:
displayName: Default
author:
@@ -13,4 +13,3 @@ spec:
repo: https://github.com/halo-sigs/theme-default.git
version: 1.0.0
require: 2.0.0
plugins: ["PluginLinks", "PluginJournals", "PluginPhotos"]

20
tsconfig.json Normal file
View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"skipLibCheck": true
},
"include": ["src"]
}

16
vite.config.ts Normal file
View File

@@ -0,0 +1,16 @@
import { defineConfig } from "vite";
import { fileURLToPath } from "url";
import path from "path";
export default defineConfig({
build: {
outDir: fileURLToPath(new URL("./templates/assets/dist", import.meta.url)),
emptyOutDir: true,
lib: {
entry: path.resolve(__dirname, "src/main.ts"),
name: "main",
fileName: "main",
formats: ["iife"],
},
},
});