@bobfrankston/npmglobalize 1.0.200 → 1.0.201

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/lib/git.d.ts DELETED
@@ -1,91 +0,0 @@
1
- /**
2
- * npmglobalize — Git operations, command execution, and push protection.
3
- * Depends on: types (leaf), config (leaf)
4
- */
5
- import { type GitStatus } from './types.js';
6
- /**
7
- * Remove 'nul' files from a directory tree (Windows reserved name issue).
8
- * These files break git and npm on Windows. Uses \\?\ prefix to bypass name validation.
9
- */
10
- export declare function removeNulFiles(dir: string, visited?: Set<string>): number;
11
- /** Repair a corrupted git index by rebuilding it.
12
- * Handles "invalid object" / "Error building trees" errors caused by
13
- * stale entries in .git/index referencing missing objects. */
14
- export declare function repairGitIndex(cwd: string): boolean;
15
- /** Parse file paths from git add "Permission denied" / "unable to index file" errors.
16
- * Matches lines like: error: open("data/PingDB.mdf"): Permission denied
17
- * and: error: unable to index file 'data/PingDB.mdf' */
18
- export declare function parseDeniedFiles(errText: string): string[];
19
- /** Run a command and return success status */
20
- export declare function runCommand(cmd: string, args: string[], options?: {
21
- silent?: boolean;
22
- verbose?: boolean;
23
- showCommand?: boolean;
24
- cwd?: string;
25
- }): {
26
- success: boolean;
27
- output: string;
28
- stderr: string;
29
- };
30
- /** Extract GitHub repo identifier from repository field */
31
- export declare function getGitHubRepo(pkg: any): string | null;
32
- /** Run a command and throw on failure */
33
- export declare function runCommandOrThrow(cmd: string, args: string[], options?: {
34
- silent?: boolean;
35
- cwd?: string;
36
- }): string;
37
- export declare function getGitStatus(cwd: string): GitStatus;
38
- /** Validate package.json for release */
39
- export declare function validatePackageJson(pkg: any): string[];
40
- /** Get the latest git tag (if any) */
41
- export declare function getLatestGitTag(cwd: string): string | null;
42
- /** Check if a git tag exists */
43
- export declare function gitTagExists(cwd: string, tag: string): boolean;
44
- /** Delete a git tag */
45
- export declare function deleteGitTag(cwd: string, tag: string): boolean;
46
- /** Get all git tags */
47
- export declare function getAllGitTags(cwd: string): string[];
48
- /** Parse version from tag (e.g., 'v1.2.3' -> [1, 2, 3]) */
49
- export declare function parseVersionTag(tag: string): number[] | null;
50
- /** Compare two version arrays (returns -1 if a < b, 0 if equal, 1 if a > b) */
51
- export declare function compareVersions(a: number[], b: number[]): number;
52
- /** Fix version/tag mismatches */
53
- export declare function fixVersionTagMismatch(cwd: string, pkg: any, verbose?: boolean): boolean;
54
- /** Wait for a package version to appear on the npm registry.
55
- * First-time publishes (brand-new package name) take much longer to
56
- * propagate than version bumps — npm has no cached metadata to update,
57
- * so the registry/CDN can take several minutes before the package is
58
- * resolvable. We wait longer and re-probe `npm view` for the version
59
- * string until it shows up (or we hit the cap). */
60
- export declare function waitForNpmVersion(pkgName: string, version: string, isNewPackage?: boolean, maxWaitMs?: number): boolean;
61
- /** Run npm install -g with retries for registry propagation delay.
62
- * Brand-new packages (first-time publish) take much longer to become
63
- * installable than version bumps, so we use longer waits and more
64
- * attempts when `isNewPackage` is true. */
65
- export declare function installGlobalWithRetry(pkgSpec: string, cwd: string, isNewPackage?: boolean, maxRetries?: number): {
66
- success: boolean;
67
- output: string;
68
- stderr: string;
69
- };
70
- /** Detect OAuth credentials.json type: "installed" (public app ID, safe to include) or "web" (has real secret, must ignore).
71
- * Returns null if no credentials.json exists or it can't be parsed. */
72
- export declare function detectCredentialsType(cwd: string): 'installed' | 'web' | null;
73
- interface PushProtectionSecret {
74
- type: string;
75
- file: string;
76
- unblockUrl: string;
77
- }
78
- interface PushProtectionInfo {
79
- detected: boolean;
80
- secrets: PushProtectionSecret[];
81
- allInstalledOAuth: boolean;
82
- }
83
- /** Parse GitHub push protection (GH013) error output and extract secret details + unblock URLs. */
84
- export declare function parsePushProtection(errorOutput: string, cwd: string): PushProtectionInfo;
85
- /** Display push protection guidance based on the type of secrets detected. */
86
- export declare function showPushProtectionGuidance(ppInfo: PushProtectionInfo): void;
87
- /** Push to git with push-protection detection and auto-bypass for installed OAuth.
88
- * Returns true if push succeeded (possibly after auto-bypass). */
89
- export declare function pushWithProtection(cwd: string, verbose: boolean): boolean;
90
- export {};
91
- //# sourceMappingURL=git.d.ts.map