bazis 0.98.14 → 0.98.15

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.
@@ -110,7 +110,9 @@ export class GraphValidator {
110
110
 
111
111
  if (this.context.validateScopes && rootLifetime === "singleton" && depRegistration.lifetime === "scoped") {
112
112
  issues.add(
113
- `Singleton "${tokenToDebugName(registration.token)}" depends on scoped "${tokenToDebugName(descriptor.token)}"`,
113
+ `Singleton "${tokenToDebugName(registration.token)}" depends on scoped "${tokenToDebugName(descriptor.token)}". `
114
+ + `A scoped service lives for one request or scope: make "${tokenToDebugName(registration.token)}" scoped too, `
115
+ + `or inject ServiceProvider and resolve "${tokenToDebugName(descriptor.token)}" in a scope you create (provider.createScope()).`,
114
116
  );
115
117
  }
116
118
 
@@ -173,6 +173,14 @@ export function validateModuleEncapsulation(
173
173
  // Why a provided token is not visible: the owner does not export it, or the
174
174
  // consumer module does not import the owner. Both used to read "not exported".
175
175
  const explainHidden = (token: Token<unknown>, consumer: ModuleGraphRecord): string => {
176
+ // A module the consumer imports already sees the token but does not pass it
177
+ // on. That export is the fix, whatever inner module (an `ormBazis` feature
178
+ // module, say) registered the token.
179
+ const blocking = consumer.imports.find((imported) => !imported.providedTokens.has(token)
180
+ && !exportedTokens(imported).has(token) && visibleTokens(imported).has(token));
181
+ if (blocking !== undefined) {
182
+ return `which its import "${blocking.name}" receives from its own imports but does not export. Add it to the exports of "${blocking.name}".`;
183
+ }
176
184
  const owner = records.find((record) => record !== consumer && record.providedTokens.has(token));
177
185
  if (owner === undefined) return "which is provided by another module but not exported.";
178
186
  return exportedTokens(owner).has(token)
@@ -232,7 +232,7 @@ export class CodexAppServerClient implements CodexClient {
232
232
  if (method === "account/updated") this.modelCache = undefined;
233
233
  }, () => { this.clearLogin(); this.modelCache = undefined; });
234
234
  const initialized = await client.request("initialize", {
235
- clientInfo: { name: "bazis", title: "Bazis", version: "0.98.14" }, capabilities: { experimentalApi: true },
235
+ clientInfo: { name: "bazis", title: "Bazis", version: "0.98.15" }, capabilities: { experimentalApi: true },
236
236
  }, 15_000, signal);
237
237
  if (resolve(text(initialized.codexHome, 4096)) !== this.paths.home) throw new CodexError("PROTOCOL_ERROR");
238
238
  client.notify("initialized");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bazis",
3
- "version": "0.98.14",
3
+ "version": "0.98.15",
4
4
  "description": "Modular backend framework for Bun in TypeScript: DI wired by codegen, HTTP, a PostgreSQL ORM, JWT, WebSocket, agents and a CLI.",
5
5
  "license": "MIT",
6
6
  "author": "Alexander Alenin",