diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..326dec9 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,48 @@ +{ + "singleQuote": false, + "tabWidth": 2, + "useTabs": false, + "htmlWhitespaceSensitivity": "ignore", + "overrides": [ + { + "files": "*.html", + "options": { + "tabWidth": 2, + "useTabs": false + } + }, + { + "files": "*.scss", + "options": { + "tabWidth": 2, + "useTabs": false + } + }, + { + "files": "*.json", + "options": { + "tabWidth": 2, + "useTabs": false + } + }, + { + "files": "*.svelte", + "options": { + "tabWidth": 2, + "useTabs": false + } + }, + { + "files": "*.js", + "options": { + "useTabs": true + } + }, + { + "files": "*.ts", + "options": { + "useTabs": true + } + } + ] +} diff --git a/README.md b/README.md index b307761..87da0ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Colormatic Website + [colormatic.org](https://colormatic.org) This project uses SvelteKit along with TypeScript and Sass. It's configured for static site generation (SSG) and prerendering at compile time to create a simple static website for Nginx to serve, with very little client-side rendering (CSR). @@ -6,22 +7,37 @@ This project uses SvelteKit along with TypeScript and Sass. It's configured for The Colormatic website is developed with accordance to modern web standards, however a legacy website will be available in the future for older/less capable browsers. To download the project, run: + ``` git clone git@git.colormatic.org:ColormaticStudios/Colormatic-Website.git cd Colormatic-Website npm install ``` + You can run the project locally with: + ``` npm run dev ``` + Or you can build the project for release with: + ``` npm run build ``` + After the project has been built, you can preview the release build with: + ``` npm run preview ``` -Bootstrap Icons are licensed under the [MIT](https://opensource.org/license/MIT) license. +Before submitting a push or pull request, run: + +``` +npm run format +``` + +To format your code according to the project code format. Remember to never fight the formatter. + +[Bootstrap Icons](https://icons.getbootstrap.com/) are licensed under the [MIT](https://opensource.org/license/MIT) license. diff --git a/package.json b/package.json index 467d4f0..b617cbb 100644 --- a/package.json +++ b/package.json @@ -1,26 +1,28 @@ { - "name": "colormatic-website", - "version": "1.0.0", - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "prepare": "svelte-kit sync || echo ''", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" - }, - "devDependencies": { - "@sveltejs/adapter-static": "^3.0.8", - "@sveltejs/kit": "^2.16.0", - "@sveltejs/vite-plugin-svelte": "^5.0.0", - "sass": "^1.83.4", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "typescript": "^5.0.0", - "vite": "^6.0.0" - }, - "dependencies": { - "bootstrap-icons": "^1.11.3" - } + "name": "colormatic-website", + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "prepare": "svelte-kit sync || echo ''", + "format": "prettier -w .", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" + }, + "devDependencies": { + "@sveltejs/adapter-static": "^3.0.8", + "@sveltejs/kit": "^2.16.0", + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "prettier": "^3.5.3", + "sass": "^1.83.4", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "typescript": "^5.0.0", + "vite": "^6.0.0" + }, + "dependencies": { + "bootstrap-icons": "^1.11.3" + } } diff --git a/tsconfig.json b/tsconfig.json index 12e6f83..d7bdc04 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,20 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true - } - // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias - // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files - // - // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes - // from the referenced tsconfig.json - TypeScript does not merge them in + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true + } + // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias + // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in } diff --git a/vite.config.ts b/vite.config.ts index bbf8c7d..6b9eb5d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ -import { sveltekit } from '@sveltejs/kit/vite'; -import { defineConfig } from 'vite'; +import { sveltekit } from "@sveltejs/kit/vite"; +import { defineConfig } from "vite"; export default defineConfig({ - plugins: [sveltekit()] + plugins: [sveltekit()], });