refactor: clean up build output (#53)

* refactor: clean up build output

* refactor: add index.ts to package roots
This commit is contained in:
Brandon Keiji 2025-04-20 12:33:39 -07:00 committed by GitHub
parent a66ad2e2af
commit f480ef4bbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 31 additions and 18 deletions

3
package-lock.json generated
View File

@ -6490,6 +6490,9 @@
"react": "^18.3.1", "react": "^18.3.1",
"yargs": "^17.7.2" "yargs": "^17.7.2"
}, },
"bin": {
"cli": "dist/index.js"
},
"devDependencies": { "devDependencies": {
"@types/diff": "^7.0.2", "@types/diff": "^7.0.2",
"@types/dotenv": "^6.1.1", "@types/dotenv": "^6.1.1",

View File

@ -8,10 +8,10 @@
], ],
"scripts": { "scripts": {
"build": "npm run build --workspaces", "build": "npm run build --workspaces",
"clean": "npm run clean --workspaces", "clean": "rm -rf node_modules && npm run clean --workspaces",
"test": "npm run test --workspaces", "test": "npm run test --workspaces",
"start": "node ./scripts/check-build-status.js && node node_modules/@gemini-code/cli/dist", "start": "node ./scripts/check-build-status.js && node node_modules/@gemini-code/cli",
"debug": "node ./scripts/check-build-status.js && node --inspect-brk node_modules/@gemini-code/cli/dist", "debug": "node ./scripts/check-build-status.js && node --inspect-brk node_modules/@gemini-code/cli",
"lint": "eslint . --ext .ts,.tsx", "lint": "eslint . --ext .ts,.tsx",
"typecheck": "tsc --noEmit --jsx react", "typecheck": "tsc --noEmit --jsx react",
"format": "prettier --write .", "format": "prettier --write .",

7
packages/cli/index.ts Normal file
View File

@ -0,0 +1,7 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import './src/gemini.js';

View File

@ -3,9 +3,10 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Gemini Code CLI", "description": "Gemini Code CLI",
"type": "module", "type": "module",
"main": "src/gemini.js", "main": "dist/index.js",
"bin": "dist/index.js",
"scripts": { "scripts": {
"build": "tsc --build && cp package.json README.md ../../LICENSE dist/ && touch dist/.last_build", "build": "tsc --build && touch dist/.last_build",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"start": "node dist/gemini.js", "start": "node dist/gemini.js",
"debug": "node --inspect-brk dist/gemini.js", "debug": "node --inspect-brk dist/gemini.js",

View File

@ -2,17 +2,13 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist",
"rootDir": ".",
"jsx": "react", "jsx": "react",
"lib": ["DOM", "DOM.Iterable", "ES2020"], "lib": ["DOM", "DOM.Iterable", "ES2020"],
"module": "Node16",
"target": "ES2020",
"paths": { "paths": {
"@gemini-code/*": ["./packages/*"] "@gemini-code/*": ["./packages/*"]
}, },
"types": ["node", "vitest/globals"] "types": ["node", "vitest/globals"]
}, },
"exclude": ["node_modules", "dist"], "exclude": ["node_modules", "dist"],
"include": ["src"],
"references": [{ "path": "../server" }] "references": [{ "path": "../server" }]
} }

7
packages/server/index.ts Normal file
View File

@ -0,0 +1,7 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export * from './src/index.js';

View File

@ -3,10 +3,10 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Gemini Code Server", "description": "Gemini Code Server",
"type": "module", "type": "module",
"main": "dist/src/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"start": "node dist/src/index.js", "start": "node dist/src/index.js",
"build": "tsc --build && cp package.json dist/", "build": "tsc --build",
"clean": "rm -rf dist", "clean": "rm -rf dist",
"lint": "eslint . --ext .ts,.tsx", "lint": "eslint . --ext .ts,.tsx",
"format": "prettier --write .", "format": "prettier --write .",

View File

@ -2,10 +2,7 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist",
"rootDir": ".",
"lib": ["DOM", "DOM.Iterable", "ES2020"], "lib": ["DOM", "DOM.Iterable", "ES2020"],
"module": "Node16",
"target": "ES2022",
"composite": true "composite": true
}, },
"exclude": ["node_modules", "dist"] "exclude": ["node_modules", "dist"]

View File

@ -7,11 +7,13 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"sourceMap": true, "sourceMap": true,
"composite": true, "composite": true,
// MONOREPO STUFF
"incremental": true, "incremental": true,
"target": "ES2020",
"module": "Node16",
"declaration": true, "declaration": true,
"moduleResolution": "node16" "allowSyntheticDefaultImports": true,
"lib": ["ES2023"],
"module": "NodeNext",
"moduleResolution": "nodenext",
"target": "es2022",
"types": ["node"]
} }
} }