feat: 初始化框架和组件引入
This commit is contained in:
parent
04d332ee7d
commit
34713cc9fb
13
.prettierrc
Normal file
13
.prettierrc
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"plugins": [
|
||||
"prettier-plugin-astro"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.astro",
|
||||
"options": {
|
||||
"parser": "astro"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,5 +1,15 @@
|
||||
// @ts-check
|
||||
import { defineConfig } from 'astro/config';
|
||||
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
|
||||
import svelte from '@astrojs/svelte';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({});
|
||||
export default defineConfig({
|
||||
vite: {
|
||||
plugins: [tailwindcss()]
|
||||
},
|
||||
|
||||
integrations: [svelte()]
|
||||
});
|
||||
12
eslint.config.cjs
Normal file
12
eslint.config.cjs
Normal file
@ -0,0 +1,12 @@
|
||||
const eslintPluginAstro = require('eslint-plugin-astro');
|
||||
module.exports = [
|
||||
// add more generic rule sets here, such as:
|
||||
// js.configs.recommended,
|
||||
...eslintPluginAstro.configs['flat/recommended'], // In CommonJS, the `flat/` prefix is required.
|
||||
{
|
||||
rules: {
|
||||
// override/add rules settings here, such as:
|
||||
// "astro/no-set-html-directive": "error"
|
||||
}
|
||||
}
|
||||
];
|
||||
17
package.json
17
package.json
@ -9,6 +9,21 @@
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.7.5"
|
||||
"@astrojs/svelte": "^7.0.11",
|
||||
"@astrojs/ts-plugin": "^1.10.4",
|
||||
"@skeletonlabs/skeleton-svelte": "^1.2.1",
|
||||
"@tailwindcss/vite": "^4.1.4",
|
||||
"astro": "^5.7.5",
|
||||
"svelte": "^5.28.2",
|
||||
"tailwindcss": "^4.1.4",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@skeletonlabs/skeleton": "^3.1.2",
|
||||
"@typescript-eslint/parser": "^8.31.0",
|
||||
"eslint": "^9.25.1",
|
||||
"eslint-plugin-astro": "^1.3.1",
|
||||
"prettier": "3.5.3",
|
||||
"prettier-plugin-astro": "0.14.1"
|
||||
}
|
||||
}
|
||||
1971
pnpm-lock.yaml
generated
1971
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
4
src/components/Test.svelte
Normal file
4
src/components/Test.svelte
Normal file
@ -0,0 +1,4 @@
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<button type="button" class="btn preset-filled">Button</button>
|
||||
5
src/pages/404.astro
Normal file
5
src/pages/404.astro
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
404 not found
|
||||
10
src/pages/500.astro
Normal file
10
src/pages/500.astro
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
interface Props {
|
||||
error: unknown;
|
||||
}
|
||||
const { error } = Astro.props;
|
||||
---
|
||||
|
||||
<div>500 - Internal Server Error</div>
|
||||
|
||||
<div>{error instanceof Error ? error.message : "Unknown error"}</div>
|
||||
@ -1,11 +1,14 @@
|
||||
---
|
||||
import Welcome from '../components/Welcome.astro';
|
||||
import Layout from '../layouts/Layout.astro';
|
||||
import Welcome from "../components/Welcome.astro";
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import Test from "../components/Test.svelte";
|
||||
import "@/styles/global.css";
|
||||
|
||||
// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build
|
||||
// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh.
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<Welcome />
|
||||
<!--<Welcome />-->
|
||||
<Test />
|
||||
</Layout>
|
||||
|
||||
6
src/styles/global.css
Normal file
6
src/styles/global.css
Normal file
@ -0,0 +1,6 @@
|
||||
@import 'tailwindcss';
|
||||
|
||||
@import '@skeletonlabs/skeleton';
|
||||
@import '@skeletonlabs/skeleton/optional/presets';
|
||||
@import '@skeletonlabs/skeleton/themes/cerberus';
|
||||
@source '@skeletonlabs/skeleton-svelte/dist';
|
||||
5
svelte.config.js
Normal file
5
svelte.config.js
Normal file
@ -0,0 +1,5 @@
|
||||
import { vitePreprocess } from '@astrojs/svelte';
|
||||
|
||||
export default {
|
||||
preprocess: vitePreprocess(),
|
||||
}
|
||||
@ -1,5 +1,24 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
"include": [
|
||||
".astro/types.d.ts",
|
||||
"**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"dist"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
{
|
||||
"name": "@astrojs/ts-plugin"
|
||||
}
|
||||
],
|
||||
"verbatimModuleSyntax": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user