@owlmeans/client-context 0.1.18-rc.1 → 0.1.18-rc.10

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/client-context",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.514Z",
4
+ "version": "0.1.18-rc.10",
5
+ "generatedAt": "2026-09-01T12:04:42.798Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/client-context
9
9
 
10
10
  **Layer:** Client
11
- **Install:** `"@owlmeans/client-context": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/client-context": "^0.1.18-rc.10"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
@@ -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,CAqB9F,CAAA"}
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
- throw new SyntaxError(`Service not found ${alias}`);
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;
@@ -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,WAAW,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAA;QACrD,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"}
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.1",
3
+ "version": "0.1.18-rc.10",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -28,12 +28,12 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@owlmeans/api": "^0.1.18-rc.1",
32
- "@owlmeans/client-config": "^0.1.18-rc.1",
33
- "@owlmeans/config": "^0.1.18-rc.1",
34
- "@owlmeans/context": "^0.1.18-rc.1",
35
- "@owlmeans/i18n": "^0.1.18-rc.1",
36
- "@owlmeans/route": "^0.1.18-rc.1"
31
+ "@owlmeans/api": "^0.1.18-rc.9",
32
+ "@owlmeans/client-config": "^0.1.18-rc.8",
33
+ "@owlmeans/config": "^0.1.18-rc.8",
34
+ "@owlmeans/context": "^0.1.18-rc.6",
35
+ "@owlmeans/i18n": "^0.1.18-rc.6",
36
+ "@owlmeans/route": "^0.1.18-rc.6"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@owlmeans/dep-config": "workspace:*",
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
- throw new SyntaxError(`Service not found ${alias}`)
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') {
package/build/.gitkeep DELETED
File without changes