@socketsecurity/lib 3.3.7 → 3.3.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.3.8](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.8) - 2025-11-14
9
+
10
+ ### Fixed
11
+
12
+ - **spinner**: Clear remaining artifacts after withSpinner stops
13
+ - Fixed rogue spinner characters persisting after spinner completes
14
+
8
15
  ## [3.3.7](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.7) - 2025-11-13
9
16
 
10
17
  ### Changed
package/dist/spinner.js CHANGED
@@ -62,9 +62,6 @@ function desc(value) {
62
62
  writable: true
63
63
  };
64
64
  }
65
- function normalizeText(value) {
66
- return typeof value === "string" ? value.trimStart() : "";
67
- }
68
65
  function formatProgress(progress) {
69
66
  const { current, total, unit } = progress;
70
67
  const percentage = Math.round(current / total * 100);
@@ -72,6 +69,9 @@ function formatProgress(progress) {
72
69
  const count = unit ? `${current}/${total} ${unit}` : `${current}/${total}`;
73
70
  return `${bar} ${percentage}% (${count})`;
74
71
  }
72
+ function normalizeText(value) {
73
+ return typeof value === "string" ? value.trimStart() : "";
74
+ }
75
75
  function renderProgressBar(percentage, width = 20) {
76
76
  const filled = Math.round(percentage / 100 * width);
77
77
  const empty = width - filled;
@@ -701,17 +701,10 @@ function Spinner(options) {
701
701
  * ```
702
702
  */
703
703
  stop(...args) {
704
- if (!args.length || !args[0]) {
705
- super.text = "";
706
- }
707
704
  this.#baseText = "";
708
705
  this.#progress = void 0;
709
- if (this.#shimmer) {
710
- this.#shimmer.currentDir = import_text_shimmer.DIR_LTR;
711
- this.#shimmer.step = 0;
712
- }
706
+ this.#shimmer = void 0;
713
707
  const result = this.#apply("stop", args);
714
- super.text = "";
715
708
  return result;
716
709
  }
717
710
  /**
@@ -886,7 +879,11 @@ async function withSpinner(options) {
886
879
  try {
887
880
  return await operation();
888
881
  } finally {
882
+ const wasSpinning = spinner.isSpinning;
889
883
  spinner.stop();
884
+ if (wasSpinning) {
885
+ process.stderr.write("\r\x1B[2K");
886
+ }
890
887
  if (savedColor !== void 0) {
891
888
  spinner.color = savedColor;
892
889
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/lib",
3
- "version": "3.3.7",
3
+ "version": "3.3.8",
4
4
  "packageManager": "pnpm@10.22.0",
5
5
  "license": "MIT",
6
6
  "description": "Core utilities and infrastructure for Socket.dev security tools",
@@ -686,7 +686,7 @@
686
686
  "@socketregistry/is-unicode-supported": "1.0.5",
687
687
  "@socketregistry/packageurl-js": "1.3.5",
688
688
  "@socketregistry/yocto-spinner": "1.0.25",
689
- "@socketsecurity/lib-stable": "npm:@socketsecurity/lib@3.3.5",
689
+ "@socketsecurity/lib-stable": "npm:@socketsecurity/lib@3.3.7",
690
690
  "@types/node": "24.9.2",
691
691
  "@typescript/native-preview": "7.0.0-dev.20250920.1",
692
692
  "@vitest/coverage-v8": "4.0.3",