Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import fs from 'node:fs';
import path, { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import {
autocomplete,
cancel,
groupMultiselect,
isCancel,
log,
multiselect,
Expand All @@ -21,7 +23,7 @@ import { x } from 'tinyexec';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export { multiselect, select, text };
export { autocomplete, groupMultiselect, multiselect, select, text };

function cancelAndExit() {
cancel('Operation cancelled.');
Expand Down
8 changes: 8 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as promptsActual from '@clack/prompts' with { rstest: 'importActual' };
import { expect, test } from '@rstest/core';
import {
checkCancel,
Expand All @@ -6,6 +7,7 @@ import {
select,
text,
} from '../dist/index.js';
import * as publicApi from '../src';

test('should export public APIs', () => {
expect(typeof checkCancel).toBe('function');
Expand All @@ -14,3 +16,9 @@ test('should export public APIs', () => {
expect(typeof select).toBe('function');
expect(typeof text).toBe('function');
});

test('should expose selected clack prompt helpers from src entrypoint', () => {
expect(publicApi.autocomplete).toBe(promptsActual.autocomplete);
expect(publicApi.multiselect).toBe(promptsActual.multiselect);
expect(publicApi.groupMultiselect).toBe(promptsActual.groupMultiselect);
});