Skip to content

Commit 46a209e

Browse files
wh131462thinkasany
andauthored
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>
1 parent 0d5408d commit 46a209e

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed
File renamed without changes.

common/origin/readme.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Origin
2+
3+
> 吮指原味鸡~
4+
>
5+
> 在这个目录中的都会按目录输出.

common/utils/cli-utils/commonMode.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getQuestionLanguage } from '#common/utils/question-handler/questionLang
55
import { easyLanguageView } from '#common/view/language.view.js'
66
import { logger } from '#common/utils/logger/logger.js'
77
import { rootPath } from '#common/utils/file/getRootPath.js'
8+
import { currentEnv } from '#common/utils/etc/checkEnv.js'
89

910
/**
1011
* 执行逻辑:
@@ -21,7 +22,14 @@ import { rootPath } from '#common/utils/file/getRootPath.js'
2122
export async function commonMode(cmdOpts, easyCallback) {
2223
// 启动一个额外的线程,并执行 worker.js 文件
2324
// const workerProcess =
24-
fork(path.resolve(rootPath, 'common/utils/cli-utils/checkUpdate.js'))
25+
const jsPath = path.resolve(
26+
rootPath,
27+
currentEnv() === 'cli'
28+
? 'origin/checkUpdate.js'
29+
: 'common/origin/checkUpdate.js'
30+
)
31+
fork(jsPath)
32+
logger.info(jsPath)
2533
// todo 监听额外线程的消息
2634
// workerProcess.on('message', (message) => {})
2735
// todo 监听额外线程的退出事件

esbuild.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,32 @@ function rewritePackageFile() {
7878
)
7979
}
8080

81+
/**
82+
* 创建原始目录下的文件 需要将js转化成压缩后的形式
83+
*/
84+
function createOrigin() {
85+
const originFiles = fs
86+
.readdirSync(path.resolve(rootPath, 'common/origin'))
87+
?.filter((path) => path.endsWith('.js'))
88+
.map((file) => path.resolve(rootPath, `common/origin/${file}`))
89+
esbuild.buildSync({
90+
entryPoints: originFiles,
91+
minify: true,
92+
bundle: true,
93+
outdir: 'pl-cli/origin',
94+
platform: 'node',
95+
target: ['node20'],
96+
packages: 'external',
97+
format: 'esm'
98+
})
99+
}
81100
/**
82101
* 构建完成之后的流程
83102
*/
84103
function afterBuild() {
85104
copyDocs()
86105
rewritePackageFile()
106+
createOrigin()
87107
}
88108

89109
/**
@@ -104,4 +124,5 @@ async function main() {
104124
process.exit(1)
105125
})
106126
}
127+
107128
await main()

0 commit comments

Comments
 (0)