MCPcopy Index your code
hub / github.com/GrapesJS/react / prepareReleaseGrapesJSReact

Function prepareReleaseGrapesJSReact

scripts/releaseCore.ts:7–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const grapesJSReactPath = resolve(__dirname, '../packages/grapesjs-react');
6
7async function prepareReleaseGrapesJSReact() {
8 try {
9 const releaseTag = process.argv[2] || 'rc';
10 console.log('Prepare release GrapesJS tag:', releaseTag);
11
12 runCommand(
13 'git diff-index --quiet HEAD --',
14 'You have uncommitted changes. Please commit or stash them before running the release script.'
15 );
16
17 const versionCmd = releaseTag === 'latest' ? '--patch' : `--prerelease --preid ${releaseTag}`;
18 runCommand(`yarn workspace @grapesjs/react version ${versionCmd} --no-git-tag-version --no-commit-hooks`);
19
20 // Create a new release branch
21 const newVersion = JSON.parse(fs.readFileSync(`${grapesJSReactPath}/package.json`, 'utf8')).version;
22 const newBranch = `release-v${newVersion}`;
23 runCommand(`git checkout -b ${newBranch}`);
24 runCommand('git add .');
25 runCommand(`git commit -m "Release GrapesJS React ${releaseTag}: v${newVersion}"`);
26
27 console.log(`Release prepared! Push the current "${newBranch}" branch and open a new PR targeting 'main'`);
28 } catch (error) {
29 console.error(error);
30 process.exit(1);
31 }
32}
33
34prepareReleaseGrapesJSReact();

Callers 1

releaseCore.tsFile · 0.85

Calls 1

runCommandFunction · 0.90

Tested by

no test coverage detected