Skip to content

Commit cb71e9f

Browse files
committed
chore: Reorder publish steps to build before updating package.json and add verification
1 parent 8ac5486 commit cb71e9f

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

mpp-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@xiuper/cli",
3-
"version": "3.0.0-alpha5",
3+
"version": "0.2.0",
44
"description": "AutoDev Xiuper CLI - Terminal UI for AI-powered development assistant",
55
"type": "module",
66
"bin": {

mpp-ui/scripts/publish-remote.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,14 @@ async function main() {
9393
// Check if user is logged in
9494
execSync('npm whoami', { cwd: mppCorePackageDir, stdio: 'pipe' });
9595

96-
// Publish
97-
execSync('npm publish --access public', { cwd: mppCorePackageDir, stdio: 'inherit' });
96+
// Determine if this is a prerelease version (contains -, like alpha, beta, rc)
97+
const isPrerelease = mppCoreVersion.includes('-');
98+
const publishCmd = isPrerelease
99+
? 'npm publish --access public --tag next'
100+
: 'npm publish --access public';
101+
102+
console.log(' Publishing with command:', publishCmd);
103+
execSync(publishCmd, { cwd: mppCorePackageDir, stdio: 'inherit' });
98104
console.log('✅ mpp-core published successfully\n');
99105

100106
// Wait a bit for npm registry to update
@@ -154,10 +160,17 @@ async function main() {
154160
}
155161

156162
try {
157-
execSync('npm publish --access public', { cwd: rootDir, stdio: 'inherit' });
163+
// Determine if this is a prerelease version
164+
const isCliPrerelease = currentVersion.includes('-');
165+
const cliPublishCmd = isCliPrerelease
166+
? 'npm publish --access public --tag next'
167+
: 'npm publish --access public';
168+
169+
console.log(' Publishing with command:', cliPublishCmd);
170+
execSync(cliPublishCmd, { cwd: rootDir, stdio: 'inherit' });
158171
console.log('✅ @xiuper/cli published successfully\n');
159172
} catch (error) {
160-
console.error('❌ @autodev/cli publish failed');
173+
console.error('❌ @xiuper/cli publish failed');
161174
console.log('🔄 Restoring package.json...');
162175
copyFileSync(packageJsonBackupPath, packageJsonPath);
163176
process.exit(1);

0 commit comments

Comments
 (0)