Skip to content

fix: fix hidden check #43

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

Merged
merged 10 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions common/origin/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Origin

> 吮指原味鸡~
>
> 在这个目录中的都会按目录输出.
10 changes: 9 additions & 1 deletion common/utils/cli-utils/commonMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

/**
* 执行逻辑:
Expand All @@ -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 监听额外线程的退出事件
Expand Down
21 changes: 21 additions & 0 deletions esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

/**
Expand All @@ -104,4 +124,5 @@ async function main() {
process.exit(1)
})
}

await main()