From 7fc9472e3b40988251b8529ebcb1d5e9fe89692f Mon Sep 17 00:00:00 2001 From: novlan1 <1576271227@qq.com> Date: Sat, 14 Dec 2024 12:08:19 +0800 Subject: [PATCH] docs: update docs --- README.md | 3 +- bin/publish.js | 2 +- docs/.vuepress/config.js | 8 +++-- docs/CHANGELOG.md | 12 ++++++++ docs/README.md | 6 ++-- docs/zh/ast.md | 3 +- docs/zh/base/function.md | 3 +- docs/zh/base/list.md | 3 +- docs/zh/base/number.md | 3 +- docs/zh/base/object.md | 3 +- docs/zh/base/regexp.md | 3 +- docs/zh/base/string.md | 35 ++++++++++++++++++--- docs/zh/bite.md | 3 +- docs/zh/build-upload.md | 3 +- docs/zh/bundle-analyze.md | 3 +- docs/zh/canvas.md | 3 +- docs/zh/change-log.md | 3 +- docs/zh/city.md | 3 +- docs/zh/clipboard.md | 3 +- docs/zh/color.md | 3 +- docs/zh/component.md | 54 +++++++++++++++++++++++++++++++-- docs/zh/console.md | 31 +++++++++++++++++++ docs/zh/constant.md | 3 +- docs/zh/cookie.md | 3 +- docs/zh/css.md | 3 +- docs/zh/daily-merge.md | 3 +- docs/zh/date.md | 3 +- docs/zh/debounce.md | 3 +- docs/zh/devops.md | 3 +- docs/zh/dom-to-image.md | 3 +- docs/zh/e-bus.md | 3 +- docs/zh/env-variable.md | 3 +- docs/zh/env.md | 3 +- docs/zh/fs.md | 3 +- docs/zh/functional-component.md | 3 +- docs/zh/git.md | 3 +- docs/zh/i18n.md | 3 +- docs/zh/image.md | 3 +- docs/zh/ip.md | 3 +- docs/zh/jsdoc.md | 3 +- docs/zh/launch-app.md | 3 +- docs/zh/launch-game.md | 3 +- docs/zh/loader.md | 3 +- docs/zh/mixin.md | 3 +- docs/zh/morse-pwd.md | 3 +- docs/zh/mp-ci.md | 3 +- docs/zh/mp.md | 3 +- docs/zh/msdk.md | 3 +- docs/zh/node-img.md | 3 +- docs/zh/node.md | 30 +++++++++++++++--- docs/zh/open-location.md | 3 +- docs/zh/open-source-report.md | 3 +- docs/zh/pages-statistics.md | 3 +- docs/zh/path.md | 31 ++++++++++++++++--- docs/zh/pipeline.md | 3 +- docs/zh/polling.md | 3 +- docs/zh/promise.md | 3 +- docs/zh/rainbow-to-cos.md | 3 +- docs/zh/rainbow.md | 3 +- docs/zh/rd-platform-report.md | 3 +- docs/zh/rem-to-px.md | 3 +- docs/zh/rem.md | 3 +- docs/zh/rollup.md | 26 ++++++++++++++++ docs/zh/router.md | 3 +- docs/zh/scheduler.md | 3 +- docs/zh/share/env.md | 3 +- docs/zh/slash.md | 3 +- docs/zh/sleep.md | 3 +- docs/zh/storage.md | 3 +- docs/zh/tam/img.md | 3 +- docs/zh/tencent-cloud/cos.md | 3 +- docs/zh/tencent-doc.md | 3 +- docs/zh/tgit.md | 3 +- docs/zh/throttle.md | 3 +- docs/zh/time.md | 3 +- docs/zh/toast.md | 3 +- docs/zh/uni-app.md | 3 +- docs/zh/uploader.md | 3 +- docs/zh/url.md | 3 +- docs/zh/v-console.md | 3 +- docs/zh/v-lazy.md | 3 +- docs/zh/validate.md | 3 +- docs/zh/version-tip.md | 3 +- docs/zh/version.md | 23 +++++++++++--- docs/zh/vue-start.md | 3 +- docs/zh/watermark.md | 3 +- docs/zh/weather.md | 3 +- docs/zh/wecom-robot.md | 3 +- docs/zh/wx.md | 3 +- package.json | 6 ++-- script/docs-jsdoc/deploy.js | 2 +- script/docs-jsdoc/markdown.js | 6 ++-- 92 files changed, 319 insertions(+), 187 deletions(-) create mode 100644 docs/zh/console.md create mode 100644 docs/zh/rollup.md diff --git a/README.md b/README.md index 47a4e3a3..0fb25098 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ style="margin-bottom: 20px;margin-top: 20px;" /> +

@@ -19,7 +20,7 @@ ### 介绍 -`t-comm` 是一个丰富、易用的工具库。 +`t-comm` 是一个专业、稳定、纯粹的工具库。 ### 如何使用 diff --git a/bin/publish.js b/bin/publish.js index ad73b01d..12bac77c 100644 --- a/bin/publish.js +++ b/bin/publish.js @@ -27,7 +27,7 @@ function publishWithBash({ port, }) { const publishBash = require('path').resolve(__dirname, './publish.sh'); - const command = `sh ${publishBash} ${source} ${target} ${name} ${password} ${port}`; + const command = `sh ${publishBash} ${source} ${target} ${name} "${password}" ${port}`; execSync(command, { cwd: process.cwd(), diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f3770adb..96591508 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -11,8 +11,8 @@ const changeLogSidebar = SHOW_CHANGE_LOG ? [ module.exports = { - title: 't-comm', - description: '丰富易用的工具库', + title: 'T Comm', + description: '专业、稳定、纯粹的工具库', base: process.env.PUBLISH_PATH || '/t-comm/', head: [ [ @@ -46,6 +46,10 @@ module.exports = { text: 'Press UI', link: 'https://novlan1.github.io/press-ui/', }, + { + text: 'Plugin Light', + link: 'https://novlan1.github.io/plugin-light/', + }, ], sidebar: [ { diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c6eef0ea..0de9d04a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,17 @@ # 更新日志 +### [1.3.126](https://github.com/novlan1/t-comm/compare/v1.3.125...v1.3.126) (2024-12-13) + + +### Tests ✅ + +* update test cases ([1c4ddf7](https://github.com/novlan1/t-comm/commit/1c4ddf7b7c6f79dbc4c127da1310120c5e4ceae5)) + + +### Features 🎉 + +* **publish-ci:** 支持特殊符号的密码 ([abb0757](https://github.com/novlan1/t-comm/commit/abb07573a3585e88d3be9c83aba55e748f587dc0)) + ### [1.3.125](https://github.com/novlan1/t-comm/compare/v1.3.124...v1.3.125) (2024-12-13) diff --git a/docs/README.md b/docs/README.md index 311f1d71..35c26335 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,11 +1,12 @@

+

@@ -19,7 +20,7 @@ ### 介绍 -`t-comm` 是一个丰富、易用的工具库。 +`t-comm` 是一个专业、稳定、纯粹的工具库。 ### 如何使用 @@ -52,4 +53,3 @@ timeStampFormat(stamp, 'yyyy-MM-dd hh:mm:ss'); // 2020-11-27 08:23:24 ``` - diff --git a/docs/zh/ast.md b/docs/zh/ast.md index bd2a7ec1..597a0d5e 100644 --- a/docs/zh/ast.md +++ b/docs/zh/ast.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { parseReplaceConfig, replaceDependencies } from 't-comm'; // or - import { parseReplaceConfig, replaceDependencies} from 't-comm/lib/ast/index'; ``` diff --git a/docs/zh/base/function.md b/docs/zh/base/function.md index 0ebbe352..91b85dc7 100644 --- a/docs/zh/base/function.md +++ b/docs/zh/base/function.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { parseFunction, cached } from 't-comm'; // or - import { parseFunction, cached} from 't-comm/lib/base/function/index'; ``` diff --git a/docs/zh/base/list.md b/docs/zh/base/list.md index 550c5228..ddd14a77 100644 --- a/docs/zh/base/list.md +++ b/docs/zh/base/list.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -17,7 +17,6 @@ import { } from 't-comm'; // or - import { flat, flatten, diff --git a/docs/zh/base/number.md b/docs/zh/base/number.md index 4d07ec4a..df0106b0 100644 --- a/docs/zh/base/number.md +++ b/docs/zh/base/number.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -16,7 +16,6 @@ import { } from 't-comm'; // or - import { NUMBER_CHI_MAP, getUnitPreviousRatio, diff --git a/docs/zh/base/object.md b/docs/zh/base/object.md index ac5e017b..5d966f48 100644 --- a/docs/zh/base/object.md +++ b/docs/zh/base/object.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { toHumpObj, extend } from 't-comm'; // or - import { toHumpObj, extend} from 't-comm/lib/base/object/index'; ``` diff --git a/docs/zh/base/regexp.md b/docs/zh/base/regexp.md index fe358e37..da8cad86 100644 --- a/docs/zh/base/regexp.md +++ b/docs/zh/base/regexp.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getMatchListFromReg, getPreReleaseTag } from 't-comm'; // or - import { getMatchListFromReg, getPreReleaseTag} from 't-comm/lib/base/regexp/index'; ``` diff --git a/docs/zh/base/string.md b/docs/zh/base/string.md index 944b2773..eca79a16 100644 --- a/docs/zh/base/string.md +++ b/docs/zh/base/string.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,12 +11,12 @@ import { capitalize, titleize, lowerInitial, + pascalCase, toUnicodeAt, toUnicode } from 't-comm'; // or - import { checkStringLength, replaceAllPolyfill, @@ -25,6 +25,7 @@ import { capitalize, titleize, lowerInitial, + pascalCase, toUnicodeAt, toUnicode } from 't-comm/lib/base/string/index'; @@ -71,10 +72,10 @@ replaceAllPolyfill() ``` -## `camelize(str)` +## `camelize(str, handleSnake)` -**描述**:

横线转驼峰命名

+**描述**:

横线转驼峰命名,如果第一个字符是字母,则不处理。

**参数**: @@ -82,6 +83,7 @@ replaceAllPolyfill() | 参数名 | 类型 | 描述 | | --- | --- | --- | | str | string |

输入字符串

| +| handleSnake | boolean |

是否处理下划线,默认不处理

| **返回**: string
@@ -198,6 +200,31 @@ lowerInitial('GroupId') // groupId ``` + + +## `pascalCase(str)` + + +**描述**:

用大驼峰,即 PascalCase 格式,来格式化字符串

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| str |

字符串

| + +**返回**:

PascalCase 的字符串

+ +**示例** + +```ts +pascalCase('ab-cd') +// AbCd + +pascalCase('ab_cd') +// AbCd +``` ## `toUnicodeAt(str, index)` diff --git a/docs/zh/bite.md b/docs/zh/bite.md index c3d65032..bbcdf40f 100644 --- a/docs/zh/bite.md +++ b/docs/zh/bite.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { formatBite } from 't-comm'; // or - import { formatBite} from 't-comm/lib/bite/index'; ``` diff --git a/docs/zh/build-upload.md b/docs/zh/build-upload.md index d2b72753..174d1355 100644 --- a/docs/zh/build-upload.md +++ b/docs/zh/build-upload.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { buildAndUpload } from 't-comm'; // or - import { buildAndUpload} from 't-comm/lib/build-upload/index'; ``` diff --git a/docs/zh/bundle-analyze.md b/docs/zh/bundle-analyze.md index 0781ded0..9e3e2e4c 100644 --- a/docs/zh/bundle-analyze.md +++ b/docs/zh/bundle-analyze.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { analyzeIndexBundle } from 't-comm'; // or - import { analyzeIndexBundle} from 't-comm/lib/bundle-analyze/index'; ``` diff --git a/docs/zh/canvas.md b/docs/zh/canvas.md index fc01a97d..fc6858af 100644 --- a/docs/zh/canvas.md +++ b/docs/zh/canvas.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { addTextForImg, mergeMultiCanvasPic, diff --git a/docs/zh/change-log.md b/docs/zh/change-log.md index fa02d034..1471999a 100644 --- a/docs/zh/change-log.md +++ b/docs/zh/change-log.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { insertDocChangeLog } from 't-comm'; // or - import { insertDocChangeLog} from 't-comm/lib/change-log/index'; ``` diff --git a/docs/zh/city.md b/docs/zh/city.md index c4ca77d6..e11ef8a5 100644 --- a/docs/zh/city.md +++ b/docs/zh/city.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -13,7 +13,6 @@ import { } from 't-comm'; // or - import { getAreaDataAll, getAreaData, diff --git a/docs/zh/clipboard.md b/docs/zh/clipboard.md index 11c6c12e..f4bf030c 100644 --- a/docs/zh/clipboard.md +++ b/docs/zh/clipboard.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { clipboardMp, clipboardWeb } from 't-comm'; // or - import { clipboardMp, clipboardWeb} from 't-comm/lib/clipboard/index'; ``` diff --git a/docs/zh/color.md b/docs/zh/color.md index d78b182c..a4313f94 100644 --- a/docs/zh/color.md +++ b/docs/zh/color.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { rgb2hsv, hsv2rgb } from 't-comm'; // or - import { rgb2hsv, hsv2rgb} from 't-comm/lib/color/index'; ``` diff --git a/docs/zh/component.md b/docs/zh/component.md index 886d981e..73dc480b 100644 --- a/docs/zh/component.md +++ b/docs/zh/component.md @@ -1,21 +1,24 @@ [[toc]] -## 引入 +

引入

```ts import { addEmitsForComponent, addNameForComponent, + getFullCompName, + getPureCompName, extractClass, extractEvent, extractProps } from 't-comm'; // or - import { addEmitsForComponent, addNameForComponent, + getFullCompName, + getPureCompName, extractClass, extractEvent, extractProps @@ -69,6 +72,53 @@ addNameForComponent('xxx.vue'); ```ts addNameForComponent('xxx.vue', 'PressUploader'); ``` + + +## `getFullCompName(name, prefix)` + + +**描述**:

获取组件全称

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| name |

组件名称

| +| prefix |

前缀

| + +**返回**:

全称

+ +**示例** + +```ts +getFullCompName('swiper-item', 'press-') +getFullCompName('press-swiper-item', 'press-') + +// press-swiper-item +``` + + +## `getPureCompName(name, prefix)` + + +**描述**:

获取组件简称

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| name |

组件名称

| +| prefix |

前缀

| + +**返回**:

简称

+
getPureCompName('press-swiper-item', 'press-')
+getPureCompName('swiper-item', 'press-')
+
+//swiper-item
+
+ ## `extractClass(params)` diff --git a/docs/zh/console.md b/docs/zh/console.md new file mode 100644 index 00000000..282ed49f --- /dev/null +++ b/docs/zh/console.md @@ -0,0 +1,31 @@ +[[toc]] + +

引入

+ +```ts +import { getBase64FromUrl } from 't-comm'; + +// or +import { getBase64FromUrl} from 't-comm/lib/console/index'; +``` + + +## `getBase64FromUrl(url)` + + +**描述**:

获取图片,并转 base64

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| url |

图片链接

| + +**返回**:

获取结果

+ +**示例** + +```ts +getBase64FromUrl(imgUrl).then(consoleImage); +``` diff --git a/docs/zh/constant.md b/docs/zh/constant.md index 7fcd527b..10f44124 100644 --- a/docs/zh/constant.md +++ b/docs/zh/constant.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { GID_MAP } from 't-comm'; // or - import { GID_MAP} from 't-comm/lib/constant/index'; ``` diff --git a/docs/zh/cookie.md b/docs/zh/cookie.md index d1a4fb0b..2bc7c165 100644 --- a/docs/zh/cookie.md +++ b/docs/zh/cookie.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,7 +11,6 @@ import { } from 't-comm'; // or - import { getCookie, setCookie, diff --git a/docs/zh/css.md b/docs/zh/css.md index 33535126..19f6667b 100644 --- a/docs/zh/css.md +++ b/docs/zh/css.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { removeCss, loadStyles, diff --git a/docs/zh/daily-merge.md b/docs/zh/daily-merge.md index 44f349bc..b8e7f334 100644 --- a/docs/zh/daily-merge.md +++ b/docs/zh/daily-merge.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { dailyMerge } from 't-comm'; // or - import { dailyMerge} from 't-comm/lib/daily-merge/index'; ``` diff --git a/docs/zh/date.md b/docs/zh/date.md index 1e493b62..3f6b83d6 100644 --- a/docs/zh/date.md +++ b/docs/zh/date.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -17,7 +17,6 @@ import { } from 't-comm'; // or - import { getMonthDay, getMonthDay2, diff --git a/docs/zh/debounce.md b/docs/zh/debounce.md index a1c7fd6b..5479b952 100644 --- a/docs/zh/debounce.md +++ b/docs/zh/debounce.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { debounce } from 't-comm'; // or - import { debounce} from 't-comm/lib/debounce/index'; ``` diff --git a/docs/zh/devops.md b/docs/zh/devops.md index a6592d8f..c5177de0 100644 --- a/docs/zh/devops.md +++ b/docs/zh/devops.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,7 +11,6 @@ import { } from 't-comm'; // or - import { startDevopsPipeline, getPipelineList, diff --git a/docs/zh/dom-to-image.md b/docs/zh/dom-to-image.md index 999dc2c3..01fca696 100644 --- a/docs/zh/dom-to-image.md +++ b/docs/zh/dom-to-image.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { convertDomToImage, urlToBase64, diff --git a/docs/zh/e-bus.md b/docs/zh/e-bus.md index 3d924b3a..6f575aaf 100644 --- a/docs/zh/e-bus.md +++ b/docs/zh/e-bus.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { initGlobalVue3EBus, initDiffVue3EBus } from 't-comm'; // or - import { initGlobalVue3EBus, initDiffVue3EBus} from 't-comm/lib/e-bus/index'; ``` diff --git a/docs/zh/env-variable.md b/docs/zh/env-variable.md index 4db5b0dc..c170852a 100644 --- a/docs/zh/env-variable.md +++ b/docs/zh/env-variable.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { readEnvVariable, writeEnvTokenToNpmRC } from 't-comm'; // or - import { readEnvVariable, writeEnvTokenToNpmRC} from 't-comm/lib/env-variable/index'; ``` diff --git a/docs/zh/env.md b/docs/zh/env.md index 3b079e6f..1f084fa3 100644 --- a/docs/zh/env.md +++ b/docs/zh/env.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { checkNodeEnv, checkUAIsIOS, diff --git a/docs/zh/fs.md b/docs/zh/fs.md index 7881a1e7..66fd0ac9 100644 --- a/docs/zh/fs.md +++ b/docs/zh/fs.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { writeFileSync, readFileSync } from 't-comm'; // or - import { writeFileSync, readFileSync} from 't-comm/lib/fs/index'; ``` diff --git a/docs/zh/functional-component.md b/docs/zh/functional-component.md index f475c69f..be941b76 100644 --- a/docs/zh/functional-component.md +++ b/docs/zh/functional-component.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { showFunctionalComponent, showFunctionalComponentQueue } from 't-comm'; // or - import { showFunctionalComponent, showFunctionalComponentQueue} from 't-comm/lib/functional-component/index'; ``` diff --git a/docs/zh/git.md b/docs/zh/git.md index 233d585f..43cd6299 100644 --- a/docs/zh/git.md +++ b/docs/zh/git.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -15,7 +15,6 @@ import { } from 't-comm'; // or - import { getAllGitRepo, getGitCurBranch, diff --git a/docs/zh/i18n.md b/docs/zh/i18n.md index 669b016b..e7b5ba5b 100644 --- a/docs/zh/i18n.md +++ b/docs/zh/i18n.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getI18nToken } from 't-comm'; // or - import { getI18nToken} from 't-comm/lib/i18n/index'; ``` diff --git a/docs/zh/image.md b/docs/zh/image.md index 58746ffb..7b98aff9 100644 --- a/docs/zh/image.md +++ b/docs/zh/image.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -13,7 +13,6 @@ import { } from 't-comm'; // or - import { handleImgUnit, getHttpsUrl, diff --git a/docs/zh/ip.md b/docs/zh/ip.md index 78ca3f35..e784c3c2 100644 --- a/docs/zh/ip.md +++ b/docs/zh/ip.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getIPAddress, getIPAddressStr } from 't-comm'; // or - import { getIPAddress, getIPAddressStr} from 't-comm/lib/ip/index'; ``` diff --git a/docs/zh/jsdoc.md b/docs/zh/jsdoc.md index bfdf0522..c1a22c7a 100644 --- a/docs/zh/jsdoc.md +++ b/docs/zh/jsdoc.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { JsDocHandler } from 't-comm'; // or - import { JsDocHandler } from 't-comm/lib/jsdoc/index'; ``` diff --git a/docs/zh/launch-app.md b/docs/zh/launch-app.md index e7a3ca97..0dc49bf6 100644 --- a/docs/zh/launch-app.md +++ b/docs/zh/launch-app.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -18,7 +18,6 @@ import { } from 't-comm'; // or - import { getOpenGameScheme, launchApp, diff --git a/docs/zh/launch-game.md b/docs/zh/launch-game.md index de4cf387..6d349b21 100644 --- a/docs/zh/launch-game.md +++ b/docs/zh/launch-game.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,7 +11,6 @@ import { } from 't-comm'; // or - import { launchDDZGameRoom, launchGNGameRoom, diff --git a/docs/zh/loader.md b/docs/zh/loader.md index 6d7577ec..3c6f8858 100644 --- a/docs/zh/loader.md +++ b/docs/zh/loader.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,7 +11,6 @@ import { } from 't-comm'; // or - import { loader, loaderUnity, diff --git a/docs/zh/mixin.md b/docs/zh/mixin.md index bfce1072..c6b34ae6 100644 --- a/docs/zh/mixin.md +++ b/docs/zh/mixin.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getMorsePwdMixin, getMsdkFullScreen } from 't-comm'; // or - import { getMorsePwdMixin, getMsdkFullScreen} from 't-comm/lib/mixin/index'; ``` diff --git a/docs/zh/morse-pwd.md b/docs/zh/morse-pwd.md index 0159237d..c704ffd2 100644 --- a/docs/zh/morse-pwd.md +++ b/docs/zh/morse-pwd.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { MorsePwd , simpleMorse } from 't-comm'; // or - import { MorsePwd , simpleMorse} from 't-comm/lib/morse-pwd/index'; ``` diff --git a/docs/zh/mp-ci.md b/docs/zh/mp-ci.md index b7ee59a6..67c077a9 100644 --- a/docs/zh/mp-ci.md +++ b/docs/zh/mp-ci.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { MpCI } from 't-comm'; // or - import { MpCI } from 't-comm/lib/mp-ci/index'; ``` diff --git a/docs/zh/mp.md b/docs/zh/mp.md index a70a20be..5d8a543e 100644 --- a/docs/zh/mp.md +++ b/docs/zh/mp.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { saveMpImage } from 't-comm'; // or - import { saveMpImage} from 't-comm/lib/mp/index'; ``` diff --git a/docs/zh/msdk.md b/docs/zh/msdk.md index 1ce01428..5e31c2db 100644 --- a/docs/zh/msdk.md +++ b/docs/zh/msdk.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -13,7 +13,6 @@ import { } from 't-comm'; // or - import { callJsReSetFullScreen, callJsSetFullScreen, diff --git a/docs/zh/node-img.md b/docs/zh/node-img.md index 654baf31..9420e61f 100644 --- a/docs/zh/node-img.md +++ b/docs/zh/node-img.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,7 +11,6 @@ import { } from 't-comm'; // or - import { saveBase64ImgToFile, turnLocalImg2Base64, diff --git a/docs/zh/node.md b/docs/zh/node.md index 8f0bc920..f5dba546 100644 --- a/docs/zh/node.md +++ b/docs/zh/node.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -12,11 +12,11 @@ import { rmEmptyDir, copyFile, traverseFolder, - execCommand + execCommand, + execCommandAll } from 't-comm'; // or - import { parseCommentJson, readCommentJson, @@ -26,7 +26,8 @@ import { rmEmptyDir, copyFile, traverseFolder, - execCommand + execCommand, + execCommandAll } from 't-comm/lib/node/index'; ``` @@ -168,6 +169,27 @@ import { ## `execCommand(command, root, stdio)` +**描述**:

nodejs 中调用 child_process.execSync 执行命令, +这个方法会对输出结果截断,只返回第一行内容

+ +**参数**: + + +| 参数名 | 类型 | 描述 | +| --- | --- | --- | +| command | string |

命令

| +| root | string |

执行命令的目录

| +| stdio | string |

结果输出,默认为 pipe

| + +**返回**: string
+ +

命令执行结果

+ + + +## `execCommandAll(command, root, stdio)` + + **描述**:

nodejs中调用 child_process.execSync 执行命令

**参数**: diff --git a/docs/zh/open-location.md b/docs/zh/open-location.md index 816afab0..e0940c71 100644 --- a/docs/zh/open-location.md +++ b/docs/zh/open-location.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { openLocationInMp, openLocationInH5 } from 't-comm'; // or - import { openLocationInMp, openLocationInH5} from 't-comm/lib/open-location/index'; ``` diff --git a/docs/zh/open-source-report.md b/docs/zh/open-source-report.md index f8317c09..6f8917e7 100644 --- a/docs/zh/open-source-report.md +++ b/docs/zh/open-source-report.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { sendOpenSourceReport } from 't-comm'; // or - import { sendOpenSourceReport} from 't-comm/lib/open-source-report/index'; ``` diff --git a/docs/zh/pages-statistics.md b/docs/zh/pages-statistics.md index c64ed08a..410e4483 100644 --- a/docs/zh/pages-statistics.md +++ b/docs/zh/pages-statistics.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { statisticsPages, statisticsComponent } from 't-comm'; // or - import { statisticsPages, statisticsComponent} from 't-comm/lib/pages-statistics/index'; ``` diff --git a/docs/zh/path.md b/docs/zh/path.md index b475910a..0ecc5e4b 100644 --- a/docs/zh/path.md +++ b/docs/zh/path.md @@ -1,13 +1,12 @@ [[toc]] -## 引入 +

引入

```ts -import { normalizePath } from 't-comm'; +import { normalizePath, getRelativePath } from 't-comm'; // or - -import { normalizePath} from 't-comm/lib/path/index'; +import { normalizePath, getRelativePath} from 't-comm/lib/path/index'; ``` @@ -32,3 +31,27 @@ normalizePath('xxx/xxx/xxx'); normalizePath('xxx\\xxx\\xxx'); ``` + + +## `getRelativePath(pathA, pathB)` + + +**描述**:

A引用B时,拿引用路径

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| pathA |

路径A

| +| pathB |

路径B

| + +**返回**:

相对路径

+ +**示例** + +```ts +getRelativePath('a', 'b'); + +// './b' +``` diff --git a/docs/zh/pipeline.md b/docs/zh/pipeline.md index e0bdee12..c062b02a 100644 --- a/docs/zh/pipeline.md +++ b/docs/zh/pipeline.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { startPipeline } from 't-comm'; // or - import { startPipeline} from 't-comm/lib/pipeline/index'; ``` diff --git a/docs/zh/polling.md b/docs/zh/polling.md index d07c44b4..c3c9305f 100644 --- a/docs/zh/polling.md +++ b/docs/zh/polling.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { PollingRequest } from 't-comm'; // or - import { PollingRequest } from 't-comm/lib/polling/index'; ``` diff --git a/docs/zh/promise.md b/docs/zh/promise.md index e3029da8..741874e2 100644 --- a/docs/zh/promise.md +++ b/docs/zh/promise.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { toPromise } from 't-comm'; // or - import { toPromise} from 't-comm/lib/promise/index'; ``` diff --git a/docs/zh/rainbow-to-cos.md b/docs/zh/rainbow-to-cos.md index 3c5f9172..f5c4ae99 100644 --- a/docs/zh/rainbow-to-cos.md +++ b/docs/zh/rainbow-to-cos.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { watchRainbowToCosAndSendRobot } from 't-comm'; // or - import { watchRainbowToCosAndSendRobot} from 't-comm/lib/rainbow-to-cos/index'; ``` diff --git a/docs/zh/rainbow.md b/docs/zh/rainbow.md index baa65289..7c9015d1 100644 --- a/docs/zh/rainbow.md +++ b/docs/zh/rainbow.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -16,7 +16,6 @@ import { } from 't-comm'; // or - import { addOrUpdateRainbowKV, addRainbowKV, diff --git a/docs/zh/rd-platform-report.md b/docs/zh/rd-platform-report.md index dabf79a5..f822e2c1 100644 --- a/docs/zh/rd-platform-report.md +++ b/docs/zh/rd-platform-report.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { reportToRdPlatform } from 't-comm'; // or - import { reportToRdPlatform} from 't-comm/lib/rd-platform-report/index'; ``` diff --git a/docs/zh/rem-to-px.md b/docs/zh/rem-to-px.md index f6f645af..10c9bb41 100644 --- a/docs/zh/rem-to-px.md +++ b/docs/zh/rem-to-px.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { remToPxInFile } from 't-comm'; // or - import { remToPxInFile} from 't-comm/lib/rem-to-px/index'; ``` diff --git a/docs/zh/rem.md b/docs/zh/rem.md index 7b9f7797..e6595c58 100644 --- a/docs/zh/rem.md +++ b/docs/zh/rem.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { transFormRem } from 't-comm'; // or - import { transFormRem} from 't-comm/lib/rem/index'; ``` diff --git a/docs/zh/rollup.md b/docs/zh/rollup.md new file mode 100644 index 00000000..8b467672 --- /dev/null +++ b/docs/zh/rollup.md @@ -0,0 +1,26 @@ +[[toc]] + +

引入

+ +```ts +import { getDeps } from 't-comm'; + +// or +import { getDeps} from 't-comm/lib/rollup/index'; +``` + + +## `getDeps(dir)` + + +**描述**:

获取依赖列表

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| dir |

目录

| + +**返回**:

dependenciesList

+ diff --git a/docs/zh/router.md b/docs/zh/router.md index 1f6a4446..e9afb2e7 100644 --- a/docs/zh/router.md +++ b/docs/zh/router.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { findRouteName, getRouterFuncPath, diff --git a/docs/zh/scheduler.md b/docs/zh/scheduler.md index 5880ac35..a5939c15 100644 --- a/docs/zh/scheduler.md +++ b/docs/zh/scheduler.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { Scheduler } from 't-comm'; // or - import { Scheduler } from 't-comm/lib/scheduler/index'; ``` diff --git a/docs/zh/share/env.md b/docs/zh/share/env.md index 72fce6d5..4641c293 100644 --- a/docs/zh/share/env.md +++ b/docs/zh/share/env.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { initMiniProgramShare, openShareUI } from 't-comm'; // or - import { initMiniProgramShare, openShareUI} from 't-comm/lib/share/env/index'; ``` diff --git a/docs/zh/slash.md b/docs/zh/slash.md index b9eaace2..2a95e2e6 100644 --- a/docs/zh/slash.md +++ b/docs/zh/slash.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { removeFirstSlash, removeLastSlash, diff --git a/docs/zh/sleep.md b/docs/zh/sleep.md index 3337ea62..6e28de3d 100644 --- a/docs/zh/sleep.md +++ b/docs/zh/sleep.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { sleep } from 't-comm'; // or - import { sleep} from 't-comm/lib/sleep/index'; ``` diff --git a/docs/zh/storage.md b/docs/zh/storage.md index b997ab62..1a833e80 100644 --- a/docs/zh/storage.md +++ b/docs/zh/storage.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { savePersist, getPersist, diff --git a/docs/zh/tam/img.md b/docs/zh/tam/img.md index a8c4282f..aae35003 100644 --- a/docs/zh/tam/img.md +++ b/docs/zh/tam/img.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -11,7 +11,6 @@ import { } from 't-comm'; // or - import { genCustomEventImgAndSendRobot, genMultiImgAndSendRobot, diff --git a/docs/zh/tencent-cloud/cos.md b/docs/zh/tencent-cloud/cos.md index 9693ff61..00718940 100644 --- a/docs/zh/tencent-cloud/cos.md +++ b/docs/zh/tencent-cloud/cos.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { uploadCOSFile } from 't-comm'; // or - import { uploadCOSFile} from 't-comm/lib/tencent-cloud/cos/index'; ``` diff --git a/docs/zh/tencent-doc.md b/docs/zh/tencent-doc.md index 465fb442..8cd5bcbb 100644 --- a/docs/zh/tencent-doc.md +++ b/docs/zh/tencent-doc.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getTencentDocUserInfo } from 't-comm'; // or - import { getTencentDocUserInfo} from 't-comm/lib/tencent-doc/index'; ``` diff --git a/docs/zh/tgit.md b/docs/zh/tgit.md index 3650246a..d2765fc3 100644 --- a/docs/zh/tgit.md +++ b/docs/zh/tgit.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -19,7 +19,6 @@ import { } from 't-comm'; // or - import { getBranchLifeCycle, getProjectDefaultBranch, diff --git a/docs/zh/throttle.md b/docs/zh/throttle.md index 92bb0848..80ac6254 100644 --- a/docs/zh/throttle.md +++ b/docs/zh/throttle.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { throttle } from 't-comm'; // or - import { throttle} from 't-comm/lib/throttle/index'; ``` diff --git a/docs/zh/time.md b/docs/zh/time.md index 094d9dd1..c3df9abb 100644 --- a/docs/zh/time.md +++ b/docs/zh/time.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { timeStampFormat, dateFormat } from 't-comm'; // or - import { timeStampFormat, dateFormat} from 't-comm/lib/time/index'; ``` diff --git a/docs/zh/toast.md b/docs/zh/toast.md index 6b7a550f..bc91ce48 100644 --- a/docs/zh/toast.md +++ b/docs/zh/toast.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -14,7 +14,6 @@ import { } from 't-comm'; // or - import { showToast, showSuccess, diff --git a/docs/zh/uni-app.md b/docs/zh/uni-app.md index c4a1d335..b3e2c1ab 100644 --- a/docs/zh/uni-app.md +++ b/docs/zh/uni-app.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getRouteLeaveCache } from 't-comm'; // or - import { getRouteLeaveCache} from 't-comm/lib/uni-app/index'; ``` diff --git a/docs/zh/uploader.md b/docs/zh/uploader.md index a6f73993..9845e893 100644 --- a/docs/zh/uploader.md +++ b/docs/zh/uploader.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { uploadFile } from 't-comm'; // or - import { uploadFile} from 't-comm/lib/uploader/index'; ``` diff --git a/docs/zh/url.md b/docs/zh/url.md index 2a8cc04a..aea0a010 100644 --- a/docs/zh/url.md +++ b/docs/zh/url.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -18,7 +18,6 @@ import { } from 't-comm'; // or - import { resolveUrlParams, formatUrlParams, diff --git a/docs/zh/v-console.md b/docs/zh/v-console.md index 53e03aaa..ece5ec2f 100644 --- a/docs/zh/v-console.md +++ b/docs/zh/v-console.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -14,7 +14,6 @@ import { } from 't-comm'; // or - import { V_CONSOLE_STATE, genVConsole, diff --git a/docs/zh/v-lazy.md b/docs/zh/v-lazy.md index 65279021..322d4726 100644 --- a/docs/zh/v-lazy.md +++ b/docs/zh/v-lazy.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { getVLazyOptions } from 't-comm'; // or - import { getVLazyOptions} from 't-comm/lib/v-lazy/index'; ``` diff --git a/docs/zh/validate.md b/docs/zh/validate.md index 7970af0e..92d15bf2 100644 --- a/docs/zh/validate.md +++ b/docs/zh/validate.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -23,7 +23,6 @@ import { } from 't-comm'; // or - import { isIdCard, isRegExp, diff --git a/docs/zh/version-tip.md b/docs/zh/version-tip.md index 1cd634ba..9ec456c4 100644 --- a/docs/zh/version-tip.md +++ b/docs/zh/version-tip.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { genVersionAndSendChangeLog, genVersionTip, diff --git a/docs/zh/version.md b/docs/zh/version.md index 15ece10a..af78bad2 100644 --- a/docs/zh/version.md +++ b/docs/zh/version.md @@ -1,16 +1,31 @@ [[toc]] -## 引入 +

引入

```ts -import { compareVersion } from 't-comm'; +import { getPreReleaseVersion, compareVersion } from 't-comm'; // or - -import { compareVersion} from 't-comm/lib/version/index'; +import { getPreReleaseVersion, compareVersion} from 't-comm/lib/version/index'; ``` +## `getPreReleaseVersion(key)` + + +**描述**:

生成 alpha、beta 等这些预发布的版本

+ +**参数**: + + +| 参数名 | 描述 | +| --- | --- | +| key |

关键词

| + +**返回**:

生成的版本

+ + + ## `compareVersion(v1, v2)` diff --git a/docs/zh/vue-start.md b/docs/zh/vue-start.md index 9cccf29a..9cef49da 100644 --- a/docs/zh/vue-start.md +++ b/docs/zh/vue-start.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { startApp } from 't-comm'; // or - import { startApp} from 't-comm/lib/vue-start/index'; ``` diff --git a/docs/zh/watermark.md b/docs/zh/watermark.md index 668885f8..28bbd8be 100644 --- a/docs/zh/watermark.md +++ b/docs/zh/watermark.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { createWatcherMark } from 't-comm'; // or - import { createWatcherMark} from 't-comm/lib/watermark/index'; ``` diff --git a/docs/zh/weather.md b/docs/zh/weather.md index ab3a2d17..6e7c22b8 100644 --- a/docs/zh/weather.md +++ b/docs/zh/weather.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -10,7 +10,6 @@ import { } from 't-comm'; // or - import { fetchWeatherData, sendWeatherRobotMsg, diff --git a/docs/zh/wecom-robot.md b/docs/zh/wecom-robot.md index 6f6067cd..44556b1f 100644 --- a/docs/zh/wecom-robot.md +++ b/docs/zh/wecom-robot.md @@ -1,6 +1,6 @@ [[toc]] -## 引入 +

引入

```ts import { @@ -12,7 +12,6 @@ import { } from 't-comm'; // or - import { sendWxRobotMsg, sendWxRobotMarkdown, diff --git a/docs/zh/wx.md b/docs/zh/wx.md index 3487c54c..9143ccff 100644 --- a/docs/zh/wx.md +++ b/docs/zh/wx.md @@ -1,12 +1,11 @@ [[toc]] -## 引入 +

引入

```ts import { genSignature, getWxCfg } from 't-comm'; // or - import { genSignature, getWxCfg} from 't-comm/lib/wx/index'; ``` diff --git a/package.json b/package.json index 6d04591d..adeb23b8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "t-comm", - "version": "1.3.125", - "description": "丰富易用的工具库", + "version": "1.3.126", + "description": "专业、稳定、纯粹的工具库", "main": "lib/index.js", "module": "lib/index.esm.js", "typings": "lib/index.d.ts", @@ -146,4 +146,4 @@ "postchangelog": "node script/docs-jsdoc/change-log" } } -} +} \ No newline at end of file diff --git a/script/docs-jsdoc/deploy.js b/script/docs-jsdoc/deploy.js index 01d7080f..e3decf66 100644 --- a/script/docs-jsdoc/deploy.js +++ b/script/docs-jsdoc/deploy.js @@ -9,7 +9,7 @@ function main() { const hostName = process.env.HOST_NAME; const hostPwd = process.env.HOST_PWD; - execSync(`node bin/cli publish -s ${sourceDir} -t ${targetDir} -n ${hostName} -p ${hostPwd}`, { + execSync(`node bin/cli publish -s ${sourceDir} -t ${targetDir} -n ${hostName} -p "${hostPwd}"`, { stdio: 'inherit', }); } diff --git a/script/docs-jsdoc/markdown.js b/script/docs-jsdoc/markdown.js index 9f8137e8..5f7fc120 100644 --- a/script/docs-jsdoc/markdown.js +++ b/script/docs-jsdoc/markdown.js @@ -29,13 +29,12 @@ function getInsertImportWay(methods, fileName) { if (methods.length <= 2) { const methodStr = methods.join(', '); return ` -## 引入 +

引入

\`\`\`ts import { ${methodStr} } from 't-comm'; // or - import { ${methodStr}} from 't-comm/lib/${newFileName}'; \`\`\` `; @@ -43,7 +42,7 @@ import { ${methodStr}} from 't-comm/lib/${newFileName}'; const methodStr = methods.join(',\n '); return ` -## 引入 +

引入

\`\`\`ts import { @@ -51,7 +50,6 @@ import { } from 't-comm'; // or - import { ${methodStr} } from 't-comm/lib/${newFileName}';