@codewithagents/api-errors 0.5.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -0
  2. package/package.json +3 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # @codewithagents/api-errors
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@codewithagents/api-errors.svg)](https://npmjs.com/package/@codewithagents/api-errors)
4
+ [![codecov](https://codecov.io/gh/codewithagents/glue/graph/badge.svg?flag=api-errors)](https://codecov.io/gh/codewithagents/glue)
5
+
3
6
  Backend API errors don't automatically map to form field errors. Every project writes the same glue code from scratch: catch the error, inspect its shape, figure out which field each message belongs to, then call your form library's error setter. This package does that for you — framework-agnostic core with a first-class React Hook Form adapter.
4
7
 
5
8
  ## Installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codewithagents/api-errors",
3
- "version": "0.5.0",
3
+ "version": "1.0.0",
4
4
  "description": "Map backend API errors to form field errors. Framework-agnostic core with React Hook Form adapter.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,6 +17,7 @@
17
17
  "scripts": {
18
18
  "build": "tsc",
19
19
  "test": "vitest run",
20
+ "test:coverage": "vitest run --coverage",
20
21
  "lint": "tsc --noEmit"
21
22
  },
22
23
  "keywords": [
@@ -33,6 +34,7 @@
33
34
  "url": "https://github.com/codewithagents/glue"
34
35
  },
35
36
  "devDependencies": {
37
+ "@vitest/coverage-v8": "^3.0.0",
36
38
  "typescript": "^6.0.0",
37
39
  "vitest": "^3.0.0"
38
40
  }