The Svelte 5 SSG Migration #1

Merged
mifi merged 14 commits from feature/svelte-ssg into main 2026-02-01 05:50:42 +00:00
5 changed files with 122 additions and 95 deletions
Showing only changes of commit 8d688291df - Show all commits

View File

@@ -1,6 +1,6 @@
# Deploy pipeline: lint, test, build, then Docker image → registry → Portainer webhook.
# Runs on push to main, tag, or manual run.
# See pr.yaml for PR-only (lint + test + build).
# See lint-and-build.yaml for PR-only (lint + test + build).
when:
branch: main
event: [push, tag, manual]

View File

@@ -0,0 +1,31 @@
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
# Runs when a pull request is opened or updated.
# Does not build Docker image or deploy.
when:
event: pull_request
steps:
- name: install
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm install --frozen-lockfile || pnpm install
- name: lint
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm run lint
- pnpm run lint:css
- name: build
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm run build
- name: test
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm test

View File

@@ -1,16 +0,0 @@
# PR pipeline: lint, test, and test build on the branch.
# Runs when a pull request is opened or updated.
# Does not build Docker image or deploy.
when:
event: pull_request
steps:
- name: lint-and-build
image: node:20-alpine
commands:
- corepack enable && corepack prepare pnpm@10.28.2 --activate
- pnpm install --frozen-lockfile || pnpm install
- pnpm run lint
- pnpm run lint:css
- pnpm run build
- pnpm test

View File

@@ -104,7 +104,7 @@ mifi-ventures-landing/
│ ├── devcontainer.json # Dev container config (extensions)
│ └── Dockerfile # Dev container image (Node)
├── .woodpecker/ # CI/CD pipelines (see below)
│ ├── pr.yaml # PR: lint, test, build (no deploy)
│ ├── lint-and-build.yaml # PR: lint, test, build (no deploy)
│ └── deploy.yaml # main: lint, test, build, Docker, push, webhook
├── Dockerfile # Production container (nginx:alpine)
├── nginx.conf # nginx web server configuration
@@ -140,7 +140,7 @@ mifi-ventures-landing/
### Pipeline Overview
Woodpecker uses two workflows (`.woodpecker/pr.yaml` and `.woodpecker/deploy.yaml`):
Woodpecker uses two workflows (`.woodpecker/lint-and-build.yaml` and `.woodpecker/deploy.yaml`):
- **Pull requests**: Opening or updating a PR runs **lint** (ESLint + Stylelint), **tests** (Vitest), and a **test build** (SvelteKit + Critters) on the branch. No Docker image or deploy.
- **Push to main** (or tag / manual run): Runs the same lint, test, and build, then:

View File

@@ -2,6 +2,7 @@ import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import svelteConfig from './svelte.config.js';
export default [
{
@@ -19,6 +20,17 @@ export default [
...tseslint.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
projectService: true,
extraFileExtensions: ['.svelte'],
svelteConfig
}
}
},
{
files: ['**/*.mjs', 'build.mjs'],
languageOptions: { globals: { console: 'readonly', process: 'readonly' } }