@flowscripter/dynamic-cli-framework 7.0.0 → 7.0.2
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/dist/src/service/configuration/KeyValueServiceProvider.d.ts +7 -0
- package/dist/src/service/configuration/KeyValueServiceProvider.d.ts.map +1 -1
- package/dist/src/service/configuration/KeyValueServiceProvider.js +8 -0
- package/package.json +5 -5
- package/src/service/configuration/KeyValueServiceProvider.ts +11 -1
|
@@ -98,6 +98,13 @@ export default class KeyValueServiceProvider implements ServiceProvider {
|
|
|
98
98
|
*
|
|
99
99
|
* Returns `context` itself, unchanged, if neither `keyValueServiceEnabled` nor
|
|
100
100
|
* `secretServiceEnabled` is set.
|
|
101
|
+
*
|
|
102
|
+
* Also forwards `addServiceInstance`, even though it is not part of the {@link Context}
|
|
103
|
+
* interface: `runner.ts` applies this same scoping to every `ServiceProvider`'s `initService()`
|
|
104
|
+
* call (scope "service"), and `PluginServiceProvider.initService()` relies on casting its
|
|
105
|
+
* received `context` to `DefaultContext` to register services discovered from plugins at
|
|
106
|
+
* runtime - a capability every `ServiceProvider` already had before this scoping was
|
|
107
|
+
* introduced, since `initService()` always received the real `DefaultContext` directly.
|
|
101
108
|
*/
|
|
102
109
|
getContextForScope(context: Context, scopeType: KeyValueServiceScopeType, scopeKey: string): Context;
|
|
103
110
|
initService(context: Context): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueServiceProvider.d.ts","sourceRoot":"","sources":["../../../../src/service/configuration/KeyValueServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,KAAK,4BAA4B,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"KeyValueServiceProvider.d.ts","sourceRoot":"","sources":["../../../../src/service/configuration/KeyValueServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,KAAK,4BAA4B,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AA+BlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,YAAW,eAAe;;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAwB;IAClD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAIjC,SAAgB,sBAAsB,EAAE,OAAO,CAAC;IAChD,SAAgB,oBAAoB,EAAE,OAAO,CAAC;IAW9C;;;;;;;;OAQG;IACH,YACE,eAAe,EAAE,MAAM,EACvB,4BAA4B,EAAE,4BAA4B,EAC1D,sBAAsB,UAAQ,EAC9B,oBAAoB,UAAQ,EAY7B;IAEM,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAUhE;IAED;;;;;;;;;;OAUG;IACI,wBAAwB,CAC7B,SAAS,EAAE,wBAAwB,EACnC,QAAQ,EAAE,MAAM,GACf,eAAe,CAsBjB;IAED;;;;;;;;;;;;;;;OAeG;IACI,kBAAkB,CACvB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,wBAAwB,EACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAaT;IAeY,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAWxD;CACF"}
|
|
@@ -162,6 +162,13 @@ export default class KeyValueServiceProvider {
|
|
|
162
162
|
*
|
|
163
163
|
* Returns `context` itself, unchanged, if neither `keyValueServiceEnabled` nor
|
|
164
164
|
* `secretServiceEnabled` is set.
|
|
165
|
+
*
|
|
166
|
+
* Also forwards `addServiceInstance`, even though it is not part of the {@link Context}
|
|
167
|
+
* interface: `runner.ts` applies this same scoping to every `ServiceProvider`'s `initService()`
|
|
168
|
+
* call (scope "service"), and `PluginServiceProvider.initService()` relies on casting its
|
|
169
|
+
* received `context` to `DefaultContext` to register services discovered from plugins at
|
|
170
|
+
* runtime - a capability every `ServiceProvider` already had before this scoping was
|
|
171
|
+
* introduced, since `initService()` always received the real `DefaultContext` directly.
|
|
165
172
|
*/
|
|
166
173
|
getContextForScope(context, scopeType, scopeKey) {
|
|
167
174
|
if (!this.keyValueServiceEnabled && !this.secretServiceEnabled) {
|
|
@@ -172,6 +179,7 @@ export default class KeyValueServiceProvider {
|
|
|
172
179
|
cliConfig: context.cliConfig,
|
|
173
180
|
getServiceById: (id) => id === KEY_VALUE_SERVICE_ID ? scopedKeyValueService : context.getServiceById(id),
|
|
174
181
|
doesServiceExist: (id) => context.doesServiceExist(id),
|
|
182
|
+
addServiceInstance: (id, serviceInstance) => context.addServiceInstance(id, serviceInstance),
|
|
175
183
|
};
|
|
176
184
|
}
|
|
177
185
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowscripter/dynamic-cli-framework",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "A framework for developing CLI applications which supports dynamic discovery and installation of new commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -48,20 +48,20 @@
|
|
|
48
48
|
"build": "tsc -p tsconfig.build.json"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@flowscripter/dynamic-cli-framework-api": "^4.0.
|
|
52
|
-
"@flowscripter/dynamic-plugin-framework": "^2.2.
|
|
51
|
+
"@flowscripter/dynamic-cli-framework-api": "^4.0.2",
|
|
52
|
+
"@flowscripter/dynamic-plugin-framework": "^2.2.10",
|
|
53
53
|
"emphasize": "^7.0.0",
|
|
54
54
|
"fastest-levenshtein": "^1.0.16",
|
|
55
55
|
"figlet": "^1.11.4",
|
|
56
56
|
"highlight.js": "^11.12.0",
|
|
57
|
-
"prettier": "^3.9.
|
|
57
|
+
"prettier": "^3.9.8",
|
|
58
58
|
"semver": "^7.8.5",
|
|
59
59
|
"supports-color": "^11.0.0",
|
|
60
60
|
"supports-terminal-graphics": "^0.1.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/bun": "^1.4.2",
|
|
64
|
-
"@types/node": "^26.6.
|
|
64
|
+
"@types/node": "^26.6.2",
|
|
65
65
|
"@types/semver": "^7.8.0",
|
|
66
66
|
"oxfmt": "0.68.0",
|
|
67
67
|
"oxlint": "1.83.0"
|
|
@@ -11,6 +11,7 @@ import DefaultKeyValueService from "./DefaultKeyValueService.ts";
|
|
|
11
11
|
import DefaultSecretService from "./DefaultSecretService.ts";
|
|
12
12
|
import type ConfigurationServiceProvider from "./ConfigurationServiceProvider.ts";
|
|
13
13
|
import type { KeyValueServiceScopeType } from "./ConfigurationServiceProvider.ts";
|
|
14
|
+
import type DefaultContext from "../../runtime/DefaultContext.ts";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Registered under {@link KEY_VALUE_SERVICE_ID} in the plain, undecorated {@link Context} purely
|
|
@@ -200,6 +201,13 @@ export default class KeyValueServiceProvider implements ServiceProvider {
|
|
|
200
201
|
*
|
|
201
202
|
* Returns `context` itself, unchanged, if neither `keyValueServiceEnabled` nor
|
|
202
203
|
* `secretServiceEnabled` is set.
|
|
204
|
+
*
|
|
205
|
+
* Also forwards `addServiceInstance`, even though it is not part of the {@link Context}
|
|
206
|
+
* interface: `runner.ts` applies this same scoping to every `ServiceProvider`'s `initService()`
|
|
207
|
+
* call (scope "service"), and `PluginServiceProvider.initService()` relies on casting its
|
|
208
|
+
* received `context` to `DefaultContext` to register services discovered from plugins at
|
|
209
|
+
* runtime - a capability every `ServiceProvider` already had before this scoping was
|
|
210
|
+
* introduced, since `initService()` always received the real `DefaultContext` directly.
|
|
203
211
|
*/
|
|
204
212
|
public getContextForScope(
|
|
205
213
|
context: Context,
|
|
@@ -215,7 +223,9 @@ export default class KeyValueServiceProvider implements ServiceProvider {
|
|
|
215
223
|
getServiceById: (id: string): unknown =>
|
|
216
224
|
id === KEY_VALUE_SERVICE_ID ? scopedKeyValueService : context.getServiceById(id),
|
|
217
225
|
doesServiceExist: (id: string): boolean => context.doesServiceExist(id),
|
|
218
|
-
|
|
226
|
+
addServiceInstance: (id: string, serviceInstance: unknown): void =>
|
|
227
|
+
(context as DefaultContext).addServiceInstance(id, serviceInstance),
|
|
228
|
+
} as Context;
|
|
219
229
|
}
|
|
220
230
|
|
|
221
231
|
/**
|