Home / File/ selector-ui.ts — drizzle-orm Source File

selector-ui.ts — drizzle-orm Source File

Architecture documentation for selector-ui.ts, a typescript file in the drizzle-orm codebase. 2 imports, 4 dependents.

File typescript DrizzleKit SchemaDiffer 2 imports 4 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  78dc1315_e71e_ad0d_dd8e_8ff968c12ee5["selector-ui.ts"]
  0f00c7dd_5eba_f1f8_c559_a99431086500["chalk"]
  78dc1315_e71e_ad0d_dd8e_8ff968c12ee5 --> 0f00c7dd_5eba_f1f8_c559_a99431086500
  a506b568_7d24_7568_35df_af935066e9fd["hanji"]
  78dc1315_e71e_ad0d_dd8e_8ff968c12ee5 --> a506b568_7d24_7568_35df_af935066e9fd
  b387f7cb_f080_cc3a_a94d_1e2775ef2400["mysqlPushUtils.ts"]
  b387f7cb_f080_cc3a_a94d_1e2775ef2400 --> 78dc1315_e71e_ad0d_dd8e_8ff968c12ee5
  1f0f6821_4b66_fcbb_186f_e1b78872b924["pgPushUtils.ts"]
  1f0f6821_4b66_fcbb_186f_e1b78872b924 --> 78dc1315_e71e_ad0d_dd8e_8ff968c12ee5
  6219550e_1686_ca7a_0d96_0838fb90e7cb["push.ts"]
  6219550e_1686_ca7a_0d96_0838fb90e7cb --> 78dc1315_e71e_ad0d_dd8e_8ff968c12ee5
  65107a57_7714_63e5_7018_8c2efc0f3b41["singlestorePushUtils.ts"]
  65107a57_7714_63e5_7018_8c2efc0f3b41 --> 78dc1315_e71e_ad0d_dd8e_8ff968c12ee5
  style 78dc1315_e71e_ad0d_dd8e_8ff968c12ee5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import chalk from 'chalk';
import { Prompt, SelectState } from 'hanji';

export class Select extends Prompt<{ index: number; value: string }> {
	private readonly data: SelectState<{ label: string; value: string }>;

	constructor(items: string[]) {
		super();
		this.on('attach', (terminal) => terminal.toggleCursor('hide'));
		this.on('detach', (terminal) => terminal.toggleCursor('show'));

		this.data = new SelectState(
			items.map((it) => ({ label: it, value: `${it}-value` })),
		);
		this.data.bind(this);
	}

	render(status: 'idle' | 'submitted' | 'aborted'): string {
		if (status === 'submitted' || status === 'aborted') return '';

		let text = ``;
		this.data.items.forEach((it, idx) => {
			text += idx === this.data.selectedIdx
				? `${chalk.green('❯ ' + it.label)}`
				: `  ${it.label}`;
			text += idx != this.data.items.length - 1 ? '\n' : '';
		});

		return text;
	}

	result() {
		return {
			index: this.data.selectedIdx,
			value: this.data.items[this.data.selectedIdx]!.value!,
		};
	}
}

Domain

Subdomains

Classes

Dependencies

  • chalk
  • hanji

Frequently Asked Questions

What does selector-ui.ts do?
selector-ui.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleKit domain, SchemaDiffer subdomain.
What does selector-ui.ts depend on?
selector-ui.ts imports 2 module(s): chalk, hanji.
What files import selector-ui.ts?
selector-ui.ts is imported by 4 file(s): mysqlPushUtils.ts, pgPushUtils.ts, push.ts, singlestorePushUtils.ts.
Where is selector-ui.ts in the architecture?
selector-ui.ts is located at drizzle-kit/src/cli/selector-ui.ts (domain: DrizzleKit, subdomain: SchemaDiffer, directory: drizzle-kit/src/cli).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free