@socketsecurity/lib 3.2.8 → 3.3.1

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 (84) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +19 -240
  3. package/dist/agent.js +10 -10
  4. package/dist/bin.js +4 -4
  5. package/dist/colors.d.ts +37 -0
  6. package/dist/colors.js +58 -0
  7. package/dist/constants/node.js +1 -1
  8. package/dist/constants/packages.js +9 -9
  9. package/dist/constants/process.js +1 -1
  10. package/dist/constants/socket.d.ts +1 -0
  11. package/dist/constants/socket.js +3 -0
  12. package/dist/debug.js +3 -3
  13. package/dist/dlx-binary.js +4 -4
  14. package/dist/effects/text-shimmer.js +1 -1
  15. package/dist/env/ci.js +2 -2
  16. package/dist/env/debug.js +1 -1
  17. package/dist/env/github.js +1 -1
  18. package/dist/env/home.js +1 -1
  19. package/dist/env/locale.js +1 -1
  20. package/dist/env/node-auth-token.js +1 -1
  21. package/dist/env/node-env.js +1 -1
  22. package/dist/env/npm.js +1 -1
  23. package/dist/env/package-manager.js +1 -1
  24. package/dist/env/path.js +1 -1
  25. package/dist/env/pre-commit.js +2 -2
  26. package/dist/env/rewire.d.ts +5 -5
  27. package/dist/env/rewire.js +22 -14
  28. package/dist/env/shell.js +1 -1
  29. package/dist/env/socket-cli-shadow.js +2 -2
  30. package/dist/env/socket-cli.js +2 -2
  31. package/dist/env/socket.js +2 -2
  32. package/dist/env/temp-dir.js +1 -1
  33. package/dist/env/term.js +1 -1
  34. package/dist/env/test.js +3 -3
  35. package/dist/env/windows.js +1 -1
  36. package/dist/env/xdg.js +1 -1
  37. package/dist/external/@inquirer/checkbox.js +3361 -3
  38. package/dist/external/@inquirer/confirm.js +1 -0
  39. package/dist/external/@inquirer/input.js +1 -0
  40. package/dist/external/@inquirer/password.js +1 -0
  41. package/dist/external/@inquirer/search.js +1 -0
  42. package/dist/external/@inquirer/select.js +1 -0
  43. package/dist/fs.js +4 -6
  44. package/dist/git.js +1 -1
  45. package/dist/github.js +2 -2
  46. package/dist/globs.js +3 -4
  47. package/dist/lifecycle-script-names.d.ts +8 -2
  48. package/dist/lifecycle-script-names.js +9 -4
  49. package/dist/logger.d.ts +106 -81
  50. package/dist/logger.js +234 -205
  51. package/dist/maintained-node-versions.d.ts +2 -2
  52. package/dist/maintained-node-versions.js +9 -4
  53. package/dist/objects.js +1 -1
  54. package/dist/package-default-node-range.d.ts +2 -2
  55. package/dist/package-default-node-range.js +10 -5
  56. package/dist/package-default-socket-categories.d.ts +6 -2
  57. package/dist/package-default-socket-categories.js +9 -4
  58. package/dist/package-extensions.d.ts +2 -2
  59. package/dist/package-extensions.js +9 -4
  60. package/dist/packages/exports.js +1 -1
  61. package/dist/packages/isolation.js +2 -2
  62. package/dist/packages/licenses.js +2 -2
  63. package/dist/packages/manifest.js +3 -3
  64. package/dist/packages/normalize.js +1 -1
  65. package/dist/packages/operations.js +5 -5
  66. package/dist/packages/provenance.js +1 -1
  67. package/dist/path.d.ts +11 -0
  68. package/dist/path.js +1 -1
  69. package/dist/paths.js +14 -14
  70. package/dist/promises.js +2 -2
  71. package/dist/spawn.js +1 -1
  72. package/dist/spinner.d.ts +29 -51
  73. package/dist/spinner.js +155 -149
  74. package/dist/stdio/prompts.d.ts +17 -0
  75. package/dist/stdio/prompts.js +11 -12
  76. package/dist/temporary-executor.js +1 -1
  77. package/dist/themes/types.d.ts +2 -1
  78. package/dist/themes/utils.d.ts +1 -1
  79. package/dist/utils/get-ipc.d.ts +0 -1
  80. package/dist/utils/get-ipc.js +4 -4
  81. package/dist/versions.d.ts +1 -1
  82. package/package.json +15 -11
  83. package/dist/external/@inquirer/core.js +0 -4
  84. package/dist/external/@inquirer/prompts.js +0 -4
package/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ 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.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.1) - 2025-11-11
9
+
10
+ ### Added
11
+
12
+ - Added `SOCKET_DOCS_CONTACT_URL` constant for documentation contact support page
13
+ - Added `checkbox` prompt support
14
+
15
+ ## [3.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.0) - 2025-11-07
16
+
17
+ ### Added
18
+
19
+ - **Spinner**: New `reason()` and `reasonAndStop()` methods for displaying working/thinking output
20
+ - `reason(text)`: Display reason text alongside spinner (e.g., "Analyzing dependencies...")
21
+ - `reasonAndStop(text)`: Display reason text and stop spinner in one call
22
+ - Normalizes text formatting consistently with other spinner methods
23
+ - Useful for communicating progress steps during long-running operations
24
+
25
+ - **Logger**: New `reason()` method and symbol for working/thinking output
26
+ - `LOG_SYMBOLS.reason`: New symbol for reason output (distinct from info/step symbols)
27
+ - `reason(message)`: Display reason messages with dedicated symbol
28
+ - Complements existing info/step/success/error/warning methods
29
+
8
30
  ## [3.2.8](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.8) - 2025-11-05
9
31
 
10
32
  ### Fixed
package/README.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  [![Socket Badge](https://socket.dev/api/badge/npm/package/@socketsecurity/lib)](https://socket.dev/npm/package/@socketsecurity/lib)
4
4
  [![CI](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml/badge.svg)](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml)
5
- ![Test Coverage](https://img.shields.io/badge/test--coverage-100%25-brightgreen)
6
- ![Type Coverage](https://img.shields.io/badge/type--coverage-100%25-brightgreen)
5
+ ![Coverage](https://img.shields.io/badge/coverage-83.06%25-brightgreen)
7
6
 
8
7
  [![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
8
+ [![Follow @socket.dev on Bluesky](https://img.shields.io/badge/Follow-@socket.dev-1DA1F2?style=social&logo=bluesky)](https://bsky.app/profile/socket.dev)
9
9
 
10
- **Core infrastructure library for Socket.dev security tools** — utilities, constants, and helpers with zero dependencies.
10
+ Core library for [Socket.dev](https://socket.dev/) tools.
11
11
 
12
- ## Quick Start
12
+ ## Install
13
13
 
14
14
  ```bash
15
15
  pnpm add @socketsecurity/lib
16
16
  ```
17
17
 
18
+ ## Usage
19
+
18
20
  ```typescript
19
- // Import what you need - tree-shakeable exports
21
+ // Tree-shakeable exports
20
22
  import { Spinner } from '@socketsecurity/lib/spinner'
21
23
  import { readJsonFile } from '@socketsecurity/lib/fs'
22
24
  import { NODE_MODULES } from '@socketsecurity/lib/constants/packages'
@@ -27,248 +29,25 @@ const pkg = await readJsonFile('./package.json')
27
29
  spinner.stop()
28
30
  ```
29
31
 
30
- ## 📦 What's Inside
31
-
32
- ```
33
- @socketsecurity/lib
34
- ├── Visual Effects → 5 themes, spinners, shimmer, logger
35
- ├── File System → fs, paths, globs, temp files
36
- ├── Package Management → 11 utilities (npm, pnpm, yarn, dlx)
37
- ├── Process & Spawn → Safe process spawning, IPC
38
- ├── Environment → 22 modules with 68 typed env getters
39
- ├── Constants → 14 modules (Node.js, npm, platform)
40
- ├── Utilities → Arrays, objects, strings, promises
41
- └── Types → Full TypeScript definitions
42
- ```
43
-
44
- ## 💡 Key Features
45
-
46
- ### Visual Effects
47
-
48
- **Themed spinners and text effects:**
49
-
50
- ```typescript
51
- import { Spinner, setTheme } from '@socketsecurity/lib'
52
-
53
- setTheme('ultra') // 🌈 Rainbow shimmer!
54
- const spinner = Spinner({ text: 'Processing...' })
55
- spinner.start()
56
- ```
57
-
58
- **5 Built-in Themes:** `socket` (violet) · `sunset` (twilight) · `terracotta` (warm) · `lush` (steel blue) · `ultra` (rainbow)
59
-
60
- 👉 [**Theme System Docs**](./docs/themes.md)
61
-
62
- ### File System
63
-
64
- **Safe, typed file operations:**
65
-
66
- ```typescript
67
- import { readJsonFile, writeJsonFile } from '@socketsecurity/lib/fs'
68
-
69
- const pkg = await readJsonFile<PackageJson>('./package.json')
70
- await writeJsonFile('./output.json', { data: pkg })
71
- ```
72
-
73
- ### Package Management
32
+ ## What's Inside
74
33
 
75
- **Parse and validate package specs:**
76
-
77
- ```typescript
78
- import { parsePackageSpec } from '@socketsecurity/lib/packages'
79
-
80
- const spec = parsePackageSpec('lodash@^4.17.0')
81
- // { name: 'lodash', version: '^4.17.0', type: 'range', ... }
82
- ```
83
-
84
- ### Environment Variables
85
-
86
- **68 typed environment getters:**
87
-
88
- ```typescript
89
- import { getCI } from '@socketsecurity/lib/env/ci'
90
- import { getHome } from '@socketsecurity/lib/env/home'
91
- import { getNodeEnv } from '@socketsecurity/lib/env/node-env'
92
-
93
- if (getCI()) {
94
- console.log('Running in CI')
95
- }
96
- ```
97
-
98
- ### Constants
99
-
100
- **Access platform and Node.js constants:**
101
-
102
- ```typescript
103
- import {
104
- NODE_MODULES,
105
- PACKAGE_JSON,
106
- NPM_REGISTRY_URL,
107
- } from '@socketsecurity/lib/constants/packages'
108
-
109
- import { DARWIN, WIN32 } from '@socketsecurity/lib/constants/platform'
110
- ```
111
-
112
- ## Common Patterns
113
-
114
- ### Spinner with Progress
115
-
116
- ```typescript
117
- import { withSpinner, Spinner } from '@socketsecurity/lib/spinner'
118
-
119
- await withSpinner({
120
- message: 'Installing packages...',
121
- spinner: Spinner({ color: [140, 82, 255] }),
122
- operation: async () => {
123
- await installPackages()
124
- }
125
- })
126
- ```
127
-
128
- ### Safe Process Spawning
129
-
130
- ```typescript
131
- import { spawn } from '@socketsecurity/lib/spawn'
132
-
133
- const result = await spawn('npm', ['install'], {
134
- cwd: '/path/to/project',
135
- timeout: 30000
136
- })
137
- ```
138
-
139
- ### JSON File Operations
140
-
141
- ```typescript
142
- import { readJsonFile, writeJsonFile } from '@socketsecurity/lib/fs'
143
-
144
- const data = await readJsonFile('./config.json')
145
- data.version = '2.0.0'
146
- await writeJsonFile('./config.json', data)
147
- ```
148
-
149
- ### Promise Utilities
150
-
151
- ```typescript
152
- import { timeout, retry } from '@socketsecurity/lib/promises'
153
-
154
- // Timeout after 5 seconds
155
- const result = await timeout(fetchData(), 5000)
156
-
157
- // Retry up to 3 times
158
- const data = await retry(() => fetchData(), { maxAttempts: 3 })
159
- ```
160
-
161
- ## Module Organization
162
-
163
- **120+ granular exports** organized by category:
164
-
165
- ```
166
- /constants/ → Node.js, npm, platform constants
167
- ├─ packages → PACKAGE_JSON, NODE_MODULES, etc.
168
- ├─ platform → DARWIN, WIN32, S_IXUSR, etc.
169
- ├─ node → NODE_VERSION, NODE_PATH, etc.
170
- ├─ time → MILLISECONDS_PER_*, DLX_BINARY_CACHE_TTL
171
- └─ encoding → UTF8, CHAR_* codes
172
-
173
- /env/ → 22 modules providing 68 typed getters
174
- ├─ ci → getCI() - Detect CI environment
175
- ├─ home → getHome() - User home directory
176
- ├─ node-env → getNodeEnv() - NODE_ENV value
177
- └─ ... → And 19 more modules!
178
-
179
- /packages/ → Package management utilities (11 modules)
180
- ├─ validation → Package name/version validation
181
- ├─ operations → Install, extract, manifest, dlx
182
- ├─ registry → npm registry utilities
183
- └─ editable → Editable installs detection
184
-
185
- /effects/ → Visual effects for CLI
186
- ├─ text-shimmer → Animated gradient text
187
- ├─ pulse-frames → Pulsing text effect
188
- └─ ultra → Rainbow gradients
189
-
190
- /stdio/ → Terminal I/O utilities
191
- ├─ stdout → Safe stdout operations
192
- ├─ stderr → Safe stderr operations
193
- ├─ clear → Clear terminal
194
- └─ footer → Terminal footers
195
-
196
- /themes/ → Theme system for consistent branding (5 modules)
197
- ├─ types → Theme type definitions
198
- ├─ themes → 5 themes (socket, sunset, terracotta, lush, ultra)
199
- ├─ context → Global theme management
200
- └─ utils → Color resolution, theme creation
201
- ```
202
-
203
- ## Documentation
204
-
205
- | Doc | Description |
206
- |-----|-------------|
207
- | [**Getting Started**](./docs/getting-started.md) | Quick start for contributors (5 min setup) |
208
- | [**Theme System**](./docs/themes.md) | Themed spinners, colors, and effects |
209
- | [**Build Architecture**](./docs/build.md) | Vendored dependencies, build system |
210
- | [**CLAUDE.md**](./CLAUDE.md) | Coding standards and patterns |
211
-
212
- ## Architecture
213
-
214
- ```
215
- ┌─────────────────────────────────────────────────────┐
216
- │ @socketsecurity/lib │
217
- │ Zero runtime dependencies │
218
- ├─────────────────────────────────────────────────────┤
219
- │ src/ │
220
- │ ├── constants/ 14 modules │
221
- │ ├── env/ 22 modules (68 getters) │
222
- │ ├── packages/ 11 utilities │
223
- │ ├── effects/ 4 visual effects │
224
- │ ├── stdio/ 9 I/O utilities │
225
- │ ├── themes/ 5 theme definitions │
226
- │ ├── external/ 16 vendored deps │
227
- │ └── ... 62+ more modules │
228
- ├─────────────────────────────────────────────────────┤
229
- │ Build: esbuild → CommonJS (ES2022) │
230
- │ Types: tsgo (TypeScript Native Preview) │
231
- │ Tests: Vitest (4600+ tests, 100% coverage) │
232
- └─────────────────────────────────────────────────────┘
233
- ```
34
+ - **Visual Effects** Spinners, themes, logger
35
+ - **File System** → fs, paths, globs
36
+ - **Package Management** → npm, pnpm, yarn, dlx
37
+ - **Process & Spawn** Safe process spawning
38
+ - **Environment** → 68 typed env getters
39
+ - **Constants** Node.js, npm, platform
40
+ - **Utilities** Arrays, objects, strings, promises
234
41
 
235
42
  ## Development
236
43
 
237
- **New to the project?** See the [**Getting Started Guide**](./docs/getting-started.md) for setup, workflow, and contribution guidelines.
238
-
239
- **Quick commands:**
240
44
  ```bash
241
- pnpm install # Install dependencies
242
- pnpm run dev # Watch mode
243
- pnpm test # Run tests
244
- pnpm run fix # Auto-fix issues
45
+ pnpm install # Install
46
+ pnpm build # Build
47
+ pnpm test # Test
48
+ pnpm dev # Watch mode
245
49
  ```
246
50
 
247
- ## Stats
248
-
249
- - **143** TypeScript modules
250
- - **120+** granular exports
251
- - **68** typed environment getters
252
- - **22** environment modules
253
- - **14** constant modules
254
- - **5** theme definitions
255
- - **4600+** tests passing
256
- - **Zero** runtime dependencies
257
-
258
- ## Contributing
259
-
260
- **Ready to contribute?** Start with the [Getting Started Guide](./docs/getting-started.md) for a quick setup walkthrough.
261
-
262
- See [CLAUDE.md](./CLAUDE.md) for:
263
- - Code style and patterns
264
- - Path alias usage
265
- - Testing guidelines
266
- - Build system details
267
-
268
51
  ## License
269
52
 
270
53
  MIT
271
-
272
- ---
273
-
274
- **Built by Socket.dev** — [socket.dev](https://socket.dev) | [@SocketSecurity](https://twitter.com/SocketSecurity)
package/dist/agent.js CHANGED
@@ -34,8 +34,8 @@ __export(agent_exports, {
34
34
  isPnpmLoglevelFlag: () => isPnpmLoglevelFlag
35
35
  });
36
36
  module.exports = __toCommonJS(agent_exports);
37
- var import_ci = require("./env/ci");
38
- var import_platform = require("./constants/platform");
37
+ var import_ci = require("#env/ci");
38
+ var import_platform = require("#constants/platform");
39
39
  var import_bin = require("./bin");
40
40
  var import_debug = require("./debug");
41
41
  var import_fs = require("./fs");
@@ -87,7 +87,7 @@ function execNpm(args, options) {
87
87
  // one level quieter.
88
88
  useDebug || npmArgs.some(isNpmLoglevelFlag) ? [] : ["--loglevel", "warn"]
89
89
  );
90
- const npmBin = require("./constants/agents").NPM_BIN_PATH;
90
+ const npmBin = require("#constants/agents").NPM_BIN_PATH;
91
91
  return (0, import_spawn.spawn)(
92
92
  npmBin,
93
93
  [
@@ -231,11 +231,11 @@ function execScript(scriptName, args, options) {
231
231
  if (spawnOptions.shell === true) {
232
232
  return (0, import_spawn.spawn)(scriptName, resolvedArgs, spawnOptions);
233
233
  }
234
- const useNodeRun = !prepost && /* @__PURE__ */ require("./constants/node").supportsNodeRun();
234
+ const useNodeRun = !prepost && /* @__PURE__ */ require("#constants/node").supportsNodeRun();
235
235
  const cwd = (0, import_objects.getOwn)(spawnOptions, "cwd") ?? process.cwd();
236
236
  const pnpmLockPath = (0, import_fs.findUpSync)(
237
237
  /*@__INLINE__*/
238
- require("./constants/agents").PNPM_LOCK_YAML,
238
+ require("#constants/agents").PNPM_LOCK_YAML,
239
239
  { cwd }
240
240
  );
241
241
  if (pnpmLockPath) {
@@ -243,7 +243,7 @@ function execScript(scriptName, args, options) {
243
243
  }
244
244
  const packageLockPath = (0, import_fs.findUpSync)(
245
245
  /*@__INLINE__*/
246
- require("./constants/agents").PACKAGE_LOCK_JSON,
246
+ require("#constants/agents").PACKAGE_LOCK_JSON,
247
247
  { cwd }
248
248
  );
249
249
  if (packageLockPath) {
@@ -251,18 +251,18 @@ function execScript(scriptName, args, options) {
251
251
  }
252
252
  const yarnLockPath = (0, import_fs.findUpSync)(
253
253
  /*@__INLINE__*/
254
- require("./constants/agents").YARN_LOCK,
254
+ require("#constants/agents").YARN_LOCK,
255
255
  { cwd }
256
256
  );
257
257
  if (yarnLockPath) {
258
258
  return /* @__PURE__ */ execYarn(["run", scriptName, ...resolvedArgs], spawnOptions);
259
259
  }
260
260
  return (0, import_spawn.spawn)(
261
- /* @__PURE__ */ require("./constants/node").getExecPath(),
261
+ /* @__PURE__ */ require("#constants/node").getExecPath(),
262
262
  [
263
- .../* @__PURE__ */ require("./constants/node").getNodeNoWarningsFlags(),
263
+ .../* @__PURE__ */ require("#constants/node").getNodeNoWarningsFlags(),
264
264
  ...useNodeRun ? ["--run"] : [
265
- require("./constants/agents").NPM_REAL_EXEC_PATH,
265
+ require("#constants/agents").NPM_REAL_EXEC_PATH,
266
266
  "run"
267
267
  ],
268
268
  scriptName,
package/dist/bin.js CHANGED
@@ -32,10 +32,10 @@ __export(bin_exports, {
32
32
  whichSync: () => whichSync
33
33
  });
34
34
  module.exports = __toCommonJS(bin_exports);
35
- var import_home = require("./env/home");
36
- var import_windows = require("./env/windows");
37
- var import_xdg = require("./env/xdg");
38
- var import_platform = require("./constants/platform");
35
+ var import_home = require("#env/home");
36
+ var import_windows = require("#env/windows");
37
+ var import_xdg = require("#env/xdg");
38
+ var import_platform = require("#constants/platform");
39
39
  var import_fs = require("./fs");
40
40
  var import_path = require("./path");
41
41
  var import_spawn = require("./spawn");
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @fileoverview Color utilities for RGB color conversion and manipulation.
3
+ * Provides type-safe color handling with named colors and RGB tuples.
4
+ */
5
+ /**
6
+ * Named color values supported by the library.
7
+ * Maps to standard terminal colors with bright variants.
8
+ */
9
+ export type ColorName = 'black' | 'blue' | 'blueBright' | 'cyan' | 'cyanBright' | 'gray' | 'green' | 'greenBright' | 'magenta' | 'magentaBright' | 'red' | 'redBright' | 'white' | 'whiteBright' | 'yellow' | 'yellowBright';
10
+ /**
11
+ * Special 'inherit' color value that uses the current color context.
12
+ * Used with effects like shimmer to dynamically inherit color.
13
+ */
14
+ export type ColorInherit = 'inherit';
15
+ /**
16
+ * RGB color tuple with values 0-255 for red, green, and blue channels.
17
+ * @example [140, 82, 255] // Socket purple
18
+ * @example [255, 0, 0] // Red
19
+ */
20
+ export type ColorRgb = readonly [number, number, number];
21
+ /**
22
+ * Union of all supported color types: named colors or RGB tuples.
23
+ */
24
+ export type ColorValue = ColorName | ColorRgb;
25
+ /**
26
+ * Type guard to check if a color value is an RGB tuple.
27
+ * @param value - Color value to check
28
+ * @returns `true` if value is an RGB tuple, `false` if it's a color name
29
+ */
30
+ export declare function isRgbTuple(value: ColorValue): value is ColorRgb;
31
+ /**
32
+ * Convert a color value to RGB tuple format.
33
+ * Named colors are looked up in the `colorToRgb` map, RGB tuples are returned as-is.
34
+ * @param color - Color name or RGB tuple
35
+ * @returns RGB tuple with values 0-255
36
+ */
37
+ export declare function toRgb(color: ColorValue): ColorRgb;
package/dist/colors.js ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with esbuild */
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var colors_exports = {};
21
+ __export(colors_exports, {
22
+ isRgbTuple: () => isRgbTuple,
23
+ toRgb: () => toRgb
24
+ });
25
+ module.exports = __toCommonJS(colors_exports);
26
+ const colorToRgb = {
27
+ __proto__: null,
28
+ black: [0, 0, 0],
29
+ blue: [0, 0, 255],
30
+ blueBright: [100, 149, 237],
31
+ cyan: [0, 255, 255],
32
+ cyanBright: [0, 255, 255],
33
+ gray: [128, 128, 128],
34
+ green: [0, 128, 0],
35
+ greenBright: [0, 255, 0],
36
+ magenta: [255, 0, 255],
37
+ magentaBright: [255, 105, 180],
38
+ red: [255, 0, 0],
39
+ redBright: [255, 69, 0],
40
+ white: [255, 255, 255],
41
+ whiteBright: [255, 255, 255],
42
+ yellow: [255, 255, 0],
43
+ yellowBright: [255, 255, 153]
44
+ };
45
+ function isRgbTuple(value) {
46
+ return Array.isArray(value);
47
+ }
48
+ function toRgb(color) {
49
+ if (isRgbTuple(color)) {
50
+ return color;
51
+ }
52
+ return colorToRgb[color];
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ isRgbTuple,
57
+ toRgb
58
+ });
@@ -49,7 +49,7 @@ function getNodeMajorVersion() {
49
49
  let _maintainedNodeVersions;
50
50
  function getMaintainedNodeVersions() {
51
51
  if (_maintainedNodeVersions === void 0) {
52
- _maintainedNodeVersions = require("../maintained-node-versions");
52
+ _maintainedNodeVersions = require("#lib/maintained-node-versions").maintainedNodeVersions;
53
53
  }
54
54
  return _maintainedNodeVersions;
55
55
  }
@@ -32,7 +32,7 @@ __export(packages_exports, {
32
32
  getPacoteCachePath: () => getPacoteCachePath
33
33
  });
34
34
  module.exports = __toCommonJS(packages_exports);
35
- var import_npm = require("../env/npm");
35
+ var import_npm = require("#env/npm");
36
36
  let _lifecycleScriptNames;
37
37
  let _packageDefaultNodeRange;
38
38
  let _packageDefaultSocketCategories;
@@ -45,20 +45,20 @@ const LATEST = "latest";
45
45
  const PACKAGE_DEFAULT_VERSION = "1.0.0";
46
46
  function getPackageDefaultNodeRange() {
47
47
  if (_packageDefaultNodeRange === void 0) {
48
- _packageDefaultNodeRange = require("../package-default-node-range");
48
+ _packageDefaultNodeRange = require("#lib/package-default-node-range").packageDefaultNodeRange;
49
49
  }
50
50
  return _packageDefaultNodeRange;
51
51
  }
52
52
  function getPackageDefaultSocketCategories() {
53
53
  if (_packageDefaultSocketCategories === void 0) {
54
- _packageDefaultSocketCategories = require("../package-default-socket-categories");
54
+ _packageDefaultSocketCategories = require("#lib/package-default-socket-categories").packageDefaultSocketCategories;
55
55
  }
56
56
  return _packageDefaultSocketCategories;
57
57
  }
58
58
  function getPackageExtensions() {
59
59
  if (_packageExtensions === void 0) {
60
- const exts = require("../package-extensions");
61
- _packageExtensions = Object.entries(exts);
60
+ const { packageExtensions } = require("#lib/package-extensions");
61
+ _packageExtensions = Object.entries(packageExtensions);
62
62
  }
63
63
  return _packageExtensions;
64
64
  }
@@ -67,8 +67,8 @@ function getNpmLifecycleEvent() {
67
67
  }
68
68
  function getLifecycleScriptNames() {
69
69
  if (_lifecycleScriptNames === void 0) {
70
- const scriptNamesSet = require("../lifecycle-script-names");
71
- _lifecycleScriptNames = Array.from(scriptNamesSet);
70
+ const { lifecycleScriptNames } = require("#lib/lifecycle-script-names");
71
+ _lifecycleScriptNames = Array.from(lifecycleScriptNames);
72
72
  }
73
73
  return _lifecycleScriptNames;
74
74
  }
@@ -81,8 +81,8 @@ function getPackumentCache() {
81
81
  function getPacoteCachePath() {
82
82
  if (_pacoteCachePath === void 0) {
83
83
  try {
84
- const pacote = require('../external/pacote');
85
- const { normalizePath } = require("../path");
84
+ const pacote = require("../external/pacote");
85
+ const { normalizePath } = require("#lib/path");
86
86
  const proto = Reflect.getPrototypeOf(
87
87
  pacote.RegistryFetcher.prototype
88
88
  );
@@ -37,7 +37,7 @@ function getAbortSignal() {
37
37
  let _spinner;
38
38
  function getSpinner() {
39
39
  if (_spinner === void 0) {
40
- const { Spinner: SpinnerFn } = require("../spinner");
40
+ const { Spinner: SpinnerFn } = require("#lib/spinner");
41
41
  _spinner = SpinnerFn() ?? null;
42
42
  }
43
43
  return _spinner ?? null;
@@ -14,6 +14,7 @@ export declare const SOCKET_API_TOKENS_URL = "https://socket.dev/dashboard/setti
14
14
  export declare const SOCKET_PRICING_URL = "https://socket.dev/pricing";
15
15
  export declare const SOCKET_STATUS_URL = "https://status.socket.dev";
16
16
  export declare const SOCKET_DOCS_URL = "https://docs.socket.dev";
17
+ export declare const SOCKET_DOCS_CONTACT_URL = "https://docs.socket.dev/docs/contact-support";
17
18
  // Socket.dev scopes.
18
19
  export declare const SOCKET_REGISTRY_SCOPE = "@socketregistry";
19
20
  export declare const SOCKET_SECURITY_SCOPE = "@socketsecurity";
@@ -29,6 +29,7 @@ __export(socket_exports, {
29
29
  SOCKET_CONTACT_URL: () => SOCKET_CONTACT_URL,
30
30
  SOCKET_DASHBOARD_URL: () => SOCKET_DASHBOARD_URL,
31
31
  SOCKET_DLX_APP_NAME: () => SOCKET_DLX_APP_NAME,
32
+ SOCKET_DOCS_CONTACT_URL: () => SOCKET_DOCS_CONTACT_URL,
32
33
  SOCKET_DOCS_URL: () => SOCKET_DOCS_URL,
33
34
  SOCKET_FIREWALL_APP_NAME: () => SOCKET_FIREWALL_APP_NAME,
34
35
  SOCKET_GITHUB_ORG: () => SOCKET_GITHUB_ORG,
@@ -57,6 +58,7 @@ const SOCKET_API_TOKENS_URL = "https://socket.dev/dashboard/settings/api-tokens"
57
58
  const SOCKET_PRICING_URL = "https://socket.dev/pricing";
58
59
  const SOCKET_STATUS_URL = "https://status.socket.dev";
59
60
  const SOCKET_DOCS_URL = "https://docs.socket.dev";
61
+ const SOCKET_DOCS_CONTACT_URL = "https://docs.socket.dev/docs/contact-support";
60
62
  const SOCKET_REGISTRY_SCOPE = "@socketregistry";
61
63
  const SOCKET_SECURITY_SCOPE = "@socketsecurity";
62
64
  const SOCKET_OVERRIDE_SCOPE = "@socketoverride";
@@ -85,6 +87,7 @@ const REGISTRY_SCOPE_DELIMITER = "__";
85
87
  SOCKET_CONTACT_URL,
86
88
  SOCKET_DASHBOARD_URL,
87
89
  SOCKET_DLX_APP_NAME,
90
+ SOCKET_DOCS_CONTACT_URL,
88
91
  SOCKET_DOCS_URL,
89
92
  SOCKET_FIREWALL_APP_NAME,
90
93
  SOCKET_GITHUB_ORG,
package/dist/debug.js CHANGED
@@ -43,9 +43,9 @@ __export(debug_exports, {
43
43
  isDebugNs: () => isDebugNs
44
44
  });
45
45
  module.exports = __toCommonJS(debug_exports);
46
- var import_process = require("./constants/process");
47
- var import_debug = require("./env/debug");
48
- var import_socket = require("./env/socket");
46
+ var import_process = require("#constants/process");
47
+ var import_debug = require("#env/debug");
48
+ var import_socket = require("#env/socket");
49
49
  var import_is_unicode_supported = __toESM(require("./external/@socketregistry/is-unicode-supported"));
50
50
  var import_debug2 = __toESM(require("./external/debug"));
51
51
  var import_logger = require("./logger");
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(dlx_binary_exports);
40
40
  var import_crypto = require("crypto");
41
41
  var import_os = __toESM(require("os"));
42
42
  var import_path = __toESM(require("path"));
43
- var import_platform = require("./constants/platform");
43
+ var import_platform = require("#constants/platform");
44
44
  var import_dlx = require("./dlx");
45
45
  var import_dlx_manifest = require("./dlx-manifest");
46
46
  var import_http_request = require("./http-request");
@@ -167,7 +167,7 @@ async function writeMetadata(cacheEntryPath, cacheKey, url, binaryName, checksum
167
167
  }
168
168
  async function cleanDlxCache(maxAge = (
169
169
  /*@__INLINE__*/
170
- require("./constants/time").DLX_BINARY_CACHE_TTL
170
+ require("#constants/time").DLX_BINARY_CACHE_TTL
171
171
  )) {
172
172
  const cacheDir = getDlxCachePath();
173
173
  const fs = /* @__PURE__ */ getFs();
@@ -211,7 +211,7 @@ async function dlxBinary(args, options, spawnExtra) {
211
211
  const {
212
212
  cacheTtl = (
213
213
  /*@__INLINE__*/
214
- require("./constants/time").DLX_BINARY_CACHE_TTL
214
+ require("#constants/time").DLX_BINARY_CACHE_TTL
215
215
  ),
216
216
  checksum,
217
217
  force: userForce = false,
@@ -300,7 +300,7 @@ async function downloadBinary(options) {
300
300
  const {
301
301
  cacheTtl = (
302
302
  /*@__INLINE__*/
303
- require("./constants/time").DLX_BINARY_CACHE_TTL
303
+ require("#constants/time").DLX_BINARY_CACHE_TTL
304
304
  ),
305
305
  checksum,
306
306
  force = false,
@@ -30,7 +30,7 @@ __export(text_shimmer_exports, {
30
30
  module.exports = __toCommonJS(text_shimmer_exports);
31
31
  var import_ansi = require("../ansi");
32
32
  var import_arrays = require("../arrays");
33
- var import_ci = require("../env/ci");
33
+ var import_ci = require("#env/ci");
34
34
  var import_utils = require("../themes/utils");
35
35
  var import_themes = require("../themes/themes");
36
36
  function detectStyles(text) {