rman 1.3.0 → 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.
- package/README.md +65 -31
- package/builtins/platforms/node/augmentation/rmanrc.augmentation.d.ts +83 -0
- package/builtins/platforms/node/augmentation/system-info.augmentation.d.ts +26 -0
- package/builtins/platforms/node/augmentation/system-info.augmentation.js +79 -0
- package/builtins/platforms/node/commands/ci.command.d.ts +133 -0
- package/builtins/platforms/node/commands/ci.command.js +60 -0
- package/builtins/platforms/node/commands/clean.command.d.ts +185 -0
- package/builtins/platforms/node/commands/clean.command.js +74 -0
- package/builtins/platforms/node/index.d.ts +8 -0
- package/builtins/platforms/node/index.js +8 -0
- package/builtins/platforms/node/node-config.interface.d.ts +76 -0
- package/builtins/platforms/node/node-config.interface.js +7 -0
- package/builtins/platforms/node/node-manifest.provider.d.ts +68 -0
- package/builtins/platforms/node/node-manifest.provider.js +125 -0
- package/builtins/platforms/node/node.platform.d.ts +53 -0
- package/builtins/platforms/node/node.platform.js +134 -0
- package/builtins/platforms/node/services/ci.service.d.ts +47 -0
- package/builtins/platforms/node/services/ci.service.js +213 -0
- package/builtins/platforms/node/services/clean.service.d.ts +53 -0
- package/builtins/platforms/node/services/clean.service.js +237 -0
- package/builtins/platforms/node/services/publish.service.d.ts +114 -0
- package/builtins/platforms/node/services/publish.service.js +371 -0
- package/builtins/platforms/node/services/version-plan.service.d.ts +44 -0
- package/builtins/platforms/node/services/version-plan.service.js +58 -0
- package/builtins/platforms/node/utils/workspace-range.d.ts +26 -0
- package/builtins/platforms/node/utils/workspace-range.js +28 -0
- package/builtins/presets/index.d.ts +15 -0
- package/builtins/presets/index.js +57 -0
- package/builtins/presets/node.d.ts +16 -0
- package/builtins/presets/node.js +57 -0
- package/{services → builtins/publish-targets/docker}/docker-publish.service.d.ts +52 -31
- package/{services → builtins/publish-targets/docker}/docker-publish.service.js +49 -26
- package/builtins/publish-targets/docker/docker.target.d.ts +54 -0
- package/builtins/publish-targets/docker/docker.target.js +40 -0
- package/builtins/publish-targets/docker/index.d.ts +2 -0
- package/builtins/publish-targets/docker/index.js +2 -0
- package/builtins/publish-targets/npm/index.d.ts +2 -0
- package/builtins/publish-targets/npm/index.js +2 -0
- package/builtins/publish-targets/npm/npm-publish-target.d.ts +73 -0
- package/builtins/publish-targets/npm/npm-publish-target.js +95 -0
- package/builtins/publish-targets/npm/npm-view.d.ts +48 -0
- package/builtins/publish-targets/npm/npm-view.js +71 -0
- package/cli.d.ts +8 -0
- package/cli.js +228 -93
- package/commands/build.command.d.ts +177 -3
- package/commands/build.command.js +20 -10
- package/commands/changelog.command.d.ts +296 -3
- package/commands/changelog.command.js +127 -43
- package/commands/config.command.d.ts +44 -3
- package/commands/config.command.js +53 -24
- package/commands/diff.command.d.ts +37 -3
- package/commands/diff.command.js +25 -16
- package/commands/exec.command.d.ts +193 -3
- package/commands/exec.command.js +60 -58
- package/commands/github-release.command.d.ts +154 -3
- package/commands/github-release.command.js +67 -37
- package/commands/import.command.d.ts +36 -3
- package/commands/import.command.js +28 -20
- package/commands/info.command.d.ts +35 -7
- package/commands/info.command.js +36 -30
- package/commands/lint.command.d.ts +176 -0
- package/commands/lint.command.js +34 -0
- package/commands/list.command.d.ts +163 -3
- package/commands/list.command.js +109 -71
- package/commands/publish.command.d.ts +231 -0
- package/commands/publish.command.js +304 -0
- package/commands/run.command.d.ts +186 -6
- package/commands/run.command.js +26 -72
- package/commands/test.command.d.ts +173 -3
- package/commands/test.command.js +16 -10
- package/commands/version.command.d.ts +330 -3
- package/commands/version.command.js +292 -78
- package/commands.d.ts +32 -0
- package/commands.js +28 -0
- package/constants.js +1 -1
- package/core/application.d.ts +116 -0
- package/core/application.js +160 -0
- package/core/classes/package.d.ts +219 -0
- package/core/classes/package.js +214 -0
- package/core/classes/registry.d.ts +30 -0
- package/core/classes/registry.js +47 -0
- package/core/{repository.d.ts → classes/repository.d.ts} +69 -20
- package/core/{repository.js → classes/repository.js} +195 -75
- package/core/classes/service.d.ts +49 -0
- package/core/classes/service.js +40 -0
- package/core/{version-scheme.d.ts → classes/version-scheme.d.ts} +23 -1
- package/core/{version-scheme.js → classes/version-scheme.js} +29 -1
- package/core/classes/workspace.d.ts +275 -0
- package/core/classes/workspace.js +537 -0
- package/core/command-builder.d.ts +14 -0
- package/core/command-builder.js +94 -0
- package/core/config/config-file-scope.d.ts +107 -0
- package/core/config/config-file-scope.js +226 -0
- package/core/config/config-interpolator.d.ts +164 -0
- package/core/config/config-interpolator.js +577 -0
- package/core/config/config-paths.d.ts +65 -0
- package/core/config/config-paths.js +78 -0
- package/core/config/config-reader.d.ts +192 -0
- package/core/config/config-reader.js +727 -0
- package/core/{merge-config.d.ts → config/merge-config.d.ts} +33 -34
- package/core/config/merge-config.js +260 -0
- package/core/{resolve-target.d.ts → config/resolve-config-target.d.ts} +1 -1
- package/core/{resolve-target.js → config/resolve-config-target.js} +1 -1
- package/core/{custom-command.d.ts → interfaces/custom-command.d.ts} +46 -10
- package/core/{custom-command.js → interfaces/custom-command.js} +44 -17
- package/core/{manifest.d.ts → interfaces/manifest.d.ts} +49 -27
- package/core/interfaces/manifest.js +132 -0
- package/core/interfaces/plugin.d.ts +174 -0
- package/core/interfaces/plugin.js +124 -0
- package/core/interfaces/publish-target.d.ts +136 -0
- package/core/interfaces/publish-target.js +43 -0
- package/core/{run-step.d.ts → interfaces/run-step.d.ts} +4 -4
- package/core/interfaces/run-step.js +1 -0
- package/core/plugin-loader.d.ts +25 -0
- package/core/plugin-loader.js +53 -0
- package/index.d.ts +122 -24
- package/index.js +66 -16
- package/interfaces/config-scope.interface.d.ts +223 -0
- package/interfaces/config-scope.interface.js +1 -0
- package/interfaces/rman-config.interface.d.ts +821 -203
- package/interfaces/rman-config.interface.js +78 -1
- package/package.json +3 -1
- package/services/change-hash.service.d.ts +42 -8
- package/services/change-hash.service.js +92 -13
- package/services/changelog.service.d.ts +91 -52
- package/services/changelog.service.js +460 -74
- package/services/config-service.d.ts +8 -0
- package/services/config-service.js +3 -0
- package/services/exec.service.d.ts +23 -12
- package/services/exec.service.js +14 -9
- package/services/github-release.service.d.ts +45 -34
- package/services/github-release.service.js +15 -12
- package/services/import.service.d.ts +25 -14
- package/services/import.service.js +9 -5
- package/services/list.service.d.ts +67 -13
- package/services/list.service.js +62 -15
- package/services/run.service.d.ts +35 -22
- package/services/run.service.js +316 -233
- package/services/system-info.d.ts +1 -1
- package/services/version-plan.service.d.ts +35 -8
- package/services/version-plan.service.js +96 -36
- package/services/version.service.d.ts +34 -14
- package/services/version.service.js +35 -16
- package/services.d.ts +1 -1
- package/services.js +1 -1
- package/utils/bin-path.d.ts +6 -7
- package/utils/bin-path.js +7 -18
- package/utils/branch-guard.d.ts +30 -1
- package/utils/branch-guard.js +31 -0
- package/utils/color-yaml.d.ts +8 -0
- package/utils/color-yaml.js +86 -0
- package/utils/exec.d.ts +10 -0
- package/utils/exec.js +1 -1
- package/utils/git.d.ts +26 -0
- package/utils/git.js +65 -0
- package/utils/logger.d.ts +2 -2
- package/utils/logger.js +1 -1
- package/utils/package-filter.d.ts +135 -8
- package/utils/package-filter.js +204 -16
- package/utils/printable-config.d.ts +9 -1
- package/utils/printable-config.js +46 -1
- package/utils/progress-panel.d.ts +9 -0
- package/utils/progress-panel.js +23 -1
- package/utils/release-version.d.ts +1 -1
- package/utils/run-bin.d.ts +10 -0
- package/utils/run-bin.js +1 -1
- package/utils/run-options.d.ts +97 -0
- package/utils/run-options.js +81 -0
- package/utils/version-group.d.ts +31 -0
- package/utils/version-group.js +43 -0
- package/utils/version-stamp.d.ts +1 -1
- package/utils/version-stamp.js +1 -1
- package/commands/changed.command.d.ts +0 -3
- package/commands/changed.command.js +0 -29
- package/core/config.d.ts +0 -409
- package/core/config.js +0 -939
- package/core/extends-config.d.ts +0 -27
- package/core/extends-config.js +0 -89
- package/core/manifest.js +0 -150
- package/core/merge-config.js +0 -219
- package/core/package.d.ts +0 -83
- package/core/package.js +0 -106
- package/core/plugin.d.ts +0 -112
- package/core/plugin.js +0 -189
- package/core/workspace.d.ts +0 -68
- package/core/workspace.js +0 -83
- /package/{core/run-step.js → builtins/platforms/node/augmentation/rmanrc.augmentation.js} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Which config paths are code rather than data**, and which are left for later.
|
|
3
|
+
*
|
|
4
|
+
* Three lists, read by `ConfigInterpolator` as it walks and by the commands that own the keys. Not
|
|
5
|
+
* members of that class, and that is the exception CLAUDE.md records: `CodeSubtree` is derived from
|
|
6
|
+
* `CODE_SUBTREES` with `(typeof ...)[number]`, and a class field has no type to derive from. The
|
|
7
|
+
* test is whether a *type* reads the value, not whether the value feels constant.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Keys whose **whole subtree** is code rather than config, so no function under them is a value to
|
|
11
|
+
* compute.
|
|
12
|
+
*
|
|
13
|
+
* The three contribution keys, and each has to be here: an entry may be the *instance* itself, and
|
|
14
|
+
* a `Plugin` is almost entirely functions - `manifestProvider.read`, `getWorkspace`,
|
|
15
|
+
* `getBinPaths`, `versionPlanner` - while a command is often a bare factory and a publish target
|
|
16
|
+
* carries `getPlan`/`applyPlan`.
|
|
17
|
+
*
|
|
18
|
+
* Measured twice, once per shape. With `plugins` walked like any other key, resolving the config
|
|
19
|
+
* of a repository that named a plugin called that plugin's yargs builder with the config scope:
|
|
20
|
+
* `Config function in "plugins[0].commands[0].builder" failed: cmd.option is not a function`. And
|
|
21
|
+
* with `commands` left out of this list, a declarative command - which *is* a function - was
|
|
22
|
+
* invoked with the interpolation scope instead of the application, so its handler closed over a
|
|
23
|
+
* repository that was not one: `repository.getPackages is not a function`, from inside `clean`.
|
|
24
|
+
*
|
|
25
|
+
* These entries are loaded by `loadPlugins` and `cli.ts`, never read as settings.
|
|
26
|
+
*/
|
|
27
|
+
export const CODE_SUBTREES = ['plugins', 'platforms', 'commands', 'publishTargets'];
|
|
28
|
+
/**
|
|
29
|
+
* Paths whose value is a **step** - something to run later - rather than a setting to compute now.
|
|
30
|
+
* `*` matches one path segment (`run.<script>.exec`).
|
|
31
|
+
*
|
|
32
|
+
* This is what tells a step function from a value function, and the two live side by side in one
|
|
33
|
+
* config:
|
|
34
|
+
*
|
|
35
|
+
* ```js
|
|
36
|
+
* '[*]': {
|
|
37
|
+
* clean: { include: ({ vars, value }) => [...value, vars.buildDir] }, // a value: called here
|
|
38
|
+
* run: { build: { after: ({ pkg }) => copyDocs(pkg) } }, // a step: called by `run`
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* **The key decides, and it already did.** `run.build.exec: 'tsc -b'` is a shell command and
|
|
43
|
+
* `publish.npm.directory: 'build'` is a path - not because of anything about the strings, but because of
|
|
44
|
+
* where they sit. A function inherits the same rule, so nothing new has to be learned and no marker
|
|
45
|
+
* has to be remembered. The alternative was inspecting the function (arity, parameter names), which
|
|
46
|
+
* is the kind of guess `loadPlugins` refuses to make about a module's export for the same reason:
|
|
47
|
+
* guessing wrong here means running build-time code while merely loading the repository, or
|
|
48
|
+
* silently never running it.
|
|
49
|
+
*
|
|
50
|
+
* A **string** at one of these paths is still interpolated - `exec: 'tsc -b ${{ file.resolve(...) }}'`
|
|
51
|
+
* has to keep working - so this is narrower than `DEFERRED_PATHS`, which skips its paths entirely.
|
|
52
|
+
*/
|
|
53
|
+
export const STEP_PATHS = [
|
|
54
|
+
/** The bare-value shorthand: `run: { build: fn }` means `{ exec: fn }`, as `run: { build: 'cmd' }`
|
|
55
|
+
* means `{ exec: 'cmd' }`. Missing it made the two spellings disagree about *when* the function
|
|
56
|
+
* runs, which is worse than not supporting the short one at all. */
|
|
57
|
+
'run.*',
|
|
58
|
+
'run.*.before',
|
|
59
|
+
'run.*.exec',
|
|
60
|
+
'run.*.after',
|
|
61
|
+
/** A condition, evaluated per package by `RunService` when the run reaches it. Called here
|
|
62
|
+
* instead, it collapsed to the boolean it happened to return at load time - and `parseIfExpr`
|
|
63
|
+
* then read that boolean as "no condition given", so the script ran unconditionally (measured). */
|
|
64
|
+
'run.*.if',
|
|
65
|
+
'version.before',
|
|
66
|
+
'version.exec',
|
|
67
|
+
'version.after',
|
|
68
|
+
];
|
|
69
|
+
/**
|
|
70
|
+
* Config paths left untouched when a repository's config is first resolved, and evaluated only by
|
|
71
|
+
* the command that runs them.
|
|
72
|
+
*
|
|
73
|
+
* `version`'s own hooks are the one place `${{ pkg.targetVersion }}` makes sense, and the version
|
|
74
|
+
* being written is not known until `version` has computed its plan - long after the config was
|
|
75
|
+
* resolved. Evaluating these eagerly would throw while merely *loading* the repository, so any
|
|
76
|
+
* command at all would fail on a config that mentions it.
|
|
77
|
+
*/
|
|
78
|
+
export const DEFERRED_PATHS = ['version.before', 'version.exec', 'version.after'];
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { RmanConfig } from '../../interfaces/rman-config.interface.js';
|
|
2
|
+
import type { Package } from '../classes/package.js';
|
|
3
|
+
import type { Repository } from '../classes/repository.js';
|
|
4
|
+
import { type Platform, type Plugin } from '../interfaces/plugin.js';
|
|
5
|
+
export declare class ConfigReader {
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @protected
|
|
9
|
+
*/
|
|
10
|
+
protected readonly configFiles: readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* Whether a config key names **packages** rather than a setting: `"[*]"`, `"[/]"`, `"[pkg-a]"`.
|
|
13
|
+
*/
|
|
14
|
+
static isSelectorKey(key: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* **Which packages a selector key speaks for.** Two audiences, and the second is a glob:
|
|
17
|
+
*
|
|
18
|
+
* | | matches | `test` is given |
|
|
19
|
+
* | --- | --- | --- |
|
|
20
|
+
* | `"[/]"` | the **root package** alone, structurally | - |
|
|
21
|
+
* | `"[platform:node]"`, `"[platform:node,cargo]"` | packages of those **technologies** | `pkg.platform.name` |
|
|
22
|
+
* | `"[*]"`, `"[pkg-a]"`, `"[*-dialect]"` | the packages **below** this directory the glob matches | `pkg.selector` |
|
|
23
|
+
*
|
|
24
|
+
* The glob is anchored at both ends, so `"[*-dialect]"` matches `mysql-dialect` but not
|
|
25
|
+
* `my-dialect-helper`. `"[ws:*]"` and `"[workspace:*]"` are accepted and mean exactly `"[*]"`.
|
|
26
|
+
*/
|
|
27
|
+
static parseSelector(key: string): ConfigReader.ParsedSelector;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
resolve(dirname: string, options?: ConfigReader.Options): Promise<ConfigReader.ResolveResult>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @protected
|
|
35
|
+
*/
|
|
36
|
+
protected _resolve(context: ConfigReader.Context, options?: ConfigReader.Options): Promise<RmanConfig>;
|
|
37
|
+
protected _getDeclaredPlatform(config: RmanConfig): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The one config file `dirname` declares, or `undefined` for a directory that declares none.
|
|
40
|
+
*
|
|
41
|
+
* **Several is an error**, which is the whole point of reading the directory rather than probing
|
|
42
|
+
* the names in a fixed order: a probe cannot tell "this one" from "this one, and three others I
|
|
43
|
+
* am quietly folding in underneath". The message lists what it found, because the fix is to
|
|
44
|
+
* delete one and the reader has to know which are in play.
|
|
45
|
+
*
|
|
46
|
+
* Public because it answers a question a *reader* has and not only the resolver: `rman config`
|
|
47
|
+
* heads its output with the file you would open to change what it prints.
|
|
48
|
+
*/
|
|
49
|
+
findConfigSource(dirname: string): string | undefined;
|
|
50
|
+
/** @see {@link ConfigReader.findConfigSource} */
|
|
51
|
+
protected _findConfigSource(dirname: string): string | undefined;
|
|
52
|
+
/** Reads one config file into a plain object. Nothing is merged and nothing is checked here
|
|
53
|
+
* beyond the file being an object at all - a config that is a list or a string is a mistake
|
|
54
|
+
* worth naming before any key of it is read. */
|
|
55
|
+
protected _readConfigFile(file: string): Promise<RmanConfig>;
|
|
56
|
+
/**
|
|
57
|
+
* Loads a config module - a `.rmanrc.cjs`/`.mjs`/`.js`, or an `extends` target that is one. The
|
|
58
|
+
* default export when there is one, the module's own exports object otherwise.
|
|
59
|
+
*/
|
|
60
|
+
protected _loadConfigModule(file: string): Promise<any>;
|
|
61
|
+
protected _assertSelectorBlocks(config: RmanConfig, file: string): void;
|
|
62
|
+
protected _resolveExtends(context: ConfigReader.Context, config: RmanConfig, from: string, seen?: string[]): Promise<RmanConfig>;
|
|
63
|
+
/**
|
|
64
|
+
* Lays `options.presets` underneath this level's own config, exactly as an `extends` naming them
|
|
65
|
+
* would - so a repository that declares nothing still has rman's own technologies, commands and
|
|
66
|
+
* publish targets, and one that declares something still wins every key.
|
|
67
|
+
*
|
|
68
|
+
* Nothing happens without `options.presets`, which is how a level that is not the root - and a
|
|
69
|
+
* caller wanting a bare core - says so.
|
|
70
|
+
*/
|
|
71
|
+
protected _applyPresets(config: RmanConfig, context: ConfigReader.Context, options?: ConfigReader.Options): Promise<RmanConfig>;
|
|
72
|
+
/**
|
|
73
|
+
* Loads the technologies a level's `platforms` names, into `context.platforms`.
|
|
74
|
+
*
|
|
75
|
+
* An entry is a `Platform`, or a glob naming `.js` modules that `export default` one. Already
|
|
76
|
+
* present by name, it is skipped - two layers naming one technology is ordinary rather than a
|
|
77
|
+
* mistake, and registering it twice would have two objects answering for one name.
|
|
78
|
+
*/
|
|
79
|
+
protected _loadPlatforms(config: RmanConfig, context: ConfigReader.Context): Promise<void>;
|
|
80
|
+
/** Appends a technology unless one already answers to its name. */
|
|
81
|
+
protected _addPlatform(platform: Platform, context: ConfigReader.Context): void;
|
|
82
|
+
/** Appends a plugin unless one already answers to that name. */
|
|
83
|
+
protected _addPlugin(plugin: Plugin, context: ConfigReader.Context): void;
|
|
84
|
+
protected _loadPlugins(config: RmanConfig, context: ConfigReader.Context): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Refuses a plugin that did not come through `definePlatform`/`definePlugin`.
|
|
87
|
+
*
|
|
88
|
+
* @param from where the entry came from, for the message - the config key for one written into
|
|
89
|
+
* the config, and the file for one a glob loaded.
|
|
90
|
+
*/
|
|
91
|
+
protected _assertDeclaredPlugin(value: Plugin, from: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* Loads the plugins a **string** `plugins` entry names.
|
|
94
|
+
*
|
|
95
|
+
* The string is a glob - never a package name, and already absolute by the time it arrives - so
|
|
96
|
+
* it may match several modules and this returns a list. An entry written as an instance does not
|
|
97
|
+
* come through here; it is already the plugin.
|
|
98
|
+
*
|
|
99
|
+
* Each match must `export default` a plugin declared through `definePlatform`/`definePlugin`.
|
|
100
|
+
* A glob matching nothing is an error.
|
|
101
|
+
*/
|
|
102
|
+
protected _loadPluginsByEntry(entry: string): Promise<Plugin[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Refuses whatever a glob matched when it is not the kind the key takes, naming what it *is*.
|
|
105
|
+
*
|
|
106
|
+
* @param want which key is being loaded, so the message can point at the other one.
|
|
107
|
+
*/
|
|
108
|
+
protected _assertLoaded(value: unknown, file: string, want: Plugin.DeclaredKind): void;
|
|
109
|
+
/**
|
|
110
|
+
* Every default export a **glob** entry names, with the file each came from.
|
|
111
|
+
*
|
|
112
|
+
* Shared by `plugins` and `platforms`, which take the same two forms and differ only in what they
|
|
113
|
+
* accept back - so the caller checks the shape and this one only finds and imports.
|
|
114
|
+
*
|
|
115
|
+
* The glob is absolute by the time it arrives: `mergeConfig` anchors a contribution glob to the
|
|
116
|
+
* file that declared it (`anchorContributions`). Nothing here resolves a path, and a resolution
|
|
117
|
+
* step would make a preset's `'./x.js'` look in the consumer's directory. `.js` only - these are
|
|
118
|
+
* imported into rman's own process with no loader registered, so a `.ts` module cannot be one.
|
|
119
|
+
*/
|
|
120
|
+
protected _loadByGlob(entry: string, key: string): Promise<{
|
|
121
|
+
value: unknown;
|
|
122
|
+
file: string;
|
|
123
|
+
}[]>;
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @protected
|
|
127
|
+
*/
|
|
128
|
+
protected _resolveExtendTarget(target: string, from: string, label: string): string;
|
|
129
|
+
/**
|
|
130
|
+
* Where one of rman's own presets lives - `extends: "rman:node"`.
|
|
131
|
+
*
|
|
132
|
+
* A preset is an ordinary config that happens to ship with rman: it contributes a technology, the
|
|
133
|
+
* commands that belong to it and its publish target, and it reaches a repository the same way any
|
|
134
|
+
* other config does.
|
|
135
|
+
*/
|
|
136
|
+
protected _resolvePreset(name: string, label: string): string;
|
|
137
|
+
}
|
|
138
|
+
export declare namespace ConfigReader {
|
|
139
|
+
/** What a `"[...]"` key resolves to - see {@link ConfigReader.parseSelector}. */
|
|
140
|
+
interface ParsedSelector {
|
|
141
|
+
/**
|
|
142
|
+
* What `test` is asked about:
|
|
143
|
+
*
|
|
144
|
+
* - `'root'` - nothing; the root is matched by *being* the root.
|
|
145
|
+
* - `'platform'` - the package's `platform.name`.
|
|
146
|
+
* - `'package'` - the package's `selector`.
|
|
147
|
+
*
|
|
148
|
+
* A glob and a platform block both match packages below the root, never the root itself - its
|
|
149
|
+
* address is `"[/]"`.
|
|
150
|
+
*/
|
|
151
|
+
scope: 'root' | 'package' | 'platform';
|
|
152
|
+
/** Whether a package's selector is one this key speaks for. Always `true` for a root key, which
|
|
153
|
+
* is matched by *being* the root rather than by name. */
|
|
154
|
+
test(name: string): boolean;
|
|
155
|
+
}
|
|
156
|
+
interface Options {
|
|
157
|
+
/** Plugins to start with - the application's. Optional like `platforms`, which it was not: a
|
|
158
|
+
* plugin used to be how a technology arrived, so a caller always had one. */
|
|
159
|
+
plugins?: Plugin[];
|
|
160
|
+
/**
|
|
161
|
+
* rman's own presets to lay **underneath** this level's config - `['node']`, the bare names
|
|
162
|
+
* `extends: "rman:node"` would have spelled. Omitted or empty, none are applied, which is what
|
|
163
|
+
* every level below the root passes and what a caller wanting a bare core passes too.
|
|
164
|
+
*
|
|
165
|
+
* They are loaded **after** whatever the config declared, so a repository's own technology is
|
|
166
|
+
* asked about a directory first.
|
|
167
|
+
*/
|
|
168
|
+
presets?: readonly string[];
|
|
169
|
+
/** Technologies to start with - typically the application's. They come first, so a repository's
|
|
170
|
+
* own additions are appended after them. */
|
|
171
|
+
platforms?: Platform[];
|
|
172
|
+
}
|
|
173
|
+
interface Context {
|
|
174
|
+
dirname: string;
|
|
175
|
+
plugins: Plugin[];
|
|
176
|
+
platforms: Platform[];
|
|
177
|
+
}
|
|
178
|
+
interface ResolveResult {
|
|
179
|
+
config: RmanConfig;
|
|
180
|
+
/** Every plugin in play after this read - the ones passed in, plus whatever the config named. */
|
|
181
|
+
plugins: Plugin[];
|
|
182
|
+
/** Every technology in play, in the order it was contributed. A `platforms` entry comes before
|
|
183
|
+
* one a plugin carried, since a config naming a technology outright is the more direct
|
|
184
|
+
* statement. */
|
|
185
|
+
platforms: Platform[];
|
|
186
|
+
}
|
|
187
|
+
interface InterpolateArgs<T = RmanConfig> {
|
|
188
|
+
config: T;
|
|
189
|
+
repository: Repository;
|
|
190
|
+
pkg: Package;
|
|
191
|
+
}
|
|
192
|
+
}
|