@socketsecurity/lib 3.3.6 → 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 +15 -0
- package/dist/bin.js +1 -1
- package/dist/cacache.js +1 -1
- package/dist/dlx-package.js +4 -4
- package/dist/fs.js +2 -2
- package/dist/globs.js +2 -2
- package/dist/package-default-node-range.js +1 -1
- package/dist/package-extensions.js +1 -1
- package/dist/sorts.js +2 -2
- package/dist/spawn.js +1 -1
- package/dist/spinner.js +9 -12
- package/dist/streams.js +1 -1
- package/dist/versions.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ 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
|
+
|
|
15
|
+
## [3.3.7](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.7) - 2025-11-13
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **refactor**: Add explicit `.js` extensions to external require calls
|
|
20
|
+
- Improves module resolution clarity and compatibility with modern bundlers
|
|
21
|
+
- Updated 18 require calls across 10 source files
|
|
22
|
+
|
|
8
23
|
## [3.3.6](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.6) - 2025-11-13
|
|
9
24
|
|
|
10
25
|
### Changed
|
package/dist/bin.js
CHANGED
package/dist/cacache.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(cacache_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(cacache_exports);
|
|
31
31
|
var import_paths = require("./paths");
|
|
32
32
|
function getCacache() {
|
|
33
|
-
return require("./external/cacache");
|
|
33
|
+
return require("./external/cacache.js");
|
|
34
34
|
}
|
|
35
35
|
function patternToRegex(pattern) {
|
|
36
36
|
const escaped = pattern.replaceAll(/[.+?^${}()|[\]\\]/g, "\\$&");
|
package/dist/dlx-package.js
CHANGED
|
@@ -55,7 +55,7 @@ let _npmPackageArg;
|
|
|
55
55
|
// @__NO_SIDE_EFFECTS__
|
|
56
56
|
function getNpmPackageArg() {
|
|
57
57
|
if (_npmPackageArg === void 0) {
|
|
58
|
-
_npmPackageArg = require("./external/npm-package-arg");
|
|
58
|
+
_npmPackageArg = require("./external/npm-package-arg.js");
|
|
59
59
|
}
|
|
60
60
|
return _npmPackageArg;
|
|
61
61
|
}
|
|
@@ -63,7 +63,7 @@ let _libnpmexec;
|
|
|
63
63
|
// @__NO_SIDE_EFFECTS__
|
|
64
64
|
function getLibnpmexec() {
|
|
65
65
|
if (_libnpmexec === void 0) {
|
|
66
|
-
_libnpmexec = require("./external/libnpmexec");
|
|
66
|
+
_libnpmexec = require("./external/libnpmexec.js");
|
|
67
67
|
}
|
|
68
68
|
return _libnpmexec;
|
|
69
69
|
}
|
|
@@ -71,7 +71,7 @@ let _pacote;
|
|
|
71
71
|
// @__NO_SIDE_EFFECTS__
|
|
72
72
|
function getPacote() {
|
|
73
73
|
if (_pacote === void 0) {
|
|
74
|
-
_pacote = require("./external/pacote");
|
|
74
|
+
_pacote = require("./external/pacote.js");
|
|
75
75
|
}
|
|
76
76
|
return _pacote;
|
|
77
77
|
}
|
|
@@ -79,7 +79,7 @@ let _arborist;
|
|
|
79
79
|
// @__NO_SIDE_EFFECTS__
|
|
80
80
|
function getArborist() {
|
|
81
81
|
if (_arborist === void 0) {
|
|
82
|
-
_arborist = require("./external/@npmcli/arborist");
|
|
82
|
+
_arborist = require("./external/@npmcli/arborist.js");
|
|
83
83
|
}
|
|
84
84
|
return _arborist;
|
|
85
85
|
}
|
package/dist/fs.js
CHANGED
|
@@ -443,7 +443,7 @@ function invalidatePathCache() {
|
|
|
443
443
|
}
|
|
444
444
|
(0, import_rewire.registerCacheInvalidation)(invalidatePathCache);
|
|
445
445
|
async function safeDelete(filepath, options) {
|
|
446
|
-
const { deleteAsync } = require("./external/del");
|
|
446
|
+
const { deleteAsync } = require("./external/del.js");
|
|
447
447
|
const opts = { __proto__: null, ...options };
|
|
448
448
|
const patterns = (0, import_arrays.isArray)(filepath) ? filepath.map(import_path.pathLikeToString) : [(0, import_path.pathLikeToString)(filepath)];
|
|
449
449
|
let shouldForce = opts.force !== false;
|
|
@@ -474,7 +474,7 @@ async function safeDelete(filepath, options) {
|
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
function safeDeleteSync(filepath, options) {
|
|
477
|
-
const { deleteSync } = require("./external/del");
|
|
477
|
+
const { deleteSync } = require("./external/del.js");
|
|
478
478
|
const opts = { __proto__: null, ...options };
|
|
479
479
|
const patterns = (0, import_arrays.isArray)(filepath) ? filepath.map(import_path.pathLikeToString) : [(0, import_path.pathLikeToString)(filepath)];
|
|
480
480
|
let shouldForce = opts.force !== false;
|
package/dist/globs.js
CHANGED
|
@@ -69,7 +69,7 @@ let _picomatch;
|
|
|
69
69
|
// @__NO_SIDE_EFFECTS__
|
|
70
70
|
function getPicomatch() {
|
|
71
71
|
if (_picomatch === void 0) {
|
|
72
|
-
_picomatch = require("./external/picomatch");
|
|
72
|
+
_picomatch = require("./external/picomatch.js");
|
|
73
73
|
}
|
|
74
74
|
return _picomatch;
|
|
75
75
|
}
|
|
@@ -77,7 +77,7 @@ let _fastGlob;
|
|
|
77
77
|
// @__NO_SIDE_EFFECTS__
|
|
78
78
|
function getFastGlob() {
|
|
79
79
|
if (_fastGlob === void 0) {
|
|
80
|
-
_fastGlob = require("./external/fast-glob");
|
|
80
|
+
_fastGlob = require("./external/fast-glob.js");
|
|
81
81
|
}
|
|
82
82
|
return _fastGlob;
|
|
83
83
|
}
|
|
@@ -23,7 +23,7 @@ __export(package_default_node_range_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(package_default_node_range_exports);
|
|
25
25
|
const { maintainedNodeVersions } = require("#lib/maintained-node-versions");
|
|
26
|
-
const semver = require("./external/semver");
|
|
26
|
+
const semver = require("./external/semver.js");
|
|
27
27
|
const packageDefaultNodeRange = `>=${semver.parse(maintainedNodeVersions.last).major}`;
|
|
28
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
29
|
0 && (module.exports = {
|
|
@@ -23,7 +23,7 @@ __export(package_extensions_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(package_extensions_exports);
|
|
25
25
|
const { freeze: ObjectFreeze } = Object;
|
|
26
|
-
const yarnPkgExtensions = require("./external/@yarnpkg/extensions");
|
|
26
|
+
const yarnPkgExtensions = require("./external/@yarnpkg/extensions.js");
|
|
27
27
|
const packageExtensions = ObjectFreeze(
|
|
28
28
|
[
|
|
29
29
|
yarnPkgExtensions.packageExtensions,
|
package/dist/sorts.js
CHANGED
|
@@ -59,7 +59,7 @@ let _naturalSorter;
|
|
|
59
59
|
// @__NO_SIDE_EFFECTS__
|
|
60
60
|
function naturalSorter(arrayToSort) {
|
|
61
61
|
if (_naturalSorter === void 0) {
|
|
62
|
-
const fastSort = require("./external/fast-sort");
|
|
62
|
+
const fastSort = require("./external/fast-sort.js");
|
|
63
63
|
_naturalSorter = fastSort.createNewSortInstance({
|
|
64
64
|
comparer: naturalCompare
|
|
65
65
|
});
|
|
@@ -72,7 +72,7 @@ function compareStr(a, b) {
|
|
|
72
72
|
}
|
|
73
73
|
// @__NO_SIDE_EFFECTS__
|
|
74
74
|
function compareSemver(a, b) {
|
|
75
|
-
const semver = require("./external/semver");
|
|
75
|
+
const semver = require("./external/semver.js");
|
|
76
76
|
const validA = semver.valid(a);
|
|
77
77
|
const validB = semver.valid(b);
|
|
78
78
|
if (!validA && !validB) {
|
package/dist/spawn.js
CHANGED
|
@@ -44,7 +44,7 @@ let _npmCliPromiseSpawn;
|
|
|
44
44
|
// @__NO_SIDE_EFFECTS__
|
|
45
45
|
function getNpmcliPromiseSpawn() {
|
|
46
46
|
if (_npmCliPromiseSpawn === void 0) {
|
|
47
|
-
_npmCliPromiseSpawn = require("./external/@npmcli/promise-spawn");
|
|
47
|
+
_npmCliPromiseSpawn = require("./external/@npmcli/promise-spawn.js");
|
|
48
48
|
}
|
|
49
49
|
return _npmCliPromiseSpawn;
|
|
50
50
|
}
|
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,11 +69,14 @@ 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;
|
|
78
78
|
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
79
|
-
const colors = require("./external/yoctocolors-cjs");
|
|
79
|
+
const colors = require("./external/yoctocolors-cjs.js");
|
|
80
80
|
return colors.cyan(bar);
|
|
81
81
|
}
|
|
82
82
|
let _cliSpinners;
|
|
@@ -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
|
-
|
|
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/dist/streams.js
CHANGED
|
@@ -29,7 +29,7 @@ let _streamingIterables;
|
|
|
29
29
|
// @__NO_SIDE_EFFECTS__
|
|
30
30
|
function getStreamingIterables() {
|
|
31
31
|
if (_streamingIterables === void 0) {
|
|
32
|
-
_streamingIterables = require("./external/streaming-iterables");
|
|
32
|
+
_streamingIterables = require("./external/streaming-iterables.js");
|
|
33
33
|
}
|
|
34
34
|
return _streamingIterables;
|
|
35
35
|
}
|
package/dist/versions.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "3.3.
|
|
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.
|
|
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",
|