@staff0rd/assist 0.172.4 → 0.173.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/dist/commands/backlog/web/bundle.js +75 -60
- package/dist/index.js +21 -10
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.173.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -76,6 +76,7 @@ var package_default = {
|
|
|
76
76
|
marked: "^15.0.12",
|
|
77
77
|
react: "^19.2.4",
|
|
78
78
|
"react-dom": "^19.2.4",
|
|
79
|
+
"react-router": "^7.14.0",
|
|
79
80
|
"semantic-release": "^25.0.2",
|
|
80
81
|
tsup: "^8.5.1",
|
|
81
82
|
vitest: "^4.0.18"
|
|
@@ -306,9 +307,9 @@ function saveAllItems(db, items) {
|
|
|
306
307
|
import { z } from "zod";
|
|
307
308
|
var backlogStatusSchema = z.enum(["todo", "in-progress", "done", "wontdo"]);
|
|
308
309
|
var backlogTypeSchema = z.enum(["story", "bug"]);
|
|
309
|
-
var planTaskSchema = z.
|
|
310
|
+
var planTaskSchema = z.object({
|
|
310
311
|
task: z.string()
|
|
311
|
-
});
|
|
312
|
+
}).strip();
|
|
312
313
|
var planPhaseSchema = z.strictObject({
|
|
313
314
|
name: z.string(),
|
|
314
315
|
tasks: z.array(planTaskSchema),
|
|
@@ -1379,18 +1380,28 @@ var itemRoutes = {
|
|
|
1379
1380
|
PATCH: (req, res, id) => patchItemStatus(req, res, id),
|
|
1380
1381
|
DELETE: (_req, res, id) => deleteItem2(res, id)
|
|
1381
1382
|
};
|
|
1383
|
+
var serveHtml = createHtmlHandler(getHtml);
|
|
1382
1384
|
var baseHandler = createRouteHandler(routes);
|
|
1385
|
+
async function handleItemRoute(req, res, pathname) {
|
|
1386
|
+
const match = pathname.match(/^\/api\/items\/(\d+)$/);
|
|
1387
|
+
if (!match) return false;
|
|
1388
|
+
const handler = itemRoutes[req.method ?? "GET"];
|
|
1389
|
+
if (!handler) return false;
|
|
1390
|
+
await handler(req, res, Number.parseInt(match[1], 10));
|
|
1391
|
+
return true;
|
|
1392
|
+
}
|
|
1383
1393
|
async function handleRequest(req, res, port) {
|
|
1384
1394
|
const url = new URL(req.url ?? "/", `http://localhost:${port}`);
|
|
1385
1395
|
const method = req.method ?? "GET";
|
|
1386
1396
|
const pathname = url.pathname;
|
|
1387
|
-
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1397
|
+
if (await handleItemRoute(req, res, pathname)) return;
|
|
1398
|
+
if (routes[`${method} ${pathname}`]) {
|
|
1399
|
+
await baseHandler(req, res, port);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (method === "GET" && !pathname.startsWith("/api/")) {
|
|
1403
|
+
await serveHtml(req, res);
|
|
1404
|
+
return;
|
|
1394
1405
|
}
|
|
1395
1406
|
await baseHandler(req, res, port);
|
|
1396
1407
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@staff0rd/assist",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.173.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"marked": "^15.0.12",
|
|
71
71
|
"react": "^19.2.4",
|
|
72
72
|
"react-dom": "^19.2.4",
|
|
73
|
+
"react-router": "^7.14.0",
|
|
73
74
|
"semantic-release": "^25.0.2",
|
|
74
75
|
"tsup": "^8.5.1",
|
|
75
76
|
"vitest": "^4.0.18"
|