Skip to content

Commit

Permalink
chore(repo): Attempt to fix snapshot release
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosdouvlis committed Nov 7, 2023
1 parent 25562c1 commit 8e490a4
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion scripts/snapshot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,45 @@
import 'zx/globals';
import { constants } from './common.mjs';

console.log(constants);
const snapshot = `---
'gatsby-plugin-clerk': patch
'@clerk/chrome-extension': patch
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/clerk-sdk-node': patch
'@clerk/backend': patch
'@clerk/fastify': patch
'@clerk/nextjs': patch
'@clerk/shared': patch
'@clerk/themes': patch
'@clerk/clerk-react': patch
'@clerk/remix': patch
'@clerk/types': patch
'@clerk/clerk-expo': patch
---
Snapshot release
`;

const prefix = argv.name || argv._[0] || 'snapshot';

await $`npx json -I -f ${constants.ChangesetConfigFile} -e "this.changelog = false"`;
await $`npx changeset pre exit || true`;

try {
// exit pre-release mode if we're in it
await $`npx 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 $`npx 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 (e) {
// otherwise, do nothing
}

const res = await $`npx changeset version --snapshot ${prefix}`;
const success = !res.stderr.includes('No unreleased changesets found');

Expand Down

0 comments on commit 8e490a4

Please sign in to comment.