gigabuddy 0.0.1 → 0.2.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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "gigabuddy",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "description": "The Gigabuddy CLI — sign in, and install @gigabuddy packages as yourself.",
5
5
  "type": "module",
6
- "license": "UNLICENSED",
6
+ "license": "MIT",
7
7
  "homepage": "https://gigabuddy.com",
8
8
  "bin": {
9
9
  "gigabuddy": "bin/cli.js"
@@ -16,7 +16,8 @@
16
16
  "bin/**/*.js",
17
17
  "index.js",
18
18
  "src/**/*.d.ts",
19
- "README.md"
19
+ "README.md",
20
+ "LICENSE"
20
21
  ],
21
22
  "engines": {
22
23
  "node": ">=20"
@@ -1,11 +1,3 @@
1
- /**
2
- * The `gigabuddy` commands. Kept separate from bin/cli.ts (which only parses
3
- * argv and dispatches) so each one is testable without spawning a process.
4
- *
5
- * Everything here is deliberately thin: sign in, prove who you are to the npm
6
- * door, say what state you're in, sign out. The platform's actual capabilities
7
- * live behind hosted doors — this client never grows tool implementations.
8
- */
9
1
  import { type UserCredentials } from '@gigabuddy/client-core';
10
2
  export declare const PRODUCTION_AUTH_URL = "https://auth.gigabuddy.com";
11
3
  export declare const PRODUCTION_API_URL = "https://api.gigabuddy.com";
@@ -33,5 +25,11 @@ export declare function loginCommand(env: Env): Promise<void>;
33
25
  */
34
26
  export declare function npmLoginCommand(env: Env): Promise<void>;
35
27
  export declare function npmLogoutCommand(env: Env): void;
36
- export declare function logoutCommand(env: Env): void;
37
- export declare function statusCommand(): void;
28
+ export declare function logoutCommand(env: Env): Promise<void>;
29
+ /**
30
+ * `gigabuddy doctor [package]` — why isn't this working?
31
+ *
32
+ * Exits non-zero when it found something wrong, so CI can gate on it.
33
+ */
34
+ export declare function doctorCommand(env: Env, packageName?: string): Promise<void>;
35
+ export declare function statusCommand(): Promise<void>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * `gigabuddy doctor` — answer "why doesn't my install work?" in one command.
3
+ *
4
+ * This exists because of a deliberate property of the registry door: a denied
5
+ * read is answered as an npm-shaped `404 no such package`, so that private
6
+ * package names don't enumerate to people who can't read them. Correct for the
7
+ * door, miserable for the human — "not found" looks identical whether you typed
8
+ * the name wrong, aren't signed in, have an expired credential, or simply
9
+ * haven't been given access. npm cannot tell you which, and neither can the
10
+ * registry without leaking the thing it's protecting.
11
+ *
12
+ * So the client says it instead. It holds the pieces the door can't safely
13
+ * reveal — who you are signed in as, whether that session is live, what npm
14
+ * will actually resolve — and turns a bare 404 into a sentence with a next
15
+ * action in it.
16
+ *
17
+ * Every check is independent and never throws: a doctor that dies on the first
18
+ * problem is useless precisely when you need it.
19
+ */
20
+ import { type UserCredentials } from '@gigabuddy/client-core';
21
+ export type CheckStatus = 'ok' | 'warn' | 'fail' | 'skip';
22
+ export interface Check {
23
+ label: string;
24
+ status: CheckStatus;
25
+ detail?: string;
26
+ }
27
+ export interface DoctorResult {
28
+ checks: Check[];
29
+ /** What to actually do next, in order. Empty when everything is healthy. */
30
+ advice: string[];
31
+ }
32
+ export interface DoctorDeps {
33
+ readNpmrc: () => string;
34
+ /** `npm config get @gigabuddy:registry` — the EFFECTIVE value, all layers merged. */
35
+ npmEffectiveRegistry: () => string | null;
36
+ fetchImpl: typeof fetch;
37
+ /** Every .npmrc npm consults ahead of the user-level file, nearest first. */
38
+ shadowingNpmrcFiles: () => {
39
+ path: string;
40
+ contents: string;
41
+ }[];
42
+ nodeVersion: string;
43
+ loadCredentials: (staging: boolean) => UserCredentials | null;
44
+ }
45
+ export declare function runDoctor(deps: DoctorDeps, packageName?: string): Promise<DoctorResult>;
46
+ /** Render for a terminal. Colour only when one is attached and NO_COLOR is unset. */
47
+ export declare function formatDoctor(result: DoctorResult, colour: boolean): string;