gitxelectron 1.1.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/README.md +84 -0
- package/bin/cli.js +213 -0
- package/bin/postinstall.js +57 -0
- package/bin/preuninstall.js +22 -0
- package/out/main/index.js +1450 -0
- package/out/preload/index.js +90 -0
- package/out/renderer/assets/index-BFPlchlf.js +26371 -0
- package/out/renderer/assets/index-DsltCz9R.css +56 -0
- package/out/renderer/assets/logo-5889zCqp.png +0 -0
- package/out/renderer/index.html +31 -0
- package/package.json +72 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const electron = require("electron");
|
|
3
|
+
const preload = require("@electron-toolkit/preload");
|
|
4
|
+
const api = {
|
|
5
|
+
getCliRepo: () => electron.ipcRenderer.invoke("get-cli-repo"),
|
|
6
|
+
onSetCliRepo: (callback) => {
|
|
7
|
+
electron.ipcRenderer.on("set-cli-repo", (_event, repoPath) => callback(repoPath));
|
|
8
|
+
},
|
|
9
|
+
selectDirectory: () => electron.ipcRenderer.invoke("select-directory"),
|
|
10
|
+
setRepoPath: (path) => electron.ipcRenderer.invoke("set-repo-path", path),
|
|
11
|
+
initRepo: (path) => electron.ipcRenderer.invoke("init-repo", path),
|
|
12
|
+
getStatus: () => electron.ipcRenderer.invoke("get-status"),
|
|
13
|
+
stageFiles: (files) => electron.ipcRenderer.invoke("stage-files", files),
|
|
14
|
+
unstageFiles: (files) => electron.ipcRenderer.invoke("unstage-files", files),
|
|
15
|
+
commitChanges: (message) => electron.ipcRenderer.invoke("commit-changes", message),
|
|
16
|
+
pushToRemote: (remote, branch) => electron.ipcRenderer.invoke("push-to-remote", remote, branch),
|
|
17
|
+
pullFromRemote: (remote, branch) => electron.ipcRenderer.invoke("pull-from-remote", remote, branch),
|
|
18
|
+
resetToRemote: (remote, branch) => electron.ipcRenderer.invoke("reset-to-remote", remote, branch),
|
|
19
|
+
fetchRemote: () => electron.ipcRenderer.invoke("fetch-remote"),
|
|
20
|
+
getBranches: () => electron.ipcRenderer.invoke("get-branches"),
|
|
21
|
+
checkoutBranch: (branch) => electron.ipcRenderer.invoke("checkout-branch", branch),
|
|
22
|
+
createBranch: (branch, baseBranch) => electron.ipcRenderer.invoke("create-branch", branch, baseBranch),
|
|
23
|
+
getCommitHistory: () => electron.ipcRenderer.invoke("get-commit-history"),
|
|
24
|
+
getDeletedHistory: () => electron.ipcRenderer.invoke("get-deleted-history"),
|
|
25
|
+
getAuthStatus: () => electron.ipcRenderer.invoke("get-auth-status"),
|
|
26
|
+
startDeviceFlow: () => electron.ipcRenderer.invoke("start-device-flow"),
|
|
27
|
+
pollDeviceFlow: (deviceCode, interval) => electron.ipcRenderer.invoke("poll-device-flow", deviceCode, interval),
|
|
28
|
+
logoutGithub: () => electron.ipcRenderer.invoke("logout-github"),
|
|
29
|
+
verifyPushPermission: (remoteUrl) => electron.ipcRenderer.invoke("verify-push-permission", remoteUrl),
|
|
30
|
+
getRemotes: () => electron.ipcRenderer.invoke("get-remotes"),
|
|
31
|
+
getFileDiff: (file, staged = false) => electron.ipcRenderer.invoke("get-file-diff", file, staged),
|
|
32
|
+
getGitConfig: (key, global = false) => electron.ipcRenderer.invoke("get-git-config", key, global),
|
|
33
|
+
setGitConfig: (key, value, global = false) => electron.ipcRenderer.invoke("set-git-config", key, value, global),
|
|
34
|
+
readFile: (file) => electron.ipcRenderer.invoke("read-file", file),
|
|
35
|
+
writeFile: (file, content) => electron.ipcRenderer.invoke("write-file", file, content),
|
|
36
|
+
// NEW: Multi-Account & Window
|
|
37
|
+
newWindow: () => electron.ipcRenderer.invoke("new-window"),
|
|
38
|
+
getAccounts: () => electron.ipcRenderer.invoke("get-accounts"),
|
|
39
|
+
switchAccount: (accountId) => electron.ipcRenderer.invoke("switch-account", accountId),
|
|
40
|
+
removeAccount: (accountId) => electron.ipcRenderer.invoke("remove-account", accountId),
|
|
41
|
+
getUserRepositories: () => electron.ipcRenderer.invoke("get-user-repositories"),
|
|
42
|
+
createGitHubRepository: (name, description, isPrivate, autoInit = false, gitignoreTemplate = "", licenseTemplate = "") => electron.ipcRenderer.invoke(
|
|
43
|
+
"create-github-repository",
|
|
44
|
+
name,
|
|
45
|
+
description,
|
|
46
|
+
isPrivate,
|
|
47
|
+
autoInit,
|
|
48
|
+
gitignoreTemplate,
|
|
49
|
+
licenseTemplate
|
|
50
|
+
),
|
|
51
|
+
addRemote: (name, url) => electron.ipcRenderer.invoke("add-remote", name, url),
|
|
52
|
+
pushAllBranches: (remote) => electron.ipcRenderer.invoke("push-all-branches", remote),
|
|
53
|
+
openExternal: (url) => electron.ipcRenderer.invoke("open-external", url),
|
|
54
|
+
compareExternalFile: (sourcePath, repoRelativePath) => electron.ipcRenderer.invoke("compare-external-file", sourcePath, repoRelativePath),
|
|
55
|
+
copyExternalFiles: (files, destinationDir) => electron.ipcRenderer.invoke("copy-external-files", files, destinationDir),
|
|
56
|
+
getCollaborators: (remoteUrl) => electron.ipcRenderer.invoke("get-collaborators", remoteUrl),
|
|
57
|
+
addCollaborator: (remoteUrl, username) => electron.ipcRenderer.invoke("add-collaborator", remoteUrl, username),
|
|
58
|
+
removeCollaborator: (remoteUrl, usernameOrId, isInvitation) => electron.ipcRenderer.invoke("remove-collaborator", remoteUrl, usernameOrId, isInvitation),
|
|
59
|
+
searchGitHubUser: (username) => electron.ipcRenderer.invoke("search-github-user", username),
|
|
60
|
+
getUserInvitations: () => electron.ipcRenderer.invoke("get-user-invitations"),
|
|
61
|
+
acceptInvitation: (invitationId) => electron.ipcRenderer.invoke("accept-invitation", invitationId),
|
|
62
|
+
declineInvitation: (invitationId) => electron.ipcRenderer.invoke("decline-invitation", invitationId),
|
|
63
|
+
// UNIVERSAL PUSH APIs
|
|
64
|
+
selectUniversalFiles: (isDirectory) => electron.ipcRenderer.invoke("select-universal-files", isDirectory),
|
|
65
|
+
getRepositoryBranches: (owner, repo) => electron.ipcRenderer.invoke("get-repository-branches", owner, repo),
|
|
66
|
+
setupUniversalWorkspace: (remoteUrl, branch, baseBranch, dest) => electron.ipcRenderer.invoke("setup-universal-workspace", remoteUrl, branch, baseBranch, dest),
|
|
67
|
+
checkUniversalCollisions: (workspacePath, sourceFiles, dest) => electron.ipcRenderer.invoke("check-universal-collisions", workspacePath, sourceFiles, dest),
|
|
68
|
+
getUniversalDiff: (workspacePath, file) => electron.ipcRenderer.invoke("get-universal-diff", workspacePath, file),
|
|
69
|
+
commitUniversalWorkspace: (workspacePath, msg, branch) => electron.ipcRenderer.invoke("commit-universal-workspace", workspacePath, msg, branch),
|
|
70
|
+
cleanupUniversalWorkspace: (workspacePath) => electron.ipcRenderer.invoke("cleanup-universal-workspace", workspacePath),
|
|
71
|
+
toggleAutoSync: (repoPath, enabled) => electron.ipcRenderer.send("toggle-auto-sync", repoPath, enabled),
|
|
72
|
+
onAutoSyncLog: (callback) => {
|
|
73
|
+
electron.ipcRenderer.removeAllListeners("auto-sync-log");
|
|
74
|
+
electron.ipcRenderer.on("auto-sync-log", (_event, msg) => callback(msg));
|
|
75
|
+
},
|
|
76
|
+
getAppVersion: () => electron.ipcRenderer.invoke("get-app-version"),
|
|
77
|
+
checkUpdates: () => electron.ipcRenderer.invoke("check-updates"),
|
|
78
|
+
installUpdate: () => electron.ipcRenderer.invoke("install-update")
|
|
79
|
+
};
|
|
80
|
+
if (process.contextIsolated) {
|
|
81
|
+
try {
|
|
82
|
+
electron.contextBridge.exposeInMainWorld("electron", preload.electronAPI);
|
|
83
|
+
electron.contextBridge.exposeInMainWorld("api", api);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error(error);
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
window.electron = preload.electronAPI;
|
|
89
|
+
window.api = api;
|
|
90
|
+
}
|