From c9613ad88c9685871cb00c723c9de119b969dab8 Mon Sep 17 00:00:00 2001 From: mnenie <121057011+mneniee@users.noreply.github.com> Date: Sat, 28 Dec 2024 23:31:21 +0300 Subject: [PATCH 1/7] feat: add bundle analyzer --- core/client/package.json | 2 ++ core/client/vite.config.ts | 6 ++++++ pnpm-lock.yaml | 12 ++++++++++++ 3 files changed, 20 insertions(+) diff --git a/core/client/package.json b/core/client/package.json index 137a8a96..a6bfed18 100644 --- a/core/client/package.json +++ b/core/client/package.json @@ -9,6 +9,7 @@ "preview": "vite preview", "test:unit": "vitest", "build-only": "vite build", + "debug:build": "NODE_OPTIONS='--inspect-brk' pnpm run build", "type-check": "vue-tsc --build --force", "lint": "eslint . --fix", "stylelint": "npx stylelint **/*.scss --fix", @@ -84,6 +85,7 @@ "lint-staged": "^15.2.7", "npm-run-all2": "^6.2.0", "prettier": "^3.2.5", + "sonda": "0.7.0", "storybook": "^8.1.10", "stylelint": "^16.6.1", "stylelint-config-standard-scss": "^13.1.0", diff --git a/core/client/vite.config.ts b/core/client/vite.config.ts index 8b04a399..917d0341 100644 --- a/core/client/vite.config.ts +++ b/core/client/vite.config.ts @@ -6,6 +6,7 @@ import UnpluginVueRouterExtend from 'unplugin-vue-router-extend/vite' import UnpluginVueRouter from 'unplugin-vue-router/vite' import { defineConfig } from 'vite' import vueDevTools from 'vite-plugin-vue-devtools' +// import Sonda from 'sonda/vite' import type { TreeNode } from 'unplugin-vue-router' const routeMap = new Map() @@ -27,6 +28,7 @@ export default defineConfig({ }), vueDevTools(), UnoCSS(), + // Sonda(), vue(), ], resolve: { @@ -34,6 +36,10 @@ export default defineConfig({ '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, + build: { + // only with sonda active + // sourcemap: true, + }, css: { preprocessorOptions: { scss: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 243d839b..b2c2623f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -219,6 +219,9 @@ importers: prettier: specifier: ^3.2.5 version: 3.4.1 + sonda: + specifier: 0.7.0 + version: 0.7.0 storybook: specifier: ^8.1.10 version: 8.4.6(prettier@3.4.1) @@ -4255,6 +4258,9 @@ packages: resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} engines: {node: '>=18'} + sonda@0.7.0: + resolution: {integrity: sha512-JKdTOWEbQGB4EbBfl77uOpG2/PHviIj8/Mum8DXVKEHZZQaO+pg/eX4TOSY3RCKSD3vmalt777Xf3JcmjG16Bg==} + sortablejs@1.14.0: resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==} @@ -9383,6 +9389,12 @@ snapshots: ansi-styles: 6.2.1 is-fullwidth-code-point: 5.0.0 + sonda@0.7.0: + dependencies: + '@ampproject/remapping': 2.3.0 + '@jridgewell/sourcemap-codec': 1.5.0 + open: 10.1.0 + sortablejs@1.14.0: {} source-map-js@1.2.1: {} From 62d362147aba3d81a361865b4575a173f52e665c Mon Sep 17 00:00:00 2001 From: mnenie <121057011+mneniee@users.noreply.github.com> Date: Sun, 29 Dec 2024 22:32:10 +0300 Subject: [PATCH 2/7] feat: add workspace popover --- core/client/src/app/providers/router/index.ts | 6 +- core/client/src/entities/workspace/index.ts | 1 + .../src/entities/workspace/model/index.ts | 1 + .../workspace/model/workspace.store.ts | 27 ++++++ .../src/features/filter/ui/SearchFilter.vue | 6 +- core/client/src/shared/ui/index.ts | 1 + .../src/shared/ui/popover/UiPopover.vue | 15 +++ .../shared/ui/popover/UiPopoverContent.vue | 48 ++++++++++ .../shared/ui/popover/UiPopoverTrigger.vue | 11 +++ core/client/src/shared/ui/popover/index.ts | 4 + .../src/widgets/dialogs/ui/HotkeysDialog.vue | 14 +-- .../src/widgets/dialogs/ui/ShareDialog.vue | 14 +-- .../widgets/layout/header/ui/HeaderMain.vue | 12 ++- .../widgets/layout/sidebar/ui/InfoMenu.vue | 7 +- .../layout/sidebar/ui/IntegrationItems.vue | 4 +- .../layout/sidebar/ui/ProjectsList.vue | 4 +- .../widgets/layout/sidebar/ui/WorkSpace.vue | 2 +- .../layout/sidebar/ui/WorkSpaceChooser.vue | 13 ++- .../__snapshots__/WorkSpace.spec.ts.snap | 2 +- core/client/src/widgets/workspace/index.ts | 1 + .../widgets/workspace/ui/WorkspaceMenu.vue | 93 +++++++++++++++++++ core/client/src/widgets/workspace/ui/index.ts | 1 + 22 files changed, 252 insertions(+), 35 deletions(-) create mode 100644 core/client/src/entities/workspace/index.ts create mode 100644 core/client/src/entities/workspace/model/index.ts create mode 100644 core/client/src/entities/workspace/model/workspace.store.ts create mode 100644 core/client/src/shared/ui/popover/UiPopover.vue create mode 100644 core/client/src/shared/ui/popover/UiPopoverContent.vue create mode 100644 core/client/src/shared/ui/popover/UiPopoverTrigger.vue create mode 100644 core/client/src/shared/ui/popover/index.ts create mode 100644 core/client/src/widgets/workspace/index.ts create mode 100644 core/client/src/widgets/workspace/ui/WorkspaceMenu.vue create mode 100644 core/client/src/widgets/workspace/ui/index.ts diff --git a/core/client/src/app/providers/router/index.ts b/core/client/src/app/providers/router/index.ts index 94f1fe4d..6798d93b 100644 --- a/core/client/src/app/providers/router/index.ts +++ b/core/client/src/app/providers/router/index.ts @@ -10,9 +10,9 @@ export const router = createRouter({ router.beforeEach((to, from) => { // Needs to add guard auth logic in router - if (to.meta.requiresAuth === true) { - return router.push({ name: 'sign-in' }) - } + // if (to.meta.requiresAuth === true) { + // return router.push({ name: 'sign-in' }) + // } }) router.beforeEach(layoutResolverMiddleware) diff --git a/core/client/src/entities/workspace/index.ts b/core/client/src/entities/workspace/index.ts new file mode 100644 index 00000000..116e6686 --- /dev/null +++ b/core/client/src/entities/workspace/index.ts @@ -0,0 +1 @@ +export * from './model' diff --git a/core/client/src/entities/workspace/model/index.ts b/core/client/src/entities/workspace/model/index.ts new file mode 100644 index 00000000..5f9ee99b --- /dev/null +++ b/core/client/src/entities/workspace/model/index.ts @@ -0,0 +1 @@ +export * from './workspace.store' diff --git a/core/client/src/entities/workspace/model/workspace.store.ts b/core/client/src/entities/workspace/model/workspace.store.ts new file mode 100644 index 00000000..27aa80ce --- /dev/null +++ b/core/client/src/entities/workspace/model/workspace.store.ts @@ -0,0 +1,27 @@ +import { ref } from 'vue' +import { defineStore } from 'pinia' +import type { User } from '@/entities/user' + +interface BaseTestWorkspace { + _id: string + name: string + img: string | Blob + link: string + status: 'active' | 'archive' + members: User[] +} + +export const useWorkspaceStore = defineStore('workspace', () => { + const workspace = ref({ + _id: '0', + name: 'Example.io', + img: 'https://avatars.githubusercontent.com/u/185750893?s=100&v=4', + link: 'https://jenda-app-mnenie.com/example.io', + status: 'active', + members: [], + } as BaseTestWorkspace) + + return { + workspace, + } +}) diff --git a/core/client/src/features/filter/ui/SearchFilter.vue b/core/client/src/features/filter/ui/SearchFilter.vue index a80daff5..a3e7da7f 100644 --- a/core/client/src/features/filter/ui/SearchFilter.vue +++ b/core/client/src/features/filter/ui/SearchFilter.vue @@ -46,11 +46,11 @@ const [DefineTemplate, ReuseTemplate] = createReusableTemplate() >
+import { PopoverRoot, useForwardPropsEmits } from 'radix-vue' +import type { PopoverRootEmits, PopoverRootProps } from 'radix-vue' + +const props = defineProps() +const emits = defineEmits() + +const forwarded = useForwardPropsEmits(props, emits) + + + diff --git a/core/client/src/shared/ui/popover/UiPopoverContent.vue b/core/client/src/shared/ui/popover/UiPopoverContent.vue new file mode 100644 index 00000000..3f52e161 --- /dev/null +++ b/core/client/src/shared/ui/popover/UiPopoverContent.vue @@ -0,0 +1,48 @@ + + + diff --git a/core/client/src/shared/ui/popover/UiPopoverTrigger.vue b/core/client/src/shared/ui/popover/UiPopoverTrigger.vue new file mode 100644 index 00000000..22f4772a --- /dev/null +++ b/core/client/src/shared/ui/popover/UiPopoverTrigger.vue @@ -0,0 +1,11 @@ + + + diff --git a/core/client/src/shared/ui/popover/index.ts b/core/client/src/shared/ui/popover/index.ts new file mode 100644 index 00000000..c9459bf9 --- /dev/null +++ b/core/client/src/shared/ui/popover/index.ts @@ -0,0 +1,4 @@ +export { default as UiPopover } from './UiPopover.vue' +export { default as UiPopoverContent } from './UiPopoverContent.vue' +export { default as UiPopoverTrigger } from './UiPopoverTrigger.vue' +export { PopoverAnchor } from 'radix-vue' diff --git a/core/client/src/widgets/dialogs/ui/HotkeysDialog.vue b/core/client/src/widgets/dialogs/ui/HotkeysDialog.vue index f69a619b..45ced5ce 100644 --- a/core/client/src/widgets/dialogs/ui/HotkeysDialog.vue +++ b/core/client/src/widgets/dialogs/ui/HotkeysDialog.vue @@ -20,16 +20,18 @@ const badges = [ { system: 'cmd/ctrl', key: 'X' }, ] as const +const model = defineModel('open') + const [DefineTemplate, ReuseTemplate] = createReusableTemplate()