Skip to content

Commit

Permalink
chore: update Prettier config for optimized formatting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
NinaHahne committed Feb 7, 2025
1 parent d40eb28 commit 88b8f61
Show file tree
Hide file tree
Showing 21 changed files with 409 additions and 392 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

permissions:
contents: write # This allows GitHub Actions to push changes to the repository
contents: write # This allows GitHub Actions to push changes to the repository

steps:
- name: Checkout code
Expand Down
37 changes: 24 additions & 13 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
"semi": true,
"useTabs": false,
"tabWidth": 2,
"singleQuote": false,
"jsxSingleQuote": false,
"trailingComma": "es5",
"printWidth": 120,
"endOfLine": "lf",
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte",
"svelteSortOrder": "options-scripts-markup-styles"
}
},
{
"files": ["*.js", "*.ts"],
"options": {
"singleQuote": true
}
}
]
}
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This is the **Himmelblau** flower shop website, built with **SvelteKit** and int
---

## 🚀 Project Overview

- **Framework**: SvelteKit (Static Site)
- **CMS**: Sanity.io (for opening hours, events, and image gallery)
- **Hosting**: GitHub Pages
Expand All @@ -14,53 +15,67 @@ This is the **Himmelblau** flower shop website, built with **SvelteKit** and int
---

## 📌 **Setup & Installation**

### **1️⃣ Install Dependencies**

```bash
cd ~/code/himmelblau
npm install
```

### **2️⃣ Start Local Development Server**

```bash
npm run dev
```

- Open [http://localhost:5173](http://localhost:5173) in your browser.
- The site will load with the latest Sanity content.

---

## 🖼️ **Fetching Content from Sanity**

### **Content Managed in Sanity Studio**

- **Öffnungszeiten (Opening Hours)**
- **Events & Announcements**
- **Image Gallery**

### **Update Content (No Redeploy Needed!)**

1. Go to [Sanity Studio](https://himmelblau-studio.sanity.studio).
2. Edit the content and click **Publish**.
3. The website will automatically fetch updated content.

---

## 🔄 **Building & Deploying**

### **Build for Production**

```bash
npm run build
```

This generates static files in `build/`.

### **Deploy to GitHub Pages**

Deployment is handled automatically via **GitHub Actions** whenever changes are pushed to `main`.

To trigger a manual deployment:

```bash
git push origin main
```

---

## 🌍 **Fixing CORS Issues (If Content Doesn't Load)**

If the site can’t fetch data from Sanity:

1. Go to [Sanity API Settings](https://www.sanity.io/manage).
2. Under **CORS Origins**, make sure this is added:
```
Expand All @@ -72,16 +87,18 @@ If the site can’t fetch data from Sanity:
---

## **Common Commands**
| Command | Description |
|----------------------------|-------------|
| `npm install` | Install dependencies. |
| `npm run dev` | Start local development server. |
| `npm run build` | Build for production. |
| `npm run preview` | Preview the production build. |

| Command | Description |
| ----------------- | ------------------------------- |
| `npm install` | Install dependencies. |
| `npm run dev` | Start local development server. |
| `npm run build` | Build for production. |
| `npm run preview` | Preview the production build. |

---

## **Need Help?**

- **Check the Console** (`F12 → Console`) if something isn’t loading.
- **Sanity Studio Issues?** Try redeploying:
```bash
Expand Down
44 changes: 22 additions & 22 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ import ts from 'typescript-eslint';
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));

export default ts.config(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ['**/*.svelte'],

languageOptions: {
parserOptions: {
parser: ts.parser
}
}
}
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
}
);
82 changes: 41 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"name": "himmelblau",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint ."
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
"@eslint/js": "^9.17.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"ts-node": "^10.9.2",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.4.11"
},
"dependencies": {
"@sanity/client": "^6.27.2",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15"
}
"name": "himmelblau",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint ."
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
"@eslint/js": "^9.17.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.9",
"ts-node": "^10.9.2",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.4.11"
},
"dependencies": {
"@sanity/client": "^6.27.2",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15"
}
}
8 changes: 4 additions & 4 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
26 changes: 13 additions & 13 deletions src/app.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

.logo {
width: 100%;
width: 100%;
}

aside > div {
position: relative;
display: flex;
flex-direction: column;
position: relative;
display: flex;
flex-direction: column;
}

aside nav {
display: flex;
flex-direction: column;
gap: 1rem;
justify-content: space-between;
height: 100%;
}
display: flex;
flex-direction: column;
gap: 1rem;
justify-content: space-between;
height: 100%;
}
14 changes: 7 additions & 7 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}

export {};
33 changes: 18 additions & 15 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Blumenladen "himmelblau" - Berlin</title>
<head>
<meta charset="utf-8" />
<title>Blumenladen "himmelblau" - Berlin</title>

<meta name="title" property="og:title" content='Blumenladen "himmelblau" - Berlin'>
<meta name="title" property="og:title" content='Blumenladen "himmelblau" - Berlin' />

<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Architects+Daughter&family=Dancing+Script:wght@400..700&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Patrick+Hand&family=Sacramento&display=swap" rel="stylesheet">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Architects+Daughter&family=Dancing+Script:wght@400..700&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Patrick+Hand&family=Sacramento&display=swap"
rel="stylesheet"
/>

%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
Loading

0 comments on commit 88b8f61

Please sign in to comment.