@checkstack/dependency-backend 0.2.1 → 0.2.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @checkstack/dependency-backend
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - d1a2796: Enforce stricter code quality standards and eliminate AI slop anti-patterns.
8
+
9
+ **New utility**
10
+
11
+ - `extractErrorMessage(error, fallback?)` in `@checkstack/common` for consistent error extraction
12
+
13
+ **ESLint rules**
14
+
15
+ - `react-hooks/rules-of-hooks` and `exhaustive-deps` for hook correctness
16
+ - `no-console` in frontend packages — forces `toast` over silent `console.error`
17
+ - `no-restricted-syntax` banning `instanceof Error` — forces `extractErrorMessage`
18
+ - Custom `no-eslint-disable-any` rule preventing `@typescript-eslint/no-explicit-any` circumvention
19
+
20
+ **Refactoring**
21
+
22
+ - Replace 141 `instanceof Error` boilerplate patterns across the codebase
23
+ - Replace swallowed `console.error` with user-visible `toast.error()` feedback
24
+ - Remove 15 redundant `as` type casts in IntegrationsPage and ProviderConnectionsPage
25
+ - Consolidate 3 identical callback handlers into `handleDialogClose`
26
+ - Fix conditional React hook call in `FormField.tsx`
27
+ - Fix unstable useMemo deps in `Dashboard.tsx`
28
+ - Replace `useEffect`→`setState` with derived `useMemo` in `RegisterPage.tsx`
29
+ - Rewrite `keystore.test.ts` with typed `DrizzleMockChain` (eliminating 7 `any` suppressions)
30
+ - Delete obvious comments in `encryption.ts` and Teams `provider.ts`
31
+
32
+ - Updated dependencies [d1a2796]
33
+ - Updated dependencies [3c34b07]
34
+ - @checkstack/common@0.6.5
35
+ - @checkstack/backend-api@0.11.1
36
+ - @checkstack/catalog-backend@0.2.23
37
+ - @checkstack/healthcheck-backend@0.12.1
38
+ - @checkstack/catalog-common@1.3.1
39
+ - @checkstack/healthcheck-common@0.10.1
40
+ - @checkstack/dependency-common@0.2.1
41
+ - @checkstack/incident-common@0.4.7
42
+ - @checkstack/maintenance-common@0.4.9
43
+ - @checkstack/signal-common@0.1.9
44
+
3
45
  ## 0.2.1
4
46
 
5
47
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/dependency-backend",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -13,12 +13,12 @@
13
13
  "lint:code": "eslint . --max-warnings 0"
14
14
  },
15
15
  "dependencies": {
16
- "@checkstack/backend-api": "0.10.0",
17
- "@checkstack/dependency-common": "0.1.0",
18
- "@checkstack/catalog-common": "1.2.11",
19
- "@checkstack/catalog-backend": "0.2.20",
20
- "@checkstack/healthcheck-common": "0.8.4",
21
- "@checkstack/healthcheck-backend": "0.10.7",
16
+ "@checkstack/backend-api": "0.11.0",
17
+ "@checkstack/dependency-common": "0.2.0",
18
+ "@checkstack/catalog-common": "1.3.0",
19
+ "@checkstack/catalog-backend": "0.2.22",
20
+ "@checkstack/healthcheck-common": "0.10.0",
21
+ "@checkstack/healthcheck-backend": "0.12.0",
22
22
  "@checkstack/maintenance-common": "0.4.8",
23
23
  "@checkstack/incident-common": "0.4.6",
24
24
  "@checkstack/signal-common": "0.1.8",
@@ -30,8 +30,8 @@
30
30
  "devDependencies": {
31
31
  "@checkstack/drizzle-helper": "0.0.4",
32
32
  "@checkstack/scripts": "0.1.2",
33
- "@checkstack/test-utils-backend": "0.1.15",
34
- "@checkstack/tsconfig": "0.0.4",
33
+ "@checkstack/test-utils-backend": "0.1.17",
34
+ "@checkstack/tsconfig": "0.0.5",
35
35
  "@types/bun": "^1.0.0",
36
36
  "typescript": "^5.0.0"
37
37
  }
package/src/router.ts CHANGED
@@ -17,6 +17,7 @@ import type {
17
17
  } from "./services/warning-evaluation-service";
18
18
  import { dependencyHooks } from "./hooks";
19
19
  import type { InferClient } from "@checkstack/common";
20
+ import { extractErrorMessage } from "@checkstack/common";
20
21
  import { CatalogApi } from "@checkstack/catalog-common";
21
22
  import { HealthCheckApi } from "@checkstack/healthcheck-common";
22
23
 
@@ -205,12 +206,12 @@ export function createRouter({
205
206
 
206
207
  return result;
207
208
  } catch (error) {
209
+ const message = extractErrorMessage(error);
208
210
  if (
209
- error instanceof Error &&
210
- (error.message.includes("circular chain") ||
211
- error.message.includes("already exists"))
211
+ message.includes("circular chain") ||
212
+ message.includes("already exists")
212
213
  ) {
213
- throw new ORPCError("BAD_REQUEST", { message: error.message });
214
+ throw new ORPCError("BAD_REQUEST", { message });
214
215
  }
215
216
  throw error;
216
217
  }