From 8446f437c0a4226201a020728a94cd63ffd77e25 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 12 Aug 2021 18:29:51 +0200 Subject: [PATCH] Initial commit --- .eslintrc.cjs | 15 +++++++++++++++ .gitignore | 5 +++++ .prettierrc | 6 ++++++ README.md | 38 +++++++++++++++++++++++++++++++++++++ jsconfig.json | 10 ++++++++++ package.json | 27 ++++++++++++++++++++++++++ postcss.config.cjs | 20 +++++++++++++++++++ src/app.html | 12 ++++++++++++ src/app.postcss | 4 ++++ src/global.d.ts | 1 + src/routes/__layout.svelte | 2 ++ src/routes/index.svelte | 2 ++ static/favicon.png | Bin 0 -> 1571 bytes svelte.config.js | 14 ++++++++++++++ tailwind.config.cjs | 12 ++++++++++++ 15 files changed, 168 insertions(+) create mode 100644 .eslintrc.cjs create mode 100644 .gitignore create mode 100644 .prettierrc create mode 100644 README.md create mode 100644 jsconfig.json create mode 100644 package.json create mode 100644 postcss.config.cjs create mode 100644 src/app.html create mode 100644 src/app.postcss create mode 100644 src/global.d.ts create mode 100644 src/routes/__layout.svelte create mode 100644 src/routes/index.svelte create mode 100644 static/favicon.png create mode 100644 svelte.config.js create mode 100644 tailwind.config.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..e496918 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,15 @@ +module.exports = { + root: true, + extends: ['eslint:recommended', 'prettier'], + plugins: ['svelte3'], + overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], + parserOptions: { + sourceType: 'module', + ecmaVersion: 2019 + }, + env: { + browser: true, + es2017: true, + node: true + } +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dad6f80 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/package diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..ff2677e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100 +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..82510ca --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# create-svelte + +Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte); + +## Creating a project + +If you're seeing this, you've probably already done this step. Congrats! + +```bash +# create a new project in the current directory +npm init svelte@next + +# create a new project in my-app +npm init svelte@next my-app +``` + +> Note: the `@next` is temporary + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```bash +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then: + +```bash +npm run build +``` + +> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production. diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..3757b0e --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "$lib": ["src/lib"], + "$lib/*": ["src/lib/*"] + } + }, + "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..266e4be --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "~TODO~", + "version": "0.0.1", + "scripts": { + "dev": "svelte-kit dev", + "build": "svelte-kit build", + "preview": "svelte-kit preview", + "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", + "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ." + }, + "devDependencies": { + "@sveltejs/kit": "next", + "eslint": "^7.22.0", + "eslint-config-prettier": "^8.1.0", + "eslint-plugin-svelte3": "^3.2.0", + "prettier": "~2.2.1", + "prettier-plugin-svelte": "^2.2.0", + "svelte": "^3.34.0", + "postcss": "^8.3.5", + "postcss-load-config": "^3.1.0", + "svelte-preprocess": "^4.7.4", + "autoprefixer": "^10.3.1", + "cssnano": "^5.0.6", + "tailwindcss": "^2.2.4" + }, + "type": "module" +} \ No newline at end of file diff --git a/postcss.config.cjs b/postcss.config.cjs new file mode 100644 index 0000000..530f2fc --- /dev/null +++ b/postcss.config.cjs @@ -0,0 +1,20 @@ +const tailwindcss = require("tailwindcss"); +const autoprefixer = require("autoprefixer"); +const cssnano = require("cssnano"); + +const mode = process.env.NODE_ENV; +const dev = mode === "development"; + +const config = { + plugins: [ + //Some plugins, like postcss-nested, need to run before Tailwind, + tailwindcss(), + //But others, like autoprefixer, need to run after, + autoprefixer(), + !dev && cssnano({ + preset: "default", + }) + ], +}; + +module.exports = config; \ No newline at end of file diff --git a/src/app.html b/src/app.html new file mode 100644 index 0000000..e759c4a --- /dev/null +++ b/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %svelte.head% + + +
%svelte.body%
+ + diff --git a/src/app.postcss b/src/app.postcss new file mode 100644 index 0000000..dbf6827 --- /dev/null +++ b/src/app.postcss @@ -0,0 +1,4 @@ +@tailwind base; +/* Write your global styles here, in PostCSS syntax */ +@tailwind components; +@tailwind utilities \ No newline at end of file diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..63908c6 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte new file mode 100644 index 0000000..a8602bb --- /dev/null +++ b/src/routes/__layout.svelte @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/routes/index.svelte b/src/routes/index.svelte new file mode 100644 index 0000000..5982b0a --- /dev/null +++ b/src/routes/index.svelte @@ -0,0 +1,2 @@ +

Welcome to SvelteKit

+

Visit kit.svelte.dev to read the documentation

diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..825b9e65af7c104cfb07089bb28659393b4f2097 GIT binary patch literal 1571 zcmV+;2Hg3HP)Px)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zO+H=CpV~aaUefmjvfZ3Ttu9W&W3Iu6 zROlh0MFA5h;my}8lB0tAV-Rvc2Zs_CCSJnx@d`**$idgy-iMob4dJWWw|21b4NB=LfsYp0Aeh{Ov)yztQi;eL4y5 zMi>8^SzKqk8~k?UiQK^^-5d8c%bV?$F8%X~czyiaKCI2=UH element in src/app.html + target: '#svelte' + }, + + preprocess: [preprocess({ + "postcss": true + })] +}; + +export default config; diff --git a/tailwind.config.cjs b/tailwind.config.cjs new file mode 100644 index 0000000..ab3fb9b --- /dev/null +++ b/tailwind.config.cjs @@ -0,0 +1,12 @@ +const config = { + mode: "jit", + purge: [ + "./src/**/*.{html,js,svelte,ts}", + ], + theme: { + extend: {}, + }, + plugins: [], +}; + +module.exports = config;