@overkube/web 0.1.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 the overkube contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @overkube/web
2
+
3
+ overkube's page: what the browser runs. Started in order ([src/boot.ts](src/boot.ts)): signed in as its server says one signs in here (`GET /auth`; [src/session.tsx](src/session.tsx): not signed in, the sign-in screen alone); the connector to the gateway at `/kube` ([@overkube/connector](../../packages/connector/README.md)) and the source answering queries over it ([@overkube/source](../../packages/source/README.md)); overweave's registry of the dashboard's kinds ([@overkube/sdk](../../packages/sdk/README.md)); the user's changes read back ([@overkube/shell](../../packages/shell/README.md)'s `UserService`, in localStorage); the addons run in it ([src/host](src/host): their lifecycle — requirements, retries, `?safe` runs the core alone); the shell drawn into `#app` (`?debug`: the slots over it). The addons in its bundle: [src/addons.ts](src/addons.ts) — the [core](../../addons/core/README.md), [metrics](../../addons/metrics/README.md), [cert-manager](../../addons/cert-manager/README.md), [trivy](../../addons/trivy/README.md), [helm](../../addons/helm/README.md), [flux](../../addons/flux/README.md).
4
+
5
+ ```bash
6
+ npm run dev -w @overkube/web # Vite, with /kube and /auth passed to OVERKUBE_SERVER (http://127.0.0.1:8080)
7
+ npm run build -w @overkube/web # dist/: what the server serves as OVERKUBE_UI
8
+ ```
9
+
10
+ The dev stand (`make dev`) runs the first at [http://localhost:5173](http://localhost:5173); the image copies the second to `/app/ui`. [vite.config.ts](vite.config.ts) reads the workspace's packages and overweave from their sources (the `overkube-source` and `overweave-source` conditions), one Preact.
11
+
12
+ For a host that draws the page into a page of its own (a platform's plugin), it is published as a library, `@overkube/web` ([src/index.ts](src/index.ts)): `boot({ element, asked, gateway, headers, signIn: false, addons })` — its gateway where the host serves it, the host's headers on every request (a CSRF token), no `/auth` asked (the host has signed the user in), the host's own addons beside the page's; it answers the registry and `close()`. Its own packages (the addons, the shell, the runtime, the source, the connector) are bundled in; those a host's addons are written with — `@overkube/sdk`, `@overkube/uikit`, `@overkube/kube-types`, `@overkube/query`, `@overkube/gateway`, overweave, Preact — are dependencies, one of each in the host's bundle. `@overkube/web/styles` is the page around it (the fonts, [src/page.css](src/page.css)), for the host's bundler.
13
+
14
+ ```ts
15
+ import { boot } from '@overkube/web';
16
+ import '@overkube/web/styles';
17
+
18
+ const page = await boot({ element, asked: new URLSearchParams(location.search), gateway: '/plugins/overkube/kube', signIn: false });
19
+ ```
20
+
21
+ ```bash
22
+ npm run build:lib -w @overkube/web # lib/: the library (vite.lib.config.ts), its types
23
+ ```
package/lib/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import type { KubeKinds } from '@overkube/sdk';
2
+ import type { KindsByName, Registry } from '@overweave/core';
3
+ import type { BootOptions } from './options.ts';
4
+ /**
5
+ * overkube's page, for a host that draws it into a page of its own (a
6
+ * platform's plugin): boot it into an element, with its gateway where the
7
+ * host serves it. Its addons are those of addons.ts — and the host's own,
8
+ * given to boot (BootOptions.addons). Published as @overkube/web: its
9
+ * own packages bundled in, those a host's addons are written with (the
10
+ * SDK, the kit, overweave, Preact) the host's, one of each. The page
11
+ * around it: @overkube/web/styles (the fonts, page.css), if the host
12
+ * wants it.
13
+ */
14
+ export type { BootOptions };
15
+ /** The page started: the registry of its kinds, and its end (a host's page left). */
16
+ export interface Booted {
17
+ registry: Registry<KindsByName<KubeKinds>>;
18
+ close(): void;
19
+ }
20
+ /** The page started into its element; none (the sign-in screen in its place, or the server not answering): undefined. */
21
+ export declare function boot(options: BootOptions): Promise<Booted | undefined>;