rman 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/constants.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.4.0';
1
+ export const version = '2.5.0';
package/index.d.ts CHANGED
@@ -32,6 +32,11 @@
32
32
  import './builtins/platforms/node/augmentation/rmanrc.augmentation.js';
33
33
  import type { RmanConfig as CommandDeclaration } from './interfaces/rman-config.interface.js';
34
34
  export { defineConfig } from './interfaces/rman-config.interface.js';
35
+ /**
36
+ * Merges `source` onto `target` the way rman layers an `extends` base, a directory level or a
37
+ * `"[selector]"` block - returning `target`, mutated.
38
+ */
39
+ export { mergeConfig } from './core/config/merge-config.js';
35
40
  /**
36
41
  * **A config value written as a function**, and the scope it is handed. Exported because a config
37
42
  * author could not name either: `interpolateConfig` calls a function wherever a `${{ }}` could
package/index.js CHANGED
@@ -31,6 +31,32 @@
31
31
  */
32
32
  import './builtins/platforms/node/augmentation/rmanrc.augmentation.js';
33
33
  export { defineConfig } from './interfaces/rman-config.interface.js';
34
+ /**
35
+ * Merges `source` onto `target` the way rman layers an `extends` base, a directory level or a
36
+ * `"[selector]"` block - returning `target`, mutated.
37
+ */
38
+ /* **Exported for a config assembled in JavaScript**, which `@panates/rman-preset` is: it composes
39
+ * one config from a platform-neutral part and a Node one, and a plain object spread gets that
40
+ * wrong in two ways a reader would not expect.
41
+ *
42
+ * A spread is shallow, so two objects both declaring `changelog` keep only the later one's -
43
+ * silently, and wholesale. A deep merge from a general-purpose library fixes that half and breaks
44
+ * the other: measured with `@jsopen/objects`' `merge({deep: true})`, `commands: ['a','b']` merged
45
+ * with `['c']` gives `['c']`, while rman appends those - `commands`, `plugins`, `platforms` and
46
+ * `publishTargets` are `ALWAYS_APPEND` keys precisely because naming one of your own never means
47
+ * "and drop the ones my base brought". A generic merge would drop a preset's commands the day
48
+ * anything else declared one.
49
+ *
50
+ * `origin` is the file `source` was read from, recorded per key so a failing expression can name
51
+ * it. A caller merging an object it built rather than read passes nothing, and the error then
52
+ * names whatever file the surrounding config came from.
53
+ *
54
+ * **`extends` remains the better answer where it fits**, and it is worth trying first: a config
55
+ * module can carry `extends: ['./other.js']` and let rman do the merging, which costs no API
56
+ * surface at all and keeps the origins exact. Measured to work for a JS module extending a JS
57
+ * module, nested inside a config that is itself an `extends` target. This export is for the case
58
+ * where one module has to hand back a single finished object. */
59
+ export { mergeConfig } from './core/config/merge-config.js';
34
60
  export { defineCommand } from './core/interfaces/custom-command.js';
35
61
  /** Both the shape and the registry: `const m: Manifest` and `Manifest.read(dir)` - merged onto one
36
62
  * name so a plugin can augment it the way it augments `SystemInfo`. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Repository manager",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {