Merge pull request #42 from LSTM-Kirigaya/dev

包管理器换成yarn
This commit is contained in:
Li Yaning 2025-06-22 16:32:04 +08:00 committed by GitHub
commit eab59e4ba1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 6069 additions and 16543 deletions

View File

@ -4,6 +4,9 @@ on:
push:
branches:
- main
- dev
- hotfix
- hotfix/*
release:
types:
- published
@ -23,13 +26,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
cache: 'yarn'
- name: Install dependencies
run: npm ci
run: yarn install --frozen-lockfile
- name: Build all
run: npm run build
run: yarn build
- name: Package VSIX
run: npx vsce package --out dist/openmcp.vsix

View File

@ -4,6 +4,9 @@ on:
push:
branches:
- main
- dev
- hotfix
- hotfix/*
release:
types:
- published
@ -23,10 +26,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
cache: 'yarn'
- name: Install dependencies
run: npm ci
run: yarn install --frozen-lockfile
- name: Install xvfb (Linux only)
if: runner.os == 'Linux'
@ -34,8 +37,8 @@ jobs:
- name: Run Test with XVFB (Linux)
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum npm run test
run: xvfb-run --auto-servernum yarn test
- name: Run Test (Windows/macOS)
if: runner.os != 'Linux'
run: npm run test
run: yarn test

View File

@ -168,4 +168,4 @@ Then just press F5, いただきます (Let's begin)
✅ npm run build:task-loop
✅ openmcp-client UT
✅ openmcp-sdk UT
✅ vscode extension UT
✅ vscode extension UT

View File

@ -8,9 +8,13 @@ build({
format: 'cjs',
outfile: 'dist/extension.cjs.js',
sourcemap: true,
external: ['vscode'], // 只排除 vscode其他依赖全部打包进来
target: ['node18'], // 你可以根据实际 node 版本调整
external: ['vscode'],
target: ['node22'],
loader: {
'.json': 'json'
}
},
define: { 'import.meta.url': '_importMetaUrl' },
banner: {
js: "const _importMetaUrl=require('url').pathToFileURL(__filename)",
},
}).catch(() => process.exit(1));

11875
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
"description": "An all in one MCP Client/TestTool",
"version": "0.1.8",
"publisher": "kirigaya",
"private": true,
"author": {
"name": "kirigaya",
"email": "1193466151@qq.com"
@ -220,14 +221,14 @@
"renderer"
],
"scripts": {
"setup": "npm i && npm run prepare:ocr",
"setup": "yarn install && yarn prepare:ocr",
"serve": "turbo serve",
"build": "turbo build && tsc -p ./ && node esbuild.config.js",
"build:plugin": "npm run build && tsc && vsce package",
"build:plugin": "yarn build && tsc && vsce package",
"vscode:prepublish": "node esbuild.config.js",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run build",
"pretest": "yarn build",
"lint": "eslint src --ext ts",
"test": "node ./dist/test/e2e/runTest.js",
"prepare:ocr": "rollup -c rollup.tesseract.js --bundleConfigAsCjs",
@ -265,6 +266,7 @@
"@types/node": "^22.15.29",
"@types/pako": "^2.0.3",
"@types/showdown": "^2.0.0",
"@types/sinon": "^17.0.4",
"@types/vscode": "^1.72.0",
"@vscode/test-cli": "^0.0.11",
"@vscode/test-electron": "^2.5.2",
@ -275,6 +277,7 @@
"rollup": "^4.43.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-visualizer": "^6.0.1",
"sinon": "^21.0.0",
"ts-loader": "^9.5.1",
"turbo": "^2.5.3",
"typescript": "^5.4.2",
@ -286,5 +289,5 @@
"webpack": "^5.99.5",
"webpack-cli": "^5.1.4"
},
"packageManager": "npm@10.0.0"
}
"packageManager": "yarn@1.22.22"
}

View File

@ -62,5 +62,7 @@
"vite": "^6.2.4",
"vite-plugin-vue-devtools": "^7.7.2",
"vue-tsc": "^2.2.8"
}
},
"main": "index.js",
"license": "MIT"
}

4633
service/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,13 @@
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"serve": "nodemon --watch src --exec tsx src/main.ts",
"serve": "tsx watch src/main.ts",
"build": "tsc",
"build:watch": "tsc --watch",
"postbuild": "node ./scripts/post-build.mjs",
"start": "node --experimental-specifier-resolution=node dist/main.js",
"start:prod": "NODE_ENV=production node --experimental-specifier-resolution=node dist/main.js",
"debug": "node --inspect --no-warnings=ExperimentalWarning -r tsx/esm src/main.ts",
"start": "node dist/main.js",
"start:prod": "NODE_ENV=production node dist/main.js",
"debug": "tsx --inspect src/main.ts",
"clean": "rm -rf dist",
"lint": "eslint src --ext .ts,.tsx",
"typecheck": "tsc --noEmit"
@ -50,4 +50,4 @@
"uuid": "^11.1.0",
"ws": "^8.18.1"
}
}
}

View File

@ -13,9 +13,6 @@ export interface VSCodeMessage {
callbackId?: string;
}
// 适配 ESM 的 __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// 统一路径变量
const devHome = join(__dirname, '..', '..');

View File

@ -9,9 +9,6 @@ import path from 'path';
import { setRunningCWD } from './hook/setting.js';
import { exit } from 'process';
// 适配 ESM 的 __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export interface VSCodeMessage {
command: string;

View File

@ -2,9 +2,11 @@ import * as assert from 'assert';
import * as vscode from 'vscode';
suite('测试基础插件激活和命令注册', () => {
vscode.window.showInformationMessage('Start base tests.');
test('Sample test', () => {
vscode.window.showInformationMessage('开始测试基础插件激活和命令注册');
setup(async () => {
await vscode.commands.executeCommand('workbench.view.extension.openmcp-sidebar');
});
test('测试的测试', () => {
assert.strictEqual([1, 2, 3].indexOf(5), -1);
assert.strictEqual([1, 2, 3].indexOf(0), -1);
});
@ -25,9 +27,5 @@ suite('测试基础插件激活和命令注册', () => {
assert.ok(commands.includes('openmcp.showOpenMCP'), '命令未注册');
});
test('等待 10 秒以便观察窗口', async function () {
this.timeout(15000);
await new Promise(resolve => setTimeout(resolve, 10000));
});
//
});

View File

@ -0,0 +1,44 @@
import * as assert from 'assert';
import * as vscode from 'vscode';
import * as sinon from 'sinon';
suite('连接管理测试', () => {
vscode.window.showInformationMessage('开始测试连接管理');
let inputBoxStub: sinon.SinonStub;
let quickPickStub: sinon.SinonStub;
setup(async () => {
// mock showQuickPick
// quickPickStub = sinon.stub(vscode.window, 'showQuickPick');
// // mock showInputBox
// inputBoxStub = sinon.stub(vscode.window, 'showInputBox');
await vscode.commands.executeCommand('workbench.view.extension.openmcp-sidebar');
});
teardown(() => {
sinon.restore();
});
test('新建STDIO连接', async function () {
this.timeout(15000);
// await vscode.commands.executeCommand('openmcp.sidebar.workspace-connection.addConnection');
// quickPickStub.onFirstCall().resolves('STDIO');
// await new Promise(resolve => setTimeout(resolve, 5000));
// inputBoxStub.onFirstCall().resolves('echo'); // command
// await new Promise(resolve => setTimeout(resolve, 5000));
// inputBoxStub.onSecondCall().resolves(''); // cwd
await vscode.commands.executeCommand('openmcp.sidebar.workspace-connection.addConnection');
});
test('等待以便观察窗口', async function () {
this.timeout(15000);
await new Promise(resolve => setTimeout(resolve, 10000));
});
});

5983
yarn.lock Normal file

File diff suppressed because it is too large Load Diff