Skip to content

Commit

Permalink
Fix npx usage
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellatman committed Nov 27, 2024
1 parent f7e41d8 commit 68a3fa3
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 13 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,10 @@
"package.json",
"packages"
],
"type": "module"
"type": "module",
"exports": {
".": {
"import": "./dist/index.js"
}
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/installed.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/uninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/package-management.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 68a3fa3

Please sign in to comment.