diff --git a/apps/cli/package.json b/apps/cli/package.json index 631954c4..dfc859ca 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -26,7 +26,7 @@ "fs": "0.0.1-security", "glob": "^11.0.0", "nodemon": "^3.1.4", - "secret-scan": "workspace:*", + "@keyshade/secret-scan": "workspace:*", "socket.io-client": "^4.7.5", "typescript": "^5.5.2" }, diff --git a/apps/cli/src/commands/scan.command.ts b/apps/cli/src/commands/scan.command.ts index dfc11187..186cd8dd 100644 --- a/apps/cli/src/commands/scan.command.ts +++ b/apps/cli/src/commands/scan.command.ts @@ -7,7 +7,7 @@ import { execSync } from 'child_process' import { readFileSync, statSync } from 'fs' import { globSync } from 'glob' import path from 'path' -import secretDetector from 'secret-scan' +import secretDetector from '@keyshade/secret-scan' // eslint-disable-next-line @typescript-eslint/no-var-requires const colors = require('colors/safe') @@ -83,7 +83,10 @@ export default class ScanCommand extends BaseCommand { skipNextLine = true return } - const { found, regex } = secretDetector.detect(line) + const { found, regex } = secretDetector.detect(line) as { + found: boolean + regex: RegExp + } if (found) { const matched = line.match(regex) const highlightedLine = line diff --git a/package.json b/package.json index 2abbd97d..9314ef58 100644 --- a/package.json +++ b/package.json @@ -110,9 +110,10 @@ "build:api": "pnpm db:generate-types && turbo run build --filter=api", "build:web": "turbo run build --filter=web", "build:platform": "turbo run build --filter=platform", - "build:cli": "pnpm build:api-client && turbo run build --filter=cli", + "build:cli": "pnpm build:secret-scan && pnpm build:api-client && turbo run build --filter=cli", "build:api-client": "turbo run --filter=api-client build", "build:schema": "pnpm run --filter=schema build", + "build:secret-scan": "turbo run build --filter=secret-scan", "start": "turbo run start", "start:api": "turbo run start --filter=api", "start:web": "turbo run start --filter=web", diff --git a/packages/secret-scan/package.json b/packages/secret-scan/package.json index 3bc68ac0..d8405298 100644 --- a/packages/secret-scan/package.json +++ b/packages/secret-scan/package.json @@ -1,5 +1,5 @@ { - "name": "secret-scan", + "name": "@keyshade/secret-scan", "version": "1.0.0", "description": "Do static analysis of a string to find secrets", "main": "dist/index.js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a5dbe89..059f2704 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -286,6 +286,9 @@ importers: '@clack/prompts': specifier: ^0.7.0 version: 0.7.0 + '@keyshade/secret-scan': + specifier: workspace:* + version: link:../../packages/secret-scan chalk: specifier: ^4.1.2 version: 4.1.2 @@ -313,9 +316,6 @@ importers: nodemon: specifier: ^3.1.4 version: 3.1.4 - secret-scan: - specifier: workspace:* - version: link:../../packages/secret-scan socket.io-client: specifier: ^4.7.5 version: 4.7.5