diff --git a/.release-it.json b/.release-it.json index 689636e..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 checkout -b stable-v${version} && git push origin stable-v${version}" + "after:release": "git checkout master && git push origin master:stable-v${version} || true" }, "plugins": { "@release-it/bumper": { 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/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() 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": {