Skip to content

Commit

Permalink
replace demo uuid dep with native method
Browse files Browse the repository at this point in the history
  • Loading branch information
vhscom committed May 15, 2022
1 parent 3d34924 commit b2b348c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-llamas-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Drop external uuid dependency in favor of native functionality
1 change: 0 additions & 1 deletion packages/create-svelte/templates/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"type": "module",
"dependencies": {
"@fontsource/fira-mono": "^4.5.0",
"@lukeed/uuid": "^2.0.0",
"cookie": "^0.5.0"
}
}
4 changes: 2 additions & 2 deletions packages/create-svelte/templates/default/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { v4 as uuid } from '@lukeed/uuid';
import crypto from 'crypto';
import type { Handle } from '@sveltejs/kit';
import * as cookie from 'cookie';

/** @type {import('@sveltejs/kit').Handle} */
export const handle: Handle = async ({ event, resolve }) => {
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
event.locals.userid = cookies['userid'] || uuid();
event.locals.userid = cookies['userid'] || crypto.randomUUID();

const response = await resolve(event);

Expand Down
14 changes: 0 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2b348c

Please sign in to comment.