sveltekit-auth-example 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.eslintrc.cjs +19 -7
  2. package/.prettierignore +1 -0
  3. package/.yarn/install-state.gz +0 -0
  4. package/CHANGELOG.md +162 -100
  5. package/README.md +6 -1
  6. package/package.json +67 -67
  7. package/prettier.config.mjs +7 -6
  8. package/src/app.d.ts +31 -29
  9. package/src/app.html +8 -3
  10. package/src/hooks.server.ts +15 -15
  11. package/src/lib/focus.ts +6 -6
  12. package/src/lib/google.ts +48 -49
  13. package/src/lib/server/db.ts +7 -6
  14. package/src/lib/server/sendgrid.ts +11 -11
  15. package/src/routes/+error.svelte +1 -1
  16. package/src/routes/+layout.server.ts +5 -5
  17. package/src/routes/+layout.svelte +133 -100
  18. package/src/routes/admin/+page.server.ts +1 -1
  19. package/src/routes/admin/+page.svelte +2 -2
  20. package/src/routes/api/v1/user/+server.ts +13 -14
  21. package/src/routes/auth/[slug]/+server.ts +11 -6
  22. package/src/routes/auth/forgot/+server.ts +23 -23
  23. package/src/routes/auth/google/+server.ts +44 -45
  24. package/src/routes/auth/reset/+server.ts +1 -1
  25. package/src/routes/auth/reset/[token]/+page.svelte +117 -95
  26. package/src/routes/auth/reset/[token]/+page.ts +4 -4
  27. package/src/routes/forgot/+page.svelte +74 -63
  28. package/src/routes/info/+page.svelte +1 -1
  29. package/src/routes/login/+page.svelte +140 -120
  30. package/src/routes/profile/+page.server.ts +9 -9
  31. package/src/routes/profile/+page.svelte +142 -88
  32. package/src/routes/register/+page.server.ts +3 -2
  33. package/src/routes/register/+page.svelte +159 -104
  34. package/src/routes/teachers/+page.server.ts +5 -5
  35. package/src/routes/teachers/+page.svelte +2 -2
  36. package/src/stores.ts +1 -1
  37. package/svelte.config.js +1 -1
package/.eslintrc.cjs CHANGED
@@ -1,20 +1,32 @@
1
1
  module.exports = {
2
2
  root: true,
3
3
  parser: '@typescript-eslint/parser',
4
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5
- plugins: ['svelte3', '@typescript-eslint'],
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:svelte/recommended',
8
+ 'prettier'
9
+ ],
10
+ plugins: ['@typescript-eslint'],
6
11
  ignorePatterns: ['*.cjs'],
7
12
  overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8
- settings: {
9
- 'svelte3/typescript': () => require('typescript')
10
- },
11
13
  parserOptions: {
12
14
  sourceType: 'module',
13
- ecmaVersion: 2020
15
+ ecmaVersion: 2020,
16
+ extraFileExtensions: ['.svelte']
14
17
  },
15
18
  env: {
16
19
  browser: true,
17
20
  es2017: true,
18
21
  node: true
19
- }
22
+ },
23
+ overrides: [
24
+ {
25
+ files: ['*.svelte'],
26
+ parser: 'svelte-eslint-parser',
27
+ parserOptions: {
28
+ parser: '@typescript-eslint/parser'
29
+ }
30
+ }
31
+ ]
20
32
  }
package/.prettierignore CHANGED
@@ -1,5 +1,6 @@
1
1
  .DS_Store
2
2
  node_modules
3
+ .yarn
3
4
  /build
4
5
  /.svelte-kit
5
6
  /package
Binary file
package/CHANGELOG.md CHANGED
@@ -1,219 +1,281 @@
1
1
  # Backlog
2
- * Add password complexity checking on /register and /profile pages (only checks for length currently despite what the pages say)
3
- * fix prettier
2
+
3
+ - Add password complexity checking on /register and /profile pages (only checks for length currently despite what the pages say)
4
+
5
+ # 2.0.2
6
+ - fix prettier
4
7
 
5
8
  # 2.0.1
6
- * Bump @sveltejs/adapter-node, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte, svelte-check, vite, google-auth-library, @types/pg, @typescript-eslint/*, prettier, sass, vitest
9
+
10
+ - Bump @sveltejs/adapter-node, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte, svelte-check, vite, google-auth-library, @types/pg, @typescript-eslint/\*, prettier, sass, vitest
7
11
 
8
12
  # 2.0.0 Upgrade for SvelteKit to 2.0
9
- * Migrated to SvelteKit way of managing cookies (vs. setting headers). The latter no longer works.
10
- * Corrected AuthenticationResult.statusCode type
11
- * Removed throw from SvelteKit functions redirect and error
12
- * Bump @sendgrid/mail, node, yarn, svelte, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte-check, google-auth-library, vite, typescript, eslint, eslint-config-prettier, prettier-plugin-svelte, vitest, @types*, @typescript-eslint*, prettier
13
+
14
+ - Migrated to SvelteKit way of managing cookies (vs. setting headers). The latter no longer works.
15
+ - Corrected AuthenticationResult.statusCode type
16
+ - Removed throw from SvelteKit functions redirect and error
17
+ - Bump @sendgrid/mail, node, yarn, svelte, @sveltejs/kit, @sveltejs/vite-plugin-svelte, svelte-check, google-auth-library, vite, typescript, eslint, eslint-config-prettier, prettier-plugin-svelte, vitest, @types*, @typescript-eslint*, prettier
13
18
 
14
19
  # 1.0.59
15
- * Bump pg, sveltekit, @types*, bootstrap, eslint, google-auth-library, sass, svelte, svelte-check, tslib, typescript, vite, vitest
20
+
21
+ - Bump pg, sveltekit, @types\*, bootstrap, eslint, google-auth-library, sass, svelte, svelte-check, tslib, typescript, vite, vitest
16
22
 
17
23
  # 1.0.58
18
- * Bump pg, sveltekit, adapter-node, bootstrap, svelte, sass, jsonwebtoken, google-auth-library, vite, vitest
24
+
25
+ - Bump pg, sveltekit, adapter-node, bootstrap, svelte, sass, jsonwebtoken, google-auth-library, vite, vitest
19
26
 
20
27
  # 1.0.57
21
- * Minor bumps for pg, tslib, typescript
28
+
29
+ - Minor bumps for pg, tslib, typescript
22
30
 
23
31
  # 1.0.56
24
- * Svelte 4, minor updates for other dependencies
32
+
33
+ - Svelte 4, minor updates for other dependencies
25
34
 
26
35
  # 1.0.55
27
- * Add comment to indicate property that should be removed if ssl is turned off on the PostgreSQL server (thanks Brazos)
28
- * Update public.reset_password stored procedure to plpgsql (thanks Brazos)
36
+
37
+ - Add comment to indicate property that should be removed if ssl is turned off on the PostgreSQL server (thanks Brazos)
38
+ - Update public.reset_password stored procedure to plpgsql (thanks Brazos)
29
39
 
30
40
  # 1.0.54
31
- * Bump sveltekit, @types/pg, @typescript*, boostrap, eslint, prettier-plugin-svelte, sass, tslib, typescript, vitest
41
+
42
+ - Bump sveltekit, @types/pg, @typescript\*, boostrap, eslint, prettier-plugin-svelte, sass, tslib, typescript, vitest
32
43
 
33
44
  # 1.0.53
34
- * Fix service-worker.ts typing
35
- * Bump pg, sveltekit, svelte, vite, tslib and other devDependencies
45
+
46
+ - Fix service-worker.ts typing
47
+ - Bump pg, sveltekit, svelte, vite, tslib and other devDependencies
36
48
 
37
49
  # 1.0.52
38
- * Bump @sveltejs/kit, svelte, vite, vitest, pg, adapter-node, google-auth-library, eslint, sass, @typescript*, typescript, prettier, eslint-config-prettier, prettier-plugin-svelte, svelte-check
50
+
51
+ - Bump @sveltejs/kit, svelte, vite, vitest, pg, adapter-node, google-auth-library, eslint, sass, @typescript\*, typescript, prettier, eslint-config-prettier, prettier-plugin-svelte, svelte-check
39
52
 
40
53
  # 1.0.50
41
- * Bump @sveltejs/kit, vite, @typescript*
54
+
55
+ - Bump @sveltejs/kit, vite, @typescript\*
42
56
 
43
57
  # 1.0.50
44
- * Bump @sveltejs/kit, sass, vite
58
+
59
+ - Bump @sveltejs/kit, sass, vite
45
60
 
46
61
  # 1.0.49
47
- * Bump @sveltejs/kit, adapter-node, @typescript*, sass, vitest
62
+
63
+ - Bump @sveltejs/kit, adapter-node, @typescript\*, sass, vitest
48
64
 
49
65
  # 1.0.48
50
- * Bump node, npm, @sveltejs/kit, adapter-node, eslint, prettier
66
+
67
+ - Bump node, npm, @sveltejs/kit, adapter-node, eslint, prettier
51
68
 
52
69
  # 1.0.47
53
- * Bump @sveltejs/kit, adapter-node, @types/google.accounts, @typescript*, eslint, sass, typescript, vite, vitest
70
+
71
+ - Bump @sveltejs/kit, adapter-node, @types/google.accounts, @typescript\*, eslint, sass, typescript, vite, vitest
54
72
 
55
73
  # 1.0.46
56
- * Bump @sveltejs/kit, pg, tslib, vitest
74
+
75
+ - Bump @sveltejs/kit, pg, tslib, vitest
57
76
 
58
77
  # 1.0.45
59
- * Bump @sveltejs/kit, adapter-node, svelte-check, @typescript*, eslint, prettier, vitest, @types/jsonwebtoken
78
+
79
+ - Bump @sveltejs/kit, adapter-node, svelte-check, @typescript\*, eslint, prettier, vitest, @types/jsonwebtoken
60
80
 
61
81
  # 1.0.44
62
- * Bump @sveltejs/kit, svelte
82
+
83
+ - Bump @sveltejs/kit, svelte
63
84
 
64
85
  # 1.0.43
65
- * Bump @sveltejs/kit, svelte-check, vitest, @typescript*, prettier
86
+
87
+ - Bump @sveltejs/kit, svelte-check, vitest, @typescript\*, prettier
66
88
 
67
89
  # 1.0.42
68
- * Bump @sveltejs/kit, vite, @typescript*, eslint-config-prettier, @types/google.accounts
90
+
91
+ - Bump @sveltejs/kit, vite, @typescript\*, eslint-config-prettier, @types/google.accounts
69
92
 
70
93
  # 1.0.41
71
- * Bump @sveltejs/kit, vite, jsonwebtoken, svelte-check, sass
94
+
95
+ - Bump @sveltejs/kit, vite, jsonwebtoken, svelte-check, sass
72
96
 
73
97
  # 1.0.39
74
- * Bump Svelte, SvelteKit, adapter-node, vite, svelte-preprocess,sass, svelte-check, typescript, prettier, prettier-plugin-svelte
98
+
99
+ - Bump Svelte, SvelteKit, adapter-node, vite, svelte-preprocess,sass, svelte-check, typescript, prettier, prettier-plugin-svelte
75
100
 
76
101
  # 1.0.38
77
- * Switch from SendInBlue to Sendgrid for email
78
- * Bump SvelteKit, adapter-node, and vite
102
+
103
+ - Switch from SendInBlue to Sendgrid for email
104
+ - Bump SvelteKit, adapter-node, and vite
79
105
 
80
106
  # 1.0.37
81
- * Bump SvelteKit, svelte-check, and a few dev dependencies
107
+
108
+ - Bump SvelteKit, svelte-check, and a few dev dependencies
82
109
 
83
110
  # 1.0.36
84
- * Bump SvelteKit, adapter-node, Bootstrap, prettier
111
+
112
+ - Bump SvelteKit, adapter-node, Bootstrap, prettier
85
113
 
86
114
  # 1.0.35
87
- * Update SvelteKit, vite, Typescript
115
+
116
+ - Update SvelteKit, vite, Typescript
88
117
 
89
118
  # 1.0.34
90
- * Update SvelteKit
119
+
120
+ - Update SvelteKit
91
121
 
92
122
  # 1.0.33
93
- * Update dependencies
123
+
124
+ - Update dependencies
94
125
 
95
126
  # 1.0.32
96
- * Remove window from reference to google.accounts
97
- * Add apple-touch-icon.png
98
- * Update dependencies
99
- * Remove dead code
127
+
128
+ - Remove window from reference to google.accounts
129
+ - Add apple-touch-icon.png
130
+ - Update dependencies
131
+ - Remove dead code
100
132
 
101
133
  # 1.0.31
102
- * Cleanup
103
- * Update SvelteKit
134
+
135
+ - Cleanup
136
+ - Update SvelteKit
104
137
 
105
138
  # 1.0.30
106
- * Fixed bug where opening /login or /register would fail to render Sign in With Google button (onMount in +layout.svelte loads after children's onMount)
107
- * Fix bad path for favicon
108
- * Update dependencies
139
+
140
+ - Fixed bug where opening /login or /register would fail to render Sign in With Google button (onMount in +layout.svelte loads after children's onMount)
141
+ - Fix bad path for favicon
142
+ - Update dependencies
109
143
 
110
144
  # 1.0.29
111
- * Fixed bug in hooks.server.ts - new version of SvelteKit complains about modifying cookie after `const response = await resolve(event)` so moved it up two lines.
112
- * Update dependencies
145
+
146
+ - Fixed bug in hooks.server.ts - new version of SvelteKit complains about modifying cookie after `const response = await resolve(event)` so moved it up two lines.
147
+ - Update dependencies
113
148
 
114
149
  # 1.0.28
115
- * Update dependencies
150
+
151
+ - Update dependencies
116
152
 
117
153
  # 1.0.27
118
- * Update dependencies
154
+
155
+ - Update dependencies
119
156
 
120
157
  # 1.0.26
121
- * On the client, track whether the login session has expired and if so, clear $loginSession
122
- * Update dependencies
158
+
159
+ - On the client, track whether the login session has expired and if so, clear $loginSession
160
+ - Update dependencies
123
161
 
124
162
  # 1.0.25
125
- * Bump dependencies
126
- * Simplify Sign In With Google
163
+
164
+ - Bump dependencies
165
+ - Simplify Sign In With Google
127
166
 
128
167
  # 1.0.24
129
- * Bump dependencies
168
+
169
+ - Bump dependencies
130
170
 
131
171
  # 1.0.23
132
- * Restructured server-side libraries to $lib/server based on https://github.com/sveltejs/kit/pull/6623
133
- * General cleanup
172
+
173
+ - Restructured server-side libraries to $lib/server based on https://github.com/sveltejs/kit/pull/6623
174
+ - General cleanup
134
175
 
135
176
  # 1.0.22
136
- * Move google-auth-library and jsonwebtoken to devDependencies from dependencies and other cleanup to package.json
177
+
178
+ - Move google-auth-library and jsonwebtoken to devDependencies from dependencies and other cleanup to package.json
137
179
 
138
180
  # 1.0.21
139
- * Refactor to use $env/static/private and public, dropping dotenv dependency
140
- * Remove @types/cookie and bootstrap-icons dependencies
181
+
182
+ - Refactor to use $env/static/private and public, dropping dotenv dependency
183
+ - Remove @types/cookie and bootstrap-icons dependencies
141
184
 
142
185
  # 1.0.20
143
- * Bump dependencies
144
- * Add service-worker
145
- * Add dropdown, avatarm and user's first name to navbar once user is logged in
146
- * Refactor user session and update typing
186
+
187
+ - Bump dependencies
188
+ - Add service-worker
189
+ - Add dropdown, avatarm and user's first name to navbar once user is logged in
190
+ - Refactor user session and update typing
147
191
 
148
192
  # 1.0.19
149
- * Added SvelteKit's cookies implementation in RequestEvent
150
- * [Bug] Logout then go to http://localhost/admin gives error on auth.ts:39
193
+
194
+ - Added SvelteKit's cookies implementation in RequestEvent
195
+ - [Bug] Logout then go to http://localhost/admin gives error on auth.ts:39
151
196
 
152
197
  # 1.0.18
153
- * Bump dependencies
198
+
199
+ - Bump dependencies
154
200
 
155
201
  # 1.0.17
156
- * Bump dependencies
202
+
203
+ - Bump dependencies
157
204
 
158
205
  # 1.0.16
159
- * [Bug] Fixed LayoutServerLoad typing
206
+
207
+ - [Bug] Fixed LayoutServerLoad typing
160
208
 
161
209
  # 1.0.15
162
- * [Bug] Replaced use of Action type in +server.ts files (only works for +page.server.ts)
210
+
211
+ - [Bug] Replaced use of Action type in +server.ts files (only works for +page.server.ts)
163
212
 
164
213
  # 1.0.14
165
- * Refactor routing to be folder, not file-based - https://github.com/sveltejs/kit/discussions/5774 (file system router). More info: https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3294867
166
- * Move bootstrap SCSS import to JavaScript in +layout.svelte
167
- * Refactor as session was removed in https://github.com/sveltejs/kit/discussions/5883
214
+
215
+ - Refactor routing to be folder, not file-based - https://github.com/sveltejs/kit/discussions/5774 (file system router). More info: https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3294867
216
+ - Move bootstrap SCSS import to JavaScript in +layout.svelte
217
+ - Refactor as session was removed in https://github.com/sveltejs/kit/discussions/5883
168
218
 
169
219
  # 1.0.13
170
- * Bump dependencies
220
+
221
+ - Bump dependencies
171
222
 
172
223
  # 1.0.12
173
- * Remove unnecessary reference from app.d.ts
174
- * Remove commented lines in svelte.config.js
224
+
225
+ - Remove unnecessary reference from app.d.ts
226
+ - Remove commented lines in svelte.config.js
175
227
 
176
228
  # 1.0.10
177
- * Bump dependencies
178
- * Adjust for changes to SvelteKit
179
- * Improve typings
229
+
230
+ - Bump dependencies
231
+ - Adjust for changes to SvelteKit
232
+ - Improve typings
180
233
 
181
234
  # 1.0.9
182
- * Bump dependencies
183
- * Adjust for changes to SvelteKit with respect to vite
235
+
236
+ - Bump dependencies
237
+ - Adjust for changes to SvelteKit with respect to vite
184
238
 
185
239
  # 1.0.7
186
- * Bump dependencies and verify against latest SvelteKit
187
- * Additional changes for register PostgreSQL function
240
+
241
+ - Bump dependencies and verify against latest SvelteKit
242
+ - Additional changes for register PostgreSQL function
188
243
 
189
244
  # 1.0.5
190
- * Bump dependencies
191
- * [Fix] Flaw in register allowing user to register over top of an existing account
192
- * Additional checks of submitted data
245
+
246
+ - Bump dependencies
247
+ - [Fix] Flaw in register allowing user to register over top of an existing account
248
+ - Additional checks of submitted data
193
249
 
194
250
  # 1.0.4
195
- * Bump dependencies
251
+
252
+ - Bump dependencies
196
253
 
197
254
  # 1.0.4
198
- * [Fix] If you login with a Google account, you cannot Update the Profile (UI is looking for password and confirm password which don't make sense in this context)
199
- * Added Content Security Policy
255
+
256
+ - [Fix] If you login with a Google account, you cannot Update the Profile (UI is looking for password and confirm password which don't make sense in this context)
257
+ - Added Content Security Policy
200
258
 
201
259
  # 1.0.3
202
- * [Fix] user created or updated when password mismatches (@lxy-yz)
203
- * Updated project dependencies
204
- * Replaced Sveltestrap's Toast with native Bootstrap 5 JavaScript to avoid error with @popperjs import (lacks type=module)
205
- * Added declarations for Session and Locals for type safety
260
+
261
+ - [Fix] user created or updated when password mismatches (@lxy-yz)
262
+ - Updated project dependencies
263
+ - Replaced Sveltestrap's Toast with native Bootstrap 5 JavaScript to avoid error with @popperjs import (lacks type=module)
264
+ - Added declarations for Session and Locals for type safety
206
265
 
207
266
  # 1.0.2
208
- * [Fix] Updated endpoints and hooks to conform to SvelteKit's API changes.
209
- * Updated project dependencies
267
+
268
+ - [Fix] Updated endpoints and hooks to conform to SvelteKit's API changes.
269
+ - Updated project dependencies
210
270
 
211
271
  # 1.0.1
212
- * Switched to dotenv vs. VITE_ env values for better security
213
- * Load Sign in with Google via code instead of static template
214
- * Fix logout (didn't work if session expired)
215
- * Fix login button rendering if that's the starting page
272
+
273
+ - Switched to dotenv vs. VITE\_ env values for better security
274
+ - Load Sign in with Google via code instead of static template
275
+ - Fix logout (didn't work if session expired)
276
+ - Fix login button rendering if that's the starting page
216
277
 
217
278
  # Backlog
218
- * [Low] Add password complexity check
219
- * [Low] Add Google reCaptcha 3
279
+
280
+ - [Low] Add password complexity check
281
+ - [Low] Add Google reCaptcha 3
package/README.md CHANGED
@@ -10,6 +10,7 @@ It's a Single Page App (SPA) built with SvelteKit and a PostgreSQL database back
10
10
  The project includes a Content Security Policy (CSP) in svelte.config.js.
11
11
 
12
12
  The website supports two types of authentication:
13
+
13
14
  1. **Local accounts** via username (email) and password
14
15
  - The login form (/src/routes/login/+page.svelte) sends the login info as JSON to endpoint /auth/login
15
16
  - The endpoint passes the JSON to PostgreSQL function authenticate(json) which hashes the password and compares it to the stored hashed password in the users table. The function returns JSON containing a session ID (v4 UUID) and user object (sans password).
@@ -31,6 +32,7 @@ The website supports two types of authentication:
31
32
  The forgot password / password reset functionality uses a JWT and [**SendGrid**](https://www.sendgrid.com) to send the email. You would need to have a **SendGrid** account and set two environmental variables. Email sending is in /src/routes/auth/forgot.ts. This code could easily be replaced by nodemailer or something similar. Note: I have no affliation with **SendGrid** (used their API in another project).
32
33
 
33
34
  ## Prerequisites
35
+
34
36
  - PostgreSQL 14.10 or higher
35
37
  - Node.js 18.19.0 or higher
36
38
  - Google API client
@@ -41,6 +43,7 @@ The forgot password / password reset functionality uses a JWT and [**SendGrid**]
41
43
  Here are the steps:
42
44
 
43
45
  1. Get the project and setup the database
46
+
44
47
  ```bash
45
48
  # Clone the repo to your current directory
46
49
  git clone https://github.com/nstuyvesant/sveltekit-auth-example.git
@@ -58,6 +61,7 @@ psql -d postgres -f db_create.sql
58
61
  3. [Create a free Twilio SendGrid account](https://signup.sendgrid.com) and generate an API Key following [this documentation](https://docs.sendgrid.com/ui/account-and-settings/api-keys) and add a sender as documented [here](https://docs.sendgrid.com/ui/sending-email/senders).
59
62
 
60
63
  4. Create an **.env** file at the top level of the project with the following values (substituting your own id and PostgreSQL username and password):
64
+
61
65
  ```bash
62
66
  DATABASE_URL=postgres://user:password@localhost:5432/auth
63
67
  DOMAIN=http://localhost:3000
@@ -77,10 +81,11 @@ yarn dev -- --open
77
81
  ## Valid logins
78
82
 
79
83
  The db_create.sql script adds three users to the database with obvious roles:
84
+
80
85
  - admin@example.com password admin123
81
86
  - teacher@example.com password teacher123
82
87
  - student@example.com password student123
83
88
 
84
89
  ## My ask of you
85
90
 
86
- Please report any issues [here](https://github.com/nstuyvesant/sveltekit-auth-example/issues). [Pull requests](https://github.com/nstuyvesant/sveltekit-auth-example/pulls) are encouraged especially as SvelteKit is evolving rapidly.
91
+ Please report any issues [here](https://github.com/nstuyvesant/sveltekit-auth-example/issues). [Pull requests](https://github.com/nstuyvesant/sveltekit-auth-example/pulls) are encouraged especially as SvelteKit is evolving rapidly.
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
1
  {
2
- "name": "sveltekit-auth-example",
3
- "description": "SvelteKit Authentication Example",
4
- "version": "2.0.1",
5
- "author": "Nate Stuyvesant",
6
- "license": "https://github.com/nstuyvesant/sveltekit-auth-example/blob/master/LICENSE",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/nstuyvesant/sveltekit-auth-example.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/nstuyvesant/sveltekit-auth-example/issues"
13
- },
14
- "keywords": [
15
- "svelte",
16
- "sveltekit",
17
- "authentication",
18
- "example",
19
- "google",
20
- "postgresql"
21
- ],
22
- "scripts": {
23
- "start": "node build",
24
- "dev": "vite dev",
25
- "build": "vite build",
26
- "package": "svelte-kit package",
27
- "preview": "vite preview",
28
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
29
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
30
- "lint": "prettier --check . && eslint .",
31
- "format": "prettier --write ."
32
- },
33
- "engines": {
34
- "node": "^18.19.0"
35
- },
36
- "type": "module",
37
- "dependencies": {
38
- "@sendgrid/mail": "^8.1.0",
39
- "pg": "^8.11.3"
40
- },
41
- "devDependencies": {
42
- "@sveltejs/adapter-node": "^4.0.1",
43
- "@sveltejs/kit": "^2.5.0",
44
- "@sveltejs/vite-plugin-svelte": "^3.0.2",
45
- "@types/bootstrap": "5.2.10",
46
- "@types/google.accounts": "^0.0.14",
47
- "@types/jsonwebtoken": "^9.0.5",
48
- "@types/pg": "^8.11.0",
49
- "@typescript-eslint/eslint-plugin": "^6.19.1",
50
- "@typescript-eslint/parser": "^6.19.1",
51
- "bootstrap": "^5.3.2",
52
- "eslint": "^8.56.0",
53
- "eslint-config-prettier": "^9.1.0",
54
- "eslint-plugin-svelte3": "^4.0.0",
55
- "google-auth-library": "^9.5.0",
56
- "jsonwebtoken": "^9.0.2",
57
- "prettier": "^3.2.4",
58
- "prettier-plugin-svelte": "^3.1.2",
59
- "sass": "^1.70.0",
60
- "svelte": "^4.2.9",
61
- "svelte-check": "^3.6.3",
62
- "tslib": "^2.6.2",
63
- "typescript": "^5.3.3",
64
- "vite": "^5.0.12",
65
- "vitest": "^1.2.2"
66
- },
67
- "packageManager": "yarn@4.0.2",
68
- "prettier": "./prettier.config.mjs"
2
+ "name": "sveltekit-auth-example",
3
+ "description": "SvelteKit Authentication Example",
4
+ "version": "2.0.2",
5
+ "author": "Nate Stuyvesant",
6
+ "license": "https://github.com/nstuyvesant/sveltekit-auth-example/blob/master/LICENSE",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/nstuyvesant/sveltekit-auth-example.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/nstuyvesant/sveltekit-auth-example/issues"
13
+ },
14
+ "keywords": [
15
+ "svelte",
16
+ "sveltekit",
17
+ "authentication",
18
+ "example",
19
+ "google",
20
+ "postgresql"
21
+ ],
22
+ "scripts": {
23
+ "start": "node build",
24
+ "dev": "vite dev",
25
+ "build": "vite build",
26
+ "package": "svelte-kit package",
27
+ "preview": "vite preview",
28
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
29
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
30
+ "lint": "prettier --check . && eslint .",
31
+ "format": "prettier --write ."
32
+ },
33
+ "engines": {
34
+ "node": "^18.19.0"
35
+ },
36
+ "type": "module",
37
+ "dependencies": {
38
+ "@sendgrid/mail": "^8.1.0",
39
+ "pg": "^8.11.3"
40
+ },
41
+ "devDependencies": {
42
+ "@sveltejs/adapter-node": "^4.0.1",
43
+ "@sveltejs/kit": "^2.5.0",
44
+ "@sveltejs/vite-plugin-svelte": "^3.0.2",
45
+ "@types/bootstrap": "5.2.10",
46
+ "@types/google.accounts": "^0.0.14",
47
+ "@types/jsonwebtoken": "^9.0.5",
48
+ "@types/pg": "^8.11.0",
49
+ "@typescript-eslint/eslint-plugin": "^6.19.1",
50
+ "@typescript-eslint/parser": "^6.19.1",
51
+ "bootstrap": "^5.3.2",
52
+ "eslint": "^8.56.0",
53
+ "eslint-config-prettier": "^9.1.0",
54
+ "eslint-plugin-svelte": "^2.35.1",
55
+ "google-auth-library": "^9.5.0",
56
+ "jsonwebtoken": "^9.0.2",
57
+ "prettier": "^3.2.4",
58
+ "prettier-plugin-svelte": "^3.1.2",
59
+ "sass": "^1.70.0",
60
+ "svelte": "^4.2.9",
61
+ "svelte-check": "^3.6.3",
62
+ "tslib": "^2.6.2",
63
+ "typescript": "^5.3.3",
64
+ "vite": "^5.0.12",
65
+ "vitest": "^1.2.2"
66
+ },
67
+ "packageManager": "yarn@4.0.2",
68
+ "prettier": "./prettier.config.mjs"
69
69
  }
@@ -1,14 +1,15 @@
1
1
  export default {
2
2
  $schema: 'https://json.schemastore.org/prettierrc',
3
- plugins: ['prettier-plugin-svelte'],
4
3
  useTabs: true,
5
4
  semi: false,
6
5
  singleQuote: true,
7
6
  trailingComma: 'none',
8
7
  printWidth: 100,
9
- pluginSearchDirs: ['.'],
10
- overrides: [{
11
- files: '*.svelte',
12
- options: { parser: 'svelte' }
13
- }]
8
+ plugins: ['prettier-plugin-svelte'],
9
+ overrides: [
10
+ {
11
+ files: '*.svelte',
12
+ options: { parser: 'svelte' }
13
+ }
14
+ ]
14
15
  }