cc-tools-utils 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -32
- package/index.js +12 -0
- package/lib/js/cesiumHooks.js +1127 -0
- package/lib/js/tools.js +36 -0
- package/package.json +24 -26
- package/vue-config-helper.js +54 -0
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -1
- package/dist/lib/img/Transform.d.ts +0 -3
- package/dist/lib/js/Anima.d.ts +0 -2
- package/dist/lib/js/bus.d.ts +0 -9
- package/dist/lib/js/tools.d.ts +0 -53
- package/lib/js/Anima.js +0 -10949
- package/lib/js/bus.ts +0 -24
- package/lib/js/tools.ts +0 -238
package/README.md
CHANGED
|
@@ -1,44 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
一个由 chencheng 开发与维护的个人工具函数库,旨在为日常开发提供常用的、高质量的辅助工具。
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
主入口文件为index.ts 所有的包函数名或变量名的出口 统一出口 entry
|
|
5
|
-
打包 导出的整个包的名称为index.js 全部混入成一个index.js
|
|
6
|
-
遇到ts文件使用ts-loader进行加载
|
|
7
|
-
无论js 还是 ts 都需要进行babel转义成es5等支持更低版本浏览器的版本
|
|
3
|
+
✨ 特性
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
开箱即用:简单导入,无需复杂配置
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
轻量无依赖:保持核心功能的纯净,不引入第三方依赖
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
通过命令npm config set registry https://registry.npmjs.org/
|
|
9
|
+
类型友好:使用 TypeScript 编写,提供完整的类型定义
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
先登录
|
|
18
|
-
npm login
|
|
19
|
-
再发布
|
|
20
|
-
npm publish
|
|
11
|
+
模块化:按需引入,支持 Tree Shaking
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
chencheng1998
|
|
24
|
-
13512597595cc
|
|
13
|
+
良好测试:核心功能均有单元测试覆盖
|
|
25
14
|
|
|
26
|
-
|
|
27
|
-
node v20.14.0
|
|
28
|
-
npm 10.9.0
|
|
15
|
+
## 📦 安装
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install cc-tools-utils
|
|
19
|
+
# 或
|
|
20
|
+
yarn add cc-tools-utils
|
|
21
|
+
# 或
|
|
22
|
+
pnpm add cc-tools-utils
|
|
23
|
+
```
|
|
33
24
|
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
2af26bf09d6ff92b1b034e6eab54c7deb655bb339b0f1a5379b200f02f815251
|
|
37
|
-
f6732d5d0c4816e51076304b88827e07420b0d5261b94545c0295fbb7d50a39a
|
|
38
|
-
1b14023b2ce3dbd220388f5f27e012faf7dc01df7227251be93a54f8f30edc60
|
|
39
|
-
d9a2bcb440a0278363c45f51d9fec1b8a56fa2511ab2b12dd4a9ef763e1e6732
|
|
40
|
-
dc1161f6b1a64f778b7f683748dfb59c20630350cf42e695cc6ff7f5d0107952
|
|
26
|
+
## 🚀 使用
|
|
41
27
|
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
```javascript
|
|
29
|
+
import { cesiumHooks, tools } from 'cc-tools-utils';
|
|
44
30
|
|
|
31
|
+
// 使用 Cesium hooks
|
|
32
|
+
const { viewer } = cesiumHooks.initCesium('cesiumContainer');
|
|
33
|
+
|
|
34
|
+
// 使用工具函数
|
|
35
|
+
const debouncedFn = tools.debounce(300, () => console.log('debounced'));
|
|
36
|
+
```
|
package/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// import * as img from "./lib/img/Transform.js";
|
|
2
|
+
import * as tools from "./lib/js/tools.js";
|
|
3
|
+
import * as cesiumHooks from "./lib/js/cesiumHooks.js";
|
|
4
|
+
|
|
5
|
+
// 命名导出
|
|
6
|
+
export { tools, cesiumHooks };
|
|
7
|
+
|
|
8
|
+
// 默认导出
|
|
9
|
+
export default {
|
|
10
|
+
tools,
|
|
11
|
+
cesiumHooks,
|
|
12
|
+
};
|