naro-cli 0.2.0 → 0.3.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/dist/deploy.d.ts CHANGED
@@ -1,40 +1,54 @@
1
- import type { BuildObserver } from "./artifact-types";
2
- import { type StoredSession } from "./session";
3
- export interface CliDeploymentContext {
4
- deploymentId: string;
5
- projectId: string;
6
- callbackToken: string;
7
- branch: string;
8
- rootDirectory: string | null;
9
- env: Record<string, string>;
10
- controlPlaneUrl: string;
11
- envSkipped?: string[];
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
+ }>;
12
14
  }
13
- export declare function startCliDeployment(accessToken: string, opts: {
14
- name: string;
15
- production: boolean;
16
- controlPlaneUrl: string;
17
- repositoryUrl?: string | null | undefined;
18
- branch?: string | null | undefined;
19
- rootDirectory?: string | null | undefined;
20
- env?: Record<string, string> | undefined;
21
- fetch?: typeof fetch;
22
- }): Promise<CliDeploymentContext>;
23
- export declare function controlPlaneUrl(env?: NodeJS.ProcessEnv): string;
24
- export declare function requireSessionOrLogin(log: (message: string) => void, home?: string, loginFlow?: () => Promise<StoredSession>): Promise<StoredSession>;
25
- export declare function eventsObserver(cp: string, deploymentId: string, token: string, fetchImpl?: typeof fetch): BuildObserver;
15
+ /** Parses dotenv text into a key/value map. */
26
16
  export declare function parseDotenv(text: string): Record<string, string>;
17
+ /** Reads the first of .env.local / .env.production / .env in a directory. */
27
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;
28
20
  export declare function slugify(value: string): string;
29
21
  export interface DeployOptions {
30
22
  name?: string | undefined;
23
+ /** Linked project id (.naro/project.json or --project). */
24
+ projectId?: string | undefined;
31
25
  rootDirectory?: string | null;
32
26
  production?: boolean;
33
27
  env?: Record<string, string> | undefined;
34
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;
35
38
  }
36
39
  export interface DeployResult {
37
- workerName: string;
40
+ deploymentId: string;
41
+ projectId: string;
42
+ status: DeploymentStatus;
38
43
  url: string;
44
+ production: boolean;
39
45
  }
46
+ /**
47
+ * The full CLI deploy: authenticate, register the deployment with the
48
+ * control plane, build locally (OpenNext for Next.js, the static pipeline
49
+ * for Vite/CRA/static sites), upload the artifact and poll until the
50
+ * platform finishes publishing the worker.
51
+ *
52
+ * Shared by `naro deploy` and the MCP `deploy` tool.
53
+ */
40
54
  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
- readProjectEnv,
8
- requireSessionOrLogin,
9
- slugify,
10
- startCliDeployment
11
- } from "./chunk-UNCVFCTH.js";
6
+ readProjectEnv2 as readProjectEnv,
7
+ slugify
8
+ } from "./chunk-B6F7QIW7.js";
12
9
  export {
13
- controlPlaneUrl,
14
10
  deployDirectory,
15
11
  eventsObserver,
16
12
  parseDotenv,
17
13
  readProjectEnv,
18
- requireSessionOrLogin,
19
- slugify,
20
- startCliDeployment
14
+ slugify
21
15
  };