@industry-theme/git-panels 0.1.1

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,192 @@
1
+ /**
2
+ * Panel Extension Type Definitions
3
+ *
4
+ * Re-exports core types from @principal-ade/panel-framework-core
5
+ * and defines git-specific slice types for this library.
6
+ */
7
+ export type { DataSlice, WorkspaceMetadata, RepositoryMetadata, FileTreeSource, ActiveFileSlice, PanelEventType, PanelEvent, PanelEventEmitter, PanelActions, PanelContextValue, PanelComponentProps, PanelMetadata, PanelLifecycleHooks, PanelDefinition, PanelModule, PanelRegistryEntry, PanelLoader, PanelRegistryConfig, PanelTool, PanelToolsMetadata, JsonSchema, PanelEventCallTemplate, } from '@principal-ade/panel-framework-core';
8
+ /**
9
+ * Information about a single git commit.
10
+ * Host should provide this data via the 'commits' slice.
11
+ */
12
+ export interface GitCommitInfo {
13
+ /** Full commit hash */
14
+ hash: string;
15
+ /** Commit message (may be multiline) */
16
+ message: string;
17
+ /** Author name */
18
+ author: string;
19
+ /** Author email */
20
+ authorEmail?: string;
21
+ /** ISO date string of when the commit was made */
22
+ date: string;
23
+ }
24
+ /**
25
+ * Data structure for the 'commits' slice.
26
+ */
27
+ export interface CommitsSliceData {
28
+ commits: GitCommitInfo[];
29
+ }
30
+ /**
31
+ * User information for PR author/assignee.
32
+ */
33
+ export interface PullRequestUser {
34
+ login: string;
35
+ avatar_url?: string;
36
+ html_url?: string;
37
+ }
38
+ /**
39
+ * Branch reference information.
40
+ */
41
+ export interface PullRequestRef {
42
+ ref: string;
43
+ sha?: string;
44
+ }
45
+ /**
46
+ * Information about a single pull request.
47
+ * Host should provide this data via the 'pullRequests' slice.
48
+ */
49
+ export interface PullRequestInfo {
50
+ /** Unique identifier */
51
+ id: number;
52
+ /** PR number (e.g., #42) */
53
+ number: number;
54
+ /** PR title */
55
+ title: string;
56
+ /** PR body/description */
57
+ body?: string | null;
58
+ /** State: 'open' or 'closed' */
59
+ state: 'open' | 'closed';
60
+ /** Whether this is a draft PR */
61
+ draft?: boolean;
62
+ /** URL to view the PR */
63
+ html_url: string;
64
+ /** PR author */
65
+ user?: PullRequestUser | null;
66
+ /** ISO date string when PR was created */
67
+ created_at: string;
68
+ /** ISO date string when PR was last updated */
69
+ updated_at: string;
70
+ /** ISO date string when PR was closed (null if open) */
71
+ closed_at?: string | null;
72
+ /** ISO date string when PR was merged (null if not merged) */
73
+ merged_at?: string | null;
74
+ /** Base branch (target) */
75
+ base?: PullRequestRef | null;
76
+ /** Head branch (source) */
77
+ head?: PullRequestRef | null;
78
+ /** Number of comments */
79
+ comments?: number;
80
+ /** Number of review comments */
81
+ review_comments?: number;
82
+ }
83
+ /**
84
+ * Data structure for the 'pullRequests' slice.
85
+ */
86
+ export interface PullRequestsSliceData {
87
+ pullRequests: PullRequestInfo[];
88
+ /** Repository owner (e.g., 'anthropics') */
89
+ owner?: string;
90
+ /** Repository name (e.g., 'claude-code') */
91
+ repo?: string;
92
+ }
93
+ /**
94
+ * A single git configuration entry.
95
+ */
96
+ export interface GitConfigEntry {
97
+ /** Configuration key (e.g., 'user.name', 'core.editor') */
98
+ key: string;
99
+ /** Configuration value */
100
+ value: string;
101
+ /** Scope where this config is defined */
102
+ scope: 'local' | 'global' | 'system';
103
+ }
104
+ /**
105
+ * Git remote configuration.
106
+ */
107
+ export interface GitRemoteInfo {
108
+ /** Remote name (e.g., 'origin', 'upstream') */
109
+ name: string;
110
+ /** Fetch URL */
111
+ fetchUrl: string;
112
+ /** Push URL (may differ from fetch) */
113
+ pushUrl?: string;
114
+ }
115
+ /**
116
+ * Git branch configuration.
117
+ */
118
+ export interface GitBranchConfig {
119
+ /** Branch name */
120
+ name: string;
121
+ /** Remote tracking branch */
122
+ remote?: string;
123
+ /** Merge reference */
124
+ merge?: string;
125
+ }
126
+ /**
127
+ * Data structure for the 'gitConfig' slice.
128
+ */
129
+ export interface GitConfigSliceData {
130
+ /** User configuration (name, email, etc.) */
131
+ user: {
132
+ name?: string;
133
+ email?: string;
134
+ signingKey?: string;
135
+ };
136
+ /** Core git settings */
137
+ core: {
138
+ editor?: string;
139
+ autocrlf?: string;
140
+ ignorecase?: boolean;
141
+ filemode?: boolean;
142
+ fsmonitor?: boolean | string;
143
+ untrackedCache?: boolean | string;
144
+ preloadIndex?: boolean;
145
+ fscache?: boolean;
146
+ symlinks?: boolean;
147
+ longpaths?: boolean;
148
+ };
149
+ /** Performance & optimization settings */
150
+ performance: {
151
+ /** Maintenance/gc settings */
152
+ gcAuto?: number | string;
153
+ gcAutoPackLimit?: number | string;
154
+ /** Pack settings */
155
+ packThreads?: number | string;
156
+ packWindowMemory?: string;
157
+ /** Feature flags */
158
+ featureManyFiles?: boolean;
159
+ featureExperimental?: boolean;
160
+ };
161
+ /** Fetch/pull/push settings */
162
+ transfer: {
163
+ fetchPrune?: boolean;
164
+ fetchPruneTag?: boolean;
165
+ pullRebase?: boolean | string;
166
+ pullFf?: string;
167
+ pushDefault?: string;
168
+ pushAutoSetupRemote?: boolean;
169
+ pushFollowTags?: boolean;
170
+ };
171
+ /** Merge and diff settings */
172
+ mergeDiff: {
173
+ mergeFf?: string;
174
+ mergeConflictStyle?: string;
175
+ diffAlgorithm?: string;
176
+ diffColorMoved?: string;
177
+ rerereEnabled?: boolean;
178
+ };
179
+ /** Commit settings */
180
+ commit: {
181
+ gpgSign?: boolean;
182
+ template?: string;
183
+ verbose?: boolean;
184
+ };
185
+ /** Configured remotes */
186
+ remotes: GitRemoteInfo[];
187
+ /** Branch configurations */
188
+ branches: GitBranchConfig[];
189
+ /** All raw config entries for detailed view */
190
+ allEntries: GitConfigEntry[];
191
+ }
192
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAEV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe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EAAE,MAAM,CAAC;QACrB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,8BAA8B;IAC9B,SAAS,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,sBAAsB;IACtB,MAAM,EAAE;QACN,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,yBAAyB;IACzB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,4BAA4B;IAC5B,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,+CAA+C;IAC/C,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Formatting utilities for git panels
3
+ */
4
+ /**
5
+ * Format a date string as relative time (e.g., "2 hours ago")
6
+ */
7
+ export declare function formatRelativeTime(dateStr: string | undefined): string;
8
+ /**
9
+ * Format a date string with more context (Today, Yesterday, X days ago, etc.)
10
+ */
11
+ export declare function formatDate(dateString: string | null): string;
12
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAoBtE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAiB5D"}
@@ -0,0 +1,2 @@
1
+ export { formatRelativeTime, formatDate } from './formatters';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "@industry-theme/git-panels",
3
+ "version": "0.1.1",
4
+ "description": "Git commit history and pull request panels for the panel framework",
5
+ "type": "module",
6
+ "main": "dist/panels.bundle.js",
7
+ "module": "dist/panels.bundle.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/panels.bundle.js",
13
+ "require": "./dist/panels.bundle.js",
14
+ "default": "./dist/panels.bundle.js"
15
+ },
16
+ "./tools": {
17
+ "types": "./dist/tools/index.d.ts",
18
+ "import": "./dist/tools.bundle.js",
19
+ "require": "./dist/tools.bundle.js",
20
+ "default": "./dist/tools.bundle.js"
21
+ }
22
+ },
23
+ "keywords": [
24
+ "panel-extension"
25
+ ],
26
+ "author": "Industry Theme",
27
+ "license": "MIT",
28
+ "scripts": {
29
+ "build": "bun run clean && bun run build:panel && bun run build:tools && bun run build:types",
30
+ "build:panel": "vite build",
31
+ "build:tools": "bun build ./src/tools/index.ts --outfile ./dist/tools.bundle.js --format esm --target browser",
32
+ "build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
33
+ "dev": "vite build --watch",
34
+ "clean": "rm -rf dist",
35
+ "typecheck": "tsc --noEmit",
36
+ "lint": "eslint . --ext .ts,.tsx",
37
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
38
+ "format": "prettier --write .",
39
+ "format:check": "prettier --check .",
40
+ "test": "bun test",
41
+ "test:watch": "bun test --watch",
42
+ "storybook": "storybook dev -p 6006",
43
+ "build-storybook": "storybook build"
44
+ },
45
+ "peerDependencies": {
46
+ "react": ">=19.0.0",
47
+ "react-dom": ">=19.0.0"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "@principal-ade/panel-framework-core": {
51
+ "optional": true
52
+ }
53
+ },
54
+ "dependencies": {
55
+ "@principal-ade/industry-theme": "^0.1.3",
56
+ "@principal-ade/panel-framework-core": "^0.1.5",
57
+ "@principal-ade/utcp-panel-event": "^0.1.0",
58
+ "clsx": "^2.1.1",
59
+ "lucide-react": "^0.552.0"
60
+ },
61
+ "devDependencies": {
62
+ "@chromatic-com/storybook": "^4.1.3",
63
+ "@eslint/js": "^9.32.0",
64
+ "@storybook/addon-docs": "10.1.2",
65
+ "@storybook/addon-links": "10.1.2",
66
+ "@storybook/addon-onboarding": "10.1.2",
67
+ "@storybook/react-vite": "10.1.2",
68
+ "@types/bun": "latest",
69
+ "@types/node": "^22.15.26",
70
+ "@types/react": "^19.0.0",
71
+ "@types/react-dom": "^19.0.0",
72
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
73
+ "@typescript-eslint/parser": "^8.38.0",
74
+ "@vitejs/plugin-react": "^4.3.4",
75
+ "esbuild": "^0.25.8",
76
+ "eslint": "^9.32.0",
77
+ "eslint-config-prettier": "^10.1.8",
78
+ "eslint-plugin-react": "^7.37.2",
79
+ "eslint-plugin-react-hooks": "^5.0.0",
80
+ "eslint-plugin-storybook": "10.1.2",
81
+ "prettier": "^3.6.2",
82
+ "react": "^19.0.0",
83
+ "react-dom": "^19.0.0",
84
+ "storybook": "10.1.2",
85
+ "typescript": "^5.0.4",
86
+ "typescript-eslint": "^8.38.0",
87
+ "vite": "^6.0.7"
88
+ },
89
+ "files": [
90
+ "dist",
91
+ "README.md",
92
+ "LICENSE"
93
+ ],
94
+ "repository": {
95
+ "type": "git",
96
+ "url": "git+https://github.com/your-org/panel-starter.git"
97
+ }
98
+ }