@checkstack/api-docs-frontend 0.2.6 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # @checkstack/api-docs-frontend
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9dcc848: Cut initial-load JS: lazy plugin contributions, a hardened lazy-by-default contribution contract, on-demand Monaco, and a lighter icon/chart load.
8
+
9
+ - Lazy plugin route pages: each plugin's route `element` references a `React.lazy`-wrapped page rendered inside a shared `<Suspense>` boundary. Plugins still register synchronously, so nav, slots, commands, API factories, and `foreignSignals` are available on first paint. This moves ~37 route-page chunks (~600 KB) out of the entry; the entry chunk drops from ~2.4 MB to ~190 KB. Auth flow pages stay eager. The `@checkstack/scripts` scaffold template generates lazy route pages too.
10
+ - Hardened contribution contract (BREAKING, frontend plugin contract): plugins declare contributions lazily and let the framework own code-splitting, Suspense, and per-plugin error isolation. Routes use `load: () => import("./Page").then((m) => ({ default: m.Page }))` instead of `element: <Page />` (`element` is still accepted for the rare page that must paint without a chunk fetch; provide exactly one). Slot extensions accept either an eager `component` or a lazy `load`; new `getLazyContribution` + `ExtensionComponent` exports from `@checkstack/frontend-api` render either kind. This also fixes runtime-installed plugins: `ExtensionSlot` subscribes to the plugin registry, and the API registry rebuilds when the plugin set changes (`getPlugins()` returns an immutable snapshot via `useSyncExternalStore`). A per-plugin error boundary contains a bad contribution.
11
+ - On-demand Monaco: the `@checkstack/ui` barrel no longer pulls the `@codingame/*` / `monaco-languageclient` stack into the initial load. `CodeEditor` lazy-loads its Monaco-backed editor behind `React.lazy` + Suspense, `validateTypeScriptSources` imports the editor API via in-body `await import(...)`, and the "vscode services ready" signal moved to a Monaco-free module. The ~10 MB editor body loads only when a `CodeEditor` mounts. A `react-vendor` `manualChunks` split was added for stable vendor caching.
12
+ - lucide-react 1.x + lighter icons/charts (BREAKING for icon consumers): lucide-react unified from three drifting ranges to `^1.17.0`. lucide v1 removed brand icons, so the GitHub/GitLab marks are vendored in `@checkstack/ui` (`GithubIcon`, `GitlabIcon`, `brandIcons`); a new `IconName` type (`LucideIconName | BrandIconName`) in `@checkstack/common` is canonical, accepted by `AuthStrategy.icon` and the card components, so data-driven brand names keep working. `DynamicIcon` no longer eagerly imports lucide's ~1600-icon map (~1 MB) - it lives in a `React.lazy` `iconRegistry` chunk fetched on first data-driven render, while statically named-imported icons tree-shake normally. The recharts-backed health-check charts (~300 KB) and the `HealthCheckSystemOverview` drawer leave the initial load.
13
+
14
+ BREAKING CHANGES:
15
+
16
+ - Frontend plugin contract: routes/slot contributions are lazy-by-default (`load` instead of `element`/eager elements) as described above.
17
+ - Any external consumer importing a brand icon from `lucide-react` (e.g. `import { Github } from "lucide-react"`) must switch to the vendored `@checkstack/ui` brand icons or a custom SVG.
18
+
19
+ This is a beta minor.
20
+
21
+ - 9dcc848: Align workspace dependency versions and migrate React Router to v7.
22
+
23
+ BREAKING CHANGES (React Router v7): All frontend packages now depend on `react-router-dom@^7.16.0`. Previously the workspace declared four divergent ranges (`^6.20.0`, `^6.22.0`, `^7.1.1`, `^7.14.2`), which resolved both `react-router@6` and `react-router@7` into a single bundle. Everything is now unified on v7. The public imports the app uses (`BrowserRouter`, `Routes`, `Route`, `Link`, `NavLink`, `MemoryRouter`, `useNavigate`, `useParams`, `useSearchParams`, `useLocation`) are unchanged between v6 and v7, so no source rewrites were required - but any out-of-tree plugin still on react-router v6 should upgrade to v7 (see the React Router v6 -> v7 upgrade guide) to share the host's single router instance via the import map.
24
+
25
+ Other unified ranges (no API change): `react` -> `^18.3.1`, the `@orpc/*` family (`contract`, `server`, `client`, `tanstack-query`, `openapi`, `zod`) -> `^1.14.4`, and `better-auth` -> `^1.6.13`.
26
+
27
+ Removed the pre-rename `@orpc/react-query` leftover from `@checkstack/frontend-api`; its `createRouterUtils` / `RouterUtils` / `ProcedureUtils` now come from `@orpc/tanstack-query` (the package already in use).
28
+
29
+ Stale in-range runtime deps pulled up to current published versions: `hono` `^4.12.23`, `@tanstack/react-query` (+devtools) `^5.100.14`, `date-fns` `^4.4.0`, `jose` `^6.2.3`, `tar` `^7.5.16`, `semver` `^7.8.1`, `@xyflow/react` `^12.11.0`.
30
+
31
+ ### Patch Changes
32
+
33
+ - 9dcc848: Move primary navigation into a left sidebar, and serve the user guide in-app.
34
+
35
+ Feature navigation (a ~20-item user-menu dropdown) now lives in a persistent left sidebar (a slide-over drawer on mobile), grouped by section with the active route highlighted; the user menu keeps only account actions. A route opts into the sidebar with new `nav` metadata (`{ group, icon, label?, order?, accessRule? }`) on its registration, co-located with path + access + title. The sidebar filters entries with the same access check as page guards. `@checkstack/common` gains `isAccessRuleSatisfied` and a centralized set of in-app doc slugs (`APP_DOC_SLUGS` + `docsPath`, with a test asserting each resolves to a real docs page); `@checkstack/auth-frontend` exports `useAccessRules`.
36
+
37
+ The backend now serves the Astro Starlight docs build same-origin at `/checkstack/*` (the same artifact deployed to GitHub Pages), so the user guide is available inside the app including for self-hosted / air-gapped installs (served verbatim, no rebuild, no link rewriting; from `CHECKSTACK_DOCS_DIST`, before the SPA catch-all, degrading gracefully when absent; the Docker image builds and ships `docs/dist`; Vite proxies `/checkstack` in dev). The "Docs" link is a shell-owned external sidebar entry under the Documentation group (book icon), opening `/checkstack/user-guide/` in a new tab; the group renders even when no plugin route contributes to it.
38
+
39
+ BREAKING (plugin authors): `UserMenuItemsSlot` is no longer the way to add navigation - registering a top user-menu item no longer surfaces it anywhere. Add `nav` to the page's route instead. `UserMenuItemsBottomSlot` (account items) is unchanged. All bundled plugins have been migrated.
40
+
41
+ This is a beta minor.
42
+
43
+ - Updated dependencies [9dcc848]
44
+ - Updated dependencies [9dcc848]
45
+ - Updated dependencies [9dcc848]
46
+ - Updated dependencies [9dcc848]
47
+ - Updated dependencies [9dcc848]
48
+ - Updated dependencies [9dcc848]
49
+ - Updated dependencies [9dcc848]
50
+ - Updated dependencies [9dcc848]
51
+ - Updated dependencies [9dcc848]
52
+ - Updated dependencies [9dcc848]
53
+ - Updated dependencies [9dcc848]
54
+ - @checkstack/ui@1.13.0
55
+ - @checkstack/common@0.13.0
56
+ - @checkstack/frontend-api@0.7.0
57
+ - @checkstack/api-docs-common@0.1.16
58
+
3
59
  ## 0.2.6
4
60
 
5
61
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/api-docs-frontend",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "main": "src/index.tsx",
@@ -16,10 +16,10 @@
16
16
  "@checkstack/frontend-api": "0.6.0",
17
17
  "@checkstack/common": "0.12.0",
18
18
  "@checkstack/api-docs-common": "0.1.15",
19
- "@checkstack/ui": "1.11.0",
20
- "react": "^18.2.0",
21
- "react-router-dom": "^6.22.0",
22
- "lucide-react": "^0.344.0"
19
+ "@checkstack/ui": "1.12.0",
20
+ "react": "^18.3.1",
21
+ "react-router-dom": "^7.16.0",
22
+ "lucide-react": "^1.17.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "typescript": "^5.0.0",
package/src/index.tsx CHANGED
@@ -1,12 +1,7 @@
1
- import {
2
- createFrontendPlugin,
3
- createSlotExtension,
4
- UserMenuItemsSlot,
5
- } from "@checkstack/frontend-api";
1
+ import { createFrontendPlugin } from "@checkstack/frontend-api";
6
2
  import { createRoutes } from "@checkstack/common";
7
3
  import { pluginMetadata, apiDocsAccess } from "@checkstack/api-docs-common";
8
- import { ApiDocsPage } from "./ApiDocsPage";
9
- import { ApiDocsMenuItem } from "./ApiDocsMenuItem";
4
+ import { FileCode2 } from "lucide-react";
10
5
 
11
6
  export const apiDocsRoutes = createRoutes(pluginMetadata.pluginId, {
12
7
  docs: "/",
@@ -17,17 +12,15 @@ export const apiDocsPlugin = createFrontendPlugin({
17
12
  routes: [
18
13
  {
19
14
  route: apiDocsRoutes.routes.docs,
20
- element: <ApiDocsPage />,
15
+ load: () => import("./ApiDocsPage").then((m) => ({ default: m.ApiDocsPage })),
21
16
  accessRule: apiDocsAccess.view,
17
+ nav: {
18
+ group: "Documentation",
19
+ icon: FileCode2,
20
+ label: "API Documentation",
21
+ },
22
22
  },
23
23
  ],
24
- extensions: [
25
- createSlotExtension(UserMenuItemsSlot, {
26
- id: "api-docs.user-menu.link",
27
- component: ApiDocsMenuItem,
28
- metadata: { group: "Documentation" },
29
- }),
30
- ],
31
24
  });
32
25
 
33
26
  export default apiDocsPlugin;
@@ -1,29 +0,0 @@
1
- import { useNavigate } from "react-router-dom";
2
- import { FileCode2 } from "lucide-react";
3
- import { DropdownMenuItem } from "@checkstack/ui";
4
- import type { UserMenuItemsContext } from "@checkstack/frontend-api";
5
- import { resolveRoute } from "@checkstack/common";
6
- import { pluginMetadata, apiDocsAccess } from "@checkstack/api-docs-common";
7
- import { apiDocsRoutes } from "./index";
8
- import React from "react";
9
-
10
- const REQUIRED_ACCESS_RULE = `${pluginMetadata.pluginId}.${apiDocsAccess.view.id}`;
11
-
12
- export function ApiDocsMenuItem({
13
- accessRules: userPerms,
14
- }: UserMenuItemsContext) {
15
- const navigate = useNavigate();
16
- const canView =
17
- userPerms.includes("*") || userPerms.includes(REQUIRED_ACCESS_RULE);
18
-
19
- if (!canView) return <React.Fragment />;
20
-
21
- return (
22
- <DropdownMenuItem
23
- onClick={() => navigate(resolveRoute(apiDocsRoutes.routes.docs))}
24
- icon={<FileCode2 className="h-4 w-4" />}
25
- >
26
- API Documentation
27
- </DropdownMenuItem>
28
- );
29
- }