Skip to content

Commit a0a6ca1

Browse files
committed
feat: migrate patch command to @socketsecurity/socket-patch@1.2.0
1 parent c4b1339 commit a0a6ca1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+194
-5659
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [Unreleased]
8+
9+
### Changed
10+
- Updated to @socketsecurity/socket-patch@1.2.0.
11+
712
## [2.1.0](https://github.com/SocketDev/socket-cli/releases/tag/v2.1.0) - 2025-11-02
813

914
### Added

packages/cli/external-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
"package": "socketsecurity",
2525
"version": "^2.2.15"
2626
},
27+
"socket-patch": {
28+
"description": "Socket Patch CLI for applying security patches",
29+
"type": "npm",
30+
"package": "@socketsecurity/socket-patch",
31+
"version": "1.2.0"
32+
},
2733
"sfw": {
2834
"description": "Socket Firewall (sfw)",
2935
"type": "standalone",

packages/cli/scripts/build.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Options: --quiet, --verbose, --force, --watch
44
*/
55

6-
import { copyFileSync } from 'node:fs'
7-
import { promises as fs } from 'node:fs'
6+
import { copyFileSync, promises as fs } from 'node:fs'
87
import path from 'node:path'
98
import { fileURLToPath } from 'node:url'
109

packages/cli/scripts/esbuild-shared.mjs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,30 @@ export function getInlinedEnvVars() {
137137
const externalTools = JSON.parse(
138138
readFileSync(path.join(rootPath, 'external-tools.json'), 'utf-8'),
139139
)
140-
const cdxgenVersion = externalTools['@cyclonedx/cdxgen']?.version || ''
141-
const coanaVersion = externalTools['@coana-tech/cli']?.version || ''
142-
const pyCliVersion = externalTools['socketsecurity']?.version || ''
143-
const pythonBuildTag = externalTools['python']?.buildTag || ''
144-
const pythonVersion = externalTools['python']?.version || ''
145-
const sfwVersion = externalTools['sfw']?.version || ''
140+
141+
function getExternalToolVersion(key, field = 'version') {
142+
const tool = externalTools[key]
143+
if (!tool) {
144+
throw new Error(
145+
`External tool "${key}" not found in external-tools.json. Please add it to the configuration.`,
146+
)
147+
}
148+
const value = tool[field]
149+
if (!value) {
150+
throw new Error(
151+
`External tool "${key}" is missing required field "${field}" in external-tools.json.`,
152+
)
153+
}
154+
return value
155+
}
156+
157+
const cdxgenVersion = getExternalToolVersion('@cyclonedx/cdxgen')
158+
const coanaVersion = getExternalToolVersion('@coana-tech/cli')
159+
const pyCliVersion = getExternalToolVersion('socketsecurity')
160+
const pythonBuildTag = getExternalToolVersion('python', 'buildTag')
161+
const pythonVersion = getExternalToolVersion('python')
162+
const sfwVersion = getExternalToolVersion('sfw')
163+
const socketPatchVersion = getExternalToolVersion('socket-patch')
146164

147165
// Build-time constants that can be overridden by environment variables.
148166
const publishedBuild =
@@ -166,6 +184,7 @@ export function getInlinedEnvVars() {
166184
INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION: JSON.stringify(cdxgenVersion),
167185
INLINED_SOCKET_CLI_PYCLI_VERSION: JSON.stringify(pyCliVersion),
168186
INLINED_SOCKET_CLI_SFW_VERSION: JSON.stringify(sfwVersion),
187+
INLINED_SOCKET_CLI_SOCKET_PATCH_VERSION: JSON.stringify(socketPatchVersion),
169188
INLINED_SOCKET_CLI_SYNP_VERSION: JSON.stringify(synpVersion),
170189
INLINED_SOCKET_CLI_PUBLISHED_BUILD: JSON.stringify(
171190
publishedBuild ? '1' : '',

packages/cli/src/commands/patch/PatchSelectorApp.tsx

Lines changed: 0 additions & 244 deletions
This file was deleted.

0 commit comments

Comments
 (0)