plum-e2e 2.4.7 → 2.4.8

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/bin/plum.js +58 -0
  2. package/package.json +1 -1
package/bin/plum.js CHANGED
@@ -323,6 +323,44 @@ async function serverStart() {
323
323
  clack.outro(pc.green('Plum is running. Use "plum server stop" to shut down.'));
324
324
  }
325
325
 
326
+ async function serverRestart() {
327
+ clack.intro(pc.bgMagenta(pc.white(' 🟣 Plum — Restart ')));
328
+ const { loadServerConfig } = serverConfigLib();
329
+ const cfg = loadServerConfig(process.cwd());
330
+ applyServerConfig(cfg);
331
+ clack.log.info(`UI: ${pc.cyan(`http://localhost:${cfg.frontendPort}`)}`);
332
+
333
+ execSync('docker compose up --build -d', { cwd: plumRoot, stdio: 'inherit' });
334
+
335
+ const apiBase = `http://localhost:${cfg.backendPort}`;
336
+ const s = clack.spinner();
337
+ s.start('Waiting for server to be ready…');
338
+ let ready = false;
339
+ for (let i = 0; i < 40; i++) {
340
+ await new Promise((r) => setTimeout(r, 1500));
341
+ try {
342
+ const res = await fetch(`${apiBase}/auth/needs-setup`);
343
+ if (res.ok) {
344
+ ready = true;
345
+ break;
346
+ }
347
+ } catch {}
348
+ }
349
+ s.stop(ready ? pc.green('✓ Server is ready') : pc.yellow('Server may still be starting'));
350
+ clack.log.info(`UI: ${pc.cyan(`http://localhost:${cfg.frontendPort}`)}`);
351
+ clack.log.info(`API: ${pc.cyan(`http://localhost:${cfg.backendPort}`)}`);
352
+ clack.outro(pc.green('Plum restarted.'));
353
+ }
354
+
355
+ async function serverUpdate() {
356
+ clack.intro(pc.bgMagenta(pc.white(' 🟣 Plum — Update ')));
357
+ clack.log.step('Fetching latest Plum version…');
358
+ execSync('npm install -g plum-e2e@latest', { stdio: 'inherit' });
359
+ clack.log.success('Plum CLI updated.');
360
+ clack.log.step('Rebuilding server with new version…');
361
+ await serverRestart();
362
+ }
363
+
326
364
  async function serverReconfig() {
327
365
  clack.intro(pc.bgMagenta(pc.white(' 🟣 Plum — Reconfigure Server ')));
328
366
  const cfg = await configureServer({ force: true });
@@ -759,6 +797,14 @@ switch (command) {
759
797
  await serverReconfig();
760
798
  break;
761
799
  }
800
+ if (subcommand === 'restart') {
801
+ await serverRestart();
802
+ break;
803
+ }
804
+ if (subcommand === 'update') {
805
+ await serverUpdate();
806
+ break;
807
+ }
762
808
  // fall through to start for 'plum server start' or 'plum server'
763
809
  // intentional fall-through
764
810
 
@@ -766,6 +812,14 @@ switch (command) {
766
812
  await serverStart();
767
813
  break;
768
814
 
815
+ case 'restart':
816
+ await serverRestart();
817
+ break;
818
+
819
+ case 'update':
820
+ await serverUpdate();
821
+ break;
822
+
769
823
  case 'run-test': {
770
824
  console.log('--------------------------------------\n');
771
825
  console.log('🚀 Running tests locally...');
@@ -957,7 +1011,11 @@ switch (command) {
957
1011
  console.log(' --backend-port <n> Host port for the backend/API (default: 3001)');
958
1012
  console.log(' --frontend-port <n> Host port for the UI (default: 5173)');
959
1013
  console.log(' server reconfig Re-enter server settings without starting');
1014
+ console.log(
1015
+ ' server restart Rebuild and restart the server (no prompts; alias: plum restart)'
1016
+ );
960
1017
  console.log(' server stop Stop the server (alias: plum stop)');
1018
+ console.log(' update Update Plum to the latest version and restart the server');
961
1019
  console.log(' node start Start a runner node (interactive), then open runner menu');
962
1020
  console.log(' --primary <url> Primary Plum server to auto-register with');
963
1021
  console.log(' --url <url> Address the primary calls back (default: <lan-ip>:<port>;');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plum-e2e",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/silverlunah/plum.git"