weifuwu 0.18.10 → 0.18.11
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/index.js +12 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5478,17 +5478,6 @@ function ssr(path2) {
|
|
|
5478
5478
|
return r;
|
|
5479
5479
|
}
|
|
5480
5480
|
|
|
5481
|
-
// layout.ts
|
|
5482
|
-
function layout(path2) {
|
|
5483
|
-
return async (req, ctx, next) => {
|
|
5484
|
-
const mod = await compileTsx(path2);
|
|
5485
|
-
const Component = mod.default;
|
|
5486
|
-
if (!Component) throw new Error(`Layout ${path2} has no default export`);
|
|
5487
|
-
ctx.layoutStack = [...ctx.layoutStack || [], { path: path2, component: Component }];
|
|
5488
|
-
return next(req, ctx);
|
|
5489
|
-
};
|
|
5490
|
-
}
|
|
5491
|
-
|
|
5492
5481
|
// tailwind.ts
|
|
5493
5482
|
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync } from "node:fs";
|
|
5494
5483
|
import { join as join3, relative, resolve as resolve5 } from "node:path";
|
|
@@ -5533,9 +5522,6 @@ function liveReload(opts) {
|
|
|
5533
5522
|
// tailwind.ts
|
|
5534
5523
|
var isDev2 = process.env.NODE_ENV !== "production";
|
|
5535
5524
|
var extraSources = /* @__PURE__ */ new Set();
|
|
5536
|
-
function addTailwindSource(dir) {
|
|
5537
|
-
extraSources.add(resolve5(dir));
|
|
5538
|
-
}
|
|
5539
5525
|
function tailwind(dir) {
|
|
5540
5526
|
const cssDir = resolve5(dir);
|
|
5541
5527
|
const cssPath = join3(cssDir, "app.css");
|
|
@@ -5592,6 +5578,17 @@ function watchFile(path2, onChange) {
|
|
|
5592
5578
|
return watcher;
|
|
5593
5579
|
}
|
|
5594
5580
|
|
|
5581
|
+
// layout.ts
|
|
5582
|
+
function layout(path2) {
|
|
5583
|
+
return async (req, ctx, next) => {
|
|
5584
|
+
const mod = await compileTsx(path2);
|
|
5585
|
+
const Component = mod.default;
|
|
5586
|
+
if (!Component) throw new Error(`Layout ${path2} has no default export`);
|
|
5587
|
+
ctx.layoutStack = [...ctx.layoutStack || [], { path: path2, component: Component }];
|
|
5588
|
+
return next(req, ctx);
|
|
5589
|
+
};
|
|
5590
|
+
}
|
|
5591
|
+
|
|
5595
5592
|
// opencode/session.ts
|
|
5596
5593
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
5597
5594
|
import { join as join4 } from "node:path";
|
|
@@ -6227,7 +6224,7 @@ async function buildRouter4(deps) {
|
|
|
6227
6224
|
});
|
|
6228
6225
|
try {
|
|
6229
6226
|
const uiDir = new URL("../opencode/ui/", import.meta.url).pathname;
|
|
6230
|
-
|
|
6227
|
+
router.use(tailwind(uiDir));
|
|
6231
6228
|
router.use(layout(join5(uiDir, "layout.tsx")));
|
|
6232
6229
|
router.get("/", ssr(join5(uiDir, "page.tsx")));
|
|
6233
6230
|
} catch (e) {
|