From ff3c562ff2cab0c0727071f5a9a26fc91a7b1858 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 9 Oct 2022 14:56:33 +0800 Subject: [PATCH] refactor: rename admin to console (halo-dev/console#634) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: Ref https://github.com/halo-dev/halo/pull/2521 我们已经将 halo-admin 的命名改为了 console,所以相关命名需要同步修改。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2519 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式: 1. 需要 `pnpm install && pnpm build:packages` 2. 测试后台功能是否正常。 PS:将在此 PR 合并之后发布 `@halo-dev/console-shared` 包到 npm。 #### Does this PR introduce a user-facing change? ```release-note None ``` --- .changeset/pre.json | 2 +- index.html | 2 +- package.json | 4 ++-- packages/components/package.json | 4 ++-- packages/shared/package.json | 12 ++++++------ packages/shared/vite.config.ts | 4 ++-- pnpm-lock.yaml | 4 ++-- src/build/library-external.ts | 8 ++++---- src/composables/usePlugins.ts | 2 +- src/main.ts | 2 +- .../components/AttachmentSelectorModal.vue | 2 +- .../selector-providers/CoreSelectorProvider.vue | 2 +- .../selector-providers/UploadSelectorProvider.vue | 2 +- .../attachments/composables/use-attachment.ts | 2 +- src/modules/contents/attachments/module.ts | 2 +- src/modules/contents/comments/module.ts | 2 +- src/modules/contents/pages/FunctionalPageList.vue | 2 +- src/modules/contents/pages/layouts/PageLayout.vue | 2 +- src/modules/contents/pages/module.ts | 6 +++++- src/modules/contents/posts/module.ts | 6 +++++- src/modules/dashboard/module.ts | 2 +- src/modules/interface/menus/module.ts | 2 +- src/modules/interface/themes/layouts/ThemeLayout.vue | 2 +- src/modules/interface/themes/module.ts | 2 +- src/modules/system/plugins/layouts/PluginLayout.vue | 2 +- src/modules/system/plugins/module.ts | 6 +++++- src/modules/system/roles/module.ts | 2 +- .../system/settings/layouts/SystemSettingsLayout.vue | 2 +- src/modules/system/settings/module.ts | 2 +- .../system/users/layouts/UserProfileLayout.vue | 2 +- src/modules/system/users/module.ts | 6 +++++- src/router/menus.config.ts | 2 +- src/router/routes.config.ts | 2 +- src/setup/setupStyles.ts | 2 +- 34 files changed, 62 insertions(+), 46 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index fbcafdd61..694d1d353 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -3,7 +3,7 @@ "tag": "alpha", "initialVersions": { "@halo-dev/components": "0.0.0-alpha.0", - "@halo-dev/admin-shared": "0.0.0-alpha.0" + "@halo-dev/console-shared": "0.0.0-alpha.0" }, "changesets": [] } diff --git a/index.html b/index.html index b9abcb114..a8fdc44b5 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,7 @@ diff --git a/package.json b/package.json index 8f685ac60..183822ce6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@halo-dev/admin-next", + "name": "@halo-dev/console", "version": "0.0.0", "scripts": { "prepare": "husky install", @@ -33,7 +33,7 @@ "@formkit/inputs": "^1.0.0-beta.11", "@formkit/themes": "^1.0.0-beta.11", "@formkit/vue": "^1.0.0-beta.11", - "@halo-dev/admin-shared": "workspace:*", + "@halo-dev/console-shared": "workspace:*", "@halo-dev/api-client": "^0.0.35", "@halo-dev/components": "workspace:*", "@halo-dev/richtext-editor": "^0.0.0-alpha.7", diff --git a/packages/components/package.json b/packages/components/package.json index 529ebf40b..133b69c56 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -35,13 +35,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/halo-dev/halo-admin.git", + "url": "https://github.com/halo-dev/console.git", "directory": "packages/components" }, "bugs": { "url": "https://github.com/halo-dev/halo/issues" }, - "homepage": "https://github.com/halo-dev/halo-admin/tree/next/packages/components#readme", + "homepage": "https://github.com/halo-dev/console/tree/main/packages/components#readme", "license": "MIT", "devDependencies": { "@histoire/plugin-vue": "^0.10.7", diff --git a/packages/shared/package.json b/packages/shared/package.json index b27756915..c68e99d89 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,5 +1,5 @@ { - "name": "@halo-dev/admin-shared", + "name": "@halo-dev/console-shared", "version": "0.0.0-alpha.5", "description": "", "files": [ @@ -17,25 +17,25 @@ "name": "@halo-dev", "url": "https://github.com/halo-dev" }, - "main": "./dist/halo-admin-shared.iife.js", - "module": "./dist/halo-admin-shared.es.js", + "main": "./dist/halo-console-shared.iife.js", + "module": "./dist/halo-console-shared.es.js", "types": "./dist/index.d.ts", "exports": { ".": { "types": "./dist/index.d.ts", - "import": "./dist/halo-admin-shared.es.js" + "import": "./dist/halo-console-shared.es.js" }, "./dist/style.css": "./dist/style.css" }, "repository": { "type": "git", - "url": "https://github.com/halo-dev/halo-admin.git", + "url": "https://github.com/halo-dev/console.git", "directory": "packages/shared" }, "bugs": { "url": "https://github.com/halo-dev/halo/issues" }, - "homepage": "https://github.com/halo-dev/halo-admin/tree/next/shared/components#readme", + "homepage": "https://github.com/halo-dev/console/tree/main/packages/shared#readme", "license": "MIT", "dependencies": { "@halo-dev/components": "workspace:*" diff --git a/packages/shared/vite.config.ts b/packages/shared/vite.config.ts index a0ae3fb05..70b64146d 100644 --- a/packages/shared/vite.config.ts +++ b/packages/shared/vite.config.ts @@ -25,9 +25,9 @@ export default defineConfig({ outDir: path.resolve(__dirname, "dist"), lib: { entry: path.resolve(__dirname, "src/index.ts"), - name: "HaloAdminShared", + name: "HaloConsoleShared", formats: ["es", "iife"], - fileName: (format) => `halo-admin-shared.${format}.js`, + fileName: (format) => `halo-console-shared.${format}.js`, }, rollupOptions: { external: ["vue", "vue-router", "@halo-dev/components"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 98dceac35..ce121c790 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,9 +13,9 @@ importers: '@formkit/inputs': ^1.0.0-beta.11 '@formkit/themes': ^1.0.0-beta.11 '@formkit/vue': ^1.0.0-beta.11 - '@halo-dev/admin-shared': workspace:* '@halo-dev/api-client': ^0.0.35 '@halo-dev/components': workspace:* + '@halo-dev/console-shared': workspace:* '@halo-dev/richtext-editor': ^0.0.0-alpha.7 '@iconify-json/mdi': ^1.1.33 '@iconify-json/vscode-icons': ^1.1.14 @@ -100,9 +100,9 @@ importers: '@formkit/inputs': 1.0.0-beta.11 '@formkit/themes': 1.0.0-beta.11_tailwindcss@3.1.8 '@formkit/vue': 1.0.0-beta.11_k5hp3txgeyj6le63abiyc7wx3u - '@halo-dev/admin-shared': link:packages/shared '@halo-dev/api-client': 0.0.35 '@halo-dev/components': link:packages/components + '@halo-dev/console-shared': link:packages/shared '@halo-dev/richtext-editor': 0.0.0-alpha.7_vue@3.2.40 '@tiptap/extension-character-count': 2.0.0-beta.199 '@vueuse/components': 8.9.4_vue@3.2.40 diff --git a/src/build/library-external.ts b/src/build/library-external.ts index e702d6387..02dde28b6 100644 --- a/src/build/library-external.ts +++ b/src/build/library-external.ts @@ -63,9 +63,9 @@ export const setupLibraryExternal = ( rename: `halo-components.iife.${staticSuffix}.js`, }, { - src: "./node_modules/@halo-dev/admin-shared/dist/halo-admin-shared.iife.js", - dest: "assets/admin-shared", - rename: `halo-admin-shared.iife.${staticSuffix}.js`, + src: "./node_modules/@halo-dev/console-shared/dist/halo-console-shared.iife.js", + dest: "assets/console-shared", + rename: `halo-console-shared.iife.${staticSuffix}.js`, }, ]; @@ -73,7 +73,7 @@ export const setupLibraryExternal = ( ViteExternals({ vue: "Vue", "vue-router": "VueRouter", - "@halo-dev/shared": "HaloAdminShared", + "@halo-dev/shared": "HaloConsoleShared", "@halo-dev/components": "HaloComponents", "@vueuse/core": "VueUse", "@vueuse/components": "VueUse", diff --git a/src/composables/usePlugins.ts b/src/composables/usePlugins.ts index bb8e3203e..7c3ce7cd3 100644 --- a/src/composables/usePlugins.ts +++ b/src/composables/usePlugins.ts @@ -2,7 +2,7 @@ import { usePluginStore } from "@/stores/plugin"; import type { ExtensionPointName, ExtensionPointState, -} from "@halo-dev/admin-shared"; +} from "@halo-dev/console-shared"; import type { Plugin } from "@halo-dev/api-client"; import type { Ref } from "vue"; diff --git a/src/main.ts b/src/main.ts index 9539c0cbf..a82939e65 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,7 +7,7 @@ import type { MenuGroupType, MenuItemType, Plugin, -} from "@halo-dev/admin-shared"; +} from "@halo-dev/console-shared"; import { apiClient } from "@/utils/api-client"; import { menus, minimenus, registerMenu } from "./router/menus.config"; // setup diff --git a/src/modules/contents/attachments/components/AttachmentSelectorModal.vue b/src/modules/contents/attachments/components/AttachmentSelectorModal.vue index 5050491b9..ad99df3b1 100644 --- a/src/modules/contents/attachments/components/AttachmentSelectorModal.vue +++ b/src/modules/contents/attachments/components/AttachmentSelectorModal.vue @@ -6,7 +6,7 @@ import UploadSelectorProvider from "./selector-providers/UploadSelectorProvider. import type { AttachmentLike, AttachmentSelectorPublicState, -} from "@halo-dev/admin-shared"; +} from "@halo-dev/console-shared"; import { useExtensionPointsState } from "@/composables/usePlugins"; withDefaults( diff --git a/src/modules/contents/attachments/components/selector-providers/CoreSelectorProvider.vue b/src/modules/contents/attachments/components/selector-providers/CoreSelectorProvider.vue index 9ae389a84..e65e6ac6b 100644 --- a/src/modules/contents/attachments/components/selector-providers/CoreSelectorProvider.vue +++ b/src/modules/contents/attachments/components/selector-providers/CoreSelectorProvider.vue @@ -16,7 +16,7 @@ import { watchEffect, ref } from "vue"; import { isImage } from "@/utils/image"; import { useAttachmentControl } from "../../composables/use-attachment"; import LazyImage from "@/components/image/LazyImage.vue"; -import type { AttachmentLike } from "@halo-dev/admin-shared"; +import type { AttachmentLike } from "@halo-dev/console-shared"; import type { Attachment, Group } from "@halo-dev/api-client"; import AttachmentUploadModal from "../AttachmentUploadModal.vue"; import AttachmentFileTypeIcon from "../AttachmentFileTypeIcon.vue"; diff --git a/src/modules/contents/attachments/components/selector-providers/UploadSelectorProvider.vue b/src/modules/contents/attachments/components/selector-providers/UploadSelectorProvider.vue index cd1150a39..72ec2441c 100644 --- a/src/modules/contents/attachments/components/selector-providers/UploadSelectorProvider.vue +++ b/src/modules/contents/attachments/components/selector-providers/UploadSelectorProvider.vue @@ -7,7 +7,7 @@ import { useDialog, } from "@halo-dev/components"; -import type { AttachmentLike } from "@halo-dev/admin-shared"; +import type { AttachmentLike } from "@halo-dev/console-shared"; import { apiClient } from "@/utils/api-client"; import LazyImage from "@/components/image/LazyImage.vue"; import type { Attachment } from "@halo-dev/api-client"; diff --git a/src/modules/contents/attachments/composables/use-attachment.ts b/src/modules/contents/attachments/composables/use-attachment.ts index 12c704930..678da5f71 100644 --- a/src/modules/contents/attachments/composables/use-attachment.ts +++ b/src/modules/contents/attachments/composables/use-attachment.ts @@ -7,7 +7,7 @@ import type { } from "@halo-dev/api-client"; import type { Ref } from "vue"; import { ref, watch } from "vue"; -import type { AttachmentLike } from "@halo-dev/admin-shared"; +import type { AttachmentLike } from "@halo-dev/console-shared"; import { apiClient } from "@/utils/api-client"; import { useDialog } from "@halo-dev/components"; import type { Content, Editor } from "@halo-dev/richtext-editor"; diff --git a/src/modules/contents/attachments/module.ts b/src/modules/contents/attachments/module.ts index 961b6e730..eebdedf71 100644 --- a/src/modules/contents/attachments/module.ts +++ b/src/modules/contents/attachments/module.ts @@ -1,4 +1,4 @@ -import { BasicLayout, definePlugin } from "@halo-dev/admin-shared"; +import { BasicLayout, definePlugin } from "@halo-dev/console-shared"; import AttachmentList from "./AttachmentList.vue"; import AttachmentSelectorModal from "./components/AttachmentSelectorModal.vue"; import { IconFolder } from "@halo-dev/components"; diff --git a/src/modules/contents/comments/module.ts b/src/modules/contents/comments/module.ts index 49e41e8ea..91052e36d 100644 --- a/src/modules/contents/comments/module.ts +++ b/src/modules/contents/comments/module.ts @@ -1,4 +1,4 @@ -import { BasicLayout, definePlugin } from "@halo-dev/admin-shared"; +import { BasicLayout, definePlugin } from "@halo-dev/console-shared"; import { IconMessage } from "@halo-dev/components"; import CommentList from "./CommentList.vue"; diff --git a/src/modules/contents/pages/FunctionalPageList.vue b/src/modules/contents/pages/FunctionalPageList.vue index 75edd1d08..0a109dc07 100644 --- a/src/modules/contents/pages/FunctionalPageList.vue +++ b/src/modules/contents/pages/FunctionalPageList.vue @@ -8,7 +8,7 @@ import { VEntity, VEntityField, } from "@halo-dev/components"; -import type { PagesPublicState } from "@halo-dev/admin-shared"; +import type { PagesPublicState } from "@halo-dev/console-shared"; import { useExtensionPointsState } from "@/composables/usePlugins"; const pagesPublicState = ref({ diff --git a/src/modules/contents/pages/layouts/PageLayout.vue b/src/modules/contents/pages/layouts/PageLayout.vue index 091980ada..dbc3cc53a 100644 --- a/src/modules/contents/pages/layouts/PageLayout.vue +++ b/src/modules/contents/pages/layouts/PageLayout.vue @@ -8,7 +8,7 @@ import { IconPages, VButton, } from "@halo-dev/components"; -import { BasicLayout } from "@halo-dev/admin-shared"; +import { BasicLayout } from "@halo-dev/console-shared"; import { useRoute, useRouter } from "vue-router"; const route = useRoute(); diff --git a/src/modules/contents/pages/module.ts b/src/modules/contents/pages/module.ts index efde88e7b..dc76b0e1e 100644 --- a/src/modules/contents/pages/module.ts +++ b/src/modules/contents/pages/module.ts @@ -1,4 +1,8 @@ -import { BasicLayout, BlankLayout, definePlugin } from "@halo-dev/admin-shared"; +import { + BasicLayout, + BlankLayout, + definePlugin, +} from "@halo-dev/console-shared"; import PageLayout from "./layouts/PageLayout.vue"; import FunctionalPageList from "./FunctionalPageList.vue"; import SinglePageList from "./SinglePageList.vue"; diff --git a/src/modules/contents/posts/module.ts b/src/modules/contents/posts/module.ts index dd0696a17..11773b021 100644 --- a/src/modules/contents/posts/module.ts +++ b/src/modules/contents/posts/module.ts @@ -1,4 +1,8 @@ -import { BasicLayout, BlankLayout, definePlugin } from "@halo-dev/admin-shared"; +import { + BasicLayout, + BlankLayout, + definePlugin, +} from "@halo-dev/console-shared"; import { IconBookRead } from "@halo-dev/components"; import PostList from "./PostList.vue"; import PostEditor from "./PostEditor.vue"; diff --git a/src/modules/dashboard/module.ts b/src/modules/dashboard/module.ts index 3cdec08d7..87e45875a 100644 --- a/src/modules/dashboard/module.ts +++ b/src/modules/dashboard/module.ts @@ -1,4 +1,4 @@ -import { BasicLayout, definePlugin } from "@halo-dev/admin-shared"; +import { BasicLayout, definePlugin } from "@halo-dev/console-shared"; import Dashboard from "./Dashboard.vue"; import { IconDashboard } from "@halo-dev/components"; diff --git a/src/modules/interface/menus/module.ts b/src/modules/interface/menus/module.ts index 612d23fa1..4e1b54b85 100644 --- a/src/modules/interface/menus/module.ts +++ b/src/modules/interface/menus/module.ts @@ -1,4 +1,4 @@ -import { BasicLayout, definePlugin } from "@halo-dev/admin-shared"; +import { BasicLayout, definePlugin } from "@halo-dev/console-shared"; import Menus from "./Menus.vue"; import { IconListSettings } from "@halo-dev/components"; diff --git a/src/modules/interface/themes/layouts/ThemeLayout.vue b/src/modules/interface/themes/layouts/ThemeLayout.vue index 5831b9c89..e42dd3226 100644 --- a/src/modules/interface/themes/layouts/ThemeLayout.vue +++ b/src/modules/interface/themes/layouts/ThemeLayout.vue @@ -10,7 +10,7 @@ import cloneDeep from "lodash.clonedeep"; // hooks import { useThemeLifeCycle } from "../composables/use-theme"; // types -import { BasicLayout } from "@halo-dev/admin-shared"; +import { BasicLayout } from "@halo-dev/console-shared"; import { useSettingForm } from "@/composables/use-setting-form"; // components diff --git a/src/modules/interface/themes/module.ts b/src/modules/interface/themes/module.ts index c6d5f4833..7bcc598a2 100644 --- a/src/modules/interface/themes/module.ts +++ b/src/modules/interface/themes/module.ts @@ -1,4 +1,4 @@ -import { BlankLayout, definePlugin } from "@halo-dev/admin-shared"; +import { BlankLayout, definePlugin } from "@halo-dev/console-shared"; import ThemeLayout from "./layouts/ThemeLayout.vue"; import ThemeDetail from "./ThemeDetail.vue"; import ThemeSetting from "./ThemeSetting.vue"; diff --git a/src/modules/system/plugins/layouts/PluginLayout.vue b/src/modules/system/plugins/layouts/PluginLayout.vue index aaa1b9c72..6d34c0823 100644 --- a/src/modules/system/plugins/layouts/PluginLayout.vue +++ b/src/modules/system/plugins/layouts/PluginLayout.vue @@ -12,7 +12,7 @@ import { useSettingForm } from "@/composables/use-setting-form"; // components import { VButton, VCard, VPageHeader, VTabbar } from "@halo-dev/components"; -import { BasicLayout } from "@halo-dev/admin-shared"; +import { BasicLayout } from "@halo-dev/console-shared"; // types import type { Ref } from "vue"; diff --git a/src/modules/system/plugins/module.ts b/src/modules/system/plugins/module.ts index 147aa9614..9b8b85630 100644 --- a/src/modules/system/plugins/module.ts +++ b/src/modules/system/plugins/module.ts @@ -1,4 +1,8 @@ -import { BasicLayout, BlankLayout, definePlugin } from "@halo-dev/admin-shared"; +import { + BasicLayout, + BlankLayout, + definePlugin, +} from "@halo-dev/console-shared"; import PluginLayout from "./layouts/PluginLayout.vue"; import PluginList from "./PluginList.vue"; import PluginSetting from "./PluginSetting.vue"; diff --git a/src/modules/system/roles/module.ts b/src/modules/system/roles/module.ts index 6309bc2a1..b809c1a45 100644 --- a/src/modules/system/roles/module.ts +++ b/src/modules/system/roles/module.ts @@ -1,4 +1,4 @@ -import { BasicLayout, definePlugin } from "@halo-dev/admin-shared"; +import { BasicLayout, definePlugin } from "@halo-dev/console-shared"; import RoleList from "./RoleList.vue"; import RoleDetail from "./RoleDetail.vue"; diff --git a/src/modules/system/settings/layouts/SystemSettingsLayout.vue b/src/modules/system/settings/layouts/SystemSettingsLayout.vue index 97ab60b76..7a7a03193 100644 --- a/src/modules/system/settings/layouts/SystemSettingsLayout.vue +++ b/src/modules/system/settings/layouts/SystemSettingsLayout.vue @@ -5,7 +5,7 @@ import { ref, watch } from "vue"; import { useRoute, useRouter } from "vue-router"; // types -import { BasicLayout } from "@halo-dev/admin-shared"; +import { BasicLayout } from "@halo-dev/console-shared"; import { useSettingForm } from "@/composables/use-setting-form"; // components diff --git a/src/modules/system/settings/module.ts b/src/modules/system/settings/module.ts index 93e5c5d17..3c09efea1 100644 --- a/src/modules/system/settings/module.ts +++ b/src/modules/system/settings/module.ts @@ -1,4 +1,4 @@ -import { definePlugin } from "@halo-dev/admin-shared"; +import { definePlugin } from "@halo-dev/console-shared"; import SystemSettingsLayout from "./layouts/SystemSettingsLayout.vue"; import SystemSetting from "./SystemSetting.vue"; import { IconSettings } from "@halo-dev/components"; diff --git a/src/modules/system/users/layouts/UserProfileLayout.vue b/src/modules/system/users/layouts/UserProfileLayout.vue index ab3cac054..62f966f81 100644 --- a/src/modules/system/users/layouts/UserProfileLayout.vue +++ b/src/modules/system/users/layouts/UserProfileLayout.vue @@ -1,5 +1,5 @@