Files
luminary/src/main.tsx
T
bhursey b34d34dacb Package a self-contained macOS app and harden serving
- Add macos/build.mjs: stages a universal .app outside the checkout, bundles
  and checksums Node, installs production deps per architecture, compiles the
  launcher shim, signs ad-hoc or with a Developer ID, and writes a zip and dmg
  with an optional notarization path.
- Serve precompressed brotli/gzip assets and split admin panels and the public
  pages out of the main bundle.
- Support HTTP range requests, and fix upload and quota accounting, gallery
  download counts and unreadable-file handling.
- Add server HTTP integration tests, a Gitea CI workflow, a catalog backup
  script and a crash screen for the UI.
2026-11-29 06:23:58 +00:00

35 lines
1.3 KiB
TypeScript

import { lazy, Suspense } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
import ErrorBoundary from './components/ErrorBoundary';
import './styles.css';
// Proofing galleries and invite pages are public and self-contained: loading
// them lazily keeps the editor out of the chunk a client downloads to view a
// shoot, and keeps the invite page tiny.
const ProofingGallery = lazy(() => import('./components/ProofingGallery'));
const JoinPage = lazy(() => import('./components/JoinPage'));
const root = document.getElementById('root');
if (!root) throw new Error('root element missing');
// Proofing links are public: /g/<token> renders the gallery straight away and
// never mounts the editor or asks for a session.
const galleryMatch = /^\/g\/([A-Za-z0-9_-]+)\/?$/.exec(window.location.pathname);
// Invite links are public too: the token decides whether signup is allowed.
const joinMatch = /^\/join\/([A-Za-z0-9_-]+)\/?$/.exec(window.location.pathname);
createRoot(root).render(
<ErrorBoundary>
<Suspense fallback={null}>
{galleryMatch ? (
<ProofingGallery token={galleryMatch[1]} />
) : joinMatch ? (
<JoinPage token={joinMatch[1]} />
) : (
<App />
)}
</Suspense>
</ErrorBoundary>,
);