mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
infra: add multipackage support (#34)
This commit is contained in:
716
package-lock.json
generated
716
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,10 +8,12 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build --workspaces",
|
"build": "npm run build --workspaces",
|
||||||
|
"clean": "npm run clean --workspaces",
|
||||||
"test": "npm run test --workspaces",
|
"test": "npm run test --workspaces",
|
||||||
"start": "node ./scripts/check-build-status.js && npm run start --workspace=@google/gemini-code -- \"$@\"",
|
"start": "node ./scripts/check-build-status.js && node node_modules/@gemini-code/cli/dist -- \"$@\"",
|
||||||
"lint": "eslint . --ext .ts,.tsx",
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
"typecheck": "tsc --noEmit --jsx react",
|
"typecheck": "tsc --noEmit --jsx react",
|
||||||
|
"format": "prettier --write .",
|
||||||
"artifactregistry-login": "npx google-artifactregistry-auth"
|
"artifactregistry-login": "npx google-artifactregistry-auth"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "@google/gemini-code",
|
"name": "@gemini-code/cli",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Gemini Code CLI",
|
"description": "Gemini Code CLI",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "gemini.js",
|
"main": "src/gemini.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && cp package.json README.md ../../LICENSE dist/ && touch dist/.last_build",
|
"build": "tsc && cp package.json README.md ../../LICENSE dist/ && touch dist/.last_build",
|
||||||
"start": "node dist/gemini.js",
|
"start": "node dist/gemini.js",
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google/genai": "^0.8.0",
|
"@google/genai": "^0.8.0",
|
||||||
|
"@gemini-code/server": "1.0.0",
|
||||||
"diff": "^7.0.0",
|
"diff": "^7.0.0",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"fast-glob": "^3.3.3",
|
"fast-glob": "^3.3.3",
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ import { WriteFileTool } from './tools/write-file.tool.js';
|
|||||||
import { WebFetchTool } from './tools/web-fetch.tool.js';
|
import { WebFetchTool } from './tools/web-fetch.tool.js';
|
||||||
import { globalConfig } from './config/config.js';
|
import { globalConfig } from './config/config.js';
|
||||||
|
|
||||||
|
// TODO(b/411707095): remove. left here as an example of how to pull in inter-package deps
|
||||||
|
import { helloServer } from '@gemini-code/server'
|
||||||
|
helloServer();
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// Configure tools
|
// Configure tools
|
||||||
registerTools(globalConfig.getTargetDir());
|
registerTools(globalConfig.getTargetDir());
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./dist",
|
"outDir": "dist",
|
||||||
"rootDir": "./src",
|
"rootDir": ".",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
||||||
"module": "Node16",
|
"module": "Node16",
|
||||||
"target": "ES2020"
|
"target": "ES2020",
|
||||||
|
"paths": {
|
||||||
|
"@gemini-code/*": ["./packages/*"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "dist"],
|
"exclude": ["node_modules", "dist"],
|
||||||
"include": ["src"]
|
"include": ["src"],
|
||||||
|
"references": [
|
||||||
|
{ "path": "../server" },
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
6
packages/server/README.md
Normal file
6
packages/server/README.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Nested package template. Either fill this out with "backend" functionality or create similar packages that you want built separate from the CLI.
|
||||||
|
|
||||||
|
To use this package from another dependent package in this monorepo:
|
||||||
|
|
||||||
|
1. add `"@gemini-code/server"` to the dependent package's `package.json`
|
||||||
|
1. import in a dependenant by calling `import { } from "@gemini-code/server"`
|
||||||
24
packages/server/package.json
Normal file
24
packages/server/package.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "@gemini-code/server",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Gemini Code Server",
|
||||||
|
"type": "module",
|
||||||
|
"main": "src/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc && cp package.json dist/",
|
||||||
|
"clean": "rm -rf dist",
|
||||||
|
"lint": "eslint . --ext .ts,.tsx",
|
||||||
|
"format": "prettier --write ."
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
3
packages/server/src/index.ts
Normal file
3
packages/server/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export function helloServer() {
|
||||||
|
// TODO: add more things in this package
|
||||||
|
}
|
||||||
13
packages/server/tsconfig.json
Normal file
13
packages/server/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "dist",
|
||||||
|
"rootDir": ".",
|
||||||
|
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
||||||
|
"module": "Node16",
|
||||||
|
"target": "ES2022",
|
||||||
|
"composite": true,
|
||||||
|
},
|
||||||
|
"exclude": ["node_modules", "dist"],
|
||||||
|
}
|
||||||
|
|
||||||
@@ -5,6 +5,13 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"composite": true,
|
||||||
|
// MONOREPO STUFF
|
||||||
|
"incremental": true,
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "Node16",
|
||||||
|
"declaration": true,
|
||||||
|
"moduleResolution": "node16",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user