Skip to content

Commit 5e9127c

Browse files
authored
feat: expose additional clack prompt helpers (#120)
1 parent cb606b3 commit 5e9127c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import fs from 'node:fs';
22
import path, { dirname } from 'node:path';
33
import { fileURLToPath } from 'node:url';
44
import {
5+
autocomplete,
56
cancel,
7+
groupMultiselect,
68
isCancel,
79
log,
810
multiselect,
@@ -21,7 +23,7 @@ import { x } from 'tinyexec';
2123
const __filename = fileURLToPath(import.meta.url);
2224
const __dirname = dirname(__filename);
2325

24-
export { multiselect, select, text };
26+
export { autocomplete, groupMultiselect, multiselect, select, text };
2527

2628
function cancelAndExit() {
2729
cancel('Operation cancelled.');

test/index.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as promptsActual from '@clack/prompts' with { rstest: 'importActual' };
12
import { expect, test } from '@rstest/core';
23
import {
34
checkCancel,
@@ -6,6 +7,7 @@ import {
67
select,
78
text,
89
} from '../dist/index.js';
10+
import * as publicApi from '../src';
911

1012
test('should export public APIs', () => {
1113
expect(typeof checkCancel).toBe('function');
@@ -14,3 +16,9 @@ test('should export public APIs', () => {
1416
expect(typeof select).toBe('function');
1517
expect(typeof text).toBe('function');
1618
});
19+
20+
test('should expose selected clack prompt helpers from src entrypoint', () => {
21+
expect(publicApi.autocomplete).toBe(promptsActual.autocomplete);
22+
expect(publicApi.multiselect).toBe(promptsActual.multiselect);
23+
expect(publicApi.groupMultiselect).toBe(promptsActual.groupMultiselect);
24+
});

0 commit comments

Comments
 (0)