@motiadev/workbench 0.8.2-beta.140-516159 → 0.8.2-beta.140-957262

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.
@@ -9,6 +9,14 @@ const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const vite_1 = require("vite");
11
11
  const vite_plugin_motia_plugins_1 = __importDefault(require("./vite-plugin-motia-plugins"));
12
+ const workbenchBasePlugin = (workbenchBase) => {
13
+ return {
14
+ name: 'html-transform',
15
+ transformIndexHtml: (html) => {
16
+ return html.replace('</head>', `<script>const workbenchBase = ${JSON.stringify(workbenchBase)};</script></head>`);
17
+ },
18
+ };
19
+ };
12
20
  const processCwdPlugin = () => {
13
21
  return {
14
22
  name: 'html-transform',
@@ -62,7 +70,13 @@ const applyMiddleware = async ({ app, port, workbenchBase, plugins }) => {
62
70
  // antd: path.join(process.cwd(), './node_modules/antd'),
63
71
  },
64
72
  },
65
- plugins: [(0, plugin_react_1.default)(), processCwdPlugin(), reoPlugin(), (0, vite_plugin_motia_plugins_1.default)(plugins)],
73
+ plugins: [
74
+ (0, plugin_react_1.default)(),
75
+ processCwdPlugin(),
76
+ reoPlugin(),
77
+ (0, vite_plugin_motia_plugins_1.default)(plugins),
78
+ workbenchBasePlugin(workbenchBase),
79
+ ],
66
80
  assetsInclude: ['**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.gif', '**/*.svg', '**/*.ico', '**/*.webp', '**/*.avif'],
67
81
  });
68
82
  app.use(workbenchBase, vite.middlewares);
@@ -0,0 +1 @@
1
+ export declare const NotFoundPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Header } from './header/header';
3
+ export const NotFoundPage = () => (_jsxs("div", { className: "grid grid-rows-[auto_1fr] h-screen bg-background text-foreground", children: [_jsx(Header, {}), _jsxs("div", { className: "flex flex-col items-center justify-center", children: [_jsx("h1", { className: "text-4xl font-bold mb-4", children: "404 \u2013 Page Not Found" }), _jsx("p", { className: "text-lg opacity-80 mb-6", children: "This route doesn\u2019t exist." })] })] }));
@@ -22,7 +22,7 @@ export const DeployButton = () => {
22
22
  };
23
23
  const onSelfHostedClick = () => {
24
24
  analytics.track('deploy_button_self_hosted_clicked');
25
- window.open('https://www.motia.dev/docs/concepts/deployment/self-hosted', '_blank');
25
+ window.open('https://www.motia.dev/docs/deployment-guide/self-hosted', '_blank');
26
26
  };
27
27
  return (_jsxs(_Fragment, { children: [isOpen && (_jsxs("div", { children: [_jsx("div", { className: "fixed inset-0 z-[9999] bg-black/20 backdrop-blur-sm", onClick: () => setIsOpen(false) }), _jsxs("div", { className: "driver-popover w-[600px]! fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[10000] animate-in fade-in-0 zoom-in-95", children: [_jsx("img", { src: "https://oxhhfuuoqzsaqthfairn.supabase.co/storage/v1/object/public/public-images/preview.png", alt: "Motia Cloud", className: "driver-popover-image object-cover", style: { height: 393, width: '100%' } }), _jsx("div", { className: "driver-popover-title", children: _jsx("h2", { className: "popover-title", children: "Motia Cloud is Live!" }) }), _jsx("div", { className: "driver-popover-description", children: "Deploy to production in minutes, not hours. One click gets your Motia project live with enterprise-grade reliability. Seamlessly scale, rollback instantly, and monitor everything in real-time. Your code deserves infrastructure that just works." }), _jsx("a", { href: "https://www.motia.dev/docs/concepts/deployment/motia-cloud/features", target: "_blank", className: "text-foreground text-xs font-semibold px-4 hover:underline", children: "Learn more about Motia Cloud" }), _jsx("div", { className: "driver-popover-footer flex items-center justify-end", children: _jsxs("div", { className: "driver-popover-navigation-btns flex gap-6", children: [_jsx("button", { className: "tutorial-opt-out-button text-sm! font-semibold! text-muted-foreground!", onClick: onClose, children: "Close" }), _jsx("a", { href: "https://motia.cloud?utm_source=workbench&utm_medium=referral", target: "_blank", onClick: onDeployClick, children: _jsx("button", { className: "driver-popover-next-btn", children: "Deploy!" }) })] }) })] })] })), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: "font-semibold text-sm dark:bg-white dark:text-black dark:hover:bg-white/90 bg-black/90 hover:bg-black/80 text-white", onClick: onDeployButtonClick, children: [_jsx(Rocket, {}), "Deploy"] }) }), _jsxs(DropdownMenuContent, { className: "bg-background text-foreground w-56", children: [_jsx(DropdownMenuItem, { className: "cursor-pointer h-10 font-semibold", onClick: onMotiaCloudClick, children: "Motia Cloud" }), _jsx(DropdownMenuItem, { className: "cursor-pointer h-10 font-semibold", onClick: onSelfHostedClick, children: "Self-Hosted (Docker)" })] })] })] }));
28
28
  };
package/dist/src/main.js CHANGED
@@ -1,14 +1,18 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MotiaStreamProvider } from '@motiadev/stream-client-react';
3
3
  import { StrictMode } from 'react';
4
4
  import { createRoot } from 'react-dom/client';
5
+ import { BrowserRouter, Routes, Route } from 'react-router-dom';
5
6
  import { RootMotia } from './components/root-motia';
7
+ import { App } from './App';
8
+ import { NotFoundPage } from './components/NotFoundPage';
6
9
  import '@motiadev/ui/globals.css';
7
10
  import './index.css';
8
- import { App } from './App';
9
11
  const rootElement = document.getElementById('root');
10
12
  if (!rootElement.innerHTML) {
13
+ // eslint-disable-next-line no-undef
14
+ const basePath = workbenchBase;
11
15
  const root = createRoot(rootElement);
12
16
  const address = window.location.origin.replace('http', 'ws');
13
- root.render(_jsx(StrictMode, { children: _jsx(MotiaStreamProvider, { address: address, children: _jsx(RootMotia, { children: _jsx(App, {}) }) }) }));
17
+ root.render(_jsx(StrictMode, { children: _jsx(MotiaStreamProvider, { address: address, children: _jsx(RootMotia, { children: _jsx(BrowserRouter, { children: _jsxs(Routes, { children: [_jsx(Route, { path: basePath, element: _jsx(App, {}) }), _jsx(Route, { path: "*", element: _jsx(NotFoundPage, {}) })] }) }) }) }) }));
14
18
  }