Skip to content

Commit

Permalink
Merge pull request #9 from QPixel/feat/sveltekit
Browse files Browse the repository at this point in the history
Feat/sveltekit
  • Loading branch information
QPixel authored Apr 23, 2024
2 parents d4cb8ca + 6118cdd commit b4e256d
Show file tree
Hide file tree
Showing 48 changed files with 1,695 additions and 6,073 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
109 changes: 31 additions & 78 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,78 +1,31 @@
/** @type {import("eslint").Linter.Config} */
const config = {
extends: [
"eslint:recommended",
"plugin:astro/recommended",
'plugin:@typescript-eslint/recommended',

],
plugins: ['@typescript-eslint', 'import'],
env: {
es2022: true,
node: true,
browser: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
extraFileExtensions: [".astro", ".svelte"],
},
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
}
},
{
files: ["*.d.ts"],
rules: {
"@typescript-eslint/triple-slash-reference": "off",
"@typescript-eslint/consistent-type-imports": "off",
},
},
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
plugins: ['svelte', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:svelte/prettier',
'plugin:@typescript-eslint/recommended-type-checked',
],
parserOptions: {
parser: '@typescript-eslint/parser',
}
}
],
ignorePatterns: [
"**/*.config.js",
"**/*.config.cjs",
"**/.eslintrc.cjs",
"dist",
"pnpm-lock.yaml",
],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", fixStyle: "separate-type-imports" },
],
"@typescript-eslint/no-misused-promises": [
2,
{ checksVoidReturn: { attributes: false } },
],
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
'@typescript-eslint/no-non-null-assertion': 'off',
"@typescript-eslint/triple-slash-reference": 'off',
}
}

module.exports = config
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};
34 changes: 9 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production
.env.development.local

# macOS-specific files
.DS_Store

.vercel
.env*.local

node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.wrangler
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
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 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
15 changes: 15 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
# The Womp Womp Counter
# create-svelte

This was a simple counter project to see how many times I say "Womp Womp".
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

## Stack
## Creating a project

- Astro: https://astro.build/
- Svelte: https://svelte.dev/
- TailwindCSS: https://tailwindcss.com/
- Drizzle: https://orm.drizzle.team
- Cloudflare Pages + D1 + K/V: https://cloudflare.com/
If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
```

## 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

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
24 changes: 0 additions & 24 deletions astro.config.mjs

This file was deleted.

23 changes: 12 additions & 11 deletions components.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "new-york",
"tailwind": {
"config": "tailwind.config.mjs",
"css": "src/styles/global.css",
"baseColor": "zinc"
},
"aliases": {
"utils": "$lib/utils",
"components": "$lib/components"
}
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.pcss",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
},
"typescript": true
}
100 changes: 51 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,53 @@
{
"name": "womp-womp",
"type": "module",
"version": "2.0.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "wrangler pages dev ./dist",
"astro": "astro",
"wrangler": "wrangler",
"seed:db": "wrangler d1 local-test-db --local --file=./seed.sql",
"lint": "eslint .",
"format": "prettier --write src"
},
"dependencies": {
"@astrojs/check": "^0.5.10",
"@astrojs/cloudflare": "^10.0.2",
"@astrojs/svelte": "^5.3.0",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.5.14",
"bits-ui": "^0.19.7",
"clsx": "^2.1.0",
"date-fns": "^3.6.0",
"drizzle-orm": "^0.30.6",
"svelte": "^4.2.12",
"svelte-radix": "^1.1.0",
"tailwind-merge": "^2.2.2",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.3"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240402.0",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@types/eslint": "^8.56.7",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"drizzle-kit": "^0.20.14",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^0.33.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-svelte": "^2.35.1",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-svelte": "^3.2.2",
"prettier-plugin-tailwindcss": "^0.5.13",
"typescript": "^5.4.3",
"wrangler": "^3.44.0"
}
"name": "womp-womp",
"version": "3.0.0",
"private": true,
"packageManager": "[email protected]",
"engines": {
"node": ">=20.11.1"
},
"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",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"wrangler": "wrangler",
"seed:db": "wrangler d1 local-test-db --local --file=./seed.sql"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-cloudflare": "^4.4.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"postcss": "^8.4.32",
"postcss-load-config": "^5.0.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.5.9",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.3.6",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
},
"type": "module",
"dependencies": {
"bits-ui": "^0.21.4",
"clsx": "^2.1.0",
"date-fns": "^3.6.0",
"drizzle-orm": "^0.30.9",
"tailwind-merge": "^2.3.0",
"tailwind-variants": "^0.2.1"
}
}
Loading

0 comments on commit b4e256d

Please sign in to comment.