Skip to content

Commit 69b7030

Browse files
committed
refactor: revert themes subpath
1 parent c811374 commit 69b7030

File tree

10 files changed

+15
-188
lines changed

10 files changed

+15
-188
lines changed

packages/core/build.config.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@ import { defineBuildConfig } from 'unbuild';
33
// @see https://github.com/unjs/unbuild
44
export default defineBuildConfig({
55
preset: '../../build.preset',
6-
entries: [
7-
{
8-
name: 'index',
9-
input: 'src/prompts/index',
10-
},
11-
{
12-
name: 'themes',
13-
input: 'src/themes/index',
14-
},
15-
],
6+
entries: ['src/index'],
167
});

packages/core/package.json

-13
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,9 @@
1010
"import": "./dist/index.mjs",
1111
"require": "./dist/index.cjs"
1212
},
13-
"./themes": {
14-
"types": "./dist/themes.d.ts",
15-
"import": "./dist/themes.mjs",
16-
"require": "./dist/themes.cjs"
17-
},
1813
"./package.json": "./package.json"
1914
},
2015
"types": "./dist/index.d.ts",
21-
"typesVersions": {
22-
"*": {
23-
"themes": [
24-
"./dist/themes.d.ts"
25-
]
26-
}
27-
},
2816
"repository": {
2917
"type": "git",
3018
"url": "https://github.com/natemoo-re/clack",
@@ -63,7 +51,6 @@
6351
"test": "vitest run"
6452
},
6553
"dependencies": {
66-
"is-unicode-supported": "^1.3.0",
6754
"picocolors": "^1.0.0",
6855
"sisteransi": "^1.0.5"
6956
},

packages/core/src/index.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export { default as ConfirmPrompt } from "./prompts/confirm";
2+
export { default as GroupMultiSelectPrompt } from "./prompts/group-multiselect";
3+
export { default as MultiSelectPrompt } from "./prompts/multi-select";
4+
export { default as PasswordPrompt } from "./prompts/password";
5+
export { default as Prompt, State } from "./prompts/prompt";
6+
export { default as SelectPrompt } from "./prompts/select";
7+
export { default as SelectKeyPrompt } from "./prompts/select-key";
8+
export { default as TextPrompt } from "./prompts/text";
9+
export { block, isCancel, strLength, setGlobalAliases } from "./utils";

packages/core/src/prompts/index.ts

-10
This file was deleted.

packages/core/src/themes/default.ts

-105
This file was deleted.

packages/core/src/themes/index.ts

-3
This file was deleted.

packages/core/src/themes/symbols.ts

-30
This file was deleted.

packages/core/src/themes/types.ts

-10
This file was deleted.

packages/prompts/src/index.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import color from "picocolors";
1717
import { cursor, erase } from "sisteransi";
1818

1919
export { isCancel, setGlobalAliases } from "@clack/core";
20-
import { defaultTheme, S } from '@clack/core/themes';
2120

2221
const unicode = isUnicodeSupported();
2322
const s = (c: string, fallback: string) => (unicode ? c : fallback);
@@ -240,7 +239,7 @@ export interface PasswordOptions {
240239
export const password = (opts: PasswordOptions) => {
241240
return new PasswordPrompt({
242241
validate: opts.validate,
243-
mask: opts.mask ?? S.PASSWORD_MASK,
242+
mask: opts.mask ?? S_PASSWORD_MASK,
244243
render() {
245244
return applyTheme({
246245
ctx: this,
@@ -446,7 +445,7 @@ export const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {
446445
if (state === "submitted") {
447446
return `${color.dim(label)}`;
448447
}
449-
return `${color.dim(S.CHECKBOX_INACTIVE)} ${color.dim(label)}`;
448+
return `${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;
450449
};
451450

452451
return new MultiSelectPrompt({
@@ -691,7 +690,7 @@ export const groupMultiselect = <Value>(
691690
}
692691
return opt(option, active ? "active" : "inactive", options);
693692
})
694-
.join(`\n${color.yellow(S.BAR)} `)}\n${footer}\n`;
693+
.join(`\n${color.yellow(S_BAR)} `)}\n${footer}\n`;
695694
}
696695
default: {
697696
return `${title}\n${color.cyan(S_BAR)} ${this.options
@@ -720,7 +719,7 @@ export const groupMultiselect = <Value>(
720719
}
721720
return opt(option, active ? "active" : "inactive", options);
722721
})
723-
.join(`\n${color.cyan(S.BAR)} `)}\n${color.cyan(S.BAR_END)}\n`;
722+
.join(`\n${color.cyan(S_BAR)} `)}\n${color.cyan(S_BAR_END)}\n`;
724723
}
725724
}
726725
},
@@ -949,7 +948,7 @@ export const spinner = () => {
949948
clearPrevMessage();
950949
const step =
951950
code === 0
952-
? color.green(S.STEP_SUBMIT)
951+
? color.green(S_STEP_SUBMIT)
953952
: code === 1
954953
? color.red(S_STEP_CANCEL)
955954
: color.red(S_STEP_ERROR);

pnpm-lock.yaml

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)