@owlmeans/client-context 0.1.18-rc.6 → 0.1.18-rc.8
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/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/client-context",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.18-rc.7",
|
|
5
|
+
"generatedAt": "2026-08-24T21:14:00.136Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
package/build/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG7D,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG7D,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAG,CAqC9F,CAAA"}
|
package/build/context.js
CHANGED
|
@@ -5,7 +5,20 @@ export const makeClientContext = (cfg) => {
|
|
|
5
5
|
context.serviceRoute = (alias, makeDefault) => {
|
|
6
6
|
const service = context.cfg.services[alias];
|
|
7
7
|
if (service == null) {
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The alternatives belong in the message, not in a debugger session.
|
|
10
|
+
*
|
|
11
|
+
* This throws at module scope, during import, so the app is blank and the stack points at
|
|
12
|
+
* a framework file — there is nowhere for a reader to look up what WAS registered. And
|
|
13
|
+
* the mistake it reports is almost always one specific confusion: a route alias passed
|
|
14
|
+
* where a service alias belongs. Both are strings, so nothing before this point objects.
|
|
15
|
+
*
|
|
16
|
+
* `?? {}` because `services` is optional on the config — an error must never be replaced
|
|
17
|
+
* by a worse one thrown while describing it.
|
|
18
|
+
*/
|
|
19
|
+
const registered = Object.keys(context.cfg.services ?? {});
|
|
20
|
+
throw new SyntaxError(`Service not found ${alias}. Registered services: `
|
|
21
|
+
+ (registered.length > 0 ? registered.join(', ') : '(none)'));
|
|
9
22
|
}
|
|
10
23
|
if (typeof makeDefault === 'boolean') {
|
|
11
24
|
service.default = makeDefault;
|
package/build/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAqD,GAAM,EAAK,EAAE;IACjG,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAM,CAAA;IAE1C,OAAO,CAAC,YAAY,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC3C,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAqD,GAAM,EAAK,EAAE;IACjG,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAM,CAAA;IAE1C,OAAO,CAAC,YAAY,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC3C,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB;;;;;;;;;;eAUG;YACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAA;YAE1D,MAAM,IAAI,WAAW,CACnB,qBAAqB,KAAK,yBAAyB;kBACjD,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC7D,CAAA;QACH,CAAC;QAED,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE,CAAC;YACrC,OAAO,CAAC,OAAO,GAAG,WAAW,CAAA;QAC/B,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC,CAAA;IAED,eAAe,CAAO,OAAO,CAAC,CAAA;IAE9B,OAAO,CAAC,WAAW,GAAG,iBAA+C,CAAA;IAErE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/client-context",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@owlmeans/api": "^0.1.18-rc.
|
|
32
|
-
"@owlmeans/client-config": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
31
|
+
"@owlmeans/api": "^0.1.18-rc.8",
|
|
32
|
+
"@owlmeans/client-config": "^0.1.18-rc.7",
|
|
33
|
+
"@owlmeans/config": "^0.1.18-rc.7",
|
|
34
34
|
"@owlmeans/context": "^0.1.18-rc.6",
|
|
35
35
|
"@owlmeans/i18n": "^0.1.18-rc.6",
|
|
36
36
|
"@owlmeans/route": "^0.1.18-rc.6"
|
package/src/context.ts
CHANGED
|
@@ -8,7 +8,23 @@ export const makeClientContext = <C extends ClientConfig, T extends ClientContex
|
|
|
8
8
|
context.serviceRoute = (alias, makeDefault) => {
|
|
9
9
|
const service = context.cfg.services[alias]
|
|
10
10
|
if (service == null) {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The alternatives belong in the message, not in a debugger session.
|
|
13
|
+
*
|
|
14
|
+
* This throws at module scope, during import, so the app is blank and the stack points at
|
|
15
|
+
* a framework file — there is nowhere for a reader to look up what WAS registered. And
|
|
16
|
+
* the mistake it reports is almost always one specific confusion: a route alias passed
|
|
17
|
+
* where a service alias belongs. Both are strings, so nothing before this point objects.
|
|
18
|
+
*
|
|
19
|
+
* `?? {}` because `services` is optional on the config — an error must never be replaced
|
|
20
|
+
* by a worse one thrown while describing it.
|
|
21
|
+
*/
|
|
22
|
+
const registered = Object.keys(context.cfg.services ?? {})
|
|
23
|
+
|
|
24
|
+
throw new SyntaxError(
|
|
25
|
+
`Service not found ${alias}. Registered services: `
|
|
26
|
+
+ (registered.length > 0 ? registered.join(', ') : '(none)')
|
|
27
|
+
)
|
|
12
28
|
}
|
|
13
29
|
|
|
14
30
|
if (typeof makeDefault === 'boolean') {
|