Skip to content

Commit

Permalink
docs: show CHANGELOG at docs
Browse files Browse the repository at this point in the history
  • Loading branch information
flingyp committed Dec 15, 2022
1 parent 09d77b9 commit 623e54e
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ const defaultSideBar = [

const docsSideBar = [...defaultSideBar, ...sideBar]

const defaultNav = [{ text: 'Guide', items: [{ text: 'Get Started', link: '/guide/' }] }]
const guideNav = [{ text: 'Guide', items: [{ text: 'Get Started', link: '/guide/' }] }]

const defaultVersionNav = [
const versionNav = [
{
text: `${version}`,
items: [{ text: 'CHANGELOG.md', link: 'https://github.com/flingyp/flypeng-tool/blob/dev/CHANGELOG.md' }]
items: [{ text: 'CHANGELOG', link: '/guide/CHANGELOG' }]
}
]

const docsNav = [...defaultNav, ...navBar, ...defaultVersionNav]
const docsNav = [...guideNav, ...navBar, ...versionNav]

export default defineConfig({
base: '/flypeng-tool',
Expand Down
201 changes: 201 additions & 0 deletions docs/guide/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@

### [4.0.1](https://github.com/flingyp/flypeng-tool/compare/v4.0.0...v4.0.1) (2022-12-12)


### ✨ Features | 新功能

* **useListenNetwork:** useListenNetwork optimization ([98c1d05](https://github.com/flingyp/flypeng-tool/commit/98c1d054f8aa464ebd0eae02d7837e9716556d84))

## [4.0.0](https://github.com/flingyp/flypeng-tool/compare/v3.0.1...v4.0.0) (2022-12-07)


### ✨ Features | 新功能

* subpackage dev and divied into @flypeng/browser package and @flypeng/node package ([7792176](https://github.com/flingyp/flypeng-tool/commit/779217679f0af9c67e123e928729ea6e7123805a))

### [3.0.1](https://github.com/flingyp/flypeng-tool/compare/v3.0.0...v3.0.1) (2022-12-07)


### ✏️ Documentation | 文档

* solve docs build appear error of import node packages ([16c4f54](https://github.com/flingyp/flypeng-tool/commit/16c4f54dd41a680a2e7a512734fb5451697f0792))


### ✨ Features | 新功能

* **useGetCurrentDirectory:** rename useGetCurrentPath ([2ff9afd](https://github.com/flingyp/flypeng-tool/commit/2ff9afdc76dc25142b8d7487d0b6b6db8819565c))


### 🐛 Bug Fixes | Bug 修复

* appear vitest v0.25.5 version process don't ending and reduced version to v0.25.3 ([0596fb3](https://github.com/flingyp/flypeng-tool/commit/0596fb37c2c99ec895acc4ac12a4c65418ee99df))

## [3.0.0](https://github.com/flingyp/flypeng-tool/compare/v2.3.0...v3.0.0) (2022-12-06)


### ✏️ Documentation | 文档

* add version description ([cfe4e84](https://github.com/flingyp/flypeng-tool/commit/cfe4e84d265449cff3f53babf4b9835e4efc59c5))
* add version navbar ([b054327](https://github.com/flingyp/flypeng-tool/commit/b0543272b9e597a3b61ec2936ee203d7d960edf2))


### ✨ Features | 新功能

* add Node module and add three hooks functions of node ([fb90625](https://github.com/flingyp/flypeng-tool/commit/fb9062513272f588102c70fc4c780a0fa7fc250d))
* **isWechatBrowser:** new Function ([faf59da](https://github.com/flingyp/flypeng-tool/commit/faf59dad3aaef69265a647bfc4ac718137cbd4a0))


### 🐛 Bug Fixes | Bug 修复

* execute pnpm release command error ([d745b75](https://github.com/flingyp/flypeng-tool/commit/d745b7544ea572151860993c99533cc5d9b60efb))

## [2.3.0](https://github.com/flingyp/flypeng-tool/compare/v2.2.0...v2.3.0) (2022-11-29)


### ✨ Features | 新功能

* **useCustomContextMenu:** new Function ([388fc28](https://github.com/flingyp/flypeng-tool/commit/388fc28a98ad868d59a2d76d8e972c49f64c2717))
* **useObjectIsEmpty:** new Function ([b8d7f69](https://github.com/flingyp/flypeng-tool/commit/b8d7f69121cbfa290783154d6437cd8b209b48b4))
* **usePageTabSwitch:** new Function ([1720cb7](https://github.com/flingyp/flypeng-tool/commit/1720cb7c53b4e13c40548a7fb1c9f229c42ad7ee))
* **usePreventSeeSourceCode:** new Function ([1372d88](https://github.com/flingyp/flypeng-tool/commit/1372d88a3adc329075b94f8efa2abffb2abe9646))

## [2.2.0](https://github.com/flingyp/flypeng-tool/compare/v2.1.0...v2.2.0) (2022-11-18)


### ✨ Features | 新功能

* modify function name, useCopy to useCopySelector ([dfbdd8b](https://github.com/flingyp/flypeng-tool/commit/dfbdd8b4bf4cdce3ac599206d4995c037ea4652b))
* **useCommonType:** add isRegExp function ([b5443a6](https://github.com/flingyp/flypeng-tool/commit/b5443a6ac3f40e42c9e80d050d57852f78f623fa))
* **useDeepClone:** new Function ([1bf9f48](https://github.com/flingyp/flypeng-tool/commit/1bf9f483ec5aedaad0a6277303b31f5fb87516a7))


### 🐛 Bug Fixes | Bug 修复

* **useCopyContent:** new Function ([fca7181](https://github.com/flingyp/flypeng-tool/commit/fca7181c8137bc487256cf148e4e0d68941f97cb))

## [2.1.0](https://github.com/flingyp/flypeng-tool/compare/v2.0.1...v2.1.0) (2022-10-15)


### ✨ Features | 新功能

* **useAddDateDay:** new Function ([48bfa2d](https://github.com/flingyp/flypeng-tool/commit/48bfa2d731be370e726b766472e48654349e2687))
* **useCommonDate:** useGetFirstDay、useGetLastDay ([0b4d919](https://github.com/flingyp/flypeng-tool/commit/0b4d9197209a1fde37d9da04e8a854aaaac935dc))
* **useDifDaysValue:** new Function ([2c96a55](https://github.com/flingyp/flypeng-tool/commit/2c96a55607dd00b3a764d78a6c29880bc34a5359))
* useFormatDate support deliver Date type ([8d726ae](https://github.com/flingyp/flypeng-tool/commit/8d726ae7207bd7b2fd3624c140b6e17daa564ed7))
* **useTransformCase:** new Function ([b98dbd2](https://github.com/flingyp/flypeng-tool/commit/b98dbd2fda5a7cc8ec1b49707f3705c54f39eef6))

### [2.0.1](https://github.com/flingyp/flypeng-tool/compare/v2.0.0...v2.0.1) (2022-09-29)


### 🐛 Bug Fixes | Bug 修复

* **useFormateDate:** delete console ([7e2a132](https://github.com/flingyp/flypeng-tool/commit/7e2a1327b534125b9aeae1896a14b4078830a65e))

## [2.0.0](https://github.com/flingyp/flypeng-tool/compare/v1.4.2...v2.0.0) (2022-09-24)


### ✏️ Documentation | 文档

* 修改文档主题 ([e96b34f](https://github.com/flingyp/flypeng-tool/commit/e96b34f0182b1499ddbccea86adce968c7f7cab3))
* change light theme ([4578f60](https://github.com/flingyp/flypeng-tool/commit/4578f6088a17cc5b15340daff9844dc3d4863645))
* change useCheckIncludeNumber error ([241fd84](https://github.com/flingyp/flypeng-tool/commit/241fd8459ff97a3769f885245dd0c678cba6af74))
* useCommonType add Type Declaration ([77b9cf1](https://github.com/flingyp/flypeng-tool/commit/77b9cf1e87b06d1d1c588dd381d9c278a2d7e062))


### ✨ Features | 新功能

* **useCheckIncludeEmoji:** new Function ([227fa36](https://github.com/flingyp/flypeng-tool/commit/227fa3646051910806e6bf757509b897bbc315ae))
* **useCommonDate:** useLeapYear to useCommonDate ([2ddcbe7](https://github.com/flingyp/flypeng-tool/commit/2ddcbe7e980f7518531ccf7afc6e32cd3fc53ace))
* **useCopy:** new Function ([6c22ec0](https://github.com/flingyp/flypeng-tool/commit/6c22ec0ab2fd48c988c9e8dac710ed37c502731a))
* **useDownloadFile:** new Function ([5508eb2](https://github.com/flingyp/flypeng-tool/commit/5508eb203f714bbc5cb69143df535e1ea37cbbb5))
* **useDownloadFile:** use Blob to download file ([6ea740e](https://github.com/flingyp/flypeng-tool/commit/6ea740e288f251a724f62c3de27a1467ffddf0b8))
* **useFormatDate:** new Function ([2c46a73](https://github.com/flingyp/flypeng-tool/commit/2c46a735a156fe5fcd4c603d148fd2d3801728d7))
* **useLeapYear:** new Function ([57be3c9](https://github.com/flingyp/flypeng-tool/commit/57be3c91dd455c111f9b10d3260854aa4d969a22))
* **useMonthNumber:** new Function ([a67056d](https://github.com/flingyp/flypeng-tool/commit/a67056dc9b3330834ce52c8095fce977b0627bd0))
* **useNumberSeparate:** new Function ([188963f](https://github.com/flingyp/flypeng-tool/commit/188963fa042387ed29deaa32dd1a7ca13101f5be))
* **useTodayWeek:** new Function ([7447d56](https://github.com/flingyp/flypeng-tool/commit/7447d56851c469dc0aaba9809c0001b832373be2))

### [1.4.2](https://github.com/flingyp/flypeng-tool/compare/v1.4.1...v1.4.2) (2022-09-11)


### ✏️ Documentation | 文档

* 修改在线演示,使用[@vitepress-demo-preview](https://github.com/vitepress-demo-preview)插件 ([154080b](https://github.com/flingyp/flypeng-tool/commit/154080bfdad5b541f62731c48410eb90bf2aa615))


### ✨ Features | 新功能

* improve useDebounce Function ([d845707](https://github.com/flingyp/flypeng-tool/commit/d845707d47e39961553897eec0ecaa6f0d622579))
* improve useThrottle Function ([9d02fca](https://github.com/flingyp/flypeng-tool/commit/9d02fca5be1a1d70c091dfa0aedee146aab93c3b))
* **useMobileDevice:** new Function ([49d7aa0](https://github.com/flingyp/flypeng-tool/commit/49d7aa0a786ba882b99e05faf772b1f15584c7e4))

### [1.4.1](https://github.com/flingyp/flypeng-tool/compare/v1.4.0...v1.4.1) (2022-08-19)


### ✨ Features | 新功能

* **useDebounce:** new Function ([f747352](https://github.com/flingyp/flypeng-tool/commit/f7473520b66bbc600c62f7f3b80a794aa8172294))
* **useThrottle:** new Function ([f67c262](https://github.com/flingyp/flypeng-tool/commit/f67c262e6e5d8525d940a69bca12a24679d340e0))


### ✏️ Documentation | 文档

* theme change ([867add7](https://github.com/flingyp/flypeng-tool/commit/867add7161db19c0d90aebb041964df8a4feb144))
* useDebounce example code change ([c8691b6](https://github.com/flingyp/flypeng-tool/commit/c8691b668b206c046892e6573a5773e792d17d85))
* **useDebounce:** 修改文档案例 ([f794498](https://github.com/flingyp/flypeng-tool/commit/f794498c1d6756f83011717e90e50c8e32f93b77))

## [1.4.0](https://github.com/flingyp/YToolUse/compare/v1.3.0...v1.4.0) (2022-08-10)

### 🐛 Bug Fixes | Bug 修复

- demo Source not click ([7a3a164](https://github.com/flingyp/YToolUse/commit/7a3a1649484a745389942502037d66cd1c980ccc))
- Source url error ([4952351](https://github.com/flingyp/YToolUse/commit/4952351ed5993e31aca4a545cbafb26c177fd296))

### ✏️ Documentation | 文档

- add contributing article ([20f82cb](https://github.com/flingyp/YToolUse/commit/20f82cbc517fdf205e457371849be0c04256f679))

### ✨ Features | 新功能

- **useCheckEmailUrl:** new Function ([f7611fb](https://github.com/flingyp/YToolUse/commit/f7611fbf8c124a2ef840faa667c501dc21d9fb04))
- **usecheckidcard:** new Function ([1f6d412](https://github.com/flingyp/YToolUse/commit/1f6d41282a69b8302ac6a738e756456ac78e857d))
- **useCheckIncludeChinese:** new Function ([bec9adb](https://github.com/flingyp/YToolUse/commit/bec9adb48c8973ad2774acdd5948d5e71269ed89))
- **useCheckIncludeNumber:** new Function ([27d743c](https://github.com/flingyp/YToolUse/commit/27d743c7eac3e6c015e8c05147d245f5ac1de4a9))
- **useCheckPhoneNumber:** new Function ([920eb99](https://github.com/flingyp/YToolUse/commit/920eb9933cc52e2bc811f9aac17e3134962c4845))
- **useCheckQQNumber:** new Function ([ad67cd7](https://github.com/flingyp/YToolUse/commit/ad67cd7131e7f781e17876a8a8c04676f4cbd48a))
- **useDataType:** new Function ([57ce3e0](https://github.com/flingyp/YToolUse/commit/57ce3e03dc538d66ad74962a803826ecb81258b5))
- **useIsBrowser:** new function ([9377309](https://github.com/flingyp/YToolUse/commit/9377309a03b74448687dd50563121cb48c31bb8d))

## 1.3.0 (2022-07-28)

### ✏️ Documentation | 文档

- 修改文档相关样式。站点图片,代码块 ([8b9ce96](https://github.com/flingyp/YToolUse/commit/8b9ce96bc0f6225f3b7e071f0662aa6e97cc03ad))
- add function source code github link ([06381b1](https://github.com/flingyp/YToolUse/commit/06381b1a6d545d3e238de6bf5fb588acadfde0cf))
- Get Started Perfect ([1680d65](https://github.com/flingyp/YToolUse/commit/1680d65c3abf0bbf6ad88424825be1cc524b0d11))
- **script/dosc.ts:** auto generate docs sideBar script file ([b3fafc0](https://github.com/flingyp/YToolUse/commit/b3fafc01192e9693b2c0a104bd8879342abfbee2))

### ✨ Features | 新功能

- 更改包名为 WebTool,初始化文档 docs ([fef60a8](https://github.com/flingyp/YToolUse/commit/fef60a8d1724aac9538cf48c9c4388b6097b893b))
- 删除 core 模块,添加 Number Functions 模块 ([189e1ea](https://github.com/flingyp/YToolUse/commit/189e1ea8f28f9738150dbcbaac7625f0ee5d9f66))
- add .versionrc.json file ([2a4084a](https://github.com/flingyp/YToolUse/commit/2a4084aee2863dd20898fd2f6fbf00315853a321))
- add Dev Function article ([b414f5d](https://github.com/flingyp/YToolUse/commit/b414f5d10d6e72ca32a933aa39257e10404c4af2))
- add eslint and prettier ([0b51cf9](https://github.com/flingyp/YToolUse/commit/0b51cf9c36e73a88e9eeb41c0fd07db7fbafc551))
- add vitest frame and useRandomInteger function ([9b1eb03](https://github.com/flingyp/YToolUse/commit/9b1eb03c302541802fffa8ab43dff8733ab8906b))
- config husky lint-staged commitlint commitizen ([b3157e6](https://github.com/flingyp/YToolUse/commit/b3157e6c3f6d470c28280f513f4870b4ccc68835))
- creat deply-docs actions ([11742fc](https://github.com/flingyp/YToolUse/commit/11742fce80a475edc1aed10aedcba8d2b99ceab1))
- create script/release.ts to auto release ([b5e6b27](https://github.com/flingyp/YToolUse/commit/b5e6b2751d2a3281e894d119bfeb2199781a33a3))
- delete esbuild build tool ([d25b0ba](https://github.com/flingyp/YToolUse/commit/d25b0ba5ca3a82f3bf4f8d2c04764dc96d90af33))
- feat unbuild tool ([97b10f7](https://github.com/flingyp/YToolUse/commit/97b10f7f07c49a737d65b0e50a0167c8b37b7921))
- first publish ytooluse and @ytooluse/core packages ([7819724](https://github.com/flingyp/YToolUse/commit/7819724d97f4a40abcf28959a6c57c7799202f85))
- init ytools ([b1d435f](https://github.com/flingyp/YToolUse/commit/b1d435f85053c6b9691f03d421c36b1d1f1b0895))
- initial ([6442b64](https://github.com/flingyp/YToolUse/commit/6442b64e40c2ad9d007fba28d15901cf3da21111))
- integrate rollup bundle tool ([e8c112f](https://github.com/flingyp/YToolUse/commit/e8c112ff039f06a43bce564169af8e88944dc525))
- integrate workspace and add example list ([eb7145d](https://github.com/flingyp/YToolUse/commit/eb7145d93235027839e73d50c14b3249f29e53be))
- package name is @flypeng/tool ([cf086c9](https://github.com/flingyp/YToolUse/commit/cf086c99c8081c1e86fad4e2b6def2bde7e31d5a))
- **useDataSensitive:** new Function ([2076cba](https://github.com/flingyp/YToolUse/commit/2076cba97ddc0e34774bf7350c6c5e3b0d488497))
- **useGetUrlParam:** new Function ([76c2dcf](https://github.com/flingyp/YToolUse/commit/76c2dcfa2140c0e91346b5418c79a11712fd78d5))
- **useIsMobile:** new Function ([0d9b51d](https://github.com/flingyp/YToolUse/commit/0d9b51d789690f384b239bee704440af1cec1d20))
- **useLocationInfo:** new Funtion ([d2ca0fd](https://github.com/flingyp/YToolUse/commit/d2ca0fd3c5677a859bf4d7f1088edcb7cd996493))
- **useRandomString:** new Function ([a87eb86](https://github.com/flingyp/YToolUse/commit/a87eb8650f0eeb497a8fde91cb5f4b1154911dcf))
15 changes: 15 additions & 0 deletions scripts/gen-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ import { resolve } from 'path'
import packageJson from '../package.json'

const docsInfoPath = resolve('./', 'docs/info.ts')
const changelogPath = resolve('./', 'CHANGELOG.md')
const tagetChangelogPath = resolve('./', 'docs/guide/CHANGELOG.md')

if (existsSync(docsInfoPath)) {
unlinkSync(docsInfoPath)
}
if (existsSync(tagetChangelogPath)) {
unlinkSync(tagetChangelogPath)
}
writeFileSync(docsInfoPath, '')
writeFileSync(tagetChangelogPath, '')

// 工具库版本
const toolVersion = packageJson.version || '1.0.0'
Expand All @@ -25,3 +31,12 @@ const hooksNum = distStateFileContent.match(/export\s\{\s(.*)\s\};/)![1].split('
writeFileSync(docsInfoPath, `${readFileSync(docsInfoPath) || ''}\nexport const HooksNum = ${hooksNum}`, {
encoding: 'utf-8'
})

// CHANGELOG文件的拷贝
const changelogContent = readFileSync(changelogPath, { encoding: 'utf-8' })
// 从这个字符串的最后一个字符开始,删除CHANGELOG文件头部不重要的信息
const findStr = 'commit guidelines.'
const firstFindStrIndex = changelogContent.indexOf(findStr)
const changelogNeedContent = changelogContent.slice(firstFindStrIndex + findStr.length + 1)

writeFileSync(tagetChangelogPath, changelogNeedContent)

0 comments on commit 623e54e

Please sign in to comment.