From 27e42012481990010fd26112fe1cebd1155a1138 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 29 Sep 2025 00:23:02 +1300 Subject: [PATCH 01/18] local: deploy issuese --- .gitignore | 2 + app/entry.client.tsx | 4 +- app/lib/runtime/action-runner.ts | 3 +- app/lib/stores/files.ts | 5 +- app/remix-server-build.d.tsx | 6 + app/root.tsx | 94 +- app/routes/api.chat.ts | 59 - app/routes/app.chat.ts | 40 + app/server/assets/run-chat.server-Cx_OyQDp.js | 100 + app/server/assets/server-build-D5H6ZeJU.js | 949 + app/server/index.js | 15 + app/server/run-chat.server.ts | 42 + app/types/remix-server-build.d.ts | 6 + functions/[[path]].ts | 19 +- functions/_server/index.js | 1033 + package-lock.json | 25361 ++++++++++++++++ package.json | 214 +- pnpm-lock.yaml | 1117 +- scripts/copy-server-bundle.mjs | 13 + scripts/start-dev.ps1 | 14 + uno.config.ts | 287 +- vite.config.ts | 86 +- 22 files changed, 28653 insertions(+), 816 deletions(-) create mode 100644 app/remix-server-build.d.tsx delete mode 100644 app/routes/api.chat.ts create mode 100644 app/routes/app.chat.ts create mode 100644 app/server/assets/run-chat.server-Cx_OyQDp.js create mode 100644 app/server/assets/server-build-D5H6ZeJU.js create mode 100644 app/server/index.js create mode 100644 app/server/run-chat.server.ts create mode 100644 app/types/remix-server-build.d.ts create mode 100644 functions/_server/index.js create mode 100644 package-lock.json create mode 100644 scripts/copy-server-bundle.mjs create mode 100644 scripts/start-dev.ps1 diff --git a/.gitignore b/.gitignore index 965ef504ae..0dca1aacab 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ dist-ssr *.vars .wrangler _worker.bundle + +.dev.vars diff --git a/app/entry.client.tsx b/app/entry.client.tsx index 62917e70d4..16d03b5932 100644 --- a/app/entry.client.tsx +++ b/app/entry.client.tsx @@ -1,7 +1,9 @@ import { RemixBrowser } from '@remix-run/react'; import { startTransition } from 'react'; import { hydrateRoot } from 'react-dom/client'; +import "@unocss/reset/tailwind.css"; +import "virtual:uno.css"; startTransition(() => { hydrateRoot(document.getElementById('root')!, ); -}); +}); \ No newline at end of file diff --git a/app/lib/runtime/action-runner.ts b/app/lib/runtime/action-runner.ts index e2ea6a2264..99c143b4b6 100644 --- a/app/lib/runtime/action-runner.ts +++ b/app/lib/runtime/action-runner.ts @@ -1,6 +1,6 @@ import { WebContainer } from '@webcontainer/api'; import { map, type MapStore } from 'nanostores'; -import * as nodePath from 'node:path'; +import * as nodePath from 'path'; import type { BoltAction } from '~/types/actions'; import { createScopedLogger } from '~/utils/logger'; import { unreachable } from '~/utils/unreachable'; @@ -184,3 +184,4 @@ export class ActionRunner { this.actions.setKey(id, { ...actions[id], ...newState }); } } + diff --git a/app/lib/stores/files.ts b/app/lib/stores/files.ts index 663ae58113..f9754511d2 100644 --- a/app/lib/stores/files.ts +++ b/app/lib/stores/files.ts @@ -1,8 +1,8 @@ import type { PathWatcherEvent, WebContainer } from '@webcontainer/api'; import { getEncoding } from 'istextorbinary'; import { map, type MapStore } from 'nanostores'; -import { Buffer } from 'node:buffer'; -import * as nodePath from 'node:path'; +import { Buffer } from 'buffer'; +import * as nodePath from 'path'; import { bufferWatchEvents } from '~/utils/buffer'; import { WORK_DIR } from '~/utils/constants'; import { computeFileModifications } from '~/utils/diff'; @@ -218,3 +218,4 @@ function convertToBuffer(view: Uint8Array): Buffer { return buffer as Buffer; } + diff --git a/app/remix-server-build.d.tsx b/app/remix-server-build.d.tsx new file mode 100644 index 0000000000..e2aa1eb445 --- /dev/null +++ b/app/remix-server-build.d.tsx @@ -0,0 +1,6 @@ +declare module "../build/server/index.js" { + // Good enough for editor; Remix will provide the real thing at runtime + // You can refine this to ServerBuild if you want stricter types. + const build: any; + export = build; +} diff --git a/app/root.tsx b/app/root.tsx index 31eb387e03..4be66b1559 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -1,83 +1,31 @@ -import { useStore } from '@nanostores/react'; -import type { LinksFunction } from '@remix-run/cloudflare'; -import { Links, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react'; -import tailwindReset from '@unocss/reset/tailwind-compat.css?url'; -import { themeStore } from './lib/stores/theme'; -import { stripIndents } from './utils/stripIndent'; -import { createHead } from 'remix-island'; -import { useEffect } from 'react'; +// app/root.tsx +import { Meta, Links, Outlet, Scripts, ScrollRestoration } from "@remix-run/react"; -import reactToastifyStyles from 'react-toastify/dist/ReactToastify.css?url'; -import globalStyles from './styles/index.scss?url'; -import xtermStyles from '@xterm/xterm/css/xterm.css?url'; - -import 'virtual:uno.css'; - -export const links: LinksFunction = () => [ - { - rel: 'icon', - href: '/favicon.svg', - type: 'image/svg+xml', - }, - { rel: 'stylesheet', href: reactToastifyStyles }, - { rel: 'stylesheet', href: tailwindReset }, - { rel: 'stylesheet', href: globalStyles }, - { rel: 'stylesheet', href: xtermStyles }, - { - rel: 'preconnect', - href: 'https://fonts.googleapis.com', - }, - { - rel: 'preconnect', - href: 'https://fonts.gstatic.com', - crossOrigin: 'anonymous', - }, - { - rel: 'stylesheet', - href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap', - }, -]; - -const inlineThemeCode = stripIndents` - setTutorialKitTheme(); - - function setTutorialKitTheme() { - let theme = localStorage.getItem('bolt_theme'); - - if (!theme) { - theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; - } - - document.querySelector('html')?.setAttribute('data-theme', theme); - } -`; - -export const Head = createHead(() => ( - <> - - - - -