zudoku 0.3.0-dev.38 → 0.3.0-dev.39
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/app/entry.client.d.ts +0 -1
- package/dist/app/entry.client.js +5 -8
- package/dist/app/entry.client.js.map +1 -1
- package/dist/{vite/ssr → app}/entry.server.d.ts +1 -1
- package/dist/{vite/ssr → app}/entry.server.js +5 -6
- package/dist/app/entry.server.js.map +1 -0
- package/dist/app/main.d.ts +6 -0
- package/dist/{lib → app}/main.js +5 -6
- package/dist/app/main.js.map +1 -0
- package/dist/{vite/ssr → app}/zudoku-manifest.js +1 -1
- package/dist/app/zudoku-manifest.js.map +1 -0
- package/dist/internal.d.ts +0 -2
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +12 -0
- package/dist/lib/components/Bootstrap.js +9 -0
- package/dist/lib/components/Bootstrap.js.map +1 -0
- package/dist/lib/components/DevPortal.js +1 -1
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/index.d.ts +10 -0
- package/dist/lib/components/index.js +5 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +5 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +3 -1
- package/dist/lib/plugins/openapi/index.d.ts +5 -1
- package/dist/lib/plugins/openapi/index.js +2 -2
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/vite/build.js +12 -15
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +9 -8
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +1 -0
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +5 -12
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin.js +0 -2
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AnchorLink-Sx89bfCW.js → AnchorLink-DCdBbdqo.js} +4 -3
- package/lib/AnchorLink-DCdBbdqo.js.map +1 -0
- package/lib/{DevPortalProvider-Demv4Ngx.js → DevPortalProvider-C-O1s7mm.js} +20 -20
- package/lib/{DevPortalProvider-Demv4Ngx.js.map → DevPortalProvider-C-O1s7mm.js.map} +1 -1
- package/lib/{Markdown-DMEnjeMH.js → Markdown-CGZJUYcj.js} +3192 -2663
- package/lib/Markdown-CGZJUYcj.js.map +1 -0
- package/lib/MdxPage-BZLuBOqR.js +190 -0
- package/lib/MdxPage-BZLuBOqR.js.map +1 -0
- package/lib/{OperationList-9NIdTqS0.js → OperationList-BEpN70_E.js} +192 -192
- package/lib/{OperationList-9NIdTqS0.js.map → OperationList-BEpN70_E.js.map} +1 -1
- package/lib/{Route-BqfQoDR2.js → Route-WiMUalLG.js} +3 -3
- package/lib/{Route-BqfQoDR2.js.map → Route-WiMUalLG.js.map} +1 -1
- package/lib/{Select-CJamK_wp.js → Select-BQ9-3iTJ.js} +5 -5
- package/lib/{Select-CJamK_wp.js.map → Select-BQ9-3iTJ.js.map} +1 -1
- package/lib/{Spinner-3YT-WUu5.js → Spinner-C1L_TK5f.js} +10 -10
- package/lib/{Spinner-3YT-WUu5.js.map → Spinner-C1L_TK5f.js.map} +1 -1
- package/lib/createWorkerClient-TWecYOlx.js +16698 -0
- package/lib/createWorkerClient-TWecYOlx.js.map +1 -0
- package/lib/{hook-Cq3Jb1lX.js → hook-SM2dMVmI.js} +9 -9
- package/lib/{hook-Cq3Jb1lX.js.map → hook-SM2dMVmI.js.map} +1 -1
- package/lib/{index-BB2EBBgh.js → index-CtLNbq0d.js} +15 -15
- package/lib/{index-BB2EBBgh.js.map → index-CtLNbq0d.js.map} +1 -1
- package/lib/{index-DhKGMJM2.js → index-PvQa9XLl.js} +16 -17
- package/lib/{index-DhKGMJM2.js.map → index-PvQa9XLl.js.map} +1 -1
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/index-pI9JkN46.js.map +1 -0
- package/lib/jsx-runtime-DLtUZ5Ve.js +1526 -0
- package/lib/{jsx-runtime-Bt86M5tA.js.map → jsx-runtime-DLtUZ5Ve.js.map} +1 -1
- package/lib/router-BkOLuJlq.js +2973 -0
- package/lib/{router-CcYTwKjf.js.map → router-BkOLuJlq.js.map} +1 -1
- package/lib/slugify-DbLhpSPt.js +28 -0
- package/lib/slugify-DbLhpSPt.js.map +1 -0
- package/lib/{util-CYBrkBUo.js → util-Cgie7wjb.js} +2 -2
- package/lib/{util-CYBrkBUo.js.map → util-Cgie7wjb.js.map} +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +692 -408
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +2 -225
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-markdown.js +4 -4
- package/lib/zudoku.plugin-openapi.js +6 -7
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +4 -4
- package/package.json +3 -10
- package/src/app/entry.client.tsx +4 -20
- package/src/app/entry.server.tsx +156 -0
- package/src/{lib → app}/main.tsx +9 -8
- package/src/app/zudoku-manifest.ts +22 -0
- package/src/lib/components/Bootstrap.tsx +37 -0
- package/src/lib/components/DevPortal.tsx +1 -1
- package/src/lib/components/Layout.tsx +1 -1
- package/src/lib/components/index.ts +8 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +9 -1
- package/src/lib/plugins/openapi/client/interfaces.ts +3 -1
- package/src/lib/plugins/openapi/index.tsx +7 -3
- package/dist/lib/main.d.ts +0 -26
- package/dist/lib/main.js.map +0 -1
- package/dist/vite/plugin-openapi-worker.d.ts +0 -4
- package/dist/vite/plugin-openapi-worker.js +0 -39
- package/dist/vite/plugin-openapi-worker.js.map +0 -1
- package/dist/vite/ssr/entry.server.js.map +0 -1
- package/dist/vite/ssr/zudoku-manifest.js.map +0 -1
- package/lib/AnchorLink-Sx89bfCW.js.map +0 -1
- package/lib/Markdown-DMEnjeMH.js.map +0 -1
- package/lib/MdxPage-s9RlKFtt.js +0 -213
- package/lib/MdxPage-s9RlKFtt.js.map +0 -1
- package/lib/jsx-runtime-Bt86M5tA.js +0 -866
- package/lib/router-CcYTwKjf.js +0 -183
- package/lib/urql-DMlBWUKL.js +0 -1592
- package/lib/urql-DMlBWUKL.js.map +0 -1
- /package/dist/{vite/ssr → app}/zudoku-manifest.d.ts +0 -0
|
@@ -1,228 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function d(e) {
|
|
3
|
-
if (!m(e))
|
|
4
|
-
throw new Error("Parameter was not an error");
|
|
5
|
-
}
|
|
6
|
-
function m(e) {
|
|
7
|
-
return T(e) === "[object Error]" || e instanceof Error;
|
|
8
|
-
}
|
|
9
|
-
function T(e) {
|
|
10
|
-
return Object.prototype.toString.call(e);
|
|
11
|
-
}
|
|
12
|
-
function I(e) {
|
|
13
|
-
let t, n = "";
|
|
14
|
-
if (e.length === 0)
|
|
15
|
-
t = {};
|
|
16
|
-
else if (m(e[0]))
|
|
17
|
-
t = {
|
|
18
|
-
cause: e[0]
|
|
19
|
-
}, n = e.slice(1).join(" ") || "";
|
|
20
|
-
else if (e[0] && typeof e[0] == "object")
|
|
21
|
-
t = Object.assign({}, e[0]), n = e.slice(1).join(" ") || "";
|
|
22
|
-
else if (typeof e[0] == "string")
|
|
23
|
-
t = {}, n = n = e.join(" ") || "";
|
|
24
|
-
else
|
|
25
|
-
throw new Error("Invalid arguments passed to Layerr");
|
|
26
|
-
return {
|
|
27
|
-
options: t,
|
|
28
|
-
shortMessage: n
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
class c extends Error {
|
|
32
|
-
constructor(t, n) {
|
|
33
|
-
const r = [...arguments], { options: o, shortMessage: s } = I(r);
|
|
34
|
-
let i = s;
|
|
35
|
-
if (o.cause && (i = `${i}: ${o.cause.message}`), super(i), this.message = i, o.name && typeof o.name == "string" ? this.name = o.name : this.name = "Layerr", o.cause && Object.defineProperty(this, "_cause", { value: o.cause }), Object.defineProperty(this, "_info", { value: {} }), o.info && typeof o.info == "object" && Object.assign(this._info, o.info), Error.captureStackTrace) {
|
|
36
|
-
const l = o.constructorOpt || this.constructor;
|
|
37
|
-
Error.captureStackTrace(this, l);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
static cause(t) {
|
|
41
|
-
return d(t), t._cause && m(t._cause) ? t._cause : null;
|
|
42
|
-
}
|
|
43
|
-
static fullStack(t) {
|
|
44
|
-
d(t);
|
|
45
|
-
const n = c.cause(t);
|
|
46
|
-
return n ? `${t.stack}
|
|
47
|
-
caused by: ${c.fullStack(n)}` : t.stack;
|
|
48
|
-
}
|
|
49
|
-
static info(t) {
|
|
50
|
-
d(t);
|
|
51
|
-
const n = {}, r = c.cause(t);
|
|
52
|
-
return r && Object.assign(n, c.info(r)), t._info && Object.assign(n, t._info), n;
|
|
53
|
-
}
|
|
54
|
-
cause() {
|
|
55
|
-
return c.cause(this);
|
|
56
|
-
}
|
|
57
|
-
toString() {
|
|
58
|
-
let t = this.name || this.constructor.name || this.constructor.prototype.name;
|
|
59
|
-
return this.message && (t = `${t}: ${this.message}`), t;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const f = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", u = 32, p = 281474976710655, h = 10, j = 16, a = Object.freeze({
|
|
63
|
-
source: "ulid"
|
|
64
|
-
});
|
|
65
|
-
function C(e) {
|
|
66
|
-
const t = O(), n = t && (t.crypto || t.msCrypto) || null;
|
|
67
|
-
if (typeof (n == null ? void 0 : n.getRandomValues) == "function")
|
|
68
|
-
return () => {
|
|
69
|
-
const r = new Uint8Array(1);
|
|
70
|
-
return n.getRandomValues(r), r[0] / 255;
|
|
71
|
-
};
|
|
72
|
-
if (typeof (n == null ? void 0 : n.randomBytes) == "function")
|
|
73
|
-
return () => n.randomBytes(1).readUInt8() / 255;
|
|
74
|
-
throw new c({
|
|
75
|
-
info: {
|
|
76
|
-
code: "PRNG_DETECT",
|
|
77
|
-
...a
|
|
78
|
-
}
|
|
79
|
-
}, "Failed to find a reliable PRNG");
|
|
80
|
-
}
|
|
81
|
-
function O() {
|
|
82
|
-
return k() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
|
|
83
|
-
}
|
|
84
|
-
function R(e, t) {
|
|
85
|
-
let n = "";
|
|
86
|
-
for (; e > 0; e--)
|
|
87
|
-
n = P(t) + n;
|
|
88
|
-
return n;
|
|
89
|
-
}
|
|
90
|
-
function E(e, t) {
|
|
91
|
-
if (isNaN(e))
|
|
92
|
-
throw new c({
|
|
93
|
-
info: {
|
|
94
|
-
code: "ENC_TIME_NAN",
|
|
95
|
-
...a
|
|
96
|
-
}
|
|
97
|
-
}, `Time must be a number: ${e}`);
|
|
98
|
-
if (e > p)
|
|
99
|
-
throw new c({
|
|
100
|
-
info: {
|
|
101
|
-
code: "ENC_TIME_SIZE_EXCEED",
|
|
102
|
-
...a
|
|
103
|
-
}
|
|
104
|
-
}, `Cannot encode a time larger than ${p}: ${e}`);
|
|
105
|
-
if (e < 0)
|
|
106
|
-
throw new c({
|
|
107
|
-
info: {
|
|
108
|
-
code: "ENC_TIME_NEG",
|
|
109
|
-
...a
|
|
110
|
-
}
|
|
111
|
-
}, `Time must be positive: ${e}`);
|
|
112
|
-
if (Number.isInteger(e) === !1)
|
|
113
|
-
throw new c({
|
|
114
|
-
info: {
|
|
115
|
-
code: "ENC_TIME_TYPE",
|
|
116
|
-
...a
|
|
117
|
-
}
|
|
118
|
-
}, `Time must be an integer: ${e}`);
|
|
119
|
-
let n, r = "";
|
|
120
|
-
for (let o = t; o > 0; o--)
|
|
121
|
-
n = e % u, r = f.charAt(n) + r, e = (e - n) / u;
|
|
122
|
-
return r;
|
|
123
|
-
}
|
|
124
|
-
function M(e) {
|
|
125
|
-
let t, n = e.length, r, o, s = e;
|
|
126
|
-
const i = u - 1;
|
|
127
|
-
for (; !t && n-- >= 0; ) {
|
|
128
|
-
if (r = s[n], o = f.indexOf(r), o === -1)
|
|
129
|
-
throw new c({
|
|
130
|
-
info: {
|
|
131
|
-
code: "B32_INC_ENC",
|
|
132
|
-
...a
|
|
133
|
-
}
|
|
134
|
-
}, "Incorrectly encoded string");
|
|
135
|
-
if (o === i) {
|
|
136
|
-
s = g(s, n, f[0]);
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
t = g(s, n, f[o + 1]);
|
|
140
|
-
}
|
|
141
|
-
if (typeof t == "string")
|
|
142
|
-
return t;
|
|
143
|
-
throw new c({
|
|
144
|
-
info: {
|
|
145
|
-
code: "B32_INC_INVALID",
|
|
146
|
-
...a
|
|
147
|
-
}
|
|
148
|
-
}, "Failed incrementing string");
|
|
149
|
-
}
|
|
150
|
-
function k() {
|
|
151
|
-
return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
|
|
152
|
-
}
|
|
153
|
-
function x(e) {
|
|
154
|
-
const t = C();
|
|
155
|
-
let n = 0, r;
|
|
156
|
-
return function(s) {
|
|
157
|
-
const i = isNaN(s) ? Date.now() : s;
|
|
158
|
-
if (i <= n) {
|
|
159
|
-
const b = r = M(r);
|
|
160
|
-
return E(n, h) + b;
|
|
161
|
-
}
|
|
162
|
-
n = i;
|
|
163
|
-
const l = r = R(j, t);
|
|
164
|
-
return E(i, h) + l;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
function P(e) {
|
|
168
|
-
let t = Math.floor(e() * u);
|
|
169
|
-
return t === u && (t = u - 1), f.charAt(t);
|
|
170
|
-
}
|
|
171
|
-
function g(e, t, n) {
|
|
172
|
-
return t > e.length - 1 ? e : e.substr(0, t) + n + e.substr(t + 1);
|
|
173
|
-
}
|
|
174
|
-
const S = () => {
|
|
175
|
-
const e = /* @__PURE__ */ new Map();
|
|
176
|
-
return [(r) => new Promise((o) => {
|
|
177
|
-
e.set(r, o);
|
|
178
|
-
}), (r, o) => {
|
|
179
|
-
const s = e.get(r);
|
|
180
|
-
s && (s(o), e.delete(r));
|
|
181
|
-
}];
|
|
182
|
-
}, $ = x(), F = () => {
|
|
183
|
-
const e = new SharedWorker(new URL(
|
|
184
|
-
/* @vite-ignore */
|
|
185
|
-
"./assets/worker-BjPv-hjP.js",
|
|
186
|
-
import.meta.url
|
|
187
|
-
), {
|
|
188
|
-
type: "module"
|
|
189
|
-
});
|
|
190
|
-
e.onerror = (r) => {
|
|
191
|
-
console.error(r);
|
|
192
|
-
}, e.port.start();
|
|
193
|
-
const [t, n] = S();
|
|
194
|
-
return e.port.onmessage = (r) => {
|
|
195
|
-
n(r.data.id, r.data.body);
|
|
196
|
-
}, new y({
|
|
197
|
-
url: "/__z/graphql",
|
|
198
|
-
// Custom fetch to send the GraphQL request to the worker and convert the response back to a `Response` object
|
|
199
|
-
fetch: async (r, o) => {
|
|
200
|
-
if (!(o != null && o.body)) throw new Error("No body");
|
|
201
|
-
const s = $();
|
|
202
|
-
e.port.postMessage({
|
|
203
|
-
id: s,
|
|
204
|
-
body: o.body
|
|
205
|
-
});
|
|
206
|
-
const i = await t(s);
|
|
207
|
-
return new Response(i, {
|
|
208
|
-
headers: {
|
|
209
|
-
"Content-Type": "application/json"
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
exchanges: [
|
|
214
|
-
N,
|
|
215
|
-
w({
|
|
216
|
-
onError(r, o) {
|
|
217
|
-
var s;
|
|
218
|
-
console.error(r), console.groupCollapsed("Operation info"), console.log("body", (s = o.query.loc) == null ? void 0 : s.source.body.trim()), console.log("variables", o.variables), console.groupEnd();
|
|
219
|
-
}
|
|
220
|
-
}),
|
|
221
|
-
_
|
|
222
|
-
]
|
|
223
|
-
});
|
|
224
|
-
};
|
|
1
|
+
import { c as t } from "./createWorkerClient-TWecYOlx.js";
|
|
225
2
|
export {
|
|
226
|
-
|
|
3
|
+
t as createClient
|
|
227
4
|
};
|
|
228
5
|
//# sourceMappingURL=zudoku.openapi-worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.openapi-worker.js","sources":["../../../node_modules/.pnpm/layerr@2.1.0/node_modules/layerr/dist/error.js","../../../node_modules/.pnpm/layerr@2.1.0/node_modules/layerr/dist/tools.js","../../../node_modules/.pnpm/layerr@2.1.0/node_modules/layerr/dist/layerr.js","../../../node_modules/.pnpm/ulidx@2.3.0/node_modules/ulidx/dist/browser/index.js","../src/lib/util/createWaitForNotify.ts","../src/lib/plugins/openapi/client/createWorkerClient.ts"],"sourcesContent":["export function assertError(err) {\n if (!isError(err)) {\n throw new Error(\"Parameter was not an error\");\n }\n}\nexport function isError(err) {\n return objectToString(err) === \"[object Error]\" || err instanceof Error;\n}\nfunction objectToString(obj) {\n return Object.prototype.toString.call(obj);\n}\n","import { isError } from \"./error.js\";\nexport function parseArguments(args) {\n let options, shortMessage = \"\";\n if (args.length === 0) {\n options = {};\n }\n else if (isError(args[0])) {\n options = {\n cause: args[0]\n };\n shortMessage = args.slice(1).join(\" \") || \"\";\n }\n else if (args[0] && typeof args[0] === \"object\") {\n options = Object.assign({}, args[0]);\n shortMessage = args.slice(1).join(\" \") || \"\";\n }\n else if (typeof args[0] === \"string\") {\n options = {};\n shortMessage = shortMessage = args.join(\" \") || \"\";\n }\n else {\n throw new Error(\"Invalid arguments passed to Layerr\");\n }\n return {\n options,\n shortMessage\n };\n}\n","import { assertError, isError } from \"./error.js\";\nimport { parseArguments } from \"./tools.js\";\nexport class Layerr extends Error {\n constructor(errorOptionsOrMessage, messageText) {\n const args = [...arguments];\n const { options, shortMessage } = parseArguments(args);\n let message = shortMessage;\n if (options.cause) {\n message = `${message}: ${options.cause.message}`;\n }\n super(message);\n this.message = message;\n if (options.name && typeof options.name === \"string\") {\n this.name = options.name;\n }\n else {\n this.name = \"Layerr\";\n }\n if (options.cause) {\n Object.defineProperty(this, \"_cause\", { value: options.cause });\n }\n Object.defineProperty(this, \"_info\", { value: {} });\n if (options.info && typeof options.info === \"object\") {\n Object.assign(this._info, options.info);\n }\n if (Error.captureStackTrace) {\n const ctor = options.constructorOpt || this.constructor;\n Error.captureStackTrace(this, ctor);\n }\n }\n static cause(err) {\n assertError(err);\n if (!err._cause)\n return null;\n return isError(err._cause) ? err._cause : null;\n }\n static fullStack(err) {\n assertError(err);\n const cause = Layerr.cause(err);\n if (cause) {\n return `${err.stack}\\ncaused by: ${Layerr.fullStack(cause)}`;\n }\n return err.stack;\n }\n static info(err) {\n assertError(err);\n const output = {};\n const cause = Layerr.cause(err);\n if (cause) {\n Object.assign(output, Layerr.info(cause));\n }\n if (err._info) {\n Object.assign(output, err._info);\n }\n return output;\n }\n cause() {\n return Layerr.cause(this);\n }\n toString() {\n let output = this.name || this.constructor.name || this.constructor.prototype.name;\n if (this.message) {\n output = `${output}: ${this.message}`;\n }\n return output;\n }\n}\n","import { Layerr } from 'layerr';\n\nconst B32_CHARACTERS = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\";\nconst MAX_ULID = \"7ZZZZZZZZZZZZZZZZZZZZZZZZZ\";\nconst MIN_ULID = \"00000000000000000000000000\";\nconst ULID_REGEX = /^[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}$/;\nconst UUID_REGEX = /^[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/;\n\n// Code from https://github.com/devbanana/crockford-base32/blob/develop/src/index.ts\nfunction crockfordEncode(input) {\n const output = [];\n let bitsRead = 0;\n let buffer = 0;\n const reversedInput = new Uint8Array(input.slice().reverse());\n for (const byte of reversedInput) {\n buffer |= byte << bitsRead;\n bitsRead += 8;\n while (bitsRead >= 5) {\n output.unshift(buffer & 0x1f);\n buffer >>>= 5;\n bitsRead -= 5;\n }\n }\n if (bitsRead > 0) {\n output.unshift(buffer & 0x1f);\n }\n return output.map(byte => B32_CHARACTERS.charAt(byte)).join(\"\");\n}\nfunction crockfordDecode(input) {\n const sanitizedInput = input.toUpperCase().split(\"\").reverse().join(\"\");\n const output = [];\n let bitsRead = 0;\n let buffer = 0;\n for (const character of sanitizedInput) {\n const byte = B32_CHARACTERS.indexOf(character);\n if (byte === -1) {\n throw new Error(`Invalid base 32 character found in string: ${character}`);\n }\n buffer |= byte << bitsRead;\n bitsRead += 5;\n while (bitsRead >= 8) {\n output.unshift(buffer & 0xff);\n buffer >>>= 8;\n bitsRead -= 8;\n }\n }\n if (bitsRead >= 5 || buffer > 0) {\n output.unshift(buffer & 0xff);\n }\n return new Uint8Array(output);\n}\n\n// These values should NEVER change. The values are precisely for\n// generating ULIDs.\nconst ENCODING = \"0123456789ABCDEFGHJKMNPQRSTVWXYZ\"; // Crockford's Base32\nconst ENCODING_LEN = 32; // from ENCODING.length;\nconst TIME_MAX = 281474976710655; // from Math.pow(2, 48) - 1;\nconst TIME_LEN = 10;\nconst RANDOM_LEN = 16;\nconst ERROR_INFO = Object.freeze({\n source: \"ulid\"\n});\n/**\n * Decode time from a ULID\n * @param id The ULID\n * @returns The decoded timestamp\n */\nfunction decodeTime(id) {\n if (id.length !== TIME_LEN + RANDOM_LEN) {\n throw new Layerr({\n info: {\n code: \"DEC_TIME_MALFORMED\",\n ...ERROR_INFO\n }\n }, \"Malformed ULID\");\n }\n const time = id\n .substr(0, TIME_LEN)\n .toUpperCase()\n .split(\"\")\n .reverse()\n .reduce((carry, char, index) => {\n const encodingIndex = ENCODING.indexOf(char);\n if (encodingIndex === -1) {\n throw new Layerr({\n info: {\n code: \"DEC_TIME_CHAR\",\n ...ERROR_INFO\n }\n }, `Time decode error: Invalid character: ${char}`);\n }\n return (carry += encodingIndex * Math.pow(ENCODING_LEN, index));\n }, 0);\n if (time > TIME_MAX) {\n throw new Layerr({\n info: {\n code: \"DEC_TIME_CHAR\",\n ...ERROR_INFO\n }\n }, `Malformed ULID: timestamp too large: ${time}`);\n }\n return time;\n}\n/**\n * Detect the best PRNG (pseudo-random number generator)\n * @param root The root to check from (global/window)\n * @returns The PRNG function\n */\nfunction detectPRNG(root) {\n const rootLookup = root || detectRoot();\n const globalCrypto = (rootLookup && (rootLookup.crypto || rootLookup.msCrypto)) ||\n (null);\n if (typeof globalCrypto?.getRandomValues === \"function\") {\n return () => {\n const buffer = new Uint8Array(1);\n globalCrypto.getRandomValues(buffer);\n return buffer[0] / 0xff;\n };\n }\n else if (typeof globalCrypto?.randomBytes === \"function\") {\n return () => globalCrypto.randomBytes(1).readUInt8() / 0xff;\n }\n else ;\n throw new Layerr({\n info: {\n code: \"PRNG_DETECT\",\n ...ERROR_INFO\n }\n }, \"Failed to find a reliable PRNG\");\n}\nfunction detectRoot() {\n if (inWebWorker())\n return self;\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n return null;\n}\nfunction encodeRandom(len, prng) {\n let str = \"\";\n for (; len > 0; len--) {\n str = randomChar(prng) + str;\n }\n return str;\n}\n/**\n * Encode the time portion of a ULID\n * @param now The current timestamp\n * @param len Length to generate\n * @returns The encoded time\n */\nfunction encodeTime(now, len) {\n if (isNaN(now)) {\n throw new Layerr({\n info: {\n code: \"ENC_TIME_NAN\",\n ...ERROR_INFO\n }\n }, `Time must be a number: ${now}`);\n }\n else if (now > TIME_MAX) {\n throw new Layerr({\n info: {\n code: \"ENC_TIME_SIZE_EXCEED\",\n ...ERROR_INFO\n }\n }, `Cannot encode a time larger than ${TIME_MAX}: ${now}`);\n }\n else if (now < 0) {\n throw new Layerr({\n info: {\n code: \"ENC_TIME_NEG\",\n ...ERROR_INFO\n }\n }, `Time must be positive: ${now}`);\n }\n else if (Number.isInteger(now) === false) {\n throw new Layerr({\n info: {\n code: \"ENC_TIME_TYPE\",\n ...ERROR_INFO\n }\n }, `Time must be an integer: ${now}`);\n }\n let mod, str = \"\";\n for (let currentLen = len; currentLen > 0; currentLen--) {\n mod = now % ENCODING_LEN;\n str = ENCODING.charAt(mod) + str;\n now = (now - mod) / ENCODING_LEN;\n }\n return str;\n}\n/**\n * Fix a ULID's Base32 encoding -\n * i and l (case-insensitive) will be treated as 1 and o (case-insensitive) will be treated as 0.\n * hyphens are ignored during decoding.\n * @param id The ULID\n * @returns The cleaned up ULID\n */\nfunction fixULIDBase32(id) {\n return id.replace(/i/gi, \"1\").replace(/l/gi, \"1\").replace(/o/gi, \"0\").replace(/-/g, \"\");\n}\nfunction incrementBase32(str) {\n let done = undefined, index = str.length, char, charIndex, output = str;\n const maxCharIndex = ENCODING_LEN - 1;\n while (!done && index-- >= 0) {\n char = output[index];\n charIndex = ENCODING.indexOf(char);\n if (charIndex === -1) {\n throw new Layerr({\n info: {\n code: \"B32_INC_ENC\",\n ...ERROR_INFO\n }\n }, \"Incorrectly encoded string\");\n }\n if (charIndex === maxCharIndex) {\n output = replaceCharAt(output, index, ENCODING[0]);\n continue;\n }\n done = replaceCharAt(output, index, ENCODING[charIndex + 1]);\n }\n if (typeof done === \"string\") {\n return done;\n }\n throw new Layerr({\n info: {\n code: \"B32_INC_INVALID\",\n ...ERROR_INFO\n }\n }, \"Failed incrementing string\");\n}\nfunction inWebWorker() {\n // @ts-ignore\n return typeof WorkerGlobalScope !== \"undefined\" && self instanceof WorkerGlobalScope;\n}\n/**\n * Check if a ULID is valid\n * @param id The ULID to test\n * @returns True if valid, false otherwise\n * @example\n * isValid(\"01HNZX8JGFACFA36RBXDHEQN6E\"); // true\n * isValid(\"\"); // false\n */\nfunction isValid(id) {\n return (typeof id === \"string\" &&\n id.length === TIME_LEN + RANDOM_LEN &&\n id\n .toUpperCase()\n .split(\"\")\n .every(char => ENCODING.indexOf(char) !== -1));\n}\n/**\n * Create a ULID factory to generate monotonically-increasing\n * ULIDs\n * @param prng The PRNG to use\n * @returns A ulid factory\n * @example\n * const ulid = monotonicFactory();\n * ulid(); // \"01HNZXD07M5CEN5XA66EMZSRZW\"\n */\nfunction monotonicFactory(prng) {\n const currentPRNG = prng || detectPRNG();\n let lastTime = 0, lastRandom;\n return function _ulid(seedTime) {\n const seed = isNaN(seedTime) ? Date.now() : seedTime;\n if (seed <= lastTime) {\n const incrementedRandom = (lastRandom = incrementBase32(lastRandom));\n return encodeTime(lastTime, TIME_LEN) + incrementedRandom;\n }\n lastTime = seed;\n const newRandom = (lastRandom = encodeRandom(RANDOM_LEN, currentPRNG));\n return encodeTime(seed, TIME_LEN) + newRandom;\n };\n}\nfunction randomChar(prng) {\n let rand = Math.floor(prng() * ENCODING_LEN);\n if (rand === ENCODING_LEN) {\n rand = ENCODING_LEN - 1;\n }\n return ENCODING.charAt(rand);\n}\nfunction replaceCharAt(str, index, char) {\n if (index > str.length - 1) {\n return str;\n }\n return str.substr(0, index) + char + str.substr(index + 1);\n}\n/**\n * Generate a ULID\n * @param seedTime Optional time seed\n * @param prng Optional PRNG function\n * @returns A ULID string\n * @example\n * ulid(); // \"01HNZXD07M5CEN5XA66EMZSRZW\"\n */\nfunction ulid(seedTime, prng) {\n const currentPRNG = prng || detectPRNG();\n const seed = isNaN(seedTime) ? Date.now() : seedTime;\n return encodeTime(seed, TIME_LEN) + encodeRandom(RANDOM_LEN, currentPRNG);\n}\n/**\n * Convert a ULID to a UUID\n * @param ulid The ULID to convert\n * @returns A UUID string\n */\nfunction ulidToUUID(ulid) {\n const isValid = ULID_REGEX.test(ulid);\n if (!isValid) {\n throw new Layerr({ info: { code: \"INVALID_ULID\", ...ERROR_INFO } }, \"Invalid ULID\");\n }\n const uint8Array = crockfordDecode(ulid);\n let uuid = Array.from(uint8Array)\n .map(byte => byte.toString(16).padStart(2, \"0\"))\n .join(\"\");\n uuid =\n uuid.substring(0, 8) +\n \"-\" +\n uuid.substring(8, 12) +\n \"-\" +\n uuid.substring(12, 16) +\n \"-\" +\n uuid.substring(16, 20) +\n \"-\" +\n uuid.substring(20);\n return uuid;\n}\n/**\n * Convert a UUID to a ULID\n * @param uuid The UUID to convert\n * @returns A ULID string\n */\nfunction uuidToULID(uuid) {\n const isValid = UUID_REGEX.test(uuid);\n if (!isValid) {\n throw new Layerr({ info: { code: \"INVALID_UUID\", ...ERROR_INFO } }, \"Invalid UUID\");\n }\n const uint8Array = new Uint8Array(uuid\n .replace(/-/g, \"\")\n .match(/.{1,2}/g)\n .map(byte => parseInt(byte, 16)));\n return crockfordEncode(uint8Array);\n}\n\nexport { B32_CHARACTERS, MAX_ULID, MIN_ULID, ULID_REGEX, UUID_REGEX, decodeTime, detectPRNG, encodeTime, fixULIDBase32, isValid, monotonicFactory, ulid, ulidToUUID, uuidToULID };\n","export const createWaitForNotify = <T extends NonNullable<unknown>>() => {\n const resolveMap = new Map<string, (value: T | PromiseLike<T>) => void>();\n\n const waitFor = (id: string) =>\n new Promise<T>((resolve) => {\n resolveMap.set(id, resolve);\n });\n\n const notify = (id: string, data: T) => {\n const resolveFn = resolveMap.get(id);\n if (resolveFn) {\n resolveFn(data);\n resolveMap.delete(id);\n }\n };\n\n return [waitFor, notify] as const;\n};\n","/* eslint-disable no-console */\nimport { monotonicFactory } from \"ulidx\";\nimport { createWaitForNotify } from \"../../../util/createWaitForNotify.js\";\nimport {\n cacheExchange,\n Client,\n fetchExchange,\n mapExchange,\n} from \"../util/urql.js\";\nimport { CreateClientFunction } from \"./interfaces.js\";\n\nexport type WorkerGraphQLMessage = { id: string; body: string };\n\nconst ulid = monotonicFactory();\n\n/**\n * This loads the client from a worker and uses mess port to send requests\n * and responses between the main thread and the worker.\n */\nexport const createClient: CreateClientFunction = () => {\n // NOTE: This URL needs to be inline with the SharedWorker otherwse\n // vite build does not recognize the worker file as a module.\n const worker = new SharedWorker(new URL(\"./worker.ts\", import.meta.url), {\n type: \"module\",\n });\n\n worker.onerror = (e) => {\n console.error(e);\n };\n\n worker.port.start();\n\n const [waitFor, notify] = createWaitForNotify<string>();\n\n worker.port.onmessage = (e: MessageEvent<WorkerGraphQLMessage>) => {\n notify(e.data.id, e.data.body);\n };\n\n return new Client({\n url: \"/__z/graphql\",\n // Custom fetch to send the GraphQL request to the worker and convert the response back to a `Response` object\n fetch: async (_req, init) => {\n if (!init?.body) throw new Error(\"No body\");\n\n const id = ulid();\n worker.port.postMessage({\n id,\n body: init.body as string,\n } satisfies WorkerGraphQLMessage);\n\n const body = await waitFor(id);\n\n return new Response(body, {\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n },\n exchanges: [\n cacheExchange,\n mapExchange({\n onError(error, operation) {\n console.error(error);\n console.groupCollapsed(\"Operation info\");\n console.log(\"body\", operation.query.loc?.source.body.trim());\n console.log(\"variables\", operation.variables);\n console.groupEnd();\n },\n }),\n fetchExchange,\n ],\n });\n};\n"],"names":["assertError","err","isError","objectToString","obj","parseArguments","args","options","shortMessage","Layerr","errorOptionsOrMessage","messageText","message","ctor","cause","output","ENCODING","ENCODING_LEN","TIME_MAX","TIME_LEN","RANDOM_LEN","ERROR_INFO","detectPRNG","root","rootLookup","detectRoot","globalCrypto","buffer","inWebWorker","encodeRandom","len","prng","str","randomChar","encodeTime","now","mod","currentLen","incrementBase32","done","index","char","charIndex","maxCharIndex","replaceCharAt","monotonicFactory","currentPRNG","lastTime","lastRandom","seedTime","seed","incrementedRandom","newRandom","rand","createWaitForNotify","resolveMap","id","resolve","data","resolveFn","ulid","createClient","worker","e","waitFor","notify","Client","_req","init","body","cacheExchange","mapExchange","error","operation","_a","fetchExchange"],"mappings":";AAAO,SAASA,EAAYC,GAAK;AAC7B,MAAI,CAACC,EAAQD,CAAG;AACZ,UAAM,IAAI,MAAM,4BAA4B;AAEpD;AACO,SAASC,EAAQD,GAAK;AACzB,SAAOE,EAAeF,CAAG,MAAM,oBAAoBA,aAAe;AACtE;AACA,SAASE,EAAeC,GAAK;AACzB,SAAO,OAAO,UAAU,SAAS,KAAKA,CAAG;AAC7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AAE,KAAK,IAAI;AAAA,EAAA,GAGxB,IAAIG,EAAO;AAAA,IAChB,KAAK;AAAA;AAAA,IAEL,OAAO,OAAOC,GAAMC,MAAS;AAC3B,UAAI,EAACA,KAAA,QAAAA,EAAM,MAAY,OAAA,IAAI,MAAM,SAAS;AAE1C,YAAMZ,IAAKI;AACX,MAAAE,EAAO,KAAK,YAAY;AAAA,QACtB,IAAAN;AAAA,QACA,MAAMY,EAAK;AAAA,MAAA,CACmB;AAE1B,YAAAC,IAAO,MAAML,EAAQR,CAAE;AAEtB,aAAA,IAAI,SAASa,GAAM;AAAA,QACxB,SAAS;AAAA,UACP,gBAAgB;AAAA,QAClB;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,WAAW;AAAA,MACTC;AAAA,MACAC,EAAY;AAAA,QACV,QAAQC,GAAOC,GAAW;;AACxB,kBAAQ,MAAMD,CAAK,GACnB,QAAQ,eAAe,gBAAgB,GAC/B,QAAA,IAAI,SAAQE,IAAAD,EAAU,MAAM,QAAhB,gBAAAC,EAAqB,OAAO,KAAK,MAAM,GACnD,QAAA,IAAI,aAAaD,EAAU,SAAS,GAC5C,QAAQ,SAAS;AAAA,QACnB;AAAA,MAAA,CACD;AAAA,MACDE;AAAA,IACF;AAAA,EAAA,CACD;AACH;","x_google_ignoreList":[0,1,2,3]}
|
|
1
|
+
{"version":3,"file":"zudoku.openapi-worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as e,
|
|
2
|
-
import { R as v, u as b } from "./hook-
|
|
3
|
-
import { u as w, a as h, S as N, b as k, c as K, d as E, e as S, f as p, B as o } from "./Select-
|
|
4
|
-
import { c as l,
|
|
5
|
-
import {
|
|
1
|
+
import { j as e, c as g, O as j } from "./jsx-runtime-DLtUZ5Ve.js";
|
|
2
|
+
import { R as v, u as b } from "./hook-SM2dMVmI.js";
|
|
3
|
+
import { u as w, a as h, S as N, b as k, c as K, d as E, e as S, f as p, B as o } from "./Select-BQ9-3iTJ.js";
|
|
4
|
+
import { c as l, a as A, L as x } from "./Markdown-CGZJUYcj.js";
|
|
5
|
+
import { a as m, b as C, c as P } from "./DevPortalProvider-C-O1s7mm.js";
|
|
6
6
|
import * as R from "react";
|
|
7
7
|
import { useState as D } from "react";
|
|
8
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as s, N as x } from "./jsx-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { t as f, i as g } from "./util-
|
|
1
|
+
import { j as s, N as x } from "./jsx-runtime-DLtUZ5Ve.js";
|
|
2
|
+
import { u as d } from "./DevPortalProvider-C-O1s7mm.js";
|
|
3
|
+
import { t as f, i as g } from "./util-Cgie7wjb.js";
|
|
4
4
|
const h = (t, e) => {
|
|
5
5
|
const r = Object.entries(t).flatMap(
|
|
6
6
|
([n, m]) => {
|
|
@@ -10,7 +10,7 @@ const h = (t, e) => {
|
|
|
10
10
|
return {
|
|
11
11
|
path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : o,
|
|
12
12
|
lazy: async () => {
|
|
13
|
-
const { MdxPage: u } = await import("./MdxPage-
|
|
13
|
+
const { MdxPage: u } = await import("./MdxPage-BZLuBOqR.js"), { default: c, ...l } = await m();
|
|
14
14
|
return {
|
|
15
15
|
element: /* @__PURE__ */ s.jsx(
|
|
16
16
|
u,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import "./jsx-runtime-
|
|
2
|
-
import { o as
|
|
3
|
-
import "./
|
|
4
|
-
import "
|
|
5
|
-
import "./
|
|
6
|
-
import "./router-CcYTwKjf.js";
|
|
1
|
+
import "./jsx-runtime-DLtUZ5Ve.js";
|
|
2
|
+
import { o as e } from "./index-PvQa9XLl.js";
|
|
3
|
+
import "./createWorkerClient-TWecYOlx.js";
|
|
4
|
+
import "./Markdown-CGZJUYcj.js";
|
|
5
|
+
import "./router-BkOLuJlq.js";
|
|
7
6
|
export {
|
|
8
|
-
|
|
7
|
+
e as openApiPlugin
|
|
9
8
|
};
|
|
10
9
|
//# sourceMappingURL=zudoku.plugin-openapi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const i = (
|
|
3
|
-
getRoutes: () =>
|
|
4
|
-
path:
|
|
1
|
+
import { r as o } from "./router-BkOLuJlq.js";
|
|
2
|
+
const i = (r) => ({
|
|
3
|
+
getRoutes: () => r.redirects.map(({ from: e, to: t, replace: a }) => ({
|
|
4
|
+
path: e,
|
|
5
5
|
loader: () => o(t)
|
|
6
6
|
}))
|
|
7
7
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -62,12 +62,6 @@
|
|
|
62
62
|
},
|
|
63
63
|
"./app/*": {
|
|
64
64
|
"import": "./src/app/*"
|
|
65
|
-
},
|
|
66
|
-
"./server/entry": {
|
|
67
|
-
"import": "./dist/vite/ssr/entry.server.js"
|
|
68
|
-
},
|
|
69
|
-
"./server/manifest": {
|
|
70
|
-
"import": "./dist/vite/ssr/zudoku-manifest.js"
|
|
71
65
|
}
|
|
72
66
|
},
|
|
73
67
|
"dependencies": {
|
|
@@ -87,6 +81,7 @@
|
|
|
87
81
|
"@tailwindcss/typography": "0.5.13",
|
|
88
82
|
"@tanstack/react-query": "5.50.1",
|
|
89
83
|
"@vitejs/plugin-react": "4.3.1",
|
|
84
|
+
"@zudoku/react-helmet-async": "2.0.4",
|
|
90
85
|
"autoprefixer": "10.4.19",
|
|
91
86
|
"chokidar": "^3.6.0",
|
|
92
87
|
"class-variance-authority": "0.7.0",
|
|
@@ -108,7 +103,6 @@
|
|
|
108
103
|
"react": "18.3.1",
|
|
109
104
|
"react-dom": "18.3.1",
|
|
110
105
|
"react-error-boundary": "^4.0.13",
|
|
111
|
-
"react-helmet-async": "2.0.5",
|
|
112
106
|
"react-hook-form": "^7.52.1",
|
|
113
107
|
"react-markdown": "9.0.1",
|
|
114
108
|
"react-router-dom": "6.24.1",
|
|
@@ -123,8 +117,8 @@
|
|
|
123
117
|
"semver": "7.6.2",
|
|
124
118
|
"slugify": "1.6.6",
|
|
125
119
|
"strip-ansi": "7.1.0",
|
|
126
|
-
"tailwindcss": "3.4.4",
|
|
127
120
|
"tailwind-merge": "2.3.0",
|
|
121
|
+
"tailwindcss": "3.4.4",
|
|
128
122
|
"tiny-invariant": "1.3.3",
|
|
129
123
|
"ulidx": "^2.3.0",
|
|
130
124
|
"unist-util-visit": "5.0.0",
|
|
@@ -155,7 +149,6 @@
|
|
|
155
149
|
"oauth4webapi": "2.11.1",
|
|
156
150
|
"prism-react-renderer": "2.3.1",
|
|
157
151
|
"prismjs": "1.29.0",
|
|
158
|
-
"react-helmet-async": "2.0.5",
|
|
159
152
|
"react-markdown": "9.0.1",
|
|
160
153
|
"react-router-dom": "6.24.1",
|
|
161
154
|
"rollup-plugin-visualizer": "^5.12.0",
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -1,34 +1,18 @@
|
|
|
1
|
-
import { StrictMode } from "react";
|
|
2
1
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
3
|
-
import { HelmetProvider } from "react-helmet-async";
|
|
4
2
|
import {
|
|
5
3
|
createBrowserRouter,
|
|
6
4
|
matchRoutes,
|
|
7
|
-
RouterProvider,
|
|
8
5
|
type RouteObject,
|
|
9
6
|
} from "react-router-dom";
|
|
10
7
|
import "virtual:vite-zudoku-custom-css.css";
|
|
11
8
|
import config from "virtual:zudoku-config";
|
|
12
|
-
|
|
13
|
-
import "virtual:vite-zudoku-custom-css.css";
|
|
14
|
-
import { getRoutesByConfig } from "zudoku/internal";
|
|
9
|
+
import { Bootstrap } from "zudoku/components";
|
|
15
10
|
import "./main.css";
|
|
11
|
+
import { getRoutesByConfig } from "./main.js";
|
|
16
12
|
|
|
17
13
|
const routes = getRoutesByConfig(config);
|
|
18
14
|
const root = document.getElementById("root")!;
|
|
19
15
|
|
|
20
|
-
const RootReactElement = ({
|
|
21
|
-
router,
|
|
22
|
-
}: {
|
|
23
|
-
router: ReturnType<typeof createBrowserRouter>;
|
|
24
|
-
}) => (
|
|
25
|
-
<StrictMode>
|
|
26
|
-
<HelmetProvider>
|
|
27
|
-
<RouterProvider router={router} />
|
|
28
|
-
</HelmetProvider>
|
|
29
|
-
</StrictMode>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
16
|
if (root.childElementCount > 0) {
|
|
33
17
|
void hydrate(routes);
|
|
34
18
|
} else {
|
|
@@ -52,12 +36,12 @@ async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
|
52
36
|
|
|
53
37
|
function render(routes: RouteObject[]) {
|
|
54
38
|
const router = createBrowserRouter(routes);
|
|
55
|
-
createRoot(root).render(<
|
|
39
|
+
createRoot(root).render(<Bootstrap router={router} />);
|
|
56
40
|
}
|
|
57
41
|
|
|
58
42
|
async function hydrate(routes: RouteObject[]) {
|
|
59
43
|
await hydrateLazyRoutes(routes);
|
|
60
44
|
const router = createBrowserRouter(routes);
|
|
61
45
|
|
|
62
|
-
hydrateRoot(root, <
|
|
46
|
+
hydrateRoot(root, <Bootstrap router={router} />);
|
|
63
47
|
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { type HelmetData } from "@zudoku/react-helmet-async";
|
|
2
|
+
import type express from "express";
|
|
3
|
+
import logger from "loglevel";
|
|
4
|
+
import { Transform } from "node:stream";
|
|
5
|
+
import { renderToPipeableStream, renderToStaticMarkup } from "react-dom/server";
|
|
6
|
+
import { isRouteErrorResponse } from "react-router-dom";
|
|
7
|
+
import {
|
|
8
|
+
createStaticHandler,
|
|
9
|
+
createStaticRouter,
|
|
10
|
+
} from "react-router-dom/server.js";
|
|
11
|
+
import "virtual:vite-zudoku-custom-css.css";
|
|
12
|
+
import config from "virtual:zudoku-config";
|
|
13
|
+
import { BootstrapStatic, ServerError } from "zudoku/components";
|
|
14
|
+
import "./main.css";
|
|
15
|
+
import { getRoutesByConfig } from "./main.js";
|
|
16
|
+
|
|
17
|
+
export const render = async ({
|
|
18
|
+
template,
|
|
19
|
+
expressRequest,
|
|
20
|
+
fetchRequest,
|
|
21
|
+
response,
|
|
22
|
+
}: {
|
|
23
|
+
template: string;
|
|
24
|
+
expressRequest?: express.Request;
|
|
25
|
+
fetchRequest?: Request;
|
|
26
|
+
response: express.Response;
|
|
27
|
+
}) => {
|
|
28
|
+
const routes = getRoutesByConfig(config);
|
|
29
|
+
const { query, dataRoutes } = createStaticHandler(routes);
|
|
30
|
+
|
|
31
|
+
const request = expressRequest
|
|
32
|
+
? createFetchRequest(expressRequest, response)
|
|
33
|
+
: fetchRequest;
|
|
34
|
+
|
|
35
|
+
if (!request) {
|
|
36
|
+
throw new Error("Either fetchRequest or expressRequest must be provided");
|
|
37
|
+
}
|
|
38
|
+
const context = await query(request);
|
|
39
|
+
let status = 200;
|
|
40
|
+
|
|
41
|
+
if (context instanceof Response) {
|
|
42
|
+
if ([301, 302, 303, 307, 308].includes(context.status)) {
|
|
43
|
+
return response.redirect(
|
|
44
|
+
context.status,
|
|
45
|
+
context.headers.get("Location")!,
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
throw context;
|
|
50
|
+
} else if (context.errors) {
|
|
51
|
+
// when throwing a Response from a loader it will be caught here
|
|
52
|
+
// unfortunately it is not `instanceof Response` for some reason
|
|
53
|
+
const firstError = Object.values(context.errors).find(isRouteErrorResponse);
|
|
54
|
+
|
|
55
|
+
if (firstError?.status) {
|
|
56
|
+
status = firstError.status;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const router = createStaticRouter(dataRoutes, context);
|
|
61
|
+
const helmetContext = {} as HelmetData["context"];
|
|
62
|
+
|
|
63
|
+
const { pipe } = renderToPipeableStream(
|
|
64
|
+
<BootstrapStatic
|
|
65
|
+
router={router}
|
|
66
|
+
context={context}
|
|
67
|
+
helmetContext={helmetContext}
|
|
68
|
+
/>,
|
|
69
|
+
{
|
|
70
|
+
onShellError(error) {
|
|
71
|
+
response.status(500);
|
|
72
|
+
response.set({ "Content-Type": "text/html" });
|
|
73
|
+
|
|
74
|
+
const html = renderToStaticMarkup(<ServerError error={error} />);
|
|
75
|
+
|
|
76
|
+
response.send(html);
|
|
77
|
+
},
|
|
78
|
+
// for SSG we could use onAllReady instead of onShellReady
|
|
79
|
+
// https://react.dev/reference/react-dom/server/renderToPipeableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation
|
|
80
|
+
onShellReady() {
|
|
81
|
+
response.set({ "Content-Type": "text/html" });
|
|
82
|
+
response.status(status);
|
|
83
|
+
|
|
84
|
+
const transformStream = new Transform({
|
|
85
|
+
transform(chunk, encoding, callback) {
|
|
86
|
+
response.write(chunk, encoding);
|
|
87
|
+
callback();
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const [htmlStart, htmlEnd] = template.split("<!--app-html-->");
|
|
92
|
+
|
|
93
|
+
response.write(
|
|
94
|
+
htmlStart.replace(
|
|
95
|
+
"<!--app-helmet-->",
|
|
96
|
+
[
|
|
97
|
+
helmetContext.helmet.title.toString(),
|
|
98
|
+
helmetContext.helmet.meta.toString(),
|
|
99
|
+
helmetContext.helmet.link.toString(),
|
|
100
|
+
helmetContext.helmet.style.toString(),
|
|
101
|
+
helmetContext.helmet.script.toString(),
|
|
102
|
+
].join("\n"),
|
|
103
|
+
),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
transformStream.on("finish", () => {
|
|
107
|
+
response.end(htmlEnd);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
pipe(transformStream);
|
|
111
|
+
},
|
|
112
|
+
onError(error) {
|
|
113
|
+
status = 500;
|
|
114
|
+
logger.error(error);
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export function createFetchRequest(
|
|
121
|
+
req: express.Request,
|
|
122
|
+
res: express.Response,
|
|
123
|
+
): Request {
|
|
124
|
+
const origin = `${req.protocol}://${req.get("host")}`;
|
|
125
|
+
// Note: This had to take originalUrl into account for presumably vite's proxying
|
|
126
|
+
const url = new URL(req.originalUrl || req.url, origin);
|
|
127
|
+
|
|
128
|
+
const controller = new AbortController();
|
|
129
|
+
res.on("close", () => controller.abort());
|
|
130
|
+
|
|
131
|
+
const headers = new Headers();
|
|
132
|
+
|
|
133
|
+
for (const [key, values] of Object.entries(req.headers)) {
|
|
134
|
+
if (values) {
|
|
135
|
+
if (Array.isArray(values)) {
|
|
136
|
+
for (const value of values) {
|
|
137
|
+
headers.append(key, value);
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
headers.set(key, values);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const init: RequestInit = {
|
|
146
|
+
method: req.method,
|
|
147
|
+
headers,
|
|
148
|
+
signal: controller.signal,
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
152
|
+
init.body = req.body;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return new Request(url.href, init);
|
|
156
|
+
}
|
package/src/{lib → app}/main.tsx
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type RouteObject } from "react-router-dom";
|
|
2
|
+
import "virtual:vite-zudoku-custom-css.css";
|
|
2
3
|
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
3
4
|
import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
|
|
4
5
|
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
5
6
|
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
6
7
|
import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
|
|
8
|
+
import { DevPortal, Layout, RouterError } from "zudoku/components";
|
|
9
|
+
import { isNavigationPlugin } from "zudoku/internal";
|
|
7
10
|
import type { ZudokuConfig } from "../config/config.js";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import "virtual:vite-zudoku-custom-css.css";
|
|
11
|
-
import { DevPortal } from "./components/DevPortal.js";
|
|
12
|
-
import { Layout } from "./components/Layout.js";
|
|
13
|
-
import { RouterError } from "./errors/RouterError.js";
|
|
11
|
+
import type { ZudokuContextOptions } from "../lib/core/DevPortalContext.js";
|
|
14
12
|
|
|
15
|
-
export const convertZudokuConfigToOptions = (
|
|
13
|
+
export const convertZudokuConfigToOptions = (
|
|
14
|
+
config: ZudokuConfig,
|
|
15
|
+
): ZudokuContextOptions => {
|
|
16
16
|
return {
|
|
17
17
|
page: {
|
|
18
18
|
logo: config.page?.logo ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
@@ -24,6 +24,7 @@ export const convertZudokuConfigToOptions = (config: ZudokuConfig) => {
|
|
|
24
24
|
title: "%s | Developer Portal",
|
|
25
25
|
...config.metadata,
|
|
26
26
|
},
|
|
27
|
+
mdxComponents: config.mdx?.components,
|
|
27
28
|
navigation: config.navigation ?? [],
|
|
28
29
|
authentication: configuredAuthProvider,
|
|
29
30
|
plugins: [
|
|
@@ -40,7 +41,7 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
40
41
|
const options = convertZudokuConfigToOptions(config);
|
|
41
42
|
|
|
42
43
|
const allPlugins = [
|
|
43
|
-
...options.plugins,
|
|
44
|
+
...(options.plugins ? options.plugins : []),
|
|
44
45
|
...(options.authentication ? [options.authentication] : []),
|
|
45
46
|
];
|
|
46
47
|
|