Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OLILHR authored Oct 1, 2024
0 parents commit d687032
Show file tree
Hide file tree
Showing 40 changed files with 6,764 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
docker-compose.yml
node_modules
/.svelte-kit
.eslintrc.cjs
.git
.gitattributes
.gitignore
.npmrc
.prettierignore
.prettierrc
README.md
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=sveltekit-static-template
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package.json
package-lock.json
42 changes: 42 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: {
ts: "@typescript-eslint/parser",
js: "espree",
typescript: "@typescript-eslint/parser",
},
},
},
],
env: {
browser: true,
es2017: true,
node: true,
},
rules: {
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal"],
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
]
},
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* linguist-vendored
/src/** -linguist-vendored
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "🤖 "
reviewers:
- "OLILHR"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "🤖 "
reviewers:
- "OLILHR"
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Building"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.13"
cache: "npm"

- name: Install modules
run: npm ci

- name: Build frontend
run: npm run build
19 changes: 19 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Dependabot auto-approve / -merge

on: pull_request

jobs:
dependabot:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
50 changes: 50 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Deploying"

on:
push:
branches:
- "main"

jobs:
build_site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm install

- name: Build
env:
BASE_PATH: "/${{ github.event.repository.name }}"
run: |
npm run build
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: "build/"

deploy:
needs: build_site
runs-on: ubuntu-latest

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
29 changes: 29 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Linting"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.13"
cache: "npm"

- name: Install modules
run: npm ci

- name: Linting
run: npm run lint
39 changes: 39 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "E2E-Testing"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.13"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Set up PlayWright browser
run: npx playwright install --with-deps

- name: Build frontend
run: npm run build

- name: Start dev server
run: npm run dev &

- name: Run Playwright tests
run: npx playwright test
29 changes: 29 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Formatting"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.13"
cache: "npm"

- name: Install modules
run: npm ci

- name: Prettier
run: npm run format:check
29 changes: 29 additions & 0 deletions .github/workflows/type_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Type-Checking"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: "20.13"
cache: "npm"

- name: Install modules
run: npm ci

- name: Type-Checking
run: npm run check
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
node_modules

# Output
.output
.vercel
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# PlayWright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
.env.example
.svelte-kit/
node_modules/
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"plugins": ["prettier-plugin-svelte", "prettier-plugin-organize-imports"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20.13-alpine as build

WORKDIR /app

COPY . .

RUN npm install
RUN npm run build

FROM nginx:stable

COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/build /usr/share/nginx/html
Loading

0 comments on commit d687032

Please sign in to comment.