Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.

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

## [1.1.30](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.30) - 2025-11-18

### Changed
- Enhanced `SOCKET_CLI_COANA_LOCAL_PATH` to support compiled Coana CLI binaries alongside Node.js script files

### Fixed
- Resolved PR creation workflow to properly recreate pull requests after closing or merging
- Corrected API token selection to honor `SOCKET_CLI_API_TOKEN` environment variable in package alert requests

## [1.1.29](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.29) - 2025-11-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket",
"version": "1.1.29",
"version": "1.1.30",
"description": "CLI for Socket.dev",
"homepage": "https://github.com/SocketDev/socket-cli",
"license": "MIT AND OFL-1.1",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/dlx.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('utils/dlx', () => {
it('should place --silent before dlx for pnpm', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '~1.0.0',
version: '1.0.0',
}

await spawnDlx(packageSpec, ['run', '/some/path'], {
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('utils/dlx', () => {
it('should place --silent after --yes for npm', async () => {
const packageSpec: DlxPackageSpec = {
name: '@coana-tech/cli',
version: '~1.0.0',
version: '1.0.0',
}

await spawnDlx(packageSpec, ['run', '/some/path'], {
Expand Down
31 changes: 31 additions & 0 deletions src/utils/path-resolve.test.mts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { existsSync, lstatSync, readdirSync, rmSync } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

Expand All @@ -23,6 +24,36 @@ const __dirname = path.dirname(__filename)
const rootNmPath = path.join(__dirname, '../..', NODE_MODULES)
const mockFixturePath = normalizePath(path.join(__dirname, 'mock'))
const mockNmPath = normalizePath(rootNmPath)

// Remove broken symlinks in node_modules before loading to prevent mock-fs errors.
function cleanupBrokenSymlinks(dirPath: string): void {
try {
if (!existsSync(dirPath)) {
return
}
const entries = readdirSync(dirPath, { withFileTypes: true })
for (const entry of entries) {
const fullPath = path.join(dirPath, entry.name)
try {
if (entry.isSymbolicLink() && !existsSync(fullPath)) {
// Symlink exists but target does not, remove it.
rmSync(fullPath, { force: true })
} else if (entry.isDirectory()) {
// Recursively check subdirectories.
cleanupBrokenSymlinks(fullPath)
}
} catch {
// Ignore errors for individual entries.
}
}
} catch {
// If we cannot read the directory, skip cleanup.
}
}

// Clean up broken symlinks before loading node_modules.
cleanupBrokenSymlinks(rootNmPath)

const mockedNmCallback = mockFs.load(rootNmPath)

function mockTestFs(config: FileSystem.DirectoryItems) {
Expand Down