@socketsecurity/lib 3.3.11 → 3.4.0
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 +16 -0
- package/dist/logger.d.ts +20 -0
- package/dist/logger.js +23 -1
- package/dist/spinner.d.ts +6 -2
- package/dist/spinner.js +31 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.4.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.4.0) - 2025-11-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Spinner**: New `skip()` and `skipAndStop()` methods for displaying skipped operations
|
|
13
|
+
- `skip(text)`: Display skip message alongside spinner (e.g., "Skipping optional step...")
|
|
14
|
+
- `skipAndStop(text)`: Display skip message and stop spinner in one call
|
|
15
|
+
- Uses cyan ↻ (refresh/reload) symbol with @ ASCII fallback
|
|
16
|
+
- Normalizes text formatting consistently with other spinner methods
|
|
17
|
+
- Useful for communicating skipped steps during long-running operations
|
|
18
|
+
|
|
19
|
+
- **Logger**: New `skip()` method and symbol for skipped operations
|
|
20
|
+
- `LOG_SYMBOLS.skip`: New cyan ↻ symbol for skip output (@ ASCII fallback)
|
|
21
|
+
- `skip(message)`: Display skip messages with dedicated symbol
|
|
22
|
+
- Complements existing info/step/success/error/warning/reason methods
|
|
23
|
+
|
|
8
24
|
## [3.3.11](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.11) - 2025-11-14
|
|
9
25
|
|
|
10
26
|
### Fixed
|
package/dist/logger.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ type LogSymbols = {
|
|
|
26
26
|
progress: string;
|
|
27
27
|
/** Dimmed yellow reasoning/working symbol (∴ or :. in ASCII) */
|
|
28
28
|
reason: string;
|
|
29
|
+
/** Cyan colored skip symbol (↻ or @ in ASCII) */
|
|
30
|
+
skip: string;
|
|
29
31
|
/** Cyan colored step symbol (→ or > in ASCII) */
|
|
30
32
|
step: string;
|
|
31
33
|
/** Green colored success symbol (✔ or √ in ASCII) */
|
|
@@ -741,6 +743,24 @@ export declare class Logger {
|
|
|
741
743
|
* ```
|
|
742
744
|
*/
|
|
743
745
|
resetIndent(): this;
|
|
746
|
+
/**
|
|
747
|
+
* Logs a skip message with a cyan colored skip symbol.
|
|
748
|
+
*
|
|
749
|
+
* Automatically prefixes the message with `LOG_SYMBOLS.skip` (cyan ↻).
|
|
750
|
+
* Always outputs to stderr. If the message starts with an existing
|
|
751
|
+
* symbol, it will be stripped and replaced.
|
|
752
|
+
*
|
|
753
|
+
* @param args - Message and additional arguments to log
|
|
754
|
+
* @returns The logger instance for chaining
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
757
|
+
* ```typescript
|
|
758
|
+
* logger.skip('Test skipped due to environment')
|
|
759
|
+
* logger.skip('Skipping optional step')
|
|
760
|
+
* logger.skip('Feature disabled, skipping')
|
|
761
|
+
* ```
|
|
762
|
+
*/
|
|
763
|
+
skip(...args: unknown[]): this;
|
|
744
764
|
/**
|
|
745
765
|
* Logs a main step message with a cyan arrow symbol and blank line before it.
|
|
746
766
|
*
|
package/dist/logger.js
CHANGED
|
@@ -92,6 +92,7 @@ const LOG_SYMBOLS = /* @__PURE__ */ (() => {
|
|
|
92
92
|
target.reason = colors.dim(
|
|
93
93
|
/* @__PURE__ */ applyColor(supported ? "\u2234" : ":.", warningColor, colors)
|
|
94
94
|
);
|
|
95
|
+
target.skip = /* @__PURE__ */ applyColor(supported ? "\u21BB" : "@", stepColor, colors);
|
|
95
96
|
target.step = /* @__PURE__ */ applyColor(supported ? "\u2192" : ">", stepColor, colors);
|
|
96
97
|
target.success = /* @__PURE__ */ applyColor(supported ? "\u2714" : "\u221A", successColor, colors);
|
|
97
98
|
target.warn = /* @__PURE__ */ applyColor(supported ? "\u26A0" : "\u203C", warningColor, colors);
|
|
@@ -332,6 +333,7 @@ class Logger {
|
|
|
332
333
|
reason: colors.dim(
|
|
333
334
|
/* @__PURE__ */ applyColor(supported ? "\u2234" : ":.", theme.colors.warning, colors)
|
|
334
335
|
),
|
|
336
|
+
skip: /* @__PURE__ */ applyColor(supported ? "\u21BB" : "@", theme.colors.step, colors),
|
|
335
337
|
step: /* @__PURE__ */ applyColor(supported ? "\u2192" : ">", theme.colors.step, colors),
|
|
336
338
|
success: /* @__PURE__ */ applyColor(supported ? "\u2714" : "\u221A", theme.colors.success, colors),
|
|
337
339
|
warn: /* @__PURE__ */ applyColor(supported ? "\u26A0" : "\u203C", theme.colors.warning, colors)
|
|
@@ -381,7 +383,7 @@ class Logger {
|
|
|
381
383
|
* @private
|
|
382
384
|
*/
|
|
383
385
|
#stripSymbols(text) {
|
|
384
|
-
return text.replace(/^(?:[
|
|
386
|
+
return text.replace(/^(?:[✖✗×⚠‼✔✓√ℹ→∴↻]|:.)[\uFE0F\s]*/u, "");
|
|
385
387
|
}
|
|
386
388
|
/**
|
|
387
389
|
* Apply a method with a symbol prefix.
|
|
@@ -1119,6 +1121,26 @@ class Logger {
|
|
|
1119
1121
|
}
|
|
1120
1122
|
return this;
|
|
1121
1123
|
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Logs a skip message with a cyan colored skip symbol.
|
|
1126
|
+
*
|
|
1127
|
+
* Automatically prefixes the message with `LOG_SYMBOLS.skip` (cyan ↻).
|
|
1128
|
+
* Always outputs to stderr. If the message starts with an existing
|
|
1129
|
+
* symbol, it will be stripped and replaced.
|
|
1130
|
+
*
|
|
1131
|
+
* @param args - Message and additional arguments to log
|
|
1132
|
+
* @returns The logger instance for chaining
|
|
1133
|
+
*
|
|
1134
|
+
* @example
|
|
1135
|
+
* ```typescript
|
|
1136
|
+
* logger.skip('Test skipped due to environment')
|
|
1137
|
+
* logger.skip('Skipping optional step')
|
|
1138
|
+
* logger.skip('Feature disabled, skipping')
|
|
1139
|
+
* ```
|
|
1140
|
+
*/
|
|
1141
|
+
skip(...args) {
|
|
1142
|
+
return this.#symbolApply("skip", args);
|
|
1143
|
+
}
|
|
1122
1144
|
/**
|
|
1123
1145
|
* Logs a main step message with a cyan arrow symbol and blank line before it.
|
|
1124
1146
|
*
|
package/dist/spinner.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ import type { ColorInherit, ColorRgb, ColorValue } from './colors';
|
|
|
7
7
|
import type { ShimmerColorGradient, ShimmerConfig, ShimmerDirection, ShimmerState } from './effects/text-shimmer';
|
|
8
8
|
/**
|
|
9
9
|
* Symbol types for status messages.
|
|
10
|
-
* Maps to log symbols: fail (✗), info (ℹ), reason (∴), success (✓), warn (⚠).
|
|
10
|
+
* Maps to log symbols: fail (✗), info (ℹ), reason (∴), skip (↻), success (✓), warn (⚠).
|
|
11
11
|
*/
|
|
12
|
-
export type SymbolType = 'fail' | 'info' | 'reason' | 'success' | 'warn';
|
|
12
|
+
export type SymbolType = 'fail' | 'info' | 'reason' | 'skip' | 'success' | 'warn';
|
|
13
13
|
/**
|
|
14
14
|
* Progress tracking information for display in spinner.
|
|
15
15
|
* Used by `progress()` and `progressStep()` methods to show animated progress bars.
|
|
@@ -107,6 +107,10 @@ export type Spinner = {
|
|
|
107
107
|
reasonAndStop(text?: string | undefined, ...extras: unknown[]): Spinner;
|
|
108
108
|
/** Set complete shimmer configuration */
|
|
109
109
|
setShimmer(config: ShimmerConfig): Spinner;
|
|
110
|
+
/** Show skip (↻) message without stopping the spinner */
|
|
111
|
+
skip(text?: string | undefined, ...extras: unknown[]): Spinner;
|
|
112
|
+
/** Show skip (↻) message and stop the spinner, auto-clearing the line */
|
|
113
|
+
skipAndStop(text?: string | undefined, ...extras: unknown[]): Spinner;
|
|
110
114
|
/** Start spinning with optional text */
|
|
111
115
|
start(text?: string | undefined): Spinner;
|
|
112
116
|
/** Show main step message to stderr without stopping */
|
package/dist/spinner.js
CHANGED
|
@@ -605,6 +605,37 @@ function Spinner(options) {
|
|
|
605
605
|
}
|
|
606
606
|
return this;
|
|
607
607
|
}
|
|
608
|
+
/**
|
|
609
|
+
* Show a skip message (↻) without stopping the spinner.
|
|
610
|
+
* Outputs to stderr and continues spinning.
|
|
611
|
+
*
|
|
612
|
+
* @param text - Skip message to display
|
|
613
|
+
* @param extras - Additional values to log
|
|
614
|
+
* @returns This spinner for chaining
|
|
615
|
+
*/
|
|
616
|
+
skip(text, ...extras) {
|
|
617
|
+
return this.#showStatusAndKeepSpinning("skip", [text, ...extras]);
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Show a skip message (↻) and stop the spinner.
|
|
621
|
+
* Auto-clears the spinner line before displaying the message.
|
|
622
|
+
*
|
|
623
|
+
* Implementation note: Similar to reasonAndStop(), this method cannot use #apply()
|
|
624
|
+
* with a 'skip' method name because yocto-spinner doesn't have a built-in 'skip'
|
|
625
|
+
* method. Instead, we manually stop the spinner then log the message with the skip symbol.
|
|
626
|
+
*
|
|
627
|
+
* @param text - Skip message to display
|
|
628
|
+
* @param extras - Additional values to log
|
|
629
|
+
* @returns This spinner for chaining
|
|
630
|
+
*/
|
|
631
|
+
skipAndStop(text, ...extras) {
|
|
632
|
+
this.#apply("stop", []);
|
|
633
|
+
const normalized = normalizeText(text);
|
|
634
|
+
if (normalized) {
|
|
635
|
+
logger.error(`${import_logger.LOG_SYMBOLS.skip} ${normalized}`, ...extras);
|
|
636
|
+
}
|
|
637
|
+
return this;
|
|
638
|
+
}
|
|
608
639
|
/**
|
|
609
640
|
* Set complete shimmer configuration.
|
|
610
641
|
* Replaces any existing shimmer config with the provided values.
|