rman 1.2.5 → 2.0.0-beta.2

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 (153) hide show
  1. package/README.md +63 -19
  2. package/cli.d.ts +5 -0
  3. package/cli.js +214 -88
  4. package/commands/build.command.d.ts +177 -3
  5. package/commands/build.command.js +20 -10
  6. package/commands/changed.command.d.ts +80 -3
  7. package/commands/changed.command.js +19 -12
  8. package/commands/changelog.command.d.ts +192 -3
  9. package/commands/changelog.command.js +87 -43
  10. package/commands/config.command.d.ts +44 -3
  11. package/commands/config.command.js +30 -19
  12. package/commands/diff.command.d.ts +37 -3
  13. package/commands/diff.command.js +25 -16
  14. package/commands/exec.command.d.ts +193 -3
  15. package/commands/exec.command.js +60 -58
  16. package/commands/github-release.command.d.ts +154 -3
  17. package/commands/github-release.command.js +67 -37
  18. package/commands/import.command.d.ts +36 -3
  19. package/commands/import.command.js +28 -20
  20. package/commands/info.command.d.ts +35 -7
  21. package/commands/info.command.js +36 -30
  22. package/commands/list.command.d.ts +163 -3
  23. package/commands/list.command.js +109 -71
  24. package/commands/publish.command.d.ts +231 -0
  25. package/commands/publish.command.js +304 -0
  26. package/commands/run.command.d.ts +186 -6
  27. package/commands/run.command.js +26 -72
  28. package/commands/test.command.d.ts +173 -3
  29. package/commands/test.command.js +16 -10
  30. package/commands/version.command.d.ts +317 -3
  31. package/commands/version.command.js +149 -69
  32. package/commands.d.ts +32 -0
  33. package/commands.js +28 -0
  34. package/constants.js +1 -1
  35. package/core/application.d.ts +116 -0
  36. package/core/application.js +143 -0
  37. package/core/command-builder.d.ts +14 -0
  38. package/core/command-builder.js +78 -0
  39. package/core/config.d.ts +180 -50
  40. package/core/config.js +332 -153
  41. package/core/core-services.d.ts +14 -0
  42. package/core/core-services.js +30 -0
  43. package/core/core-targets.d.ts +14 -0
  44. package/core/core-targets.js +16 -0
  45. package/core/custom-command.d.ts +42 -6
  46. package/core/custom-command.js +44 -17
  47. package/core/extends-config.d.ts +13 -5
  48. package/core/extends-config.js +52 -12
  49. package/core/load-config-module.d.ts +28 -0
  50. package/core/load-config-module.js +42 -0
  51. package/core/manifest.d.ts +47 -25
  52. package/core/manifest.js +51 -69
  53. package/core/merge-config.d.ts +33 -34
  54. package/core/merge-config.js +138 -93
  55. package/core/package.d.ts +145 -17
  56. package/core/package.js +128 -36
  57. package/core/plugin-loader.d.ts +65 -0
  58. package/core/plugin-loader.js +234 -0
  59. package/core/plugin.d.ts +135 -90
  60. package/core/plugin.js +70 -173
  61. package/core/publish-target.d.ts +124 -0
  62. package/core/publish-target.js +30 -0
  63. package/core/registry.d.ts +30 -0
  64. package/core/registry.js +47 -0
  65. package/core/repository.d.ts +72 -9
  66. package/core/repository.js +293 -43
  67. package/core/resolve-target.d.ts +1 -1
  68. package/core/resolve-target.js +1 -1
  69. package/core/service.d.ts +49 -0
  70. package/core/service.js +40 -0
  71. package/core/version-scheme.d.ts +23 -1
  72. package/core/version-scheme.js +29 -1
  73. package/core/workspace.d.ts +84 -33
  74. package/core/workspace.js +63 -22
  75. package/index.d.ts +111 -14
  76. package/index.js +85 -9
  77. package/interfaces/rman-config.interface.d.ts +739 -212
  78. package/interfaces/rman-config.interface.js +61 -1
  79. package/package.json +2 -1
  80. package/plugins/builtins.d.ts +44 -0
  81. package/plugins/builtins.js +33 -0
  82. package/plugins/detect.d.ts +78 -0
  83. package/plugins/detect.js +70 -0
  84. package/plugins/node/augmentation/rman.augmentation.d.ts +84 -0
  85. package/plugins/node/augmentation/rman.augmentation.js +1 -0
  86. package/plugins/node/augmentation/system-info.augmentation.d.ts +26 -0
  87. package/plugins/node/augmentation/system-info.augmentation.js +79 -0
  88. package/plugins/node/commands/ci.command.d.ts +131 -0
  89. package/plugins/node/commands/ci.command.js +59 -0
  90. package/plugins/node/commands/clean.command.d.ts +183 -0
  91. package/plugins/node/commands/clean.command.js +73 -0
  92. package/plugins/node/index.d.ts +29 -0
  93. package/plugins/node/index.js +40 -0
  94. package/plugins/node/node-config.interface.d.ts +77 -0
  95. package/plugins/node/node-config.interface.js +7 -0
  96. package/plugins/node/node-manifest.provider.d.ts +68 -0
  97. package/plugins/node/node-manifest.provider.js +125 -0
  98. package/plugins/node/node.platform.d.ts +53 -0
  99. package/plugins/node/node.platform.js +134 -0
  100. package/plugins/node/npm-publish-target.d.ts +73 -0
  101. package/plugins/node/npm-publish-target.js +96 -0
  102. package/plugins/node/services/ci.service.d.ts +47 -0
  103. package/plugins/node/services/ci.service.js +213 -0
  104. package/plugins/node/services/clean.service.d.ts +53 -0
  105. package/plugins/node/services/clean.service.js +237 -0
  106. package/plugins/node/services/publish.service.d.ts +114 -0
  107. package/plugins/node/services/publish.service.js +371 -0
  108. package/plugins/node/services/version-plan.service.d.ts +44 -0
  109. package/plugins/node/services/version-plan.service.js +58 -0
  110. package/plugins/node/utils/npm-view.d.ts +48 -0
  111. package/plugins/node/utils/npm-view.js +71 -0
  112. package/plugins/node/utils/workspace-range.d.ts +26 -0
  113. package/plugins/node/utils/workspace-range.js +28 -0
  114. package/services/change-hash.service.d.ts +2 -2
  115. package/services/change-hash.service.js +2 -2
  116. package/services/changelog.service.d.ts +62 -51
  117. package/services/changelog.service.js +14 -11
  118. package/services/docker-publish.service.d.ts +50 -29
  119. package/services/docker-publish.service.js +43 -20
  120. package/services/exec.service.d.ts +23 -12
  121. package/services/exec.service.js +14 -9
  122. package/services/github-release.service.d.ts +44 -33
  123. package/services/github-release.service.js +13 -10
  124. package/services/import.service.d.ts +25 -14
  125. package/services/import.service.js +9 -5
  126. package/services/list.service.d.ts +62 -10
  127. package/services/list.service.js +62 -15
  128. package/services/run.service.d.ts +22 -13
  129. package/services/run.service.js +262 -223
  130. package/services/version-plan.service.d.ts +27 -4
  131. package/services/version-plan.service.js +42 -15
  132. package/services/version.service.d.ts +31 -11
  133. package/services/version.service.js +29 -13
  134. package/targets/docker.target.d.ts +53 -0
  135. package/targets/docker.target.js +40 -0
  136. package/utils/bin-path.d.ts +6 -7
  137. package/utils/bin-path.js +7 -18
  138. package/utils/branch-guard.d.ts +29 -0
  139. package/utils/branch-guard.js +31 -0
  140. package/utils/exec.d.ts +10 -0
  141. package/utils/exec.js +1 -1
  142. package/utils/logger.d.ts +1 -1
  143. package/utils/logger.js +1 -1
  144. package/utils/package-filter.d.ts +127 -7
  145. package/utils/package-filter.js +197 -16
  146. package/utils/printable-config.d.ts +1 -1
  147. package/utils/printable-config.js +1 -1
  148. package/utils/run-bin.d.ts +10 -0
  149. package/utils/run-bin.js +1 -1
  150. package/utils/run-options.d.ts +97 -0
  151. package/utils/run-options.js +81 -0
  152. package/utils/version-stamp.d.ts +1 -1
  153. package/utils/version-stamp.js +1 -1
package/index.js CHANGED
@@ -6,47 +6,123 @@
6
6
  * per domain - CLI-only concerns (argv parsing, `--help` text, and all console/file presentation)
7
7
  * stay in `cli.ts` and the individual `commands/*.command.ts` modules, which are not exported here.
8
8
  *
9
- * **This is also the plugin contract.** A plugin (`rman-node`, say) is an ordinary package that
10
- * imports from here, so everything a command needs in order to live outside rman has to be
11
- * exported - the progress panel, the package filter, the branch guard, the git helper. What is
9
+ * **This is also the plugin contract.** A third-party plugin is an ordinary package that imports
10
+ * from here, so everything a command needs in order to live outside rman has to be exported - the progress panel, the package filter, the branch guard, the git helper. What is
12
11
  * *not* exported is deliberately private: config resolution internals, the expression evaluator,
13
12
  * the command registry.
14
13
  */
14
+ /**
15
+ * **The `node` built-in's type augmentation, imported for the same reason `commands.ts` is.**
16
+ *
17
+ * A `declare module` augmentation applies only where the module declaring it is part of the
18
+ * program. The node plugin's lives in `plugins/node/augmentation/rman.augmentation.ts` and is
19
+ * imported by the *plugin's* entry point - which nothing here reached, so `clean`, `publish.npm`
20
+ * and the rest existed for rman itself and for nobody else.
21
+ *
22
+ * **Measured on a real consumer**, `@panates/rman-node`, a config package annotated with these
23
+ * types: `Object literal may only specify known properties, and 'clean' does not exist in type
24
+ * 'RmanConfig'`, plus `Property 'npm' does not exist` - ten errors across its config and its own
25
+ * suite. It is the identical failure the core's command keys caused when they stopped being
26
+ * hand-written centrally, and it reappeared the moment the plugin moved *inside* rman: until then
27
+ * a consumer imported `rman-node` and got the augmentation with the package.
28
+ *
29
+ * Type-only, so the emitted module is empty - imported for what it declares, not for what it does.
30
+ * Pinned in `docs-api.spec.ts`, which imports only from this file.
31
+ */
32
+ import './plugins/node/augmentation/rman.augmentation.js';
15
33
  export { defineConfig } from './core/config.js';
16
34
  export { defineCommand } from './core/custom-command.js';
17
35
  /** Both the shape and the registry: `const m: Manifest` and `Manifest.read(dir)` - merged onto one
18
36
  * name so a plugin can augment it the way it augments `SystemInfo`. */
37
+ export { RmanApplication } from './core/application.js';
19
38
  export { Manifest } from './core/manifest.js';
20
39
  export { Package } from './core/package.js';
21
- export { definePlugin } from './core/plugin.js';
40
+ /** The publish seam: where a package's artifact ships. The core brings `docker` (nobody's
41
+ * ecosystem); npm's target is the `node` built-in's, and any other technology's is its own plugin's. */
42
+ export { declaredTargets, shipsTo, targetsOf, unknownTargets } from './core/publish-target.js';
43
+ export { Registry } from './core/registry.js';
22
44
  export { Repository } from './core/repository.js';
45
+ export { Service } from './core/service.js';
46
+ /**
47
+ * **`Platform` is one technology, whole**; **`Plugin` is whatever a package contributes**, platforms
48
+ * among them.
49
+ *
50
+ * A platform says how its packages are recognized and written, where they live, what goes on a
51
+ * child's PATH and how its releases are planned - `manifestProvider` is what makes one, and it is
52
+ * required. A plugin carries `platforms` and an `init` for anything the seams do not name yet; a
53
+ * bare `Platform` is accepted wherever a `Plugin` is, as sugar for the plugin that provides only it.
54
+ *
55
+ * **Both must be declared through their factory.** `loadPlugins` checks for the mark, because an
56
+ * rman 1.x plugin was `{ name, init }` and so is a 2.x plugin contributing nothing but an `init` -
57
+ * no shape test can tell them apart.
58
+ */
59
+ export { basePlatform, definePlatform, definePlugin, isPlatform, } from './core/plugin.js';
23
60
  /** The numbering seam. `VersionScheme` is abstract - `highestVersion`/`highestBump`/`smallestBump`
24
61
  * are implemented from the members around them, so a scheme states only what it must and still
25
62
  * overrides any of the three. `SemverScheme` is exported to subclass rather than restate. */
26
63
  export { assertOneScheme, SemverScheme, semverScheme, VersionScheme } from './core/version-scheme.js';
27
64
  /** The workspace seam: how a repository's packages are found. A plugin contributes a provider
28
- * (see `RmanPlugin.workspace`); the core has none, so `workspaces` is npm's idea and lives in
29
- * `rman-node`. */
65
+ * (see `Plugin.workspace`); the core has none, so `workspaces` is npm's idea and belongs to the
66
+ * `node` built-in. */
30
67
  /** `Workspace.Layout`, `Workspace.Provider`, `Workspace.addProvider`, `Workspace.resolve`,
31
68
  * `Workspace.findRoot` - one namespace, so a plugin can augment it. */
32
69
  export { Workspace } from './core/workspace.js';
70
+ /**
71
+ * **How a command is declared** - the same API the built-ins use, so a plugin's command is declared
72
+ * rather than built: options as data (checked for typos), positionals named against the command
73
+ * string, `--config` keys derived from what the command owns, and `ArgsOf` for the handler.
74
+ *
75
+ * `declareCommand`, not `registerCommand`: the latter pushes onto a module-level registry every
76
+ * `runCli` walks, so a plugin using it would give its commands to repositories that never named it.
77
+ * Anything else puts the function in its config's `commands`.
78
+ *
79
+ * **Flat names rather than `RmanConfig.CommandOption`**, and they outlived the reason they were
80
+ * introduced: a second file exported a `RmanConfig` too, so the namespace holding these was
81
+ * unreachable from outside the package. The two are one file now and `RmanConfig` *is* exported -
82
+ * these stay because they are the better names for the job. A plugin author declaring a flag wants
83
+ * `CommandOption`; the config it happens to contribute to is not what they are naming.
84
+ */
85
+ export { declareCommand } from './interfaces/rman-config.interface.js';
86
+ export * from './commands.js';
33
87
  export * from './interfaces/rman-config.interface.js';
34
88
  export * from './services.js';
35
89
  // --- what a command needs to behave like a built-in one -----------------------------------------
36
90
  /** Branch guarding: `allowBranch`/`ignoreBranch`, so a plugin's release command refuses to run on
37
91
  * the wrong branch exactly as `publish` and `version` do. */
38
- export { applyBranchGuardOptions, assertAllowedBranch, readBranchGuardOptions, } from './utils/branch-guard.js';
92
+ export { applyBranchGuardOptions, assertAllowedBranch, branchGuardOptions, readBranchGuardOptions, } from './utils/branch-guard.js';
39
93
  /** Where a repository's locally installed binaries live - the core spells the PATH variable, a
40
- * plugin says which directories go on it (see `RmanPlugin.binPaths`). */
94
+ * plugin says which directories go on it (see `Plugin.binPaths`). */
41
95
  export { BinPath } from './utils/bin-path.js';
42
96
  export { exec } from './utils/exec.js';
43
97
  export { GitHelper } from './utils/git.js';
44
98
  export { LOG_LEVELS, Logger, resolveRootLogLevel } from './utils/logger.js';
45
99
  /** `--scope`/`--deps`/`--dependents`/`--private`, so a plugin's command filters packages the same
46
100
  * way every built-in does rather than inventing its own flags. */
47
- export { applyPackageFilterOptions, applyRootOption, filterPackages, readPackageFilterOptions, readRootOption, } from './utils/package-filter.js';
101
+ export { applyFromRootOption, applyPackageFilterOptions, filterPackages, fromRootOption, packageFilterOptions, readFromRootOption, readPackageFilterOptions, ROOT_SELECTOR, } from './utils/package-filter.js';
48
102
  /** The live panel `run`/`build`/`clean` print - a plugin's per-package command looks like the rest
49
103
  * of rman instead of like a script someone bolted on. */
50
104
  export { formatDuration, ProgressPanel, } from './utils/progress-panel.js';
105
+ /** Version stamping helpers a `Plugin.stampVersion` can delegate to - the quoted-constant
106
+ * pattern most languages share, and the OCI Dockerfile label (which `version` stamps itself, since
107
+ * the label's value is by specification the package's version). */
108
+ /** A calendar version's time part (`2026.9.15-1430`) is a semver *prerelease identifier* by
109
+ * construction, so anything asking "is this a preview?" has to rule it out first - `github-release`
110
+ * does, and so must a publish target deciding whether a version needs its own dist-tag. Exported
111
+ * because that second caller lives in a plugin. */
112
+ /**
113
+ * **The `node` built-in's own surface.** It ships inside rman rather than as `rman-node`, so its
114
+ * services and target are named from here - a repository asks for the technology with
115
+ * `plugins: ['node']` (or lets detection find it) and never constructs any of this by hand.
116
+ *
117
+ * Its `.rmanrc` *keys* arrive separately, through the bare import at the top of this file - see
118
+ * there for why that import is not tidiness.
119
+ */
120
+ export { BUILTIN_PLUGINS, builtinPluginNames, isBuiltinPlugin } from './plugins/builtins.js';
121
+ export { NPM_TARGET, NpmPublishTarget } from './plugins/node/npm-publish-target.js';
122
+ export { CiService } from './plugins/node/services/ci.service.js';
123
+ export { CleanService } from './plugins/node/services/clean.service.js';
124
+ export { PublishService } from './plugins/node/services/publish.service.js';
125
+ export { NodeVersionPlanService } from './plugins/node/services/version-plan.service.js';
126
+ export { isCalendarVersion } from './utils/release-version.js';
51
127
  export { runBin } from './utils/run-bin.js';
52
128
  export { OCI_VERSION_LABEL, stampVersionConstant, stampVersionLabel } from './utils/version-stamp.js';