@screenbook/ui 0.0.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.
Files changed (101) hide show
  1. package/.astro/content-assets.mjs +1 -0
  2. package/.astro/content-modules.mjs +1 -0
  3. package/.astro/content.d.ts +199 -0
  4. package/.astro/data-store.json +1 -0
  5. package/.astro/settings.json +5 -0
  6. package/.astro/types.d.ts +2 -0
  7. package/.prettierrc +15 -0
  8. package/.screenbook/coverage.json +37 -0
  9. package/.screenbook/screens.json +90 -0
  10. package/LICENSE +21 -0
  11. package/astro.config.mjs +18 -0
  12. package/dist/client/_astro/_baseUniq.BGai4mcc.js +1 -0
  13. package/dist/client/_astro/arc.DUp0dfXj.js +1 -0
  14. package/dist/client/_astro/architectureDiagram-VXUJARFQ.De_Gt-YC.js +36 -0
  15. package/dist/client/_astro/blockDiagram-VD42YOAC.BBt_VNhR.js +122 -0
  16. package/dist/client/_astro/c4Diagram-YG6GDRKO.DfgUlHvt.js +10 -0
  17. package/dist/client/_astro/channel.CNyr52v1.js +1 -0
  18. package/dist/client/_astro/chunk-4BX2VUAB.BL0ar6du.js +1 -0
  19. package/dist/client/_astro/chunk-55IACEB6.CI6SkZkY.js +1 -0
  20. package/dist/client/_astro/chunk-B4BG7PRW.Z25N80K6.js +165 -0
  21. package/dist/client/_astro/chunk-DI55MBZ5.BqjPVmi1.js +220 -0
  22. package/dist/client/_astro/chunk-FMBD7UC4.bZ9DWnFm.js +15 -0
  23. package/dist/client/_astro/chunk-QN33PNHL.BkzuUgWB.js +1 -0
  24. package/dist/client/_astro/chunk-QZHKN3VN.C__d68N_.js +1 -0
  25. package/dist/client/_astro/chunk-TZMSLE5B.BIpu8bMn.js +1 -0
  26. package/dist/client/_astro/classDiagram-2ON5EDUG.CxT3aW-h.js +1 -0
  27. package/dist/client/_astro/classDiagram-v2-WZHVMYZB.CxT3aW-h.js +1 -0
  28. package/dist/client/_astro/clone.U_lSZ6fe.js +1 -0
  29. package/dist/client/_astro/cose-bilkent-S5V4N54A.D48yfMll.js +1 -0
  30. package/dist/client/_astro/coverage.CKIVg4LY.css +1 -0
  31. package/dist/client/_astro/coverage.DDJMzKCq.css +1 -0
  32. package/dist/client/_astro/cytoscape.esm.DtBltrT8.js +331 -0
  33. package/dist/client/_astro/dagre-6UL2VRFP.LKVH7b30.js +4 -0
  34. package/dist/client/_astro/defaultLocale.C4B-KCzX.js +1 -0
  35. package/dist/client/_astro/diagram-PSM6KHXK.AHgUjH56.js +24 -0
  36. package/dist/client/_astro/diagram-QEK2KX5R.DvS33xWZ.js +43 -0
  37. package/dist/client/_astro/diagram-S2PKOQOG.BWisaYrQ.js +24 -0
  38. package/dist/client/_astro/erDiagram-Q2GNP2WA.B7oID6oT.js +60 -0
  39. package/dist/client/_astro/flowDiagram-NV44I4VS.Bb1qJLxr.js +162 -0
  40. package/dist/client/_astro/ganttDiagram-JELNMOA3.3vGHETyo.js +267 -0
  41. package/dist/client/_astro/gitGraphDiagram-NY62KEGX.Co2SKcif.js +65 -0
  42. package/dist/client/_astro/graph.B5fevUwB.js +1 -0
  43. package/dist/client/_astro/graph.astro_astro_type_script_index_0_lang.1HlATQ1g.js +1 -0
  44. package/dist/client/_astro/impact.Cvhl64u1.css +1 -0
  45. package/dist/client/_astro/impact.astro_astro_type_script_index_0_lang.D4cAR9AL.js +6 -0
  46. package/dist/client/_astro/infoDiagram-WHAUD3N6.B6ULtps1.js +2 -0
  47. package/dist/client/_astro/init.Gi6I4Gst.js +1 -0
  48. package/dist/client/_astro/journeyDiagram-XKPGCS4Q.BSOCzWmw.js +139 -0
  49. package/dist/client/_astro/kanban-definition-3W4ZIXB7.D8KKGc1o.js +89 -0
  50. package/dist/client/_astro/katex.XbL3y5x-.js +261 -0
  51. package/dist/client/_astro/layout.8vv24qEg.js +1 -0
  52. package/dist/client/_astro/linear.B6O9ymuK.js +1 -0
  53. package/dist/client/_astro/mermaid.core.CReXU7YN.js +256 -0
  54. package/dist/client/_astro/min.CdGMGVU0.js +1 -0
  55. package/dist/client/_astro/mindmap-definition-VGOIOE7T.G14HgtDw.js +68 -0
  56. package/dist/client/_astro/ordinal.BYWQX77i.js +1 -0
  57. package/dist/client/_astro/pieDiagram-ADFJNKIX.bC2VkyoW.js +30 -0
  58. package/dist/client/_astro/quadrantDiagram-AYHSOK5B.BlLaQQxO.js +7 -0
  59. package/dist/client/_astro/requirementDiagram-UZGBJVZJ.DHRnMofO.js +64 -0
  60. package/dist/client/_astro/sankeyDiagram-TZEHDZUN.BMuaJBmt.js +10 -0
  61. package/dist/client/_astro/sequenceDiagram-WL72ISMW.CnU62wqy.js +145 -0
  62. package/dist/client/_astro/stateDiagram-FKZM4ZOC.CewI55YO.js +1 -0
  63. package/dist/client/_astro/stateDiagram-v2-4FDKWEC3.7xUQqoNr.js +1 -0
  64. package/dist/client/_astro/timeline-definition-IT6M3QCI.D1PLRwss.js +61 -0
  65. package/dist/client/_astro/treemap-KMMF4GRG.D3VNVvXF.js +128 -0
  66. package/dist/client/_astro/xychartDiagram-PRI3JC2R.CQex0-ul.js +7 -0
  67. package/dist/client/logo.svg +5 -0
  68. package/dist/server/_@astrojs-ssr-adapter.mjs +1 -0
  69. package/dist/server/_noop-middleware.mjs +3 -0
  70. package/dist/server/chunks/_@astrojs-ssr-adapter_DgsYudHz.mjs +4385 -0
  71. package/dist/server/chunks/astro/server_m7yT4wCr.mjs +2787 -0
  72. package/dist/server/chunks/astro-designed-error-pages_BvPhMmw0.mjs +364 -0
  73. package/dist/server/chunks/fs-lite_COtHaKzy.mjs +157 -0
  74. package/dist/server/chunks/impactAnalysis_Bz5lMdmy.mjs +188 -0
  75. package/dist/server/chunks/loadScreens_DJf-tycc.mjs +39 -0
  76. package/dist/server/chunks/node_DoTkMCOi.mjs +1673 -0
  77. package/dist/server/chunks/remote_B3W5fv4r.mjs +188 -0
  78. package/dist/server/chunks/sharp_DHNfMLYY.mjs +99 -0
  79. package/dist/server/entry.mjs +47 -0
  80. package/dist/server/manifest_-V1HEnR8.mjs +101 -0
  81. package/dist/server/noop-entrypoint.mjs +3 -0
  82. package/dist/server/pages/_image.astro.mjs +2 -0
  83. package/dist/server/pages/coverage.astro.mjs +65 -0
  84. package/dist/server/pages/graph.astro.mjs +107 -0
  85. package/dist/server/pages/impact.astro.mjs +52 -0
  86. package/dist/server/pages/index.astro.mjs +28 -0
  87. package/dist/server/pages/screen/_id_.astro.mjs +52 -0
  88. package/dist/server/renderers.mjs +3 -0
  89. package/package.json +42 -0
  90. package/public/logo.svg +5 -0
  91. package/src/layouts/Layout.astro +60 -0
  92. package/src/pages/coverage.astro +399 -0
  93. package/src/pages/graph.astro +330 -0
  94. package/src/pages/impact.astro +459 -0
  95. package/src/pages/index.astro +167 -0
  96. package/src/pages/screen/[id].astro +186 -0
  97. package/src/styles/global.css +862 -0
  98. package/src/utils/impactAnalysis.ts +297 -0
  99. package/src/utils/loadCoverage.ts +30 -0
  100. package/src/utils/loadScreens.ts +18 -0
  101. package/tsconfig.json +9 -0
@@ -0,0 +1,364 @@
1
+ import { al as NOOP_MIDDLEWARE_HEADER, am as REDIRECT_STATUS_CODES, A as AstroError, an as ActionsReturnedInvalidDataError, V as DEFAULT_404_COMPONENT } from './astro/server_m7yT4wCr.mjs';
2
+ import { parse, stringify } from 'devalue';
3
+ import { escape } from 'html-escaper';
4
+
5
+ const NOOP_MIDDLEWARE_FN = async (_ctx, next) => {
6
+ const response = await next();
7
+ response.headers.set(NOOP_MIDDLEWARE_HEADER, "true");
8
+ return response;
9
+ };
10
+
11
+ const ACTION_QUERY_PARAMS$1 = {
12
+ actionName: "_action"};
13
+ const ACTION_RPC_ROUTE_PATTERN = "/_actions/[...path]";
14
+
15
+ const __vite_import_meta_env__ = {"ASSETS_PREFIX": undefined, "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SITE": undefined, "SSR": true};
16
+ const ACTION_QUERY_PARAMS = ACTION_QUERY_PARAMS$1;
17
+ const codeToStatusMap = {
18
+ // Implemented from IANA HTTP Status Code Registry
19
+ // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
20
+ BAD_REQUEST: 400,
21
+ UNAUTHORIZED: 401,
22
+ PAYMENT_REQUIRED: 402,
23
+ FORBIDDEN: 403,
24
+ NOT_FOUND: 404,
25
+ METHOD_NOT_ALLOWED: 405,
26
+ NOT_ACCEPTABLE: 406,
27
+ PROXY_AUTHENTICATION_REQUIRED: 407,
28
+ REQUEST_TIMEOUT: 408,
29
+ CONFLICT: 409,
30
+ GONE: 410,
31
+ LENGTH_REQUIRED: 411,
32
+ PRECONDITION_FAILED: 412,
33
+ CONTENT_TOO_LARGE: 413,
34
+ URI_TOO_LONG: 414,
35
+ UNSUPPORTED_MEDIA_TYPE: 415,
36
+ RANGE_NOT_SATISFIABLE: 416,
37
+ EXPECTATION_FAILED: 417,
38
+ MISDIRECTED_REQUEST: 421,
39
+ UNPROCESSABLE_CONTENT: 422,
40
+ LOCKED: 423,
41
+ FAILED_DEPENDENCY: 424,
42
+ TOO_EARLY: 425,
43
+ UPGRADE_REQUIRED: 426,
44
+ PRECONDITION_REQUIRED: 428,
45
+ TOO_MANY_REQUESTS: 429,
46
+ REQUEST_HEADER_FIELDS_TOO_LARGE: 431,
47
+ UNAVAILABLE_FOR_LEGAL_REASONS: 451,
48
+ INTERNAL_SERVER_ERROR: 500,
49
+ NOT_IMPLEMENTED: 501,
50
+ BAD_GATEWAY: 502,
51
+ SERVICE_UNAVAILABLE: 503,
52
+ GATEWAY_TIMEOUT: 504,
53
+ HTTP_VERSION_NOT_SUPPORTED: 505,
54
+ VARIANT_ALSO_NEGOTIATES: 506,
55
+ INSUFFICIENT_STORAGE: 507,
56
+ LOOP_DETECTED: 508,
57
+ NETWORK_AUTHENTICATION_REQUIRED: 511
58
+ };
59
+ const statusToCodeMap = Object.entries(codeToStatusMap).reduce(
60
+ // reverse the key-value pairs
61
+ (acc, [key, value]) => ({ ...acc, [value]: key }),
62
+ {}
63
+ );
64
+ class ActionError extends Error {
65
+ type = "AstroActionError";
66
+ code = "INTERNAL_SERVER_ERROR";
67
+ status = 500;
68
+ constructor(params) {
69
+ super(params.message);
70
+ this.code = params.code;
71
+ this.status = ActionError.codeToStatus(params.code);
72
+ if (params.stack) {
73
+ this.stack = params.stack;
74
+ }
75
+ }
76
+ static codeToStatus(code) {
77
+ return codeToStatusMap[code];
78
+ }
79
+ static statusToCode(status) {
80
+ return statusToCodeMap[status] ?? "INTERNAL_SERVER_ERROR";
81
+ }
82
+ static fromJson(body) {
83
+ if (isInputError(body)) {
84
+ return new ActionInputError(body.issues);
85
+ }
86
+ if (isActionError(body)) {
87
+ return new ActionError(body);
88
+ }
89
+ return new ActionError({
90
+ code: "INTERNAL_SERVER_ERROR"
91
+ });
92
+ }
93
+ }
94
+ function isActionError(error) {
95
+ return typeof error === "object" && error != null && "type" in error && error.type === "AstroActionError";
96
+ }
97
+ function isInputError(error) {
98
+ return typeof error === "object" && error != null && "type" in error && error.type === "AstroActionInputError" && "issues" in error && Array.isArray(error.issues);
99
+ }
100
+ class ActionInputError extends ActionError {
101
+ type = "AstroActionInputError";
102
+ // We don't expose all ZodError properties.
103
+ // Not all properties will serialize from server to client,
104
+ // and we don't want to import the full ZodError object into the client.
105
+ issues;
106
+ fields;
107
+ constructor(issues) {
108
+ super({
109
+ message: `Failed to validate: ${JSON.stringify(issues, null, 2)}`,
110
+ code: "BAD_REQUEST"
111
+ });
112
+ this.issues = issues;
113
+ this.fields = {};
114
+ for (const issue of issues) {
115
+ if (issue.path.length > 0) {
116
+ const key = issue.path[0].toString();
117
+ this.fields[key] ??= [];
118
+ this.fields[key]?.push(issue.message);
119
+ }
120
+ }
121
+ }
122
+ }
123
+ function getActionQueryString(name) {
124
+ const searchParams = new URLSearchParams({ [ACTION_QUERY_PARAMS$1.actionName]: name });
125
+ return `?${searchParams.toString()}`;
126
+ }
127
+ function serializeActionResult(res) {
128
+ if (res.error) {
129
+ if (Object.assign(__vite_import_meta_env__, {})?.DEV) {
130
+ actionResultErrorStack.set(res.error.stack);
131
+ }
132
+ let body2;
133
+ if (res.error instanceof ActionInputError) {
134
+ body2 = {
135
+ type: res.error.type,
136
+ issues: res.error.issues,
137
+ fields: res.error.fields
138
+ };
139
+ } else {
140
+ body2 = {
141
+ ...res.error,
142
+ message: res.error.message
143
+ };
144
+ }
145
+ return {
146
+ type: "error",
147
+ status: res.error.status,
148
+ contentType: "application/json",
149
+ body: JSON.stringify(body2)
150
+ };
151
+ }
152
+ if (res.data === void 0) {
153
+ return {
154
+ type: "empty",
155
+ status: 204
156
+ };
157
+ }
158
+ let body;
159
+ try {
160
+ body = stringify(res.data, {
161
+ // Add support for URL objects
162
+ URL: (value) => value instanceof URL && value.href
163
+ });
164
+ } catch (e) {
165
+ let hint = ActionsReturnedInvalidDataError.hint;
166
+ if (res.data instanceof Response) {
167
+ hint = REDIRECT_STATUS_CODES.includes(res.data.status) ? "If you need to redirect when the action succeeds, trigger a redirect where the action is called. See the Actions guide for server and client redirect examples: https://docs.astro.build/en/guides/actions." : "If you need to return a Response object, try using a server endpoint instead. See https://docs.astro.build/en/guides/endpoints/#server-endpoints-api-routes";
168
+ }
169
+ throw new AstroError({
170
+ ...ActionsReturnedInvalidDataError,
171
+ message: ActionsReturnedInvalidDataError.message(String(e)),
172
+ hint
173
+ });
174
+ }
175
+ return {
176
+ type: "data",
177
+ status: 200,
178
+ contentType: "application/json+devalue",
179
+ body
180
+ };
181
+ }
182
+ function deserializeActionResult(res) {
183
+ if (res.type === "error") {
184
+ let json;
185
+ try {
186
+ json = JSON.parse(res.body);
187
+ } catch {
188
+ return {
189
+ data: void 0,
190
+ error: new ActionError({
191
+ message: res.body,
192
+ code: "INTERNAL_SERVER_ERROR"
193
+ })
194
+ };
195
+ }
196
+ if (Object.assign(__vite_import_meta_env__, {})?.PROD) {
197
+ return { error: ActionError.fromJson(json), data: void 0 };
198
+ } else {
199
+ const error = ActionError.fromJson(json);
200
+ error.stack = actionResultErrorStack.get();
201
+ return {
202
+ error,
203
+ data: void 0
204
+ };
205
+ }
206
+ }
207
+ if (res.type === "empty") {
208
+ return { data: void 0, error: void 0 };
209
+ }
210
+ return {
211
+ data: parse(res.body, {
212
+ URL: (href) => new URL(href)
213
+ }),
214
+ error: void 0
215
+ };
216
+ }
217
+ const actionResultErrorStack = /* @__PURE__ */ (function actionResultErrorStackFn() {
218
+ let errorStack;
219
+ return {
220
+ set(stack) {
221
+ errorStack = stack;
222
+ },
223
+ get() {
224
+ return errorStack;
225
+ }
226
+ };
227
+ })();
228
+
229
+ function template({
230
+ title,
231
+ pathname,
232
+ statusCode = 404,
233
+ tabTitle,
234
+ body
235
+ }) {
236
+ return `<!doctype html>
237
+ <html lang="en">
238
+ <head>
239
+ <meta charset="UTF-8">
240
+ <title>${tabTitle}</title>
241
+ <style>
242
+ :root {
243
+ --gray-10: hsl(258, 7%, 10%);
244
+ --gray-20: hsl(258, 7%, 20%);
245
+ --gray-30: hsl(258, 7%, 30%);
246
+ --gray-40: hsl(258, 7%, 40%);
247
+ --gray-50: hsl(258, 7%, 50%);
248
+ --gray-60: hsl(258, 7%, 60%);
249
+ --gray-70: hsl(258, 7%, 70%);
250
+ --gray-80: hsl(258, 7%, 80%);
251
+ --gray-90: hsl(258, 7%, 90%);
252
+ --black: #13151A;
253
+ --accent-light: #E0CCFA;
254
+ }
255
+
256
+ * {
257
+ box-sizing: border-box;
258
+ }
259
+
260
+ html {
261
+ background: var(--black);
262
+ color-scheme: dark;
263
+ accent-color: var(--accent-light);
264
+ }
265
+
266
+ body {
267
+ background-color: var(--gray-10);
268
+ color: var(--gray-80);
269
+ font-family: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
270
+ line-height: 1.5;
271
+ margin: 0;
272
+ }
273
+
274
+ a {
275
+ color: var(--accent-light);
276
+ }
277
+
278
+ .center {
279
+ display: flex;
280
+ flex-direction: column;
281
+ justify-content: center;
282
+ align-items: center;
283
+ height: 100vh;
284
+ width: 100vw;
285
+ }
286
+
287
+ h1 {
288
+ margin-bottom: 8px;
289
+ color: white;
290
+ font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
291
+ font-weight: 700;
292
+ margin-top: 1rem;
293
+ margin-bottom: 0;
294
+ }
295
+
296
+ .statusCode {
297
+ color: var(--accent-light);
298
+ }
299
+
300
+ .astro-icon {
301
+ height: 124px;
302
+ width: 124px;
303
+ }
304
+
305
+ pre, code {
306
+ padding: 2px 8px;
307
+ background: rgba(0,0,0, 0.25);
308
+ border: 1px solid rgba(255,255,255, 0.25);
309
+ border-radius: 4px;
310
+ font-size: 1.2em;
311
+ margin-top: 0;
312
+ max-width: 60em;
313
+ }
314
+ </style>
315
+ </head>
316
+ <body>
317
+ <main class="center">
318
+ <svg class="astro-icon" xmlns="http://www.w3.org/2000/svg" width="64" height="80" viewBox="0 0 64 80" fill="none"> <path d="M20.5253 67.6322C16.9291 64.3531 15.8793 57.4632 17.3776 52.4717C19.9755 55.6188 23.575 56.6157 27.3035 57.1784C33.0594 58.0468 38.7122 57.722 44.0592 55.0977C44.6709 54.7972 45.2362 54.3978 45.9045 53.9931C46.4062 55.4451 46.5368 56.9109 46.3616 58.4028C45.9355 62.0362 44.1228 64.8429 41.2397 66.9705C40.0868 67.8215 38.8669 68.5822 37.6762 69.3846C34.0181 71.8508 33.0285 74.7426 34.403 78.9491C34.4357 79.0516 34.4649 79.1541 34.5388 79.4042C32.6711 78.5705 31.3069 77.3565 30.2674 75.7604C29.1694 74.0757 28.6471 72.2121 28.6196 70.1957C28.6059 69.2144 28.6059 68.2244 28.4736 67.257C28.1506 64.8985 27.0406 63.8425 24.9496 63.7817C22.8036 63.7192 21.106 65.0426 20.6559 67.1268C20.6215 67.2865 20.5717 67.4446 20.5218 67.6304L20.5253 67.6322Z" fill="white"/> <path d="M20.5253 67.6322C16.9291 64.3531 15.8793 57.4632 17.3776 52.4717C19.9755 55.6188 23.575 56.6157 27.3035 57.1784C33.0594 58.0468 38.7122 57.722 44.0592 55.0977C44.6709 54.7972 45.2362 54.3978 45.9045 53.9931C46.4062 55.4451 46.5368 56.9109 46.3616 58.4028C45.9355 62.0362 44.1228 64.8429 41.2397 66.9705C40.0868 67.8215 38.8669 68.5822 37.6762 69.3846C34.0181 71.8508 33.0285 74.7426 34.403 78.9491C34.4357 79.0516 34.4649 79.1541 34.5388 79.4042C32.6711 78.5705 31.3069 77.3565 30.2674 75.7604C29.1694 74.0757 28.6471 72.2121 28.6196 70.1957C28.6059 69.2144 28.6059 68.2244 28.4736 67.257C28.1506 64.8985 27.0406 63.8425 24.9496 63.7817C22.8036 63.7192 21.106 65.0426 20.6559 67.1268C20.6215 67.2865 20.5717 67.4446 20.5218 67.6304L20.5253 67.6322Z" fill="url(#paint0_linear_738_686)"/> <path d="M0 51.6401C0 51.6401 10.6488 46.4654 21.3274 46.4654L29.3786 21.6102C29.6801 20.4082 30.5602 19.5913 31.5538 19.5913C32.5474 19.5913 33.4275 20.4082 33.7289 21.6102L41.7802 46.4654C54.4274 46.4654 63.1076 51.6401 63.1076 51.6401C63.1076 51.6401 45.0197 2.48776 44.9843 2.38914C44.4652 0.935933 43.5888 0 42.4073 0H20.7022C19.5206 0 18.6796 0.935933 18.1251 2.38914C18.086 2.4859 0 51.6401 0 51.6401Z" fill="white"/> <defs> <linearGradient id="paint0_linear_738_686" x1="31.554" y1="75.4423" x2="39.7462" y2="48.376" gradientUnits="userSpaceOnUse"> <stop stop-color="#D83333"/> <stop offset="1" stop-color="#F041FF"/> </linearGradient> </defs> </svg>
319
+ <h1>${statusCode ? `<span class="statusCode">${statusCode}: </span> ` : ""}<span class="statusMessage">${title}</span></h1>
320
+ ${body || `
321
+ <pre>Path: ${escape(pathname)}</pre>
322
+ `}
323
+ </main>
324
+ </body>
325
+ </html>`;
326
+ }
327
+
328
+ const DEFAULT_404_ROUTE = {
329
+ component: DEFAULT_404_COMPONENT,
330
+ generate: () => "",
331
+ params: [],
332
+ pattern: /^\/404\/?$/,
333
+ prerender: false,
334
+ pathname: "/404",
335
+ segments: [[{ content: "404", dynamic: false, spread: false }]],
336
+ type: "page",
337
+ route: "/404",
338
+ fallbackRoutes: [],
339
+ isIndex: false,
340
+ origin: "internal"
341
+ };
342
+ function ensure404Route(manifest) {
343
+ if (!manifest.routes.some((route) => route.route === "/404")) {
344
+ manifest.routes.push(DEFAULT_404_ROUTE);
345
+ }
346
+ return manifest;
347
+ }
348
+ async function default404Page({ pathname }) {
349
+ return new Response(
350
+ template({
351
+ statusCode: 404,
352
+ title: "Not found",
353
+ tabTitle: "404: Not Found",
354
+ pathname
355
+ }),
356
+ { status: 404, headers: { "Content-Type": "text/html" } }
357
+ );
358
+ }
359
+ default404Page.isAstroComponentFactory = true;
360
+ const default404Instance = {
361
+ default: default404Page
362
+ };
363
+
364
+ export { ActionError as A, DEFAULT_404_ROUTE as D, NOOP_MIDDLEWARE_FN as N, ACTION_RPC_ROUTE_PATTERN as a, ACTION_QUERY_PARAMS as b, default404Instance as c, deserializeActionResult as d, ensure404Route as e, getActionQueryString as g, serializeActionResult as s };
@@ -0,0 +1,157 @@
1
+ import { promises, existsSync } from 'node:fs';
2
+ import { resolve, dirname, join } from 'node:path';
3
+
4
+ function defineDriver(factory) {
5
+ return factory;
6
+ }
7
+ function createError(driver, message, opts) {
8
+ const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
9
+ if (Error.captureStackTrace) {
10
+ Error.captureStackTrace(err, createError);
11
+ }
12
+ return err;
13
+ }
14
+ function createRequiredError(driver, name) {
15
+ if (Array.isArray(name)) {
16
+ return createError(
17
+ driver,
18
+ `Missing some of the required options ${name.map((n) => "`" + n + "`").join(", ")}`
19
+ );
20
+ }
21
+ return createError(driver, `Missing required option \`${name}\`.`);
22
+ }
23
+
24
+ function ignoreNotfound(err) {
25
+ return err.code === "ENOENT" || err.code === "EISDIR" ? null : err;
26
+ }
27
+ function ignoreExists(err) {
28
+ return err.code === "EEXIST" ? null : err;
29
+ }
30
+ async function writeFile(path, data, encoding) {
31
+ await ensuredir(dirname(path));
32
+ return promises.writeFile(path, data, encoding);
33
+ }
34
+ function readFile(path, encoding) {
35
+ return promises.readFile(path, encoding).catch(ignoreNotfound);
36
+ }
37
+ function unlink(path) {
38
+ return promises.unlink(path).catch(ignoreNotfound);
39
+ }
40
+ function readdir(dir) {
41
+ return promises.readdir(dir, { withFileTypes: true }).catch(ignoreNotfound).then((r) => r || []);
42
+ }
43
+ async function ensuredir(dir) {
44
+ if (existsSync(dir)) {
45
+ return;
46
+ }
47
+ await ensuredir(dirname(dir)).catch(ignoreExists);
48
+ await promises.mkdir(dir).catch(ignoreExists);
49
+ }
50
+ async function readdirRecursive(dir, ignore, maxDepth) {
51
+ if (ignore && ignore(dir)) {
52
+ return [];
53
+ }
54
+ const entries = await readdir(dir);
55
+ const files = [];
56
+ await Promise.all(
57
+ entries.map(async (entry) => {
58
+ const entryPath = resolve(dir, entry.name);
59
+ if (entry.isDirectory()) {
60
+ if (maxDepth === void 0 || maxDepth > 0) {
61
+ const dirFiles = await readdirRecursive(
62
+ entryPath,
63
+ ignore,
64
+ maxDepth === void 0 ? void 0 : maxDepth - 1
65
+ );
66
+ files.push(...dirFiles.map((f) => entry.name + "/" + f));
67
+ }
68
+ } else {
69
+ if (!(ignore && ignore(entry.name))) {
70
+ files.push(entry.name);
71
+ }
72
+ }
73
+ })
74
+ );
75
+ return files;
76
+ }
77
+ async function rmRecursive(dir) {
78
+ const entries = await readdir(dir);
79
+ await Promise.all(
80
+ entries.map((entry) => {
81
+ const entryPath = resolve(dir, entry.name);
82
+ if (entry.isDirectory()) {
83
+ return rmRecursive(entryPath).then(() => promises.rmdir(entryPath));
84
+ } else {
85
+ return promises.unlink(entryPath);
86
+ }
87
+ })
88
+ );
89
+ }
90
+
91
+ const PATH_TRAVERSE_RE = /\.\.:|\.\.$/;
92
+ const DRIVER_NAME = "fs-lite";
93
+ const fsLite = defineDriver((opts = {}) => {
94
+ if (!opts.base) {
95
+ throw createRequiredError(DRIVER_NAME, "base");
96
+ }
97
+ opts.base = resolve(opts.base);
98
+ const r = (key) => {
99
+ if (PATH_TRAVERSE_RE.test(key)) {
100
+ throw createError(
101
+ DRIVER_NAME,
102
+ `Invalid key: ${JSON.stringify(key)}. It should not contain .. segments`
103
+ );
104
+ }
105
+ const resolved = join(opts.base, key.replace(/:/g, "/"));
106
+ return resolved;
107
+ };
108
+ return {
109
+ name: DRIVER_NAME,
110
+ options: opts,
111
+ flags: {
112
+ maxDepth: true
113
+ },
114
+ hasItem(key) {
115
+ return existsSync(r(key));
116
+ },
117
+ getItem(key) {
118
+ return readFile(r(key), "utf8");
119
+ },
120
+ getItemRaw(key) {
121
+ return readFile(r(key));
122
+ },
123
+ async getMeta(key) {
124
+ const { atime, mtime, size, birthtime, ctime } = await promises.stat(r(key)).catch(() => ({}));
125
+ return { atime, mtime, size, birthtime, ctime };
126
+ },
127
+ setItem(key, value) {
128
+ if (opts.readOnly) {
129
+ return;
130
+ }
131
+ return writeFile(r(key), value, "utf8");
132
+ },
133
+ setItemRaw(key, value) {
134
+ if (opts.readOnly) {
135
+ return;
136
+ }
137
+ return writeFile(r(key), value);
138
+ },
139
+ removeItem(key) {
140
+ if (opts.readOnly) {
141
+ return;
142
+ }
143
+ return unlink(r(key));
144
+ },
145
+ getKeys(_base, topts) {
146
+ return readdirRecursive(r("."), opts.ignore, topts?.maxDepth);
147
+ },
148
+ async clear() {
149
+ if (opts.readOnly || opts.noClear) {
150
+ return;
151
+ }
152
+ await rmRecursive(r("."));
153
+ }
154
+ };
155
+ });
156
+
157
+ export { fsLite as default };
@@ -0,0 +1,188 @@
1
+ function matchesDependency(dependency, apiName) {
2
+ if (dependency === apiName) {
3
+ return true;
4
+ }
5
+ if (dependency.startsWith(`${apiName}.`)) {
6
+ return true;
7
+ }
8
+ if (apiName.startsWith(`${dependency}.`)) {
9
+ return true;
10
+ }
11
+ return false;
12
+ }
13
+ function findDirectDependents(screens, apiName) {
14
+ return screens.filter(
15
+ (screen) => screen.dependsOn?.some((dep) => matchesDependency(dep, apiName))
16
+ );
17
+ }
18
+ function buildNavigationGraph(screens) {
19
+ const graph = /* @__PURE__ */ new Map();
20
+ for (const screen of screens) {
21
+ if (!screen.next) continue;
22
+ if (!graph.has(screen.id)) {
23
+ graph.set(screen.id, /* @__PURE__ */ new Set());
24
+ }
25
+ for (const nextId of screen.next) {
26
+ graph.get(screen.id).add(nextId);
27
+ }
28
+ }
29
+ return graph;
30
+ }
31
+ function findPathToDirectDependent(startId, targetIds, graph, maxDepth) {
32
+ const queue = [
33
+ { id: startId, path: [startId] }
34
+ ];
35
+ const localVisited = /* @__PURE__ */ new Set([startId]);
36
+ while (queue.length > 0) {
37
+ const current = queue.shift();
38
+ if (current.path.length > maxDepth + 1) {
39
+ continue;
40
+ }
41
+ const neighbors = graph.get(current.id);
42
+ if (!neighbors) {
43
+ continue;
44
+ }
45
+ for (const neighborId of neighbors) {
46
+ if (localVisited.has(neighborId)) {
47
+ continue;
48
+ }
49
+ const newPath = [...current.path, neighborId];
50
+ if (newPath.length > maxDepth + 1) {
51
+ continue;
52
+ }
53
+ if (targetIds.has(neighborId)) {
54
+ return newPath;
55
+ }
56
+ localVisited.add(neighborId);
57
+ queue.push({ id: neighborId, path: newPath });
58
+ }
59
+ }
60
+ return null;
61
+ }
62
+ function findTransitiveDependents(screens, directDependentIds, maxDepth) {
63
+ const navigationGraph = buildNavigationGraph(screens);
64
+ const transitive = [];
65
+ const visited = /* @__PURE__ */ new Set();
66
+ for (const screen of screens) {
67
+ if (directDependentIds.has(screen.id)) {
68
+ continue;
69
+ }
70
+ const path = findPathToDirectDependent(
71
+ screen.id,
72
+ directDependentIds,
73
+ navigationGraph,
74
+ maxDepth
75
+ );
76
+ if (path && !visited.has(screen.id)) {
77
+ visited.add(screen.id);
78
+ transitive.push({
79
+ screen,
80
+ path
81
+ });
82
+ }
83
+ }
84
+ return transitive;
85
+ }
86
+ function analyzeImpact(screens, apiName, maxDepth = 3) {
87
+ const direct = findDirectDependents(screens, apiName);
88
+ const directIds = new Set(direct.map((s) => s.id));
89
+ const transitive = findTransitiveDependents(screens, directIds, maxDepth);
90
+ return {
91
+ api: apiName,
92
+ direct,
93
+ transitive,
94
+ totalCount: direct.length + transitive.length
95
+ };
96
+ }
97
+ function getAllApis(screens) {
98
+ const apis = /* @__PURE__ */ new Set();
99
+ for (const screen of screens) {
100
+ if (screen.dependsOn) {
101
+ for (const dep of screen.dependsOn) {
102
+ apis.add(dep);
103
+ }
104
+ }
105
+ }
106
+ return Array.from(apis).sort();
107
+ }
108
+ function getApiDependencyCount(screens) {
109
+ const counts = /* @__PURE__ */ new Map();
110
+ for (const screen of screens) {
111
+ if (screen.dependsOn) {
112
+ for (const dep of screen.dependsOn) {
113
+ counts.set(dep, (counts.get(dep) || 0) + 1);
114
+ }
115
+ }
116
+ }
117
+ return counts;
118
+ }
119
+ function generateImpactMermaid(screens, result) {
120
+ const directIds = new Set(result.direct.map((s) => s.id));
121
+ const transitiveIds = new Set(result.transitive.map((t) => t.screen.id));
122
+ const lines = ["flowchart TD"];
123
+ lines.push(" classDef direct fill:#dc2626,stroke:#fef2f2,color:#ffffff,stroke-width:3px,font-weight:bold");
124
+ lines.push(" classDef transitive fill:#ea580c,stroke:#fff7ed,color:#ffffff,stroke-width:3px,font-weight:bold");
125
+ lines.push(" classDef normal fill:#1e293b,stroke:#64748b,color:#e2e8f0,stroke-width:1px");
126
+ for (const screen of screens) {
127
+ const label = screen.title.replace(/"/g, "'");
128
+ const id = screen.id.replace(/\./g, "_");
129
+ lines.push(` ${id}["${label}"]`);
130
+ }
131
+ lines.push("");
132
+ for (const screen of screens) {
133
+ if (screen.next) {
134
+ const fromId = screen.id.replace(/\./g, "_");
135
+ for (const nextId of screen.next) {
136
+ const toId = nextId.replace(/\./g, "_");
137
+ lines.push(` ${fromId} --> ${toId}`);
138
+ }
139
+ }
140
+ }
141
+ lines.push("");
142
+ const directNodes = screens.filter((s) => directIds.has(s.id)).map((s) => s.id.replace(/\./g, "_"));
143
+ const transitiveNodes = screens.filter((s) => transitiveIds.has(s.id)).map((s) => s.id.replace(/\./g, "_"));
144
+ const normalNodes = screens.filter((s) => !directIds.has(s.id) && !transitiveIds.has(s.id)).map((s) => s.id.replace(/\./g, "_"));
145
+ if (directNodes.length > 0) {
146
+ lines.push(` class ${directNodes.join(",")} direct`);
147
+ }
148
+ if (transitiveNodes.length > 0) {
149
+ lines.push(` class ${transitiveNodes.join(",")} transitive`);
150
+ }
151
+ if (normalNodes.length > 0) {
152
+ lines.push(` class ${normalNodes.join(",")} normal`);
153
+ }
154
+ return lines.join("\n");
155
+ }
156
+ function formatImpactMarkdown(result) {
157
+ const lines = [];
158
+ lines.push(`## Impact Analysis: \`${result.api}\``);
159
+ lines.push("");
160
+ if (result.totalCount === 0) {
161
+ lines.push("No screens depend on this API.");
162
+ return lines.join("\n");
163
+ }
164
+ lines.push(
165
+ `**${result.totalCount} screen${result.totalCount > 1 ? "s" : ""} affected**`
166
+ );
167
+ lines.push("");
168
+ if (result.direct.length > 0) {
169
+ lines.push(`### Direct Dependencies (${result.direct.length})`);
170
+ lines.push("");
171
+ for (const screen of result.direct) {
172
+ const owner = screen.owner?.length ? ` - ${screen.owner.join(", ")}` : "";
173
+ lines.push(`- **${screen.title}** (\`${screen.route}\`)${owner}`);
174
+ }
175
+ lines.push("");
176
+ }
177
+ if (result.transitive.length > 0) {
178
+ lines.push(`### Transitive Dependencies (${result.transitive.length})`);
179
+ lines.push("");
180
+ for (const { screen, path } of result.transitive) {
181
+ lines.push(`- **${screen.title}** via \`${path.join(" → ")}\``);
182
+ }
183
+ lines.push("");
184
+ }
185
+ return lines.join("\n");
186
+ }
187
+
188
+ export { analyzeImpact as a, generateImpactMermaid as b, getApiDependencyCount as c, formatImpactMarkdown as f, getAllApis as g };