plexmint 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +29 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -195,7 +195,7 @@ async function setupCommand() {
195
195
  console.log(mintBold(" PlexMint Setup"));
196
196
  console.log(chalk2.gray(" Create your account and start browsing AI prompts."));
197
197
  console.log("");
198
- const answers = await inquirer.prompt([
198
+ const { name, email } = await inquirer.prompt([
199
199
  {
200
200
  type: "input",
201
201
  name: "name",
@@ -207,24 +207,34 @@ async function setupCommand() {
207
207
  name: "email",
208
208
  message: "Email:",
209
209
  validate: (v) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) || "Enter a valid email address."
210
- },
211
- {
212
- type: "password",
213
- name: "password",
214
- message: "Password:",
215
- mask: "*",
216
- validate: (v) => v.length >= 8 || "Password must be at least 8 characters."
217
- },
218
- {
219
- type: "password",
220
- name: "confirmPassword",
221
- message: "Confirm password:",
222
- mask: "*",
223
- validate: (v, a) => {
224
- if (!a) return "Confirm your password.";
225
- return v === a.password || "Passwords do not match.";
210
+ }
211
+ ]);
212
+ let password = "";
213
+ while (true) {
214
+ const { pw } = await inquirer.prompt([
215
+ {
216
+ type: "password",
217
+ name: "pw",
218
+ message: "Password:",
219
+ mask: "*",
220
+ validate: (v) => v.length >= 8 || "Password must be at least 8 characters."
226
221
  }
227
- },
222
+ ]);
223
+ const { confirm } = await inquirer.prompt([
224
+ {
225
+ type: "password",
226
+ name: "confirm",
227
+ message: "Confirm password:",
228
+ mask: "*"
229
+ }
230
+ ]);
231
+ if (pw === confirm) {
232
+ password = pw;
233
+ break;
234
+ }
235
+ console.log(chalk2.red(" Passwords do not match. Try again.\n"));
236
+ }
237
+ const { tickerPrefix } = await inquirer.prompt([
228
238
  {
229
239
  type: "input",
230
240
  name: "tickerPrefix",
@@ -233,6 +243,7 @@ async function setupCommand() {
233
243
  validate: (v) => /^[A-Z]{2,5}$/i.test(v.trim()) || "Enter 2-5 letters (e.g. NUE, ACME)."
234
244
  }
235
245
  ]);
246
+ const answers = { name, email, password, tickerPrefix };
236
247
  const spinner = ora("Creating your account...").start();
237
248
  try {
238
249
  const client = new PlexMintClient();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plexmint",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "PlexMint CLI — Browse, buy, and manage AI prompts from your terminal",
5
5
  "type": "module",
6
6
  "bin": {