You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(commands): option groups, invocation scopes and the invocation record
- `defineOptions(name, schema)` declares an option group: a schema that is
also an injection token typed as its parsed values. `options` takes a
schema or a list of groups and schemas, and `ctx.options` is typed as the
merged values. Spellings collide only with different specs; an alias may
not equal another option's spelling.
- Every non-root group a command declares is provided in the invocation
injector with its slice of the parsed values. `CliOptions` is the
process-level group, provided at the root; the option table derives its
global entries from it, and a command may list it but not redeclare its
spellings. The built-ins that redeclared `--path` or `--help` list it.
- `OptionContributions` adds groups to a command by any of its names, own or
registered, or to the root, ahead of the parse that targets them.
- `providedIn` on a provider, an implementation class (`@ProvidedIn`) or a
contract puts the instance on the nearest injector of that scope in the
resolving chain; the adapter opens each invocation's injector in the
`invocation` scope and disposes it when the invocation ends. Resolving a
scoped record from outside its scope is an error, `optional` or not.
- `currentInvocationInjector()` resolves the synchronous injection context,
then the invocation's asynchronous flow, then the most recently opened
invocation. Hooks resolve their by-name dependencies against it, and a
definition run as given defaults its scope to it. An in-process dispatch
closes the invocations it opened.
0 commit comments