Skip to content

Commit 961fec8

Browse files
authored
Merge pull request #88 from mapbox/ctufts/add-exports-opex
added version/tool exports
2 parents 6269ad9 + 609c55a commit 961fec8

4 files changed

Lines changed: 50 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Unreleased
22

3+
### Public API
4+
5+
- **Add `getAllTools` and `getVersionInfo` to public exports**`getAllTools` is now re-exported from `@mapbox/mcp-devkit-server/tools` and `getVersionInfo` (plus `VersionInfo` type) from `@mapbox/mcp-devkit-server/utils`. These are needed by `hosted-mcp-server` to import server functionality via npm packages instead of submodule filesystem paths.
6+
- Added `test/exports.test.ts` to verify public barrel exports
7+
38
## 0.5.1 - 2026-03-04
49

510
### Dependencies

src/tools/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export const validateStyle = new ValidateStyleTool();
162162

163163
// Export registry functions for batch access
164164
export {
165+
getAllTools,
165166
getCoreTools,
166167
getElicitationTools,
167168
getResourceFallbackTools,

src/utils/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,9 @@ export {
4242
type HttpPolicy
4343
} from './httpPipeline.js';
4444

45+
// Export version utilities
46+
export { getVersionInfo } from './versionUtils.js';
47+
export type { VersionInfo } from './versionUtils.js';
48+
4549
// Export types
4650
export type { HttpRequest } from './types.js';

test/exports.test.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Mapbox, Inc.
2+
// Licensed under the MIT License.
3+
4+
import { describe, it, expect } from 'vitest';
5+
6+
describe('Public API exports', () => {
7+
describe('tools barrel', () => {
8+
it('exports getAllTools', async () => {
9+
const { getAllTools } = await import('../src/tools/index.js');
10+
expect(getAllTools).toBeDefined();
11+
expect(typeof getAllTools).toBe('function');
12+
});
13+
14+
it('exports getCoreTools', async () => {
15+
const { getCoreTools } = await import('../src/tools/index.js');
16+
expect(getCoreTools).toBeDefined();
17+
expect(typeof getCoreTools).toBe('function');
18+
});
19+
20+
it('exports getToolByName', async () => {
21+
const { getToolByName } = await import('../src/tools/index.js');
22+
expect(getToolByName).toBeDefined();
23+
expect(typeof getToolByName).toBe('function');
24+
});
25+
});
26+
27+
describe('utils barrel', () => {
28+
it('exports getVersionInfo', async () => {
29+
const { getVersionInfo } = await import('../src/utils/index.js');
30+
expect(getVersionInfo).toBeDefined();
31+
expect(typeof getVersionInfo).toBe('function');
32+
});
33+
34+
it('exports httpRequest', async () => {
35+
const { httpRequest } = await import('../src/utils/index.js');
36+
expect(httpRequest).toBeDefined();
37+
expect(typeof httpRequest).toBe('function');
38+
});
39+
});
40+
});

0 commit comments

Comments
 (0)