Skip to content

Commit bc32e20

Browse files
committed
Project setup with: Svelte & SvelteKit, Tailwind, ESLint, Prettier, adapter-static for SSG, deploy script to github pages.
1 parent e68557f commit bc32e20

21 files changed

Lines changed: 4457 additions & 6 deletions

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to Github Pages
2+
3+
on:
4+
push:
5+
branches: 'main'
6+
7+
jobs:
8+
build_site:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- name: Install dependencies
21+
run: npm i
22+
23+
- name: build
24+
env:
25+
BASE_PATH: '/${{ github.event.repository.name }}'
26+
run: |
27+
npm run build
28+
29+
- name: Upload Artifacts
30+
uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: 'build/'
33+
34+
deploy:
35+
needs: build_site
36+
runs-on: ubuntu-latest
37+
38+
permissions:
39+
pages: write
40+
id-token: write
41+
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
46+
steps:
47+
- name: Deploy
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Env
16+
.env
17+
.env.*
18+
!.env.example
19+
!.env.test
20+
21+
# Vite
22+
vite.config.js.timestamp-*
23+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock
5+
bun.lock
6+
bun.lockb
7+
8+
# Miscellaneous
9+
/static/

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true
4+
}

eslint.config.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import prettier from 'eslint-config-prettier';
2+
import { fileURLToPath } from 'node:url';
3+
import { includeIgnoreFile } from '@eslint/compat';
4+
import js from '@eslint/js';
5+
import svelte from 'eslint-plugin-svelte';
6+
import { defineConfig } from 'eslint/config';
7+
import globals from 'globals';
8+
import ts from 'typescript-eslint';
9+
import svelteConfig from './svelte.config.js';
10+
11+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
12+
13+
export default defineConfig(
14+
includeIgnoreFile(gitignorePath),
15+
js.configs.recommended,
16+
...ts.configs.recommended,
17+
...svelte.configs.recommended,
18+
prettier,
19+
...svelte.configs.prettier,
20+
{
21+
languageOptions: {
22+
globals: { ...globals.browser, ...globals.node }
23+
},
24+
rules: {
25+
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
26+
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
27+
'no-undef': 'off'
28+
}
29+
},
30+
{
31+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
32+
languageOptions: {
33+
parserOptions: {
34+
projectService: true,
35+
extraFileExtensions: ['.svelte'],
36+
parser: ts.parser,
37+
svelteConfig
38+
}
39+
}
40+
}
41+
);

index.html

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)