naro-cli 0.2.1 → 0.4.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.
@@ -0,0 +1,29 @@
1
+ export interface OutputStreams {
2
+ stdout(text: string): void;
3
+ stderr(text: string): void;
4
+ }
5
+ /**
6
+ * One Output per invocation. Human mode: progress + results on stdout.
7
+ * JSON mode (--json): stdout carries exactly one machine-readable JSON
8
+ * object; every human-facing line moves to stderr so agents never have to
9
+ * parse log noise.
10
+ */
11
+ export declare class Output {
12
+ readonly json: boolean;
13
+ readonly debug: boolean;
14
+ private readonly streams;
15
+ private resultPrinted;
16
+ constructor(json: boolean, debug: boolean, streams?: OutputStreams);
17
+ /** Progress/log line for humans. */
18
+ log(message: string): void;
19
+ /** Extra diagnostics, only with --debug. */
20
+ debugLog(message: string): void;
21
+ /**
22
+ * Final command result. JSON mode prints {success:true, ...data}; human
23
+ * mode prints the lines instead.
24
+ */
25
+ result(data: Record<string, unknown>, humanLines?: string[]): void;
26
+ /** Command failure: stable {success:false, code, message} in JSON mode. */
27
+ fail(error: unknown): void;
28
+ get hasResult(): boolean;
29
+ }
@@ -0,0 +1,17 @@
1
+ export interface Prompter {
2
+ /** Free-text question. */
3
+ ask(question: string): Promise<string>;
4
+ /** Question with hidden echo (secrets). */
5
+ askHidden(question: string): Promise<string>;
6
+ /** y/N confirmation, defaults to No. */
7
+ confirm(question: string): Promise<boolean>;
8
+ /** Pick one option by number; returns its index. */
9
+ select(question: string, options: string[]): Promise<number>;
10
+ }
11
+ export declare function isInteractive(): boolean;
12
+ /** Reads all of stdin — the CI path for piped secret values. */
13
+ export declare function readStdin(): Promise<string>;
14
+ export declare function createPrompter(options: {
15
+ json: boolean;
16
+ yes: boolean;
17
+ }): Prompter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naro-cli",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "naro": "./dist/index.js"
@@ -18,25 +18,26 @@
18
18
  "default": "./dist/deploy.js"
19
19
  }
20
20
  },
21
+ "scripts": {
22
+ "build": "tsup && pnpm build:types",
23
+ "build:types": "tsc --project tsconfig.build.json",
24
+ "test": "vitest run",
25
+ "typecheck": "tsc --noEmit",
26
+ "prepublishOnly": "pnpm build && node ../../scripts/check-publish.mjs naro-cli"
27
+ },
21
28
  "dependencies": {
22
29
  "@opennextjs/cloudflare": "1.20.2",
23
30
  "@supabase/supabase-js": "2.112.3",
24
31
  "wrangler": "4.124.0"
25
32
  },
26
33
  "devDependencies": {
34
+ "@next-deploy/build": "workspace:*",
35
+ "@next-deploy/core": "workspace:*",
36
+ "@next-deploy/config": "workspace:*",
27
37
  "tsup": "8.5.0",
28
38
  "tsx": "4.23.12",
29
39
  "typescript": "7.0.2",
30
40
  "vitest": "3.2.7",
31
- "@next-deploy/build": "0.1.0",
32
- "@next-deploy/core": "0.1.0",
33
- "@next-deploy/config": "0.1.0"
34
- },
35
- "scripts": {
36
- "build": "tsup && pnpm build:types",
37
- "build:types": "tsc --project tsconfig.build.json",
38
- "test": "vitest run",
39
- "typecheck": "tsc --noEmit",
40
- "lint": "tsc --noEmit"
41
+ "@next-deploy/sdk": "workspace:*"
41
42
  }
42
- }
43
+ }
@@ -1,10 +0,0 @@
1
- export interface CallbackServer {
2
- port: number;
3
- waitForCode(timeoutMs: number): Promise<string>;
4
- close(): void;
5
- }
6
- /**
7
- * Starts a localhost HTTP callback server for OAuth redirects.
8
- * The server resolves exactly one callback via `waitForCode()` — call it once per server.
9
- */
10
- export declare function startCallbackServer(): Promise<CallbackServer>;
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export interface Flags {
2
- name?: string | undefined;
3
- root?: string | undefined;
4
- branch?: string | undefined;
5
- production: boolean;
6
- }
7
- export declare function parseFlags(argv: string[]): Flags;
package/dist/login.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { type StoredSession } from "./session";
2
- export interface CliIo {
3
- out(msg: string): void;
4
- err(msg: string): void;
5
- }
6
- export declare const stdio: CliIo;
7
- export declare function openBrowser(url: string): void;
8
- export declare function runLogin(io?: CliIo): Promise<void>;
9
- export declare function runWhoami(io?: CliIo, home?: string, refresh?: (refreshToken: string) => Promise<StoredSession>): Promise<void>;
10
- export declare function runLogout(io?: CliIo, home?: string, signOut?: (session: StoredSession) => Promise<void>): Promise<void>;
package/dist/session.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export interface StoredSession {
2
- access_token: string;
3
- refresh_token: string;
4
- expires_at: number;
5
- user: {
6
- id: string;
7
- email: string | null;
8
- github: string | null;
9
- };
10
- }
11
- export declare function credentialsDir(home?: string): string;
12
- export declare function credentialsFile(home?: string): string;
13
- export declare function saveSession(session: StoredSession, home?: string): void;
14
- export declare function loadStoredSession(home?: string): StoredSession | null;
15
- export declare function clearSession(home?: string): void;
16
- export declare function isExpired(session: StoredSession, skewSeconds?: number): boolean;
@@ -1,11 +0,0 @@
1
- import { type Session, type SupabaseClient } from "@supabase/supabase-js";
2
- import type { StoredSession } from "./session";
3
- export declare function createAuthClient(env?: NodeJS.ProcessEnv): SupabaseClient;
4
- export declare function toStoredSession(session: Session): StoredSession;
5
- export declare function refreshStoredSession(refreshToken: string, client?: SupabaseClient): Promise<StoredSession>;
6
- export interface LoginDeps {
7
- openBrowser: (url: string) => void;
8
- client?: SupabaseClient;
9
- timeoutMs?: number;
10
- }
11
- export declare function login(deps: LoginDeps): Promise<StoredSession>;