Skip to content

Commit 23c4dbc

Browse files
committed
feat(openapi-ts): export additional functions from index.ts
Added exports for getSpec, initConfigs, and parseOpenApiSpec to the main index file for improved accessibility of these functions.
1 parent 729488e commit 23c4dbc

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

packages/openapi-ts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hey-api/openapi-ts",
3-
"version": "0.66.3",
3+
"version": "0.67.0",
44
"description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.",
55
"homepage": "https://heyapi.dev/",
66
"repository": {
@@ -98,6 +98,6 @@
9898
"prettier": "3.4.2",
9999
"ts-node": "10.9.2",
100100
"tslib": "2.8.1",
101-
"typescript": "5.5.3"
101+
"typescript": "5.8.3"
102102
}
103103
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, it } from 'vitest';
2+
3+
describe('main entry index', () => {
4+
it('getSpec should be exported', async () => {
5+
const { getSpec } = await import('../index');
6+
expect(getSpec).toBeDefined();
7+
});
8+
9+
it('initConfigs should be exported', async () => {
10+
const { initConfigs } = await import('../index');
11+
expect(initConfigs).toBeDefined();
12+
});
13+
14+
it('parseOpenApiSpec should be exported', async () => {
15+
const { parseOpenApiSpec } = await import('../index');
16+
expect(parseOpenApiSpec).toBeDefined();
17+
});
18+
19+
describe('createClient', () => {
20+
it('should be exported', async () => {
21+
const { createClient } = await import('../index');
22+
expect(createClient).toBeDefined();
23+
});
24+
});
25+
});

packages/openapi-ts/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ export const createClient = async (
9191
export const defineConfig = async (config: Configs): Promise<UserConfig> =>
9292
typeof config === 'function' ? await config() : config;
9393

94+
export { getSpec } from './getSpec';
9495
export { defaultPlugins } from './initConfigs';
96+
export { initConfigs } from './initConfigs';
9597
export type { IR } from './ir/types';
98+
export { parseOpenApiSpec } from './openApi';
9699
export type { OpenApi } from './openApi/types';
97100
export { clientDefaultConfig } from './plugins/@hey-api/client-core/config';
98101
export { clientPluginHandler } from './plugins/@hey-api/client-core/plugin';

0 commit comments

Comments
 (0)