@teacss/inspector 0.10.13 → 0.10.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.
package/dist/access.js CHANGED
@@ -1,5 +1,3 @@
1
- // The inspector answers only loopback peers that also name a loopback host: the Host header alone is
2
- // client-controlled, and `vite --host` would otherwise hand the config, module tokens and REPL to the LAN.
3
1
  import { BlockList, isIP } from "node:net";
4
2
  const loopback = new BlockList();
5
3
  loopback.addSubnet("127.0.0.0", 8, "ipv4");
@@ -11,7 +9,6 @@ function isLoopbackAddress(value) {
11
9
  const family = isIP(address);
12
10
  return family !== 0 && loopback.check(address, family === 4 ? "ipv4" : "ipv6");
13
11
  }
14
- /** The hostname of a `Host` header (`name`, `name:port`, `[v6]`, `[v6]:port`); undefined when malformed. */
15
12
  function hostnameOf(header) {
16
13
  const value = header?.trim().toLowerCase();
17
14
  if (!value)
package/dist/index.js CHANGED
@@ -2,10 +2,8 @@ import { fileURLToPath } from "node:url";
2
2
  import { version } from "@teacss/engine";
3
3
  import sirv from "sirv";
4
4
  import { isLoopbackRequest } from "./access.js";
5
- /** A REPL body past this is refused before it is read into memory (the engine's own source bound is v02.2 §8's 16 MiB). */
6
5
  const MAX_BODY_BYTES = 1 << 20;
7
6
  const CLIENT_DIR = fileURLToPath(new URL("./client/", import.meta.url));
8
- /** `GET /api/token/<token>`; the token is percent-encoded, so `rd:1/2` arrives as `rd%3A1%2F2`. */
9
7
  const TOKEN_ROUTE = "/api/token/";
10
8
  class HttpError extends Error {
11
9
  status;
@@ -14,7 +12,6 @@ class HttpError extends Error {
14
12
  this.status = status;
15
13
  }
16
14
  }
17
- /** `/api/suggest` answers at most this many candidates; `limit` can lower it. */
18
15
  const MAX_SUGGESTIONS = 100;
19
16
  /**
20
17
  * `/api/project`, `/api/modules`, `/api/css`, `/api/stats`, `/api/token/<token>`, `/api/suggest?q=` and `POST /api/repl`
@@ -120,7 +117,6 @@ function decodeToken(encoded) {
120
117
  throw new HttpError(400, "token is not percent-encoded");
121
118
  }
122
119
  }
123
- /** `limit` as a count in 0–MAX_SUGGESTIONS; absent means the maximum. */
124
120
  function parseLimit(raw) {
125
121
  if (raw === null)
126
122
  return MAX_SUGGESTIONS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacss/inspector",
3
- "version": "0.10.13",
3
+ "version": "0.10.15",
4
4
  "description": "TeaCSS inspector: the dev-server page @teacss/vite mounts at /__teacss, reading the Rust engine (@teacss/engine)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  "node": ">=26"
35
35
  },
36
36
  "dependencies": {
37
- "@teacss/engine": "0.10.13",
37
+ "@teacss/engine": "0.10.15",
38
38
  "sirv": "^3"
39
39
  },
40
40
  "devDependencies": {