@mcpmesh/tsuite 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/tsuite +41 -0
- package/package.json +25 -0
- package/scripts/postinstall.js +17 -0
package/bin/tsuite
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execFileSync } = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
const platforms = {
|
|
7
|
+
'darwin-arm64': '@mcpmesh/tsuite-darwin-arm64',
|
|
8
|
+
'darwin-x64': '@mcpmesh/tsuite-darwin-x64',
|
|
9
|
+
'linux-arm64': '@mcpmesh/tsuite-linux-arm64',
|
|
10
|
+
'linux-x64': '@mcpmesh/tsuite-linux-x64',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const platform = `${process.platform === 'darwin' ? 'darwin' : 'linux'}-${process.arch === 'arm64' ? 'arm64' : 'x64'}`;
|
|
14
|
+
const pkgName = platforms[platform];
|
|
15
|
+
|
|
16
|
+
if (!pkgName) {
|
|
17
|
+
console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Find the binary
|
|
22
|
+
let binaryPath;
|
|
23
|
+
try {
|
|
24
|
+
const pkgPath = require.resolve(`${pkgName}/package.json`);
|
|
25
|
+
binaryPath = path.join(path.dirname(pkgPath), 'bin', 'tsuite');
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error(`Platform package ${pkgName} not found. Try reinstalling @mcpmesh/tsuite`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!fs.existsSync(binaryPath)) {
|
|
32
|
+
console.error(`Binary not found at ${binaryPath}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Execute the binary with all arguments
|
|
37
|
+
try {
|
|
38
|
+
execFileSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
39
|
+
} catch (e) {
|
|
40
|
+
process.exit(e.status || 1);
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcpmesh/tsuite",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Test suite runner for MCP Mesh",
|
|
5
|
+
"bin": {
|
|
6
|
+
"tsuite": "bin/tsuite"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node scripts/postinstall.js"
|
|
10
|
+
},
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"@mcpmesh/tsuite-darwin-arm64": "0.2.0",
|
|
13
|
+
"@mcpmesh/tsuite-darwin-x64": "0.2.0",
|
|
14
|
+
"@mcpmesh/tsuite-linux-arm64": "0.2.0",
|
|
15
|
+
"@mcpmesh/tsuite-linux-x64": "0.2.0"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/mcpmesh/mcp-mesh-test-suite"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=16"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Verify platform package was installed
|
|
2
|
+
const platforms = {
|
|
3
|
+
'darwin-arm64': '@mcpmesh/tsuite-darwin-arm64',
|
|
4
|
+
'darwin-x64': '@mcpmesh/tsuite-darwin-x64',
|
|
5
|
+
'linux-arm64': '@mcpmesh/tsuite-linux-arm64',
|
|
6
|
+
'linux-x64': '@mcpmesh/tsuite-linux-x64',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const platform = `${process.platform === 'darwin' ? 'darwin' : 'linux'}-${process.arch === 'arm64' ? 'arm64' : 'x64'}`;
|
|
10
|
+
const pkgName = platforms[platform];
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
require.resolve(`${pkgName}/package.json`);
|
|
14
|
+
console.log(`✓ @mcpmesh/tsuite installed successfully for ${platform}`);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.warn(`⚠ Platform package ${pkgName} not installed. Some features may not work.`);
|
|
17
|
+
}
|