diff --git a/packages/master/web/index.jsx b/packages/master/web/index.jsx index 30fdbf62..64be3a06 100644 --- a/packages/master/web/index.jsx +++ b/packages/master/web/index.jsx @@ -1 +1,3 @@ -import("@clusterio/web_ui/src/bootstrap"); +import("@clusterio/web_ui").then(webUi => { + return webUi.bootstrap(); +}).catch(console.error); diff --git a/packages/master/webpack.config.js b/packages/master/webpack.config.js index 06fd9363..16223c8b 100644 --- a/packages/master/webpack.config.js +++ b/packages/master/webpack.config.js @@ -29,7 +29,6 @@ module.exports = (env = {}) => merge(common(env), { "@clusterio/lib/schema": { singleton: true }, "@clusterio/lib/users": { singleton: true }, "@clusterio/web_ui": { singleton: true }, - "ajv": {}, "antd": { singleton: true }, "react": { singleton: true }, "react-dom": { singleton: true }, diff --git a/packages/web_ui/package.json b/packages/web_ui/package.json index 5a4fe02a..3adf1e6c 100644 --- a/packages/web_ui/package.json +++ b/packages/web_ui/package.json @@ -4,6 +4,7 @@ "author": "Hornwitser", "license": "MIT", "version": "2.0.0-alpha.4", + "browser": "src/index.jsx", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/packages/web_ui/src/bootstrap.jsx b/packages/web_ui/src/bootstrap.jsx index ee217769..0e37a489 100644 --- a/packages/web_ui/src/bootstrap.jsx +++ b/packages/web_ui/src/bootstrap.jsx @@ -74,7 +74,7 @@ async function loadPlugins() { return plugins; } -async function load() { +export default async function bootstrap() { logger.add(new ConsoleTransport({ level: "verbose", format: new WebConsoleFormat(), @@ -92,5 +92,3 @@ async function load() { ReactDOM.render(, document.getElementById("root")); } - -load().catch((err) => logger.fatal(err.stack)); diff --git a/packages/web_ui/src/index.jsx b/packages/web_ui/src/index.jsx new file mode 100644 index 00000000..dc3e9887 --- /dev/null +++ b/packages/web_ui/src/index.jsx @@ -0,0 +1,20 @@ +export { default as basename } from "./basename.jsx"; +export { default as bootstrap } from "./bootstrap.jsx"; +export { default as notify, notifyErrorHandler } from "./util/notify.jsx"; + +export * from "./model/instance.jsx"; +export * from "./model/slave.jsx"; + + +export { default as ControlContext } from "./components/ControlContext"; +export { default as PluginsContext } from "./components/PluginsContext"; + +export { default as BaseConfigTree } from "./components/BaseConfigTree"; +export { default as InstanceConfigTree } from "./components/InstanceConfigTree"; +export { default as MasterConfigTree } from "./components/MasterConfigTree"; + +export { default as AssignInstanceModal } from "./components/AssignInstanceModal"; +export { default as InstanceConsole } from "./components/InstanceConsole"; +export { default as InstanceRcon } from "./components/InstanceRcon"; + +export { default as PageLayout } from "./components/PageLayout";