mfeflow 0.0.0-stage → 0.1.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.
Files changed (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -2
  3. package/assets/features/analytics-gtm/feature.json +117 -0
  4. package/assets/features/analytics-gtm/files/Analytics.tsx +13 -0
  5. package/assets/features/analytics-gtm/files/ConsentBanner.tsx +47 -0
  6. package/assets/features/analytics-gtm/files/consent-banner-test.tsx +36 -0
  7. package/assets/features/analytics-gtm/files/init.ts +26 -0
  8. package/assets/features/analytics-gtm/files/remote-analytics-test.ts.eta +18 -0
  9. package/assets/features/analytics-gtm/files/remote-analytics.ts.eta +13 -0
  10. package/assets/features/analytics-gtm/files/shell-init-test.ts +42 -0
  11. package/assets/features/ci-github/feature.json +26 -0
  12. package/assets/features/ci-github/files/ci.md +41 -0
  13. package/assets/features/ci-github/files/ci.yml +63 -0
  14. package/assets/features/env-t3/feature.json +378 -0
  15. package/assets/features/env-t3/files/check-runtime-config.ts +105 -0
  16. package/assets/features/env-t3/files/env.arktype.ts +12 -0
  17. package/assets/features/env-t3/files/env.example +1 -0
  18. package/assets/features/env-t3/files/env.valibot.ts +12 -0
  19. package/assets/features/env-t3/files/env.zod.ts +12 -0
  20. package/assets/features/env-t3/files/runtime.ts.eta +30 -0
  21. package/assets/features/env-t3/files/schema.arktype.ts +8 -0
  22. package/assets/features/env-t3/files/schema.valibot.ts +8 -0
  23. package/assets/features/env-t3/files/schema.zod.ts +8 -0
  24. package/assets/features/git-hooks/feature.json +42 -0
  25. package/assets/features/git-hooks/files/commitlint.config.js +1 -0
  26. package/assets/features/git-hooks/files/lefthook.yml +9 -0
  27. package/assets/features/lint-oxlint/feature.json +60 -0
  28. package/assets/features/lint-oxlint/files/oxlintrc.json +5 -0
  29. package/assets/features/lint-oxlint/files/prettierignore +5 -0
  30. package/assets/features/lint-oxlint/files/prettierrc.json +5 -0
  31. package/assets/features/telemetry-otel/feature.json +159 -0
  32. package/assets/features/telemetry-otel/files/init.ts.eta +53 -0
  33. package/assets/features/telemetry-otel/files/remote-telemetry-test.ts.eta +13 -0
  34. package/assets/features/telemetry-otel/files/remote-telemetry.ts.eta +11 -0
  35. package/assets/features/telemetry-otel/files/shell-init-test.ts.eta +36 -0
  36. package/assets/features/testing/feature.json +202 -0
  37. package/assets/features/testing/files/handlers.ts +5 -0
  38. package/assets/features/testing/files/playwright.config.ts +30 -0
  39. package/assets/features/testing/files/root-vitest.config.ts +6 -0
  40. package/assets/features/testing/files/sample-handlers-test.ts +16 -0
  41. package/assets/features/testing/files/sample-remote-test.tsx +12 -0
  42. package/assets/features/testing/files/sample-shell-test.tsx +11 -0
  43. package/assets/features/testing/files/sample-smoke-e2e.ts +53 -0
  44. package/assets/features/testing/files/server.ts +4 -0
  45. package/assets/features/testing/files/setup.ts +18 -0
  46. package/assets/features/testing/files/vitest.config.ts +11 -0
  47. package/assets/features/tsconfig/feature.json +78 -0
  48. package/assets/features/tsconfig/files/root.tsconfig.json +4 -0
  49. package/assets/features/tsconfig/files/tsconfig.json +5 -0
  50. package/assets/features/url-factory/feature.json +30 -0
  51. package/assets/features/url-factory/files/endpoints.ts +12 -0
  52. package/assets/templates/monorepo/feature.json +295 -0
  53. package/assets/templates/monorepo/files/remote/mfe.json.eta +7 -0
  54. package/assets/templates/monorepo/files/remote/package.json.eta +6 -0
  55. package/assets/templates/monorepo/files/remote/rsbuild.config.ts.eta +7 -0
  56. package/assets/templates/monorepo/files/remote/src/bootstrap.tsx.eta +6 -0
  57. package/assets/templates/monorepo/files/remote/src/env.d.ts.eta +1 -0
  58. package/assets/templates/monorepo/files/remote/src/exposed/App.tsx.eta +18 -0
  59. package/assets/templates/monorepo/files/remote/src/index.ts.eta +2 -0
  60. package/assets/templates/monorepo/files/root/AGENTS.md.eta +17 -0
  61. package/assets/templates/monorepo/files/root/README.md.eta +52 -0
  62. package/assets/templates/monorepo/files/root/gitignore.eta +11 -0
  63. package/assets/templates/monorepo/files/root/nvmrc.eta +1 -0
  64. package/assets/templates/monorepo/files/root/package.json.eta +9 -0
  65. package/assets/templates/monorepo/files/root/pnpm-workspace.yaml.eta +7 -0
  66. package/assets/templates/monorepo/files/root/turbo.json.eta +16 -0
  67. package/assets/templates/monorepo/files/shell/mfe.json.eta +7 -0
  68. package/assets/templates/monorepo/files/shell/package.json.eta +6 -0
  69. package/assets/templates/monorepo/files/shell/rsbuild.config.ts.eta +74 -0
  70. package/assets/templates/monorepo/files/shell/src/App.tsx.eta +46 -0
  71. package/assets/templates/monorepo/files/shell/src/bootstrap.tsx.eta +24 -0
  72. package/assets/templates/monorepo/files/shell/src/env.d.ts.eta +1 -0
  73. package/assets/templates/monorepo/files/shell/src/index.ts.eta +4 -0
  74. package/assets/templates/monorepo/files/shell/src/pages/Home.tsx.eta +12 -0
  75. package/assets/templates/monorepo/files/shell/src/remotes/route-table.tsx.eta +12 -0
  76. package/assets/templates/monorepo/glue/registry-entry.json.eta +5 -0
  77. package/assets/templates/monorepo/glue/route.tsx.eta +5 -0
  78. package/bin/mfeflow.js +4 -0
  79. package/dist/args.d.ts +68 -0
  80. package/dist/assets.d.ts +13 -0
  81. package/dist/catalog.d.ts +24 -0
  82. package/dist/checks/compat.d.ts +2 -0
  83. package/dist/checks/config.d.ts +8 -0
  84. package/dist/checks/env.d.ts +6 -0
  85. package/dist/checks/index.d.ts +6 -0
  86. package/dist/checks/plugins.d.ts +4 -0
  87. package/dist/checks/singletons.d.ts +9 -0
  88. package/dist/checks/workspace.d.ts +2 -0
  89. package/dist/cli.d.ts +11 -0
  90. package/dist/commands/add.d.ts +84 -0
  91. package/dist/commands/budget.d.ts +56 -0
  92. package/dist/commands/dev.d.ts +62 -0
  93. package/dist/commands/doctor.d.ts +141 -0
  94. package/dist/commands/env-key.d.ts +4 -0
  95. package/dist/commands/features.d.ts +53 -0
  96. package/dist/commands/init.d.ts +102 -0
  97. package/dist/devregistry.d.ts +19 -0
  98. package/dist/exit.d.ts +31 -0
  99. package/dist/findings.d.ts +35 -0
  100. package/dist/glue.d.ts +41 -0
  101. package/dist/help.d.ts +12 -0
  102. package/dist/index.d.ts +8 -0
  103. package/dist/index.js +4154 -0
  104. package/dist/inspect.d.ts +57 -0
  105. package/dist/io.d.ts +10 -0
  106. package/dist/local.d.ts +28 -0
  107. package/dist/options.d.ts +7 -0
  108. package/dist/output.d.ts +157 -0
  109. package/dist/pipeline.d.ts +7 -0
  110. package/dist/preset.d.ts +19 -0
  111. package/dist/proc.d.ts +79 -0
  112. package/dist/prompter.d.ts +28 -0
  113. package/dist/report.d.ts +26 -0
  114. package/dist/runtime.d.ts +17 -0
  115. package/dist/singletons.d.ts +11 -0
  116. package/dist/sizes.d.ts +17 -0
  117. package/dist/system.d.ts +20 -0
  118. package/dist/version.d.ts +8 -0
  119. package/dist/write.d.ts +26 -0
  120. package/package.json +66 -3
@@ -0,0 +1,141 @@
1
+ import type { ReportResult } from '../output.js';
2
+ import type { Runtime } from '../runtime.js';
3
+ export declare const DOCTOR_ARGS: {
4
+ readonly yes: {
5
+ readonly type: 'boolean';
6
+ readonly alias: 'y';
7
+ readonly description: 'Take the defaults and never prompt';
8
+ };
9
+ readonly preset: {
10
+ readonly type: 'string';
11
+ readonly description: 'Replay options from a JSON file or an https URL';
12
+ readonly valueHint: 'file|url';
13
+ };
14
+ readonly json: {
15
+ readonly type: 'boolean';
16
+ readonly description: 'Print one JSON document on stdout, nothing else';
17
+ };
18
+ readonly 'dry-run': {
19
+ readonly type: 'boolean';
20
+ readonly description: 'Print the summary and diff, write nothing';
21
+ };
22
+ readonly cwd: {
23
+ readonly type: 'string';
24
+ readonly description: 'Run as if started in this folder';
25
+ readonly valueHint: 'dir';
26
+ };
27
+ readonly install: {
28
+ readonly type: 'boolean';
29
+ readonly default: true;
30
+ readonly description: 'Run the package manager after writing (--no-install to skip)';
31
+ };
32
+ readonly verbose: {
33
+ readonly type: 'boolean';
34
+ readonly description: 'Show package manager output and stack traces';
35
+ };
36
+ readonly local: {
37
+ readonly type: 'string';
38
+ readonly description: 'Link @mfeflow/* from a built mfeflow checkout (env MFEFLOW_LOCAL)';
39
+ readonly valueHint: 'path';
40
+ };
41
+ readonly help: {
42
+ readonly type: 'boolean';
43
+ readonly alias: 'h';
44
+ readonly description: 'Show this help';
45
+ };
46
+ readonly fix: {
47
+ readonly type: 'boolean';
48
+ readonly description: 'Repair what is safe: missing workspace versions and registry entries';
49
+ };
50
+ };
51
+ export declare const VALIDATE_ARGS: {
52
+ readonly yes: {
53
+ readonly type: 'boolean';
54
+ readonly alias: 'y';
55
+ readonly description: 'Take the defaults and never prompt';
56
+ };
57
+ readonly preset: {
58
+ readonly type: 'string';
59
+ readonly description: 'Replay options from a JSON file or an https URL';
60
+ readonly valueHint: 'file|url';
61
+ };
62
+ readonly json: {
63
+ readonly type: 'boolean';
64
+ readonly description: 'Print one JSON document on stdout, nothing else';
65
+ };
66
+ readonly 'dry-run': {
67
+ readonly type: 'boolean';
68
+ readonly description: 'Print the summary and diff, write nothing';
69
+ };
70
+ readonly cwd: {
71
+ readonly type: 'string';
72
+ readonly description: 'Run as if started in this folder';
73
+ readonly valueHint: 'dir';
74
+ };
75
+ readonly install: {
76
+ readonly type: 'boolean';
77
+ readonly default: true;
78
+ readonly description: 'Run the package manager after writing (--no-install to skip)';
79
+ };
80
+ readonly verbose: {
81
+ readonly type: 'boolean';
82
+ readonly description: 'Show package manager output and stack traces';
83
+ };
84
+ readonly local: {
85
+ readonly type: 'string';
86
+ readonly description: 'Link @mfeflow/* from a built mfeflow checkout (env MFEFLOW_LOCAL)';
87
+ readonly valueHint: 'path';
88
+ };
89
+ readonly help: {
90
+ readonly type: 'boolean';
91
+ readonly alias: 'h';
92
+ readonly description: 'Show this help';
93
+ };
94
+ };
95
+ export declare const COMPAT_ARGS: {
96
+ readonly yes: {
97
+ readonly type: 'boolean';
98
+ readonly alias: 'y';
99
+ readonly description: 'Take the defaults and never prompt';
100
+ };
101
+ readonly preset: {
102
+ readonly type: 'string';
103
+ readonly description: 'Replay options from a JSON file or an https URL';
104
+ readonly valueHint: 'file|url';
105
+ };
106
+ readonly json: {
107
+ readonly type: 'boolean';
108
+ readonly description: 'Print one JSON document on stdout, nothing else';
109
+ };
110
+ readonly 'dry-run': {
111
+ readonly type: 'boolean';
112
+ readonly description: 'Print the summary and diff, write nothing';
113
+ };
114
+ readonly cwd: {
115
+ readonly type: 'string';
116
+ readonly description: 'Run as if started in this folder';
117
+ readonly valueHint: 'dir';
118
+ };
119
+ readonly install: {
120
+ readonly type: 'boolean';
121
+ readonly default: true;
122
+ readonly description: 'Run the package manager after writing (--no-install to skip)';
123
+ };
124
+ readonly verbose: {
125
+ readonly type: 'boolean';
126
+ readonly description: 'Show package manager output and stack traces';
127
+ };
128
+ readonly local: {
129
+ readonly type: 'string';
130
+ readonly description: 'Link @mfeflow/* from a built mfeflow checkout (env MFEFLOW_LOCAL)';
131
+ readonly valueHint: 'path';
132
+ };
133
+ readonly help: {
134
+ readonly type: 'boolean';
135
+ readonly alias: 'h';
136
+ readonly description: 'Show this help';
137
+ };
138
+ };
139
+ export declare function runDoctor(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<ReportResult>;
140
+ export declare function runValidate(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<ReportResult>;
141
+ export declare function runCheckCompat(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<ReportResult>;
@@ -0,0 +1,4 @@
1
+ import { type Globals } from '../args.js';
2
+ import { type AddResult } from '../output.js';
3
+ import type { Runtime } from '../runtime.js';
4
+ export declare function addEnvKey(rt: Runtime, globals: Globals, args: Record<string, unknown>, key: string | undefined): Promise<AddResult>;
@@ -0,0 +1,53 @@
1
+ import type { FeatureInfo, FeaturesResult } from '../output.js';
2
+ import type { Runtime } from '../runtime.js';
3
+ export declare const FEATURES_ARGS: {
4
+ readonly yes: {
5
+ readonly type: 'boolean';
6
+ readonly alias: 'y';
7
+ readonly description: 'Take the defaults and never prompt';
8
+ };
9
+ readonly preset: {
10
+ readonly type: 'string';
11
+ readonly description: 'Replay options from a JSON file or an https URL';
12
+ readonly valueHint: 'file|url';
13
+ };
14
+ readonly json: {
15
+ readonly type: 'boolean';
16
+ readonly description: 'Print one JSON document on stdout, nothing else';
17
+ };
18
+ readonly 'dry-run': {
19
+ readonly type: 'boolean';
20
+ readonly description: 'Print the summary and diff, write nothing';
21
+ };
22
+ readonly cwd: {
23
+ readonly type: 'string';
24
+ readonly description: 'Run as if started in this folder';
25
+ readonly valueHint: 'dir';
26
+ };
27
+ readonly install: {
28
+ readonly type: 'boolean';
29
+ readonly default: true;
30
+ readonly description: 'Run the package manager after writing (--no-install to skip)';
31
+ };
32
+ readonly verbose: {
33
+ readonly type: 'boolean';
34
+ readonly description: 'Show package manager output and stack traces';
35
+ };
36
+ readonly local: {
37
+ readonly type: 'string';
38
+ readonly description: 'Link @mfeflow/* from a built mfeflow checkout (env MFEFLOW_LOCAL)';
39
+ readonly valueHint: 'path';
40
+ };
41
+ readonly help: {
42
+ readonly type: 'boolean';
43
+ readonly alias: 'h';
44
+ readonly description: 'Show this help';
45
+ };
46
+ readonly search: {
47
+ readonly type: 'positional';
48
+ readonly required: false;
49
+ readonly description: 'Only features whose name or description contains this';
50
+ };
51
+ };
52
+ export declare function matches(feature: FeatureInfo, search: string): boolean;
53
+ export declare function runFeatures(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<FeaturesResult>;
@@ -0,0 +1,102 @@
1
+ import { type MfeflowProject } from '@mfeflow/core';
2
+ import { type Globals } from '../args.js';
3
+ import { type FeatureOptions } from '../options.js';
4
+ import { type InitResult } from '../output.js';
5
+ import { type Preset } from '../preset.js';
6
+ import type { Runtime } from '../runtime.js';
7
+ export declare const INIT_ARGS: {
8
+ readonly yes: {
9
+ readonly type: 'boolean';
10
+ readonly alias: 'y';
11
+ readonly description: 'Take the defaults and never prompt';
12
+ };
13
+ readonly preset: {
14
+ readonly type: 'string';
15
+ readonly description: 'Replay options from a JSON file or an https URL';
16
+ readonly valueHint: 'file|url';
17
+ };
18
+ readonly json: {
19
+ readonly type: 'boolean';
20
+ readonly description: 'Print one JSON document on stdout, nothing else';
21
+ };
22
+ readonly 'dry-run': {
23
+ readonly type: 'boolean';
24
+ readonly description: 'Print the summary and diff, write nothing';
25
+ };
26
+ readonly cwd: {
27
+ readonly type: 'string';
28
+ readonly description: 'Run as if started in this folder';
29
+ readonly valueHint: 'dir';
30
+ };
31
+ readonly install: {
32
+ readonly type: 'boolean';
33
+ readonly default: true;
34
+ readonly description: 'Run the package manager after writing (--no-install to skip)';
35
+ };
36
+ readonly verbose: {
37
+ readonly type: 'boolean';
38
+ readonly description: 'Show package manager output and stack traces';
39
+ };
40
+ readonly local: {
41
+ readonly type: 'string';
42
+ readonly description: 'Link @mfeflow/* from a built mfeflow checkout (env MFEFLOW_LOCAL)';
43
+ readonly valueHint: 'path';
44
+ };
45
+ readonly help: {
46
+ readonly type: 'boolean';
47
+ readonly alias: 'h';
48
+ readonly description: 'Show this help';
49
+ };
50
+ readonly dir: {
51
+ readonly type: 'positional';
52
+ readonly required: false;
53
+ readonly description: 'Folder to create (default mfeflow-app)';
54
+ };
55
+ readonly scope: {
56
+ readonly type: 'string';
57
+ readonly description: 'npm scope for the project packages, like @my-org';
58
+ readonly valueHint: '@scope';
59
+ };
60
+ readonly remotes: {
61
+ readonly type: 'string';
62
+ readonly description: 'Remotes to create, comma separated (default catalog,cart)';
63
+ readonly valueHint: 'a,b';
64
+ };
65
+ readonly features: {
66
+ readonly type: 'string';
67
+ readonly description: `Optional features, comma separated (${string})`;
68
+ readonly valueHint: 'a,b';
69
+ };
70
+ readonly 'package-manager': {
71
+ readonly type: 'string';
72
+ readonly description: 'pnpm (the only one in this release)';
73
+ readonly valueHint: 'pm';
74
+ };
75
+ readonly topology: {
76
+ readonly type: 'string';
77
+ readonly description: 'monorepo (the only one in this release)';
78
+ readonly valueHint: 'name';
79
+ };
80
+ readonly option: {
81
+ readonly type: 'string';
82
+ readonly description: 'A feature option, repeatable: --option feature.key=value';
83
+ readonly valueHint: 'f.k=v';
84
+ };
85
+ };
86
+ export interface InitOptions {
87
+ dir: string;
88
+ scope: string;
89
+ remotes: string[];
90
+ features: string[];
91
+ featureOptions: FeatureOptions;
92
+ }
93
+ /** `@` plus the folder name made safe for an npm scope. */
94
+ export declare function scopeFor(dir: string, cwd?: string): string;
95
+ export declare function checkRemotes(remotes: readonly string[]): void;
96
+ /** The optional features to install, validated and in catalogue order. */
97
+ export declare function checkFeatures(requested: readonly string[]): string[];
98
+ /** Flags win over the preset, the preset over prompts, prompts over defaults. */
99
+ export declare function resolveInitOptions(rt: Runtime, globals: Globals, args: Record<string, unknown>, raw: readonly string[], preset: Preset): Promise<InitOptions>;
100
+ export declare function assertEmpty(root: string, readdir?: (dir: string) => Promise<string[]>): Promise<void>;
101
+ export declare function skeleton(options: InitOptions): MfeflowProject;
102
+ export declare function runInit(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<InitResult>;
@@ -0,0 +1,19 @@
1
+ import type { ProjectView } from './inspect.js';
2
+ export interface DevRemote {
3
+ name: string;
4
+ entry: string;
5
+ version: string;
6
+ }
7
+ export interface DevIndex {
8
+ remotes: DevRemote[];
9
+ }
10
+ /** `name=url` flags as a map. A bare origin means its `/mf-manifest.json`. */
11
+ export declare function parseOverrides(flags: readonly string[], remotes: readonly string[]): Map<string, string>;
12
+ /** Throws E107 for an override outside localhost that `--allow-origin` did not name. */
13
+ export declare function assertAllowed(overrides: ReadonlyMap<string, string>, allowed: readonly string[]): void;
14
+ /**
15
+ * What the shell reads in dev: every remote of mfeflow.json, from registry/envs/dev when it has an
16
+ * entry (else from the remote's own port), with `overrides` replacing the entry URL.
17
+ */
18
+ export declare function devIndex(view: ProjectView, overrides?: ReadonlyMap<string, string>): DevIndex;
19
+ export declare const serializeIndex: (index: DevIndex) => string;
package/dist/exit.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ import { type MfeflowError } from '@mfeflow/core';
2
+ /** Stable exit codes. Scripts can branch on them; changing one is a breaking change. */
3
+ export declare const EXIT: {
4
+ readonly ok: 0;
5
+ readonly unexpected: 1;
6
+ readonly usage: 2;
7
+ readonly project: 3;
8
+ readonly feature: 4;
9
+ readonly build: 5;
10
+ readonly registry: 6;
11
+ readonly upgrade: 7;
12
+ readonly cancelled: 130;
13
+ };
14
+ /** Raised when the user backs out of a prompt. */
15
+ export declare class Cancelled extends Error {
16
+ constructor();
17
+ }
18
+ /** The exit code of a catalogue code such as `MFEFLOW_E301`. */
19
+ export declare function exitCodeOfCode(code: string): number;
20
+ export declare function exitCodeFor(error: unknown): number;
21
+ export interface ErrorReport {
22
+ code: string;
23
+ message: string;
24
+ fix: string;
25
+ docs: string;
26
+ }
27
+ export declare function reportOf(error: MfeflowError): ErrorReport;
28
+ /** What `--json` reports for an error that is no MfeflowError: a bug, so no code from the catalogue. */
29
+ export declare function unexpectedReport(error: unknown): ErrorReport;
30
+ /** What an unexpected (non-mfeflow) error prints: the message, and the stack with --verbose. */
31
+ export declare function unexpectedText(error: unknown, verbose: boolean): string;
@@ -0,0 +1,35 @@
1
+ import { type ErrorCode } from '@mfeflow/core';
2
+ import type { ProjectView } from './inspect.js';
3
+ export type Severity = 'error' | 'warning';
4
+ export interface Finding {
5
+ code: string;
6
+ severity: Severity;
7
+ /** The check that found it, like `config.ports`. */
8
+ check: string;
9
+ message: string;
10
+ fix: string;
11
+ docs: string;
12
+ app?: string;
13
+ path?: string;
14
+ /** `doctor --fix` can repair it. */
15
+ fixable: boolean;
16
+ }
17
+ export interface FindingOptions {
18
+ severity?: Severity;
19
+ app?: string;
20
+ path?: string;
21
+ fixable?: boolean;
22
+ }
23
+ /** A finding carrying the catalogue's code, message, fix and docs link. */
24
+ export declare function finding(check: string, code: ErrorCode, detail: string, options?: FindingOptions): Finding;
25
+ export interface CheckOutcome {
26
+ findings: Finding[];
27
+ /** Why the check did not run. */
28
+ skipped?: string;
29
+ }
30
+ export interface Check {
31
+ id: string;
32
+ title: string;
33
+ run(view: ProjectView): Promise<CheckOutcome>;
34
+ }
35
+ export declare const done: (findings: Finding[]) => Promise<CheckOutcome>;
package/dist/glue.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { type LoadedFeature, type MfeflowProject } from '@mfeflow/core';
2
+ import type { AssetRoots } from './assets.js';
3
+ export declare const SHELL_PORT = 4300;
4
+ export declare const REMOTE_PORT = 4311;
5
+ export declare function assertAppName(name: string, apps?: MfeflowProject['apps']): void;
6
+ /** The first free port from `start` upwards. */
7
+ export declare function freePort(project: Pick<MfeflowProject, 'apps'>, start: number): number;
8
+ export declare function routeComponent(remote: string): string;
9
+ export declare const REGISTRY_ENVS: readonly ['dev', 'staging', 'prod'];
10
+ export interface RemoteSpec {
11
+ name: string;
12
+ port: number;
13
+ }
14
+ export interface GlueOptions {
15
+ roots: AssetRoots;
16
+ /** Version of the `core` feature, so the plan records what generated these files. */
17
+ version: string;
18
+ remote: RemoteSpec;
19
+ /** Write `registry/envs/<env>/<name>.json`. */
20
+ registry: boolean;
21
+ /** Apps (a shell name, or "shell" for every shell) that get a route to the remote. */
22
+ shells: readonly string[];
23
+ }
24
+ export interface RegistryEntryFile {
25
+ path: string;
26
+ content: string;
27
+ }
28
+ /** `registry/envs/<env>/<name>.json` for dev, staging and prod: dev points at the remote's dev server. */
29
+ export declare function registryEntryFiles(roots: AssetRoots, remote: RemoteSpec, envs?: readonly string[]): Promise<RegistryEntryFile[]>;
30
+ /**
31
+ * The parts of adding a remote that belong to no single app: its registry
32
+ * entries, and a route in each shell. Returned as a feature so the engine
33
+ * applies it like any other, with the same checks and the same plan.
34
+ */
35
+ export declare function remoteGlue(options: GlueOptions): Promise<LoadedFeature>;
36
+ /**
37
+ * The parts of `feature` that target `from` (`shell` or `remotes`), retargeted
38
+ * at one app, so a new app gets what every existing one of its kind got.
39
+ * Undefined when the feature has nothing for that kind.
40
+ */
41
+ export declare function partsForApp(feature: LoadedFeature, from: 'shell' | 'remotes', app: string): LoadedFeature | undefined;
package/dist/help.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import type { ArgsDef } from 'citty';
2
+ export declare const REPO_URL = "https://github.com/mfeflow/mfeflow";
3
+ export interface CommandHelp {
4
+ name: string;
5
+ summary: string;
6
+ usage: string;
7
+ args: ArgsDef;
8
+ examples: readonly string[];
9
+ }
10
+ export declare function commandHelp(help: CommandHelp): string;
11
+ export declare function exitCodesText(): string;
12
+ export declare function rootHelp(commands: readonly CommandHelp[]): string;
@@ -0,0 +1,8 @@
1
+ export { main } from './cli.js';
2
+ export { COMMANDS } from './cli.js';
3
+ export { EXIT, exitCodeFor } from './exit.js';
4
+ export { validateResult } from './output.js';
5
+ export type { AddResult, BudgetResult, DevResult, CliResult, FailureResult, FeatureInfo, FeaturesResult, InitResult, PlanReport, ReportResult, } from './output.js';
6
+ export { realRuntime, type Runtime } from './runtime.js';
7
+ export type { Io } from './io.js';
8
+ export type { Prompter } from './prompter.js';