Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions npm-packages/common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions npm-packages/dashboard-self-hosted/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ const nextConfig = {
};
}

if (
!isServer &&
process.env.NEXT_PUBLIC_LOAD_MONACO_INTERNALLY === "true"
) {
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
config.plugins.push(
new MonacoWebpackPlugin({
languages: ["json", "typescript", "javascript"],
filename: "static/[name].worker.js",
}),
);
}

return config;
},
};
Expand Down
5 changes: 4 additions & 1 deletion npm-packages/dashboard-self-hosted/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"react-dom": "^18.0.0",
"react-use": "~17.6.0",
"system-udfs": "workspace:*",
"zod": "^3.24.0"
"zod": "^3.24.0",
"@monaco-editor/react": "4.7.0",
"monaco-editor": "0.40.0",
"monaco-editor-webpack-plugin": "~7.1.1"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.10",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { loader } from "@monaco-editor/react";
import * as monaco from "monaco-editor";

loader.config({ monaco });

loader.init().then((_monacoInstance) => {
/* ... */
});
4 changes: 4 additions & 0 deletions npm-packages/dashboard-self-hosted/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ import { z } from "zod";
import { UIProvider } from "@ui/UIContext";
import Link from "next/link";

if (process.env.NEXT_PUBLIC_LOAD_MONACO_INTERNALLY === "true") {
import("../lib/monacoInternalLoader").then((a) => a);
}

// Context for self-hosted dashboard sidebar settings
const SelfHostedSettingsContext = createContext<{
visiblePages?: string[];
Expand Down
4 changes: 4 additions & 0 deletions self-hosted/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ npx convex import --replace-all <path-to-export-file>
random identifier plus the version of the backend in use. You may opt out of
the beacon by setting the environment variable `DISABLE_BEACON` to `true`.

## Dashboard optional configuration

- The dashboard uses the **monaco-editor** npm package for all the editor-like elements. By default, monaco loads it's core from a CDN. You could configure it to load internally by setting the `NEXT_PUBLIC_LOAD_MONACO_INTERNALLY` environment variable to `true`

## Running the dashboard locally

From the `npm-packages/dashboard-self-hosted` directory, run:
Expand Down
1 change: 1 addition & 0 deletions self-hosted/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
- "${DASHBOARD_PORT:-6791}:6791"
environment:
- NEXT_PUBLIC_DEPLOYMENT_URL=${NEXT_PUBLIC_DEPLOYMENT_URL:-http://127.0.0.1:${PORT:-3210}}
- NEXT_PUBLIC_LOAD_MONACO_INTERNALLY
depends_on:
backend:
condition: service_healthy
Expand Down