Skip to content

Commit

Permalink
release v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed May 18, 2023
1 parent ccd8e94 commit 1a154b9
Show file tree
Hide file tree
Showing 57 changed files with 34,844 additions and 35,257 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/lib
/dist
/temp
/docs

*.bak
*_bak
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.30.0
version: 8.5.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.30.0
version: 8.5.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/
dist/
es/
lib/
docs/
npm-debug.log
yarn.lock
yarn-error.log
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/lib
/dist
/temp
/docs

*.bak
*_bak
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cSpell.words": [
"activex",
"esbuild",
"esno",
"filesize",
Expand Down
107 changes: 58 additions & 49 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,150 +1,159 @@
# 更新日志
# Change logs

## 2023.05.18 v4.0.0

1. split `csv` into `arrayToCSV` `CSVToArray` `CSVToJSON` `JSONToCSV`
2. split `cache` into `setCache` `getCache` `delCache`
3. split `session`into `setSession` `getSession` `delSession`
4. split `cookie` into `setCookie` `getCookie` `delCookie`
5. drop `tslib` package
6. new build scripts & output

## 2023.04.07 v3.1.0

1. 优化构建输出,把 `tslib` 从包中移出
1. Optimize build output by removing `tslib` from the package

## 2023.04.06 v3.0.0

1. 移除 `imgAdapt` `imgChoose` `throttle` `debounce` `enWxJumpLink` `enWxJumpLinkOld` `deWxJumpLink` `deWxJumpLinkOld` `clearHtmlExpSN` `clearHtmlN` `clearHtmlNS` `clearHtmlTag` `formatTime` `formatTimeStr` `getFileType` `clearBr`
1. remove `imgAdapt` `imgChoose` `throttle` `debounce` `enWxJumpLink` `enWxJumpLinkOld` `deWxJumpLink` `deWxJumpLinkOld` `clearHtmlExpSN` ` clearHtmlN` `clearHtmlNS` `clearHtmlTag` `formatTime` `formatTimeStr` `getFileType` `clearBr`
2. move `arrayToCSV` `CSVToArray` `CSVToJSON` `JSONToCSV` to `csv`
3. move `setCache` `getCache` `delCache` to `cache`
4. move `setSession` `getSession` `delSession` to `session`
5. move `setCookie` `getCookie` `delCookie` to `cookie`
6. add `isPlainObject` function
7. 支持 `const addEvent = require('js-cool/addEvent')` 这种引入方式
8. 构建产物区分 esnext es5,默认输出 esnext
7. support `const addEvent = require('js-cool/addEvent')` This introduction method
8. build product differentiate between esnext and es5, default output esnext
9. `splitThousand` => `toThousands`
10. `getWindowSize` => `windowSize`
11. new `extend` function

## 2022.12.13 v2.8.0

1. `loadSource` `mountCss` `mountImg` `mountJs` `mountStyle`新增支持传入自定义属性,调整入参形式,并完善 ts 类型,修复 IE 兼容问题
2. 依赖包升级
1. `loadSource` `mountCss` `mountImg` `mountJs` `mountStyle` new support for passing in custom properties, adjusting the input form, and improving the ts type, fixing IE compatibility issues
2. dependency package upgrade

## 2022.12.07 v2.7.1

1. 扩展`getType`方法支持的类型
Extend the types supported by `getType` method.

## 2022.12.04 v2.7.0

1. 新增`setProperty`方法
2. 修复 getProperty bug
1. add `setProperty` method
2. fix getProperty bug

## 2022.12.04 v2.6.0

1. 新增`loadSource` `mountCss` `mountImg` `mountJs` `mountStyle` 5 个方法
2. 升级依赖包
1. add `loadSource` `mountCss` `mountImg` `mountJs` `mountStyle` 5 methods
2. upgrade the dependency package

## 2022.09.10 v2.5.0

1. 调整 exports 导出方式,重点支持 node esm 模式
2. 优化构建脚本
3. 升级依赖包
1. adjust exports export method, focus on supporting node esm mode
2. optimize build scripts
3. upgrade dependency packages

## 2022.08.23 v2.4.0

1. 升级依赖包
2. 优化构建流程
1. upgrade dependency packages
2. optimize the build process

## 2022.03.12 v2.3.2

1. 升级依赖包
2. 优化文档
1. upgrade dependency packages
2. optimize the documentation

## 2022.02.25 v2.3.1

1. 修复`tslib`包问题
1. fix `tslib` package issue

## 2021.11.11 v2.3.0

1. 导出模块进保留 default
2. 依赖包升级
1. export module to keep default
2. upgrade dependency package

## 2021.10.23 v2.2.4

1. 新增 getProperty 方法
1. add getProperty method

## 2021.10.19 v2.2.3

1. 完善 fillIPv6 方法
1. improve fillIPv6 method

## 2021.10.18 v2.2.2

1. 新增 fillIPv6 方法
1. add fillIPv6 method

## 2021.10.15 v2.2.1

1. 新增多个数组求交集、并集、差集、补集的方法
2. 新增 contains 方法
3. 新增 unique 去重的方法
1. add methods to find the intersection, concatenation, difference and complement of multiple arrays
2. add contains method
3. add a unique method for de-duplication

## 2021.09.21 v2.1.3

1. 构建输出 banner
1. build output banner

## 2021.09.10 v2.1.2

1. 完善 typescript 类型
2. 依赖包升级
1. improve typescript types
2. upgrade dependency package

## 2021.09.02 v2.1.1

1. 完善 typescript 类型
1. refine typescript types

## 2021.08.29 v2.1.0

1. 新增构建 es 模块
1. add build es module

## 2021.08.28 v2.0.1

1. 修复几个问题
2. 优化代码,优化文档
1. fix several issues
2. optimize code, optimize documentation

## 2021.08.26 v2.0.0

1. 全部改用 typescript 重构
2. 方法注释按 tsdoc 规范重新写
1. refactor all the code to typescript
2. rewrite method comments according to tsdoc specification

## 2021.07.26 v1.1.0

1. 采用 webpack umd
1. use webpack to build umd package

## 2021.03.03 v1.0.9

1. 新增 all/any/RGBToHex/uuid 等方法
2. 新增 CSV 与对象之间的互转方法:arrayToCSV/CSVToArray/CSVToJSON/JSONtoCSV
1. add all/any/RGBToHex/uuid methods
2. add CSV to object conversion methods: arrayToCSV/CSVToArray/CSVToJSON/JSONtoCSV

## 2021.03.02 v1.0.8

1. 新增 splitThousand 千分位分割方法
1. add splitThousand method

## 2021.03.01 v1.0.7

1. 修复 nextIndex bug
1. fix nextIndex bug

## 2021.02.18 v1.0.6

1. 新增 openUrl 方法
1. add openUrl method

## 2021.02.18 v1.0.5

1. 新增 download/searchTreeObject 方法
1. add download/searchTreeObject method

## 2021.02.08 v1.0.4

1. 更新 getCookie/setCookie 方法
1. update getCookie/setCookie methods

## 2021.02.01 v1.0.3

1. 处理 BUG
1. handle bugs

## 2021.01.23 v1.0.2

1. 新增 nextIndex,fixNumber,delay,extend,getType,isArray,cleanData,getCache,setCache,delCache
2. 删除 getLocal,setLocal,delLocal
1. add nextIndex,fixNumber,delay,extend,getType,isArray,cleanData,getCache,setCache,delCache
2. delete getLocal,setLocal,delLocal

## 2020.12.14 v1.0.1

1. 创建项目
1. create project
64 changes: 16 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<div style="text-align: center; margin-bottom: 20px;" align="center">

### **[使用文档](./docs/modules.md)**&nbsp; &nbsp; &nbsp; &nbsp;[更新日志](./CHANGELOG.md)
### **[Documentation](https://www.saqqdy.com/js-cool)****[Change Log](./CHANGELOG.md)**

</div>

Expand Down Expand Up @@ -56,61 +56,20 @@ getOsVersion() // 返回系统版本
// ...
```

### 按需引入

```js
// 在你的.vue或者main.js里面写上import
import download from 'js-cool/lib/download'
// 使用
download(url, filename) // 下载文件
// ...
```

### 使用文件引入的方式

1. 通过 require 引入

```js
// 在你的main.js文件里面加上下面这一行
require('js-cool')
const { getOsVersion } = require('js-cool')
```

2. html 静态页直接使用

```html
<!-- 在你的html代码上加上script标签,使用CDN链接引入 -->
<script src="https://unpkg.com/js-cool@2.3.2/lib/index.umd.js"></script>
```

### 使用按需打包

1. 安装依赖

```shell
# 使用npm
npm install -D babel-plugin-import
# 使用yarn
yarn add -D babel-plugin-import
```

2. babel 设置

```js
// babel.config.js
module.exports = {
plugins: [
[
'import',
{
libraryName: 'js-cool',
style: false,
libraryDirectory: 'lib',
camel2DashComponentName: false
},
'js-cool'
]
]
}
<script src="https://unpkg.com/js-cool@4.0.0/dist/js-cool.global.prod.js"></script>
```

## 所有方法汇总
Expand Down Expand Up @@ -146,9 +105,15 @@ const functionList = {
getParameter, // 获取单个URL参数
getUrlParam, // 获取URL参数
// 缓存、cookie、session
cache, // 读取、写入、删除localStorage
session, // 读取、写入、删除sessionStorage
cookie, // 读取、写入、删除cookie
getCache, // 读取localStorage
setCache, // 写入localStorage
delCache, // 删除localStorage
getSession, // 读取sessionStorage
setSession, // 写入sessionStorage
delSession, // 删除sessionStorage
getCookie, // 读取cookie
setCookie, // 写入cookie
delCookie, // 删除cookie
// 编码与解码
encodeBase64, // 字符串、数字转base64
encodeUtf8, // 编码Utf8
Expand All @@ -175,7 +140,10 @@ const functionList = {
all, // 如果所提供的谓词函数对一个集合中的所有元素都返回true,则返回true,否则返回false。
any, // 如果所提供的谓词函数对一个集合中的至少一个元素返回true,则返回true,否则返回false。
uuid, // 浏览器端生成uuid,采用v4方法
csv, // csv与json、array相互转换
CSVToArray, // csv与json、array相互转换
arrayToCSV, // csv与json、array相互转换
CSVToJSON, // csv与json、array相互转换
JSONToCSV, // csv与json、array相互转换
RGBToHex, // 将RGB组件的值转换为颜色代码。
intersect, // 多个数组求交集
union, // 求多个数组的并集
Expand Down
2 changes: 1 addition & 1 deletion api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"projectFolder": "./src",
"mainEntryPointFilePath": "./lib/index.d.ts",
"mainEntryPointFilePath": "./temp/index.d.ts",
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
Expand Down
Loading

0 comments on commit 1a154b9

Please sign in to comment.