mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-25 03:03:19 -07:00
feat(ci): integrate PR #12389 build improvements and tsbuildinfo
This commit is contained in:
@@ -28,6 +28,8 @@ bower_components
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
.cache/
|
||||
|
||||
# TypeScript build info files
|
||||
*.tsbuildinfo
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
"build-and-start": "npm run build && npm run start --",
|
||||
"build:vscode": "node scripts/build_vscode_companion.js",
|
||||
"build:all": "npm run build && npm run build:sandbox && npm run build:vscode",
|
||||
"build:packages": "npm run build --workspaces",
|
||||
"build:sandbox": "node scripts/build_sandbox.js",
|
||||
"build:binary": "node scripts/build_binary.js",
|
||||
"bundle": "npm run generate && npm run build --workspace=@google/gemini-cli-devtools && npm run bundle:browser-mcp -w @google/gemini-cli-core && node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"outDir": "dist",
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2023"],
|
||||
"composite": true,
|
||||
"tsBuildInfoFile": "../../.cache/a2a-server.tsbuildinfo",
|
||||
"types": ["node", "vitest/globals"]
|
||||
},
|
||||
"include": ["index.ts", "src/**/*.ts", "src/**/*.json"],
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"outDir": "dist",
|
||||
"jsx": "react-jsx",
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2023"],
|
||||
"tsBuildInfoFile": "../../.cache/cli.tsbuildinfo",
|
||||
"types": ["node", "vitest/globals"]
|
||||
},
|
||||
"include": [
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"outDir": "dist",
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2023"],
|
||||
"composite": true,
|
||||
"tsBuildInfoFile": "../../.cache/core.tsbuildinfo",
|
||||
"types": ["node", "vitest/globals"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"outDir": "dist",
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2021"],
|
||||
"composite": true,
|
||||
"tsBuildInfoFile": "../../.cache/test-utils.tsbuildinfo",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["index.ts", "src/**/*.ts", "src/**/*.json"],
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
*/
|
||||
"skipLibCheck": true,
|
||||
"rootDir": "src",
|
||||
"strict": true /* enable all strict type-checking options */
|
||||
"strict": true /* enable all strict type-checking options */,
|
||||
"tsBuildInfoFile": "../../.cache/vscode-ide-companion.tsbuildinfo"
|
||||
/* Additional Checks */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
+15
-21
@@ -30,33 +30,27 @@ if (!existsSync(join(root, 'node_modules'))) {
|
||||
execSync('npm install', { stdio: 'inherit', cwd: root });
|
||||
}
|
||||
|
||||
// build all workspaces/packages
|
||||
execSync('npm run generate', { stdio: 'inherit', cwd: root });
|
||||
const workspaces = [
|
||||
'@google/gemini-cli-test-utils',
|
||||
'@google/gemini-cli-core',
|
||||
'@google/gemini-cli-a2a-server',
|
||||
'@google/gemini-cli',
|
||||
'gemini-cli-vscode-ide-companion',
|
||||
];
|
||||
|
||||
if (process.env.CI) {
|
||||
console.log('CI environment detected. Building workspaces sequentially...');
|
||||
execSync('npm run build --workspaces', { stdio: 'inherit', cwd: root });
|
||||
} else {
|
||||
// Build core first because everyone depends on it
|
||||
console.log('Building @google/gemini-cli-core...');
|
||||
execSync('npm run build -w @google/gemini-cli-core', {
|
||||
function buildWorkspace(workspace) {
|
||||
console.log(`Building ${workspace}...`);
|
||||
execSync(`npm run build --workspace ${workspace}`, {
|
||||
stdio: 'inherit',
|
||||
cwd: root,
|
||||
});
|
||||
}
|
||||
|
||||
// Build the rest in parallel
|
||||
console.log('Building other workspaces in parallel...');
|
||||
const workspaceInfo = JSON.parse(
|
||||
execSync('npm query .workspace --json', { cwd: root, encoding: 'utf-8' }),
|
||||
);
|
||||
const parallelWorkspaces = workspaceInfo
|
||||
.map((w) => w.name)
|
||||
.filter((name) => name !== '@google/gemini-cli-core');
|
||||
// build all workspaces/packages
|
||||
execSync('npm run generate', { stdio: 'inherit', cwd: root });
|
||||
|
||||
execSync(
|
||||
`npx npm-run-all --parallel ${parallelWorkspaces.map((w) => `"build -w ${w}"`).join(' ')}`,
|
||||
{ stdio: 'inherit', cwd: root },
|
||||
);
|
||||
for (const workspace of workspaces) {
|
||||
buildWorkspace(workspace);
|
||||
}
|
||||
|
||||
// also build container image if sandboxing is enabled
|
||||
|
||||
Reference in New Issue
Block a user