Skip to content

Commit f850c03

Browse files
fix build
1 parent 0cd6530 commit f850c03

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/server/sapi-base-server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
22
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3-
import pkg from '../../package.json';
43
import { ScraperApiClient } from '../clients/scraper-api-client';
4+
import { PACKAGE_VERSION } from '../version';
55
import {
66
AmazonSearchTool,
77
AmazonProductTool,
@@ -48,7 +48,7 @@ export class ScraperAPIBaseServer {
4848
constructor({ auth, toolsets = [] }: { auth: string; toolsets: TOOLSET[] }) {
4949
this.server = new McpServer({
5050
name: 'decodo',
51-
version: pkg.version,
51+
version: PACKAGE_VERSION,
5252
});
5353
this.sapiClient = new ScraperApiClient({});
5454

src/version.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readFileSync } from 'node:fs';
2+
import { join } from 'node:path';
3+
4+
/** Resolved at runtime so `rootDir` can stay `./src` (no `import` of repo-root `package.json`). */
5+
export const PACKAGE_VERSION = (
6+
JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8')) as { version: string }
7+
).version;

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"target": "es2017",
44
"module": "nodenext",
5+
"rootDir": "./src",
56
"outDir": "./build",
67
"baseUrl": "src",
78
"strict": true,

0 commit comments

Comments
 (0)