Skip to content

Commit 8e490a4

Browse files
committed
chore(repo): Attempt to fix snapshot release
1 parent 25562c1 commit 8e490a4

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

scripts/snapshot.mjs

+36-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,45 @@
33
import 'zx/globals';
44
import { constants } from './common.mjs';
55

6+
console.log(constants);
7+
const snapshot = `---
8+
'gatsby-plugin-clerk': patch
9+
'@clerk/chrome-extension': patch
10+
'@clerk/localizations': patch
11+
'@clerk/clerk-js': patch
12+
'@clerk/clerk-sdk-node': patch
13+
'@clerk/backend': patch
14+
'@clerk/fastify': patch
15+
'@clerk/nextjs': patch
16+
'@clerk/shared': patch
17+
'@clerk/themes': patch
18+
'@clerk/clerk-react': patch
19+
'@clerk/remix': patch
20+
'@clerk/types': patch
21+
'@clerk/clerk-expo': patch
22+
---
23+
24+
Snapshot release
25+
`;
26+
627
const prefix = argv.name || argv._[0] || 'snapshot';
728

829
await $`npx json -I -f ${constants.ChangesetConfigFile} -e "this.changelog = false"`;
9-
await $`npx changeset pre exit || true`;
30+
31+
try {
32+
// exit pre-release mode if we're in it
33+
await $`npx changeset pre exit`;
34+
// bump the version of all affected packages
35+
// this will remove the prerelease versions
36+
// but will also clear the changeset .md files
37+
await $`npx changeset version`;
38+
// generate a temp .md file that indicates that all packages have changes
39+
// in order to force a snapshot release
40+
await $`touch .changeset/snap.md && echo ${snapshot} > .changeset/snap.md`;
41+
} catch (e) {
42+
// otherwise, do nothing
43+
}
44+
1045
const res = await $`npx changeset version --snapshot ${prefix}`;
1146
const success = !res.stderr.includes('No unreleased changesets found');
1247

0 commit comments

Comments
 (0)