mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 11:41:04 +00:00
Sync upstream Gemini-CLI v0.8.2 (#838)
This commit is contained in:
parent
096fabb5d6
commit
eb95c131be
644 changed files with 70389 additions and 23709 deletions
|
|
@ -38,9 +38,35 @@ run(`npm version ${versionType} --no-git-tag-version --allow-same-version`);
|
|||
|
||||
// 3. Get all workspaces and filter out the one we don't want to version.
|
||||
const workspacesToExclude = [];
|
||||
const lsOutput = JSON.parse(
|
||||
execSync('npm ls --workspaces --json --depth=0').toString(),
|
||||
);
|
||||
let lsOutput;
|
||||
try {
|
||||
lsOutput = JSON.parse(
|
||||
execSync('npm ls --workspaces --json --depth=0').toString(),
|
||||
);
|
||||
} catch (e) {
|
||||
// `npm ls` can exit with a non-zero status code if there are issues
|
||||
// with dependencies, but it will still produce the JSON output we need.
|
||||
// We'll try to parse the stdout from the error object.
|
||||
if (e.stdout) {
|
||||
console.warn(
|
||||
'Warning: `npm ls` exited with a non-zero status code. Attempting to proceed with the output.',
|
||||
);
|
||||
try {
|
||||
lsOutput = JSON.parse(e.stdout.toString());
|
||||
} catch (parseError) {
|
||||
console.error(
|
||||
'Error: Failed to parse JSON from `npm ls` output even after `npm ls` failed.',
|
||||
);
|
||||
console.error('npm ls stderr:', e.stderr.toString());
|
||||
console.error('Parse error:', parseError);
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
console.error('Error: `npm ls` failed with no output.');
|
||||
console.error(e.stderr?.toString() || e);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
const allWorkspaces = Object.keys(lsOutput.dependencies || {});
|
||||
const workspacesToVersion = allWorkspaces.filter(
|
||||
(wsName) => !workspacesToExclude.includes(wsName),
|
||||
|
|
@ -56,7 +82,7 @@ for (const workspaceName of workspacesToVersion) {
|
|||
const rootPackageJsonPath = resolve(process.cwd(), 'package.json');
|
||||
const newVersion = readJson(rootPackageJsonPath).version;
|
||||
|
||||
// 6. Update the sandboxImageUri in the root package.json
|
||||
// 5. Update the sandboxImageUri in the root package.json
|
||||
const rootPackageJson = readJson(rootPackageJsonPath);
|
||||
if (rootPackageJson.config?.sandboxImageUri) {
|
||||
rootPackageJson.config.sandboxImageUri =
|
||||
|
|
@ -65,7 +91,7 @@ if (rootPackageJson.config?.sandboxImageUri) {
|
|||
writeJson(rootPackageJsonPath, rootPackageJson);
|
||||
}
|
||||
|
||||
// 7. Update the sandboxImageUri in the cli package.json
|
||||
// 6. Update the sandboxImageUri in the cli package.json
|
||||
const cliPackageJsonPath = resolve(process.cwd(), 'packages/cli/package.json');
|
||||
const cliPackageJson = readJson(cliPackageJsonPath);
|
||||
if (cliPackageJson.config?.sandboxImageUri) {
|
||||
|
|
@ -77,7 +103,9 @@ if (cliPackageJson.config?.sandboxImageUri) {
|
|||
writeJson(cliPackageJsonPath, cliPackageJson);
|
||||
}
|
||||
|
||||
// 8. Run `npm install` to update package-lock.json.
|
||||
run('npm install');
|
||||
// 7. Run `npm install` to update package-lock.json.
|
||||
run(
|
||||
'npm install --workspace packages/cli --workspace packages/core --package-lock-only',
|
||||
);
|
||||
|
||||
console.log(`Successfully bumped versions to v${newVersion}.`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue