Spaces:
Sleeping
Sleeping
Commit
·
c95db22
0
Parent(s):
init
Browse files- .eslintignore +13 -0
- .eslintrc.cjs +30 -0
- .gitignore +10 -0
- .npmrc +1 -0
- .prettierignore +13 -0
- .prettierrc +9 -0
- Dockerfile +12 -0
- README.md +49 -0
- package-lock.json +0 -0
- package.json +35 -0
- src/app.d.ts +12 -0
- src/app.html +12 -0
- src/lib/index.ts +1 -0
- src/lib/supabaseClient.ts +6 -0
- src/routes/+page.svelte +9 -0
- src/routes/+page.ts +8 -0
- static/favicon.png +0 -0
- svelte.config.js +18 -0
- tsconfig.json +17 -0
- vite.config.ts +6 -0
.eslintignore
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
node_modules
|
3 |
+
/build
|
4 |
+
/.svelte-kit
|
5 |
+
/package
|
6 |
+
.env
|
7 |
+
.env.*
|
8 |
+
!.env.example
|
9 |
+
|
10 |
+
# Ignore files for PNPM, NPM and YARN
|
11 |
+
pnpm-lock.yaml
|
12 |
+
package-lock.json
|
13 |
+
yarn.lock
|
.eslintrc.cjs
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = {
|
2 |
+
root: true,
|
3 |
+
extends: [
|
4 |
+
'eslint:recommended',
|
5 |
+
'plugin:@typescript-eslint/recommended',
|
6 |
+
'plugin:svelte/recommended',
|
7 |
+
'prettier'
|
8 |
+
],
|
9 |
+
parser: '@typescript-eslint/parser',
|
10 |
+
plugins: ['@typescript-eslint'],
|
11 |
+
parserOptions: {
|
12 |
+
sourceType: 'module',
|
13 |
+
ecmaVersion: 2020,
|
14 |
+
extraFileExtensions: ['.svelte']
|
15 |
+
},
|
16 |
+
env: {
|
17 |
+
browser: true,
|
18 |
+
es2017: true,
|
19 |
+
node: true
|
20 |
+
},
|
21 |
+
overrides: [
|
22 |
+
{
|
23 |
+
files: ['*.svelte'],
|
24 |
+
parser: 'svelte-eslint-parser',
|
25 |
+
parserOptions: {
|
26 |
+
parser: '@typescript-eslint/parser'
|
27 |
+
}
|
28 |
+
}
|
29 |
+
]
|
30 |
+
};
|
.gitignore
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
node_modules
|
3 |
+
/build
|
4 |
+
/.svelte-kit
|
5 |
+
/package
|
6 |
+
.env
|
7 |
+
.env.*
|
8 |
+
!.env.example
|
9 |
+
vite.config.js.timestamp-*
|
10 |
+
vite.config.ts.timestamp-*
|
.npmrc
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
engine-strict=true
|
.prettierignore
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
node_modules
|
3 |
+
/build
|
4 |
+
/.svelte-kit
|
5 |
+
/package
|
6 |
+
.env
|
7 |
+
.env.*
|
8 |
+
!.env.example
|
9 |
+
|
10 |
+
# Ignore files for PNPM, NPM and YARN
|
11 |
+
pnpm-lock.yaml
|
12 |
+
package-lock.json
|
13 |
+
yarn.lock
|
.prettierrc
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"useTabs": true,
|
3 |
+
"singleQuote": true,
|
4 |
+
"trailingComma": "none",
|
5 |
+
"printWidth": 100,
|
6 |
+
"plugins": ["prettier-plugin-svelte"],
|
7 |
+
"pluginSearchDirs": ["."],
|
8 |
+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
9 |
+
}
|
Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:18
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
COPY package.json ./
|
5 |
+
RUN npm install
|
6 |
+
|
7 |
+
COPY . .
|
8 |
+
RUN npm run build
|
9 |
+
|
10 |
+
CMD ["node", "build"]
|
11 |
+
|
12 |
+
EXPOSE 3000
|
README.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Sveltekit Supabase
|
3 |
+
emoji: 🐨
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: yellow
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
license: mit
|
9 |
+
app_port: 3000
|
10 |
+
---
|
11 |
+
|
12 |
+
# create-svelte
|
13 |
+
|
14 |
+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
|
15 |
+
|
16 |
+
## Creating a project
|
17 |
+
|
18 |
+
If you're seeing this, you've probably already done this step. Congrats!
|
19 |
+
|
20 |
+
```bash
|
21 |
+
# create a new project in the current directory
|
22 |
+
npm create svelte@latest
|
23 |
+
|
24 |
+
# create a new project in my-app
|
25 |
+
npm create svelte@latest my-app
|
26 |
+
```
|
27 |
+
|
28 |
+
## Developing
|
29 |
+
|
30 |
+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
31 |
+
|
32 |
+
```bash
|
33 |
+
npm run dev
|
34 |
+
|
35 |
+
# or start the server and open the app in a new browser tab
|
36 |
+
npm run dev -- --open
|
37 |
+
```
|
38 |
+
|
39 |
+
## Building
|
40 |
+
|
41 |
+
To create a production version of your app:
|
42 |
+
|
43 |
+
```bash
|
44 |
+
npm run build
|
45 |
+
```
|
46 |
+
|
47 |
+
You can preview the production build with `npm run preview`.
|
48 |
+
|
49 |
+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
package-lock.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
package.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "sveltekit-supabase",
|
3 |
+
"version": "0.0.1",
|
4 |
+
"private": true,
|
5 |
+
"scripts": {
|
6 |
+
"dev": "vite dev",
|
7 |
+
"build": "vite build",
|
8 |
+
"preview": "vite preview",
|
9 |
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
10 |
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
11 |
+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
12 |
+
"format": "prettier --plugin-search-dir . --write ."
|
13 |
+
},
|
14 |
+
"devDependencies": {
|
15 |
+
"@sveltejs/adapter-auto": "^2.0.0",
|
16 |
+
"@sveltejs/adapter-node": "^1.3.1",
|
17 |
+
"@sveltejs/kit": "^1.20.4",
|
18 |
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
19 |
+
"@typescript-eslint/parser": "^6.0.0",
|
20 |
+
"eslint": "^8.28.0",
|
21 |
+
"eslint-config-prettier": "^8.5.0",
|
22 |
+
"eslint-plugin-svelte": "^2.30.0",
|
23 |
+
"prettier": "^2.8.0",
|
24 |
+
"prettier-plugin-svelte": "^2.10.1",
|
25 |
+
"svelte": "^4.0.5",
|
26 |
+
"svelte-check": "^3.4.3",
|
27 |
+
"tslib": "^2.4.1",
|
28 |
+
"typescript": "^5.0.0",
|
29 |
+
"vite": "^4.4.2"
|
30 |
+
},
|
31 |
+
"type": "module",
|
32 |
+
"dependencies": {
|
33 |
+
"@supabase/supabase-js": "^2.38.4"
|
34 |
+
}
|
35 |
+
}
|
src/app.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// See https://kit.svelte.dev/docs/types#app
|
2 |
+
// for information about these interfaces
|
3 |
+
declare global {
|
4 |
+
namespace App {
|
5 |
+
// interface Error {}
|
6 |
+
// interface Locals {}
|
7 |
+
// interface PageData {}
|
8 |
+
// interface Platform {}
|
9 |
+
}
|
10 |
+
}
|
11 |
+
|
12 |
+
export {};
|
src/app.html
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
7 |
+
%sveltekit.head%
|
8 |
+
</head>
|
9 |
+
<body data-sveltekit-preload-data="hover">
|
10 |
+
<div style="display: contents">%sveltekit.body%</div>
|
11 |
+
</body>
|
12 |
+
</html>
|
src/lib/index.ts
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
// place files you want to import through the `$lib` alias in this folder.
|
src/lib/supabaseClient.ts
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { createClient } from '@supabase/supabase-js';
|
2 |
+
|
3 |
+
export const supabase = createClient(
|
4 |
+
'https://gqofcnmefucmstcnqira.supabase.co',
|
5 |
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyMzE0OTQ1NywiZXhwIjoxOTM4NzI1NDU3fQ.fzdMiMmofndpry46hbmuu7jLPj8HcBlSu0BWsOGirII'
|
6 |
+
);
|
src/routes/+page.svelte
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script>
|
2 |
+
export let data;
|
3 |
+
</script>
|
4 |
+
|
5 |
+
<ul>
|
6 |
+
{#each data.countries as country}
|
7 |
+
<li>{country.name}</li>
|
8 |
+
{/each}
|
9 |
+
</ul>
|
src/routes/+page.ts
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { supabase } from '$lib/supabaseClient';
|
2 |
+
|
3 |
+
export async function load() {
|
4 |
+
const { data } = await supabase.from('countries').select();
|
5 |
+
return {
|
6 |
+
countries: data ?? []
|
7 |
+
};
|
8 |
+
}
|
static/favicon.png
ADDED
![]() |
svelte.config.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import adapter from '@sveltejs/adapter-node';
|
2 |
+
import { vitePreprocess } from '@sveltejs/kit/vite';
|
3 |
+
|
4 |
+
/** @type {import('@sveltejs/kit').Config} */
|
5 |
+
const config = {
|
6 |
+
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
7 |
+
// for more information about preprocessors
|
8 |
+
preprocess: vitePreprocess(),
|
9 |
+
|
10 |
+
kit: {
|
11 |
+
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
12 |
+
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
13 |
+
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
14 |
+
adapter: adapter()
|
15 |
+
}
|
16 |
+
};
|
17 |
+
|
18 |
+
export default config;
|
tsconfig.json
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"extends": "./.svelte-kit/tsconfig.json",
|
3 |
+
"compilerOptions": {
|
4 |
+
"allowJs": true,
|
5 |
+
"checkJs": true,
|
6 |
+
"esModuleInterop": true,
|
7 |
+
"forceConsistentCasingInFileNames": true,
|
8 |
+
"resolveJsonModule": true,
|
9 |
+
"skipLibCheck": true,
|
10 |
+
"sourceMap": true,
|
11 |
+
"strict": true
|
12 |
+
}
|
13 |
+
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
14 |
+
//
|
15 |
+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
16 |
+
// from the referenced tsconfig.json - TypeScript does not merge them in
|
17 |
+
}
|
vite.config.ts
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { sveltekit } from '@sveltejs/kit/vite';
|
2 |
+
import { defineConfig } from 'vite';
|
3 |
+
|
4 |
+
export default defineConfig({
|
5 |
+
plugins: [sveltekit()]
|
6 |
+
});
|