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
570 changes: 300 additions & 270 deletions bun.lock

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,62 +44,62 @@
"*": "prettier --write --ignore-unknown"
},
"devDependencies": {
"@contextbridge-ai/eslint-config": "^0.0.0",
"@contextbridge-ai/prettier-config": "^0.0.0",
"@contextbridge-ai/eslint-config": "^0.1.0",
"@contextbridge-ai/prettier-config": "^0.0.1",
"@fontsource/ibm-plex-mono": "^5.3.0",
"@fontsource/ibm-plex-sans": "^5.3.0",
"@graphql-codegen/cli": "^7.4.3",
"@graphql-codegen/cli": "^7.4.4",
"@graphql-codegen/typed-document-node": "^7.1.1",
"@graphql-codegen/typescript-operations": "^6.1.8",
"@graphql-codegen/typescript-operations": "^6.1.10",
"@graphql-typed-document-node/core": "^3.2.0",
"@octokit/graphql-schema": "^15.26.1",
"@octokit/plugin-paginate-rest": "^16.0.0",
"@octokit/types": "^18.0.0",
"@storybook/react-vite": "^10.6.0",
"@storybook/react-vite": "^10.6.1",
"@tailwindcss/vite": "^4.3.3",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@types/bun": "latest",
"@types/react": "^19",
"@types/react-dom": "^19",
"@types/semver": "^7.8.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/browser-playwright": "^5.0.2",
"@vitejs/plugin-react": "^6.1.2",
"@vitest/browser-playwright": "^5.0.3",
"bun-plugin-tailwind": "^0.1.2",
"chromatic": "^18.10.1",
"eslint": "^10.11.0",
"chromatic": "^18.11.0",
"eslint": "^10.12.0",
"fishery": "^2.4.0",
"globals": "^17.12.0",
"globals": "^17.13.0",
"husky": "^9.1.7",
"lint-staged": "^17.6.0",
"playwright": "^1.63.0",
"prettier": "^3.9.9",
"storybook": "^10.6.0",
"storybook": "^10.6.1",
"tailwindcss": "^4",
"typescript": "^6.0.3",
"typescript-eslint": "^8.71.0",
"vite": "^8.3.1",
"vitest": "^5.0.2"
"typescript-eslint": "^8.71.1",
"vite": "^8.3.3",
"vitest": "^5.0.3"
},
"dependencies": {
"@clack/prompts": "^1.8.1",
"@js-temporal/polyfill": "^0.5.1",
"@octokit/plugin-retry": "^8.1.1",
"@octokit/plugin-throttling": "^11.0.5",
"@octokit/rest": "^22.0.1",
"@sentry/bun": "^11.1.0",
"@sentry/bun": "^11.4.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"graphql": "^16.14.0",
"lucide-react": "^1.48.0",
"lucide-react": "^1.52.0",
"neverthrow": "^8.2.0",
"open": "^11.0.4",
"p-map": "^7.0.8",
"pino": "^10.3.1",
"pino-pretty": "^13.1.3",
"posthog-js": "^1.434.17",
"posthog-node": "^5.54.1",
"radix-ui": "^1.6.7",
"pino": "^10.4.0",
"pino-pretty": "^13.2.0",
"posthog-js": "^1.438.2",
"posthog-node": "^5.55.0",
"radix-ui": "^1.7.0",
"react": "^19",
"react-dom": "^19",
"semver": "^7.8.5",
Expand Down
3 changes: 1 addition & 2 deletions src/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect, test } from 'bun:test';
import { main } from './cli.ts';
import { githubRepoResponse } from './testFactories.ts';
import { createFakeContext } from './testHelpers/index.ts';
import type { FakeAnalytics, FakeGithubClient } from './testHelpers/index.ts';
import { type FakeAnalytics, type FakeGithubClient, createFakeContext } from './testHelpers/index.ts';

// The Dependabot PR search is the only GraphQL call; resolve it empty so the
// happy-path tests reach the report without exercising the search internals.
Expand Down
3 changes: 1 addition & 2 deletions src/collectors/cve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { type ResultAsync, errAsync, okAsync } from 'neverthrow';
import { z } from 'zod';
import type { GithubError } from '../github/errors.ts';
import type { GithubClient } from '../github/GithubClient.ts';
import type { CveAlert, CveSeverity, CveSlice, RepoMeta, RepoRef } from '../types.ts';
import { repoKey } from '../types.ts';
import { type CveAlert, type CveSeverity, type CveSlice, type RepoMeta, type RepoRef, repoKey } from '../types.ts';

// `security_vulnerability` is null on alerts GitHub can't attribute to a
// concrete vulnerability (e.g. auto-dismissed); those carry no severity or
Expand Down
9 changes: 8 additions & 1 deletion src/collectors/repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ export function listTargetRepos(client: GithubClient, target: string): ResultAsy
}

function toRepoMeta(raw: RawRepo): RepoMeta {
const visibility: Visibility = raw.visibility === 'internal' ? 'internal' : raw.private ? 'private' : 'public';
let visibility: Visibility;
if (raw.visibility === 'internal') {
visibility = 'internal';
} else if (raw.private) {
visibility = 'private';
} else {
visibility = 'public';
}
const security = raw.security_and_analysis;
return {
owner: raw.owner.login,
Expand Down
15 changes: 5 additions & 10 deletions src/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import type { GithubClient } from '../github/GithubClient.ts';
import { GithubClientImpl } from '../github/GithubClient.ts';
import { type GithubClient, GithubClientImpl } from '../github/GithubClient.ts';
import { type Analytics, NoopAnalytics } from '../telemetry/Analytics.ts';
import { isTelemetryDisabled } from '../telemetry/Telemetry.ts';
import type { Io } from './BaseIo.ts';
import type { BrowserOpener } from './BrowserOpener.ts';
import { BrowserOpenerImpl } from './BrowserOpener.ts';
import type { Clock } from './Clock.ts';
import { ClockImpl } from './Clock.ts';
import { type BrowserOpener, BrowserOpenerImpl } from './BrowserOpener.ts';
import { type Clock, ClockImpl } from './Clock.ts';
import { type Environment, getEnvironment } from './Environment.ts';
import type { FileSystem } from './FileSystem.ts';
import { FileSystemImpl } from './FileSystem.ts';
import { type FileSystem, FileSystemImpl } from './FileSystem.ts';
import { IoImpl } from './IoImpl.ts';
import { type Logger, createLogger } from './Logger.ts';
import type { Prompter } from './Prompter.ts';
import { PrompterImpl } from './Prompter.ts';
import { type Prompter, PrompterImpl } from './Prompter.ts';

export interface Context {
readonly io: Io;
Expand Down
9 changes: 7 additions & 2 deletions src/interactive/repositorySelectionPrompt.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { type ResultAsync, okAsync } from 'neverthrow';
import type { PromptError, Prompter } from '../context/Prompter.ts';
import type { RepoMeta, RepositorySelection } from '../types.ts';
import { allActiveRepositorySelection, isActiveRepo, repoKey } from '../types.ts';
import {
type RepoMeta,
type RepositorySelection,
allActiveRepositorySelection,
isActiveRepo,
repoKey,
} from '../types.ts';

type SelectionMode = 'all' | 'chooseFromAll' | 'chooseFromNone';

Expand Down
3 changes: 1 addition & 2 deletions src/report/web/analytics/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Analytics, createNoopAnalytics } from '../../../telemetry/Analytics.ts';
import type { ReportAnalyticsConfig } from '../../../telemetry/Analytics.ts';
import { type Analytics, type ReportAnalyticsConfig, createNoopAnalytics } from '../../../telemetry/Analytics.ts';
import { type PostHogBrowserClient, createPostHogReportAnalytics } from './postHogAnalytics.ts';

export interface ReportAnalyticsBuildInfo {
Expand Down
4 changes: 2 additions & 2 deletions src/report/web/analytics/stableUrlRewriter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BeforeSendFn } from 'posthog-js';
import type { CaptureResult } from 'posthog-js';

// The report is opened directly from disk (file://), so posthog-js would otherwise stamp the
// viewer's local filesystem path onto $current_url/$pathname — leaking the path and fragmenting
Expand All @@ -12,7 +12,7 @@ const SYNTHETIC_HOST = 'patchwave.local';
const SYNTHETIC_PATH = '/report';
const URL_PROPERTY_KEYS = ['$current_url', '$referrer', '$initial_current_url', '$initial_referrer'] as const;

export function createStableUrlRewriter(): BeforeSendFn {
export function createStableUrlRewriter(): (event: CaptureResult | null) => CaptureResult | null {
return (event) => {
if (event == null) return event;
const props = event.properties;
Expand Down
9 changes: 7 additions & 2 deletions src/report/web/sample/sampleReportData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ import {
repoMeta,
} from '../../../testFactories.ts';
import { instantFromString } from '../../../time.ts';
import type { CollectedData, CveSlice, DependabotPr, RepoMeta } from '../../../types.ts';
import { allActiveRepositorySelection } from '../../../types.ts';
import {
type CollectedData,
type CveSlice,
type DependabotPr,
type RepoMeta,
allActiveRepositorySelection,
} from '../../../types.ts';
import { aggregate } from '../../aggregate.ts';
import { toEmbeddedShape } from '../../embeddedShape.ts';
import type { EmbeddedReportData } from '../types.ts';
Expand Down
Loading