rman 2.36.0 → 2.37.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.
|
|
1
|
+
export const version = '2.37.0';
|
|
@@ -122,6 +122,11 @@ export declare class Repository extends Package {
|
|
|
122
122
|
configScope(pkg: Package, options?: {
|
|
123
123
|
targetVersion?: string;
|
|
124
124
|
}): ConfigScope;
|
|
125
|
+
/**
|
|
126
|
+
* The package a config entry names - its name, else a directory relative to the repository root
|
|
127
|
+
* - or `undefined`. How `dependencies` and `carries` entries are read.
|
|
128
|
+
*/
|
|
129
|
+
resolveDeclaredPackage(entry: string): Package | undefined;
|
|
125
130
|
/** `${{ git.* }}`, read at most once per repository per process. */
|
|
126
131
|
protected _gitScope(): GitScope;
|
|
127
132
|
/**
|
|
@@ -202,6 +202,13 @@ export class Repository extends Package {
|
|
|
202
202
|
},
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* The package a config entry names - its name, else a directory relative to the repository root
|
|
207
|
+
* - or `undefined`. How `dependencies` and `carries` entries are read.
|
|
208
|
+
*/
|
|
209
|
+
resolveDeclaredPackage(entry) {
|
|
210
|
+
return this._resolveDeclaredPackage(entry);
|
|
211
|
+
}
|
|
205
212
|
/** `${{ git.* }}`, read at most once per repository per process. */
|
|
206
213
|
_gitScope() {
|
|
207
214
|
if (this._git)
|
|
@@ -367,6 +367,19 @@ export interface RmanConfigKeys {
|
|
|
367
367
|
* would take that away from exactly the repositories that need it.
|
|
368
368
|
*/
|
|
369
369
|
dependencies?: string[];
|
|
370
|
+
/**
|
|
371
|
+
* In-repo packages that go **inside this package's artifact** without being a run-time
|
|
372
|
+
* dependency of it - a web UI a Docker image copies in through a build context, a directory a
|
|
373
|
+
* build script bundles. Their changes count as this package's own: `version` bumps it for their
|
|
374
|
+
* commits, its changelog lists them, and a publish target refuses to ship it while they have
|
|
375
|
+
* uncommitted changes.
|
|
376
|
+
*
|
|
377
|
+
* Each entry is a package **name, or a repository-relative directory**, as in `dependencies`. An
|
|
378
|
+
* entry naming no package is an error.
|
|
379
|
+
*
|
|
380
|
+
* @example { "carries": ["@acme/web-ui"] }
|
|
381
|
+
*/
|
|
382
|
+
carries?: string[];
|
|
370
383
|
/**
|
|
371
384
|
* Config for a **narrower audience**, keyed by a `"[selector]"` naming it - `"[/]"` for the root
|
|
372
385
|
* package alone, `"[*]"` for the packages below this directory, `"[*-dialect]"` for a glob over
|
package/package.json
CHANGED
|
@@ -6,10 +6,11 @@ import type { Package } from '../core/classes/package.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function unversionedReason(pkg: Package): string | undefined;
|
|
8
8
|
/**
|
|
9
|
-
* The in-repo packages whose commits count as `pkg`'s own:
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* versioned.
|
|
9
|
+
* The in-repo packages whose commits count as `pkg`'s own: every one its `.rmanrc "carries"` names,
|
|
10
|
+
* and those it needs at run time that take no version themselves - and theirs in turn. A versioned
|
|
11
|
+
* run-time dependency stops the walk, since it releases on its own and reaches `pkg` through the
|
|
12
|
+
* ordinary cascade. Empty for a package that is itself not versioned. Throws for a `carries` entry
|
|
13
|
+
* naming no package.
|
|
13
14
|
*
|
|
14
15
|
* `isUnversioned` is the planner's answer when one is asking; `unversionedReason` otherwise.
|
|
15
16
|
*/
|
|
@@ -46,10 +46,11 @@ export function unversionedReason(pkg) {
|
|
|
46
46
|
return undefined;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* The in-repo packages whose commits count as `pkg`'s own:
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* versioned.
|
|
49
|
+
* The in-repo packages whose commits count as `pkg`'s own: every one its `.rmanrc "carries"` names,
|
|
50
|
+
* and those it needs at run time that take no version themselves - and theirs in turn. A versioned
|
|
51
|
+
* run-time dependency stops the walk, since it releases on its own and reaches `pkg` through the
|
|
52
|
+
* ordinary cascade. Empty for a package that is itself not versioned. Throws for a `carries` entry
|
|
53
|
+
* naming no package.
|
|
53
54
|
*
|
|
54
55
|
* `isUnversioned` is the planner's answer when one is asking; `unversionedReason` otherwise.
|
|
55
56
|
*/
|
|
@@ -77,6 +78,15 @@ export function bundledPackages(pkg, isUnversioned = p => !!unversionedReason(p)
|
|
|
77
78
|
visit(dep);
|
|
78
79
|
}
|
|
79
80
|
};
|
|
81
|
+
/** Declared first and taken whatever their versioning - see `carries` for why a versioned one
|
|
82
|
+
* counts here and not in the walk. What a carried package needs at run time is inside the
|
|
83
|
+
* artifact as well, so the walk goes on from it. */
|
|
84
|
+
for (const carried of declaredCarries(pkg)) {
|
|
85
|
+
if (carried === pkg || result.includes(carried))
|
|
86
|
+
continue;
|
|
87
|
+
result.push(carried);
|
|
88
|
+
visit(carried);
|
|
89
|
+
}
|
|
80
90
|
visit(pkg);
|
|
81
91
|
return result;
|
|
82
92
|
}
|
|
@@ -89,3 +99,18 @@ export function filesOwnedBy(files, pkg) {
|
|
|
89
99
|
const dirs = [pkg, ...bundledPackages(pkg)].map(p => p.dirname);
|
|
90
100
|
return [...new Set(dirs.flatMap(dir => filesUnder(files, dir)))];
|
|
91
101
|
}
|
|
102
|
+
/** `pkg`'s `.rmanrc "carries"`, as packages - throwing for an entry that names none. */
|
|
103
|
+
/* **An unknown entry is an error**, where `dependencies` ignores one. That key states edges for a
|
|
104
|
+
* graph and a missing end changes no answer; this one exists because a change went unreleased in
|
|
105
|
+
* silence, and a typo here would be that same silence again. */
|
|
106
|
+
function declaredCarries(pkg) {
|
|
107
|
+
const entries = pkg.config.carries ?? [];
|
|
108
|
+
return entries.map(entry => {
|
|
109
|
+
const found = pkg.repository.resolveDeclaredPackage(entry);
|
|
110
|
+
if (!found) {
|
|
111
|
+
throw new Error(`.rmanrc "carries" of ${pkg.name} names "${entry}", which is no package in this repository ` +
|
|
112
|
+
`- write a package name, or a directory relative to the repository root.`);
|
|
113
|
+
}
|
|
114
|
+
return found;
|
|
115
|
+
});
|
|
116
|
+
}
|