naro-cli 0.17.0 → 0.19.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 +384 -24
- package/dist/{chunk-PYRN5XR6.js → chunk-DEEFHVDZ.js} +1616 -230
- package/dist/deploy.d.ts +38 -1
- package/dist/deploy.js +8 -4
- package/dist/env-consent.d.ts +9 -1
- package/dist/env-surface.d.ts +12 -0
- package/dist/index.js +782 -237
- package/dist/prompt.d.ts +16 -2
- package/dist/working-tree.d.ts +74 -0
- package/package.json +6 -6
package/dist/deploy.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type CacheTransport } from "@next-deploy/build";
|
|
1
|
+
import { type CacheTransport, type LocalBuildDependencies } from "@next-deploy/build";
|
|
2
2
|
import { type CliGitConnection } from "@next-deploy/sdk";
|
|
3
3
|
import type { BuildObserver, DeploymentArtifact, DeploymentStatus, DeploymentStrategyRecord } from "./artifact-types";
|
|
4
4
|
import { type GitInfo } from "./git-info";
|
|
5
|
+
import { type WorkingTreeCopy } from "./working-tree";
|
|
5
6
|
/** The slice of LocalBuildExecutor the deploy flow needs — injectable in tests. */
|
|
6
7
|
export interface DeployBuildExecutor {
|
|
7
8
|
build(input: {
|
|
@@ -24,8 +25,26 @@ export declare function readProjectEnv(dir: string): Record<string, string>;
|
|
|
24
25
|
export declare function eventsObserver(cp: string, deploymentId: string, token: string, fetchImpl?: typeof fetch, logIngestUrl?: string): BuildObserver & {
|
|
25
26
|
/** Sends what is buffered now; never throws. */
|
|
26
27
|
flush(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Fails this deployment with the error the dashboard shows. The local
|
|
30
|
+
* build holds only this deployment's token, not the /fail callback's, so
|
|
31
|
+
* without this a failed build left the row building — LIVE on the
|
|
32
|
+
* dashboard — until the sweeper's 10 minutes (known-issues #16). Never
|
|
33
|
+
* throws: the build's own error is what the caller reports.
|
|
34
|
+
*/
|
|
35
|
+
fail(code: string, message: string): Promise<void>;
|
|
27
36
|
};
|
|
28
37
|
export declare function slugify(value: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* What copyWorkingTree left out or rewrote, as one line each — built from the
|
|
40
|
+
* copy so the terminal, MCP and the build log say the same thing.
|
|
41
|
+
*/
|
|
42
|
+
export declare function workingTreeNotices(copy: WorkingTreeCopy): {
|
|
43
|
+
level: "WARN" | "INFO";
|
|
44
|
+
message: string;
|
|
45
|
+
}[];
|
|
46
|
+
/** Exported for the test that pins the clone to copyWorkingTree. */
|
|
47
|
+
export declare function localDependencies(sourceDir: string, say?: (message: string) => void): LocalBuildDependencies;
|
|
29
48
|
export interface DeployOptions {
|
|
30
49
|
name?: string | undefined;
|
|
31
50
|
/** Linked project id (.naro/project.json or --project). */
|
|
@@ -34,6 +53,13 @@ export interface DeployOptions {
|
|
|
34
53
|
teamSlug?: string | undefined;
|
|
35
54
|
rootDirectory?: string | null;
|
|
36
55
|
production?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Deploy to this named environment (its slug) instead of preview. Not with
|
|
58
|
+
* `production` (the control plane refuses both), and not `production` or
|
|
59
|
+
* `preview` themselves: those are `production: true` and the default, and
|
|
60
|
+
* are refused with VALIDATION_FAILED before anything runs.
|
|
61
|
+
*/
|
|
62
|
+
environment?: string | undefined;
|
|
37
63
|
env?: Record<string, string> | undefined;
|
|
38
64
|
branch?: string | undefined;
|
|
39
65
|
/** Explicit token (--token / MCP config); wins over the stored session. */
|
|
@@ -43,6 +69,12 @@ export interface DeployOptions {
|
|
|
43
69
|
/** Skip the framework gate (deploy even when detection says not deployable). */
|
|
44
70
|
force?: boolean;
|
|
45
71
|
fetch?: typeof fetch;
|
|
72
|
+
/**
|
|
73
|
+
* How often to ask whether the deployment finished. Tests set it low: their
|
|
74
|
+
* control plane answers DEPLOYING first, and a real 2.5 s wait per test was
|
|
75
|
+
* enough to time some out when the whole suite ran at once.
|
|
76
|
+
*/
|
|
77
|
+
pollIntervalMs?: number;
|
|
46
78
|
/** Test seam: replaces the local OpenNext build. */
|
|
47
79
|
executor?: DeployBuildExecutor;
|
|
48
80
|
/** Test seam: replaces the `git` calls that read the repository. */
|
|
@@ -59,6 +91,11 @@ export interface DeployResult {
|
|
|
59
91
|
status: DeploymentStatus;
|
|
60
92
|
url: string;
|
|
61
93
|
production: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The named environment it went to, as the control plane confirmed; null
|
|
96
|
+
* for production and preview.
|
|
97
|
+
*/
|
|
98
|
+
environment?: string | null;
|
|
62
99
|
/** 끝까지 채워지지 않은 키. */
|
|
63
100
|
missingEnvKeys: string[];
|
|
64
101
|
/** 서버가 확정한 목적지 — 출력과 링크 파일이 이 값을 쓴다. */
|
package/dist/deploy.js
CHANGED
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
import {
|
|
3
3
|
deployDirectory,
|
|
4
4
|
eventsObserver,
|
|
5
|
-
|
|
5
|
+
localDependencies,
|
|
6
|
+
parseDotenv2 as parseDotenv,
|
|
6
7
|
readProjectEnv,
|
|
7
|
-
slugify
|
|
8
|
-
|
|
8
|
+
slugify,
|
|
9
|
+
workingTreeNotices
|
|
10
|
+
} from "./chunk-DEEFHVDZ.js";
|
|
9
11
|
import "./chunk-K3NQKI34.js";
|
|
10
12
|
export {
|
|
11
13
|
deployDirectory,
|
|
12
14
|
eventsObserver,
|
|
15
|
+
localDependencies,
|
|
13
16
|
parseDotenv,
|
|
14
17
|
readProjectEnv,
|
|
15
|
-
slugify
|
|
18
|
+
slugify,
|
|
19
|
+
workingTreeNotices
|
|
16
20
|
};
|
package/dist/env-consent.d.ts
CHANGED
|
@@ -4,13 +4,21 @@ export interface EnvConsentContext {
|
|
|
4
4
|
cwd: string;
|
|
5
5
|
prompter: Prompter;
|
|
6
6
|
output: Output;
|
|
7
|
+
/** 배포가 가는 이름 있는 환경의 slug. 없으면 production·preview 배포다. */
|
|
8
|
+
environment?: string;
|
|
7
9
|
/** 테스트 주입용. 기본값은 SDK의 readProjectEnv. */
|
|
8
10
|
readEnv?: (dir: string) => Record<string, string>;
|
|
9
11
|
}
|
|
12
|
+
/** 비밀값은 앞 네 글자까지만 — 8자 이하면 하나도 보이지 않는다. */
|
|
13
|
+
export declare function maskSecretValue(value: string): string;
|
|
10
14
|
export declare function maskEnvValue(key: string, value: string): string;
|
|
11
15
|
/** 동의를 구하기 전에는 존재만 확인한다. 내용은 열지 않는다. */
|
|
12
16
|
export declare function findDotenvFile(dir: string): string | null;
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* 값을 채우는 명령 안내. `env add KEY`만 쓰면 target이 `all`이라 production에도
|
|
19
|
+
* 닿으므로, 환경에 배포할 때는 그 환경의 slug를 붙여 그 환경에만 저장하게 한다.
|
|
20
|
+
*/
|
|
21
|
+
export declare function envAddGuidance(keys: string[], environment?: string): string[];
|
|
14
22
|
/**
|
|
15
23
|
* 누락된 env 키를 채운다. dotenv 파일은 사용자가 명시적으로 동의한 뒤에만
|
|
16
24
|
* 열리고, 그때도 요청된 키의 값만 꺼낸다 — 파일의 나머지 내용은 전송되지 않는다.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EnvVarInfo } from "@next-deploy/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* The values one surface gets, one per key, the way the server's
|
|
4
|
+
* `envForSurface` picks them for a deployment: the surface's own row beats
|
|
5
|
+
* `all` whichever the list shows first, and no other surface's row applies
|
|
6
|
+
* (preview's never reaches an environment). A row's target is its surface's
|
|
7
|
+
* name: `production`, `preview` or an environment's slug.
|
|
8
|
+
*
|
|
9
|
+
* A leaf module on purpose: `naro env pull` and the library deploy (which MCP
|
|
10
|
+
* imports) both read it, and neither should pull in the other's commands.
|
|
11
|
+
*/
|
|
12
|
+
export declare function pullEnv(rows: EnvVarInfo[], surface: string): Record<string, string>;
|