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 Jan 11, 2025
1 parent 7a4b4df commit dfc587e
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 189 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
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.

12 changes: 5 additions & 7 deletions packages/prompts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { cursor, erase } from "sisteransi";
export { isCancel } from '@clack/core';
export { updateSettings, type ClackSettings } 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 @@ -243,7 +241,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 @@ -483,7 +481,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 @@ -728,7 +726,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 @@ -757,7 +755,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 @@ -986,7 +984,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 dfc587e

Please sign in to comment.