Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
穆春红
/
frontend-hub
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c2388472
authored
Jun 22, 2026
by
chunhong.mu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix(root): fix scripts branch naming and build-changed JSON parsing
parent
90b3136e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
scripts/build-changed.ts
scripts/build-changed.ts
View file @
c2388472
import
{
execSync
}
from
'node:child_process'
import
{
execSync
}
from
'node:child_process'
import
{
readFileSync
}
from
'node:fs'
import
{
readFileSync
,
unlinkSync
}
from
'node:fs'
import
{
resolve
}
from
'node:path'
import
{
resolve
}
from
'node:path'
/**
/**
...
@@ -16,10 +16,13 @@ function main()
...
@@ -16,10 +16,13 @@ function main()
{
{
console
.
log
(
'Detecting changed packages since last release...\n'
)
console
.
log
(
'Detecting changed packages since last release...\n'
)
const
tmpFile
=
resolve
(
process
.
cwd
(),
'.changeset-status-tmp.json'
)
try
try
{
{
// 获取 changeset 状态(JSON 格式)
// 获取 changeset 状态(输出到临时文件)
const
statusOutput
=
run
(
'pnpm changeset status --output=json'
)
run
(
`npx changeset status --output=
${
tmpFile
}
`
)
const
statusOutput
=
readFileSync
(
tmpFile
,
'utf-8'
)
const
status
=
JSON
.
parse
(
statusOutput
)
const
status
=
JSON
.
parse
(
statusOutput
)
if
(
!
status
.
releases
||
status
.
releases
.
length
===
0
)
if
(
!
status
.
releases
||
status
.
releases
.
length
===
0
)
...
@@ -57,6 +60,9 @@ function main()
...
@@ -57,6 +60,9 @@ function main()
}
}
catch
(
error
:
any
)
catch
(
error
:
any
)
{
{
// 清理临时文件
try
{
unlinkSync
(
tmpFile
)
}
catch
{}
if
(
error
.
message
?.
includes
(
'No unreleased changesets found'
))
if
(
error
.
message
?.
includes
(
'No unreleased changesets found'
))
{
{
console
.
log
(
'No unreleased changesets found. Nothing to build.'
)
console
.
log
(
'No unreleased changesets found. Nothing to build.'
)
...
@@ -67,6 +73,11 @@ function main()
...
@@ -67,6 +73,11 @@ function main()
process
.
exit
(
1
)
process
.
exit
(
1
)
}
}
}
}
finally
{
// 清理临时文件
try
{
unlinkSync
(
tmpFile
)
}
catch
{}
}
}
}
main
()
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment