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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
pull_request:
branches: [main, master]
push:
branches: [main, master]

jobs:
ci:
name: Typecheck & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup mise
uses: jdx/mise-action@v3
with:
install: true
cache: true
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: pnpm install

- name: Typecheck
run: pnpm run typecheck

- name: Test
run: pnpm -r run test
3 changes: 3 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
node = "20"
pnpm = "9"
2 changes: 1 addition & 1 deletion caido.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineConfig({
id,
name: "Data Grep",
description: "Extract data from your requests and responses",
version: "1.2.0",
version: "1.2.1",
author: {
name: "Caido Labs Inc.",
email: "dev@caido.io",
Expand Down
7 changes: 5 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
"type": "module",
"types": "src/index.ts",
"scripts": {
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"test": "vitest run",
"test:watch": "vitest"
},
"devDependencies": {
"@caido/sdk-backend": "^0.47.1",
"shared": "workspace:*"
"shared": "workspace:*",
"vitest": "^2.1.0"
},
"dependencies": {
"zod": "^3.25.30"
Expand Down
7 changes: 7 additions & 0 deletions packages/backend/src/__mocks__/caido-plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Stub for "caido:plugin" in tests. Only types are used at runtime in types.ts.
*/
export function DefineEvents<T>(): T {
return {} as T;
}
export class SDK<T, E> {}
4 changes: 4 additions & 0 deletions packages/backend/src/__mocks__/caido-utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Stub for "caido:utils" in tests. Only types are imported from here in grep.ts.
*/
export {};
6 changes: 5 additions & 1 deletion packages/backend/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export const grepRequests = async (
pattern: string,
options: GrepOptions
): Promise<{
data?: { matchesCount?: number; timeTaken?: number };
data?: {
matchesCount?: number;
timeTaken?: number;
error?: string;
};
error?: string;
}> => {
try {
Expand Down
Loading