@designtools/shadows 0.1.2 → 0.1.4
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/cli.js +8 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -274,6 +274,9 @@ async function createToolServer(config) {
|
|
|
274
274
|
wsProxy.on("error", (err) => {
|
|
275
275
|
console.error("WS proxy error:", err.message);
|
|
276
276
|
});
|
|
277
|
+
if (config.setupRoutes) {
|
|
278
|
+
config.setupRoutes(app, projectRoot);
|
|
279
|
+
}
|
|
277
280
|
const vite = await createViteServer({
|
|
278
281
|
configFile: false,
|
|
279
282
|
root: config.clientRoot,
|
|
@@ -1362,10 +1365,12 @@ async function startShadowsServer(preflight) {
|
|
|
1362
1365
|
targetPort: preflight.targetPort,
|
|
1363
1366
|
toolPort: preflight.toolPort,
|
|
1364
1367
|
clientRoot,
|
|
1365
|
-
injectScriptPath: actualInjectPath
|
|
1368
|
+
injectScriptPath: actualInjectPath,
|
|
1369
|
+
setupRoutes: (app2, projectRoot2) => {
|
|
1370
|
+
app2.use("/api/shadows", createShadowsRouter(projectRoot2));
|
|
1371
|
+
app2.use("/scan", createShadowsScanRouter(projectRoot2));
|
|
1372
|
+
}
|
|
1366
1373
|
});
|
|
1367
|
-
app.use("/api/shadows", createShadowsRouter(projectRoot));
|
|
1368
|
-
app.use("/scan", createShadowsScanRouter(projectRoot));
|
|
1369
1374
|
return { app, wss, projectRoot };
|
|
1370
1375
|
}
|
|
1371
1376
|
|