@polderlabs/bizar-dash 3.0.1 → 3.0.2
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/package.json +1 -1
- package/src/server/server.mjs +17 -10
package/package.json
CHANGED
package/src/server/server.mjs
CHANGED
|
@@ -151,6 +151,15 @@ export async function createServer({
|
|
|
151
151
|
res.sendFile(join(DIST_DIR, 'index.html'));
|
|
152
152
|
});
|
|
153
153
|
} else {
|
|
154
|
+
const distIndex = join(DIST_DIR, 'index.html');
|
|
155
|
+
if (!existsSync(distIndex)) {
|
|
156
|
+
// eslint-disable-next-line no-console
|
|
157
|
+
console.error(`[bizar-dash] dist/index.html not found at ${DIST_DIR}`);
|
|
158
|
+
// eslint-disable-next-line no-console
|
|
159
|
+
console.error(`[bizar-dash] The published package should include a prebuilt dist/.`);
|
|
160
|
+
// eslint-disable-next-line no-console
|
|
161
|
+
console.error(`[bizar-dash] Try: npm install -g @polderlabs/bizar-dash --force`);
|
|
162
|
+
}
|
|
154
163
|
app.get('/', (_req, res) => res.status(503).type('html').send(renderNotBuiltPage()));
|
|
155
164
|
app.get('*', (_req, res) => {
|
|
156
165
|
if (_req.path.startsWith('/api') || _req.path === '/ws') {
|
|
@@ -159,10 +168,6 @@ export async function createServer({
|
|
|
159
168
|
}
|
|
160
169
|
res.status(503).type('html').send(renderNotBuiltPage());
|
|
161
170
|
});
|
|
162
|
-
// eslint-disable-next-line no-console
|
|
163
|
-
console.warn(
|
|
164
|
-
`[dashboard] dist/ not found at ${DIST_DIR}. Run \`npm run build\` to build the React SPA.`,
|
|
165
|
-
);
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
wss.on('connection', (ws, req) => {
|
|
@@ -344,7 +349,7 @@ function renderNotBuiltPage() {
|
|
|
344
349
|
<html lang="en">
|
|
345
350
|
<head>
|
|
346
351
|
<meta charset="UTF-8" />
|
|
347
|
-
<title>
|
|
352
|
+
<title>Dashboard assets not found</title>
|
|
348
353
|
<style>
|
|
349
354
|
:root { color-scheme: dark; }
|
|
350
355
|
body {
|
|
@@ -373,11 +378,13 @@ function renderNotBuiltPage() {
|
|
|
373
378
|
</head>
|
|
374
379
|
<body>
|
|
375
380
|
<div class="card">
|
|
376
|
-
<h1>Dashboard not
|
|
377
|
-
<p>The
|
|
378
|
-
|
|
379
|
-
<p>
|
|
380
|
-
<pre><code>
|
|
381
|
+
<h1>Dashboard assets not found</h1>
|
|
382
|
+
<p>The <code>@polderlabs/bizar-dash</code> package ships prebuilt assets
|
|
383
|
+
in <code>dist/</code>. If you are seeing this, your install is broken.</p>
|
|
384
|
+
<p>Try:</p>
|
|
385
|
+
<pre><code>npm install -g @polderlabs/bizar-dash --force</code></pre>
|
|
386
|
+
<p>If the problem persists, file an issue at<br/>
|
|
387
|
+
<code>github.com/DrB0rk/BizarHarness</code></p>
|
|
381
388
|
<p>The REST API and WebSocket are still live at <code>/api/*</code>
|
|
382
389
|
and <code>/ws</code>.</p>
|
|
383
390
|
</div>
|