@mehmetbaykar/swift-search-mcp 0.1.0 → 0.1.2

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.
Files changed (3) hide show
  1. package/bin.js +30 -3
  2. package/install.js +0 -4
  3. package/package.json +2 -4
package/bin.js CHANGED
@@ -7,12 +7,39 @@ const fs = require('fs');
7
7
  const BINARY_NAME = 'swift-search-mcp';
8
8
 
9
9
  const PLATFORMS = {
10
- 'darwin-arm64': '@mehmetbaykar/swift-search-mcp-darwin-arm64',
11
- 'darwin-x64': '@mehmetbaykar/swift-search-mcp-darwin-x64',
12
10
  'linux-x64': '@mehmetbaykar/swift-search-mcp-linux-x64'
13
11
  };
14
12
 
13
+ /**
14
+ * Check for local development binary (release first, then debug)
15
+ * This enables using npx during local development without publishing
16
+ */
17
+ function getLocalDevBinary() {
18
+ // Project root is two levels up from npm/swift-search-mcp/
19
+ const projectRoot = path.resolve(__dirname, '../..');
20
+
21
+ const buildDirs = [
22
+ path.join(projectRoot, '.build', 'release', BINARY_NAME),
23
+ path.join(projectRoot, '.build', 'debug', BINARY_NAME),
24
+ ];
25
+
26
+ for (const binaryPath of buildDirs) {
27
+ if (fs.existsSync(binaryPath)) {
28
+ return binaryPath;
29
+ }
30
+ }
31
+
32
+ return null;
33
+ }
34
+
15
35
  function getBinaryPath() {
36
+ // 1. Check for local development binary first (release → debug)
37
+ const localBinary = getLocalDevBinary();
38
+ if (localBinary) {
39
+ return localBinary;
40
+ }
41
+
42
+ // 2. Check platform support
16
43
  const platformKey = `${process.platform}-${process.arch}`;
17
44
  const pkg = PLATFORMS[platformKey];
18
45
 
@@ -22,7 +49,7 @@ function getBinaryPath() {
22
49
  process.exit(1);
23
50
  }
24
51
 
25
- // Try to find the binary from optionalDependencies
52
+ // 3. Try to find the binary from optionalDependencies
26
53
  try {
27
54
  const pkgPath = require.resolve(`${pkg}/package.json`);
28
55
  const pkgDir = path.dirname(pkgPath);
package/install.js CHANGED
@@ -19,14 +19,10 @@ const BINARY_NAME = 'swift-search-mcp';
19
19
  const REPO = 'mehmetbaykar/swift-search-mcp';
20
20
 
21
21
  const PLATFORMS = {
22
- 'darwin-arm64': '@mehmetbaykar/swift-search-mcp-darwin-arm64',
23
- 'darwin-x64': '@mehmetbaykar/swift-search-mcp-darwin-x64',
24
22
  'linux-x64': '@mehmetbaykar/swift-search-mcp-linux-x64'
25
23
  };
26
24
 
27
25
  const ASSET_NAMES = {
28
- 'darwin-arm64': 'swift-search-mcp-darwin-arm64.tar.gz',
29
- 'darwin-x64': 'swift-search-mcp-darwin-x64.tar.gz',
30
26
  'linux-x64': 'swift-search-mcp-linux-x64.tar.gz'
31
27
  };
32
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mehmetbaykar/swift-search-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Swift MCP Server - Model Context Protocol server written in Swift",
5
5
  "author": "Mehmet Baykar",
6
6
  "license": "MIT",
@@ -19,9 +19,7 @@
19
19
  "install.js"
20
20
  ],
21
21
  "optionalDependencies": {
22
- "@mehmetbaykar/swift-search-mcp-darwin-arm64": "0.1.0",
23
- "@mehmetbaykar/swift-search-mcp-darwin-x64": "0.1.0",
24
- "@mehmetbaykar/swift-search-mcp-linux-x64": "0.1.0"
22
+ "@mehmetbaykar/swift-search-mcp-linux-x64": "0.1.2"
25
23
  },
26
24
  "engines": {
27
25
  "node": ">=14"