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
26 changes: 17 additions & 9 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CLAUDE.md — flare-client-js

## Claude instructions

- Do not tell me I am right all the time.
- Be critical.
- We're equals.
- Try to be neutral and objective.
- Do not use emojis.

## What is this?

The official JavaScript/TypeScript client for [Flare](https://flareapp.io) error tracking by Spatie. Captures frontend errors, collects
Expand Down Expand Up @@ -104,10 +112,10 @@ Before building new features, clean up the repo to make it a solid foundation. K

### Vue package: convert to TypeScript

- [ ] `packages/vue/src/index.js` is plain JavaScript — the only non-TS source in the monorepo
- [ ] Convert to `index.ts` with proper types for Vue's `App`, component instance, etc.
- [ ] Add a `typescript` script to vue's package.json (currently missing because it's JS)
- [ ] Update build script from `tsdown src/index.js` to `tsdown src/index.ts`
- [x] `packages/vue/src/index.js` was plain JavaScript — converted to TypeScript
- [x] Convert to `index.ts` with proper types for Vue's `App`, `ComponentPublicInstance`, etc.
- [x] Add a `typescript` script to vue's package.json (`tsc --noEmit`)
- [x] Update build script from `tsdown src/index.js` to `tsdown src/index.ts`

### CI improvements

Expand All @@ -116,6 +124,11 @@ Before building new features, clean up the repo to make it a solid foundation. K
- [ ] Consolidate the two workflows (test.yml + typescript.yml) into one — they both run `npm install` + `npm run build` separately, wasteful
- [ ] Consider running on `push` to `main` + PRs only (currently runs on every push to every branch)

### Housekeeping

- [x] Add `.idea/` to `.gitignore` (currently showing as untracked in git status)
- [ ] Make use of absolute paths and aliases

### Local dev/test app

- [ ] Add a simple test app inside the repo (e.g. `playground/` directory) that imports `@flareapp/js`, `@flareapp/react`, `@flareapp/vue` etc. from the local packages
Expand All @@ -126,11 +139,6 @@ Before building new features, clean up the repo to make it a solid foundation. K
- [ ] Gitignore the playground's Flare API key (use `.env.local` or similar)
- [ ] Not published to npm — `"private": true`

### Housekeeping

- [ ] Add `.idea/` to `.gitignore` (currently showing as untracked in git status)
- [ ] Make use of absolute paths and aliasses

---

## Current mission
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist
node_modules
package-lock.json
.idea
.idea/
3 changes: 2 additions & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
},
"scripts": {
"prepublishOnly": "npm run build",
"build": "tsdown src/index.js --format cjs,esm --dts --clean"
"build": "tsdown src/index.ts --format cjs,esm --dts --clean",
"typescript": "tsc --noEmit"
},
"devDependencies": {
"@flareapp/js": "file:../js",
Expand Down
23 changes: 0 additions & 23 deletions packages/vue/src/index.js

This file was deleted.

25 changes: 25 additions & 0 deletions packages/vue/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { flare } from '@flareapp/js';
import type { App, ComponentPublicInstance } from 'vue';

export function flareVue(app: App): void {
const initialErrorHandler = app.config.errorHandler;

app.config.errorHandler = (error: unknown, instance: ComponentPublicInstance | null, info: string) => {
const componentName =
instance && instance.$options && instance.$options.name ? instance.$options.name : 'AnonymousComponent';

const context = {
vue: { info, componentName },
};

flare.report(error as Error, context, { vue: { instance, info } });

if (typeof initialErrorHandler === 'function') {
initialErrorHandler(error, instance, info);

return;
}

throw error;
};
}
4 changes: 4 additions & 0 deletions packages/vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src"]
}