mfeflow 0.3.0 → 0.5.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,41 @@
1
+ import type { RegistryIndexRemote } from '@mfeflow/contracts';
2
+ import { type DeployResult, type FailureResult, type StatusResult } from './output.js';
3
+ import { type TestRuntime } from './testing.js';
4
+ export declare const BASE_URL = "https://cdn.test";
5
+ interface Ran<T> {
6
+ code: number;
7
+ result: T;
8
+ rt: TestRuntime;
9
+ }
10
+ export interface Fixture {
11
+ root: string;
12
+ site: string;
13
+ cleanup(): Promise<void>;
14
+ /** `mfeflow <argv> --json` against this project and host, for the commands that print a deploy result. */
15
+ run(...argv: string[]): Promise<Ran<DeployResult>>;
16
+ /** The same, for a run that must fail with an error document. */
17
+ fail(...argv: string[]): Promise<Ran<FailureResult>>;
18
+ /** `mfeflow status <argv> --json`. */
19
+ status(...argv: string[]): Promise<Ran<StatusResult>>;
20
+ /** What the host serves for `env`, read straight from disk. */
21
+ served(env: string, remote?: string): Promise<RegistryIndexRemote | undefined>;
22
+ hostTree(): Promise<Record<string, string>>;
23
+ localTree(): Promise<Record<string, string>>;
24
+ }
25
+ /** An object read from JSON text, for tests that poke at it. */
26
+ export declare function parseObject(text: string): Record<string, unknown>;
27
+ export declare function readObject(file: string): Promise<Record<string, unknown>>;
28
+ export declare function failureOf(text: string): FailureResult;
29
+ export declare function statusOf(text: string): StatusResult;
30
+ export declare function deployOf(text: string): DeployResult;
31
+ /** Writes a remote's build: a manifest, an entry and one expose, with content that differs by `marker`. */
32
+ export declare function buildRemote(root: string, name: string, version: string, options?: {
33
+ marker?: string;
34
+ entryBytes?: number;
35
+ reactRange?: string;
36
+ }): Promise<void>;
37
+ export declare function fixture(options?: {
38
+ env?: Record<string, string>;
39
+ configure?: boolean;
40
+ }): Promise<Fixture>;
41
+ export {};
@@ -1,10 +1,9 @@
1
+ import type { RegistryIndex, RegistryIndexRemote } from '@mfeflow/contracts';
1
2
  import type { ProjectView } from './inspect.js';
2
- export interface DevRemote {
3
- name: string;
4
- entry: string;
3
+ export type DevRemote = RegistryIndexRemote & {
5
4
  version: string;
6
- }
7
- export interface DevIndex {
5
+ };
6
+ export interface DevIndex extends RegistryIndex {
8
7
  remotes: DevRemote[];
9
8
  }
10
9
  /** `name=url` flags as a map. A bare origin means its `/mf-manifest.json`. */
package/dist/exit.d.ts CHANGED
@@ -8,7 +8,7 @@ export declare const EXIT: {
8
8
  readonly feature: 4;
9
9
  readonly build: 5;
10
10
  readonly registry: 6;
11
- readonly upgrade: 7;
11
+ readonly deploy: 7;
12
12
  readonly cancelled: 130;
13
13
  };
14
14
  /** Raised when the user backs out of a prompt. */
@@ -0,0 +1,25 @@
1
+ import { type RegistryHost } from '@mfeflow/registry/static';
2
+ export type HostSpec = {
3
+ kind: 'file';
4
+ dir: string;
5
+ } | {
6
+ kind: 's3';
7
+ bucket: string;
8
+ prefix: string;
9
+ };
10
+ /** `file:<dir>` or `s3://<bucket>[/prefix]`. A folder is resolved against `cwd`. */
11
+ export declare function parseHostSpec(spec: string, cwd: string): HostSpec;
12
+ /** The host as shown to people and in `--json`: never an endpoint or a credential. */
13
+ export declare function describeHost(host: HostSpec): string;
14
+ type Env = Readonly<Record<string, string | undefined>>;
15
+ /** The secret values the environment holds, so no message can echo them. */
16
+ export declare function secretsOf(env: Env): string[];
17
+ export declare function redact(text: string, secrets: readonly string[]): string;
18
+ export interface OpenOptions {
19
+ env: Env;
20
+ /** For tests: stands in for the network. */
21
+ fetch?: typeof fetch;
22
+ }
23
+ /** Opens the host. S3 settings and credentials come from the environment only. */
24
+ export declare function openHost(spec: HostSpec, options: OpenOptions): Promise<RegistryHost>;
25
+ export {};
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { main } from './cli.js';
2
2
  export { COMMANDS } from './cli.js';
3
3
  export { EXIT, exitCodeFor } from './exit.js';
4
4
  export { validateResult } from './output.js';
5
- export type { AddResult, BudgetResult, DevResult, CliResult, FailureResult, FeatureInfo, FeaturesResult, InitResult, PlanReport, ReportResult, } from './output.js';
5
+ export type { AddResult, BudgetResult, DevResult, DeployResult, CliResult, FailureResult, FeatureInfo, FeaturesResult, InitResult, PlanReport, RegistryEntryInfo, RegistryResult, RegistryStatus, ReportResult, StatusResult, } from './output.js';
6
6
  export { realRuntime, type Runtime } from './runtime.js';
7
7
  export type { Io } from './io.js';
8
8
  export type { Prompter } from './prompter.js';