Skip to content

Commit 770c409

Browse files
committed
♻️ feat: 统一管理依赖,更新 package.json 和 pnpm-workspace.yaml
1 parent 95c0814 commit 770c409

File tree

11 files changed

+1689
-1918
lines changed

11 files changed

+1689
-1918
lines changed

.husky/pre-commit

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
- 新增 `common.createSelfCorrectingClock` 创建零漂移的自校正实时时钟。
2525
- 新增 `common.createSelfCorrectingCountdown` 创建零漂移的自校正倒计时器。
2626
- 完善文档说明。
27+
- 2025-05-08
28+
- 依赖集中在 `pnpm-workspace.yaml - catalogs` 统一管理。
29+
- 完善文档说明。
2730

2831
## 📌 简介
2932

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import defineConfig from "@xiaohe01/eslint-config";
22

33
export default defineConfig({
4+
pnpm: true,
45
type: "lib",
56
markdown: false
67
});

package.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@ui-utils-kit/monorepo",
2+
"name": "ui-utils-kit",
33
"type": "module",
44
"version": "1.2.4",
55
"private": true,
@@ -23,23 +23,27 @@
2323
"stylelint:fix": "stylelint **/*.{css,scss,html,vue} --fix"
2424
},
2525
"dependencies": {
26-
"husky": "^9.1.7",
27-
"ui-utils-kit": "^1.2.4"
26+
"@antfu/nip": "catalog:",
27+
"husky": "catalog:",
28+
"ui-utils-kit": "catalog:"
2829
},
2930
"devDependencies": {
30-
"@antfu/ni": "^0.23.2",
31-
"@antfu/utils": "^0.7.10",
32-
"@xiaohe01/eslint-config": "^0.0.7",
33-
"@xiaohe01/tsconfig": "^0.0.2",
34-
"bumpp": "^9.11.1",
35-
"eslint": "^9.26.0",
36-
"esno": "^4.8.0",
37-
"lint-staged": "^15.5.2",
38-
"simple-git-hooks": "^2.13.0",
39-
"typescript": "~5.6.3",
40-
"unbuild": "^2.0.0",
41-
"vite": "^5.4.19",
42-
"vitest": "^2.1.9"
31+
"@antfu/ni": "catalog:",
32+
"@antfu/utils": "catalog:",
33+
"@xiaohe01/eslint-config": "catalog:",
34+
"@xiaohe01/tsconfig": "catalog:",
35+
"bumpp": "catalog:",
36+
"eslint": "catalog:",
37+
"esno": "catalog:",
38+
"lint-staged": "catalog:",
39+
"simple-git-hooks": "catalog:",
40+
"typescript": "catalog:",
41+
"unbuild": "catalog:",
42+
"vite": "catalog:",
43+
"vitest": "catalog:"
44+
},
45+
"simple-git-hooks": {
46+
"pre-commit": "npx lint-staged"
4347
},
4448
"lint-staged": {
4549
"*.{js,ts,tsx,vue}": "eslint --fix"

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@
5252
}
5353
},
5454
"devDependencies": {
55-
"html2canvas-pro": "^1.5.8"
55+
"html2canvas-pro": "catalog:"
5656
}
5757
}

packages/core/src/business.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import html2canvas from "html2canvas-pro";
22
import type { Options as Html2canvasOptions } from "html2canvas-pro";
3-
import type { CaptureResult, OutputOptions } from "./types/business-type.ts";
3+
import type { CaptureResult, OutputOptions } from "./types/business-type";
44

55
/**
66
* =====================
@@ -46,7 +46,7 @@ export async function captureElementAsImage(
4646
// 合并默认配置和用户传入的配置
4747
const finalCanvasConfig = { ...defaultCanvasConfig, ...canvasConfig };
4848

49-
console.log("config: ", finalCanvasConfig);
49+
// console.log("config: ", finalCanvasConfig);
5050
let canvas: HTMLCanvasElement | null = null;
5151
let dataUrl: string | null = null;
5252
let blobResult: Blob | null = null;

packages/core/src/tree-operations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { CheckStatus } from "./types/tree-operations-type";
1010
/**
1111
* 构建树形结构
1212
* @param {Array} nodes - 树节点数组,每个节点包含 `id` 和 `pid` 等属性
13-
* @param {boolean} [preserveChildren] - 是否保留原节点的 `children` 属性
1413
* @returns {Array} - 树形结构数组
1514
*/
1615
export function buildTree(nodes: TreeNode[]): TreeNode[] {

playground/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
},
1515
"dependencies": {
1616
"ui-utils-kit": "workspace:^",
17-
"vue": "^3.5.13"
17+
"vue": "catalog:"
1818
},
1919
"devDependencies": {
20-
"@vitejs/plugin-vue": "^5.2.0",
21-
"sass-embedded": "^1.85.0",
22-
"vite": "^5.4.11",
23-
"vue-tsc": "^2.1.10"
20+
"@vitejs/plugin-vue": "catalog:",
21+
"sass-embedded": "catalog:",
22+
"vite": "catalog:",
23+
"vue-tsc": "catalog:"
2424
}
2525
}

playground/src/components/html2canvas.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ import { ref } from "vue";
3434
const printEl = ref<HTMLElement | null>(null);
3535
3636
async function onPrint() {
37-
const res = await captureElementAsImage(printEl.value, {
37+
await captureElementAsImage(printEl.value, {
3838
proxy: "https://h2c-proxy.netlify.app/api/",
3939
useCORS: false
4040
});
41-
console.log("res: ", res);
4241
}
4342
</script>
4443

0 commit comments

Comments
 (0)