-
Notifications
You must be signed in to change notification settings - Fork 326
/
Copy pathcanary.mjs
executable file
·54 lines (45 loc) · 1.37 KB
/
canary.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env zx
import { $, echo } from 'zx';
import { constants } from './common.mjs';
const snapshot = `---
'@clerk/chrome-extension': patch
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/backend': patch
'@clerk/fastify': patch
'@clerk/agent-toolkit': patch
'@clerk/nextjs': patch
'@clerk/shared': patch
'@clerk/themes': patch
'@clerk/clerk-react': patch
'@clerk/remix': patch
'@clerk/types': patch
'@clerk/clerk-expo': patch
'@clerk/express': patch
'@clerk/testing': patch
'@clerk/elements': patch
---
Canary release
`;
await $`pnpm dlx json -I -f ${constants.ChangesetConfigFile} -e "this.changelog = false"`;
try {
// exit pre-release mode if we're in it
await $`pnpm changeset pre exit`;
// bump the version of all affected packages
// this will remove the prerelease versions
// but will also clear the changeset .md files
await $`pnpm changeset version`;
// generate a temp .md file that indicates that all packages have changes
// in order to force a snapshot release
await $`touch .changeset/snap.md && echo ${snapshot} > .changeset/snap.md`;
} catch {
// otherwise, do nothing
}
const res = await $`pnpm changeset version --snapshot canary`;
const success = !res.stderr.includes('No unreleased changesets found');
await $`git checkout HEAD -- ${constants.ChangesetConfigFile}`;
if (success) {
echo('success=1');
} else {
echo('success=0');
}