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.
This commit is contained in:
+19
-9
@@ -1,9 +1,15 @@
|
||||
import { lazy, Suspense } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import App from './App';
|
||||
import ProofingGallery from './components/ProofingGallery';
|
||||
import JoinPage from './components/JoinPage';
|
||||
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');
|
||||
|
||||
@@ -14,11 +20,15 @@ const galleryMatch = /^\/g\/([A-Za-z0-9_-]+)\/?$/.exec(window.location.pathname)
|
||||
const joinMatch = /^\/join\/([A-Za-z0-9_-]+)\/?$/.exec(window.location.pathname);
|
||||
|
||||
createRoot(root).render(
|
||||
galleryMatch ? (
|
||||
<ProofingGallery token={galleryMatch[1]} />
|
||||
) : joinMatch ? (
|
||||
<JoinPage token={joinMatch[1]} />
|
||||
) : (
|
||||
<App />
|
||||
),
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={null}>
|
||||
{galleryMatch ? (
|
||||
<ProofingGallery token={galleryMatch[1]} />
|
||||
) : joinMatch ? (
|
||||
<JoinPage token={joinMatch[1]} />
|
||||
) : (
|
||||
<App />
|
||||
)}
|
||||
</Suspense>
|
||||
</ErrorBoundary>,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user