@noldova/tools.pipelines 0.0.23 → 0.0.25

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 CHANGED
@@ -74,6 +74,7 @@ It succeeds only when:
74
74
 
75
75
  - the version is a version, the commit is its full id, and the scope is `@` and a lowercase name, such as `@noldova`;
76
76
  - the checkout is at the commit;
77
+ - no packages it expects depend on each other in a cycle, through `dependencies` or `peerDependencies`, since the publish step publishes each package after those it depends on;
77
78
  - the folder holds one archive for each package at the version, named as `npm pack` names it, such as `noldova-tools.pipelines-0.0.4.tgz`, and nothing else;
78
79
  - each archive's `package/package.json` has the package's name, inside the scope, the version, and the commit as its `gitHead`, isn't `"private": true`, has a `license`, lists any other expected package under `dependencies` at exactly the version, and lists any under `peerDependencies` in the range from the version to the next minor one, such as `>=0.0.9 <0.1.0`, as a package that takes its siblings as peers names them;
79
80
  - each archive holds `package/LICENSE`, and no file of a kind that holds credentials: `.npmrc`, `.netrc`, `.env` or `.env.<name>`, `id_rsa`, `id_dsa`, `id_ecdsa`, `id_ed25519`, or a name ending in `.pem`, `.key`, `.p12` or `.pfx`, such as `.key` itself, in any folder and whatever its case;
@@ -130,7 +131,7 @@ The step:
130
131
 
131
132
  1. runs the archive step's checks, except the build's copies, and fails with their message when they fail;
132
133
  2. asks the registry about each package, and fails, publishing nothing, with one line for each version it already has from another archive and each version that isn't newer than the version a tag it must pass points to; a version it already has from the same archive is skipped;
133
- 3. publishes the rest in turn, and stops at the first publish that fails, whose line leaves out the archive's file listing, npm's `npm notice` lines from `Tarball Contents` through `total files`, and its empty `npm notice` lines, so that npm's error shows within an annotation's length, while its other notices stay;
134
+ 3. publishes the rest, each time the first package by name whose dependencies, through `dependencies` or `peerDependencies`, are published, and stops at the first publish that fails, whose line leaves out the archive's file listing, npm's `npm notice` lines from `Tarball Contents` through `total files`, and its empty `npm notice` lines, so that npm's error shows within an annotation's length, while its other notices stay, so no package that depends on it is published;
134
135
  4. waits until the registry serves each version it published with the same archive, up to 10 minutes, asking every 10 seconds, also after a failed publish, so a rerun skips the versions already published.
135
136
 
136
137
  It succeeds with one line for each package, such as `@noldova/tools.pipelines@0.0.4 published.`, and otherwise fails with one line for each problem.
@@ -297,22 +298,30 @@ result.message; // "Looked for exact pins of @noldova/a, @noldova/b older than 0
297
298
  - It fails, before asking the host, unless the version is a release version and the commit is its full id; a nightly version moves nothing.
298
299
  - It reads the packages the commit releases as the archive step does, and checks out each repository the host lists into a new temporary folder.
299
300
  - In each tracked `package.json`, it moves every value that names one of those packages at an exact version older than the release, such as `"0.0.3"`; a range, such as `"^0.0.3"`, and a newer or equal version stay, but for Noldova Desktop's range, below.
301
+ - A repository's own peer range on a released package moves with its pins, since its checks need a peer on a package it pins to start at the pin: in each tracked `package.json`'s `peerDependencies`, a range of the form `>=<lowest> <refused>` whose lowest version is older than the release starts at the release and keeps its refused version, such as `>=0.0.8 <0.1.0`, which becomes `>=0.0.10 <0.1.0`; the description lists each range it moved as it lists the pins. A range that refuses the release leaves the repository at its pins, and names the range and its file, as for an outside peer below: a `>=<lowest> <refused>` range whose refused version is at or below the release, or a `^`, `~` or `<` range of a plain version whose upper end, as npm reads it, is. A `^` or `~` range that takes the release, such as `"~0.0.9"` for 0.0.10, and a range outside `peerDependencies` stay.
300
302
  - When a released package needs another package as a peer at an exact version, it also moves the repository's exact pins of that package when older, and the description names the released package that needs each.
301
- - Then it follows the moved packages through the registries the repository's own npm configuration names, with `npm view` and without the host's credential variables, until nothing more moves: an exact pin, as a dependency or a dev dependency, older than the exact peer, optional or not, that a moved package's new version needs moves to that version; an exact pin whose version needs a moved package as a peer at another exact version moves to its first later version whose exact peers are the moved versions. The description names, for each, the package that required it. When a pin is newer than an exact peer a moved package needs, a moved package needs another at a version other than the one it moved to, or no later version of such a pin needs the moved versions, it leaves the repository as it is and names each such pin; that repository doesn't fail. Pins the moved packages don't force stay where they are, and so do the pins of the repository's own packages, which its own next release moves.
303
+ - When a released package depends on an outside package at an exact version, it moves the repository's exact pins of that package to that version when older, so the lock holds one copy, and the description names the released package that depends on it; a newer pin leaves the repository at its pins. That version also counts as moved when the repository doesn't pin the package, so a pinned package that needs another version of it as a peer is followed below.
304
+ - When a released package accepts an outside package as a peer in a range of the form `>=<lowest> <refused>`, such as `>=0.0.8 <0.1.0`, it moves the repository's exact pins of that package older than the lowest version to it, and the description names the released package; a pin at or above the refused version leaves the repository at its pins. The first released package to name an outside package decides its version, exact peers first, then dependencies, then peer ranges.
305
+ - A repository's own peer range of an outside package that a released package needs or accepts as a peer follows that version: in each tracked `package.json`'s `peerDependencies`, a range of the form `>=<lowest> <refused>` whose lowest version is older than that version starts at it and keeps its refused version, such as a module window part's `@angular/core` peer `>=22.2.6 <23.0.0`, which becomes `>=22.3.0 <23.0.0` when the released `@noldova/desktop.window` needs `@angular/core` 22.3.0 as a peer; the description lists each range it moved as it lists the pins, and names the released package. A range already at or above that version stays, and so does a range of another form, which isn't raised; but a range that refuses that version leaves the repository at its pins, and names the range and its file: a `>=<lowest> <refused>` range whose refused version is at or below it, or a `^`, `~` or `<` range of a plain version whose upper end, as npm reads it, is: `^` the next major, or below 1.0 the next minor, or below 0.1 the next patch, `~` the next minor, `<` the version itself. A version a released package only depends on gets its own copy in the lock, so it moves no peer range.
306
+ - It moves and checks an outside package one lock folder at a time, a folder with a tracked `package-lock.json` together with the tracked `package.json` files whose nearest such folder, at or above them, it is, and only in a folder that installs a released package that names it: one whose pins move in the folder's manifests, or one the folder's lock holds before the relock.
307
+ A released package names an outside package when it takes it as a dependency or a peer, or reaches, through its own dependencies and peers, another released package that does, so a dependent that installs `@noldova/desktop.runtime` takes what a newly reached `@noldova/desktop.window` needs although its lock has never held it.
308
+ A dependency of a released package a folder never installs, such as `@noldova/desktop.build`'s exact `typescript` beside the root of a repository whose end-to-end app alone takes `@noldova/desktop.build`, can't reach that folder's tree, so it neither moves the folder's pins nor leaves the repository at them.
309
+ - Then it follows the moved packages through the registries the repository's own npm configuration names, with `npm view` and without the host's credential variables, until nothing more moves: an exact pin, as a dependency or a dev dependency, older than the exact peer, optional or not, that a moved package's new version needs moves to that version; an exact pin whose version needs a moved package as a peer at another exact version moves to its first later version whose exact peers are the moved versions. The description names, for each, the package that required it. When a pin is newer than an exact peer a moved package needs, a moved package needs another at a version other than the one it moved to, or no later version of such a pin needs the moved versions, it leaves the repository as it is and names each such pin. Pins the moved packages don't force stay where they are, and so do the pins of the repository's own packages, which its own next release moves.
302
310
  - Before it relocks, it leaves a repository as it is when any tracked `package-lock.json` holds another package that needs one of the moved packages, as a peer, at another exact version, and names each such package and the version it needs; npm couldn't install the moved pins until that package accepts them.
303
- - A lock folder whose `package.json` pins exactly a package one of the repository's own tracked `package.json` files names, while its lock holds no entry for it, as when the repository locks its own unpublished packages from its built archives, is relocked without asking a registry for that package: it, and each own package its manifest reaches by dependency or optional dependency, resolves from a stand-in archive that holds only a manifest with the tracked manifest's dependencies and optional dependencies on other packages and no peers, so npm installs no peer for an own package, as a lock made with `--legacy-peer-deps` holds none, which the folder's `package.json` names while npm runs and gives back after; the lock then leaves out every entry at or under an own package, and its root entry keeps the folder's pins, and the pull request names each such lock file. When more than one tracked `package.json` names such a package, or when that relock drops an entry the old lock marks as a peer and no moved package's locked entry names, as when the repository locks its own packages with their peers, it leaves the repository as it is and names them, without failing it.
304
- - After, it leaves the repository as it is, without chasing further, when a relocked lock file still holds a package whose exact peer differs from the version it locks, and names each.
311
+ - A lock folder whose `package.json` pins exactly a package one of the repository's own tracked `package.json` files names, while its lock holds no entry for it, as when the repository locks its own unpublished packages from its built archives, is relocked without asking a registry for that package: it, and each own package its manifest reaches by dependency or optional dependency, resolves from a stand-in archive that holds only a manifest with the tracked manifest's dependencies and optional dependencies on other packages and no peers, so npm installs no peer for an own package, as a lock made with `--legacy-peer-deps` holds none, which the folder's `package.json` names while npm runs and gives back after; the lock then leaves out every entry at or under an own package, and its root entry keeps the folder's pins, and the pull request names each such lock file. When more than one tracked `package.json` names such a package, or when that relock drops an entry the old lock marks as a peer and no moved package's locked entry names, as when the repository locks its own packages with their peers, it leaves the repository as it is and names them.
312
+ - After, it leaves the repository as it is, without chasing further, when a relocked lock file still holds a package whose exact peer differs from the version it locks, or holds a moved package at another version under the `node_modules` of a package one of that lock folder's own tracked `package.json` files names, or of one of its own folders, a second copy, and names each.
313
+ A second copy under a package only a dependency brings is kept: npm nests a copy only for a parent whose range excludes the hoisted version, and the repository can move a parent the lock folder's own manifests name, but not one a released package brings or one only another lock folder names, whose pin doesn't reach this tree, such as `app-builder-lib`, which takes `resedit` 1 beside the `resedit` 3 of `@noldova/desktop.build`, whose own lock holds the same two copies.
305
314
  - When it moved any, it relocks every tracked `package-lock.json`: it removes from the file the entries of the moved packages, the entries nested under them and the entries that depend on them, by dependency, optional dependency or peer, keeps every other entry at its locked version unless a package npm resolves again needs it to change, and lets `npm install --package-lock-only --ignore-scripts` resolve what it removed, so a package the old lock keeps at an older version, with that version's exact peers, can't hold the moved pins back; it runs without the host's credential variables and, on Linux and macOS, stops an npm run longer than 5 minutes, which fails that repository; it then commits, pushes the branch `pipelines/update-<source>` and proposes it with the moved pins and the release's notes; a repository that pins none is left as it is.
306
315
  - A module's manifest names other modules by id: when the commit releases modules, by the `id` of each `module.json` under `src/` outside `tests/` folders, it moves in each tracked `module.json` every entry of `dependencies` and `optionalDependencies` that names one of them at an exact version older than the release, and lists each move in the description as it lists the pins; a range and a newer or equal version stay. It does so only in a repository whose `package.json` pins moved, whether it relocked the repository or the repository relocked itself.
307
- - A module names the Noldova Desktop versions it accepts as a range, `>=<lowest version> <first version refused>`, whose lowest version is its exact pin of Noldova Desktop's packages: when the commit releases `@noldova/desktop.runtime`, in a repository whose `package.json` pins moved, it writes `>=<version> <next version that may break modules>`, the next minor below 1.0 and the next major from 1.0, in place of each range of that form whose lowest version is older than the release, in each tracked `module.json`'s `noldovaDesktop` and, before it relocks, in each tracked `package.json`'s value for a released package, such as a module package's peer; it lists each move in the description as it lists the pins, and another form, such as `"^0.0.1"`, and a range at or above the release stay.
316
+ - A module names the Noldova Desktop versions it accepts as a range, `>=<lowest version> <first version refused>`, whose lowest version is its exact pin of Noldova Desktop's packages: when the commit releases `@noldova/desktop.runtime`, in a repository whose `package.json` pins moved, it writes `>=<version> <next version that may break modules>`, the next minor below 1.0 and the next major from 1.0, in place of each range of that form whose lowest version is older than the release, in each tracked `module.json`'s `noldovaDesktop` and, before it relocks, in each tracked `package.json`'s value for a released package, such as a module package's peer; it lists each move in the description as it lists the pins, and another form, such as `"^0.0.3"` for 0.0.3, and a range at or above the release stay, but a `package.json` peer range of another form that refuses the release leaves the repository at its pins, as above.
308
317
  - When the branch exists, it replaces it only while the branch is at a commit of its own, with its title and the same committer; a branch with anyone else's commit is left as it is, and that repository fails, so nobody's work is lost.
309
318
  - A repository that moved any pins fails, before it relocks, when a tracked `package.json` doesn't hold a JSON object, or a tracked `package-lock.json` has no tracked `package.json` beside it.
310
- - It succeeds with one line for each repository, and fails, after trying every other repository, with the line of each that failed; an error in one repository, such as git failing, is that repository's line.
311
- - Given an output, it writes each repository's line there instead, as a success or a failure, as soon as that repository is done, so a run stopped partway still shows the repositories it finished; its result's message is then only the summary.
319
+ - It succeeds with one line for each repository. A repository it leaves at its pins, for any reason above, fails, as does an error in one repository, such as git failing, which is that repository's line; the step then fails, after trying every other repository, and its message starts by saying the released packages are published and how many repositories are left at their pins, so a failed step reads as dependents to move, not a failed release, followed by every repository's line.
320
+ - Given an output, it writes each repository's line there instead, as a success or a failure, as soon as that repository is done, so a run stopped partway still shows the repositories it finished; its result's message is then only the summary, and, when any repository is left at its pins, the line saying the packages are published and the lines of those left.
312
321
  - It removes its temporary folder whether it succeeds or fails, and makes it in the root its constructor is given, or in `os.tmpdir()`.
313
- - It first checks out every repository and asks the host's `startRelockAsync` whether each relocks itself, giving the checkout's head commit and the release as a request: the source, the version, the commit, the released packages and the peers they pin; the host starts each such relock, so they run together. Then it finishes the repositories in order.
322
+ - It first checks out every repository and asks the host's `startRelockAsync` whether each relocks itself, giving the checkout's head commit and the release as a request: the source, the version, the commit, the released packages and the outside packages they pin, each with its version, the reason the description gives, the range or exact version the released package accepts and the released packages that name it, which an older request leaves out and the relock then treats as installed; the host starts each such relock, so they run together. Then it finishes the repositories in order.
314
323
  When the host answered `null`, it moves and relocks in the checkout as above.
315
- Otherwise it reads with the host's `readRelockAsync` what the repository's relock step wrote: a repository's line, which becomes that repository's line, or the commit it ran at, the moved pins, the lock lines and the files that changed, which it writes into the checkout, each one a tracked `package.json` or `package-lock.json`, before it commits, pushes and proposes as above; a file that is neither, a relock of another commit than the checkout's, and a failure the host answers fail that repository.
324
+ Otherwise it reads with the host's `readRelockAsync` what the repository's relock step wrote: a repository's line, which becomes that repository's line, except that a line written as a success by an older relock step, one that also reports a repository left at its pins as a success, fails, since the step can't tell whether the pins moved; or the commit it ran at, the moved pins, the lock lines and the files that changed, which it writes into the checkout, each one a tracked `package.json` or `package-lock.json`, before it commits, pushes and proposes as above; a file that is neither, a relock of another commit than the checkout's, and a failure the host answers fail that repository.
316
325
 
317
326
  ### The relock step
318
327
 
package/api/index.d.ts CHANGED
@@ -475,8 +475,8 @@ export declare class ArchiveCheck {
475
475
  public readonly result: StepResult;
476
476
 
477
477
  /**
478
- * Each expected package with its archive, by package name, when the result
479
- * succeeded; none when it failed.
478
+ * Each expected package with its archive, in the order to publish them: each time, the first package by name whose
479
+ * dependencies, through `dependencies` or `peerDependencies`, are published, when the result succeeded; none when it failed.
480
480
  */
481
481
  public readonly archives: readonly PackageArchive[];
482
482
 
@@ -2014,7 +2014,9 @@ export declare class ArchiveStep implements IStep {
2014
2014
  * It fails with the first of these that is wrong: not four values, a
2015
2015
  * version that is not a version, a commit that is not a full id, a scope
2016
2016
  * that is not `@` and a lowercase name, a checkout at another commit, a
2017
- * folder that does not exist, and a commit without a package to publish.
2017
+ * folder that does not exist, a commit without a package to publish, and
2018
+ * packages that depend on each other in a cycle, naming those it can't put
2019
+ * after their dependencies.
2018
2020
  * Otherwise it fails with one line for each problem with the archives: an
2019
2021
  * archive missing, a file that is not an expected archive, an archive
2020
2022
  * `tar` cannot read the manifest of, with `tar`'s exit code and message,
@@ -2063,7 +2065,8 @@ export declare class ArchiveStep implements IStep {
2063
2065
  *
2064
2066
  * @param values The same values as {@link ArchiveStep.runAsync}.
2065
2067
  * @returns A promise of the check: the result, and when it succeeded, each
2066
- * expected package with its archive, by package name. It rejects as
2068
+ * expected package with its archive, in the order to publish them: each time, the first package by name
2069
+ * whose dependencies, through `dependencies` or `peerDependencies`, are published. It rejects as
2067
2070
  * {@link ArchiveStep.runAsync} does.
2068
2071
  * @example
2069
2072
  * ```ts
@@ -2199,8 +2202,9 @@ export declare class PublishStep implements IStep {
2199
2202
  * archive, each version not newer than the version a tag it must pass
2200
2203
  * points to, and each
2201
2204
  * read of the registry that fails, with `npm`'s exit code and message.
2202
- * After that, it publishes the archives in turn and stops at the first
2203
- * publish that fails; it still waits for the versions it published before
2205
+ * After that, it publishes the archives in the check's order, each after
2206
+ * the packages it depends on, and stops at the first publish that fails,
2207
+ * so no package that depends on it is published; it still waits for the versions it published before
2204
2208
  * it, and fails with a line for that publish, with `npm`'s exit code and
2205
2209
  * message without the archive's file listing, its `npm notice` lines from
2206
2210
  * `Tarball Contents` through `total files`, or its empty `npm notice`
@@ -2739,7 +2743,8 @@ export declare class ReproducibleStep implements IStep {
2739
2743
  * a peer, and names each such package, since npm couldn't install the moved
2740
2744
  * pins until that package accepts them; after, it leaves it as it is,
2741
2745
  * without chasing further, when a relocked lock file still holds a
2742
- * package whose exact peer differs from the version it locks. A lock folder
2746
+ * package whose exact peer differs from the version it locks, or a moved
2747
+ * package at another version under another package's `node_modules`. A lock folder
2743
2748
  * whose `package.json` pins exactly a package one of the repository's own
2744
2749
  * tracked manifests names, while its lock holds no entry for it, as when the
2745
2750
  * repository locks its own unpublished packages from its built archives, is
@@ -2829,7 +2834,14 @@ export declare class DependentsStep implements IStep {
2829
2834
  * or why it failed. It fails for any number of values but two, a version that isn't
2830
2835
  * one or is a nightly, a commit that isn't a full id, a commit that
2831
2836
  * releases no package, what the host can't answer, and when any
2832
- * repository fails, after trying every other; an error in one repository,
2837
+ * repository is left at its pins or fails, after trying every other; its
2838
+ * message then starts by saying the packages are published and how many
2839
+ * repositories are left at their pins, followed by every repository's line,
2840
+ * or, given an output, only the lines of those left. A repository is left
2841
+ * at its pins when a pin can't take what the release moves, such as a pin
2842
+ * outside the exact version or the peer range a released package names,
2843
+ * or another pinned package that needs an outside package's old version
2844
+ * and has no later version that needs the new one; an error in one repository,
2833
2845
  * such as git failing, is that repository's line. It removes its temporary
2834
2846
  * folder whether it succeeds or fails, and rejects with
2835
2847
  * {@link ProcessException} if git cannot start or fails while it reads the
@@ -2883,7 +2895,8 @@ export declare class RelockedFiles {
2883
2895
 
2884
2896
  /**
2885
2897
  * Writes a result, or a repository's line, as the JSON the relock step's
2886
- * result file holds.
2898
+ * result file holds. A line is marked as written by a relock step that
2899
+ * fails a repository left at its pins.
2887
2900
  *
2888
2901
  * @param relocked The result, or the line as a {@link StepResult}.
2889
2902
  * @returns The JSON.
@@ -2892,7 +2905,7 @@ export declare class RelockedFiles {
2892
2905
  * import { RelockedFiles, StepResult } from "@noldova/tools.pipelines";
2893
2906
  *
2894
2907
  * RelockedFiles.format(StepResult.succeeded("noldova-com/example: pins none of them below 0.0.4."));
2895
- * // {"isSuccessful":true,"message":"noldova-com/example: pins none of them below 0.0.4."}
2908
+ * // {"isSuccessful":true,"message":"noldova-com/example: pins none of them below 0.0.4.","failsWhenLeft":true}
2896
2909
  * ```
2897
2910
  */
2898
2911
  public static format(relocked: StepResult | RelockedFiles): string;
@@ -2902,8 +2915,10 @@ export declare class RelockedFiles {
2902
2915
  *
2903
2916
  * @param text The JSON.
2904
2917
  * @returns The result, or the repository's line as a {@link StepResult}
2905
- * that succeeded or failed as it did. It throws when the text isn't such
2906
- * JSON.
2918
+ * that succeeded or failed as it did. A line that succeeded without the
2919
+ * mark {@link format} writes came from an older relock step, which also
2920
+ * reports a repository left at its pins as a success, so it comes back
2921
+ * failed and says so. It throws when the text isn't such JSON.
2907
2922
  */
2908
2923
  public static parse(text: string): StepResult | RelockedFiles;
2909
2924
  }
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { JsonReader } from "@noldova/context.json";
9
9
  import { Resources } from "../resources.js";
10
+ import { PinTarget } from "./pin-target.js";
10
11
  export class DependentsUpdate {
11
12
  source;
12
13
  version;
@@ -24,11 +25,7 @@ export class DependentsUpdate {
24
25
  }
25
26
  static parseRequest(text) {
26
27
  const reader = JsonReader.parse(text);
27
- const peerPins = reader.readObjectArray(Resources.relockPeerPinsField).map(t => ({
28
- packageName: t.readString(Resources.relockPackageNameField),
29
- version: t.readString(Resources.relockVersionField),
30
- reason: t.readNullableString(Resources.relockReasonField)
31
- }));
28
+ const peerPins = reader.readObjectArray(Resources.relockPeerPinsField).map(t => new PinTarget(t.readString(Resources.relockPackageNameField), t.readString(Resources.relockVersionField), t.readNullableString(Resources.relockReasonField), t.hasField(Resources.relockRangeField) ? t.readNullableString(Resources.relockRangeField) : null, t.hasField(Resources.relockRequiredByField) ? t.readStringArray(Resources.relockRequiredByField) : []));
32
29
  return new DependentsUpdate(reader.readString(Resources.relockSourceField), reader.readString(Resources.relockVersionField), reader.readString(Resources.relockCommitField), reader.readStringArray(Resources.relockPackageNamesField), peerPins, "");
33
30
  }
34
31
  formatRequest() {
@@ -37,7 +34,7 @@ export class DependentsUpdate {
37
34
  [Resources.relockVersionField]: this.version,
38
35
  [Resources.relockCommitField]: this.commit,
39
36
  [Resources.relockPackageNamesField]: this.packageNames,
40
- [Resources.relockPeerPinsField]: this.peerPins.map(t => ({ [Resources.relockPackageNameField]: t.packageName, [Resources.relockVersionField]: t.version, [Resources.relockReasonField]: t.reason }))
37
+ [Resources.relockPeerPinsField]: this.peerPins.map(t => ({ [Resources.relockPackageNameField]: t.packageName, [Resources.relockVersionField]: t.version, [Resources.relockReasonField]: t.reason, [Resources.relockRangeField]: t.range, [Resources.relockRequiredByField]: t.requiredBy }))
41
38
  });
42
39
  }
43
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dependents-update.js","sourceRoot":"","sources":["../../../../src/noldova.tools.pipelines/src/models/dependents-update.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,gBAAgB;IACX,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,YAAY,CAAoB;IAChC,QAAQ,CAAuB;IAC/B,KAAK,CAAS;IAE9B,YAAmB,MAAc,EAAE,OAAe,EAAE,MAAc,EAAE,YAA+B,EAAE,QAA8B,EAAE,KAAa;QAChJ,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,IAAY;QACrC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC/E,WAAW,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,sBAAsB,CAAC;YAC3D,OAAO,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC;YACnD,MAAM,EAAE,CAAC,CAAC,kBAAkB,CAAC,SAAS,CAAC,iBAAiB,CAAC;SAC1D,CAAC,CAAC,CAAC;QAEJ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,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,EACzK,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC7E,CAAC;IAEM,aAAa;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,MAAM;YAC1C,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,OAAO;YAC5C,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,MAAM;YAC1C,CAAC,SAAS,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAC,YAAY;YACtD,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;SAC7R,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import path from "node:path";
9
+ import { Resources } from "../resources.js";
10
+ // A folder that installs on its own: its tracked lock file, when it has one, and the tracked manifests whose nearest
11
+ // lock folder, at or above them, it is.
12
+ export class LockScope {
13
+ folder;
14
+ lockFilePaths;
15
+ manifestPaths;
16
+ constructor(folder, lockFilePaths, manifestPaths) {
17
+ this.folder = folder;
18
+ this.lockFilePaths = lockFilePaths;
19
+ this.manifestPaths = manifestPaths;
20
+ }
21
+ static read(manifestPaths, lockFilePaths) {
22
+ const folders = lockFilePaths.map(t => path.posix.dirname(t));
23
+ const grouped = new Map(folders.map(t => [t, []]));
24
+ for (const manifestPath of manifestPaths) {
25
+ const folder = LockScope.findFolder(path.posix.dirname(manifestPath), folders);
26
+ grouped.set(folder, [...grouped.get(folder) ?? [], manifestPath]);
27
+ }
28
+ return [...grouped].map(([folder, paths]) => new LockScope(folder, lockFilePaths.filter(t => path.posix.dirname(t) === folder), paths));
29
+ }
30
+ static findFolder(manifestFolder, folders) {
31
+ const owners = folders.filter(t => t === Resources.currentFolder || t === manifestFolder || manifestFolder.startsWith(`${t}${Resources.pathSeparator}`))
32
+ .sort((a, b) => LockScope.depthOf(b) - LockScope.depthOf(a));
33
+ return owners[0] ?? manifestFolder;
34
+ }
35
+ static depthOf(folder) {
36
+ return folder === Resources.currentFolder ? 0 : folder.split(Resources.pathSeparator).length;
37
+ }
38
+ }
39
+ //# sourceMappingURL=lock-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-scope.js","sourceRoot":"","sources":["../../../../src/noldova.tools.pipelines/src/models/lock-scope.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qHAAqH;AACrH,wCAAwC;AACxC,MAAM,OAAO,SAAS;IACJ,MAAM,CAAS;IACf,aAAa,CAAoB;IACjC,aAAa,CAAoB;IAEjD,YAAmB,MAAc,EAAE,aAAgC,EAAE,aAAgC;QACnG,IAAI,CAAC,MAAM,G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Ac,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC;aACrJ,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/D,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC;IACrC,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,MAAc;QACnC,OAAO,MAAM,KAAK,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;IAC/F,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ // An outside package the released packages pin, with the released packages that name it, directly or through another
9
+ // released package; a target that names none applies wherever its package is pinned.
10
+ export class PinTarget {
11
+ packageName;
12
+ version;
13
+ reason;
14
+ range;
15
+ requiredBy;
16
+ constructor(packageName, version, reason, range, requiredBy) {
17
+ this.packageName = packageName;
18
+ this.version = version;
19
+ this.reason = reason;
20
+ this.range = range;
21
+ this.requiredBy = requiredBy;
22
+ }
23
+ appliesTo(installed) {
24
+ return this.requiredBy.length === 0 || this.requiredBy.some(t => installed.has(t));
25
+ }
26
+ }
27
+ //# sourceMappingURL=pin-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin-target.js","sourceRoot":"","sources":["../../../../src/noldova.tools.pipelines/src/models/pin-target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qHAAqH;AACrH,qFAAqF;AACrF,MAAM,OAAO,SAAS;IACJ,WAAW,CAAS;IACpB,OAAO,CAAS;IAChB,MAAM,CAAgB;IACtB,KAAK,CAAgB;IACrB,UAAU,CAAoB;IAE9C,YAAmB,WAAmB,EAAE,OAAe,EAAE,MAAqB,EAAE,KAAoB,EAAE,UAA6B;QACjI,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEM,SAAS,CAAC,SAA8B;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -21,14 +21,16 @@ export class RelockedFiles {
21
21
  }
22
22
  static format(relocked) {
23
23
  return JSON.stringify(relocked instanceof StepResult
24
- ? { [Resources.relockSucceededField]: relocked.isSuccessful, [Resources.relockMessageField]: relocked.message }
24
+ ? { [Resources.relockSucceededField]: relocked.isSuccessful, [Resources.relockMessageField]: relocked.message, [Resources.relockFailsLeftField]: true }
25
25
  : { [Resources.relockCommitField]: relocked.commit, [Resources.relockMovesField]: relocked.moves, [Resources.relockLockLinesField]: relocked.lockLines, [Resources.relockFilesField]: relocked.files });
26
26
  }
27
27
  static parse(text) {
28
28
  const reader = JsonReader.parse(text);
29
29
  if (reader.hasField(Resources.relockMessageField)) {
30
30
  const message = reader.readString(Resources.relockMessageField);
31
- return reader.readBoolean(Resources.relockSucceededField) ? StepResult.succeeded(message) : StepResult.failed(message);
31
+ if (!reader.readBoolean(Resources.relockSucceededField))
32
+ return StepResult.failed(message);
33
+ return reader.hasField(Resources.relockFailsLeftField) ? StepResult.succeeded(message) : StepResult.failed(Resources.formatRelockFromOlderPipelines(message));
32
34
  }
33
35
  const files = reader.readObject(Resources.relockFilesField);
34
36
  return new RelockedFiles(reader.readString(Resources.relockCommitField), reader.readStringArray(Resources.relockMovesField), reader.readStringArray(Resources.relockLockLinesField), Object.fromEntries(Object.keys(files.toJson()).map(t => [t, files.readString(t)])));
@@ -1 +1 @@
1
- {"version":3,"file":"relocked-files.js","sourceRoot":"","sources":["../../../../src/noldova.tools.pipelines/src/models/relocked-files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,aAAa;IACR,MAAM,CAAS;IACf,KAAK,CAAoB;IACzB,SAAS,CAAoB;IAC7B,KAAK,CAAmC;IAExD,YAAmB,MAAc,EAAE,KAAwB,EAAE,SAA4B,EAAE,KAAuC;QAChI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAoC;QACvD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,YAAY,UAAU;YAClD,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE;YAC/G,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAAC,SAAS,EAAE,CA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AAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;YAEhE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC;gBACrD,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAEpC,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC;QAChK,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QAE5D,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC,EACjL,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ // A dependent the dependents step checked out, at the head it read, with the relock run the host started for it, or
9
+ // null when the step relocks the checkout itself.
10
+ export class StartedUpdate {
11
+ repository;
12
+ directory;
13
+ git;
14
+ head;
15
+ run;
16
+ constructor(repository, directory, git, head, run) {
17
+ this.repository = repository;
18
+ this.directory = directory;
19
+ this.git = git;
20
+ this.head = head;
21
+ this.run = run;
22
+ }
23
+ }
24
+ //# sourceMappingURL=started-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"started-update.js","sourceRoot":"","sources":["../../../../src/noldova.tools.pipelines/src/models/started-update.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,oHAAoH;AACpH,kDAAkD;AAClD,MAAM,OAAO,aAAa;IACR,UAAU,CAAS;IACnB,SAAS,CAAS;IAClB,GAAG,CAAM;IACT,IAAI,CAAS;IACb,GAAG,CAAgB;IAEnC,YAAmB,UAAkB,EAAE,SAAiB,EAAE,GAAQ,EAAE,IAAY,EAAE,GAAkB;QAClG,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noldova/tools.pipelines",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "type": "module",
5
5
  "main": "api/index.js",
6
6
  "types": "api/index.d.ts",
@@ -19,8 +19,9 @@
19
19
  "registry": "https://registry.npmjs.org/"
20
20
  },
21
21
  "dependencies": {
22
- "@noldova/context.exceptions": "0.0.8",
23
- "@noldova/context.json": "0.0.8"
22
+ "@noldova/context.core": "0.0.12",
23
+ "@noldova/context.exceptions": "0.0.12",
24
+ "@noldova/context.json": "0.0.12"
24
25
  },
25
- "gitHead": "6dfdbcf13a062d8d7c92e2a6deafb834f731af9a"
26
+ "gitHead": "57f4f8d9089577a3238418f1aa7d480fbd565a96"
26
27
  }
package/resources.js CHANGED
@@ -33,6 +33,7 @@ export class Resources {
33
33
  static lockScriptSeparator = "=";
34
34
  static npmScriptValues = ["run"];
35
35
  static relockCommitField = "commit";
36
+ static relockFailsLeftField = "failsWhenLeft";
36
37
  static relockFilesField = "files";
37
38
  static relockLockLinesField = "lockLines";
38
39
  static relockMessageField = "message";
@@ -40,7 +41,9 @@ export class Resources {
40
41
  static relockPackageNameField = "packageName";
41
42
  static relockPackageNamesField = "packageNames";
42
43
  static relockPeerPinsField = "peerPins";
44
+ static relockRangeField = "range";
43
45
  static relockReasonField = "reason";
46
+ static relockRequiredByField = "requiredBy";
44
47
  static relockSourceField = "source";
45
48
  static relockStepName = "relock";
46
49
  static relockStepUsage = "<repository> <request> <result file> [<lock file>=<npm script>...]";
@@ -49,7 +52,10 @@ export class Resources {
49
52
  static dependabotFilePaths = [".github/dependabot.yml", ".github/dependabot.yaml"];
50
53
  static failureExitCode = 1;
51
54
  static exactVersionPattern = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/;
52
- static exactRangePattern = /^>=((?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)) <(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)$/;
55
+ static boundedRangePattern = /^([~^<])((?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*))$/;
56
+ static belowRangeOperator = "<";
57
+ static tildeRangeOperator = "~";
58
+ static exactRangePattern = /^>=((?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)) <((?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*))$/;
53
59
  static fileEndByteCount = 2;
54
60
  static gitAddWorktreeValues = ["worktree", "add", "--quiet", "--detach", "--end-of-options"];
55
61
  static gitAttributesFilePath = ".gitattributes";
@@ -148,6 +154,8 @@ export class Resources {
148
154
  static patchPartName = "patch";
149
155
  static pathSeparator = "/";
150
156
  static peerDependenciesField = "peerDependencies";
157
+ static publishOrderFields = ["dependencies", "peerDependencies"];
158
+ static peerDependenciesPattern = /"peerDependencies"\s*:\s*\{[^{}]*\}/g;
151
159
  static privateField = "private";
152
160
  static processKillSignal = "SIGKILL";
153
161
  static processReleaseDelayMilliseconds = 0;
@@ -433,6 +441,9 @@ export class Resources {
433
441
  static formatFolderMissing(folder) {
434
442
  return `There is no folder ${folder}.`;
435
443
  }
444
+ static formatDependencyCycle(commit, packageNames) {
445
+ return `The packages at commit ${commit} depend on each other in a cycle, so these can't each be published after their dependencies: ${packageNames.join(", ")}.`;
446
+ }
436
447
  static formatPackagesMissing(commit, folderPath) {
437
448
  return `Commit ${commit} has no package to publish under ${folderPath}/.`;
438
449
  }
@@ -592,6 +603,9 @@ export class Resources {
592
603
  static formatDependentsSummary(packageNames, version, repositoryCount) {
593
604
  return `Looked for exact pins of ${packageNames.join(", ")} older than ${version} in ${repositoryCount} repositories:`;
594
605
  }
606
+ static formatDependentsPublished(packageNames, version, leftCount, repositoryCount) {
607
+ return `${packageNames.join(", ")} ${version} are published; ${leftCount} of ${repositoryCount} repositories are left at their pins, each with what holds it:`;
608
+ }
595
609
  static formatDependentsWritten(packageNames, version, repositoryCount) {
596
610
  return `Looked for exact pins of ${packageNames.join(", ")} older than ${version} in ${repositoryCount} repositories; each one's line is above.`;
597
611
  }
@@ -607,12 +621,33 @@ export class Resources {
607
621
  static formatRepositoryConflicted(repository, version, conflicts) {
608
622
  return `${repository}: left at its pins, since the lock files relocked for ${version} still hold packages whose exact peers differ from what they lock: ${conflicts.join("; ")}.`;
609
623
  }
624
+ static formatRelockFromOlderPipelines(line) {
625
+ return `${line} Its relock ran older pipelines, which also report a repository left at its pins as a success, so this can't tell whether it moved; it fails until the repository's pipelines pin moves.`;
626
+ }
627
+ static formatRepositoryNested(repository, version, copies) {
628
+ return `${repository}: left at its pins, since the lock files relocked for ${version} still hold another copy of a package the pins moved: ${copies.join("; ")}.`;
629
+ }
630
+ static formatNestedCopy(filePath, nester, packageName, version, movedVersion) {
631
+ return `${filePath} holds ${packageName} ${version} under ${nester}, beside the ${movedVersion} the pins moved to`;
632
+ }
610
633
  static formatPeerBlocker(filePath, packageName, version, peerName, peerVersion) {
611
634
  return `${filePath} locks ${packageName} ${version}, which needs ${peerName} ${peerVersion}`;
612
635
  }
613
636
  static formatPeerReason(packageName, version) {
614
637
  return `, which \`${packageName}\` ${version} needs as a peer`;
615
638
  }
639
+ static formatDependencyReason(packageName, version) {
640
+ return `, which \`${packageName}\` ${version} depends on`;
641
+ }
642
+ static formatRangePeerReason(packageName, version) {
643
+ return `, which \`${packageName}\` ${version} accepts as a peer`;
644
+ }
645
+ static formatPinOutside(packageName, version, range, reason) {
646
+ return `${packageName} ${version} is outside ${range}${reason}`;
647
+ }
648
+ static formatPeerRangeRefuses(filePath, packageName, range, version) {
649
+ return `${packageName} ${range} in ${filePath} refuses ${version}`;
650
+ }
616
651
  static formatPeerMatchReason(peerName, peerVersion) {
617
652
  return `, the first version that needs \`${peerName}\` ${peerVersion} as a peer`;
618
653
  }