Skip to content

Commit

Permalink
feat(dotenv): add csv/dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
novlan1 committed Jan 15, 2025
1 parent d63ed8b commit 8d6defe
Show file tree
Hide file tree
Showing 32 changed files with 1,317 additions and 72 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
/public/
/config/
/repo/
!.vuepress

!/docs/.vuepress/
/docs/.vuepress/dist/*

barcode/
127 changes: 127 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,132 @@
# 更新日志

### [1.3.143](https://github.com/novlan1/t-comm/compare/v1.3.142...v1.3.143) (2025-01-07)


### Features 🎉

* **lint:** stylelint 不处理vue文件 ([84c536f](https://github.com/novlan1/t-comm/commit/84c536f4b11072e6b6ad1dcdcc07964e36d362fc))

### [1.3.142](https://github.com/novlan1/t-comm/compare/v1.3.141...v1.3.142) (2025-01-07)


### Features 🎉

* **lint:** 优化全量模式 ([c22dfc0](https://github.com/novlan1/t-comm/commit/c22dfc02d481446817daf67aad4a951eb90ffa09))

### [1.3.141](https://github.com/novlan1/t-comm/compare/v1.3.140...v1.3.141) (2025-01-07)


### Features 🎉

* **lint:** 支持全量模式 ([d123dfe](https://github.com/novlan1/t-comm/commit/d123dfe4188ab287f3e7a787208c2073f029af4f))

### [1.3.140](https://github.com/novlan1/t-comm/compare/v1.3.139...v1.3.140) (2025-01-06)


### Features 🎉

* **lint:** add checkLint ([6fa2e55](https://github.com/novlan1/t-comm/commit/6fa2e5540354e94afe8e5e6e784a6332b21996d0))

### [1.3.139](https://github.com/novlan1/t-comm/compare/v1.3.138...v1.3.139) (2024-12-25)


### Features 🎉

* **csv:** add generateCSVData ([367cc49](https://github.com/novlan1/t-comm/commit/367cc4954bebc5ccdb7ecf841f183b32dae5c091))

### [1.3.138](https://github.com/novlan1/t-comm/compare/v1.3.137...v1.3.138) (2024-12-24)


### Features 🎉

* **csv:** add generateCSV ([d3d68e1](https://github.com/novlan1/t-comm/commit/d3d68e1612a224f7ef6614f5ae959643be4a731d))

### [1.3.137](https://github.com/novlan1/t-comm/compare/v1.3.136...v1.3.137) (2024-12-24)


### Documentation 📖

* update docs ([8956a30](https://github.com/novlan1/t-comm/commit/8956a309c5f2c42d065d0ae134fb9bc41da078ee))


### Features 🎉

* **slice-object:** 边界处理 ([12d0585](https://github.com/novlan1/t-comm/commit/12d05853cd559b1dc7ee229e20261cffac4a380f))

### [1.3.136](https://github.com/novlan1/t-comm/compare/v1.3.135...v1.3.136) (2024-12-18)


### Features 🎉

* **debounce:** add debug ([f58f48c](https://github.com/novlan1/t-comm/commit/f58f48ccfe68d07260b7f07721f6658a8e7fc31e))

### [1.3.135](https://github.com/novlan1/t-comm/compare/v1.3.134...v1.3.135) (2024-12-18)

### [1.3.134](https://github.com/novlan1/t-comm/compare/v1.3.133...v1.3.134) (2024-12-18)


### Features 🎉

* **debounce:** update type ([b3c4e63](https://github.com/novlan1/t-comm/commit/b3c4e631a727a44d6822b983177635f0bf8e668d))

### [1.3.133](https://github.com/novlan1/t-comm/compare/v1.3.132...v1.3.133) (2024-12-18)


### Features 🎉

* **debounce:** add debounceRun ([cfe2740](https://github.com/novlan1/t-comm/commit/cfe27400fc16d6e6e876d308d66fc082a7ac279f))

### [1.3.132](https://github.com/novlan1/t-comm/compare/v1.3.131...v1.3.132) (2024-12-18)


### Features 🎉

* **uni-hook:** add debug in invoke ([1118bfa](https://github.com/novlan1/t-comm/commit/1118bfa62be713a7a519e877fb148b5f5b01c625))

### [1.3.131](https://github.com/novlan1/t-comm/compare/v1.3.130...v1.3.131) (2024-12-18)


### Features 🎉

* **uni-hook:** use addInterceptor ([889df7d](https://github.com/novlan1/t-comm/commit/889df7d8dab31c1e99694e40b2486d764e54224b))

### [1.3.130](https://github.com/novlan1/t-comm/compare/v1.3.129...v1.3.130) (2024-12-18)


### Features 🎉

* update dotenv ([e570221](https://github.com/novlan1/t-comm/commit/e5702211621d2f142c72ce585d260be69b7d974a))

### [1.3.129](https://github.com/novlan1/t-comm/compare/v1.3.128...v1.3.129) (2024-12-18)


### Features 🎉

* **startUniProject:** 支持可选参数 ([383b8ec](https://github.com/novlan1/t-comm/commit/383b8ec12d44bbc8b6172e6a557aa85204883e06))

### [1.3.128](https://github.com/novlan1/t-comm/compare/v1.3.127...v1.3.128) (2024-12-18)


### Features 🎉

* **dotenv:** add loadDotenv ([e2c9fc6](https://github.com/novlan1/t-comm/commit/e2c9fc6ba317197a87a9afa48ae4c9d2f5058596))

### [1.3.127](https://github.com/novlan1/t-comm/compare/v1.3.126...v1.3.127) (2024-12-16)


### Documentation 📖

* update docs ([f25e150](https://github.com/novlan1/t-comm/commit/f25e1502738fb25909789ef5a8b54e617967d735))
* update docs ([12b9f1d](https://github.com/novlan1/t-comm/commit/12b9f1d00300074e01975e282aa8d3e81ef101cd))
* update docs ([ad95eff](https://github.com/novlan1/t-comm/commit/ad95eff2beb8da645999e1a4e02f37a06ad1590c))
* update docs ([2ab440a](https://github.com/novlan1/t-comm/commit/2ab440a4cbd53c70861c672f2d8182582231dce3))


### Features 🎉

* **node-command:** support more options ([ef67c06](https://github.com/novlan1/t-comm/commit/ef67c06dfe5bad65e3a8f946d15a351216074708))

### [1.3.126](https://github.com/novlan1/t-comm/compare/v1.3.125...v1.3.126) (2024-12-13)


Expand Down
32 changes: 32 additions & 0 deletions docs/zh/csv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[[toc]]

<h2>引入</h2>

```ts
import { generateCSV } from 't-comm';

// or
import { generateCSV} from 't-comm/lib/csv/index';
```


## `generateCSV(dataList)`


**描述**:<p>生成 CSV 文件内容,可以用于 fs.writeFileSync 输出</p>
<p>第一行为表头</p>

**参数**


| 参数名 | 类型 | 描述 |
| --- | --- | --- |
| dataList | <code>Array&lt;Array&lt;string&gt;&gt;</code> | <p>二维数据列表</p> |

**返回**: <p>生成的字符串</p>

**示例**

```ts
generateCSV([['a','b'], ['1', '2']]);
```
14 changes: 13 additions & 1 deletion docs/zh/daily-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ import { dailyMerge} from 't-comm/lib/daily-merge/index';


**描述**:<p>每日合并</p>
<ol>
<li>获取昨天有活跃的分支</li>
<li>对于每个分支,进行合并并推送
<ul>
<li>清理 Git 环境</li>
<li>切到主分支,并拉最新代码</li>
<li>切到当前分支,拉最新代码</li>
<li>尝试执行 git merge</li>
<li>对比 merge 前后的 commit 信息是否相同,作为判断 merge 是否成功的依据</li>
</ul>
</li>
<li>发送机器人消息</li>
</ol>

**参数**

Expand All @@ -39,7 +52,6 @@ import { dailyMerge} from 't-comm/lib/daily-merge/index';
dailyMerge({
webhookUrl: 'xx',
appName: 'xx',
projectId: 'xx',
devRoot: 'xx',

baseUrl: 'xx',
Expand Down
30 changes: 27 additions & 3 deletions docs/zh/debounce.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,35 @@
<h2>引入</h2>

```ts
import { debounce } from 't-comm';
import { debounceRun, debounce } from 't-comm';

// or
import { debounce} from 't-comm/lib/debounce/index';
import { debounceRun, debounce} from 't-comm/lib/debounce/index';
```


## `debounce(fn, time)`
## `debounceRun`


**描述**:<p>不用生成中间函数的防抖</p>

**参数**



**示例**

```ts
debounceRun(func, args, {
funcKey: 'funcKey',
wait: 500, // 默认 500
throttle: false, // 是否是节流,默认 false
immediate: true, // 是否立即执行,默认 true
})
``
<a name="debounce"></a>

## `debounce(fn, time, immediate)`


**描述**<p>防抖,场景:搜索</p>
Expand All @@ -24,6 +45,7 @@ import { debounce} from 't-comm/lib/debounce/index';
| --- | --- | --- |
| fn | <code>function</code> | <p>主函数</p> |
| time | <code>number</code> | <p>间隔时间,单位 <code>ms</code></p> |
| immediate | <code>boolean</code> | <p>是否立即执行,默认 <code>false</code></p> |

**返回**: <p>闭包函数</p>

Expand All @@ -34,4 +56,6 @@ function count() {
console.log('xxxxx')
}
window.onscroll = debounce(count, 500)
window.onscroll = debounce(count, 500, true)
```
38 changes: 38 additions & 0 deletions docs/zh/dotenv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[[toc]]

<h2>引入</h2>

```ts
import { loadDotenv } from 't-comm';

// or
import { loadDotenv} from 't-comm/lib/dotenv/index';
```


## `loadDotenv(file, param)`


**描述**:<p>用 dotenv-expand 加载环境变量</p>

**参数**


| 参数名 | 描述 |
| --- | --- |
| file | <p>文件路径,默认 .env.local</p> |
| param | <p>参数</p> |



**示例**

```ts
loadEnv();

loadEnv('.env');

loadEnv('.env.local', {
debug: false, // 是否打印日志,默认 true
});
```
2 changes: 1 addition & 1 deletion docs/zh/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ import {
| --- | --- | --- |
| command | <code>string</code> | <p>命令</p> |
| root | <code>string</code> | <p>执行命令的目录</p> |
| stdio | <code>string</code> | <p>结果输出,默认为 pipe</p> |
| stdio | <code>string</code> \| <code>object</code> | <p>结果输出,默认为 pipe</p> |

**返回**: <code>string</code><br>

Expand Down
33 changes: 31 additions & 2 deletions docs/zh/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
import {
findRouteName,
getRouterFuncPath,
getH5CurrentUrl
getH5CurrentUrl,
uniHookRouter
} from 't-comm';

// or
import {
findRouteName,
getRouterFuncPath,
getH5CurrentUrl
getH5CurrentUrl,
uniHookRouter
} from 't-comm/lib/router/index';
```

Expand Down Expand Up @@ -79,3 +81,30 @@ console.log('name', name);
```ts
getH5CurrentUrl(this.$route);
```
<a name="uniHookRouter"></a>

## `uniHookRouter()`


**描述**:<p>拦截路由</p>

**参数**



**示例**

```ts
uniHookRouter({
navigateToHooks: [
() => console.log('1')
],
navigateBackHooks: [
() => console.log('2')
],
redirectToHooks: [
() => console.log('3')
],
debug: true,
})
```
29 changes: 27 additions & 2 deletions docs/zh/uni-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<h2>引入</h2>

```ts
import { getRouteLeaveCache } from 't-comm';
import { getRouteLeaveCache, startUniProject } from 't-comm';

// or
import { getRouteLeaveCache} from 't-comm/lib/uni-app/index';
import { getRouteLeaveCache, startUniProject} from 't-comm/lib/uni-app/index';
```


Expand All @@ -27,3 +27,28 @@ import { getRouteLeaveCache} from 't-comm/lib/uni-app/index';

**返回**: <p>返回对象,包含 beforeRouteLeave 和 activated 方法</p>

<a name="startUniProject"></a>

## `startUniProject(options)`


**描述**:<p>启动 uni-app 项目</p>

**参数**


| 参数名 | 描述 |
| --- | --- |
| options | <p>参数</p> |



**示例**

```ts
startUniProject();

startUniProject({
debug: false, // 默认为 true,会打印参数
})
```
Loading

0 comments on commit 8d6defe

Please sign in to comment.