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: 2 additions & 7 deletions apps/docs/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ export default defineConfig({
},
],
webServer: {
command: process.env.CI ? 'bun run build && bun run preview' : 'bun run dev',
command: 'bun run build && bun run preview',
url: 'http://localhost:4321',
reuseExistingServer: !process.env.CI,
timeout: (() => {
const parsed = Number.parseInt(process.env.PLAYWRIGHT_STARTUP_TIMEOUT || '', 10)
return Number.isNaN(parsed) ? 120_000 : parsed
})(),
stdout: 'pipe',
stderr: 'pipe',
timeout: 120000,
},
})
18 changes: 9 additions & 9 deletions packages/engine/tests/osv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('osvToThreatProfile', () => {
}

test('converts basic OSV record correctly', () => {
const result = osvToThreatProfile(baseOsv) as any
const result = osvToThreatProfile(baseOsv) as unknown as Record<string, unknown>
expect(result.id).toBe(baseOsv.id)
expect(result.name).toBe('test-package')
expect(result.ecosystem).toBe('npm')
Expand All @@ -43,7 +43,7 @@ describe('osvToThreatProfile', () => {
...baseOsv,
severity: [{ type: 'CVSS_V3', score }],
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.severity).toBe(expected)
}
})
Expand All @@ -53,7 +53,7 @@ describe('osvToThreatProfile', () => {
...baseOsv,
severity: [{ type: 'CVSS_V2', score: '10.0' }],
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.severity).toBe('LOW')
})

Expand All @@ -62,7 +62,7 @@ describe('osvToThreatProfile', () => {
...baseOsv,
severity: undefined,
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.severity).toBe('LOW')
})

Expand All @@ -74,7 +74,7 @@ describe('osvToThreatProfile', () => {
{ package: { name: 'pkg2', ecosystem: 'npm' } },
],
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.name).toBe('pkg1')
expect(result.ecosystem).toBe('pypi')
})
Expand All @@ -84,7 +84,7 @@ describe('osvToThreatProfile', () => {
...baseOsv,
affected: [],
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.name).toBe(osv.id)
expect(result.ecosystem).toBe('npm')
})
Expand All @@ -94,7 +94,7 @@ describe('osvToThreatProfile', () => {
...baseOsv,
summary: undefined,
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.description).toBe('')
})

Expand All @@ -106,7 +106,7 @@ describe('osvToThreatProfile', () => {
{ type: 'WEB', url: 'https://example.com/web' },
],
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.references).toEqual([
{ type: 'ADVISORY', url: 'https://example.com/advisory' },
{ type: 'WEB', url: 'https://example.com/web' },
Expand All @@ -118,7 +118,7 @@ describe('osvToThreatProfile', () => {
...baseOsv,
references: undefined,
}
const result = osvToThreatProfile(osv) as any
const result = osvToThreatProfile(osv) as unknown as Record<string, unknown>
expect(result.references).toEqual([])
})
})
9 changes: 8 additions & 1 deletion packages/scanner/src/detectors/injection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { validatePath } from '../utils.js'
interface PackageJsonManifest {
dependencies?: Record<string, string>
devDependencies?: Record<string, string>
peerDependencies?: Record<string, string>
optionalDependencies?: Record<string, string>
}

/**
Expand All @@ -23,7 +25,12 @@ function loadPackageJsonDeps(targetDir: string): Set<string> | null {
readFileSync(resolve(targetDir, 'package.json'), 'utf-8')
) as PackageJsonManifest
const declared = new Set<string>()
for (const deps of [pkg.dependencies ?? {}, pkg.devDependencies ?? {}]) {
for (const deps of [
pkg.dependencies ?? {},
pkg.devDependencies ?? {},
pkg.peerDependencies ?? {},
pkg.optionalDependencies ?? {},
]) {
for (const name of Object.keys(deps)) {
declared.add(name)
}
Expand Down
18 changes: 9 additions & 9 deletions packages/scanner/src/parsers/js-yaml.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
declare module 'js-yaml' {
export interface LoadOptions {
filename?: string;
onWarning?: (warning: Error) => void;
schema?: any;
json?: boolean;
listener?: (eventType: string, state: any) => void;
filename?: string
onWarning?: (warning: Error) => void
schema?: unknown
json?: boolean
listener?: (eventType: string, state: unknown) => void
}

/** @deprecated Unsafe for untrusted input. Use safeLoad or supply a safe schema. */
export function load(source: string, options?: LoadOptions): unknown;
export function safeLoad(source: string, options?: LoadOptions): unknown;
export function load(source: string, options?: LoadOptions): unknown

export function safeLoad(source: string, options?: LoadOptions): unknown
}
2 changes: 1 addition & 1 deletion packages/wiki-sync/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function generateSidebar(docs: DocFile[], lang: 'en' | 'cs'): string {
*/
function generateFooter(): string {
return `---
📖 [Documentation](https://hulud.dev) | 🐙 [GitHub](https://github.com/miccy/wormsCTRL) | 🪱 v1.5.1
📖 [Documentation](https://hulud.dev) | 🐙 [GitHub](https://github.com/miccy/wormsCTRL) | 🪱 v2.0.0
`
}

Expand Down
Loading