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,11 @@
|
|
|
1
|
+
// Names and shapes that more than one repo depends on. A change here is a change for every team,
|
|
2
|
+
// so it goes through a pull request and a changeset like any other published package.
|
|
3
|
+
export const EVENTS = {
|
|
4
|
+
navigate: 'platform:navigate',
|
|
5
|
+
} as const;
|
|
6
|
+
|
|
7
|
+
export type EventName = (typeof EVENTS)[keyof typeof EVENTS];
|
|
8
|
+
|
|
9
|
+
export interface NavigateEvent {
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= it.scope %>/tokens",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Colors and spacing every team uses.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": ["dist"],
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "catalog:"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# <%= it.scope.slice(1) %>-platform
|
|
2
|
+
|
|
3
|
+
The shared repo of a polyrepo made with [mfeflow](https://github.com/mfeflow/mfeflow). The shell and
|
|
4
|
+
every team repo sit next to it and depend on what is published from here.
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
packages/contracts <%= it.scope %>/contracts: event names and types every repo agrees on
|
|
8
|
+
packages/tokens <%= it.scope %>/tokens: colors and spacing
|
|
9
|
+
.github/workflows reusable-ci.yml (the CI every team repo calls), ci.yml, release.yml
|
|
10
|
+
default.json the Renovate preset every repo extends
|
|
11
|
+
.changeset how a change here gets a version
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Run it
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Build here first. The shell and the team repos link to `packages/*/dist` until you publish.
|
|
22
|
+
|
|
23
|
+
## Change a package
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pnpm changeset # describe the change and pick the bump
|
|
27
|
+
pnpm build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Commit the changeset with your change. After the pull request merges, the release workflow opens a
|
|
31
|
+
version pull request. Merging that publishes the packages.
|
|
32
|
+
|
|
33
|
+
## Where the packages are published
|
|
34
|
+
|
|
35
|
+
The team repos install `<%= it.scope %>/*` with `link:../platform/packages/*` paths so a first run needs
|
|
36
|
+
no registry. To share the packages across machines and CI, publish them to a registry and replace the
|
|
37
|
+
`link:` ranges in each repo with a version:
|
|
38
|
+
|
|
39
|
+
- npm: set `NPM_TOKEN` as a repository secret. Packages are public.
|
|
40
|
+
- GitHub Packages: add `<%= it.scope %>:registry=https://npm.pkg.github.com` to `.npmrc` in every repo.
|
|
41
|
+
- A private registry: put its URL in `.npmrc` and set `publishConfig.registry` in each package.
|
|
42
|
+
|
|
43
|
+
Creating the GitHub repos and the registry account is up to you. mfeflow never calls GitHub.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"description": "Renovate preset for every <%= it.options.org || it.scope.slice(1) %> repo. Each repo extends it with github><%= it.options.org || it.scope.slice(1) %>/platform.",
|
|
4
|
+
"extends": ["config:recommended"],
|
|
5
|
+
"packageRules": [
|
|
6
|
+
{
|
|
7
|
+
"description": "Singletons the shell and every remote must share move in one pull request per repo.",
|
|
8
|
+
"matchPackageNames": ["react", "react-dom", "@types/react", "@types/react-dom"],
|
|
9
|
+
"groupName": "react"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"description": "Module Federation and Rsbuild have to stay on versions that work together.",
|
|
13
|
+
"matchPackageNames": ["@module-federation/**", "@rsbuild/**"],
|
|
14
|
+
"groupName": "module federation and rsbuild"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"description": "mfeflow packages are released together.",
|
|
18
|
+
"matchPackageNames": ["mfeflow", "@mfeflow/**"],
|
|
19
|
+
"groupName": "mfeflow"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"description": "The packages this org publishes from its platform repo.",
|
|
23
|
+
"matchPackageNames": ["<%= it.scope %>/**"],
|
|
24
|
+
"groupName": "platform packages"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# <%= it.scope.slice(1) %>-<%= it.options.name %>
|
|
2
|
+
|
|
3
|
+
A remote of a polyrepo made with [mfeflow](https://github.com/mfeflow/mfeflow). It exposes `./App`
|
|
4
|
+
and is deployed on its own. The shell lives in its own repo.
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
apps/<%= it.options.name %> the remote
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Run it
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
pnpm install
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`pnpm dev` serves the remote on its own port. To see it inside the shell, run `pnpm dev` in the shell
|
|
18
|
+
repo too: the shell's dev config lists this remote's dev server.
|
|
19
|
+
|
|
20
|
+
## Deploy it
|
|
21
|
+
|
|
22
|
+
Each remote is deployed on its own. The registry entries live in the shell repo, not here. See
|
|
23
|
+
"Deploy and roll back" in the mfeflow docs for the commands.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# <%= it.scope.slice(1) %>-shell
|
|
2
|
+
|
|
3
|
+
The shell of a polyrepo made with [mfeflow](https://github.com/mfeflow/mfeflow): routes, layout and
|
|
4
|
+
the registry that tells it which build of each remote to load. The remotes are in their own repos.
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
apps/shell the host
|
|
8
|
+
apps/shell/public/config/runtime-config.* per environment; dev lists where the remotes run
|
|
9
|
+
registry/envs which build of each remote staging and prod serve
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Run it
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
pnpm install
|
|
16
|
+
pnpm dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`pnpm dev` starts the shell on http://localhost:4300. It finds each remote in `devRemotes` in
|
|
20
|
+
`apps/shell/public/config/runtime-config.dev.json`. Start a remote with `pnpm dev` in its own repo.
|
|
21
|
+
|
|
22
|
+
`pnpm mfeflow dev` runs the shell the same way and reloads the list when that file changes.
|
|
23
|
+
Point one remote somewhere else for a run with `pnpm mfeflow dev --remote cart=http://localhost:3001`.
|
|
24
|
+
|
|
25
|
+
## Add a team repo
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pnpm mfeflow add team-repo checkout
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This creates `../checkout` as a new git repo and registers it here. Run `git init` and the GitHub
|
|
32
|
+
steps yourself.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
"verbatimModuleSyntax": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"types": []
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
6
|
+
permissions: {}
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ci-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
check:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
|
+
with:
|
|
21
|
+
persist-credentials: false
|
|
22
|
+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
23
|
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
24
|
+
with:
|
|
25
|
+
node-version: lts/*
|
|
26
|
+
cache: pnpm
|
|
27
|
+
- run: pnpm install
|
|
28
|
+
- run: pnpm build
|
|
29
|
+
- run: pnpm mfeflow validate
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# Publishes the packages in packages/ when a "chore: version packages" pull request is merged.
|
|
4
|
+
# Set the NPM_TOKEN secret for npm, or change the registry in .npmrc for GitHub Packages.
|
|
5
|
+
# Dormant until the repository variable RELEASE_ENABLED is 'true'.
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
permissions: {}
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: release
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
release:
|
|
18
|
+
if: vars.RELEASE_ENABLED == 'true'
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
pull-requests: write
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
28
|
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
29
|
+
with:
|
|
30
|
+
node-version: lts/*
|
|
31
|
+
registry-url: https://registry.npmjs.org
|
|
32
|
+
- run: pnpm install
|
|
33
|
+
- uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2
|
|
34
|
+
with:
|
|
35
|
+
publish: pnpm release
|
|
36
|
+
pr-title: 'chore: version packages'
|
|
37
|
+
commit-message: 'chore: version packages'
|
|
38
|
+
env:
|
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
40
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: reusable-ci
|
|
2
|
+
|
|
3
|
+
# Every team repo calls this file from its own workflow:
|
|
4
|
+
#
|
|
5
|
+
# jobs:
|
|
6
|
+
# ci:
|
|
7
|
+
# uses: <%= it.options.org || it.scope.slice(1) %>/platform/.github/workflows/reusable-ci.yml@main
|
|
8
|
+
#
|
|
9
|
+
# A private platform repo has to allow it under Settings > Actions > General > Access.
|
|
10
|
+
on:
|
|
11
|
+
workflow_call:
|
|
12
|
+
inputs:
|
|
13
|
+
node-version:
|
|
14
|
+
description: Node version to run the checks on
|
|
15
|
+
type: string
|
|
16
|
+
default: lts/*
|
|
17
|
+
run-budget:
|
|
18
|
+
description: Also run mfeflow budget after the build
|
|
19
|
+
type: boolean
|
|
20
|
+
default: false
|
|
21
|
+
|
|
22
|
+
permissions: {}
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
check:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
timeout-minutes: 20
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
32
|
+
with:
|
|
33
|
+
persist-credentials: false
|
|
34
|
+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
35
|
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
36
|
+
with:
|
|
37
|
+
node-version: ${{ inputs.node-version }}
|
|
38
|
+
cache: pnpm
|
|
39
|
+
- run: pnpm install
|
|
40
|
+
- run: pnpm run --if-present typecheck
|
|
41
|
+
- run: pnpm run --if-present lint
|
|
42
|
+
- run: pnpm run --if-present test
|
|
43
|
+
- run: pnpm build
|
|
44
|
+
- name: mfeflow validate
|
|
45
|
+
run: pnpm mfeflow validate
|
|
46
|
+
- name: mfeflow doctor
|
|
47
|
+
run: pnpm mfeflow doctor
|
|
48
|
+
- name: mfeflow budget
|
|
49
|
+
if: ${{ inputs.run-budget }}
|
|
50
|
+
run: pnpm mfeflow budget
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type FetchLike } from '@mfeflow/core';
|
|
2
|
+
/** The shell a remote is checked against, as its deployed `mf-manifest.json`. */
|
|
3
|
+
export interface ShellSource {
|
|
4
|
+
/** What the user passed, for the report. */
|
|
5
|
+
from: string;
|
|
6
|
+
manifest: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The shell's `mf-manifest.json` from `source`: the manifest itself, or a registry index, whose
|
|
10
|
+
* `shell/mf-manifest.json` is read from beside it. `source` is a file or an https URL (http on
|
|
11
|
+
* localhost). Fails with E307 on anything else.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadShell(source: string, options: {
|
|
14
|
+
cwd: string;
|
|
15
|
+
fetch: FetchLike;
|
|
16
|
+
}): Promise<ShellSource>;
|
package/dist/catalog.d.ts
CHANGED
|
@@ -13,12 +13,20 @@ export declare function isFirstParty(name: string): boolean;
|
|
|
13
13
|
/** The first-party features a user may pick, in catalogue order. */
|
|
14
14
|
export declare const OPTIONAL_FEATURES: readonly string[];
|
|
15
15
|
export declare const DEFAULT_FEATURES: readonly string[];
|
|
16
|
+
/** `polyrepo` is applied by `init --topology polyrepo`; it is not offered by `add` or listed by `features`. */
|
|
17
|
+
export declare const POLYREPO_FEATURE = "polyrepo";
|
|
16
18
|
export interface FeatureSource {
|
|
17
19
|
roots: AssetRoots;
|
|
18
20
|
registries?: Record<string, string> | undefined;
|
|
19
21
|
fetch?: FetchLike | undefined;
|
|
20
22
|
/** The version to ask a registry for, when its URL template can pin one. */
|
|
21
23
|
version?: string | undefined;
|
|
24
|
+
/** Namespaces the user trusts, so their registries may be on loopback or private addresses. */
|
|
25
|
+
trusted?: ReadonlySet<string> | undefined;
|
|
26
|
+
/** Compare the registry index's version with the feature.json's. */
|
|
27
|
+
checkIndex?: boolean | undefined;
|
|
22
28
|
}
|
|
23
29
|
/** A first-party feature by name, or `@namespace/name` from a configured registry. */
|
|
24
30
|
export declare function loadAny(name: string, source: FeatureSource): Promise<LoadedFeature>;
|
|
31
|
+
/** First-party features in the order `init` applies them, then the rest as typed: a feature may edit another's files. */
|
|
32
|
+
export declare function inCatalogueOrder(names: readonly string[]): string[];
|
package/dist/checks/compat.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import { type Check } from '../findings.js';
|
|
2
|
+
/** Where the shell's versions come from when it is not in this repo. */
|
|
3
|
+
export interface AgainstShell {
|
|
4
|
+
from: string;
|
|
5
|
+
manifest: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare const ABSENT_SHELL_WARNING = "shell is not in this repo, pass --against <url|file>";
|
|
8
|
+
/**
|
|
9
|
+
* Each remote's shared ranges against the shell. The shell comes from `against` (a deployed
|
|
10
|
+
* manifest) when given, else from the shells in this repo; with neither, the check warns
|
|
11
|
+
* instead of passing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function compatCheck(against?: AgainstShell, under?: 'check-compat' | 'doctor'): Check;
|
|
2
14
|
export declare const compat: Check;
|
package/dist/checks/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Check } from '../findings.js';
|
|
2
2
|
/** What `mfeflow validate` runs: the files against their schemas and each other. */
|
|
3
3
|
export declare const VALIDATE_CHECKS: readonly Check[];
|
|
4
|
-
export declare const COMPAT_CHECKS: readonly Check[];
|
|
5
4
|
/** Every check `mfeflow doctor` runs, in order. */
|
|
6
5
|
export declare const DOCTOR_CHECKS: readonly Check[];
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { comparable } from '@mfeflow/registry/static';
|
|
1
2
|
import { type Check, type Finding } from '../findings.js';
|
|
2
|
-
|
|
3
|
-
* The comparable version behind an installed version or a declared range. Undefined for a spec
|
|
4
|
-
* that names no version (`link:`, `workspace:*`, `catalog:`, `latest`): it is only known after install.
|
|
5
|
-
*/
|
|
6
|
-
export declare function comparable(version: string): string | undefined;
|
|
3
|
+
export { comparable };
|
|
7
4
|
/** The warning for specs that cannot be compared before install. */
|
|
8
5
|
export declare function unresolved(check: string, code: 'E301' | 'E302', name: string, specs: readonly string[]): Finding;
|
|
9
6
|
export declare const singletonVersions: Check;
|
package/dist/commands/add.d.ts
CHANGED
|
@@ -78,7 +78,9 @@ export declare const ADD_ARGS: {
|
|
|
78
78
|
readonly description: 'add env-key: root, every shell or every remote, instead of --app';
|
|
79
79
|
readonly valueHint: 'root|shell|remotes';
|
|
80
80
|
};
|
|
81
|
+
readonly 'accept-changed-content': {
|
|
82
|
+
readonly type: 'boolean';
|
|
83
|
+
readonly description: 'Take a registry feature whose content differs from the hash recorded in mfeflow.json';
|
|
84
|
+
};
|
|
81
85
|
};
|
|
82
|
-
/** First-party features in the order `init` applies them, then the rest as typed: a feature may edit another's files. */
|
|
83
|
-
export declare function inCatalogueOrder(names: readonly string[]): string[];
|
|
84
86
|
export declare function runAdd(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<AddResult>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type Plan } from '@mfeflow/core';
|
|
2
|
+
import { type AdoptResult } from '../output.js';
|
|
3
|
+
import type { Runtime } from '../runtime.js';
|
|
4
|
+
export declare const ADOPT_ARGS: {
|
|
5
|
+
readonly yes: {
|
|
6
|
+
readonly type: 'boolean';
|
|
7
|
+
readonly alias: 'y';
|
|
8
|
+
readonly description: 'Take the defaults and never prompt';
|
|
9
|
+
};
|
|
10
|
+
readonly preset: {
|
|
11
|
+
readonly type: 'string';
|
|
12
|
+
readonly description: 'Replay options from a JSON file or an https URL';
|
|
13
|
+
readonly valueHint: 'file|url';
|
|
14
|
+
};
|
|
15
|
+
readonly json: {
|
|
16
|
+
readonly type: 'boolean';
|
|
17
|
+
readonly description: 'Print one JSON document on stdout, nothing else';
|
|
18
|
+
};
|
|
19
|
+
readonly 'dry-run': {
|
|
20
|
+
readonly type: 'boolean';
|
|
21
|
+
readonly description: 'Print the summary and diff, write nothing';
|
|
22
|
+
};
|
|
23
|
+
readonly cwd: {
|
|
24
|
+
readonly type: 'string';
|
|
25
|
+
readonly description: 'Run as if started in this folder';
|
|
26
|
+
readonly valueHint: 'dir';
|
|
27
|
+
};
|
|
28
|
+
readonly install: {
|
|
29
|
+
readonly type: 'boolean';
|
|
30
|
+
readonly default: true;
|
|
31
|
+
readonly description: 'Run the package manager after writing (--no-install to skip)';
|
|
32
|
+
};
|
|
33
|
+
readonly verbose: {
|
|
34
|
+
readonly type: 'boolean';
|
|
35
|
+
readonly description: 'Show package manager output and stack traces';
|
|
36
|
+
};
|
|
37
|
+
readonly local: {
|
|
38
|
+
readonly type: 'string';
|
|
39
|
+
readonly description: 'Link @mfeflow/* from a built mfeflow checkout (env MFEFLOW_LOCAL)';
|
|
40
|
+
readonly valueHint: 'path';
|
|
41
|
+
};
|
|
42
|
+
readonly help: {
|
|
43
|
+
readonly type: 'boolean';
|
|
44
|
+
readonly alias: 'h';
|
|
45
|
+
readonly description: 'Show this help';
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** The lines to paste into the shared list of a build config, which adopt never edits. */
|
|
49
|
+
export declare const SHARED_SNIPPET = " '@mfeflow/runtime': { singleton: true },";
|
|
50
|
+
/** mfeflow.json may have appeared since the first check; the plan would then overwrite it. */
|
|
51
|
+
export declare function assertNoProjectFile(plan: Plan): void;
|
|
52
|
+
/** A last guard behind the promise that adopt never edits a build config. */
|
|
53
|
+
export declare function assertBuildConfigUntouched(plan: Plan, buildConfig: readonly string[]): void;
|
|
54
|
+
export declare function runAdopt(rt: Runtime, args: Record<string, unknown>, raw: readonly string[]): Promise<AdoptResult>;
|