diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index caa8d92fe..f8ad5b394 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -27,8 +27,7 @@ jobs: run: pnpm install --frozen-lockfile - name: Build - shell: bash - run: pnpm --filter "./packages/*" build + run: pnpm build:pkg - name: Publish 🚀 shell: bash diff --git a/package.json b/package.json index 49a72a0b9..92f7dc6bd 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "dev": "vite dev", "build": "rimraf dist && cross-env NODE_ENV=production vite build", "build:watch": "rimraf dist && cross-env NODE_ENV=production vite build --watch", + "build:pkg": "pnpm -r --filter='./packages/*' run build", "preview": "npm run build --watch && vite preview", "preview:dist": "vite preview", "deploy": "bash deploy.sh", @@ -96,7 +97,7 @@ "lightningcss": "^1.24.0", "lint-staged": "~15.2.2", "mockjs": "~1.1.0", - "msw": "^2.2.2", + "msw": "^2.2.3", "postcss": "~8.4.35", "postcss-html": "~1.6.0", "postcss-less": "~6.0.0", diff --git a/packages/vite-plugin-tinymce-resource/src/index.ts b/packages/vite-plugin-tinymce-resource/src/index.ts index 54f6ea2a0..8498c4306 100644 --- a/packages/vite-plugin-tinymce-resource/src/index.ts +++ b/packages/vite-plugin-tinymce-resource/src/index.ts @@ -1,10 +1,10 @@ import { cp, readFile } from 'node:fs/promises'; -import { resolve } from 'node:path'; +import { resolve, dirname } from 'node:path'; import type { PluginOption } from 'vite'; // const require = createRequire(import.meta.url); -const tinymceDir = resolve(require.resolve('tinymce'), '../'); +const tinymceDir = dirname(require.resolve('tinymce')); let outDir: string; let base: string; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d15886745..04b1d3641 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -86,7 +86,7 @@ importers: version: link:packages/components '@admin-pkg/vite-plugin-msw': specifier: workspace:^ - version: file:packages/vite-plugin-msw(msw@2.2.2) + version: file:packages/vite-plugin-msw(msw@2.2.3) '@admin-pkg/vite-plugin-tinymce-resource': specifier: workspace:^ version: link:packages/vite-plugin-tinymce-resource @@ -107,7 +107,7 @@ importers: version: 1.1.14 '@iconify/json': specifier: ^2.2.180 - version: 2.2.187 + version: 2.2.190 '@types/lodash-es': specifier: ~4.17.12 version: 4.17.12 @@ -178,8 +178,8 @@ importers: specifier: ~1.1.0 version: 1.1.0 msw: - specifier: ^2.2.2 - version: 2.2.2(typescript@5.3.3) + specifier: ^2.2.3 + version: 2.2.3(typescript@5.3.3) postcss: specifier: ~8.4.35 version: 8.4.35 @@ -2206,8 +2206,8 @@ packages: '@iconify/types': 2.0.0 dev: true - /@iconify/json@2.2.187: - resolution: {integrity: sha512-s2YGP9Nuz1x4xAQq78Y6TZFqGZ8wUO7YlOdbqjwoMgmwJPhEhUrxLs2S17im1rG5g9TzAQsYzt4vsSlgCmoKDA==} + /@iconify/json@2.2.190: + resolution: {integrity: sha512-ci0/3DQUoRNxuNC8s0rNke5JwsCzWuYfEl4BgOykx3EAWDWMvD8lCenrDiFa04mokzMwSF+jA6I1YjBRGWfyOw==} dependencies: '@iconify/types': 2.0.0 pathe: 1.1.2 @@ -8064,6 +8064,38 @@ packages: type-fest: 4.10.3 typescript: 5.3.3 yargs: 17.7.2 + dev: false + + /msw@2.2.3(typescript@5.3.3): + resolution: {integrity: sha512-84CoNCkcJ/EvY8Tv0tD/6HKVd4S5HyGowHjM5W12K8Wgryp4fikqS7IaTOceyQgP5dNedxo2icTLDXo7dkpxCg==} + engines: {node: '>=18'} + hasBin: true + requiresBuild: true + peerDependencies: + typescript: '>= 4.7.x' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@bundled-es-modules/cookie': 2.0.0 + '@bundled-es-modules/statuses': 1.0.1 + '@inquirer/confirm': 3.0.0 + '@mswjs/cookies': 1.1.0 + '@mswjs/interceptors': 0.25.16 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.4 + chalk: 4.1.2 + graphql: 16.8.1 + headers-polyfill: 4.0.2 + is-node-process: 1.2.0 + outvariant: 1.4.2 + path-to-regexp: 6.2.1 + strict-event-emitter: 0.5.1 + type-fest: 4.10.3 + typescript: 5.3.3 + yargs: 17.7.2 + dev: true /muggle-string@0.3.1: resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} @@ -11567,7 +11599,7 @@ packages: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} dev: true - file:packages/vite-plugin-msw(msw@2.2.2): + file:packages/vite-plugin-msw(msw@2.2.3): resolution: {directory: packages/vite-plugin-msw, type: directory} id: file:packages/vite-plugin-msw name: '@admin-pkg/vite-plugin-msw' @@ -11576,6 +11608,6 @@ packages: dependencies: '@mswjs/interceptors': 0.26.6 headers-polyfill: 4.0.2 - msw: 2.2.2(typescript@5.3.3) + msw: 2.2.3(typescript@5.3.3) strict-event-emitter: 0.5.1 dev: true diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index d2287c295..15c0f933a 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -24,7 +24,7 @@ export const useUserStore = defineStore('user', () => { const serverConnected = ref(true); watch(serverConnected, (val) => { - if (val) { + if (val && token.value) { initServerMsgListener(); } }); diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7f16b2719..c71dbe280 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -7,7 +7,7 @@ - +