nolimit-x 1.0.29 → 1.0.31

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/package.json +1 -1
  2. package/src/cli.js +46 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolimit-x",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Advanced email sender ",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -258,36 +258,70 @@ program
258
258
  init(projectName);
259
259
  });
260
260
 
261
- program
261
+ // Refactor SMS to use a nested subcommand for init
262
+ const sms = program
262
263
  .command("sms")
263
- .description("Switch to SMS mode (phonebook workspace)")
264
+ .description("Switch to SMS mode or manage SMS workspaces");
265
+
266
+ sms
267
+ .command("init <workspace>")
268
+ .description("Initialize a new SMS phonebook workspace")
269
+ .action((workspace) => {
270
+ initSMSWorkspace(workspace);
271
+ });
272
+
273
+ sms
264
274
  .action(() => {
265
- const spinner = getOra('Switching to SMS mode...').start();
275
+ let workspaceExists = true;
266
276
  try {
267
277
  validateSMSWorkspace();
268
- setMode("sms");
269
- spinner.succeed('Switched to SMS mode. Workspace ready.');
270
278
  } catch (err) {
271
- spinner.fail('Workspace missing required SMS files!');
279
+ workspaceExists = false;
280
+ }
281
+ if (!workspaceExists) {
272
282
  printSMSBanner();
273
- console.log("\x1b[31mSMS workspace not detected. Run 'nolimit sms init <workspace>' to create one.\x1b[0m");
274
283
  }
284
+ const spinner = getOra('Switching to SMS mode...').start();
285
+ setTimeout(() => {
286
+ if (workspaceExists) {
287
+ setMode("sms");
288
+ spinner.succeed('Workspace ready.');
289
+ } else {
290
+ spinner.text = 'Setting up workspace...';
291
+ setTimeout(() => {
292
+ spinner.fail('Workspace missing required SMS files!');
293
+ console.log("\x1b[31mSMS workspace not detected. Run 'nolimit sms init <workspace>' to create one.\x1b[0m");
294
+ }, 1000);
295
+ }
296
+ }, 800);
275
297
  });
276
298
 
277
299
  program
278
300
  .command("email")
279
301
  .description("Switch to email mode (email campaign workspace)")
280
302
  .action(() => {
281
- const spinner = getOra('Switching to Email mode...').start();
303
+ let workspaceExists = true;
282
304
  try {
283
305
  validateEmailWorkspace();
284
- setMode("email");
285
- spinner.succeed('Switched to Email mode. Workspace ready.');
286
306
  } catch (err) {
287
- spinner.fail('Workspace missing required email files!');
307
+ workspaceExists = false;
308
+ }
309
+ if (!workspaceExists) {
288
310
  printBanner();
289
- console.log("\x1b[36mEmail workspace not detected. Run 'nolimit init <workspace>' to create one.\x1b[0m");
290
311
  }
312
+ const spinner = getOra('Switching to Email mode...').start();
313
+ setTimeout(() => {
314
+ if (workspaceExists) {
315
+ setMode("email");
316
+ spinner.succeed('Workspace ready.');
317
+ } else {
318
+ spinner.text = 'Setting up workspace...';
319
+ setTimeout(() => {
320
+ spinner.fail('Workspace missing required email files!');
321
+ console.log("\x1b[36mEmail workspace not detected. Run 'nolimit init <workspace>' to create one.\x1b[0m");
322
+ }, 1000);
323
+ }
324
+ }, 800);
291
325
  });
292
326
 
293
327
  program
@@ -304,11 +338,4 @@ program
304
338
  }
305
339
  });
306
340
 
307
- program
308
- .command("sms init <workspace>")
309
- .description("Initialize a new SMS phonebook workspace")
310
- .action((workspace) => {
311
- initSMSWorkspace(workspace);
312
- });
313
-
314
341
  program.parse();