mfeflow 0.4.0 → 0.6.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 +14 -5
- package/assets/features/analytics-gtm/feature.json +1 -1
- package/assets/features/ci-github/feature.json +1 -1
- package/assets/features/env-t3/feature.json +1 -1
- package/assets/features/lint-oxlint/feature.json +1 -1
- package/assets/features/registry-server/feature.json +128 -0
- package/assets/features/registry-server/files/deploy-server.yml +69 -0
- package/assets/features/registry-server/files/registry-server.md.eta +52 -0
- package/assets/features/registry-server/files/registry-sources.ts +12 -0
- package/assets/features/registry-static/feature.json +61 -0
- package/assets/features/registry-static/files/deploy.yml +61 -0
- package/assets/features/registry-static/files/registry.md.eta +49 -0
- package/assets/features/release/feature.json +43 -0
- package/assets/features/release/files/changeset-readme.md +7 -0
- package/assets/features/release/files/config.json +10 -0
- package/assets/features/release/files/releasing.md +21 -0
- package/assets/features/testing/feature.json +1 -1
- package/assets/features/tsconfig/feature.json +1 -1
- package/assets/features/url-factory/feature.json +1 -1
- package/assets/templates/monorepo/feature.json +13 -6
- package/assets/templates/monorepo/files/remote/{mfe.json.eta → mfeflow.app.json.eta} +1 -0
- package/assets/templates/monorepo/files/root/README.md.eta +16 -1
- package/assets/templates/monorepo/files/shell/{mfe.json.eta → mfeflow.app.json.eta} +1 -0
- package/assets/templates/monorepo/files/shell/rsbuild.config.ts.eta +42 -6
- package/assets/templates/monorepo/files/shell/src/assert.ts.eta +37 -0
- package/assets/templates/monorepo/files/shell/src/bootstrap.tsx.eta +12 -2
- package/assets/templates/monorepo/migrations/0.4.0-app-file.mjs +58 -0
- package/assets/templates/polyrepo/feature.json +305 -0
- package/assets/templates/polyrepo/files/AGENTS.md.eta +15 -0
- package/assets/templates/polyrepo/files/changeset/README.md +5 -0
- package/assets/templates/polyrepo/files/changeset/config.json +9 -0
- package/assets/templates/polyrepo/files/packages/contracts/package.json.eta +23 -0
- package/assets/templates/polyrepo/files/packages/contracts/src/index.ts +11 -0
- package/assets/templates/polyrepo/files/packages/contracts/tsconfig.json.eta +5 -0
- package/assets/templates/polyrepo/files/packages/tokens/package.json.eta +23 -0
- package/assets/templates/polyrepo/files/packages/tokens/src/index.ts +13 -0
- package/assets/templates/polyrepo/files/packages/tokens/tsconfig.json.eta +5 -0
- package/assets/templates/polyrepo/files/platform/README.md.eta +43 -0
- package/assets/templates/polyrepo/files/platform/default.json.eta +27 -0
- package/assets/templates/polyrepo/files/remote/README.md.eta +23 -0
- package/assets/templates/polyrepo/files/renovate.json.eta +4 -0
- package/assets/templates/polyrepo/files/shell/README.md.eta +32 -0
- package/assets/templates/polyrepo/files/tsconfig.base.json.eta +13 -0
- package/assets/templates/polyrepo/files/workflows/platform-ci.yml +29 -0
- package/assets/templates/polyrepo/files/workflows/release.yml +40 -0
- package/assets/templates/polyrepo/files/workflows/reusable-ci.yml.eta +50 -0
- package/assets/templates/polyrepo/files/workflows/team-ci.yml.eta +12 -0
- package/dist/against.d.ts +16 -0
- package/dist/catalog.d.ts +8 -0
- package/dist/checks/compat.d.ts +12 -0
- package/dist/checks/index.d.ts +0 -1
- package/dist/checks/singletons.d.ts +2 -5
- package/dist/commands/add.d.ts +4 -2
- package/dist/commands/adopt.d.ts +54 -0
- package/dist/commands/deploy.d.ts +262 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/init.d.ts +9 -1
- package/dist/commands/server-mode.d.ts +210 -0
- package/dist/commands/status.d.ts +63 -0
- package/dist/commands/team-repo.d.ts +9 -0
- package/dist/commands/upgrade.d.ts +66 -0
- package/dist/deploy-testing.d.ts +41 -0
- package/dist/devregistry.d.ts +4 -5
- package/dist/devremotes.d.ts +15 -0
- package/dist/exit.d.ts +2 -1
- package/dist/glue.d.ts +6 -0
- package/dist/hosts.d.ts +25 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5477 -1643
- package/dist/inspect.d.ts +14 -2
- package/dist/output.d.ts +214 -7
- package/dist/pipeline.d.ts +13 -2
- package/dist/polyrepo.d.ts +69 -0
- package/dist/publish.d.ts +98 -0
- package/dist/runtime.d.ts +10 -1
- package/dist/server-client.d.ts +61 -0
- package/dist/system.d.ts +2 -0
- package/dist/testing.d.ts +82 -0
- package/dist/trust.d.ts +4 -0
- package/dist/upgrade.d.ts +25 -0
- package/dist/write.d.ts +8 -0
- package/package.json +5 -4
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type MfeflowError } from '@mfeflow/core';
|
|
2
|
+
import type { Io } from './io.js';
|
|
3
|
+
import type { DevHost, DevProcess, DevSpec, WaitPolicy } from './proc.js';
|
|
4
|
+
import type { Prompter } from './prompter.js';
|
|
5
|
+
import type { Runtime } from './runtime.js';
|
|
6
|
+
import { type Run, type System } from './system.js';
|
|
7
|
+
/** The checkout this package lives in; `--local` tests point at it. */
|
|
8
|
+
export declare const REPO: string;
|
|
9
|
+
export interface Recorded {
|
|
10
|
+
out: string[];
|
|
11
|
+
err: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function fakeIo(overrides?: Partial<Io>): Io & Recorded;
|
|
14
|
+
/** Answers prompts in the order they are asked, from `answers`; records the messages. */
|
|
15
|
+
export declare function scriptedPrompter(answers?: readonly unknown[]): Prompter & {
|
|
16
|
+
asked: string[];
|
|
17
|
+
};
|
|
18
|
+
export interface SystemCalls {
|
|
19
|
+
installs: {
|
|
20
|
+
root: string;
|
|
21
|
+
packageManager: string;
|
|
22
|
+
verbose: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
gitInits: string[];
|
|
25
|
+
repoInits: string[];
|
|
26
|
+
}
|
|
27
|
+
export declare function fakeSystem(options?: {
|
|
28
|
+
installError?: Error;
|
|
29
|
+
gitInit?: boolean;
|
|
30
|
+
}): System & SystemCalls;
|
|
31
|
+
export interface FakeProc extends DevProcess {
|
|
32
|
+
spec: DevSpec;
|
|
33
|
+
stopped: boolean;
|
|
34
|
+
/** What the process prints. */
|
|
35
|
+
print(text: string): void;
|
|
36
|
+
/** The process ends by itself. */
|
|
37
|
+
exit(code: number | null): void;
|
|
38
|
+
}
|
|
39
|
+
export interface FakeDev extends DevHost {
|
|
40
|
+
procs: FakeProc[];
|
|
41
|
+
/** Ports `portFree` reports as taken. */
|
|
42
|
+
busy: Set<number>;
|
|
43
|
+
watched: string[][];
|
|
44
|
+
/** The watched files changed. */
|
|
45
|
+
change(): void;
|
|
46
|
+
/** Ctrl+C. */
|
|
47
|
+
interrupt(): void;
|
|
48
|
+
waitPolicy: WaitPolicy;
|
|
49
|
+
}
|
|
50
|
+
export declare function fakeDev(): FakeDev;
|
|
51
|
+
export type TestRuntime = Runtime & {
|
|
52
|
+
io: Io & Recorded;
|
|
53
|
+
system: System & SystemCalls;
|
|
54
|
+
dev: FakeDev;
|
|
55
|
+
};
|
|
56
|
+
export declare function testRuntime(overrides?: Partial<Pick<Runtime, 'prompter' | 'fetch' | 'roots' | 'configDir'>> & {
|
|
57
|
+
/** Namespaces trusted for this run, through MFEFLOW_TRUST_REGISTRIES. */
|
|
58
|
+
trust?: string[];
|
|
59
|
+
}): TestRuntime;
|
|
60
|
+
export declare function tempDir(prefix?: string): Promise<string>;
|
|
61
|
+
export declare function removeDir(dir: string): Promise<void>;
|
|
62
|
+
/** Every file under `dir`, as `/`-separated paths mapped to content. */
|
|
63
|
+
export declare function readTree(dir: string): Promise<Record<string, string>>;
|
|
64
|
+
/** Awaits a promise that must reject with an MfeflowError and returns it. */
|
|
65
|
+
export declare function failure(promise: Promise<unknown>): Promise<MfeflowError>;
|
|
66
|
+
/** Calls `fn`, which must throw an MfeflowError, and returns it. */
|
|
67
|
+
export declare function thrown(fn: () => unknown): MfeflowError;
|
|
68
|
+
/** Where git is installed, from a fixed list of system folders, never from a PATH search. */
|
|
69
|
+
export declare function gitBinary(): string;
|
|
70
|
+
/**
|
|
71
|
+
* The environment git runs in: no `GIT_*` variable, so git works on the folder it is run in and
|
|
72
|
+
* nothing else, and a PATH of git's own folder only.
|
|
73
|
+
*/
|
|
74
|
+
export declare function cleanGitEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
75
|
+
/** Runs git with a clean environment in `cwd`; returns what it printed. */
|
|
76
|
+
export declare function git(cwd: string, ...args: string[]): string;
|
|
77
|
+
/** A `Run` that runs git by its fixed path in a clean environment, and refuses any other program. */
|
|
78
|
+
export declare const gitRunner: Run;
|
|
79
|
+
/** A system that runs the real `git init` (with a clean environment) and no install. */
|
|
80
|
+
export declare function gitSystem(): System & SystemCalls;
|
|
81
|
+
/** `file` with forward slashes, the way git prints a path on every OS. */
|
|
82
|
+
export declare function posixPath(file: string): string;
|
package/dist/trust.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Trusted } from '@mfeflow/core';
|
|
2
|
+
import type { Runtime } from './runtime.js';
|
|
3
|
+
/** What this user trusts among `registries`: the trust file, or MFEFLOW_TRUST_REGISTRIES (public hosts only unless pinned to a template). */
|
|
4
|
+
export declare function trustedIn(rt: Runtime, registries: Record<string, string> | undefined): Promise<Trusted>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type MfeflowProject, type UpgradeDecisions, type UpgradePlan } from '@mfeflow/core';
|
|
2
|
+
import type { AssetRoots } from './assets.js';
|
|
3
|
+
import type { FetchLike } from '@mfeflow/core';
|
|
4
|
+
export interface UpgradeContext {
|
|
5
|
+
roots: AssetRoots;
|
|
6
|
+
fetch: FetchLike;
|
|
7
|
+
/** Registry namespaces the user trusts to be on loopback or private addresses. */
|
|
8
|
+
trusted?: ReadonlySet<string>;
|
|
9
|
+
/** Take registry content that differs from the hash recorded in mfeflow.json: every feature (`true`) or the named ones. */
|
|
10
|
+
acceptChanged?: boolean | ReadonlySet<string>;
|
|
11
|
+
}
|
|
12
|
+
/** How a registry feature's content compared with the hash recorded for it. */
|
|
13
|
+
export type IntegrityState = 'verified' | 'first-seen' | 'accepted-changed';
|
|
14
|
+
export interface ProjectUpgrade extends UpgradePlan {
|
|
15
|
+
/** Registry features by name. `first-seen`: no hash was recorded, so the served content could not be checked. */
|
|
16
|
+
integrity: Record<string, IntegrityState>;
|
|
17
|
+
}
|
|
18
|
+
/** The features `init` would apply for these recorded ones, in its order, `core` and `tsconfig` first. */
|
|
19
|
+
export declare function replayOrder(project: MfeflowProject): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Plans moving the project at `root` to `toVersion` (default: this CLI) from the templates and
|
|
22
|
+
* features this CLI ships. A recorded feature that cannot be loaded, or that a registry serves at
|
|
23
|
+
* another version than the one installed, is left out and named in the plan's warnings.
|
|
24
|
+
*/
|
|
25
|
+
export declare function planProjectUpgrade(ctx: UpgradeContext, root: string, project: MfeflowProject, toVersion?: string, decisions?: UpgradeDecisions): Promise<ProjectUpgrade>;
|
package/dist/write.d.ts
CHANGED
|
@@ -10,6 +10,14 @@ export interface WriteRequest {
|
|
|
10
10
|
project: MfeflowProject;
|
|
11
11
|
/** Runs once the files are written, before the install (`git init` for hooks that need a repo). */
|
|
12
12
|
afterWrite?: () => Promise<void>;
|
|
13
|
+
/** Install even when the plan adds no dependency, for a plan that moves ranges. */
|
|
14
|
+
install?: boolean;
|
|
15
|
+
/** Take `project` as it is: its `cli` is the version being upgraded to, not the one running. */
|
|
16
|
+
exactProject?: boolean;
|
|
17
|
+
/** Refuse to write through any symlink on a file's path, checked when the files are written. */
|
|
18
|
+
refuseSymlinks?: boolean;
|
|
19
|
+
/** The caller prints the summary and diff itself. */
|
|
20
|
+
quiet?: boolean;
|
|
13
21
|
}
|
|
14
22
|
export interface WriteOutcome {
|
|
15
23
|
dryRun: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mfeflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Create and grow a React micro-frontend platform: mfeflow init, add remote, add <feature>.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"micro-frontend",
|
|
@@ -49,14 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@clack/prompts": "1.8.1",
|
|
52
|
-
"@mfeflow/contracts": "0.
|
|
53
|
-
"@mfeflow/core": "0.
|
|
52
|
+
"@mfeflow/contracts": "0.6.0",
|
|
53
|
+
"@mfeflow/core": "0.6.0",
|
|
54
|
+
"@mfeflow/registry": "0.6.0",
|
|
54
55
|
"citty": "0.2.2",
|
|
55
56
|
"semver": "7.8.5",
|
|
56
57
|
"yaml": "2.9.1"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@mfeflow/rsbuild": "0.
|
|
60
|
+
"@mfeflow/rsbuild": "0.6.0",
|
|
60
61
|
"@rslib/core": "1.0.5",
|
|
61
62
|
"@types/node": "26.6.6",
|
|
62
63
|
"@types/semver": "7.8.0",
|