Skip to content

Commit

Permalink
refactor: revert themes subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
orochaa committed Dec 15, 2024
1 parent c811374 commit 69b7030
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 188 deletions.
11 changes: 1 addition & 10 deletions packages/core/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,5 @@ import { defineBuildConfig } from 'unbuild';
// @see https://github.com/unjs/unbuild
export default defineBuildConfig({
preset: '../../build.preset',
entries: [
{
name: 'index',
input: 'src/prompts/index',
},
{
name: 'themes',
input: 'src/themes/index',
},
],
entries: ['src/index'],
});
13 changes: 0 additions & 13 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,9 @@
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./themes": {
"types": "./dist/themes.d.ts",
"import": "./dist/themes.mjs",
"require": "./dist/themes.cjs"
},
"./package.json": "./package.json"
},
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"themes": [
"./dist/themes.d.ts"
]
}
},
"repository": {
"type": "git",
"url": "https://github.com/natemoo-re/clack",
Expand Down Expand Up @@ -63,7 +51,6 @@
"test": "vitest run"
},
"dependencies": {
"is-unicode-supported": "^1.3.0",
"picocolors": "^1.0.0",
"sisteransi": "^1.0.5"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export { default as ConfirmPrompt } from "./prompts/confirm";
export { default as GroupMultiSelectPrompt } from "./prompts/group-multiselect";
export { default as MultiSelectPrompt } from "./prompts/multi-select";
export { default as PasswordPrompt } from "./prompts/password";
export { default as Prompt, State } from "./prompts/prompt";
export { default as SelectPrompt } from "./prompts/select";
export { default as SelectKeyPrompt } from "./prompts/select-key";
export { default as TextPrompt } from "./prompts/text";
export { block, isCancel, strLength, setGlobalAliases } from "./utils";
10 changes: 0 additions & 10 deletions packages/core/src/prompts/index.ts

This file was deleted.

105 changes: 0 additions & 105 deletions packages/core/src/themes/default.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/core/src/themes/index.ts

This file was deleted.

30 changes: 0 additions & 30 deletions packages/core/src/themes/symbols.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/core/src/themes/types.ts

This file was deleted.

11 changes: 5 additions & 6 deletions packages/prompts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import color from "picocolors";
import { cursor, erase } from "sisteransi";

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

const unicode = isUnicodeSupported();
const s = (c: string, fallback: string) => (unicode ? c : fallback);
Expand Down Expand Up @@ -240,7 +239,7 @@ export interface PasswordOptions {
export const password = (opts: PasswordOptions) => {
return new PasswordPrompt({
validate: opts.validate,
mask: opts.mask ?? S.PASSWORD_MASK,
mask: opts.mask ?? S_PASSWORD_MASK,
render() {
return applyTheme({
ctx: this,
Expand Down Expand Up @@ -446,7 +445,7 @@ export const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {
if (state === "submitted") {
return `${color.dim(label)}`;
}
return `${color.dim(S.CHECKBOX_INACTIVE)} ${color.dim(label)}`;
return `${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;
};

return new MultiSelectPrompt({
Expand Down Expand Up @@ -691,7 +690,7 @@ export const groupMultiselect = <Value>(
}
return opt(option, active ? "active" : "inactive", options);
})
.join(`\n${color.yellow(S.BAR)} `)}\n${footer}\n`;
.join(`\n${color.yellow(S_BAR)} `)}\n${footer}\n`;
}
default: {
return `${title}\n${color.cyan(S_BAR)} ${this.options
Expand Down Expand Up @@ -720,7 +719,7 @@ export const groupMultiselect = <Value>(
}
return opt(option, active ? "active" : "inactive", options);
})
.join(`\n${color.cyan(S.BAR)} `)}\n${color.cyan(S.BAR_END)}\n`;
.join(`\n${color.cyan(S_BAR)} `)}\n${color.cyan(S_BAR_END)}\n`;
}
}
},
Expand Down Expand Up @@ -949,7 +948,7 @@ export const spinner = () => {
clearPrevMessage();
const step =
code === 0
? color.green(S.STEP_SUBMIT)
? color.green(S_STEP_SUBMIT)
: code === 1
? color.red(S_STEP_CANCEL)
: color.red(S_STEP_ERROR);
Expand Down
1 change: 0 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69b7030

Please sign in to comment.