@hallaxius/forge 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hallaxius/forge",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A modern Git CLI with professional UX",
5
5
  "author": "hallaxius",
6
6
  "license": "MIT",
@@ -13,14 +13,17 @@
13
13
  "scripts": {
14
14
  "dev": "bun --watch src/cli.ts",
15
15
  "build:version": "bun scripts/gen-version.mjs",
16
- "build": "bun run build:version && bun build src/cli.ts --outdir dist --target node",
16
+ "build": "bun run build:version && bun build src/cli.ts --outdir dist --target node --external inquirer",
17
17
  "start": "bun bin/forge.js",
18
18
  "test": "bun test",
19
19
  "lint": "biome check",
20
20
  "format": "biome format --write",
21
21
  "lint:fix": "biome check --write --unsafe",
22
22
  "prepublishOnly": "bun run build && bun test",
23
- "prepack": "bun run build"
23
+ "prepack": "bun run build",
24
+ "patch": "npm version patch && npm publish",
25
+ "minor": "npm version minor && npm publish",
26
+ "major": "npm version major && npm publish"
24
27
  },
25
28
  "dependencies": {
26
29
  "boxen": "^7.1.0",
package/src/lib/ui.ts CHANGED
@@ -1,9 +1,12 @@
1
1
  import boxen from "boxen";
2
2
  import chalk from "chalk";
3
+ import inquirer from "inquirer";
3
4
  import ora from "ora";
4
5
  import { colors } from "../constants/colors.js";
5
6
  import { formatting } from "../constants/messages.js";
6
7
 
8
+ const { prompt } = inquirer;
9
+
7
10
  function stripAnsi(str: string): string {
8
11
  return str.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
9
12
  }
@@ -77,16 +80,11 @@ export function showSeparator(): void {
77
80
  console.log(chalk.dim(formatting.separator));
78
81
  }
79
82
 
80
- async function getInquirer() {
81
- return await import("inquirer");
82
- }
83
-
84
83
  export async function confirm(
85
84
  msg: string,
86
85
  defaultValue: boolean = true,
87
86
  ): Promise<boolean> {
88
- const inquirer = await getInquirer();
89
- const { value } = await inquirer.prompt([
87
+ const { value } = await prompt([
90
88
  {
91
89
  type: "confirm",
92
90
  name: "value",
@@ -101,8 +99,7 @@ export async function select<T>(
101
99
  message: string,
102
100
  choices: { name: string; value: T }[],
103
101
  ): Promise<T> {
104
- const inquirer = await getInquirer();
105
- const { value } = await inquirer.prompt([
102
+ const { value } = await prompt([
106
103
  {
107
104
  type: "list",
108
105
  name: "value",
@@ -117,8 +114,7 @@ export async function input(
117
114
  message: string,
118
115
  defaultValue?: string,
119
116
  ): Promise<string> {
120
- const inquirer = await getInquirer();
121
- const { value } = await inquirer.prompt([
117
+ const { value } = await prompt([
122
118
  {
123
119
  type: "input",
124
120
  name: "value",
@@ -133,8 +129,7 @@ export async function password(
133
129
  message: string,
134
130
  mask: string = "*",
135
131
  ): Promise<string> {
136
- const inquirer = await getInquirer();
137
- const { value } = await inquirer.prompt([
132
+ const { value } = await prompt([
138
133
  {
139
134
  type: "password",
140
135
  name: "value",
@@ -149,8 +144,7 @@ export async function checkbox(
149
144
  message: string,
150
145
  choices: { name: string; value: string; checked?: boolean }[],
151
146
  ): Promise<string[]> {
152
- const inquirer = await getInquirer();
153
- const { value } = await inquirer.prompt([
147
+ const { value } = await prompt([
154
148
  {
155
149
  type: "checkbox",
156
150
  name: "value",
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by build script. DO NOT EDIT.
2
- export const VERSION = "0.1.1";
2
+ export const VERSION = "0.1.2";