From 0d5408d68104ad6d459668a1993fb6556cb7a81b Mon Sep 17 00:00:00 2001 From: EternalHeart <48346853+wh131462@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:26:50 +0800 Subject: [PATCH 1/4] chore(release): set new branch by correct command (#42) * docs: add contributors markdown * ci(release): modify ci to release when tag add and change the release-it to create new branch * feat(update): check update when first run lc and will be not allow until one day * chore(release): set new branch by correct command * docs: update QRCode (#39) * docs: simplified doc * chore: release v1.0.9-0 --------- Co-authored-by: thinkasany <480968828@qq.com> --- .release-it.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.release-it.json b/.release-it.json index 689636e..562fdf2 100644 --- a/.release-it.json +++ b/.release-it.json @@ -16,7 +16,7 @@ }, "hooks": { "after:bump": "git add CHANGELOG.md && echo 更新版本${version}成功!添加changelog的commit成功!", - "after:release": "git checkout master && git checkout -b stable-v${version} && git push origin stable-v${version}" + "after:release": "git checkout master && git pull origin master && git push origin master:stable-v${version}" }, "plugins": { "@release-it/bumper": { From 46a209ea8be810b2c13aacfd8a84a87356300da1 Mon Sep 17 00:00:00 2001 From: EternalHeart <48346853+wh131462@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:30:14 +0800 Subject: [PATCH 2/4] fix: fix hidden check (#43) * docs: add contributors markdown * ci(release): modify ci to release when tag add and change the release-it to create new branch * feat(update): check update when first run lc and will be not allow until one day * chore(release): set new branch by correct command * docs: update QRCode (#39) * docs: simplified doc * chore: release v1.0.9-0 * fix: fix the hidden check update --------- Co-authored-by: thinkasany <480968828@qq.com> --- .../cli-utils => origin}/checkUpdate.js | 0 common/origin/readme.md | 5 +++++ common/utils/cli-utils/commonMode.js | 10 ++++++++- esbuild.config.js | 21 +++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) rename common/{utils/cli-utils => origin}/checkUpdate.js (100%) create mode 100644 common/origin/readme.md diff --git a/common/utils/cli-utils/checkUpdate.js b/common/origin/checkUpdate.js similarity index 100% rename from common/utils/cli-utils/checkUpdate.js rename to common/origin/checkUpdate.js diff --git a/common/origin/readme.md b/common/origin/readme.md new file mode 100644 index 0000000..78ea2bf --- /dev/null +++ b/common/origin/readme.md @@ -0,0 +1,5 @@ +# Origin + +> 吮指原味鸡~ +> +> 在这个目录中的都会按目录输出. diff --git a/common/utils/cli-utils/commonMode.js b/common/utils/cli-utils/commonMode.js index 4911d1d..4bf4aec 100644 --- a/common/utils/cli-utils/commonMode.js +++ b/common/utils/cli-utils/commonMode.js @@ -5,6 +5,7 @@ import { getQuestionLanguage } from '#common/utils/question-handler/questionLang import { easyLanguageView } from '#common/view/language.view.js' import { logger } from '#common/utils/logger/logger.js' import { rootPath } from '#common/utils/file/getRootPath.js' +import { currentEnv } from '#common/utils/etc/checkEnv.js' /** * 执行逻辑: @@ -21,7 +22,14 @@ import { rootPath } from '#common/utils/file/getRootPath.js' export async function commonMode(cmdOpts, easyCallback) { // 启动一个额外的线程,并执行 worker.js 文件 // const workerProcess = - fork(path.resolve(rootPath, 'common/utils/cli-utils/checkUpdate.js')) + const jsPath = path.resolve( + rootPath, + currentEnv() === 'cli' + ? 'origin/checkUpdate.js' + : 'common/origin/checkUpdate.js' + ) + fork(jsPath) + logger.info(jsPath) // todo 监听额外线程的消息 // workerProcess.on('message', (message) => {}) // todo 监听额外线程的退出事件 diff --git a/esbuild.config.js b/esbuild.config.js index 5287528..3a0abea 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -78,12 +78,32 @@ function rewritePackageFile() { ) } +/** + * 创建原始目录下的文件 需要将js转化成压缩后的形式 + */ +function createOrigin() { + const originFiles = fs + .readdirSync(path.resolve(rootPath, 'common/origin')) + ?.filter((path) => path.endsWith('.js')) + .map((file) => path.resolve(rootPath, `common/origin/${file}`)) + esbuild.buildSync({ + entryPoints: originFiles, + minify: true, + bundle: true, + outdir: 'pl-cli/origin', + platform: 'node', + target: ['node20'], + packages: 'external', + format: 'esm' + }) +} /** * 构建完成之后的流程 */ function afterBuild() { copyDocs() rewritePackageFile() + createOrigin() } /** @@ -104,4 +124,5 @@ async function main() { process.exit(1) }) } + await main() From 149fd75b19cacbe036392ca12c8c70e0067097b2 Mon Sep 17 00:00:00 2001 From: EternalHeart Date: Thu, 14 Mar 2024 17:34:44 +0800 Subject: [PATCH 3/4] chore: modify release it json --- .release-it.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.release-it.json b/.release-it.json index 562fdf2..ba4c3b6 100644 --- a/.release-it.json +++ b/.release-it.json @@ -16,7 +16,7 @@ }, "hooks": { "after:bump": "git add CHANGELOG.md && echo 更新版本${version}成功!添加changelog的commit成功!", - "after:release": "git checkout master && git pull origin master && git push origin master:stable-v${version}" + "after:release": "git checkout master && git push origin master:stable-v${version} || true" }, "plugins": { "@release-it/bumper": { From 5412c800ae5d17f3ff1c6c57bbba9a516a13630f Mon Sep 17 00:00:00 2001 From: EternalHeart Date: Thu, 14 Mar 2024 17:35:08 +0800 Subject: [PATCH 4/4] chore: release v1.0.9-1 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8033660..ba4bc34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.0.9-1](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.9-0...cli-v1.0.9-1) (2024-03-14) + +### Bug Fixes + +- fix hidden check ([#43](https://github.com/wh131462/leetcode-practice/issues/43)) ([46a209e](https://github.com/wh131462/leetcode-practice/commit/46a209ea8be810b2c13aacfd8a84a87356300da1)), closes [#39](https://github.com/wh131462/leetcode-practice/issues/39) + ## [1.0.9-0](https://github.com/wh131462/leetcode-practice/compare/cli-v1.0.8...cli-v1.0.9-0) (2024-03-14) ### Features diff --git a/package.json b/package.json index e57cc05..bd3a345 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "leetcode-practice", "type": "module", - "version": "1.0.9-0", + "version": "1.0.9-1", "packageManager": "yarn@1.22.0", "description": "A powerful practice platform for leetcode.Using any way you want to create questions.", "author": {