diff --git a/package.json b/package.json index b6a3010..901dee1 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,10 @@ "package.json", "packages" ], - "type": "module" + "type": "module", + "exports": { + ".": { + "import": "./dist/index.js" + } + } } diff --git a/src/index.ts b/src/index.ts index ff421d2..664ba44 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import { install } from './install.js'; import { list } from './list.js'; import inquirer from 'inquirer'; import autocomplete from 'inquirer-autocomplete-prompt'; -import { listInstalledPackages } from './installed'; +import { listInstalledPackages } from './installed.js'; import { uninstall } from './uninstall.js'; inquirer.registerPrompt('autocomplete', autocomplete); diff --git a/src/install.ts b/src/install.ts index 60c2e3b..a8b0864 100644 --- a/src/install.ts +++ b/src/install.ts @@ -3,11 +3,11 @@ import { join } from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; import { Package } from './types/index.js'; -import { installMCPServer } from './utils/config'; +import { installMCPServer } from './utils/config.js'; import inquirer from 'inquirer'; import { exec } from 'child_process'; import { promisify } from 'util'; -import { packageHelpers } from './helpers'; +import { packageHelpers } from './helpers/index.js'; import chalk from 'chalk'; const execAsync = promisify(exec); diff --git a/src/installed.ts b/src/installed.ts index c62dc98..30dc33e 100644 --- a/src/installed.ts +++ b/src/installed.ts @@ -1,8 +1,8 @@ import inquirer from 'inquirer'; import chalk from 'chalk'; -import { readConfig } from './utils/config'; -import { displayPackageDetailsWithActions } from './utils/display'; -import { uninstallPackage } from './utils/package-management'; +import { readConfig } from './utils/config.js'; +import { displayPackageDetailsWithActions } from './utils/display.js'; +import { uninstallPackage } from './utils/package-management.js'; import { Package } from './types'; import { readFileSync } from 'fs'; import { join } from 'path'; diff --git a/src/list.ts b/src/list.ts index 9bd2f5f..edfc9e4 100644 --- a/src/list.ts +++ b/src/list.ts @@ -7,7 +7,7 @@ import { fileURLToPath } from 'url'; import { dirname } from 'path'; import { Package } from './types/index.js'; import { displayPackageDetailsWithActions } from './utils/display.js'; -import { installPackage, uninstallPackage } from './utils/package-management'; +import { installPackage, uninstallPackage } from './utils/package-management.js'; import { createInterface } from 'readline'; import Table from 'cli-table3'; // Import cli-table3 import stringWidth from 'string-width'; // Import string-width diff --git a/src/uninstall.ts b/src/uninstall.ts index d8b737f..503c617 100644 --- a/src/uninstall.ts +++ b/src/uninstall.ts @@ -5,9 +5,9 @@ import { join } from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; import { Package } from './types'; -import { uninstallPackage } from './utils/package-management'; -import { displayPackageDetailsWithActions } from './utils/display'; -import { list } from './list'; +import { uninstallPackage } from './utils/package-management.js'; +import { displayPackageDetailsWithActions } from './utils/display.js'; +import { list } from './list.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/src/utils/display.ts b/src/utils/display.ts index c1c961f..3587707 100644 --- a/src/utils/display.ts +++ b/src/utils/display.ts @@ -2,7 +2,7 @@ import chalk from 'chalk'; import stringWidth from 'string-width'; import { Package } from '../types'; import inquirer from 'inquirer'; -import { readConfig } from './config'; +import { readConfig } from './config.js'; export function padString(str: string, width: number): string { const length = stringWidth(str); diff --git a/src/utils/package-management.ts b/src/utils/package-management.ts index 98f4986..63e1ed1 100644 --- a/src/utils/package-management.ts +++ b/src/utils/package-management.ts @@ -1,6 +1,6 @@ import inquirer from 'inquirer'; import { Package } from '../types'; -import { getConfigPath, installMCPServer, readConfig, writeConfig } from './config'; +import { getConfigPath, installMCPServer, readConfig, writeConfig } from './config.js'; import { exec } from 'child_process'; import { promisify } from 'util'; import { packageHelpers } from '../helpers/index.js';