Skip to content

Commit f01d203

Browse files
jdaltonclaude
andcommitted
refactor(utils): rename files that echo directory names
- Rename utils/fs/fs.mts → utils/fs/find-up.mts - Rename utils/git/git.mts → utils/git/operations.mts - Rename utils/ecosystem/ecosystem.mts → utils/ecosystem/types.mts - Update all imports across codebase (.mts and .mjs) - Fix test import paths after @socketsecurity/lib v1.3.5 update - Fix test mocks to use proper constructor functions - Add missing logger imports to build scripts Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9e601b1 commit f01d203

Some content is hidden

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

68 files changed

+3661
-219
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"created": "2025-10-26T14:49:57.246Z",
3+
"name": "cloned",
4+
"package": "yoga-layout"
5+
}

activate-build-env.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# Socket CLI Build Environment Activation Script
3+
# Auto-generated by setup-build-toolchain.mjs
4+
5+
# Activate Emscripten SDK
6+
if [ -f "/Users/jdalton/.emsdk/emsdk_env.sh" ]; then
7+
source "/Users/jdalton/.emsdk/emsdk_env.sh"
8+
echo "✓ Emscripten activated"
9+
fi
10+
11+
# Add Rust to PATH
12+
if [ -d "/Users/jdalton/.cargo/bin" ]; then
13+
export PATH="/Users/jdalton/.cargo/bin:$PATH"
14+
echo "✓ Rust activated"
15+
fi
16+
17+
# Verify tools
18+
echo ""
19+
echo "Build environment ready:"
20+
command -v emcc >/dev/null && echo " ✓ emcc: $(emcc --version | head -1)"
21+
command -v rustc >/dev/null && echo " ✓ rustc: $(rustc --version)"
22+
command -v python3 >/dev/null && echo " ✓ python3: $(python3 --version)"
23+
command -v clang >/dev/null && echo " ✓ clang: $(clang --version | head -1)"
24+
echo ""

packages/cli/scripts/build.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { spawn } from 'node:child_process'
1616

1717
import { runCommandQuiet } from './utils/run-command.mjs'
1818
import { logger } from '@socketsecurity/lib/logger'
19-
import colors from 'yoctocolors-cjs'
2019

2120
// Simple CLI helpers without registry dependencies.
2221
const isQuiet = () => process.argv.includes('--quiet')

packages/cli/scripts/claude.mjs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import path from 'node:path'
1717
import { fileURLToPath } from 'node:url'
1818

1919
import { deleteAsync as del } from 'del'
20-
import colors from 'yoctocolors-cjs'
2120

2221
import { parseArgs } from '@socketsecurity/lib/argv/parse'
2322
import { logger } from '@socketsecurity/lib/logger'
@@ -1316,9 +1315,7 @@ async function ensureGitHubAuthenticated() {
13161315
logger.log(colors.red('\nLogin failed. Please try again.'))
13171316

13181317
if (attempts < maxAttempts) {
1319-
logger.log(
1320-
colors.yellow(`\nAttempt ${attempts + 1} of ${maxAttempts}`),
1321-
)
1318+
logger.log(colors.yellow(`\nAttempt ${attempts + 1} of ${maxAttempts}`))
13221319
await new Promise(resolve => setTimeout(resolve, 1000))
13231320
}
13241321
}
@@ -4550,9 +4547,7 @@ Let's work through this together to get CI passing.`
45504547
)
45514548
})
45524549
if (snapshotList.length > 5) {
4553-
logger.log(
4554-
colors.gray(` ... and ${snapshotList.length - 5} more`),
4555-
)
4550+
logger.log(colors.gray(` ... and ${snapshotList.length - 5} more`))
45564551
}
45574552
}
45584553

@@ -5544,9 +5539,7 @@ async function main() {
55445539
logger.log(
55455540
' --max-auto-fixes N Max auto-fix attempts (--green, default: 10)',
55465541
)
5547-
logger.log(
5548-
' --max-retries N Max CI fix attempts (--green, default: 3)',
5549-
)
5542+
logger.log(' --max-retries N Max CI fix attempts (--green, default: 3)')
55505543
logger.log(' --no-darkwing Disable "Let\'s get dangerous!" mode')
55515544
logger.log(' --no-report Skip generating scan report (--fix)')
55525545
logger.log(' --no-verify Use --no-verify when committing')
@@ -5581,9 +5574,7 @@ async function main() {
55815574
logger.log(
55825575
' pnpm claude --test lib/utils.js # Generate tests for a file',
55835576
)
5584-
logger.log(
5585-
' pnpm claude --refactor src/index.js # Suggest refactoring',
5586-
)
5577+
logger.log(' pnpm claude --refactor src/index.js # Suggest refactoring')
55875578
logger.log(' pnpm claude --push # Commit and push changes')
55885579
logger.log(' pnpm claude --help # Show this help')
55895580
logger.log('\nRequires:')

packages/cli/scripts/esbuild.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { build } from 'esbuild'
99

1010
import config from './esbuild.cli.config.mjs'
1111
import { logger } from '@socketsecurity/lib/logger'
12-
import colors from 'yoctocolors-cjs'
1312

1413
logger.log('Building Socket CLI with esbuild...\n')
1514

packages/cli/scripts/extract-minilm-model.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
1111
import path from 'node:path'
1212
import { fileURLToPath } from 'node:url'
1313
import { logger } from '@socketsecurity/lib/logger'
14-
import colors from 'yoctocolors-cjs'
1514

1615
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1716
const rootPath = path.join(__dirname, '..')

packages/cli/scripts/lint.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,7 @@ async function main() {
395395
logger.log(' --staged Lint staged files')
396396
logger.log(' --quiet, --silent Suppress progress messages')
397397
logger.log('\nExamples:')
398-
logger.log(
399-
' pnpm lint # Lint changed files (default)',
400-
)
398+
logger.log(' pnpm lint # Lint changed files (default)')
401399
logger.log(' pnpm lint --fix # Fix issues in changed files')
402400
logger.log(' pnpm lint --all # Lint all files')
403401
logger.log(' pnpm lint --staged --fix # Fix issues in staged files')

packages/cli/scripts/utils/changed-test-mapper.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function mapSourceToTests(filepath) {
184184
if (normalized.includes('src/utils/dlx/spawn.mts')) {
185185
return ['src/utils/dlx/spawn.e2e.test.mts']
186186
}
187-
if (normalized.includes('src/utils/ecosystem/ecosystem.mts')) {
187+
if (normalized.includes('src/utils/ecosystem/types.mts')) {
188188
return ['src/utils/ecosystem/ecosystem.test.mts']
189189
}
190190
if (normalized.includes('src/utils/ecosystem/environment.mts')) {
@@ -214,7 +214,7 @@ function mapSourceToTests(filepath) {
214214
if (normalized.includes('src/utils/fs/path-resolve.mts')) {
215215
return ['src/utils/fs/path-resolve.test.mts']
216216
}
217-
if (normalized.includes('src/utils/git/git.mts')) {
217+
if (normalized.includes('src/utils/git/operations.mts')) {
218218
return ['src/utils/git/git.test.mts']
219219
}
220220
if (normalized.includes('src/utils/git/github.mts')) {

packages/cli/scripts/utils/patches.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import path from 'node:path'
1010
import { parse } from '@babel/core'
1111
import MagicString from 'magic-string'
1212
import { logger } from '@socketsecurity/lib/logger'
13-
import colors from 'yoctocolors-cjs'
1413

1514
/**
1615
* Parse JavaScript/TypeScript code into a Babel AST.

packages/cli/src/commands/ci/handle-ci.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
detectDefaultBranch,
88
getRepoName,
99
gitBranch,
10-
} from '../../utils/git/git.mjs'
10+
} from '../../utils/git/operations.mjs'
1111
import { serializeResultJson } from '../../utils/output/result-json.mjs'
1212
import { handleCreateNewScan } from '../scan/handle-create-new-scan.mts'
1313

0 commit comments

Comments
 (0)