tinytsdk 0.2.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.
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Dashboard } from '../react/dashboard/Dashboard.js';
3
+ declare const meta: Meta<typeof Dashboard>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Dashboard>;
6
+ export declare const Compact: Story;
7
+ export declare const Expanded: Story;
8
+ export declare const HighLoad: Story;
9
+ export declare const Static: Story;
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { MetricsBar } from '../react/MetricsBar.js';
3
+ declare const meta: Meta<typeof MetricsBar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MetricsBar>;
6
+ export declare const Default: Story;
7
+ export declare const Compact: Story;
8
+ export declare const NoDisk: Story;
9
+ export declare const NoNet: Story;
10
+ export declare const MinimalMobile: Story;
11
+ export declare const HighLoad: Story;
12
+ export declare const Static: Story;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { MetricsPanel } from '../react/MetricsPanel.js';
3
+ declare const meta: Meta<typeof MetricsPanel>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MetricsPanel>;
6
+ export declare const Default: Story;
7
+ export declare const HighLoad: Story;
8
+ export declare const Static: Story;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * MockTinyTrackProvider — injects animated mock metrics into TinyTrackContext.
3
+ * Used exclusively in Storybook stories. No WebSocket connection is made.
4
+ */
5
+ import { ReactNode } from 'react';
6
+ import { useMetrics } from '../react/TinyTrackProvider.js';
7
+ import { TtMetrics } from '../client.js';
8
+ export { useMetrics };
9
+ export interface MockProviderProps {
10
+ children: ReactNode;
11
+ animate?: boolean;
12
+ overrides?: Partial<TtMetrics>;
13
+ /** Pre-fill history buffer with N samples (for Timeline stories) */
14
+ historySize?: number;
15
+ }
16
+ /**
17
+ * Wraps children in the real TinyTrackContext with mock data.
18
+ * Components using useMetrics() / useTinyTrack() work without changes.
19
+ */
20
+ export declare function MockTinyTrackProvider({ children, animate, overrides, historySize }: MockProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { TimeSeriesChart } from '../react/dashboard/TimeSeriesChart.js';
3
+ declare const meta: Meta<typeof TimeSeriesChart>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof TimeSeriesChart>;
6
+ export declare const CPU: Story;
7
+ export declare const Memory: Story;
8
+ export declare const Network: Story;
9
+ export declare const Load: Story;
10
+ export declare const Disk: Story;
11
+ export declare const DiskL2: Story;
12
+ export declare const AllMetrics: Story;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Timeline } from '../react/dashboard/Timeline.js';
3
+ declare const meta: Meta<typeof Timeline>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Timeline>;
6
+ export declare const CPU: Story;
7
+ export declare const Memory: Story;
8
+ export declare const Network: Story;
9
+ export declare const Disk: Story;
10
+ export declare const Load: Story;
11
+ export declare const TallRows: Story;
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "tinytsdk",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "description": "TinyTrack SDK — WebSocket client + React components for system metrics",
6
+ "main": "dist/index.cjs.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.cjs.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./react": {
16
+ "import": "./dist/react.esm.js",
17
+ "require": "./dist/react.cjs.js",
18
+ "types": "./dist/react/index.d.ts"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "npm run build:types && rollup -c",
26
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
27
+ "test": "vitest run",
28
+ "test:watch": "vitest",
29
+ "lint": "eslint src",
30
+ "storybook": "storybook dev -p 6006",
31
+ "build-storybook": "storybook build -o storybook-static"
32
+ },
33
+ "peerDependencies": {
34
+ "react": ">=18.0.0",
35
+ "react-dom": ">=18.0.0"
36
+ },
37
+ "peerDependenciesMeta": {
38
+ "react": {
39
+ "optional": true
40
+ },
41
+ "react-dom": {
42
+ "optional": true
43
+ }
44
+ },
45
+ "devDependencies": {
46
+ "@rollup/plugin-node-resolve": "^15.3.1",
47
+ "@rollup/plugin-typescript": "^11.1.6",
48
+ "@storybook/addon-essentials": "^8.6.14",
49
+ "@storybook/react": "^8.6.18",
50
+ "@storybook/react-vite": "^8.6.18",
51
+ "@types/react": "^18.3.28",
52
+ "@vitejs/plugin-react": "^4.7.0",
53
+ "@vitest/coverage-v8": "^4.1.2",
54
+ "jsdom": "^29.0.1",
55
+ "react": "^18.3.1",
56
+ "react-dom": "^18.3.1",
57
+ "rollup": "^4.60.1",
58
+ "storybook": "^8.6.18",
59
+ "tslib": "^2.8.1",
60
+ "typescript": "^5.9.3",
61
+ "vite": "^6.4.1",
62
+ "vitest": "^4.1.2"
63
+ },
64
+ "keywords": [
65
+ "tinytrack",
66
+ "metrics",
67
+ "monitoring",
68
+ "websocket",
69
+ "react"
70
+ ],
71
+ "license": "MIT",
72
+ "repository": {
73
+ "type": "git",
74
+ "url": "https://github.com/jetallavache/tiny-track"
75
+ }
76
+ }