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.
- package/README.md +120 -4
- package/dist/artifact-types.d.ts +3 -0
- package/dist/{chunk-IC4R5EYE.js → chunk-YLFLDW2H.js} +1602 -399
- package/dist/deploy.d.ts +46 -26
- package/dist/deploy.js +3 -9
- package/dist/env-consent.d.ts +18 -0
- package/dist/index.js +1401 -65
- package/dist/output.d.ts +29 -0
- package/dist/prompt.d.ts +17 -0
- package/package.json +13 -12
- package/dist/callback-server.d.ts +0 -10
- package/dist/index.d.ts +0 -7
- package/dist/login.d.ts +0 -10
- package/dist/session.d.ts +0 -16
- package/dist/supabase-auth.d.ts +0 -11
package/dist/deploy.d.ts
CHANGED
|
@@ -1,41 +1,61 @@
|
|
|
1
|
-
import type { BuildObserver } from "./artifact-types";
|
|
2
|
-
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { BuildObserver, DeploymentArtifact, DeploymentStatus } from "./artifact-types";
|
|
2
|
+
/** The slice of LocalBuildExecutor the deploy flow needs — injectable in tests. */
|
|
3
|
+
export interface DeployBuildExecutor {
|
|
4
|
+
build(input: {
|
|
5
|
+
deploymentId: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
repositoryUrl: string;
|
|
8
|
+
branch: string;
|
|
9
|
+
rootDirectory: string | null;
|
|
10
|
+
env: Record<string, string>;
|
|
11
|
+
}, observer: BuildObserver): Promise<{
|
|
12
|
+
artifact: DeploymentArtifact;
|
|
13
|
+
}>;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
name: string;
|
|
16
|
-
production: boolean;
|
|
17
|
-
controlPlaneUrl: string;
|
|
18
|
-
repositoryUrl?: string | null | undefined;
|
|
19
|
-
branch?: string | null | undefined;
|
|
20
|
-
rootDirectory?: string | null | undefined;
|
|
21
|
-
env?: Record<string, string> | undefined;
|
|
22
|
-
fetch?: typeof fetch;
|
|
23
|
-
}): Promise<CliDeploymentContext>;
|
|
24
|
-
export declare function controlPlaneUrl(env?: NodeJS.ProcessEnv): string;
|
|
25
|
-
export declare function requireSessionOrLogin(log: (message: string) => void, home?: string, loginFlow?: () => Promise<StoredSession>): Promise<StoredSession>;
|
|
26
|
-
export declare function eventsObserver(cp: string, deploymentId: string, token: string, fetchImpl?: typeof fetch): BuildObserver;
|
|
15
|
+
/** Parses dotenv text into a key/value map. */
|
|
27
16
|
export declare function parseDotenv(text: string): Record<string, string>;
|
|
17
|
+
/** Reads the first of .env.local / .env.production / .env in a directory. */
|
|
28
18
|
export declare function readProjectEnv(dir: string): Record<string, string>;
|
|
19
|
+
export declare function eventsObserver(cp: string, deploymentId: string, token: string, fetchImpl?: typeof fetch): BuildObserver;
|
|
29
20
|
export declare function slugify(value: string): string;
|
|
30
21
|
export interface DeployOptions {
|
|
31
22
|
name?: string | undefined;
|
|
23
|
+
/** Linked project id (.naro/project.json or --project). */
|
|
24
|
+
projectId?: string | undefined;
|
|
32
25
|
rootDirectory?: string | null;
|
|
33
26
|
production?: boolean;
|
|
34
27
|
env?: Record<string, string> | undefined;
|
|
35
28
|
branch?: string | undefined;
|
|
29
|
+
/** Explicit token (--token / MCP config); wins over the stored session. */
|
|
30
|
+
token?: string | undefined;
|
|
31
|
+
/** Allow opening a browser to log in when there is no session. */
|
|
32
|
+
allowLogin?: boolean;
|
|
33
|
+
/** Skip the framework gate (deploy even when detection says not deployable). */
|
|
34
|
+
force?: boolean;
|
|
35
|
+
fetch?: typeof fetch;
|
|
36
|
+
/** Test seam: replaces the local OpenNext build. */
|
|
37
|
+
executor?: DeployBuildExecutor;
|
|
38
|
+
/**
|
|
39
|
+
* 소스가 참조하지만 프로젝트에 없는 env 키를 받아, 등록할 값을 돌려준다.
|
|
40
|
+
* 대화형 CLI만 전달한다 — MCP·CI는 생략하고 안내만 받는다.
|
|
41
|
+
*/
|
|
42
|
+
onMissingEnv?: (keys: string[]) => Promise<Record<string, string>>;
|
|
36
43
|
}
|
|
37
44
|
export interface DeployResult {
|
|
38
|
-
|
|
45
|
+
deploymentId: string;
|
|
46
|
+
projectId: string;
|
|
47
|
+
status: DeploymentStatus;
|
|
39
48
|
url: string;
|
|
49
|
+
production: boolean;
|
|
50
|
+
/** 끝까지 채워지지 않은 키. */
|
|
51
|
+
missingEnvKeys: string[];
|
|
40
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The full CLI deploy: authenticate, register the deployment with the
|
|
55
|
+
* control plane, build locally (OpenNext for Next.js, the static pipeline
|
|
56
|
+
* for Vite/CRA/static sites), upload the artifact and poll until the
|
|
57
|
+
* platform finishes publishing the worker.
|
|
58
|
+
*
|
|
59
|
+
* Shared by `naro deploy` and the MCP `deploy` tool.
|
|
60
|
+
*/
|
|
41
61
|
export declare function deployDirectory(sourceDir: string, options: DeployOptions, log: (message: string) => void): Promise<DeployResult>;
|
package/dist/deploy.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
controlPlaneUrl,
|
|
4
3
|
deployDirectory,
|
|
5
4
|
eventsObserver,
|
|
6
5
|
parseDotenv,
|
|
7
6
|
readProjectEnv,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
startCliDeployment
|
|
11
|
-
} from "./chunk-IC4R5EYE.js";
|
|
7
|
+
slugify
|
|
8
|
+
} from "./chunk-YLFLDW2H.js";
|
|
12
9
|
export {
|
|
13
|
-
controlPlaneUrl,
|
|
14
10
|
deployDirectory,
|
|
15
11
|
eventsObserver,
|
|
16
12
|
parseDotenv,
|
|
17
13
|
readProjectEnv,
|
|
18
|
-
|
|
19
|
-
slugify,
|
|
20
|
-
startCliDeployment
|
|
14
|
+
slugify
|
|
21
15
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Output } from "./output";
|
|
2
|
+
import type { Prompter } from "./prompt";
|
|
3
|
+
export interface EnvConsentContext {
|
|
4
|
+
cwd: string;
|
|
5
|
+
prompter: Prompter;
|
|
6
|
+
output: Output;
|
|
7
|
+
/** 테스트 주입용. 기본값은 SDK의 readProjectEnv. */
|
|
8
|
+
readEnv?: (dir: string) => Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare function maskEnvValue(key: string, value: string): string;
|
|
11
|
+
/** 동의를 구하기 전에는 존재만 확인한다. 내용은 열지 않는다. */
|
|
12
|
+
export declare function findDotenvFile(dir: string): string | null;
|
|
13
|
+
export declare function envAddGuidance(keys: string[]): string[];
|
|
14
|
+
/**
|
|
15
|
+
* 누락된 env 키를 채운다. dotenv 파일은 사용자가 명시적으로 동의한 뒤에만
|
|
16
|
+
* 열리고, 그때도 요청된 키의 값만 꺼낸다 — 파일의 나머지 내용은 전송되지 않는다.
|
|
17
|
+
*/
|
|
18
|
+
export declare function promptForMissingEnv(ctx: EnvConsentContext, keys: string[]): Promise<Record<string, string>>;
|