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
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ jobs:
run: pnpm install

- name: Run linter
run: pnpm lint
run: pnpm lint
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"devDependencies": {
"@caido/eslint-config": "0.5.0",
"@inquirer/prompts": "7.0.0",
"knip": "5.70.2",
"typescript": "5.6.3",
"unbuild": "2.0.0"
}
Expand Down
443 changes: 379 additions & 64 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion templates/frontend-vue/.github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,28 @@ jobs:
run: pnpm install

- name: Run linter
run: pnpm lint
run: pnpm lint

knip:
name: 'Knip'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.CAIDO_NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
with:
version: ${{ env.CAIDO_PNPM_VERSION }}

- name: Install dependencies
run: pnpm install

- name: Run knip
run: pnpm knip
20 changes: 20 additions & 0 deletions templates/frontend-vue/knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { RawConfigurationOrFn } from "knip/dist/types/config.js";

const config: RawConfigurationOrFn = {
workspaces: {
".": {
entry: ["caido.config.ts", "eslint.config.mjs"],
},
"packages/backend": {
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignoreDependencies: ["caido"],
},
"packages/frontend": {
entry: ["src/index.ts"],
project: ["src/**/*.{ts,tsx,vue}"],
},
},
};

export default config;
5 changes: 4 additions & 1 deletion templates/frontend-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"typecheck": "pnpm -r typecheck",
"lint": "eslint ./packages/**/src --fix",
"knip": "knip",
"build": "caido-dev build",
"watch": "caido-dev watch"
},
Expand All @@ -13,9 +14,11 @@
"@caido/eslint-config": "^0.5.0",
"@caido/tailwindcss": "0.0.1",
"@vitejs/plugin-vue": "5.2.1",
"eslint": "9.29.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question regarding eslint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar thing here, added this because Knip would return this warning without it

Unlisted dependencies (1)
eslint  eslint.config.mjs

Unlisted binaries (2)
eslint  package.json 

"postcss-prefixwrap": "1.51.0",
"tailwindcss": "3.4.13",
"tailwindcss-primeui": "0.3.4",
"typescript": "5.5.4"
"typescript": "5.5.4",
"knip": "5.70.2"
}
}
26 changes: 25 additions & 1 deletion templates/no-frontend/.github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,28 @@ jobs:
run: pnpm install

- name: Run linter
run: pnpm lint
run: pnpm lint

knip:
name: 'Knip'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.CAIDO_NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
with:
version: ${{ env.CAIDO_PNPM_VERSION }}

- name: Install dependencies
run: pnpm install

- name: Run knip
run: pnpm knip
16 changes: 16 additions & 0 deletions templates/no-frontend/knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { RawConfigurationOrFn } from "knip/dist/types/config.js";

const config: RawConfigurationOrFn = {
workspaces: {
".": {
entry: ["caido.config.ts", "eslint.config.mjs"],
},
"packages/backend": {
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignoreDependencies: ["caido"],
},
},
};

export default config;
5 changes: 4 additions & 1 deletion templates/no-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
"scripts": {
"typecheck": "pnpm -r typecheck",
"lint": "eslint ./packages/**/src --fix",
"knip": "knip",
"build": "caido-dev build",
"watch": "caido-dev watch"
},
"devDependencies": {
"@caido-community/dev": "^0.1.3",
"@caido/eslint-config": "^0.5.0",
"typescript": "5.5.4"
"eslint": "9.29.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question regarding eslint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here as in the last comment

"typescript": "5.5.4",
"knip": "5.70.2"
}
}
3 changes: 2 additions & 1 deletion templates/no-frontend/packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build": "vite build"
},
"devDependencies": {
"@caido/sdk-backend": "^0.46.0"
"@caido/sdk-backend": "^0.46.0",
"vite": "6.0.11"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why we need to add vite? Has the templates always been broken before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because Knip would return this warning without the vite dep

Unlisted binaries (1)
vite  packages/backend/package.json

}
}
42 changes: 42 additions & 0 deletions templates/shared/cursor-rules/best-practices.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
globs:
alwaysApply: true
description: Code Quality Best Practices
---

## TypeScript and Code Quality

- Use TypeScript for all files.
- Only use types, not interfaces.
- Do not use `any` type.
- Use `undefined` over `null`.
- Do not add any comments to the code that you generate.
- Don’t cast to `any`.
- Don’t unnecessarily add `try`/`catch`.
- Use `computed` for derived state instead of reactive variables when possible.
- Use `knip` to remove unused code if making large changes.
- When refactoring, avoid creating alias types like this:
```
export type Options = ScanConfig;
```
Instead, actually rename the type and fix all occurrences if needed.

## Structure, Naming, and Organization

- Follow consistent naming conventions:
- Folders: camelCase (`intercept`, `replay`, `httpHistory`).
- Component folders: PascalCase (`PassiveFormCreate`, `PassiveTable`).
- All other files: camelCase (`useForm.ts`, `assistant.graphql`).
- Avoid massive template blocks; compose smaller components.
- Colocate code that changes together.
- Declare variables close to their usage:
- Avoid declaring all variables at the top of functions/files.
- Place variable declarations as close as possible to where they are first used.
- Group related variables together (e.g., event bus declarations next to their corresponding listeners).

## Simplicity and Readability

- Only create an abstraction if it is actually needed.
- Prefer clear function and variable names over inline comments.
- Avoid helper functions when a simple inline expression would suffice.
- Use built-in Tailwind values, occasionally allow dynamic values, rarely globals.
16 changes: 0 additions & 16 deletions templates/shared/cursor-rules/typescript.mdc

This file was deleted.