rman 2.13.0 → 2.15.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 (34) hide show
  1. package/README.md +52 -19
  2. package/builtins/platforms/node/node-dependency-updater.d.ts +116 -0
  3. package/builtins/platforms/node/node-dependency-updater.js +452 -0
  4. package/builtins/platforms/node/node.platform.d.ts +2 -0
  5. package/builtins/platforms/node/node.platform.js +2 -0
  6. package/builtins/platforms/node/services/version-plan.service.d.ts +1 -1
  7. package/builtins/platforms/node/services/version-plan.service.js +1 -1
  8. package/builtins/publish-targets/npm/npm-view.d.ts +31 -0
  9. package/builtins/publish-targets/npm/npm-view.js +47 -0
  10. package/commands/changelog.command.js +4 -3
  11. package/commands/deps.command.d.ts +175 -0
  12. package/commands/deps.command.js +252 -0
  13. package/commands/info.command.js +11 -5
  14. package/commands/version.command.js +2 -0
  15. package/commands.d.ts +2 -0
  16. package/commands.js +1 -0
  17. package/constants.js +1 -1
  18. package/core/interfaces/dependency-updater.d.ts +114 -0
  19. package/core/interfaces/dependency-updater.js +61 -0
  20. package/core/interfaces/manifest.js +1 -1
  21. package/core/interfaces/plugin.d.ts +5 -1
  22. package/core/interfaces/plugin.js +1 -1
  23. package/index.d.ts +2 -0
  24. package/index.js +2 -0
  25. package/package.json +1 -1
  26. package/services/change-hash.service.d.ts +2 -2
  27. package/services/change-hash.service.js +2 -2
  28. package/services/system-info.d.ts +3 -0
  29. package/services/system-info.js +1 -0
  30. package/services/version-plan.service.d.ts +2 -1
  31. package/services/version-plan.service.js +7 -5
  32. package/services/version.service.js +4 -4
  33. package/utils/package-filter.d.ts +1 -1
  34. package/utils/package-filter.js +1 -1
@@ -4,6 +4,7 @@ import type { BinPath } from '../../utils/bin-path.js';
4
4
  import type { RmanApplication } from '../application.js';
5
5
  import type { Repository } from '../classes/repository.js';
6
6
  import type { Workspace } from '../classes/workspace.js';
7
+ import type { DependencyUpdater } from './dependency-updater.js';
7
8
  import type { ManifestProvider } from './manifest.js';
8
9
  /**
9
10
  * **One technology, as a whole** - Node, Cargo, Maven. Everything rman needs in order to treat a
@@ -75,6 +76,9 @@ export interface Platform {
75
76
  /** How this technology's releases are planned - where a package's change boundary comes from
76
77
  * when it has no release tag, and how far into its group a bump reaches. */
77
78
  versionPlanner?: VersionPlanService;
79
+ /** How this technology's dependencies are checked against their registry and moved forward -
80
+ * what `rman deps` asks. Absent, `deps` leaves this technology's packages alone. */
81
+ dependencyUpdater?: DependencyUpdater;
78
82
  }
79
83
  /**
80
84
  * **A plugin is whatever a package contributes; a platform is one of the things it can contribute.**
@@ -168,7 +172,7 @@ export declare function isPlugin(value: unknown): value is Plugin;
168
172
  * - no `getBinPaths` -> nothing is prepended to a child process's PATH, so the inherited one
169
173
  * stands on its own rather than being guessed at;
170
174
  * - no `getRunSteps` -> a package's steps come from its `.rmanrc` alone, the core's only source;
171
- * - no `versionPlanner` -> `version`/`changed` fail naming the key, rather than releasing a
175
+ * - no `versionPlanner` -> `version` fails naming the key, rather than releasing a
172
176
  * plausible but untrue set of packages from a default nobody chose.
173
177
  */
174
178
  export declare const basePlatform: Platform;
@@ -73,7 +73,7 @@ export function isPlugin(value) {
73
73
  * - no `getBinPaths` -> nothing is prepended to a child process's PATH, so the inherited one
74
74
  * stands on its own rather than being guessed at;
75
75
  * - no `getRunSteps` -> a package's steps come from its `.rmanrc` alone, the core's only source;
76
- * - no `versionPlanner` -> `version`/`changed` fail naming the key, rather than releasing a
76
+ * - no `versionPlanner` -> `version` fails naming the key, rather than releasing a
77
77
  * plausible but untrue set of packages from a default nobody chose.
78
78
  */
79
79
  export const basePlatform = definePlatform({
package/index.d.ts CHANGED
@@ -65,6 +65,8 @@ export { Manifest } from './core/interfaces/manifest.js';
65
65
  export { Registry } from './core/classes/registry.js';
66
66
  export { Repository } from './core/classes/repository.js';
67
67
  export { Service, type ServiceFactory, type ServiceMap } from './core/classes/service.js';
68
+ /** The `deps` seam: how a technology checks its dependencies against a registry and moves them. */
69
+ export { DependencyUpdater } from './core/interfaces/dependency-updater.js';
68
70
  export { declaredTargets, type PublishTarget, shipsTo, skipReasonFor, targetsOf, unknownTargets, } from './core/interfaces/publish-target.js';
69
71
  export type { RunConditionFn, RunStepContext, RunStepFn, RunStepObject, RunStepValue, } from './core/interfaces/run-step.js';
70
72
  /**
package/index.js CHANGED
@@ -71,6 +71,8 @@ export { Manifest } from './core/interfaces/manifest.js';
71
71
  export { Registry } from './core/classes/registry.js';
72
72
  export { Repository } from './core/classes/repository.js';
73
73
  export { Service } from './core/classes/service.js';
74
+ /** The `deps` seam: how a technology checks its dependencies against a registry and moves them. */
75
+ export { DependencyUpdater } from './core/interfaces/dependency-updater.js';
74
76
  export { declaredTargets, shipsTo, skipReasonFor, targetsOf, unknownTargets, } from './core/interfaces/publish-target.js';
75
77
  export { basePlatform, definePlatform, definePlugin, isPlatform, } from './core/interfaces/plugin.js';
76
78
  /** The numbering seam. `VersionScheme` is abstract - `highestVersion`/`highestBump`/`smallestBump`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Repository manager",
4
- "version": "2.13.0",
4
+ "version": "2.15.0",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
@@ -106,8 +106,8 @@ export declare namespace ChangeHashService {
106
106
  * `changelog --from` uses, but reusable anywhere a command wants to answer "what changed for this
107
107
  * package". An explicit `options.from` (anything but `AUTO`) is returned as-is, applying the same
108
108
  * way to every package. Otherwise, it's auto-detected in order: (1) this package's own most recent
109
- * release tag - the same network-free `findLatestTag` lookup `version`/`changed` themselves use,
110
- * so all three commands agree on "since when" for any repo whose tags are the ones `rman version`
109
+ * release tag - the same network-free `findLatestTag` lookup `version` itself uses,
110
+ * so both commands agree on "since when" for any repo whose tags are the ones `rman version`
111
111
  * actually created; (2) failing that (no tag at all yet - e.g. onboarding `rman` onto a repo with
112
112
  * real release history but no `rman`-created tags), whatever this package's **own ecosystem**
113
113
  * reports as its published version (`Plugin.publishedVersion`), mapped to a git tag via
@@ -134,8 +134,8 @@ export var ChangeHashService;
134
134
  * `changelog --from` uses, but reusable anywhere a command wants to answer "what changed for this
135
135
  * package". An explicit `options.from` (anything but `AUTO`) is returned as-is, applying the same
136
136
  * way to every package. Otherwise, it's auto-detected in order: (1) this package's own most recent
137
- * release tag - the same network-free `findLatestTag` lookup `version`/`changed` themselves use,
138
- * so all three commands agree on "since when" for any repo whose tags are the ones `rman version`
137
+ * release tag - the same network-free `findLatestTag` lookup `version` itself uses,
138
+ * so both commands agree on "since when" for any repo whose tags are the ones `rman version`
139
139
  * actually created; (2) failing that (no tag at all yet - e.g. onboarding `rman` onto a repo with
140
140
  * real release history but no `rman`-created tags), whatever this package's **own ecosystem**
141
141
  * reports as its published version (`Plugin.publishedVersion`), mapped to a git tag via
@@ -7,6 +7,9 @@ export declare namespace SystemInfo {
7
7
  version: string;
8
8
  root: string;
9
9
  packageCount: number;
10
+ /** The technologies this run loaded, by `Platform.name`, in the order a directory is offered to
11
+ * them - so `["cargo", "node"]` means a directory both recognize is a Cargo package. */
12
+ platforms: string[];
10
13
  }
11
14
  /** Whatever `envinfo` reports, grouped by category - shape is `envinfo`'s own, not ours. */
12
15
  type SystemInfo = Record<string, Record<string, unknown>>;
@@ -23,6 +23,7 @@ export var SystemInfo;
23
23
  version: repository.rootPackage.version,
24
24
  root: repository.dirname,
25
25
  packageCount: repository.getPackages().length,
26
+ platforms: [...repository.app.platforms].map(p => p.name),
26
27
  };
27
28
  }
28
29
  SystemInfo.getRepositoryInfo = getRepositoryInfo;
@@ -56,7 +56,8 @@ export declare abstract class VersionPlanService {
56
56
  * Across groups: a package depending on another group's bumped package always gets its scheme's
57
57
  * **smallest** bump of its own (never inheriting the source's) - the dependency reference itself
58
58
  * is the only thing that changed for it. Whether that re-triggers its own group's cascade is
59
- * `cascade`'s answer for that smallest bump (`'changed'` under npm, so it does not), but it can
59
+ * `cascade`'s answer for that smallest bump (`'dependents'` under npm, so its own in-group
60
+ * dependents move with it), and it can
60
61
  * itself ripple into a third group, and so on, until nothing new is affected - see
61
62
  * `rippleCrossGroup`.
62
63
  *
@@ -58,7 +58,8 @@ export class VersionPlanService {
58
58
  * Across groups: a package depending on another group's bumped package always gets its scheme's
59
59
  * **smallest** bump of its own (never inheriting the source's) - the dependency reference itself
60
60
  * is the only thing that changed for it. Whether that re-triggers its own group's cascade is
61
- * `cascade`'s answer for that smallest bump (`'changed'` under npm, so it does not), but it can
61
+ * `cascade`'s answer for that smallest bump (`'dependents'` under npm, so its own in-group
62
+ * dependents move with it), and it can
62
63
  * itself ripple into a third group, and so on, until nothing new is affected - see
63
64
  * `rippleCrossGroup`.
64
65
  *
@@ -174,8 +175,8 @@ export class VersionPlanService {
174
175
  * The abort case, marked **after** the root entry so the whole table reads as one coherent
175
176
  * "if this were committed" preview rather than a mixture of two.
176
177
  *
177
- * `to` survives the overwrite; `status` is what every writer filters on (`VersionService`,
178
- * `changed`), so an `'error'` entry carrying a version cannot be applied by any of them - and
178
+ * `to` survives the overwrite; `status` is what every writer filters on (`VersionService`),
179
+ * so an `'error'` entry carrying a version cannot be applied by any of them - and
179
180
  * `version` throws on the first error before it would reach `applyPlan` anyway. The reason
180
181
  * keeps the boundary it was computed from, because the status column already says `error` and
181
182
  * a reader losing `changed since <tag>` loses the only thing that explains the number.
@@ -523,8 +524,9 @@ export class VersionPlanService {
523
524
  function getPlanner(app) {
524
525
  const planner = app.versionPlanner;
525
526
  if (!planner) {
526
- throw new Error('No version planner is registered, so no version plan can be computed. Name a plugin that ' +
527
- 'contributes one in .rmanrc "plugins" - "rman-node" for a Node repository.');
527
+ throw new Error('No version planner is registered, so no version plan can be computed. Name a technology ' +
528
+ 'that contributes one in .rmanrc "platforms", or reach it through "extends" - "rman:node" ' +
529
+ 'for a Node repository, which is laid down by default unless presets were turned off.');
528
530
  }
529
531
  return planner;
530
532
  }
@@ -361,8 +361,8 @@ export class VersionService extends Service {
361
361
  (pkg.provider
362
362
  ? ` The "${pkg.provider}" provider looked and found no version to change. Name the ` +
363
363
  `identifier with { file, constant } if it is not "version", or drop the entry.`
364
- : ` This package belongs to no ecosystem (no plugin claimed it), so nothing knows how ` +
365
- `a version is declared in it. Name a plugin in .rmanrc "plugins".`));
364
+ : ` This package belongs to no ecosystem (no platform claimed it), so nothing knows how ` +
365
+ `a version is declared in it. Name the technology in .rmanrc "platforms", or reach it through "extends" (e.g. "rman:node").`));
366
366
  }
367
367
  /** Matched, but already reads the target - nothing to write and nothing to report. Distinct
368
368
  * from the `undefined` above, which is "nothing here to rewrite at all". */
@@ -447,8 +447,8 @@ function assertStampable(pkg, version) {
447
447
  (pkg.provider
448
448
  ? ` The "${pkg.provider}" provider looked and found no version to change. Name the ` +
449
449
  `identifier with { file, constant } if it is not "version", or drop the entry.`
450
- : ` This package belongs to no ecosystem (no plugin claimed it), so nothing knows how a ` +
451
- `version is declared in it. Name a plugin in .rmanrc "plugins".`));
450
+ : ` This package belongs to no ecosystem (no platform claimed it), so nothing knows how a ` +
451
+ `version is declared in it. Name the technology in .rmanrc "platforms", or reach it through "extends" (e.g. "rman:node").`));
452
452
  }
453
453
  }
454
454
  /**
@@ -176,7 +176,7 @@ applySkip?: boolean): Package[];
176
176
  * **It only means anything where a command scopes by the current directory** - `run`/`build`/`test`,
177
177
  * `exec`, `clean`, `changelog` and `diff` narrow to `Repository.currentPackage` when you stand
178
178
  * inside a package, and this is the escape hatch. On a command that already works across the whole
179
- * repository (`version`, `publish`, `list`, `changed`) it would be a flag that does nothing, which
179
+ * repository (`version`, `publish`, `list`) it would be a flag that does nothing, which
180
180
  * is worse than not offering it: a no-op flag reads as a promise.
181
181
  *
182
182
  * That same rule is why there is no `--root-only` beside it, however naturally the pair reads: it
@@ -210,7 +210,7 @@ applySkip = true) {
210
210
  * **It only means anything where a command scopes by the current directory** - `run`/`build`/`test`,
211
211
  * `exec`, `clean`, `changelog` and `diff` narrow to `Repository.currentPackage` when you stand
212
212
  * inside a package, and this is the escape hatch. On a command that already works across the whole
213
- * repository (`version`, `publish`, `list`, `changed`) it would be a flag that does nothing, which
213
+ * repository (`version`, `publish`, `list`) it would be a flag that does nothing, which
214
214
  * is worse than not offering it: a no-op flag reads as a promise.
215
215
  *
216
216
  * That same rule is why there is no `--root-only` beside it, however naturally the pair reads: it