Skip to content

Commit

Permalink
fix: some type and constant sub-packaging bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklin committed Jul 3, 2024
1 parent 5081796 commit eaa05e7
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 52 deletions.
15 changes: 0 additions & 15 deletions apps/admin/autoResolver/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ declare module 'vue' {
CACharts: typeof import('@celeris/components')['CACharts']
CAIcon: typeof import('@celeris/components')['CAIcon']
NAvatar: typeof import('@celeris/ca-components')['NAvatar']
NBadge: typeof import('@celeris/ca-components')['NBadge']
NBreadcrumb: typeof import('@celeris/ca-components')['NBreadcrumb']
NBreadcrumbItem: typeof import('@celeris/ca-components')['NBreadcrumbItem']
NButton: typeof import('@celeris/ca-components')['NButton']
NCard: typeof import('@celeris/ca-components')['NCard']
NCheckbox: typeof import('@celeris/ca-components')['NCheckbox']
NCol: typeof import('@celeris/ca-components')['NCol']
NCollapse: typeof import('@celeris/ca-components')['NCollapse']
NCollapseItem: typeof import('@celeris/ca-components')['NCollapseItem']
NColorPicker: typeof import('@celeris/ca-components')['NColorPicker']
NConfigProvider: typeof import('@celeris/ca-components')['NConfigProvider']
NDialogProvider: typeof import('@celeris/ca-components')['NDialogProvider']
Expand All @@ -29,16 +25,9 @@ declare module 'vue' {
NDrawerContent: typeof import('@celeris/ca-components')['NDrawerContent']
NDropdown: typeof import('@celeris/ca-components')['NDropdown']
NEl: typeof import('@celeris/ca-components')['NEl']
NEmpty: typeof import('@celeris/ca-components')['NEmpty']
NForm: typeof import('@celeris/ca-components')['NForm']
NFormItem: typeof import('@celeris/ca-components')['NFormItem']
NGlobalStyle: typeof import('@celeris/ca-components')['NGlobalStyle']
NGrid: typeof import('@celeris/ca-components')['NGrid']
NGridItem: typeof import('@celeris/ca-components')['NGridItem']
NInput: typeof import('@celeris/ca-components')['NInput']
NLayout: typeof import('@celeris/ca-components')['NLayout']
NLayoutContent: typeof import('@celeris/ca-components')['NLayoutContent']
NLayoutSider: typeof import('@celeris/ca-components')['NLayoutSider']
NLoadingBarProvider: typeof import('@celeris/ca-components')['NLoadingBarProvider']
NMenu: typeof import('@celeris/ca-components')['NMenu']
NMessageProvider: typeof import('@celeris/ca-components')['NMessageProvider']
Expand All @@ -50,14 +39,10 @@ declare module 'vue' {
NSelect: typeof import('@celeris/ca-components')['NSelect']
NSpace: typeof import('@celeris/ca-components')['NSpace']
NSpin: typeof import('@celeris/ca-components')['NSpin']
NSplit: typeof import('@celeris/ca-components')['NSplit']
NStatistic: typeof import('@celeris/ca-components')['NStatistic']
NSwitch: typeof import('@celeris/ca-components')['NSwitch']
NTable: typeof import('@celeris/ca-components')['NTable']
NText: typeof import('@celeris/ca-components')['NText']
NTime: typeof import('@celeris/ca-components')['NTime']
NTooltip: typeof import('@celeris/ca-components')['NTooltip']
NVirtualList: typeof import('@celeris/ca-components')['NVirtualList']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
Expand Down
3 changes: 2 additions & 1 deletion apps/admin/src/apis/internal/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { FakeUserInfo } from "@celeris/admin-api/models/auth/FakeUserInfo";
import type { MessageMode, UserInfo } from "@celeris/types";
import type { UserInfo } from "@celeris/types";
import type { MessageMode } from "@celeris/request";
import { request } from "@celeris/request";

// Define the API endpoint URLs as an enum
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/apis/internal/menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RouteItem } from "@celeris/admin-api/models/menu/RouteItem";
import type { MessageMode } from "@celeris/types";
import type { MessageMode } from "@celeris/request";
import { request } from "@celeris/request";

// Define the API endpoint URLs as an enum
Expand Down
14 changes: 14 additions & 0 deletions apps/admin/src/store/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// project config key
export const PROJECT_CONFIG_KEY = "PROJECT__CONFIG__KEY";

export const LOCALES_STORE_KEY = "LOCALES__STORE__KEY";

export const APP_STORE_ID = "APP_STORE";

export const APP_TABS_STORE_ID = "APP_TABS_STORE";

export const APP_PERMISSION_STORE_ID = "APP_PERMISSION_STORE";

export const APP_USER_STORE_ID = "APP_USER_STORE";

export const APP_DESIGN_STORE_ID = "APP_DESIGN_STORE";
2 changes: 1 addition & 1 deletion apps/admin/src/store/modules/app.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineStore } from "pinia";
import type { DeepPartial } from "unocss";
import { APP_STORE_ID } from "@celeris/constants";
import type { HeaderSetting, MenuSetting, ProjectSetting, TransitionSetting } from "@celeris/types";
import { deepMerge } from "@celeris/utils";
import { APP_STORE_ID } from "../constants";
import { resetRouter } from "~/router";
import { DEFAULT_PROJECT_SETTING } from "~/setting/projectSetting";

Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/store/modules/design/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ThemeSetting } from "@celeris/types";
import { deepMerge } from "@celeris/utils";
import { defineStore } from "pinia";
import { APP_DESIGN_STORE_ID } from "@celeris/constants";
import type { GlobalTheme, GlobalThemeOverrides } from "naive-ui";
import { darkTheme, lightTheme } from "naive-ui";
import { APP_DESIGN_STORE_ID } from "../../constants";
import { getNaiveUICustomTheme } from "./themeUtils";
import { DEFAULT_THEME_SETTING } from "~/setting/themeSetting";

Expand Down
3 changes: 2 additions & 1 deletion apps/admin/src/store/modules/permission.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { Menu } from "@celeris/types";
import type { RoleConstants } from "@celeris/constants";
import { APP_PERMISSION_STORE_ID, PermissionModeConstants } from "@celeris/constants";
import { PermissionModeConstants } from "@celeris/constants";
import { filterTree, flattenMultiLevelRoutes, transformRouteToMenu } from "@celeris/utils";
import { defineStore } from "pinia";
import type { RouteRecordRaw } from "vue-router";
import { APP_PERMISSION_STORE_ID } from "../constants";
import { permissionCodeApi } from "~/apis/internal/auth";
import { menusApi } from "~/apis/internal/menu";
import { asyncRoutes } from "~/router/routes";
Expand Down
3 changes: 2 additions & 1 deletion apps/admin/src/store/modules/tabs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defineStore } from "pinia";
import { APP_TABS_STORE_ID, PageConstants } from "@celeris/constants";
import { PageConstants } from "@celeris/constants";
import { isGreaterOrEqual2xl } from "@celeris/hooks";
import type { RouteLocationNormalized, RouteRecordName } from "vue-router";
import { takeRight, uniqBy } from "@celeris/utils";
import { APP_TABS_STORE_ID } from "../constants";
import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from "~/router/routes/basic";

interface AppTabsState {
Expand Down
5 changes: 3 additions & 2 deletions apps/admin/src/store/modules/user.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { MessageMode } from "@celeris/types";
import type { MessageMode } from "@celeris/request";
import type { UserInfo } from "@celeris/types/src/user";
import { defineStore } from "pinia";
import { field, getErrorMessage, logger } from "@celeris/utils";
import type { RoleConstants } from "@celeris/constants";
import { APP_USER_STORE_ID, PageConstants, PermissionCacheTypeConstants } from "@celeris/constants";
import { PageConstants, PermissionCacheTypeConstants } from "@celeris/constants";
import { APP_USER_STORE_ID } from "../constants";
import { loginApi, logoutApi, userInfoApi } from "~/apis/internal/auth";
import type { LoginParams } from "~/apis/internal/auth";
import { DEFAULT_PROJECT_SETTING } from "~/setting/projectSetting";
Expand Down
File renamed without changes.
10 changes: 0 additions & 10 deletions packages/web/constants/src/storageConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,3 @@
export const PROJECT_CONFIG_KEY = "PROJECT__CONFIG__KEY";

export const LOCALES_STORE_KEY = "LOCALES__STORE__KEY";

export const APP_STORE_ID = "APP_STORE";

export const APP_TABS_STORE_ID = "APP_TABS_STORE";

export const APP_PERMISSION_STORE_ID = "APP_PERMISSION_STORE";

export const APP_USER_STORE_ID = "APP_USER_STORE";

export const APP_DESIGN_STORE_ID = "APP_DESIGN_STORE";
1 change: 1 addition & 0 deletions packages/web/request/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { defaultHttpClient as request } from "./src/index";
export * from "./src/index";
export * from "./src/types";
export * from "./src/axiosCancel";
export * from "./src/axiosTransform";
export * from "./src/HttpClient";
Expand Down
2 changes: 1 addition & 1 deletion packages/web/request/requestConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MessageMode } from "@celeris/types";
import type { MessageMode } from "@celeris/request";

export interface HttpRequestOptions {
errorMessageHandler: (message: string, mode?: MessageMode) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/web/request/src/HttpClient.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ContentTypeConstants, RequestConstants } from "@celeris/constants";
import type { RequestOptions, RequestResult } from "@celeris/types/src/httpClient";
import { cloneDeep, deepMerge } from "@celeris/utils";
import type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
import axios from "axios";
import qs from "qs";
import type { RequestOptions, RequestResult } from "./types";
import { AxiosCanceler } from "./axiosCancel";
import type { CreateAxiosOptions } from "./axiosTransform";

Expand Down
2 changes: 1 addition & 1 deletion packages/web/request/src/axiosTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Data processing class, can be configured according to the project
* 数据处理类,可以根据项目进行配置
*/
import type { RequestOptions, RequestResult } from "@celeris/types/src/httpClient";
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
import type { RequestOptions, RequestResult } from "./types";

/**
* Options that can be passed to the `createAxios` function when creating a new Axios instance.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RequestConstants, ResultConstants } from "@celeris/constants";
import type { RequestOptions, RequestResult } from "@celeris/types/src/httpClient";
import { isEmpty, isString } from "@celeris/utils";
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
import type { RequestOptions, RequestResult } from "../../types";
import { HttpRequestConfiguration } from "../../../requestConfiguration";
import type { AxiosTransform, CreateAxiosOptions } from "../../axiosTransform";
import { formatRequestDate, joinTimestamp, setObjToUrlParams } from "../../utils";
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion packages/web/types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from "./config";
export * from "./httpClient";
export * from "./global";
export * from "./menu";
export * from "./theme";
Expand Down
2 changes: 0 additions & 2 deletions packages/web/types/src/vue-router.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { RoleConstants, RouterTransitionConstants } from "@celeris/constants";

export {};

// Declare the module "vue-router" to add custom properties
// 声明模块 "vue-router" 以添加自定义属性
declare module "vue-router" {
Expand Down
6 changes: 3 additions & 3 deletions packages/web/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"author": "Kirk Lin (https://github.com/kirklin)",
"license": "MIT",
"homepage": "https://github.com/kirklin/celeris-web",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -18,17 +19,16 @@
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"build": "tsup",
"dev": "tsup --stub",
"clean": "pnpm rimraf node_modules && pnpm rimraf dist",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"prepublishOnly": "nr build",
"release": "bumpp",
"typecheck": "tsc --noEmit",
"up": "taze major -r -w -I"
"prepublishOnly": "npm run build",
"postinstall": "npm run build"
},
"dependencies": {
"@kirklin/logger": "0.0.2",
Expand Down
10 changes: 1 addition & 9 deletions packages/web/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,4 @@ export * from "./uuid";
export * from "./vue";
export { field, logger } from "@kirklin/logger";
export { isClient, isMobile, isServer, isTouchSupported } from "detect-mobile";
export {
cloneDeep,
clone,
intersection,
uniqBy,
pick,
split,
takeRight,
} from "lodash-es";
export * from "lodash-es";

0 comments on commit eaa05e7

Please sign in to comment.