plum-e2e 2.5.4 → 2.5.6

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.
@@ -159,7 +159,15 @@ function prepareEnv() {
159
159
  fs.writeFileSync(markerPath, currentVersion, 'utf8');
160
160
  }
161
161
 
162
- execSync('npx playwright install chromium firefox', { cwd: BACKEND_DIR, stdio, shell: true });
162
+ // --with-deps also installs the OS-level shared libraries (libnss3, libatk,
163
+ // etc.) Chromium/Firefox need to actually launch — without it, a fresh
164
+ // Linux host has the browser binaries but fails at launch time with
165
+ // "Host system is missing dependencies to run browsers."
166
+ execSync('npx playwright install --with-deps chromium firefox', {
167
+ cwd: BACKEND_DIR,
168
+ stdio,
169
+ shell: true
170
+ });
163
171
  }
164
172
 
165
173
  /**
package/bin/plum.js CHANGED
@@ -460,10 +460,41 @@ async function serverRestart() {
460
460
  clack.outro(pc.green('Server restarted.'));
461
461
  }
462
462
 
463
+ // A fresh `npm publish` can take a minute or two to fully propagate across
464
+ // npm's CDN edges — hitting a stale one right after publishing produces an
465
+ // ETARGET error even though the version genuinely exists. Retry a few times
466
+ // with a short delay instead of crashing outright on what's usually transient.
467
+ const NPM_INSTALL_RETRIES = 3;
468
+ const NPM_INSTALL_RETRY_DELAY_MS = 5000;
469
+
470
+ function npmInstallLatestWithRetry() {
471
+ for (let attempt = 1; attempt <= NPM_INSTALL_RETRIES; attempt++) {
472
+ try {
473
+ execSync('npm install -g plum-e2e@latest', { stdio: 'inherit' });
474
+ return true;
475
+ } catch {
476
+ if (attempt < NPM_INSTALL_RETRIES) {
477
+ clack.log.warn(
478
+ `npm install failed (attempt ${attempt}/${NPM_INSTALL_RETRIES}) — this is often a transient registry propagation delay right after a new release. Retrying in ${NPM_INSTALL_RETRY_DELAY_MS / 1000}s…`
479
+ );
480
+ execSync(`sleep ${NPM_INSTALL_RETRY_DELAY_MS / 1000}`);
481
+ }
482
+ }
483
+ }
484
+ return false;
485
+ }
486
+
463
487
  async function serverUpdate() {
464
488
  clack.intro(pc.bgMagenta(pc.white(' 🟣 Plum — Update ')));
465
489
  clack.log.step('Fetching latest Plum version…');
466
- execSync('npm install -g plum-e2e@latest', { stdio: 'inherit' });
490
+ if (!npmInstallLatestWithRetry()) {
491
+ clack.log.error(
492
+ `Failed to install the latest version after ${NPM_INSTALL_RETRIES} attempts. Try again shortly, or run "npm install -g plum-e2e@latest" manually to see the full error.`
493
+ );
494
+ clack.outro(pc.red('Update failed.'));
495
+ process.exitCode = 1;
496
+ return;
497
+ }
467
498
  clack.log.success('Plum CLI updated.');
468
499
 
469
500
  const serverCfgPath = path.join(process.cwd(), '.plum-server.json');
@@ -479,14 +510,19 @@ async function serverUpdate() {
479
510
  isAlive(registry[String(nodeCfg.id)].pid)
480
511
  );
481
512
 
513
+ // Re-exec `plum` as a fresh process for the restart steps rather than
514
+ // calling serverRestart()/nodeRestart() directly — this same process
515
+ // already loaded the OLD code into memory before npm install ran above,
516
+ // so calling them in-process would rebuild using stale logic no matter
517
+ // how new the just-installed files on disk actually are.
482
518
  if (hasServerCfg) {
483
- clack.log.step('Rebuilding server with new version…');
484
- await serverRestart();
519
+ clack.log.step('Rebuilding server with the newly installed version…');
520
+ execSync('plum server restart', { stdio: 'inherit' });
485
521
  }
486
522
 
487
523
  if (nodeRunning) {
488
- clack.log.step('Restarting node runner with new version…');
489
- await nodeRestart();
524
+ clack.log.step('Restarting node runner with the newly installed version…');
525
+ execSync('plum node restart', { stdio: 'inherit' });
490
526
  }
491
527
 
492
528
  if (!hasServerCfg && !nodeRunning) {
@@ -726,6 +762,14 @@ async function openManageRunnersMenu(primaryUrl) {
726
762
  * "plum <command>" to run the desired command.
727
763
  * ------------------------------------------------------ */
728
764
  switch (command) {
765
+ case '--version':
766
+ case '-v':
767
+ case 'version': {
768
+ const pkg = JSON.parse(fs.readFileSync(path.join(plumRoot, 'package.json'), 'utf8'));
769
+ console.log(pkg.version);
770
+ break;
771
+ }
772
+
729
773
  case 'init': {
730
774
  clack.intro(pc.bgMagenta(pc.white(' 🟣 Plum — Init ')));
731
775
 
@@ -1185,6 +1229,7 @@ switch (command) {
1185
1229
  default:
1186
1230
  console.log('--------------------------------------\n');
1187
1231
  console.log('Usage: plum <command>\n');
1232
+ console.log(' --version, -v Print the installed Plum version');
1188
1233
  console.log(' init Set up a new Plum project');
1189
1234
  console.log(' server start Start the full UI stack (interactive)');
1190
1235
  console.log(' --headless <bool> Run browsers headless (true/false)');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plum-e2e",
3
- "version": "2.5.4",
3
+ "version": "2.5.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/silverlunah/plum.git"