@epic-web/workshop-utils 6.48.3 → 6.49.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/dist/git.server.d.ts +24 -0
- package/dist/git.server.js +3 -1
- package/package.json +1 -1
package/dist/git.server.d.ts
CHANGED
|
@@ -2,29 +2,39 @@ import "./init-env.js";
|
|
|
2
2
|
export declare function checkForUpdates(): Promise<{
|
|
3
3
|
readonly updatesAvailable: false;
|
|
4
4
|
readonly message: "The app is deployed";
|
|
5
|
+
readonly commitsAhead?: undefined;
|
|
6
|
+
readonly commitsBehind?: undefined;
|
|
5
7
|
readonly localCommit?: undefined;
|
|
6
8
|
readonly remoteCommit?: undefined;
|
|
7
9
|
readonly diffLink?: undefined;
|
|
8
10
|
} | {
|
|
9
11
|
readonly updatesAvailable: false;
|
|
10
12
|
readonly message: "You are offline";
|
|
13
|
+
readonly commitsAhead?: undefined;
|
|
14
|
+
readonly commitsBehind?: undefined;
|
|
11
15
|
readonly localCommit?: undefined;
|
|
12
16
|
readonly remoteCommit?: undefined;
|
|
13
17
|
readonly diffLink?: undefined;
|
|
14
18
|
} | {
|
|
15
19
|
readonly updatesAvailable: false;
|
|
16
20
|
readonly message: "Not in a git repo";
|
|
21
|
+
readonly commitsAhead?: undefined;
|
|
22
|
+
readonly commitsBehind?: undefined;
|
|
17
23
|
readonly localCommit?: undefined;
|
|
18
24
|
readonly remoteCommit?: undefined;
|
|
19
25
|
readonly diffLink?: undefined;
|
|
20
26
|
} | {
|
|
21
27
|
readonly updatesAvailable: false;
|
|
22
28
|
readonly message: "Cannot find remote";
|
|
29
|
+
readonly commitsAhead?: undefined;
|
|
30
|
+
readonly commitsBehind?: undefined;
|
|
23
31
|
readonly localCommit?: undefined;
|
|
24
32
|
readonly remoteCommit?: undefined;
|
|
25
33
|
readonly diffLink?: undefined;
|
|
26
34
|
} | {
|
|
27
35
|
readonly updatesAvailable: boolean;
|
|
36
|
+
readonly commitsAhead: number;
|
|
37
|
+
readonly commitsBehind: number;
|
|
28
38
|
readonly localCommit: string;
|
|
29
39
|
readonly remoteCommit: string;
|
|
30
40
|
readonly diffLink: string | null;
|
|
@@ -35,33 +45,45 @@ export declare function checkForUpdates(): Promise<{
|
|
|
35
45
|
readonly remoteCommit: string | undefined;
|
|
36
46
|
readonly diffLink: string | null;
|
|
37
47
|
readonly message?: undefined;
|
|
48
|
+
readonly commitsAhead?: undefined;
|
|
49
|
+
readonly commitsBehind?: undefined;
|
|
38
50
|
}>;
|
|
39
51
|
export declare function checkForUpdatesCached(): Promise<{
|
|
40
52
|
readonly updatesAvailable: false;
|
|
41
53
|
readonly message: "The app is deployed";
|
|
54
|
+
readonly commitsAhead?: undefined;
|
|
55
|
+
readonly commitsBehind?: undefined;
|
|
42
56
|
readonly localCommit?: undefined;
|
|
43
57
|
readonly remoteCommit?: undefined;
|
|
44
58
|
readonly diffLink?: undefined;
|
|
45
59
|
} | {
|
|
46
60
|
readonly updatesAvailable: false;
|
|
47
61
|
readonly message: "You are offline";
|
|
62
|
+
readonly commitsAhead?: undefined;
|
|
63
|
+
readonly commitsBehind?: undefined;
|
|
48
64
|
readonly localCommit?: undefined;
|
|
49
65
|
readonly remoteCommit?: undefined;
|
|
50
66
|
readonly diffLink?: undefined;
|
|
51
67
|
} | {
|
|
52
68
|
readonly updatesAvailable: false;
|
|
53
69
|
readonly message: "Not in a git repo";
|
|
70
|
+
readonly commitsAhead?: undefined;
|
|
71
|
+
readonly commitsBehind?: undefined;
|
|
54
72
|
readonly localCommit?: undefined;
|
|
55
73
|
readonly remoteCommit?: undefined;
|
|
56
74
|
readonly diffLink?: undefined;
|
|
57
75
|
} | {
|
|
58
76
|
readonly updatesAvailable: false;
|
|
59
77
|
readonly message: "Cannot find remote";
|
|
78
|
+
readonly commitsAhead?: undefined;
|
|
79
|
+
readonly commitsBehind?: undefined;
|
|
60
80
|
readonly localCommit?: undefined;
|
|
61
81
|
readonly remoteCommit?: undefined;
|
|
62
82
|
readonly diffLink?: undefined;
|
|
63
83
|
} | {
|
|
64
84
|
readonly updatesAvailable: boolean;
|
|
85
|
+
readonly commitsAhead: number;
|
|
86
|
+
readonly commitsBehind: number;
|
|
65
87
|
readonly localCommit: string;
|
|
66
88
|
readonly remoteCommit: string;
|
|
67
89
|
readonly diffLink: string | null;
|
|
@@ -72,6 +94,8 @@ export declare function checkForUpdatesCached(): Promise<{
|
|
|
72
94
|
readonly remoteCommit: string | undefined;
|
|
73
95
|
readonly diffLink: string | null;
|
|
74
96
|
readonly message?: undefined;
|
|
97
|
+
readonly commitsAhead?: undefined;
|
|
98
|
+
readonly commitsBehind?: undefined;
|
|
75
99
|
} | {
|
|
76
100
|
readonly updatesAvailable: false;
|
|
77
101
|
}>;
|
package/dist/git.server.js
CHANGED
|
@@ -89,10 +89,12 @@ export async function checkForUpdates() {
|
|
|
89
89
|
cwd,
|
|
90
90
|
})).stdout.trim();
|
|
91
91
|
const { stdout } = await execa('git', ['rev-list', '--count', '--left-right', 'HEAD...@{upstream}'], { cwd });
|
|
92
|
-
const [, behind = 0] = stdout.trim().split(/\s+/).map(Number);
|
|
92
|
+
const [ahead = 0, behind = 0] = stdout.trim().split(/\s+/).map(Number);
|
|
93
93
|
const updatesAvailable = behind > 0;
|
|
94
94
|
return {
|
|
95
95
|
updatesAvailable,
|
|
96
|
+
commitsAhead: ahead,
|
|
97
|
+
commitsBehind: behind,
|
|
96
98
|
localCommit,
|
|
97
99
|
remoteCommit,
|
|
98
100
|
diffLink: await getDiffUrl(localCommit, remoteCommit),
|