From af641253932c8f7b217de754d301af0b940ffec7 Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 13 Mar 2025 04:41:52 +0800 Subject: [PATCH] workspace: fix publish script --- build/publish.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/publish.ts b/build/publish.ts index e215272e3..dd0051e3c 100644 --- a/build/publish.ts +++ b/build/publish.ts @@ -53,10 +53,11 @@ if (CI && (!tag || GITHUB_EVENT_NAME !== 'push')) { for (const name in bumpMap) { console.log(`publishing ${name}@${bumpMap[name]} ...`); if (tag === 'dev') { - const pkg = require(`${name}/package.json`); + const location = require.resolve(`../${name}/package.json`); + const pkg = require(location); if (!prerelease(pkg.version)) { pkg.version += '-dev'; - writeFileSync(path.resolve(`${name}/package.json`), JSON.stringify(pkg)); + writeFileSync(location, JSON.stringify(pkg)); } } await spawnAsync(