Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(release): release must on master and release will create a version branch #35

Merged
merged 16 commits into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: npm # See documentation for possible values
directory: / # Location of package manifests
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'EternalHeartTeam/leetcode-practice'
if: github.repository == 'EternalHeartTeam/leetcode-practice' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
12 changes: 3 additions & 9 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/usr/bin/env sh
# 导入 Husky 脚本
. "$(dirname -- "$0")/_/husky.sh"

# 检查是否处于 rebase 状态
if [ -z "$GIT_DIR" ]; then
# 处于 rebase 状态,退出脚本
exit 0
fi

# 不处于 rebase 状态,执行 pre-commit 脚本
# 如果要执行 rebase 需要跳过当前所有hooks
# todo-highlight HUSKY=0 git rebase ...
echo "Running pre-commit script..."
npm run lint && npm run format
npm run lint && npm run format && git add .
3 changes: 2 additions & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
@@ -5,8 +5,9 @@
"autoGenerate": true
},
"git": {
"commitMessage": "feat: v${version}",
"commitMessage": "chore: release v${version}",
"tagName": "cli-v${version}",
"branch": "stable-v${version}",
"tag": true,
"push": true,
"pushArgs": ["--follow-tags"]
21 changes: 9 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@


## [1.0.7](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.6...cli-v1.0.7) (2024-03-12)


### Bug Fixes

* change plan list question title to cn ([57f15d5](https://github.com/wh131462/leetcode-practice/commit/57f15d5befc23d11ce6211c30e3ee7a7e8bbe52d))
* change plan list question title to cn ([cb6fbfd](https://github.com/wh131462/leetcode-practice/commit/cb6fbfd4cd783f57d031abe3add9d85f3e271a4c))
* change the config ([2b9bb11](https://github.com/wh131462/leetcode-practice/commit/2b9bb1149c6db0dbede22f10830ccd8661b0a83f))
* delete hot100 add study plan list ([e94aaa1](https://github.com/wh131462/leetcode-practice/commit/e94aaa166e80e7e54f3ce5b570352cb798799b77))
* delete hot100 add study plan list ([9d7a22f](https://github.com/wh131462/leetcode-practice/commit/9d7a22fde8cc72264766f707ea3f51e81956c111))
* get all is not success ([9108219](https://github.com/wh131462/leetcode-practice/commit/91082196dc005b0b23314966a09304ba948416b8))
* get all is not success ([3f5bfef](https://github.com/wh131462/leetcode-practice/commit/3f5bfef7857e6c9869c40e3d12a60d50b14be2cd))
* update realm version to fix windows env ([00d2bc4](https://github.com/wh131462/leetcode-practice/commit/00d2bc4942b2b02f97ad41d23da64f8bedc23741))
* use logger instead console ([fddc458](https://github.com/wh131462/leetcode-practice/commit/fddc4581efbd5186a17aa1415aa2738283f820b7))
- change plan list question title to cn ([57f15d5](https://github.com/wh131462/leetcode-practice/commit/57f15d5befc23d11ce6211c30e3ee7a7e8bbe52d))
- change plan list question title to cn ([cb6fbfd](https://github.com/wh131462/leetcode-practice/commit/cb6fbfd4cd783f57d031abe3add9d85f3e271a4c))
- change the config ([2b9bb11](https://github.com/wh131462/leetcode-practice/commit/2b9bb1149c6db0dbede22f10830ccd8661b0a83f))
- delete hot100 add study plan list ([e94aaa1](https://github.com/wh131462/leetcode-practice/commit/e94aaa166e80e7e54f3ce5b570352cb798799b77))
- delete hot100 add study plan list ([9d7a22f](https://github.com/wh131462/leetcode-practice/commit/9d7a22fde8cc72264766f707ea3f51e81956c111))
- get all is not success ([9108219](https://github.com/wh131462/leetcode-practice/commit/91082196dc005b0b23314966a09304ba948416b8))
- get all is not success ([3f5bfef](https://github.com/wh131462/leetcode-practice/commit/3f5bfef7857e6c9869c40e3d12a60d50b14be2cd))
- update realm version to fix windows env ([00d2bc4](https://github.com/wh131462/leetcode-practice/commit/00d2bc4942b2b02f97ad41d23da64f8bedc23741))
- use logger instead console ([fddc458](https://github.com/wh131462/leetcode-practice/commit/fddc4581efbd5186a17aa1415aa2738283f820b7))

## [1.0.6](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.5...cli-v1.0.6) (2024-03-11)

3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CONTRIBUTORS

参考链接: [分支管理](https://www.ruanyifeng.com/blog/2012/07/git.html)
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Leetcode practice

[中文文档](./README_CN.md)|**English Document**||[日本語の文書](./README_JP.md)
[中文](./README_CN.md) · **English** ·[日本語](./README_JP.md)

## I. Project Information

@@ -282,14 +282,18 @@ The development and improvement of the project would not be possible without the

<a href="https://github.com/EternalHeartTeam/leetcode-practice/graphs/contributors" target="_blank"><img src="https://raw.githubusercontent.com/EternalHeartTeam/leetcode-practice/svg/images/contributors.png" /></a>

### 2. Feedback
### 2. How to Contribute

If you share a passion for open source and would like to contribute to our open source initiative, please refer to our [contribution guidelines](./CONTRIBUTORS.md).

### 3. Feedback

If you have any questions about usage or would like to offer some suggestions, feel free to join our feedback group!

Engage in face-to-face discussions with developers in the group, hoping to resonate with each other and spark new ideas!

![Feedback Group](./resources/images/service-qrcode.png)

### 3. Star Trend Chart
### 4. Star Trend Chart

[![Star History Chart](https://api.star-history.com/svg?repos=EternalHeartTeam/leetcode-practice&type=Date)](https://star-history.com/#EternalHeartTeam/leetcode-practice&Date)
10 changes: 7 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Leetcode practice

**中文文档**|[English Document](./README.md)|[日本語の文書](./README_JP.md)
**中文** · [English](./README.md) · [日本語](./README_JP.md)

## I.项目信息

@@ -287,14 +287,18 @@ npm i --save-dev leetcode-practice

<a href="https://github.com/EternalHeartTeam/leetcode-practice/graphs/contributors" target="_blank"><img src="https://raw.githubusercontent.com/EternalHeartTeam/leetcode-practice/svg/images/contributors.png" /></a>

### 2.使用反馈
### 2.如何贡献

如果你也有一颗热爱开源的心,想要为我们的开源事业贡献一份力量,那么请参考我们的[贡献手册](./CONTRIBUTORS.md)。

### 3.使用反馈

如果你有使用上的问题需要解惑,或者一些好的建议想要提出,可以加我们的使用反馈群进行反馈!

在群里和开发者面对面的交流,希望我们能产生共鸣,迸发出新的火花!

![反馈群](./resources/images/service-qrcode.png)

### 3.Star趋势图
### 4.Star趋势图

[![Star History Chart](https://api.star-history.com/svg?repos=EternalHeartTeam/leetcode-practice&type=Date)](https://star-history.com/#EternalHeartTeam/leetcode-practice&Date)
10 changes: 7 additions & 3 deletions README_JP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Leetcode practice

[中文文档](./README_CN.md)|[English Document](./README.md)|**日本語の文書**
[中文](./README_CN.md) · [English](./README.md) · **日本語**

## I.プロジェクト情報

@@ -278,14 +278,18 @@ npm i --save-dev leetcode-practice

<a href="https://github.com/EternalHeartTeam/leetcode-practice/graphs/contributors" target="_blank"><img src="https://raw.githubusercontent.com/EternalHeartTeam/leetcode-practice/svg/images/contributors.png" /></a>

### 2. 使用フィードバック
### 2. 貢献方法

もしオープンソースに対する情熱を持ち、私たちのオープンソースイニシアチブに貢献したいとお考えでしたら、[貢献ガイドライン](./CONTRIBUTORS.md) を参照してください。

### 3. 使用フィードバック

使用上の問題がある場合や、提案がある場合は、使用フィードバックグループにご参加ください!

グループで開発者と対面してコミュニケーションを取り、新たなアイデアを生み出すことを願っています!

![フィードバックグループ](./resources/images/service-qrcode.png)

### 3. Starのトレンドチャート
### 4. Starのトレンドチャート

[![Star History Chart](https://api.star-history.com/svg?repos=EternalHeartTeam/leetcode-practice&type=Date)](https://star-history.com/#EternalHeartTeam/leetcode-practice&Date)
53 changes: 7 additions & 46 deletions bin/lc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
#! /usr/bin/env node
import path from 'node:path'
import { program } from 'commander'
import { artFontLogo } from '#resources/text/art-font-logo.js'
import { lcExamples } from '#resources/text/examples.js'
import { love } from '#resources/text/love.js'
import { aim } from '#resources/text/aim.js'
import { referMode } from '#common/utils/create-check/refer-mode.js'
import { getArgs } from '#common/utils/create-check/get-args.js'
import { referMode } from '#common/utils/cli-utils/referMode.js'
import { getArgs } from '#common/utils/cli-utils/getArgs.js'
import { getQuestionToday } from '#common/utils/question-getter/getQuestionToday.js'

import { getQuestionRandom } from '#common/utils/question-getter/getQuestionRandom.js'

import { easyCreateView } from '#common/view/create.view.js'
import { description } from '#resources/text/description.js'
import { easyUpdateView } from '#common/view/update.view.js'
import { getQuestionLanguage } from '#common/utils/question-handler/questionLanguage.js'
import { easyLanguageView } from '#common/view/language.view.js'
import { DefaultVer } from '#common/constants/question.const.js'
import {
create,
createQuestionById
} from '#common/utils/create-check/createUtil.js'
import { logger } from '#common/utils/logger/logger.js'
import { createQuestionById } from '#common/utils/cli-utils/createQuestion.js'
import { create } from '#common/utils/cli-utils/create.js'
import { commonMode } from '#common/utils/cli-utils/commonMode.js'

const version = process.env.VERSION ?? DefaultVer
program
@@ -43,41 +37,8 @@ program

const cmdArgs = program.args
const cmdOpts = program.opts()
/**
* 执行逻辑:
* 目录检测 - 设置基础目录
* 模式检测 - 检测是不是easy mode
* [参数检测 - 执行对应参数]
*/
/**
* 语言设置
* -带参设置语言
* -无参获取语言
*/
if (cmdOpts.language) {
if (cmdOpts.language !== true) {
await easyLanguageView(cmdOpts.language)
} else {
const lang = await getQuestionLanguage()
logger.info(`当前CLI语言环境为:${lang}`)
}
process.exit(0)
}
// 根据dir 参数来设置基本目录
const baseDir = cmdOpts.directory
? path.join(process.cwd(), cmdOpts.directory)
: process.cwd()
if (cmdOpts.easy) {
await easyCreateView()
process.exit(0)
}
// 检测更新
if (cmdOpts.update) {
await easyUpdateView()
process.exit(0)
}
// 创建

// 通用参数执行
const baseDir = await commonMode(cmdOpts, easyCreateView)
// 模式对应的action
export const callModeAction = {
today: () => {
37 changes: 6 additions & 31 deletions bin/lf.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#! /usr/bin/env node
import path from 'node:path'
import { program } from 'commander'
import { description } from '#resources/text/description.js'
import { artFontLogo } from '#resources/text/art-font-logo.js'
import { aim } from '#resources/text/aim.js'
import { lfExamples } from '#resources/text/examples.js'
import { love } from '#resources/text/love.js'
import { easyUpdateView } from '#common/view/update.view.js'
import { easyLanguageView } from '#common/view/language.view.js'
import { getQuestionLanguage } from '#common/utils/question-handler/questionLanguage.js'
import { DefaultVer } from '#common/constants/question.const.js'
import { easyFinderView } from '#common/view/finder.view.js'
import { commonMode } from '#common/utils/cli-utils/commonMode.js'
import { willUse } from '#common/utils/etc/willUse.js'

const version = process.env.VERSION ?? DefaultVer
program
@@ -25,32 +23,9 @@ program
)
.parse(process.argv)

// const cmdArgs = program.args
const cmdArgs = program.args
const cmdOpts = program.opts()

/**
* 语言设置
* -带参设置语言
* -无参获取语言
*/
if (cmdOpts.language) {
if (cmdOpts.language !== true) {
await easyLanguageView(cmdOpts.language)
} else {
const lang = await getQuestionLanguage()
logger.info(`当前CLI语言环境为:${lang}`)
}
process.exit(0)
}
// 根据dir 参数来设置基本目录
const baseDir = cmdOpts.directory
? path.join(process.cwd(), cmdOpts.directory)
: process.cwd()
// 检测更新
if (cmdOpts.update) {
await easyUpdateView()
process.exit(0)
}
// 进入视图操作
await easyFinderView(baseDir)
// 通用参数执行
const baseDir = await commonMode(cmdOpts, easyFinderView)
willUse(cmdArgs, baseDir)
process.exit(0)
Loading
Loading