rman 2.0.0-beta.2 → 2.0.0-beta.3

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 (164) hide show
  1. package/README.md +2 -12
  2. package/{plugins/node/augmentation/rman.augmentation.d.ts → builtins/platforms/node/augmentation/rmanrc.augmentation.d.ts} +4 -5
  3. package/{plugins → builtins/platforms}/node/augmentation/system-info.augmentation.js +1 -1
  4. package/{plugins → builtins/platforms}/node/commands/ci.command.d.ts +5 -3
  5. package/{plugins → builtins/platforms}/node/commands/ci.command.js +6 -5
  6. package/{plugins → builtins/platforms}/node/commands/clean.command.d.ts +6 -4
  7. package/{plugins → builtins/platforms}/node/commands/clean.command.js +6 -5
  8. package/builtins/platforms/node/index.d.ts +8 -0
  9. package/builtins/platforms/node/index.js +8 -0
  10. package/{plugins → builtins/platforms}/node/node-config.interface.d.ts +1 -2
  11. package/{plugins → builtins/platforms}/node/node-manifest.provider.d.ts +3 -3
  12. package/{plugins → builtins/platforms}/node/node-manifest.provider.js +3 -3
  13. package/{plugins → builtins/platforms}/node/node.platform.d.ts +3 -3
  14. package/{plugins → builtins/platforms}/node/services/ci.service.d.ts +3 -3
  15. package/{plugins → builtins/platforms}/node/services/ci.service.js +4 -4
  16. package/{plugins → builtins/platforms}/node/services/clean.service.d.ts +3 -3
  17. package/{plugins → builtins/platforms}/node/services/clean.service.js +3 -3
  18. package/{plugins → builtins/platforms}/node/services/publish.service.d.ts +4 -4
  19. package/{plugins → builtins/platforms}/node/services/publish.service.js +5 -5
  20. package/{plugins → builtins/platforms}/node/services/version-plan.service.d.ts +3 -3
  21. package/{plugins → builtins/platforms}/node/services/version-plan.service.js +2 -2
  22. package/builtins/presets/index.d.ts +15 -0
  23. package/builtins/presets/index.js +57 -0
  24. package/builtins/presets/node.d.ts +16 -0
  25. package/builtins/presets/node.js +57 -0
  26. package/{services → builtins/publish-targets/docker}/docker-publish.service.d.ts +6 -6
  27. package/{services → builtins/publish-targets/docker}/docker-publish.service.js +9 -9
  28. package/{targets → builtins/publish-targets/docker}/docker.target.d.ts +6 -5
  29. package/{targets → builtins/publish-targets/docker}/docker.target.js +1 -1
  30. package/builtins/publish-targets/docker/index.d.ts +2 -0
  31. package/builtins/publish-targets/docker/index.js +2 -0
  32. package/builtins/publish-targets/npm/index.d.ts +2 -0
  33. package/builtins/publish-targets/npm/index.js +2 -0
  34. package/{plugins/node → builtins/publish-targets/npm}/npm-publish-target.d.ts +4 -4
  35. package/{plugins/node → builtins/publish-targets/npm}/npm-publish-target.js +4 -5
  36. package/cli.d.ts +3 -0
  37. package/cli.js +16 -7
  38. package/commands/changelog.command.d.ts +106 -2
  39. package/commands/changelog.command.js +40 -0
  40. package/commands/config.command.js +23 -5
  41. package/commands/lint.command.d.ts +176 -0
  42. package/commands/lint.command.js +34 -0
  43. package/commands/list.command.js +1 -1
  44. package/commands/publish.command.d.ts +1 -1
  45. package/commands/publish.command.js +1 -1
  46. package/commands/run.command.js +1 -1
  47. package/commands/version.command.d.ts +16 -3
  48. package/commands/version.command.js +143 -9
  49. package/commands.d.ts +1 -1
  50. package/commands.js +1 -1
  51. package/constants.js +1 -1
  52. package/core/application.d.ts +10 -10
  53. package/core/application.js +28 -11
  54. package/core/{package.d.ts → classes/package.d.ts} +12 -4
  55. package/core/{package.js → classes/package.js} +17 -1
  56. package/core/{repository.d.ts → classes/repository.d.ts} +22 -36
  57. package/core/{repository.js → classes/repository.js} +112 -241
  58. package/core/{service.d.ts → classes/service.d.ts} +2 -2
  59. package/core/classes/workspace.d.ts +275 -0
  60. package/core/classes/workspace.js +537 -0
  61. package/core/command-builder.js +17 -1
  62. package/core/config/config-file-scope.d.ts +107 -0
  63. package/core/config/config-file-scope.js +226 -0
  64. package/core/config/config-interpolator.d.ts +164 -0
  65. package/core/config/config-interpolator.js +577 -0
  66. package/core/config/config-paths.d.ts +65 -0
  67. package/core/config/config-paths.js +78 -0
  68. package/core/config/config-reader.d.ts +192 -0
  69. package/core/config/config-reader.js +727 -0
  70. package/core/{merge-config.js → config/merge-config.js} +4 -8
  71. package/core/{custom-command.d.ts → interfaces/custom-command.d.ts} +5 -5
  72. package/core/{manifest.d.ts → interfaces/manifest.d.ts} +3 -3
  73. package/core/{manifest.js → interfaces/manifest.js} +2 -2
  74. package/core/{plugin.d.ts → interfaces/plugin.d.ts} +44 -27
  75. package/core/{plugin.js → interfaces/plugin.js} +48 -10
  76. package/core/{publish-target.d.ts → interfaces/publish-target.d.ts} +24 -12
  77. package/core/{publish-target.js → interfaces/publish-target.js} +16 -3
  78. package/core/{run-step.d.ts → interfaces/run-step.d.ts} +4 -4
  79. package/core/plugin-loader.d.ts +11 -51
  80. package/core/plugin-loader.js +21 -202
  81. package/index.d.ts +29 -28
  82. package/index.js +20 -46
  83. package/interfaces/config-scope.interface.d.ts +223 -0
  84. package/interfaces/config-scope.interface.js +1 -0
  85. package/interfaces/rman-config.interface.d.ts +100 -5
  86. package/interfaces/rman-config.interface.js +17 -0
  87. package/package.json +2 -1
  88. package/services/change-hash.service.d.ts +40 -6
  89. package/services/change-hash.service.js +90 -11
  90. package/services/changelog.service.d.ts +31 -3
  91. package/services/changelog.service.js +448 -65
  92. package/services/config-service.d.ts +8 -0
  93. package/services/config-service.js +3 -0
  94. package/services/exec.service.d.ts +2 -2
  95. package/services/exec.service.js +1 -1
  96. package/services/github-release.service.d.ts +3 -3
  97. package/services/github-release.service.js +3 -3
  98. package/services/import.service.d.ts +2 -2
  99. package/services/import.service.js +1 -1
  100. package/services/list.service.d.ts +9 -7
  101. package/services/list.service.js +2 -2
  102. package/services/run.service.d.ts +15 -11
  103. package/services/run.service.js +62 -18
  104. package/services/system-info.d.ts +1 -1
  105. package/services/version-plan.service.d.ts +8 -4
  106. package/services/version-plan.service.js +54 -21
  107. package/services/version.service.d.ts +5 -5
  108. package/services/version.service.js +7 -4
  109. package/services.d.ts +1 -1
  110. package/services.js +1 -1
  111. package/utils/branch-guard.d.ts +1 -1
  112. package/utils/color-yaml.d.ts +8 -0
  113. package/utils/color-yaml.js +86 -0
  114. package/utils/git.d.ts +26 -0
  115. package/utils/git.js +65 -0
  116. package/utils/logger.d.ts +1 -1
  117. package/utils/package-filter.d.ts +8 -1
  118. package/utils/package-filter.js +7 -0
  119. package/utils/printable-config.d.ts +8 -0
  120. package/utils/printable-config.js +45 -0
  121. package/utils/progress-panel.d.ts +9 -0
  122. package/utils/progress-panel.js +23 -1
  123. package/utils/release-version.d.ts +1 -1
  124. package/utils/run-options.js +1 -1
  125. package/utils/version-group.d.ts +31 -0
  126. package/utils/version-group.js +43 -0
  127. package/commands/changed.command.d.ts +0 -80
  128. package/commands/changed.command.js +0 -36
  129. package/core/config.d.ts +0 -530
  130. package/core/config.js +0 -1123
  131. package/core/core-services.d.ts +0 -14
  132. package/core/core-services.js +0 -30
  133. package/core/core-targets.d.ts +0 -14
  134. package/core/core-targets.js +0 -16
  135. package/core/extends-config.d.ts +0 -35
  136. package/core/extends-config.js +0 -129
  137. package/core/load-config-module.d.ts +0 -28
  138. package/core/load-config-module.js +0 -42
  139. package/core/workspace.d.ts +0 -119
  140. package/core/workspace.js +0 -124
  141. package/plugins/builtins.d.ts +0 -44
  142. package/plugins/builtins.js +0 -33
  143. package/plugins/detect.d.ts +0 -78
  144. package/plugins/detect.js +0 -70
  145. package/plugins/node/index.d.ts +0 -29
  146. package/plugins/node/index.js +0 -40
  147. /package/{core/run-step.js → builtins/platforms/node/augmentation/rmanrc.augmentation.js} +0 -0
  148. /package/{plugins → builtins/platforms}/node/augmentation/system-info.augmentation.d.ts +0 -0
  149. /package/{plugins → builtins/platforms}/node/node-config.interface.js +0 -0
  150. /package/{plugins → builtins/platforms}/node/node.platform.js +0 -0
  151. /package/{plugins → builtins/platforms}/node/utils/workspace-range.d.ts +0 -0
  152. /package/{plugins → builtins/platforms}/node/utils/workspace-range.js +0 -0
  153. /package/{plugins/node/utils → builtins/publish-targets/npm}/npm-view.d.ts +0 -0
  154. /package/{plugins/node/utils → builtins/publish-targets/npm}/npm-view.js +0 -0
  155. /package/core/{registry.d.ts → classes/registry.d.ts} +0 -0
  156. /package/core/{registry.js → classes/registry.js} +0 -0
  157. /package/core/{service.js → classes/service.js} +0 -0
  158. /package/core/{version-scheme.d.ts → classes/version-scheme.d.ts} +0 -0
  159. /package/core/{version-scheme.js → classes/version-scheme.js} +0 -0
  160. /package/core/{merge-config.d.ts → config/merge-config.d.ts} +0 -0
  161. /package/core/{resolve-target.d.ts → config/resolve-config-target.d.ts} +0 -0
  162. /package/core/{resolve-target.js → config/resolve-config-target.js} +0 -0
  163. /package/core/{custom-command.js → interfaces/custom-command.js} +0 -0
  164. /package/{plugins/node/augmentation/rman.augmentation.js → core/interfaces/run-step.js} +0 -0
@@ -1,78 +0,0 @@
1
- /**
2
- * **Which platform a repository looks like, when it has not said.**
3
- *
4
- * The 2.0 split made every Node repository write a config file before `rman clean` would run, and
5
- * the cost of that landed on exactly the repositories the split was not for. This is the other half
6
- * of the fix: a repository that declares no technology gets the one its own files already imply.
7
- *
8
- * **The core does not know what any repository looks like, and must not.** It asks the *platforms*
9
- * - `manifestProvider.read(dir)` has always meant "is this directory one of mine?", so there is no
10
- * new seam and no list of filenames anywhere in `core/`. This file listed `package.json` for one
11
- * commit, which is the same mistake as the hardcoded `['npm']` publish default that
12
- * `PublishTarget.claims` exists to have replaced: true of npm, written in a place that speaks for
13
- * every ecosystem, and invisible while only one platform ships.
14
- *
15
- * The platforms it can ask are the ones it has, which are the built-ins - by construction, not by
16
- * choice: a third-party platform arrives through `plugins` or `extends`, and a repository that
17
- * wrote either has declared its technology, so detection never runs for it.
18
- *
19
- * **Only ever consulted when nothing was declared** - see `Repository.create`, which checks both the
20
- * config and the application. That boundary is the whole safety of it, because registering a
21
- * platform changes *which directories are packages at all* (`Workspace.resolve` takes the first
22
- * provider that answers), so guessing on top of an explicit statement could quietly change what
23
- * `rman list` reports.
24
- *
25
- * **It is announced, not silent.** A guess the reader cannot see is one they cannot correct.
26
- */
27
- export interface DetectedBuiltin {
28
- /** The built-in's name - what `plugins: [...]` would have said. */
29
- name: string;
30
- /** The file that gave it away, for the message - the platform's own `manifestFile`. */
31
- because: string;
32
- }
33
- /**
34
- * Marks a config whose `plugins` was **detected rather than declared**, so the one caller that
35
- * should say so can tell.
36
- *
37
- * A non-enumerable symbol, the way `ORIGINS` and `PREVIOUS_VALUES` already carry bookkeeping: it
38
- * travels with the config through `mergeConfig`, `JSON.stringify` and `rman config` without any of
39
- * them knowing it is there, and `expect`'s `toEqual` compares symbol properties - so a plain
40
- * property would turn every config-shape spec into a diff about this.
41
- *
42
- * The alternative was re-deriving the answer where the message is printed, which means reading the
43
- * config twice and two places that can disagree about what "declared" means.
44
- */
45
- export declare const DETECTED_BUILTIN: unique symbol;
46
- /** What detection put on `config`, if anything. */
47
- export declare function detectedBuiltinOf(config: object): DetectedBuiltin | undefined;
48
- /**
49
- * The first built-in platform that claims `dir`, or `undefined` for a repository none of them
50
- * recognizes - which is the honest answer, not a default.
51
- *
52
- * **First match, in declaration order**, the same rule `Manifest.read` and `Workspace.resolve`
53
- * already follow, so a repository two platforms both recognize resolves the same way here as it
54
- * will once they are loaded.
55
- *
56
- * Memoized per directory: this is asked once per directory per package and each ask reads the disk.
57
- * Nothing here writes, so the answer cannot change under a run in any way that matters.
58
- *
59
- * **Async only because `builtins.js` is imported dynamically, and that is a cycle rather than a
60
- * style** - the same one `expandBuiltinPlugins` in `config.ts` already documents, reached from the
61
- * other side. A built-in pulls in its commands and services; one of those services extends a core
62
- * service, and the core's own module graph comes back through here:
63
- *
64
- * ```
65
- * services/version-plan.service -> core/application -> core/core-services
66
- * -> services/github-release.service -> core/repository -> plugins/detect
67
- * -> plugins/builtins -> plugins/node/index -> plugins/node/node.platform
68
- * -> plugins/node/services/version-plan.service (extends the first, still initialising)
69
- * ```
70
- *
71
- * **Measured, and the suite could not see it**: the *built* CLI died on every command with
72
- * `ReferenceError: Cannot access 'VersionPlanService' before initialization`, while `npm test`
73
- * passed - mocha resolves `src` through `tsconfig-test.json`'s `paths`, which is a different module
74
- * graph and happens to reach the two in the other order. `npm run smoke` is what looks now.
75
- */
76
- export declare function detectBuiltin(dir: string): Promise<DetectedBuiltin | undefined>;
77
- /** Forgets what was detected - for a spec that writes a fixture, detects, then writes another. */
78
- export declare function clearDetectionCache(): void;
package/plugins/detect.js DELETED
@@ -1,70 +0,0 @@
1
- import path from 'node:path';
2
- /**
3
- * Marks a config whose `plugins` was **detected rather than declared**, so the one caller that
4
- * should say so can tell.
5
- *
6
- * A non-enumerable symbol, the way `ORIGINS` and `PREVIOUS_VALUES` already carry bookkeeping: it
7
- * travels with the config through `mergeConfig`, `JSON.stringify` and `rman config` without any of
8
- * them knowing it is there, and `expect`'s `toEqual` compares symbol properties - so a plain
9
- * property would turn every config-shape spec into a diff about this.
10
- *
11
- * The alternative was re-deriving the answer where the message is printed, which means reading the
12
- * config twice and two places that can disagree about what "declared" means.
13
- */
14
- export const DETECTED_BUILTIN = Symbol('rman.detectedBuiltin');
15
- /** What detection put on `config`, if anything. */
16
- export function detectedBuiltinOf(config) {
17
- return config[DETECTED_BUILTIN];
18
- }
19
- /**
20
- * The first built-in platform that claims `dir`, or `undefined` for a repository none of them
21
- * recognizes - which is the honest answer, not a default.
22
- *
23
- * **First match, in declaration order**, the same rule `Manifest.read` and `Workspace.resolve`
24
- * already follow, so a repository two platforms both recognize resolves the same way here as it
25
- * will once they are loaded.
26
- *
27
- * Memoized per directory: this is asked once per directory per package and each ask reads the disk.
28
- * Nothing here writes, so the answer cannot change under a run in any way that matters.
29
- *
30
- * **Async only because `builtins.js` is imported dynamically, and that is a cycle rather than a
31
- * style** - the same one `expandBuiltinPlugins` in `config.ts` already documents, reached from the
32
- * other side. A built-in pulls in its commands and services; one of those services extends a core
33
- * service, and the core's own module graph comes back through here:
34
- *
35
- * ```
36
- * services/version-plan.service -> core/application -> core/core-services
37
- * -> services/github-release.service -> core/repository -> plugins/detect
38
- * -> plugins/builtins -> plugins/node/index -> plugins/node/node.platform
39
- * -> plugins/node/services/version-plan.service (extends the first, still initialising)
40
- * ```
41
- *
42
- * **Measured, and the suite could not see it**: the *built* CLI died on every command with
43
- * `ReferenceError: Cannot access 'VersionPlanService' before initialization`, while `npm test`
44
- * passed - mocha resolves `src` through `tsconfig-test.json`'s `paths`, which is a different module
45
- * graph and happens to reach the two in the other order. `npm run smoke` is what looks now.
46
- */
47
- export async function detectBuiltin(dir) {
48
- const resolved = path.resolve(dir);
49
- if (cache.has(resolved))
50
- return cache.get(resolved);
51
- const { BUILTIN_PLUGINS } = await import('./builtins.js');
52
- let found;
53
- for (const [name, builtin] of Object.entries(BUILTIN_PLUGINS)) {
54
- const platform = builtin.platform();
55
- /** `read` is the question. Its answer is thrown away - the manifest is read again for real once
56
- * the platform is registered, and reading it twice is cheaper than keeping a half-built
57
- * package around to decide whether it should exist. */
58
- if (platform.manifestProvider.read(resolved)) {
59
- found = { name, because: platform.manifestProvider.fileName };
60
- break;
61
- }
62
- }
63
- cache.set(resolved, found);
64
- return found;
65
- }
66
- /** Forgets what was detected - for a spec that writes a fixture, detects, then writes another. */
67
- export function clearDetectionCache() {
68
- cache.clear();
69
- }
70
- const cache = new Map();
@@ -1,29 +0,0 @@
1
- import './augmentation/rman.augmentation.js';
2
- import { type Platform } from '../../core/plugin.js';
3
- import type { RmanConfig } from '../../interfaces/rman-config.interface.js';
4
- /**
5
- * **The `node` built-in, as the config it contributes** - its technology, its two commands and its
6
- * publish target, which is exactly what `extends: 'rman-node'` used to deliver.
7
- *
8
- * A *config* rather than a bare `Plugin`, and that distinction is the whole reason `plugins: ['node']`
9
- * can replace an `extends`: a technology alone would bring the manifest reader and leave `rman clean`
10
- * an unknown argument.
11
- *
12
- * **A function, so nothing here happens until a repository asks for it.** `augmentSystemInfo()`
13
- * mutates the core's own `SystemInfo` in place, so calling it at import time would have `rman info`
14
- * report npm's tooling in a Cargo repository that never named this built-in - which is the shape of
15
- * "bundled" quietly becoming "always on". The type-only augmentation above is imported eagerly
16
- * because a type costs nothing at runtime and a config author's editor wants it either way.
17
- */
18
- /**
19
- * **The platform itself, for asking.** Detection puts a directory to every built-in's platform -
20
- * `manifestProvider.read(dir)` is already "is this one of mine?" - and that question must be
21
- * answerable without turning anything on. Constructed once: a `NodePlatform` holds no state and two
22
- * of them answering differently is not a thing worth allowing.
23
- *
24
- * **Declared, like any other platform.** `loadPlugins` refuses anything that did not come through
25
- * `definePlatform`/`definePlugin`, and a built-in is registered by the same loader as everything
26
- * else - the mark is not something being inside rman excuses.
27
- */
28
- export declare const nodePlatform: Platform;
29
- export declare function nodeBuiltin(): RmanConfig;
@@ -1,40 +0,0 @@
1
- import './augmentation/rman.augmentation.js';
2
- import { definePlatform } from '../../core/plugin.js';
3
- import { augmentSystemInfo } from './augmentation/system-info.augmentation.js';
4
- import ciCommand from './commands/ci.command.js';
5
- import cleanCommand from './commands/clean.command.js';
6
- import { NodePlatform } from './node.platform.js';
7
- import { NpmPublishTarget } from './npm-publish-target.js';
8
- /**
9
- * **The `node` built-in, as the config it contributes** - its technology, its two commands and its
10
- * publish target, which is exactly what `extends: 'rman-node'` used to deliver.
11
- *
12
- * A *config* rather than a bare `Plugin`, and that distinction is the whole reason `plugins: ['node']`
13
- * can replace an `extends`: a technology alone would bring the manifest reader and leave `rman clean`
14
- * an unknown argument.
15
- *
16
- * **A function, so nothing here happens until a repository asks for it.** `augmentSystemInfo()`
17
- * mutates the core's own `SystemInfo` in place, so calling it at import time would have `rman info`
18
- * report npm's tooling in a Cargo repository that never named this built-in - which is the shape of
19
- * "bundled" quietly becoming "always on". The type-only augmentation above is imported eagerly
20
- * because a type costs nothing at runtime and a config author's editor wants it either way.
21
- */
22
- /**
23
- * **The platform itself, for asking.** Detection puts a directory to every built-in's platform -
24
- * `manifestProvider.read(dir)` is already "is this one of mine?" - and that question must be
25
- * answerable without turning anything on. Constructed once: a `NodePlatform` holds no state and two
26
- * of them answering differently is not a thing worth allowing.
27
- *
28
- * **Declared, like any other platform.** `loadPlugins` refuses anything that did not come through
29
- * `definePlatform`/`definePlugin`, and a built-in is registered by the same loader as everything
30
- * else - the mark is not something being inside rman excuses.
31
- */
32
- export const nodePlatform = definePlatform(new NodePlatform());
33
- export function nodeBuiltin() {
34
- augmentSystemInfo();
35
- return {
36
- plugins: [nodePlatform],
37
- commands: [ciCommand, cleanCommand],
38
- publishTargets: [new NpmPublishTarget()],
39
- };
40
- }
File without changes
File without changes
File without changes