Skip to content

Commit

Permalink
fix: utils monorepo build
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklin committed Jul 3, 2024
1 parent 68b61e8 commit a4a4653
Show file tree
Hide file tree
Showing 13 changed files with 597 additions and 393 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"scripts": "workspace:*",
"taze": "^0.13.8",
"treeify": "^1.1.0",
"tsup": "^8.1.0",
"typescript": "^5.5.2",
"unbuild": "^2.0.0",
"vite": "^5.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/Application/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { withInstall } from "@celeris/utils/src/vue/install";
import { withInstall } from "@celeris/utils";
import appLogo from "./src/AppLogo.vue";
import appProvider from "./src/AppNaiveUIProvider.vue";

Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/Charts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { withInstall } from "@celeris/utils/src/vue/install";
import { withInstall } from "@celeris/utils";
import charts from "./src/Charts.vue";

export * from "./types/echarts";
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/Icon/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { withInstall } from "@celeris/utils/src/vue/install";
import { withInstall } from "@celeris/utils";
import icon from "./src/Icon.vue";

export const Icon = withInstall(icon);
Expand Down
2 changes: 1 addition & 1 deletion packages/web/types/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export interface GlobConfig {
APP_SHORT_NAME: string;
}

export interface GlobEnvConfig extends ImportMetaEnv {
export interface GlobEnvConfig {
BASE_URL: string;
MODE: string;
DEV: boolean;
Expand Down
12 changes: 0 additions & 12 deletions packages/web/utils/index.ts

This file was deleted.

24 changes: 20 additions & 4 deletions packages/web/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,29 @@
"author": "Kirk Lin (https://github.com/kirklin)",
"license": "MIT",
"homepage": "https://github.com/kirklin/celeris-web",
"main": "./index.ts",
"module": "./index.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "src/index.ts",
"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"
"test:coverage": "vitest run --coverage",
"prepublishOnly": "nr build",
"release": "bumpp",
"typecheck": "tsc --noEmit",
"up": "taze major -r -w -I"
},
"dependencies": {
"@kirklin/logger": "0.0.2",
Expand All @@ -29,7 +46,6 @@
"@celeris/types": "workspace:*",
"@types/crypto-js": "^4.2.2",
"@types/lodash-es": "^4.17.12",
"@vue/runtime-core": "3.4.30",
"vue": "^3.4.30",
"vue-router": "^4.4.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/utils/src/browserHelper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { field, logger } from "../index";
import { field, logger } from "@kirklin/logger";

/**
* 打开一个新的浏览器窗口
Expand Down
11 changes: 11 additions & 0 deletions packages/web/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ export * from "./treeHelper";
export * from "./util";
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";
2 changes: 1 addition & 1 deletion packages/web/utils/src/typeChecks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ComponentPublicInstance } from "@vue/runtime-core";
import type { ComponentPublicInstance } from "vue";

export {
isArguments,
Expand Down
18 changes: 16 additions & 2 deletions packages/web/utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@
"compilerOptions": {
"target": "esnext",
"baseUrl": ".",
"module": "esnext"
"module": "esnext",
"moduleResolution": "Node",
"strict": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"sourceMap": false,
"lib": [
"esnext",
"dom"
]
},
"include": ["src"]
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
10 changes: 10 additions & 0 deletions packages/web/utils/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
clean: true,
format: ["esm", "cjs", "iife"],
external: ["vue"],
dts: true,
minify: true,
});
Loading

0 comments on commit a4a4653

Please sign in to comment.