Skip to content

Commit 52e8b84

Browse files
authored
Merge branch 'main' into scan_create_report
2 parents 6fbd023 + c0c2e5d commit 52e8b84

File tree

9 files changed

+478
-39
lines changed

9 files changed

+478
-39
lines changed

.dep-stats.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"dependencies": {
33
"@apideck/better-ajv-errors": "0.3.6",
4+
"@octokit/rest": "^21.1.1",
45
"@pnpm/lockfile.detect-dep-types": "^1001.0.6",
56
"@pnpm/lockfile.fs": "^1001.1.8",
67
"@pnpm/logger": "^1000.0.0",
@@ -33,6 +34,17 @@
3334
},
3435
"devDependencies": {},
3536
"esm": {
37+
"@octokit/auth-token": "^5.0.0",
38+
"@octokit/core": "^6.1.4",
39+
"@octokit/endpoint": "^10.1.3",
40+
"@octokit/graphql": "^8.1.2",
41+
"@octokit/plugin-paginate-rest": "^11.4.2",
42+
"@octokit/plugin-request-log": "^5.3.1",
43+
"@octokit/plugin-rest-endpoint-methods": "^13.3.0",
44+
"@octokit/request": "^9.2.2",
45+
"@octokit/request-error": "^6.1.7",
46+
"@octokit/rest": "^21.1.1",
47+
"before-after-hook": "^3.0.2",
3648
"bundle-name": "^4.1.0",
3749
"default-browser": "^5.2.1",
3850
"default-browser-id": "^5.0.0",
@@ -45,6 +57,7 @@
4557
"open": "10.1.0",
4658
"run-applescript": "^7.0.0",
4759
"tiny-updater": "3.5.3",
60+
"universal-user-agent": "^7.0.2",
4861
"when-exit": "^2.1.4"
4962
},
5063
"external": {
@@ -54,6 +67,7 @@
5467
"chalk-table": "1.0.2",
5568
"cmd-shim": "7.0.0",
5669
"common-tags": "1.8.2",
70+
"fast-content-type-parse": "^2.0.0",
5771
"hpagent": "1.2.0",
5872
"ignore": "7.0.3",
5973
"micromatch": "4.0.8",
@@ -64,5 +78,7 @@
6478
"yargs-parser": "21.1.1",
6579
"yoctocolors-cjs": "2.1.2"
6680
},
67-
"transitives": {}
81+
"transitives": {
82+
"fast-content-type-parse": "^2.0.0"
83+
}
6884
}

package-lock.json

Lines changed: 189 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "socket",
3-
"version": "0.14.68",
3+
"version": "0.14.76",
44
"description": "CLI tool for Socket.dev",
55
"homepage": "https://github.com/SocketDev/socket-cli",
66
"license": "MIT",
@@ -77,6 +77,7 @@
7777
},
7878
"dependencies": {
7979
"@apideck/better-ajv-errors": "0.3.6",
80+
"@octokit/rest": "^21.1.1",
8081
"@pnpm/lockfile.detect-dep-types": "^1001.0.6",
8182
"@pnpm/lockfile.fs": "^1001.1.8",
8283
"@pnpm/logger": "^1000.0.0",
@@ -91,6 +92,7 @@
9192
"chalk-table": "1.0.2",
9293
"cmd-shim": "7.0.0",
9394
"common-tags": "1.8.2",
95+
"fast-content-type-parse": "^2.0.0",
9496
"hpagent": "1.2.0",
9597
"ignore": "7.0.3",
9698
"meow": "13.2.0",
@@ -194,7 +196,7 @@
194196
"tiny-colors": "$yoctocolors-cjs",
195197
"typedarray": "npm:@socketregistry/typedarray@^1",
196198
"undici": "^6.21.1",
197-
"vite": "^6.2.4",
199+
"vite": "^6.2.5",
198200
"xml2js": "^0.5.0",
199201
"yaml": "2.7.1"
200202
},

src/commands/fix/cmd-fix.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('socket fix', async () => {
2626
Options
2727
--dryRun Do input validation for a command and exit 0 when input is ok
2828
--help Print this help
29+
--test Very the fix by running unit tests
2930
--testScript The test script to run for each fix attempt"
3031
`
3132
)

src/commands/fix/cmd-fix.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const config: CliCommandConfig = {
1616
hidden: true,
1717
flags: {
1818
...commonFlags,
19+
test: {
20+
type: 'boolean',
21+
default: true,
22+
description: 'Very the fix by running unit tests'
23+
},
1924
testScript: {
2025
type: 'string',
2126
default: 'test',
@@ -54,7 +59,12 @@ async function run(
5459
return
5560
}
5661

62+
// Lazily access constants.spinner.
63+
const { spinner } = constants
64+
5765
await runFix({
66+
spinner,
67+
test: Boolean(cli.flags['test']),
5868
testScript: cli.flags['testScript'] as string | undefined
5969
})
6070
}

src/commands/fix/npm-fix.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function isTopLevel(tree: SafeNode, node: SafeNode): boolean {
3131
type NpmFixOptions = {
3232
cwd?: string | undefined
3333
spinner?: Spinner | undefined
34+
test?: boolean | undefined
3435
testScript?: string | undefined
3536
}
3637

@@ -41,6 +42,7 @@ export async function npmFix(
4142
const {
4243
cwd = process.cwd(),
4344
spinner,
45+
test = false,
4446
testScript = 'test'
4547
} = { __proto__: null, ...options } as NpmFixOptions
4648

@@ -117,8 +119,10 @@ export async function npmFix(
117119
)
118120
) {
119121
try {
120-
// eslint-disable-next-line no-await-in-loop
121-
await runScript(testScript, [], { spinner, stdio: 'ignore' })
122+
if (test) {
123+
// eslint-disable-next-line no-await-in-loop
124+
await runScript(testScript, [], { spinner, stdio: 'ignore' })
125+
}
122126

123127
spinner?.info(`Patched ${name} ${oldVersion} -> ${node.version}`)
124128

0 commit comments

Comments
 (0)