@starci/eslint-canon-be 3.20.2 → 3.21.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.21.0 - 2026-11-09
4
+
5
+ - Fixed: `@nestjs/websockets` has a legal placement. The infra owner table (`ruleParams.be.infraOwners`) owns it by `platform/realtime` and by the slot `be.feature.realtime.websocket` (the owner entry `slot:<slot id>` makes every file of a slot an owner), so the `<channel>.gateway.ts` door R212 requires and its spec import it, and `infra-import-owner` reports it in every other file; no re-export is needed and it is not a framework package.
6
+ - Changed: `socket.io-client` is a test library (realtime integration specs); a source file importing it still reports.
7
+ - Changed: peers `@starci/hfs ~6.5.0`.
8
+ - Specs: `src/infra-owner.spec.ts` (the gateway, its spec and `platform/realtime` import `@nestjs/websockets`; a feature service, `platform/foo`, a domain file and another transport fail) and `src/third-party-owner.spec.ts` (a spec uses `socket.io-client`, a source file fails).
9
+ - Changed: peers `@starci/hfs ~6.5.0`, whose R328 owner rows `infra-import-owner` reads: one sign-in package for both editions, `@starci/auth` (`/server` for `integrations/passport`, `/oidc` for `integrations/keycloak`, `/contracts` and `/testing` for either), and the retired `@starci/auth-oidc` refused in every file (`nowhere`). No rule's code changed.
10
+ - Specs: `src/auth-full-owner.spec.ts` (was `auth-oidc-package.spec.ts`): integrations/keycloak may import `@starci/auth/oidc` and the GitHub Actions issuer preset, integrations/passport `@starci/auth` and `@starci/auth/server` but not `/oidc`, keycloak not `/server`; any other integration or module is refused every entry (static, re-export and dynamic imports); `jose` and `passport-oauth2` are refused everywhere; `@starci/auth-oidc` and each of its entries are refused in every file, the old glue included.
11
+
12
+
3
13
  ## 3.20.2 - 2026-11-09
4
14
 
5
15
  - Changed: peers `@starci/hfs ~6.4.0`; no lint rule changed.
@@ -4,7 +4,7 @@
4
4
  * Every raw infrastructure library (HTTP, cache, queue, scheduler, logger, date, config, in-process events, model SDKs)
5
5
  * has exactly one owning platform or integration capability, and only files of that capability may import it or reach
6
6
  * for it as a global. The table lives in the slot manifest (`ruleParams.be.infraOwners`: specifier -> owners, `[]` for
7
- * "nowhere"), so the rule holds no library name of its own and the messages and the check read one source. A key covers
7
+ * "nowhere"; an entry `slot:<slot id>` makes every file of that slot an owner), so the rule holds no library name of its own and the messages and the check read one source. A key covers
8
8
  * its subpaths, so a scope key (`@langchain`) covers every package of the scope, and the longest key wins
9
9
  * (`@langchain/langgraph` over `@langchain`).
10
10
  *
@@ -35,6 +35,12 @@ const ownerIdOf = (hfs, filename) => {
35
35
  const root = hfs.ownerOf(filename);
36
36
  return root === null ? null : root.split("/").slice(-2).join("/");
37
37
  };
38
+ /** An owner entry of the table that names a slot (`slot:<slot id>`): every file of that slot is an owner, as the transport door of a feature (`slot:be.feature.realtime.websocket`) is. */
39
+ const SLOT_OWNER = "slot:";
40
+ /** True when the file is an owner of the entry: its capability id, or the slot an entry `slot:<id>` names. */
41
+ const ownsFile = (hfs, here, filename, owner) => owner.startsWith(SLOT_OWNER) ? hfs.slotOf(filename) === owner.slice(SLOT_OWNER.length) : owner === here;
42
+ /** An owner entry as a message names it. */
43
+ const ownerLabel = (owner) => (owner.startsWith(SLOT_OWNER) ? `the \`${owner.slice(SLOT_OWNER.length)}\` slot` : `\`${owner}\``);
38
44
  /** The table key a module specifier falls under (the specifier itself or a subpath of it, with or without `node:`), or null. */
39
45
  const keyOf = (table, specifier) => {
40
46
  const variants = [specifier, specifier.startsWith("node:") ? specifier.slice(5) : `node:${specifier}`];
@@ -67,12 +73,12 @@ export const infraImportOwner = {
67
73
  const owners = table[key];
68
74
  if (!owners)
69
75
  return;
70
- if ((here !== null && owners.includes(here)) || (isWorld && owners.length > 0 && !owners.includes("platform/logging")))
76
+ if (owners.some((owner) => ownsFile(hfs, here, context.filename, owner)) || (isWorld && owners.length > 0 && !owners.includes("platform/logging")))
71
77
  return;
72
78
  if (owners.length === 0)
73
79
  context.report({ node, messageId: "nowhere", data: { name } });
74
80
  else
75
- context.report({ node, messageId: "foreign", data: { name, owners: owners.map((owner) => `\`${owner}\``).join(", ") } });
81
+ context.report({ node, messageId: "foreign", data: { name, owners: owners.map(ownerLabel).join(", ") } });
76
82
  };
77
83
  return {
78
84
  ...moduleReferences(({ source, value }) => {
@@ -24,7 +24,7 @@ const FRAMEWORK = new Set([
24
24
  "@nestjs/typeorm", "@nestjs/swagger", "@nestjs/mapped-types", "@nestjs/throttler", "@apollo/server",
25
25
  "@as-integrations/express5", "express", "nest-commander", "typeorm", "@starci/nest-kit", "@starci/common",
26
26
  ]);
27
- const TEST_LIBRARIES = new Set(["@nestjs/testing", "@starci/jest-preset", "@starci/test-world", "@jest/globals", "jest", "jest-mock"]);
27
+ const TEST_LIBRARIES = new Set(["@nestjs/testing", "@starci/jest-preset", "@starci/test-world", "@jest/globals", "jest", "jest-mock", "socket.io-client"]);
28
28
  const DEPENDENCIES = new WeakMap();
29
29
  /** The module references of each integration file; read only when an integration file is judged. */
30
30
  const INTEGRATIONS = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-canon-be",
3
- "version": "3.20.2",
3
+ "version": "3.21.0",
4
4
  "description": "The StarCi back-end lint canon: every rule its laws publish, gathered as one flat-config plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "node": ">=22.13.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@starci/hfs": "~6.4.0",
43
+ "@starci/hfs": "~6.5.0",
44
44
  "eslint": ">=9",
45
45
  "typescript": ">=5.9"
46
46
  },
@@ -74,6 +74,6 @@
74
74
  "typescript": "^6.0.3"
75
75
  },
76
76
  "types": "./dist/index.d.ts",
77
- "gitHead": "247dce2b96806850cc135a4573c9b6069c908ef1",
78
- "starciSource": "b163f1bb89f926f8769f4af42818dcd4ccf49815efd0b76df9a66efa95d08249"
77
+ "gitHead": "74626bff437fb2376bf0866421379f7cfc2d4ef8",
78
+ "starciSource": "0c332db25f679f91a8ea99ce10073af38cca5379e0e71c980dc3aa43d9e82ce0"
79
79
  }