MCPcopy Index your code
hub / github.com/QwikDev/qwik / commitPrepareReleaseVersion

Function commitPrepareReleaseVersion

scripts/release.ts:89–141  ·  view source on GitHub ↗
(config: BuildConfig)

Source from the content-addressed store, hash-verified

87}
88
89export async function commitPrepareReleaseVersion(config: BuildConfig) {
90 const commitPaths: string[] = [];
91
92 // update root
93 const rootPkg = await readPackageJson(config.rootDir);
94 commitPaths.push(join(config.rootDir, 'package.json'));
95 const updatedPkg = { ...rootPkg };
96 updatedPkg.version = config.distVersion;
97 await writePackageJson(config.rootDir, updatedPkg);
98
99 // update packages/qwik
100 const qwikDir = join(config.packagesDir, 'qwik');
101 const qwikPkg = await readPackageJson(qwikDir);
102 commitPaths.push(join(qwikDir, 'package.json'));
103 qwikPkg.version = config.distVersion;
104 await writePackageJson(qwikDir, qwikPkg);
105
106 // update packages/qwik-city
107 const qwikCityDir = join(config.packagesDir, 'qwik-city');
108 const qwikCityPkg = await readPackageJson(qwikCityDir);
109 commitPaths.push(join(qwikCityDir, 'package.json'));
110 qwikCityPkg.version = config.distVersion;
111 await writePackageJson(qwikCityDir, qwikCityPkg);
112
113 // update the cli version
114 const distCliDir = join(config.packagesDir, 'create-qwik');
115 commitPaths.push(join(distCliDir, 'package.json'));
116 const cliPkg = await readPackageJson(distCliDir);
117 cliPkg.version = config.distVersion;
118 await writePackageJson(distCliDir, cliPkg);
119
120 // update the eslint version
121 const distEslintDir = join(config.packagesDir, 'eslint-plugin-qwik');
122 commitPaths.push(join(distEslintDir, 'package.json'));
123 const eslintPkg = await readPackageJson(distEslintDir);
124 eslintPkg.version = config.distVersion;
125 await writePackageJson(distEslintDir, eslintPkg);
126
127 // git add the changed package.json
128 const gitAddArgs = ['add', ...commitPaths];
129 await run('git', gitAddArgs);
130
131 // git commit the changed package.json
132 const gitCommitArgs = ['commit', '--message', `chore: ${config.distVersion}`];
133 await run('git', gitCommitArgs);
134
135 console.log(``);
136 console.log(`Next:`);
137 console.log(` - Submit a PR to main with the prepared release updates`);
138 console.log(` - Once merged, run the "Qwik CI" release workflow`);
139 console.log(` - https://github.com/QwikDev/qwik/actions/workflows/ci.yml`);
140 console.log(``);
141}
142
143export async function publish(config: BuildConfig) {
144 const isDryRun = !!config.dryRun;

Callers 1

buildFunction · 0.90

Calls 4

readPackageJsonFunction · 0.90
writePackageJsonFunction · 0.90
runFunction · 0.90
joinFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…