@checkstack/theme-frontend 0.1.21 → 0.1.22

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,41 @@
1
1
  # @checkstack/theme-frontend
2
2
 
3
+ ## 0.1.22
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
+ - @checkstack/common@0.6.5
34
+ - @checkstack/ui@1.2.1
35
+ - @checkstack/auth-frontend@0.5.18
36
+ - @checkstack/frontend-api@0.3.9
37
+ - @checkstack/theme-common@0.1.8
38
+
3
39
  ## 0.1.21
4
40
 
5
41
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/theme-frontend",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "main": "src/index.tsx",
6
6
  "checkstack": {
@@ -14,16 +14,16 @@
14
14
  "dependencies": {
15
15
  "@checkstack/theme-common": "0.1.7",
16
16
  "@checkstack/frontend-api": "0.3.8",
17
- "@checkstack/auth-frontend": "0.5.13",
17
+ "@checkstack/auth-frontend": "0.5.17",
18
18
  "@checkstack/common": "0.6.4",
19
- "@checkstack/ui": "1.1.3",
19
+ "@checkstack/ui": "1.2.0",
20
20
  "react": "^18.2.0",
21
21
  "lucide-react": "^0.344.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "typescript": "^5.0.0",
25
25
  "@types/react": "^18.2.0",
26
- "@checkstack/tsconfig": "0.0.4",
26
+ "@checkstack/tsconfig": "0.0.5",
27
27
  "@checkstack/scripts": "0.1.2"
28
28
  }
29
29
  }
@@ -3,6 +3,7 @@ import { Moon, Sun } from "lucide-react";
3
3
  import { Toggle, useTheme, useToast } from "@checkstack/ui";
4
4
  import { usePluginClient } from "@checkstack/frontend-api";
5
5
  import { ThemeApi } from "@checkstack/theme-common";
6
+ import { extractErrorMessage } from "@checkstack/common";
6
7
 
7
8
  /**
8
9
  * Theme toggle menu item for logged-in users (displayed in UserMenu).
@@ -37,11 +38,8 @@ export const ThemeToggleMenuItem = () => {
37
38
  await setThemeMutation.mutateAsync({ theme: newTheme });
38
39
  } catch (error) {
39
40
  const message =
40
- error instanceof Error
41
- ? error.message
42
- : "Failed to save theme preference";
41
+ extractErrorMessage(error, "Failed to save theme preference");
43
42
  toast.error(message);
44
- console.error("Failed to save theme preference:", error);
45
43
  // Revert on error
46
44
  setIsDark(!checked);
47
45
  setTheme(checked ? "light" : "dark");