@devframes/plugin-git 0.9.8 → 0.9.10
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/README.md +12 -12
- package/bin.mjs +2 -2
- package/dist/{cli.mjs → node/cli.mjs} +2 -2
- package/dist/{index.d.mts → node/index.d.mts} +2 -2
- package/dist/node/index.mjs +2 -0
- package/dist/{src-Dt5wS6qp.mjs → node-CSvNBV8w.mjs} +20 -2
- package/package.json +12 -11
- package/dist/index.mjs +0 -2
- /package/dist/{cli.d.mts → node/cli.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
> This devframe is experimental and may change without a major version bump until
|
|
5
5
|
> it stabilizes.
|
|
6
6
|
|
|
7
|
-
A git devframe built on [devframe](https://github.com/devframes/devframe)
|
|
7
|
+
A git devframe built on [devframe](https://github.com/devframes/devframe): a
|
|
8
8
|
repository dashboard with a **Next.js App Router + shadcn/ui** SPA over
|
|
9
9
|
type-safe RPC. The node side shells out to `git` and exposes the repository;
|
|
10
10
|
the same bundle runs as a live dev server or a fully static deployment.
|
|
11
11
|
|
|
12
12
|
Status, a SourceTree-style **commit graph**, branches, and diffs, plus staging,
|
|
13
|
-
unstaging, and committing
|
|
13
|
+
unstaging, and committing, all through the shared
|
|
14
14
|
[`@devframes/service-git`](../../services/git) wire service. The UI follows the
|
|
15
15
|
system **light/dark** preference with a manual toggle.
|
|
16
16
|
|
|
@@ -59,21 +59,21 @@ repository; the definition opts them into the static build via `rpc.snapshot`
|
|
|
59
59
|
(resolved live over WebSocket in dev, served from a build-time snapshot for
|
|
60
60
|
static deploys).
|
|
61
61
|
|
|
62
|
-
- `devframes:service:git:status
|
|
62
|
+
- `devframes:service:git:status`: branch, upstream tracking (ahead/behind), staged / unstaged /
|
|
63
63
|
untracked files, parsed from `git status --porcelain=v2`.
|
|
64
|
-
- `devframes:service:git:log
|
|
64
|
+
- `devframes:service:git:log`: paginated commit history (`limit` / `skip`) including parent
|
|
65
65
|
hashes, which drive the commit graph.
|
|
66
|
-
- `devframes:service:git:branches
|
|
67
|
-
- `devframes:service:git:diff
|
|
66
|
+
- `devframes:service:git:branches`: local branches with SHA, upstream, ahead/behind, tip subject.
|
|
67
|
+
- `devframes:service:git:diff`: per-file added/deleted counts for the working tree or index, plus
|
|
68
68
|
a unified patch for a selected file.
|
|
69
69
|
|
|
70
|
-
Write actions are `action` functions
|
|
70
|
+
Write actions are `action` functions, always exposed by the service, with
|
|
71
71
|
write authorization governed by the connection-trust boundary. Each
|
|
72
72
|
returns fresh status (commit returns a result):
|
|
73
73
|
|
|
74
|
-
- `devframes:service:git:stage
|
|
75
|
-
- `devframes:service:git:unstage
|
|
76
|
-
- `devframes:service:git:commit
|
|
74
|
+
- `devframes:service:git:stage`: `git add` the given paths.
|
|
75
|
+
- `devframes:service:git:unstage`: `git restore --staged` the given paths.
|
|
76
|
+
- `devframes:service:git:commit`: commit the staged changes with a message.
|
|
77
77
|
|
|
78
78
|
## Develop
|
|
79
79
|
|
|
@@ -83,14 +83,14 @@ pnpm -C plugins/git build # tsdown (node) + next build (SPA) → dist/
|
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
`pnpm dev` starts the Next.js dev server (with hot-reload) and the devframe
|
|
86
|
-
RPC/WebSocket backend at the same time, then prints both URLs
|
|
86
|
+
RPC/WebSocket backend at the same time, then prints both URLs; open the UI one.
|
|
87
87
|
The SPA connects to the backend over the WebSocket port carried in
|
|
88
88
|
`NEXT_PUBLIC_DEVFRAME_WS`. Override ports with `PORT` (UI) and
|
|
89
89
|
`DEVFRAME_GIT_PORT` (backend). Run a single side with `dev:client` or
|
|
90
90
|
`dev:server`.
|
|
91
91
|
|
|
92
92
|
The SPA is a standard shadcn/ui setup (Tailwind v4, `components/ui/*`). Three
|
|
93
|
-
Next.js settings in `
|
|
93
|
+
Next.js settings in `app/next.config.mjs` keep it portable: `output:
|
|
94
94
|
'export'` (devframe owns the server), `assetPrefix: '.'` (relative assets so the
|
|
95
95
|
same bundle works at any base), and `trailingSlash: true` (composes with
|
|
96
96
|
devframe's static directory-with-index resolution).
|
package/bin.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Thin launcher for the published package
|
|
3
|
-
import './dist/cli.mjs'
|
|
2
|
+
// Thin launcher for the published package; runs the compiled CLI entry.
|
|
3
|
+
import './dist/node/cli.mjs'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createGitDevframe } from "
|
|
1
|
+
import { t as createGitDevframe } from "../node-CSvNBV8w.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { createCac } from "devframe/adapters/cac";
|
|
4
|
-
//#region src/cli.ts
|
|
4
|
+
//#region src/node/cli.ts
|
|
5
5
|
createCac(createGitDevframe(), { onReady({ origin }) {
|
|
6
6
|
console.error(`\n @devframes/plugin-git ready at ${origin}\n`);
|
|
7
7
|
} }).parse().catch((error) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DevframeDefinition } from "devframe";
|
|
2
|
-
//#region src/index.d.ts
|
|
2
|
+
//#region src/node/index.d.ts
|
|
3
3
|
interface GitDevframeOptions {
|
|
4
4
|
/** Repository directory to inspect. Defaults to the devframe `cwd`. */
|
|
5
5
|
repoRoot?: string;
|
|
@@ -14,7 +14,7 @@ interface GitDevframeOptions {
|
|
|
14
14
|
port?: number;
|
|
15
15
|
/**
|
|
16
16
|
* Require the trust handshake on the standalone server. Enabled by
|
|
17
|
-
* default
|
|
17
|
+
* default; `--open` embeds the current OTP in the opened URL, so the
|
|
18
18
|
* tab authenticates automatically without extra prompts. Hosted adapters
|
|
19
19
|
* manage their own auth and ignore this.
|
|
20
20
|
*/
|
|
@@ -3,11 +3,11 @@ import { defineDevframe } from "devframe";
|
|
|
3
3
|
import { resolve } from "pathe";
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@devframes/plugin-git";
|
|
6
|
-
var version = "0.9.
|
|
6
|
+
var version = "0.9.10";
|
|
7
7
|
var description = "Devframe plugin that shows a Git dashboard for status, log, branches, and diffs.";
|
|
8
8
|
var homepage = "https://github.com/devframes/devframe#readme";
|
|
9
9
|
//#endregion
|
|
10
|
-
//#region src/index.ts
|
|
10
|
+
//#region src/node/index.ts
|
|
11
11
|
const remoteAssets = {
|
|
12
12
|
package: `${name}--assets`,
|
|
13
13
|
version
|
|
@@ -40,12 +40,30 @@ function createGitDevframe(options = {}) {
|
|
|
40
40
|
command: "devframe-git",
|
|
41
41
|
port: options.port ?? 9710,
|
|
42
42
|
distDir,
|
|
43
|
+
/**
|
|
44
|
+
* Gate the standalone server by default; `maybeOpenBrowser` folds the
|
|
45
|
+
* current OTP into the `--open` URL so the tab lands already trusted.
|
|
46
|
+
*/
|
|
43
47
|
auth: options.auth ?? true
|
|
44
48
|
},
|
|
49
|
+
/**
|
|
50
|
+
* Declared, not imperatively installed: devframe constructs each (merging
|
|
51
|
+
* options across every declarer) before setup. `service-git` backs every
|
|
52
|
+
* panel; the SPA calls it directly. `service-shiki` highlights diff patches
|
|
53
|
+
* via its `codeToTokens`; when a host doesn't advertise it, the client
|
|
54
|
+
* falls back to a plain, un-highlighted diff.
|
|
55
|
+
*/
|
|
45
56
|
services: [{
|
|
46
57
|
package: GIT_SERVICE,
|
|
47
58
|
...cwd ? { options: { cwd } } : {}
|
|
48
59
|
}, { package: "@devframes/service-shiki" }],
|
|
60
|
+
/**
|
|
61
|
+
* Bake repo state into the static build. The service defines no dump of
|
|
62
|
+
* its own, so the read ops are opted in here: status/branches/diff bake
|
|
63
|
+
* their no-arg call; log bakes the 200-commit head; show bakes one
|
|
64
|
+
* (patch-less) record per commit, enumerated at build time via the
|
|
65
|
+
* service's node API.
|
|
66
|
+
*/
|
|
49
67
|
rpc: { snapshot: [
|
|
50
68
|
"devframes:service:git:status",
|
|
51
69
|
"devframes:service:git:branches",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/plugin-git",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.10",
|
|
5
5
|
"description": "Devframe plugin that shows a Git dashboard for status, log, branches, and diffs.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"exports": {
|
|
24
|
-
".": "./dist/index.mjs",
|
|
24
|
+
".": "./dist/node/index.mjs",
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
|
-
"types": "./dist/index.d.mts",
|
|
27
|
+
"types": "./dist/node/index.d.mts",
|
|
28
28
|
"bin": {
|
|
29
29
|
"devframe-git": "./bin.mjs"
|
|
30
30
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@devframes/plugin-git--assets": "0.9.
|
|
36
|
+
"@devframes/plugin-git--assets": "0.9.10"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@devframes/plugin-git--assets": {
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@devframes/service-git": "0.9.
|
|
45
|
-
"@devframes/service-shiki": "0.9.
|
|
44
|
+
"@devframes/service-git": "0.9.10",
|
|
45
|
+
"@devframes/service-shiki": "0.9.10",
|
|
46
46
|
"cac": "^7.0.0",
|
|
47
|
-
"devframe": "0.9.
|
|
47
|
+
"devframe": "0.9.10",
|
|
48
48
|
"pathe": "^2.0.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@antfu/design": "^0.4.0",
|
|
52
|
-
"@devframes/plugin-git--assets": "0.9.
|
|
52
|
+
"@devframes/plugin-git--assets": "0.9.10",
|
|
53
53
|
"@floating-ui/react": "^0.27.20",
|
|
54
54
|
"@iconify-json/catppuccin": "^1.2.17",
|
|
55
55
|
"@radix-ui/react-scroll-area": "^1.2.18",
|
|
@@ -78,11 +78,12 @@
|
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|
|
80
80
|
"build": "tsdown && pnpm run build:spa",
|
|
81
|
-
"build:spa": "next build
|
|
81
|
+
"build:spa": "next build app && node scripts/build-spa.mjs",
|
|
82
82
|
"cli:build": "node bin.mjs build --out-dir dist/static",
|
|
83
83
|
"dev": "node scripts/dev.mjs",
|
|
84
|
-
"dev:server": "node src/cli.ts",
|
|
85
|
-
"dev:client": "next dev
|
|
84
|
+
"dev:server": "node src/node/cli.ts",
|
|
85
|
+
"dev:client": "next dev app",
|
|
86
|
+
"play": "pnpm run build && node playgrounds/server.mjs",
|
|
86
87
|
"storybook": "storybook dev -p 6011",
|
|
87
88
|
"storybook:build": "storybook build -o storybook-static",
|
|
88
89
|
"watch": "tsdown --watch",
|
package/dist/index.mjs
DELETED
|
File without changes
|