@naosystem/cf-workers-status-page 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +38 -2
- package/dist/admin.html +17 -0
- package/dist/auth-cloudflare-access.js +304 -0
- package/dist/auth-cloudflare-access.js.map +1 -0
- package/dist/chunks/monitor-B2u42off.js +79 -0
- package/dist/chunks/monitor-B2u42off.js.map +1 -0
- package/dist/chunks/notifier-DODVuFhr.js +158 -0
- package/dist/chunks/notifier-DODVuFhr.js.map +1 -0
- package/dist/chunks/page-templates-DPZcMlic.js +71 -0
- package/dist/chunks/page-templates-DPZcMlic.js.map +1 -0
- package/dist/chunks/run-check-bbo3LqI7.js +235 -0
- package/dist/chunks/run-check-bbo3LqI7.js.map +1 -0
- package/dist/chunks/timeline-YJXjehRf.js +1081 -0
- package/dist/chunks/timeline-YJXjehRf.js.map +1 -0
- package/dist/client/_headers +10 -0
- package/dist/client/assets/admin-BBJxKTF6.js +1 -0
- package/dist/client/assets/admin-Be4X0WFj.css +1 -0
- package/dist/client/assets/index-BgOspfsy.js +2 -0
- package/dist/client/assets/index-xpKyzvog.css +1 -0
- package/dist/client/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/client/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/client/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/client/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/client/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/client/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/client/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/client/assets/ja-BT5brvxP.js +1 -0
- package/dist/client/assets/ja-DSSblLff.js +1 -0
- package/dist/client/assets/noto-sans-jp-0-wght-normal-vN5ykBQF.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-1-wght-normal-N_EDDt8j.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-10-wght-normal-ChuiXes4.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-100-wght-normal-CrE4HD6k.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-101-wght-normal-DOqEZFXR.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-102-wght-normal-2gFz4V6e.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-103-wght-normal-D9RhXU-z.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-104-wght-normal-OIyZ9iQD.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-105-wght-normal-CqRQAfnb.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-106-wght-normal-D-PO3jqS.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-107-wght-normal-DrykTIAp.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-108-wght-normal-DijBe27A.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-109-wght-normal-DaJwqT__.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-11-wght-normal-DdkFqF_o.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-110-wght-normal-bhh2FQQH.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-111-wght-normal-CuGzYIdC.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-112-wght-normal-DdhK_1vk.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-113-wght-normal-hxVHS2d4.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-114-wght-normal-DUzjAsrP.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-115-wght-normal-BiZ4-5rz.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-116-wght-normal-DkZAcxAY.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-117-wght-normal-CLJPD2y0.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-118-wght-normal-D8DI_HXJ.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-119-wght-normal-BAB3pFaH.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-12-wght-normal-K36fA5_o.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-13-wght-normal-BnYizWno.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-14-wght-normal-BP4IgVC-.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-15-wght-normal-DyhWcoYF.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-16-wght-normal-CXsQLI2j.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-17-wght-normal-C8FU1ZJ4.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-18-wght-normal-Cl0IKBVh.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-19-wght-normal-D3D3JUJm.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-2-wght-normal-CGu8NhtQ.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-20-wght-normal-DxsoeWSt.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-21-wght-normal-CuNsexW5.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-22-wght-normal-DVX3OFQM.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-23-wght-normal-BPFuo_yH.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-24-wght-normal-D85Fj66x.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-25-wght-normal-DdOOVuSz.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-26-wght-normal-BRB1GnUq.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-27-wght-normal-BxZFF8JU.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-28-wght-normal-VUlviaYI.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-29-wght-normal-CalQqRwB.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-3-wght-normal-cncaCaM8.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-30-wght-normal-CHLg85G9.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-31-wght-normal-BUoF9dl9.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-32-wght-normal-C5ZTiBNw.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-33-wght-normal-C6XNJsfA.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-34-wght-normal-DHkM837w.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-35-wght-normal-QMtEjDIl.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-36-wght-normal-CUyF0GqZ.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-37-wght-normal-EORmNjxA.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-38-wght-normal-C8ERbMNG.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-39-wght-normal-ChUfpJbl.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-4-wght-normal-DtWqs3EP.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-40-wght-normal-MgP8JEEE.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-41-wght-normal-3ctF9abM.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-42-wght-normal-CQtg6UZe.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-43-wght-normal-D1Pmm9aG.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-44-wght-normal-Cp9dHeXI.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-45-wght-normal-D2b1osBj.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-46-wght-normal-CGIA-Vlo.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-47-wght-normal-C4EEGqDS.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-48-wght-normal-D2iBztXa.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-49-wght-normal-DxqRVik_.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-5-wght-normal-CFiyVtll.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-50-wght-normal-CMseszwo.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-51-wght-normal-Cqc-9wfi.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-52-wght-normal-BVLZTbqC.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-53-wght-normal-DTyNOJaY.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-54-wght-normal-_mxGq_et.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-55-wght-normal-Bvndync8.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-56-wght-normal-0MmMqroR.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-57-wght-normal-BdRnjDYs.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-58-wght-normal-BYGgVeN_.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-59-wght-normal-Bdv8mdje.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-6-wght-normal-M-pWkj3J.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-60-wght-normal-DC6FEqsM.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-61-wght-normal-CYIuK5Lr.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-62-wght-normal-DeHy8p7w.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-63-wght-normal-B4M6eMmD.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-64-wght-normal-DLyOXBrC.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-65-wght-normal-X7SsA1bs.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-66-wght-normal-VScDM-_N.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-67-wght-normal-Dg2D3DZB.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-68-wght-normal-BB0AR8UN.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-69-wght-normal-CucwpUnQ.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-7-wght-normal-DzOz8Ryd.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-70-wght-normal-BZId6-Tb.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-71-wght-normal-CzPU0NF7.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-72-wght-normal-DrNRYXnT.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-73-wght-normal-DF2BdR6a.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-74-wght-normal-BMlOw_5y.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-75-wght-normal-DKq84hLG.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-76-wght-normal-CTb-2MFr.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-77-wght-normal-DfIVi-wf.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-78-wght-normal-_-z1Vrir.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-79-wght-normal-D8kGlXda.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-8-wght-normal-BfWoBb3q.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-80-wght-normal-BOEztZwY.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-81-wght-normal-h5VC8QpU.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-82-wght-normal-DJ4QkvX0.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-83-wght-normal-DANtuAZG.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-84-wght-normal-DjZ8Sp6m.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-85-wght-normal-kpU7kbMF.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-86-wght-normal-DRPTa-bf.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-87-wght-normal-CFM472wD.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-88-wght-normal-2rLLwelj.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-89-wght-normal-DUIF9ybW.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-9-wght-normal-WLs1HgG6.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-90-wght-normal-B0n_tL-y.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-91-wght-normal-BishDeFy.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-92-wght-normal-DoIdukLp.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-93-wght-normal-DMCycan_.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-94-wght-normal-DlyoTk-A.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-95-wght-normal-D0L1aiGf.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-96-wght-normal-CjJ0kYkQ.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-97-wght-normal-CJ8uP04H.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-98-wght-normal-CjEDrQIY.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-99-wght-normal-DaQ3GEVf.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-cyrillic-wght-normal-BbS1Q_ZO.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-latin-ext-wght-normal-IaSo_s9d.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-latin-wght-normal-Bnnzbixe.woff2 +0 -0
- package/dist/client/assets/noto-sans-jp-vietnamese-wght-normal-CjvP4Ahz.woff2 +0 -0
- package/dist/client/assets/src-BDi4qpij.js +9 -0
- package/dist/client/assets/src-C6ZFz-Gu.css +1 -0
- package/dist/client/assets/views-CSeX_2-u.css +1 -0
- package/dist/client/assets/views-DHTTEaNV.js +1 -0
- package/dist/client/index.html +15 -0
- package/dist/client/licenses/fonts.txt +104 -0
- package/dist/client/licenses/third-party.txt +349 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/notifier-discord.js +153 -0
- package/dist/notifier-discord.js.map +1 -0
- package/dist/notifier-slack.js +98 -0
- package/dist/notifier-slack.js.map +1 -0
- package/dist/notifier-webhook.js +215 -0
- package/dist/notifier-webhook.js.map +1 -0
- package/dist/provider-http.js +177 -0
- package/dist/provider-http.js.map +1 -0
- package/dist/vite.js +224 -0
- package/dist/vite.js.map +1 -0
- package/dist/worker.js +8616 -0
- package/dist/worker.js.map +1 -0
- package/package.json +58 -5
package/dist/vite.js
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { a as pageTemplatesOf, s as withPageTemplates } from "./chunks/page-templates-DPZcMlic.js";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
7
|
+
import { loadEnv, runnerImport } from "vite";
|
|
8
|
+
var ADMIN_HTML_MODULE = "virtual:cf-workers-status-page/admin-html";
|
|
9
|
+
// src/vite.ts
|
|
10
|
+
/**
|
|
11
|
+
* The Vite plugin of a deployment: `plugins: [statusPage()]` in the user's vite.config.ts.
|
|
12
|
+
*
|
|
13
|
+
* The user's repository holds only status.config.ts, a short wrangler.jsonc (the Worker's
|
|
14
|
+
* name, its D1 database and its queues) and this plugin. The plugin
|
|
15
|
+
*
|
|
16
|
+
* 1. adds the Cloudflare Vite plugin, and gives it everything else the Worker needs in its
|
|
17
|
+
* Wrangler configuration (entry point, Durable Objects, queue consumers, Cron, static
|
|
18
|
+
* assets), so that a new version of the package can change these without the user
|
|
19
|
+
* editing wrangler.jsonc;
|
|
20
|
+
* 2. points the Worker's `virtual:cf-workers-status-page/config` at the user's
|
|
21
|
+
* status.config.ts, which the Worker validates when it loads;
|
|
22
|
+
* 3. serves the status page and admin UI from the package's prebuilt client (no React build
|
|
23
|
+
* in the user's project), and gives the Worker the admin UI's HTML, which only the Worker
|
|
24
|
+
* serves (after authentication);
|
|
25
|
+
* 4. writes which template each page uses into the status page's HTML, so that a page shows
|
|
26
|
+
* its loading screen in its own template (vite.pages.ts at the repository root does the
|
|
27
|
+
* same for a build from the repository).
|
|
28
|
+
*/
|
|
29
|
+
var PACKAGE_NAME = "@naosystem/cf-workers-status-page";
|
|
30
|
+
/** This file's directory: the package's `dist/`. (No `new URL(…, import.meta.url)`: Vite would treat it as an asset.) */
|
|
31
|
+
var DIST = path.dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
var WORKER_ENTRY = path.join(DIST, "worker.js");
|
|
33
|
+
var CLIENT_DIR = path.join(DIST, "client");
|
|
34
|
+
var ADMIN_HTML = path.join(DIST, "admin.html");
|
|
35
|
+
var STATUS_PAGE_HTML = path.join(CLIENT_DIR, "index.html");
|
|
36
|
+
/** The oldest compatibility date this version is tested with; a later one in wrangler.jsonc is kept. */
|
|
37
|
+
var COMPATIBILITY_DATE = "2026-11-17";
|
|
38
|
+
/** The queue bindings the user names in wrangler.jsonc (`queues.producers`). */
|
|
39
|
+
var NOTIFICATIONS = "NOTIFICATIONS";
|
|
40
|
+
var NOTIFICATIONS_DLQ = "NOTIFICATIONS_DLQ";
|
|
41
|
+
/** The variable that opts in to the admin login bypass under the dev server (see worker/admin/auth.ts). */
|
|
42
|
+
var DEV_BYPASS_VARIABLE = "ADMIN_DEV_BYPASS";
|
|
43
|
+
/** Everything the Worker needs besides what the user names; merged over wrangler.jsonc. */
|
|
44
|
+
function workerConfig(config) {
|
|
45
|
+
const producers = config.queues?.producers ?? [];
|
|
46
|
+
const queueOf = (binding) => {
|
|
47
|
+
const producer = producers.find((p) => p.binding === binding);
|
|
48
|
+
if (producer?.queue === void 0) throw new Error(`${PACKAGE_NAME}: wrangler.jsonc must name the queue of the ${binding} binding under queues.producers`);
|
|
49
|
+
return producer.queue;
|
|
50
|
+
};
|
|
51
|
+
const notifications = queueOf(NOTIFICATIONS);
|
|
52
|
+
const deadLetters = queueOf(NOTIFICATIONS_DLQ);
|
|
53
|
+
if (!(config.d1_databases ?? []).some((d1) => d1.binding === "DB")) throw new Error(`${PACKAGE_NAME}: wrangler.jsonc must name a D1 database with the binding DB under d1_databases`);
|
|
54
|
+
return {
|
|
55
|
+
main: WORKER_ENTRY,
|
|
56
|
+
compatibility_date: config.compatibility_date !== void 0 && config.compatibility_date > "2026-11-17" ? config.compatibility_date : COMPATIBILITY_DATE,
|
|
57
|
+
observability: { enabled: true },
|
|
58
|
+
upload_source_maps: true,
|
|
59
|
+
assets: {
|
|
60
|
+
binding: "ASSETS",
|
|
61
|
+
not_found_handling: "single-page-application",
|
|
62
|
+
run_worker_first: [
|
|
63
|
+
"/api/*",
|
|
64
|
+
"/admin",
|
|
65
|
+
"/admin/*"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
durable_objects: { bindings: [
|
|
69
|
+
{
|
|
70
|
+
name: "STATUS_PAGE",
|
|
71
|
+
class_name: "StatusPage"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "MONITOR",
|
|
75
|
+
class_name: "Monitor"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "RECONCILER",
|
|
79
|
+
class_name: "Reconciler"
|
|
80
|
+
}
|
|
81
|
+
] },
|
|
82
|
+
exports: {
|
|
83
|
+
PublicApi: {
|
|
84
|
+
type: "worker",
|
|
85
|
+
cache: { enabled: true }
|
|
86
|
+
},
|
|
87
|
+
StatusPage: {
|
|
88
|
+
type: "durable-object",
|
|
89
|
+
storage: "sqlite"
|
|
90
|
+
},
|
|
91
|
+
Monitor: {
|
|
92
|
+
type: "durable-object",
|
|
93
|
+
storage: "sqlite"
|
|
94
|
+
},
|
|
95
|
+
Reconciler: {
|
|
96
|
+
type: "durable-object",
|
|
97
|
+
storage: "sqlite"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
queues: { consumers: [{
|
|
101
|
+
queue: notifications,
|
|
102
|
+
max_batch_size: 10,
|
|
103
|
+
max_batch_timeout: 2,
|
|
104
|
+
max_retries: 20,
|
|
105
|
+
retry_delay: 60,
|
|
106
|
+
dead_letter_queue: deadLetters
|
|
107
|
+
}, {
|
|
108
|
+
queue: deadLetters,
|
|
109
|
+
max_batch_size: 10,
|
|
110
|
+
max_batch_timeout: 5,
|
|
111
|
+
max_retries: 100,
|
|
112
|
+
retry_delay: 300
|
|
113
|
+
}] },
|
|
114
|
+
version_metadata: { binding: "CF_VERSION_METADATA" },
|
|
115
|
+
triggers: { crons: ["* * * * *"] }
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Each page's template, from the configuration file (an absolute path). A configuration that
|
|
120
|
+
* cannot be read leaves the HTML as it is, with a warning: pages then wait for the API before
|
|
121
|
+
* showing their template, and the Worker reports what is wrong when it loads the configuration.
|
|
122
|
+
*/
|
|
123
|
+
async function loadPageTemplates(configFile, logger) {
|
|
124
|
+
try {
|
|
125
|
+
const { module, dependencies } = await runnerImport(configFile, { logLevel: "silent" });
|
|
126
|
+
const entries = module.default === void 0 ? null : pageTemplatesOf(module.default);
|
|
127
|
+
if (entries === null) logger.warn(`${path.basename(configFile)}: its pages could not be read; status pages load in the default template.`);
|
|
128
|
+
return {
|
|
129
|
+
entries,
|
|
130
|
+
files: [configFile, ...dependencies]
|
|
131
|
+
};
|
|
132
|
+
} catch (error) {
|
|
133
|
+
logger.warn(`${path.basename(configFile)} could not be read for the status page's HTML; status pages load in the default template. ${error instanceof Error ? error.message : String(error)}`);
|
|
134
|
+
return {
|
|
135
|
+
entries: null,
|
|
136
|
+
files: [configFile]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Whether the dev server should answer with the status page's HTML: a page of the status page
|
|
142
|
+
* (the site's root and `/pages/…`, the paths it shows), asked for as a document. Other paths
|
|
143
|
+
* are left to the Cloudflare plugin (the APIs and the admin UI go to the Worker).
|
|
144
|
+
*/
|
|
145
|
+
function isStatusPageRequest(request) {
|
|
146
|
+
if (request.method !== "GET" && request.method !== "HEAD") return false;
|
|
147
|
+
if (!(request.headers.accept ?? "").includes("text/html")) return false;
|
|
148
|
+
const pathname = new URL(request.url ?? "/", "http://localhost").pathname;
|
|
149
|
+
return pathname === "/" || pathname === "/index.html" || pathname.startsWith("/pages/");
|
|
150
|
+
}
|
|
151
|
+
function statusPage(options = {}) {
|
|
152
|
+
let root = process.cwd();
|
|
153
|
+
let configFile = "";
|
|
154
|
+
let logger;
|
|
155
|
+
/** Read once per build; under the dev server, again after one of its files changed. */
|
|
156
|
+
let templates = null;
|
|
157
|
+
const loadTemplates = () => templates ??= loadPageTemplates(configFile, logger);
|
|
158
|
+
const statusPageHtml = async (html) => {
|
|
159
|
+
const { entries } = await loadTemplates();
|
|
160
|
+
return entries === null ? html : withPageTemplates(html, entries);
|
|
161
|
+
};
|
|
162
|
+
return [{
|
|
163
|
+
name: "cf-workers-status-page",
|
|
164
|
+
enforce: "pre",
|
|
165
|
+
config(config, env) {
|
|
166
|
+
root = path.resolve(config.root ?? process.cwd());
|
|
167
|
+
const variables = loadEnv(env.mode, config.envDir || root, DEV_BYPASS_VARIABLE);
|
|
168
|
+
const devBypass = env.command === "serve" && variables[DEV_BYPASS_VARIABLE] === "1";
|
|
169
|
+
return {
|
|
170
|
+
publicDir: CLIENT_DIR,
|
|
171
|
+
define: { __ADMIN_DEV_BYPASS__: JSON.stringify(devBypass) }
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
configResolved(config) {
|
|
175
|
+
configFile = path.resolve(config.root, options.config ?? "status.config.ts");
|
|
176
|
+
logger = config.logger;
|
|
177
|
+
},
|
|
178
|
+
configureServer(server) {
|
|
179
|
+
server.watcher.on("all", (_event, file) => {
|
|
180
|
+
if (templates === null) return;
|
|
181
|
+
const current = templates;
|
|
182
|
+
current.then(({ files }) => {
|
|
183
|
+
if (templates === current && files.includes(path.resolve(file))) templates = null;
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
server.middlewares.use((request, response, next) => {
|
|
187
|
+
if (!isStatusPageRequest(request)) return next();
|
|
188
|
+
readFile(STATUS_PAGE_HTML, "utf8").then(statusPageHtml).then((html) => {
|
|
189
|
+
response.statusCode = 200;
|
|
190
|
+
response.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
191
|
+
response.setHeader("Cache-Control", "no-store");
|
|
192
|
+
response.end(request.method === "HEAD" ? void 0 : html);
|
|
193
|
+
}, next);
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
async writeBundle(output) {
|
|
197
|
+
if (this.environment.name !== "client" || output.dir === void 0) return;
|
|
198
|
+
const file = path.join(output.dir, "index.html");
|
|
199
|
+
const html = await readFile(file, "utf8").catch(() => null);
|
|
200
|
+
if (html === null) {
|
|
201
|
+
logger.warn(`${file} was not found: status pages load in the default template.`);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
await writeFile(file, await statusPageHtml(html));
|
|
205
|
+
},
|
|
206
|
+
configEnvironment(name) {
|
|
207
|
+
if (name !== "client") return { optimizeDeps: { exclude: [PACKAGE_NAME] } };
|
|
208
|
+
},
|
|
209
|
+
resolveId(id) {
|
|
210
|
+
if (id === "virtual:cf-workers-status-page/config") return path.resolve(root, options.config ?? "status.config.ts");
|
|
211
|
+
if (id === "virtual:cf-workers-status-page/admin-html") return `\0${ADMIN_HTML_MODULE}`;
|
|
212
|
+
},
|
|
213
|
+
load(id) {
|
|
214
|
+
if (id !== `\0virtual:cf-workers-status-page/admin-html`) return void 0;
|
|
215
|
+
return `export default ${JSON.stringify(readFileSync(ADMIN_HTML, "utf8"))};`;
|
|
216
|
+
}
|
|
217
|
+
}, cloudflare({
|
|
218
|
+
...options.cloudflare,
|
|
219
|
+
config: workerConfig
|
|
220
|
+
})];
|
|
221
|
+
}
|
|
222
|
+
export { COMPATIBILITY_DATE, statusPage, workerConfig };
|
|
223
|
+
|
|
224
|
+
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","names":[],"sources":["../src/modules.ts","../src/vite.ts"],"sourcesContent":["/**\n * Modules that the published Worker code imports and the user's build provides (see vite.ts):\n * the user's status.config.ts, and the admin UI's HTML from the package's client build.\n */\nexport const CONFIG_MODULE = \"virtual:cf-workers-status-page/config\";\nexport const ADMIN_HTML_MODULE = \"virtual:cf-workers-status-page/admin-html\";\n","/**\n * The Vite plugin of a deployment: `plugins: [statusPage()]` in the user's vite.config.ts.\n *\n * The user's repository holds only status.config.ts, a short wrangler.jsonc (the Worker's\n * name, its D1 database and its queues) and this plugin. The plugin\n *\n * 1. adds the Cloudflare Vite plugin, and gives it everything else the Worker needs in its\n * Wrangler configuration (entry point, Durable Objects, queue consumers, Cron, static\n * assets), so that a new version of the package can change these without the user\n * editing wrangler.jsonc;\n * 2. points the Worker's `virtual:cf-workers-status-page/config` at the user's\n * status.config.ts, which the Worker validates when it loads;\n * 3. serves the status page and admin UI from the package's prebuilt client (no React build\n * in the user's project), and gives the Worker the admin UI's HTML, which only the Worker\n * serves (after authentication);\n * 4. writes which template each page uses into the status page's HTML, so that a page shows\n * its loading screen in its own template (vite.pages.ts at the repository root does the\n * same for a build from the repository).\n */\nimport { readFileSync } from \"node:fs\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport type { IncomingMessage } from \"node:http\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { cloudflare, type PluginConfig } from \"@cloudflare/vite-plugin\";\nimport {\n\ttype PageTemplateEntry,\n\tpageTemplatesOf,\n\ttype StatusConfig,\n\twithPageTemplates,\n} from \"@naosystem/cf-workers-status-page-core\";\nimport { type Logger, loadEnv, type Plugin, type PluginOption, runnerImport } from \"vite\";\nimport { ADMIN_HTML_MODULE, CONFIG_MODULE } from \"./modules\";\n\nconst PACKAGE_NAME = \"@naosystem/cf-workers-status-page\";\n\n/** This file's directory: the package's `dist/`. (No `new URL(…, import.meta.url)`: Vite would treat it as an asset.) */\nconst DIST = path.dirname(fileURLToPath(import.meta.url));\nconst WORKER_ENTRY = path.join(DIST, \"worker.js\");\nconst CLIENT_DIR = path.join(DIST, \"client\");\nconst ADMIN_HTML = path.join(DIST, \"admin.html\");\nconst STATUS_PAGE_HTML = path.join(CLIENT_DIR, \"index.html\");\n\n/** The oldest compatibility date this version is tested with; a later one in wrangler.jsonc is kept. */\nexport const COMPATIBILITY_DATE = \"2026-11-17\";\n\n/** The queue bindings the user names in wrangler.jsonc (`queues.producers`). */\nconst NOTIFICATIONS = \"NOTIFICATIONS\";\nconst NOTIFICATIONS_DLQ = \"NOTIFICATIONS_DLQ\";\n\n/** The variable that opts in to the admin login bypass under the dev server (see worker/admin/auth.ts). */\nconst DEV_BYPASS_VARIABLE = \"ADMIN_DEV_BYPASS\";\n\ntype WorkerConfig = Parameters<Extract<NonNullable<PluginConfig[\"config\"]>, (...args: never[]) => unknown>>[0];\n\nexport interface StatusPageOptions {\n\t/** The configuration file, relative to the project root. Default `status.config.ts`. */\n\treadonly config?: string;\n\t/** Options of the Cloudflare Vite plugin, except `config`, which this plugin sets. */\n\treadonly cloudflare?: Omit<PluginConfig, \"config\">;\n}\n\n/** Everything the Worker needs besides what the user names; merged over wrangler.jsonc. */\nexport function workerConfig(config: WorkerConfig): Partial<WorkerConfig> {\n\tconst producers = config.queues?.producers ?? [];\n\tconst queueOf = (binding: string): string => {\n\t\tconst producer = producers.find((p) => p.binding === binding);\n\t\tif (producer?.queue === undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t`${PACKAGE_NAME}: wrangler.jsonc must name the queue of the ${binding} binding under queues.producers`,\n\t\t\t);\n\t\t}\n\t\treturn producer.queue;\n\t};\n\tconst notifications = queueOf(NOTIFICATIONS);\n\tconst deadLetters = queueOf(NOTIFICATIONS_DLQ);\n\tif (!(config.d1_databases ?? []).some((d1) => d1.binding === \"DB\")) {\n\t\tthrow new Error(`${PACKAGE_NAME}: wrangler.jsonc must name a D1 database with the binding DB under d1_databases`);\n\t}\n\tconst compatibilityDate =\n\t\tconfig.compatibility_date !== undefined && config.compatibility_date > COMPATIBILITY_DATE\n\t\t\t? config.compatibility_date\n\t\t\t: COMPATIBILITY_DATE;\n\treturn {\n\t\tmain: WORKER_ENTRY,\n\t\tcompatibility_date: compatibilityDate,\n\t\tobservability: { enabled: true },\n\t\tupload_source_maps: true,\n\t\tassets: {\n\t\t\tbinding: \"ASSETS\",\n\t\t\tnot_found_handling: \"single-page-application\",\n\t\t\trun_worker_first: [\"/api/*\", \"/admin\", \"/admin/*\"],\n\t\t},\n\t\tdurable_objects: {\n\t\t\tbindings: [\n\t\t\t\t{ name: \"STATUS_PAGE\", class_name: \"StatusPage\" },\n\t\t\t\t{ name: \"MONITOR\", class_name: \"Monitor\" },\n\t\t\t\t{ name: \"RECONCILER\", class_name: \"Reconciler\" },\n\t\t\t],\n\t\t},\n\t\texports: {\n\t\t\tPublicApi: { type: \"worker\", cache: { enabled: true } },\n\t\t\tStatusPage: { type: \"durable-object\", storage: \"sqlite\" },\n\t\t\tMonitor: { type: \"durable-object\", storage: \"sqlite\" },\n\t\t\tReconciler: { type: \"durable-object\", storage: \"sqlite\" },\n\t\t},\n\t\tqueues: {\n\t\t\tconsumers: [\n\t\t\t\t{\n\t\t\t\t\tqueue: notifications,\n\t\t\t\t\tmax_batch_size: 10,\n\t\t\t\t\tmax_batch_timeout: 2,\n\t\t\t\t\tmax_retries: 20,\n\t\t\t\t\tretry_delay: 60,\n\t\t\t\t\tdead_letter_queue: deadLetters,\n\t\t\t\t},\n\t\t\t\t{ queue: deadLetters, max_batch_size: 10, max_batch_timeout: 5, max_retries: 100, retry_delay: 300 },\n\t\t\t],\n\t\t},\n\t\tversion_metadata: { binding: \"CF_VERSION_METADATA\" },\n\t\ttriggers: { crons: [\"* * * * *\"] },\n\t} as Partial<WorkerConfig>;\n}\n\ninterface LoadedPageTemplates {\n\t/** `null` when the configuration could not be read, or a page is not valid. */\n\treadonly entries: PageTemplateEntry[] | null;\n\t/** The files the configuration was read from, to read it again when one changes. */\n\treadonly files: readonly string[];\n}\n\n/**\n * Each page's template, from the configuration file (an absolute path). A configuration that\n * cannot be read leaves the HTML as it is, with a warning: pages then wait for the API before\n * showing their template, and the Worker reports what is wrong when it loads the configuration.\n */\nasync function loadPageTemplates(configFile: string, logger: Logger): Promise<LoadedPageTemplates> {\n\ttry {\n\t\tconst { module, dependencies } = await runnerImport<{ default?: StatusConfig }>(configFile, { logLevel: \"silent\" });\n\t\tconst entries = module.default === undefined ? null : pageTemplatesOf(module.default);\n\t\tif (entries === null) logger.warn(`${path.basename(configFile)}: its pages could not be read; status pages load in the default template.`);\n\t\treturn { entries, files: [configFile, ...dependencies] };\n\t} catch (error) {\n\t\tlogger.warn(\n\t\t\t`${path.basename(configFile)} could not be read for the status page's HTML; status pages load in the default template. ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t\treturn { entries: null, files: [configFile] };\n\t}\n}\n\n/**\n * Whether the dev server should answer with the status page's HTML: a page of the status page\n * (the site's root and `/pages/…`, the paths it shows), asked for as a document. Other paths\n * are left to the Cloudflare plugin (the APIs and the admin UI go to the Worker).\n */\nfunction isStatusPageRequest(request: IncomingMessage): boolean {\n\tif (request.method !== \"GET\" && request.method !== \"HEAD\") return false;\n\tif (!(request.headers.accept ?? \"\").includes(\"text/html\")) return false;\n\tconst pathname = new URL(request.url ?? \"/\", \"http://localhost\").pathname;\n\treturn pathname === \"/\" || pathname === \"/index.html\" || pathname.startsWith(\"/pages/\");\n}\n\nexport function statusPage(options: StatusPageOptions = {}): PluginOption[] {\n\tlet root = process.cwd();\n\tlet configFile = \"\";\n\tlet logger: Logger;\n\t/** Read once per build; under the dev server, again after one of its files changed. */\n\tlet templates: Promise<LoadedPageTemplates> | null = null;\n\tconst loadTemplates = () => (templates ??= loadPageTemplates(configFile, logger));\n\tconst statusPageHtml = async (html: string) => {\n\t\tconst { entries } = await loadTemplates();\n\t\treturn entries === null ? html : withPageTemplates(html, entries);\n\t};\n\tconst plugin: Plugin = {\n\t\tname: \"cf-workers-status-page\",\n\t\tenforce: \"pre\",\n\n\t\tconfig(config, env) {\n\t\t\troot = path.resolve(config.root ?? process.cwd());\n\t\t\tconst variables = loadEnv(env.mode, config.envDir || root, DEV_BYPASS_VARIABLE);\n\t\t\t// The admin login bypass is compiled in only under the dev server, and only on request.\n\t\t\tconst devBypass = env.command === \"serve\" && variables[DEV_BYPASS_VARIABLE] === \"1\";\n\t\t\treturn {\n\t\t\t\t// The prebuilt status page and admin UI's scripts and styles are the static assets.\n\t\t\t\tpublicDir: CLIENT_DIR,\n\t\t\t\tdefine: { __ADMIN_DEV_BYPASS__: JSON.stringify(devBypass) },\n\t\t\t};\n\t\t},\n\n\t\tconfigResolved(config) {\n\t\t\tconfigFile = path.resolve(config.root, options.config ?? \"status.config.ts\");\n\t\t\tlogger = config.logger;\n\t\t},\n\n\t\tconfigureServer(server) {\n\t\t\tserver.watcher.on(\"all\", (_event, file) => {\n\t\t\t\tif (templates === null) return;\n\t\t\t\tconst current = templates;\n\t\t\t\tvoid current.then(({ files }) => {\n\t\t\t\t\tif (templates === current && files.includes(path.resolve(file))) templates = null;\n\t\t\t\t});\n\t\t\t});\n\t\t\t// The prebuilt HTML is a static file, which Vite serves as it is: give it the templates.\n\t\t\tserver.middlewares.use((request, response, next) => {\n\t\t\t\tif (!isStatusPageRequest(request)) return next();\n\t\t\t\treadFile(STATUS_PAGE_HTML, \"utf8\")\n\t\t\t\t\t.then(statusPageHtml)\n\t\t\t\t\t.then((html) => {\n\t\t\t\t\t\tresponse.statusCode = 200;\n\t\t\t\t\t\tresponse.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\t\t\tresponse.setHeader(\"Cache-Control\", \"no-store\");\n\t\t\t\t\t\tresponse.end(request.method === \"HEAD\" ? undefined : html);\n\t\t\t\t\t}, next);\n\t\t\t});\n\t\t},\n\n\t\t// The client build copies the prebuilt HTML (publicDir): give the copy the templates.\n\t\tasync writeBundle(output) {\n\t\t\tif (this.environment.name !== \"client\" || output.dir === undefined) return;\n\t\t\tconst file = path.join(output.dir, \"index.html\");\n\t\t\tconst html = await readFile(file, \"utf8\").catch(() => null);\n\t\t\tif (html === null) {\n\t\t\t\tlogger.warn(`${file} was not found: status pages load in the default template.`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait writeFile(file, await statusPageHtml(html));\n\t\t},\n\n\t\tconfigEnvironment(name) {\n\t\t\t// The Worker code imports this plugin's virtual modules: Vite must not pre-bundle it.\n\t\t\tif (name !== \"client\") return { optimizeDeps: { exclude: [PACKAGE_NAME] } };\n\t\t\treturn undefined;\n\t\t},\n\n\t\tresolveId(id) {\n\t\t\tif (id === CONFIG_MODULE) return path.resolve(root, options.config ?? \"status.config.ts\");\n\t\t\tif (id === ADMIN_HTML_MODULE) return `\\0${ADMIN_HTML_MODULE}`;\n\t\t\treturn undefined;\n\t\t},\n\n\t\tload(id) {\n\t\t\tif (id !== `\\0${ADMIN_HTML_MODULE}`) return undefined;\n\t\t\treturn `export default ${JSON.stringify(readFileSync(ADMIN_HTML, \"utf8\"))};`;\n\t\t},\n\t};\n\treturn [plugin, cloudflare({ ...options.cloudflare, config: workerConfig })];\n}\n"],"mappings":";;;;;;;AAKA,IAAa,oBAAoB;;;;;;;;;;;;;;;;;;;;;AC6BjC,IAAM,eAAe;;AAGrB,IAAM,OAAO,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,eAAe,KAAK,KAAK,MAAM,WAAW;AAChD,IAAM,aAAa,KAAK,KAAK,MAAM,QAAQ;AAC3C,IAAM,aAAa,KAAK,KAAK,MAAM,YAAY;AAC/C,IAAM,mBAAmB,KAAK,KAAK,YAAY,YAAY;;AAG3D,IAAa,qBAAqB;;AAGlC,IAAM,gBAAgB;AACtB,IAAM,oBAAoB;;AAG1B,IAAM,sBAAsB;;AAY5B,SAAgB,aAAa,QAA6C;CACzE,MAAM,YAAY,OAAO,QAAQ,aAAa,CAAC;CAC/C,MAAM,WAAW,YAA4B;EAC5C,MAAM,WAAW,UAAU,MAAM,MAAM,EAAE,YAAY,OAAO;EAC5D,IAAI,UAAU,UAAU,KAAA,GACvB,MAAM,IAAI,MACT,GAAG,a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