From 329e1286fae61ca870c6f2ba4702d8dac73c364b Mon Sep 17 00:00:00 2001 From: Hyomin Koo Date: Sat, 16 Sep 2023 10:04:57 +0000 Subject: [PATCH 01/14] feat(icons): add `Code` icon --- packages/client/src/icons/Code.svelte | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/client/src/icons/Code.svelte diff --git a/packages/client/src/icons/Code.svelte b/packages/client/src/icons/Code.svelte new file mode 100644 index 00000000..2df41d13 --- /dev/null +++ b/packages/client/src/icons/Code.svelte @@ -0,0 +1,34 @@ + + + + + From c75ae68e33ff3ce186374f7a1d6214b5d3eeec24 Mon Sep 17 00:00:00 2001 From: Hyomin Koo Date: Sun, 17 Sep 2023 01:24:58 +0000 Subject: [PATCH 02/14] fix(client/icons): make path fill follows currentColor --- packages/client/src/icons/Code.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/icons/Code.svelte b/packages/client/src/icons/Code.svelte index 2df41d13..f42f5c0c 100644 --- a/packages/client/src/icons/Code.svelte +++ b/packages/client/src/icons/Code.svelte @@ -30,5 +30,5 @@ {style} {id} {...attributes}> - + From c8e6fd2314c24e43026d81d6b768e1074eb49be5 Mon Sep 17 00:00:00 2001 From: Hyomin Koo Date: Sun, 17 Sep 2023 01:25:24 +0000 Subject: [PATCH 03/14] feat(client/icons): add icons - `DocumentArrowRight` - `TextGrammarCheckmark` --- .../src/icons/DocumentArrowRight.svelte | 34 +++++++++++++++++++ .../src/icons/TextGrammarCheckmark.svelte | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 packages/client/src/icons/DocumentArrowRight.svelte create mode 100644 packages/client/src/icons/TextGrammarCheckmark.svelte diff --git a/packages/client/src/icons/DocumentArrowRight.svelte b/packages/client/src/icons/DocumentArrowRight.svelte new file mode 100644 index 00000000..6aa4dc0f --- /dev/null +++ b/packages/client/src/icons/DocumentArrowRight.svelte @@ -0,0 +1,34 @@ + + + + + diff --git a/packages/client/src/icons/TextGrammarCheckmark.svelte b/packages/client/src/icons/TextGrammarCheckmark.svelte new file mode 100644 index 00000000..522d4ad3 --- /dev/null +++ b/packages/client/src/icons/TextGrammarCheckmark.svelte @@ -0,0 +1,34 @@ + + + + + From 2241df560e30b9644c8d7d572e070543a8801522 Mon Sep 17 00:00:00 2001 From: Hyomin Koo Date: Sun, 17 Sep 2023 04:55:37 +0000 Subject: [PATCH 04/14] feat(client): import with `src/*` path --- packages/client/tsconfig.json | 3 ++- packages/client/vite.config.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 97c35aff..2f4e3f97 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -30,7 +30,8 @@ "sourceMap": true, "paths": { "$lib": ["src/lib"], - "$lib/*": ["src/lib/*"] + "$lib/*": ["src/lib/*"], + "src/*": ["src/*"] } }, "include": [ diff --git a/packages/client/vite.config.js b/packages/client/vite.config.js index 779b1d8a..5660b3ed 100644 --- a/packages/client/vite.config.js +++ b/packages/client/vite.config.js @@ -1,9 +1,15 @@ // eslint-disable-next-line import/no-unresolved import { sveltekit } from '@sveltejs/kit/vite'; +import path from 'path'; /** @type {import('vite').UserConfig} */ const config = { plugins: [sveltekit()], + resolve: { + alias: { + src: path.resolve('src/'), + }, + } }; export default config; From ae5588ea3811502a3eb31b28574f7747b11abb0d Mon Sep 17 00:00:00 2001 From: Hyomin Koo Date: Sun, 17 Sep 2023 04:55:55 +0000 Subject: [PATCH 05/14] feat(client): strict schema check for validate user input --- packages/client/src/lib/api/config.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/client/src/lib/api/config.ts b/packages/client/src/lib/api/config.ts index 7ae54706..cec407ef 100644 --- a/packages/client/src/lib/api/config.ts +++ b/packages/client/src/lib/api/config.ts @@ -13,35 +13,35 @@ import { const LockerSubsectionSchema = z.object({ department: z.string(), range: z.tuple([z.number(), z.number()]), -}); +}).strict(); const LockerSectionSchema = z.object({ subsections: z.array(LockerSubsectionSchema).default([]), disabled: z.array(z.number()).default([]), height: z.number(), -}); +}).strict(); const BuildingSchema = z.object({ id: z.string().regex(/\d{2}/), name: z.string(), lockers: z.record(z.record(LockerSectionSchema).default({})).default({}), -}); +}).strict(); export const ConfigSchema = z.object({ id: z.string().min(1), name: z.string(), activateFrom: z.optional(z.preprocess((isoDateStr: string) => new Date(isoDateStr), z.date())), activateTo: z.optional(z.preprocess((isoDateStr: string) => new Date(isoDateStr), z.date())), -}); +}).strict(); -const DepartmentConfigSchema = ConfigSchema.extend({ +export const DepartmentConfigSchema = ConfigSchema.extend({ contact: z.string().optional(), -}); +}).strict(); -const ServiceConfigSchema = ConfigSchema.extend({ +export const ServiceConfigSchema = ConfigSchema.extend({ buildings: z.record(BuildingSchema).default({}).optional(), alert: z.string().optional(), -}); +}).strict(); // const ConfigUpdateRequestSchema = z.object({ // id: z.string().min(1), From bf3d6805ecfe6e9fe0e29de539980fff52cb88e7 Mon Sep 17 00:00:00 2001 From: Hyomin Koo Date: Sun, 17 Sep 2023 04:56:20 +0000 Subject: [PATCH 06/14] feat(client): `TextArea` component --- .../src/components/atom/form/TextArea.svelte | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/client/src/components/atom/form/TextArea.svelte diff --git a/packages/client/src/components/atom/form/TextArea.svelte b/packages/client/src/components/atom/form/TextArea.svelte new file mode 100644 index 00000000..0374b740 --- /dev/null +++ b/packages/client/src/components/atom/form/TextArea.svelte @@ -0,0 +1,31 @@ + + +
+ + +