@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.
- package/README.md +1 -1
- package/dist/chunks/{index-jtzfw679.js → index-n4zpd25n.js} +92 -92
- package/dist/chunks/{index-xm9nma2t.js → index-v8zgr7wm.js} +14 -14
- package/dist/chunks/{new-7n8qvtjd.js → new-ny89s7y7.js} +4 -6
- package/dist/chunks/{server-5shmsmse.js → server-ckdy25w2.js} +16 -11
- package/dist/cli/index.js +406 -411
- package/dist/index.js +20 -21
- package/dist/presets/index.js +20 -21
- package/package.json +7 -7
- package/src/core/files.ts +5 -3
- package/src/studio/public/app.js +37 -9
- package/src/studio/public/dom.js +20 -0
- package/src/studio/public/export.js +6 -0
- package/src/studio/public/favicon.svg +10 -4
- package/src/studio/public/graph.js +396 -26
- package/src/studio/public/index.html +26 -12
- package/src/studio/public/special-gothic-latin-ext.woff2 +0 -0
- package/src/studio/public/special-gothic-latin.woff2 +0 -0
- package/src/studio/public/special-gothic-license.txt +93 -0
- package/src/studio/public/style.css +1125 -356
- package/src/studio/server.ts +10 -1
- package/dist/chunks/index-fq57hya4.js +0 -20
package/src/studio/server.ts
CHANGED
|
@@ -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-
|
|
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 };
|