Skip to content

Commit b1c00fc

Browse files
chore: fix publish script (#5859)
1 parent 2a78924 commit b1c00fc

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

scripts/publish.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ async function publish() {
9999
'Updating 2nd-gen version.ts from 1st-gen'
100100
);
101101

102+
// Step 3.5: Refresh lockfile and rebuild after version changes
103+
run(
104+
'yarn install --refresh-lockfile',
105+
'Refreshing lockfile with new versions'
106+
);
107+
run('yarn build', 'Rebuilding packages with new versions');
108+
102109
// Step 4: Publish to npm
103110
run(
104111
`yarn changeset publish --no-git-tag --tag ${args.tag}`,

yarn.config.cjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ module.exports = defineConfig({
9090
const semverSort = (a, b) => {
9191
// Push latest & * to the bottom because we want to use the highest *specified* version
9292
if (['latest', '*'].includes(a)) {
93-
return 0;
93+
return 1;
9494
}
9595
if (['latest', '*'].includes(b)) {
96-
return 1;
96+
return -1;
9797
}
98-
return semver.gt(semver.coerce(a), semver.coerce(b));
98+
// Return proper sort comparator values: negative if b > a, 0 if equal, positive if a > b
99+
// This sorts in descending order (highest version first)
100+
return semver.compare(semver.coerce(b), semver.coerce(a));
99101
};
100102

101103
/**

0 commit comments

Comments
 (0)