feat: add TypeScript and build configuration
- Add tsconfig.json with ES2020 target and strict mode - Convert tailwind.config.js to TypeScript - Update package.json with build scripts: - build:ts - Compile TypeScript - build:ts:watch - Watch mode for development - Updated paths for web/ directory structure - Set up proper TypeScript compilation pipeline
This commit is contained in:
+9
-6
@@ -3,13 +3,16 @@
|
||||
"version": "1.0.0",
|
||||
"description": "A self-hosted ebook management system",
|
||||
"scripts": {
|
||||
"build:css": "tailwindcss -i ./cmd/server/static/input.css -o ./cmd/server/static/style.css --watch",
|
||||
"build:css:prod": "tailwindcss -i ./cmd/server/static/input.css -o ./cmd/server/static/style.css --minify",
|
||||
"postinstall": "mkdir -p cmd/server/static && curl -L https://unpkg.com/htmx.org@1.9.10/dist/htmx.min.js -o cmd/server/static/htmx.min.js"
|
||||
"build:css": "tailwindcss -i ./web/static/input.css -o ./web/static/style.css --watch",
|
||||
"build:css:prod": "tailwindcss -i ./web/static/input.css -o ./web/static/style.css --minify",
|
||||
"build:ts": "tsc",
|
||||
"build:ts:watch": "tsc --watch",
|
||||
"postinstall": "mkdir -p web/static && curl -L https://unpkg.com/htmx.org@1.9.10/dist/htmx.min.js -o web/static/htmx.min.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tailwindcss": "^3.4.0",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"@tailwindcss/forms": "^0.5.7"
|
||||
"tailwindcss": "^3.4.0",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import type { Config } from 'tailwindcss';
|
||||
|
||||
const config: Config = {
|
||||
content: [
|
||||
"./templates/**/*.{templ,html}",
|
||||
"./web/static/**/*.{html,js}"
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
primary: {
|
||||
DEFAULT: '#7aa2f7',
|
||||
50: '#f0f9ff',
|
||||
100: '#e0f2fe',
|
||||
200: '#bae6fd',
|
||||
300: '#7dd3fc',
|
||||
400: '#38bdf8',
|
||||
500: '#0ea5e9',
|
||||
600: '#0284c7',
|
||||
700: '#0369a1',
|
||||
800: '#075985',
|
||||
900: '#0c4a6e',
|
||||
},
|
||||
'bg-primary': '#1a1b26',
|
||||
'bg-secondary': '#16161e',
|
||||
'text-primary': '#a9b1d6',
|
||||
'text-secondary': '#565f89',
|
||||
'accent': '#7aa2f7',
|
||||
'border': '#414868',
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
require('@tailwindcss/forms'),
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ES2020",
|
||||
"lib": ["ES2020", "DOM"],
|
||||
"outDir": "./web/static",
|
||||
"rootDir": "./web/src",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": false,
|
||||
"sourceMap": false,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": [
|
||||
"web/src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user