Skip to content

Commit

Permalink
fix: upgrade --all version
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe committed Dec 5, 2024
1 parent cca8220 commit 9234f72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/actions/upgrade-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'node:fs';

import {getBetaVersion} from '@helpers/beta';
import {getCanaryVersion} from '@helpers/canary';
import {checkIllegalComponents} from '@helpers/check';
import {checkIllegalComponents, getConditionData} from '@helpers/check';
import {detect} from '@helpers/detect';
import {exec} from '@helpers/exec';
import {Logger} from '@helpers/logger';
Expand Down Expand Up @@ -99,12 +99,14 @@ export async function upgradeAction(components: string[], options: UpgradeAction
} else if (!components.length) {
// If have the main nextui then add
if (isNextUIAll) {
const version = transformPeerVersion(allDependencies[NEXT_UI]);
const conditionData = getConditionData(store.beta, store.canary);
const latestVersion = conditionData?.version ?? store.latestVersion;
const nextuiData = {
isLatest:
compareVersions(store.latestVersion, transformPeerVersion(allDependencies[NEXT_UI])) <= 0,
latestVersion: store.latestVersion,
isLatest: extraCompareVersions(latestVersion, version, store.beta, store.canary),
latestVersion,
package: NEXT_UI,
version: transformPeerVersion(allDependencies[NEXT_UI])
version
} as TransformComponent;

transformComponents.push(nextuiData);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ interface CheckPeerDependenciesConfig {
canary?: boolean;
}

function getConditionData(beta: boolean, canary: boolean) {
export function getConditionData(beta: boolean, canary: boolean) {
return beta
? {tag: 'beta', version: store.betaVersion}
: canary
Expand Down

0 comments on commit 9234f72

Please sign in to comment.