@fuad24/gitbridge 0.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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +223 -0
  3. package/dist/bin/gb.js +3275 -0
  4. package/dist/bin/gitbridge.js +3275 -0
  5. package/dist/cli/commands/account.d.ts +3 -0
  6. package/dist/cli/commands/auth.d.ts +7 -0
  7. package/dist/cli/commands/context.d.ts +2 -0
  8. package/dist/cli/commands/credential.d.ts +18 -0
  9. package/dist/cli/commands/doctor.d.ts +2 -0
  10. package/dist/cli/commands/enable.d.ts +3 -0
  11. package/dist/cli/commands/hook.d.ts +1 -0
  12. package/dist/cli/commands/identity.d.ts +11 -0
  13. package/dist/cli/commands/provider.d.ts +1 -0
  14. package/dist/cli/commands/push.d.ts +5 -0
  15. package/dist/cli/commands/remote.d.ts +5 -0
  16. package/dist/cli/commands/repo.d.ts +2 -0
  17. package/dist/cli/commands/rule.d.ts +8 -0
  18. package/dist/cli/commands/setup.d.ts +2 -0
  19. package/dist/cli/commands/status.d.ts +2 -0
  20. package/dist/cli/commands/switch.d.ts +4 -0
  21. package/dist/cli/index.d.ts +2 -0
  22. package/dist/cli/ui/banners.d.ts +2 -0
  23. package/dist/cli/ui/prompts.d.ts +31 -0
  24. package/dist/cli/ui/tables.d.ts +6 -0
  25. package/dist/core/config/config-store.d.ts +56 -0
  26. package/dist/core/config/path-resolver.d.ts +20 -0
  27. package/dist/core/config/schema.d.ts +461 -0
  28. package/dist/core/git/config-generator.d.ts +12 -0
  29. package/dist/core/git/git-cli.d.ts +32 -0
  30. package/dist/core/git/gitconfig-injector.d.ts +14 -0
  31. package/dist/core/git/url-parser.d.ts +16 -0
  32. package/dist/core/identity/identity-resolver.d.ts +23 -0
  33. package/dist/core/providers/bitbucket.provider.d.ts +12 -0
  34. package/dist/core/providers/github.provider.d.ts +15 -0
  35. package/dist/core/providers/gitlab.provider.d.ts +12 -0
  36. package/dist/core/providers/provider-registry.d.ts +11 -0
  37. package/dist/core/providers/provider.interface.d.ts +50 -0
  38. package/dist/core/safety/identity-guard.d.ts +18 -0
  39. package/dist/core/ssh/ssh-config-generator.d.ts +6 -0
  40. package/dist/core/ssh/ssh-injector.d.ts +14 -0
  41. package/dist/core/ssh/ssh-key-detector.d.ts +10 -0
  42. package/dist/core/storage/credential-store.d.ts +7 -0
  43. package/dist/core/storage/encrypted-vault.d.ts +16 -0
  44. package/dist/core/storage/linux-keyring.d.ts +8 -0
  45. package/dist/core/storage/macos-keychain.d.ts +8 -0
  46. package/dist/core/storage/store-factory.d.ts +5 -0
  47. package/dist/core/storage/windows-cred.d.ts +9 -0
  48. package/dist/index.d.ts +20 -0
  49. package/dist/index.js +3356 -0
  50. package/dist/index.js.map +7 -0
  51. package/dist/utils/errors.d.ts +22 -0
  52. package/dist/utils/http.d.ts +10 -0
  53. package/dist/utils/logger.d.ts +15 -0
  54. package/dist/utils/platform.d.ts +8 -0
  55. package/package.json +62 -0
@@ -0,0 +1,22 @@
1
+ export declare class GitBridgeError extends Error {
2
+ readonly code?: string | undefined;
3
+ constructor(message: string, code?: string | undefined);
4
+ }
5
+ export declare class ConfigError extends GitBridgeError {
6
+ constructor(message: string);
7
+ }
8
+ export declare class AuthError extends GitBridgeError {
9
+ constructor(message: string);
10
+ }
11
+ export declare class ProviderError extends GitBridgeError {
12
+ readonly provider: string;
13
+ constructor(message: string, provider: string);
14
+ }
15
+ export declare class GitCliError extends GitBridgeError {
16
+ readonly exitCode: number;
17
+ readonly stderr: string;
18
+ constructor(message: string, exitCode: number, stderr: string);
19
+ }
20
+ export declare class CredentialStoreError extends GitBridgeError {
21
+ constructor(message: string);
22
+ }
@@ -0,0 +1,10 @@
1
+ export interface HttpRequestOptions {
2
+ headers?: Record<string, string>;
3
+ timeoutMs?: number;
4
+ params?: Record<string, string | number | boolean | undefined>;
5
+ }
6
+ export declare function requestJson<T>(url: string, method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH", body?: unknown, options?: HttpRequestOptions): Promise<{
7
+ data: T;
8
+ status: number;
9
+ headers: Headers;
10
+ }>;
@@ -0,0 +1,15 @@
1
+ export type LogLevel = "debug" | "info" | "warn" | "error";
2
+ declare class Logger {
3
+ private isDebug;
4
+ setDebug(val: boolean): void;
5
+ debug(msg: string, ...args: unknown[]): void;
6
+ info(msg: string): void;
7
+ success(msg: string): void;
8
+ warn(msg: string): void;
9
+ error(msg: string, err?: unknown): void;
10
+ highlight(text: string): string;
11
+ dim(text: string): string;
12
+ bold(text: string): string;
13
+ }
14
+ export declare const logger: Logger;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ export type SupportedPlatform = "linux" | "darwin" | "win32" | "unknown";
2
+ export declare function getPlatform(): SupportedPlatform;
3
+ export declare function isLinux(): boolean;
4
+ export declare function isMacOS(): boolean;
5
+ export declare function isWindows(): boolean;
6
+ export declare function getHomeDir(): string;
7
+ export declare function expandTilde(filepath: string): string;
8
+ export declare function collapseTilde(filepath: string): string;
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@fuad24/gitbridge",
3
+ "version": "0.1.0",
4
+ "description": "Universal Git Identity & Multi-Account Management Layer",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "gitbridge": "dist/bin/gitbridge.js",
9
+ "gb": "dist/bin/gb.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "scripts": {
17
+ "start": "bun run bin/gitbridge.ts",
18
+ "test": "bun test",
19
+ "test:coverage": "bun test --coverage",
20
+ "typecheck": "bun x tsc --noEmit",
21
+ "build": "bun run scripts/build.ts && bun x tsc -p tsconfig.build.json",
22
+ "prepublishOnly": "bun run test && bun run build"
23
+ },
24
+ "keywords": [
25
+ "git",
26
+ "identity",
27
+ "multi-account",
28
+ "github",
29
+ "gitlab",
30
+ "bitbucket",
31
+ "ssh",
32
+ "credential-helper",
33
+ "cli"
34
+ ],
35
+ "author": "Fuad Tesfaye",
36
+ "license": "MIT",
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/FuadTesfaye/gitbridge.git"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/FuadTesfaye/gitbridge/issues"
46
+ },
47
+ "homepage": "https://github.com/FuadTesfaye/gitbridge#readme",
48
+ "dependencies": {
49
+ "@clack/prompts": "^0.9.1",
50
+ "cli-table3": "^0.6.5",
51
+ "commander": "^13.1.0",
52
+ "ora": "^8.2.0",
53
+ "picocolors": "^1.1.1",
54
+ "zod": "^3.24.2"
55
+ },
56
+ "devDependencies": {
57
+ "@types/bun": "latest",
58
+ "@types/node": "^22.13.9",
59
+ "esbuild": "^0.25.0",
60
+ "typescript": "^5.8.2"
61
+ }
62
+ }