@takodotid/circuit 0.20.0 → 0.22.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.
@@ -48,6 +48,7 @@ const CONTENT_TYPES: Record<string, string> = {
48
48
  ".css": "text/css; charset=utf-8",
49
49
  ".js": "text/javascript; charset=utf-8",
50
50
  ".svg": "image/svg+xml",
51
+ ".woff2": "font/woff2",
51
52
  };
52
53
 
53
54
  /** What Studio shows, as JSON, from `circuit studio --json` run as a new process, or what stopped it. */
@@ -109,6 +110,9 @@ export async function studio(options: StudioOptions): Promise<void> {
109
110
  };
110
111
 
111
112
  const server = createServer((request, response) => {
113
+ // Studio shows one team's network: every answer asks search engines to leave it out, and robots.txt says so for the whole site.
114
+ response.setHeader("x-robots-tag", "noindex, nofollow, noarchive");
115
+
112
116
  if (!hostAllowed(request.headers.host, port, options.allowHosts)) {
113
117
  response.writeHead(403).end();
114
118
  return;
@@ -153,6 +157,11 @@ export async function studio(options: StudioOptions): Promise<void> {
153
157
  return;
154
158
  }
155
159
 
160
+ if (path === "/robots.txt") {
161
+ response.writeHead(200, { "content-type": "text/plain; charset=utf-8" }).end("User-agent: *\nDisallow: /\n");
162
+ return;
163
+ }
164
+
156
165
  if (path === "/data") {
157
166
  response.writeHead(200, { "content-type": "application/json", "cache-control": "no-store" }).end(data);
158
167
  return;
@@ -178,7 +187,7 @@ export async function studio(options: StudioOptions): Promise<void> {
178
187
  const type = CONTENT_TYPES[extname(name)];
179
188
  const file = join(pages, name);
180
189
 
181
- if (!/^[a-z-]+\.[a-z]+$/.test(name) || !type || !existsSync(file)) {
190
+ if (!/^[a-z-]+\.[a-z0-9]+$/.test(name) || !type || !existsSync(file)) {
182
191
  response.writeHead(404).end();
183
192
  return;
184
193
  }
@@ -1,20 +0,0 @@
1
- import { createRequire } from "node:module";
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __toESM = (mod, isNodeMode, target) => {
8
- target = mod != null ? __create(__getProtoOf(mod)) : {};
9
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
- for (let key of __getOwnPropNames(mod))
11
- if (!__hasOwnProp.call(to, key))
12
- __defProp(to, key, {
13
- get: () => mod[key],
14
- enumerable: true
15
- });
16
- return to;
17
- };
18
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
19
-
20
- export { __toESM, __require };