mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9390ae4152 | ||
|
|
7ecab519ed | ||
|
|
85afb6828e | ||
|
|
d4d6ff0d89 | ||
|
|
f29510ed00 |
No files matched your search
@@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [9.9.2] - 2026-04-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Simplify nsite deployment to always use named sites, removing the root site option
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix crash in "What's new" toast when used outside the router context
|
||||||
|
- Truncate long changelog excerpts in update notifications so they fit neatly in the toast
|
||||||
|
- Left-align changelog page content for better readability
|
||||||
|
|
||||||
## [9.9.1] - 2026-04-02
|
## [9.9.1] - 2026-04-02
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
|
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
|
||||||
"homepage": "https://shakespeare.diy",
|
"homepage": "https://shakespeare.diy",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"version": "9.9.1",
|
"version": "9.9.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "shakespeare.diy",
|
"name": "shakespeare.diy",
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [9.9.2] - 2026-04-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Simplify nsite deployment to always use named sites, removing the root site option
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fix crash in "What's new" toast when used outside the router context
|
||||||
|
- Truncate long changelog excerpts in update notifications so they fit neatly in the toast
|
||||||
|
- Left-align changelog page content for better readability
|
||||||
|
|
||||||
## [9.9.1] - 2026-04-02
|
## [9.9.1] - 2026-04-02
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+1
-4
@@ -8,7 +8,6 @@ import { Suspense, useEffect } from 'react';
|
|||||||
import LightningFS from '@isomorphic-git/lightning-fs';
|
import LightningFS from '@isomorphic-git/lightning-fs';
|
||||||
import NostrProvider from '@/components/NostrProvider';
|
import NostrProvider from '@/components/NostrProvider';
|
||||||
import { NostrSync } from '@/components/NostrSync';
|
import { NostrSync } from '@/components/NostrSync';
|
||||||
import { Toaster } from "@/components/ui/toaster";
|
|
||||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||||
import { NostrLoginProvider } from '@nostrify/react/login';
|
import { NostrLoginProvider } from '@nostrify/react/login';
|
||||||
import { AppProvider } from '@/components/AppProvider';
|
import { AppProvider } from '@/components/AppProvider';
|
||||||
@@ -30,7 +29,7 @@ import { OfflineIndicator } from '@/components/OfflineIndicator';
|
|||||||
import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt';
|
import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt';
|
||||||
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
||||||
import { LockdownModeDetector } from '@/components/LockdownModeDetector';
|
import { LockdownModeDetector } from '@/components/LockdownModeDetector';
|
||||||
import { VersionCheck } from '@/components/VersionCheck';
|
|
||||||
|
|
||||||
import AppRouter from './AppRouter';
|
import AppRouter from './AppRouter';
|
||||||
|
|
||||||
@@ -149,11 +148,9 @@ export function App() {
|
|||||||
<GitSyncProvider>
|
<GitSyncProvider>
|
||||||
<SessionManagerProvider>
|
<SessionManagerProvider>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Toaster />
|
|
||||||
<DynamicFavicon />
|
<DynamicFavicon />
|
||||||
<OfflineIndicator />
|
<OfflineIndicator />
|
||||||
<PWAUpdatePrompt />
|
<PWAUpdatePrompt />
|
||||||
<VersionCheck />
|
|
||||||
<LockdownModeDetector />
|
<LockdownModeDetector />
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<AppRouter />
|
<AppRouter />
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
||||||
|
import { Toaster } from "./components/ui/toaster";
|
||||||
import { ScrollToTop } from "./components/ScrollToTop";
|
import { ScrollToTop } from "./components/ScrollToTop";
|
||||||
import { SessionMonitor } from "./components/SessionMonitor";
|
import { SessionMonitor } from "./components/SessionMonitor";
|
||||||
import { URLFragmentHandler } from "./components/URLFragmentHandler";
|
import { URLFragmentHandler } from "./components/URLFragmentHandler";
|
||||||
|
import { VersionCheck } from "./components/VersionCheck";
|
||||||
|
|
||||||
import Index from "./pages/Index";
|
import Index from "./pages/Index";
|
||||||
import Clone from "./pages/Clone";
|
import Clone from "./pages/Clone";
|
||||||
@@ -28,6 +30,8 @@ import { ChangelogPage } from "./pages/ChangelogPage";
|
|||||||
export function AppRouter() {
|
export function AppRouter() {
|
||||||
return (
|
return (
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
|
<Toaster />
|
||||||
|
<VersionCheck />
|
||||||
<ScrollToTop />
|
<ScrollToTop />
|
||||||
<SessionMonitor />
|
<SessionMonitor />
|
||||||
<URLFragmentHandler />
|
<URLFragmentHandler />
|
||||||
|
|||||||
@@ -19,8 +19,11 @@ async function fetchChangelogExcerpt(version: string): Promise<string | undefine
|
|||||||
const entry = entries.find((e) => e.version === version) ?? entries[0];
|
const entry = entries.find((e) => e.version === version) ?? entries[0];
|
||||||
if (!entry) return undefined;
|
if (!entry) return undefined;
|
||||||
|
|
||||||
// Return the first item from the first section.
|
// Return a truncated first item from the first section.
|
||||||
return entry.sections[0]?.items[0];
|
const item = entry.sections[0]?.items[0];
|
||||||
|
if (!item) return undefined;
|
||||||
|
if (item.length <= 60) return item;
|
||||||
|
return item.slice(0, 60).trimEnd() + '…';
|
||||||
} catch {
|
} catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ interface NsiteFormData {
|
|||||||
siteTitle: string;
|
siteTitle: string;
|
||||||
siteDescription: string;
|
siteDescription: string;
|
||||||
dTag: string;
|
dTag: string;
|
||||||
siteType: 'named' | 'root';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NetlifyFormData {
|
interface NetlifyFormData {
|
||||||
@@ -174,12 +173,10 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
// If a config already exists, seed the form from it and stay in summary mode.
|
// If a config already exists, seed the form from it and stay in summary mode.
|
||||||
// If not, show the full form so the user can configure for the first time.
|
// If not, show the full form so the user can configure for the first time.
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
const derivedSiteType = cfg.id === null ? 'root' : 'named';
|
|
||||||
setNsiteForm({
|
setNsiteForm({
|
||||||
siteTitle: cfg.title ?? '',
|
siteTitle: cfg.title ?? '',
|
||||||
siteDescription: cfg.description ?? '',
|
siteDescription: cfg.description ?? '',
|
||||||
dTag: (cfg.id != null && cfg.id !== '') ? cfg.id : '',
|
dTag: (cfg.id != null && cfg.id !== '') ? cfg.id : '',
|
||||||
siteType: derivedSiteType,
|
|
||||||
});
|
});
|
||||||
setNsiteShowFullForm(false);
|
setNsiteShowFullForm(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -197,7 +194,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
siteTitle: '',
|
siteTitle: '',
|
||||||
siteDescription: '',
|
siteDescription: '',
|
||||||
dTag: '',
|
dTag: '',
|
||||||
siteType: 'named',
|
|
||||||
});
|
});
|
||||||
const [netlifyForm, setNetlifyForm] = useState<NetlifyFormData>({
|
const [netlifyForm, setNetlifyForm] = useState<NetlifyFormData>({
|
||||||
siteId: '',
|
siteId: '',
|
||||||
@@ -283,9 +279,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
siteTitle: nsiteForm.siteTitle || undefined,
|
siteTitle: nsiteForm.siteTitle || undefined,
|
||||||
siteDescription: nsiteForm.siteDescription || undefined,
|
siteDescription: nsiteForm.siteDescription || undefined,
|
||||||
sourceUrl,
|
sourceUrl,
|
||||||
siteIdentifier: nsiteForm.siteType === 'named' && nsiteForm.dTag
|
siteIdentifier: nsiteForm.dTag || undefined,
|
||||||
? nsiteForm.dTag
|
|
||||||
: undefined,
|
|
||||||
});
|
});
|
||||||
} else if (selectedProvider.type === 'netlify') {
|
} else if (selectedProvider.type === 'netlify') {
|
||||||
const netlifyProvider = selectedProvider;
|
const netlifyProvider = selectedProvider;
|
||||||
@@ -397,7 +391,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
siteTitle: nsiteForm.siteTitle || undefined,
|
siteTitle: nsiteForm.siteTitle || undefined,
|
||||||
siteDescription: nsiteForm.siteDescription || undefined,
|
siteDescription: nsiteForm.siteDescription || undefined,
|
||||||
dTag: nsiteForm.dTag || undefined,
|
dTag: nsiteForm.dTag || undefined,
|
||||||
siteType: nsiteForm.siteType,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -407,7 +400,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
const newNsiteVfsConfig: NsiteVfsConfig = {
|
const newNsiteVfsConfig: NsiteVfsConfig = {
|
||||||
relays: nsiteProvider.relayUrls,
|
relays: nsiteProvider.relayUrls,
|
||||||
servers: nsiteProvider.blossomServers,
|
servers: nsiteProvider.blossomServers,
|
||||||
id: nsiteForm.siteType === 'root' ? null : (nsiteForm.dTag || undefined),
|
id: nsiteForm.dTag || undefined,
|
||||||
title: nsiteForm.siteTitle || undefined,
|
title: nsiteForm.siteTitle || undefined,
|
||||||
description: nsiteForm.siteDescription || undefined,
|
description: nsiteForm.siteDescription || undefined,
|
||||||
fallback: '/index.html',
|
fallback: '/index.html',
|
||||||
@@ -524,7 +517,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
setError(null);
|
setError(null);
|
||||||
// Reset forms
|
// Reset forms
|
||||||
setShakespeareForm({ subdomain: projectId });
|
setShakespeareForm({ subdomain: projectId });
|
||||||
setNsiteForm({ siteTitle: '', siteDescription: '', dTag: '', siteType: 'named' });
|
setNsiteForm({ siteTitle: '', siteDescription: '', dTag: '' });
|
||||||
setNetlifyForm({ siteId: '', siteName: '' });
|
setNetlifyForm({ siteId: '', siteName: '' });
|
||||||
setVercelForm({ projectName: projectName || projectId, teamId: '' });
|
setVercelForm({ projectName: projectName || projectId, teamId: '' });
|
||||||
setCloudflareForm({ projectName: projectName || projectId });
|
setCloudflareForm({ projectName: projectName || projectId });
|
||||||
@@ -556,10 +549,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
setNsiteForm(prev => ({ ...prev, siteDescription }));
|
setNsiteForm(prev => ({ ...prev, siteDescription }));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleNsiteSiteTypeChange = useCallback((siteType: 'named' | 'root') => {
|
|
||||||
setNsiteForm(prev => ({ ...prev, siteType }));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleNetlifySiteChange = useCallback((siteId: string, siteName: string) => {
|
const handleNetlifySiteChange = useCallback((siteId: string, siteName: string) => {
|
||||||
setNetlifyForm({ siteId, siteName });
|
setNetlifyForm({ siteId, siteName });
|
||||||
}, []);
|
}, []);
|
||||||
@@ -611,12 +600,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
|
|
||||||
// Summary view: shown when .nsite/config.json already exists and user hasn't clicked Edit
|
// Summary view: shown when .nsite/config.json already exists and user hasn't clicked Edit
|
||||||
if (nsiteVfsConfig && !nsiteShowFullForm) {
|
if (nsiteVfsConfig && !nsiteShowFullForm) {
|
||||||
const isRoot = nsiteVfsConfig.id === null;
|
|
||||||
const siteLabel = isRoot
|
|
||||||
? 'Root site'
|
|
||||||
: nsiteVfsConfig.id
|
|
||||||
? `Named site: ${nsiteVfsConfig.id}`
|
|
||||||
: 'Named site';
|
|
||||||
const relayCount = nsiteVfsConfig.relays?.length ?? 0;
|
const relayCount = nsiteVfsConfig.relays?.length ?? 0;
|
||||||
const serverCount = nsiteVfsConfig.servers?.length ?? 0;
|
const serverCount = nsiteVfsConfig.servers?.length ?? 0;
|
||||||
|
|
||||||
@@ -629,10 +612,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
<span className="font-medium">{nsiteVfsConfig.title}</span>
|
<span className="font-medium">{nsiteVfsConfig.title}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex justify-between">
|
|
||||||
<span className="text-muted-foreground">Type</span>
|
|
||||||
<span className="font-medium">{siteLabel}</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<span className="text-muted-foreground">Relays</span>
|
<span className="text-muted-foreground">Relays</span>
|
||||||
<span className="font-medium">{relayCount} configured</span>
|
<span className="font-medium">{relayCount} configured</span>
|
||||||
@@ -660,9 +639,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
// .nsite/config.json wins; .git/shakespeare/deploy.json is the legacy fallback
|
// .nsite/config.json wins; .git/shakespeare/deploy.json is the legacy fallback
|
||||||
const savedSiteTitle = nsiteVfsConfig?.title ?? legacy?.siteTitle;
|
const savedSiteTitle = nsiteVfsConfig?.title ?? legacy?.siteTitle;
|
||||||
const savedSiteDescription = nsiteVfsConfig?.description ?? legacy?.siteDescription;
|
const savedSiteDescription = nsiteVfsConfig?.description ?? legacy?.siteDescription;
|
||||||
const savedSiteType = nsiteVfsConfig
|
|
||||||
? (nsiteVfsConfig.id === null ? 'root' : 'named')
|
|
||||||
: legacy?.siteType;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
@@ -672,10 +648,8 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
savedNsec={legacy?.nsec}
|
savedNsec={legacy?.nsec}
|
||||||
savedSiteTitle={savedSiteTitle}
|
savedSiteTitle={savedSiteTitle}
|
||||||
savedSiteDescription={savedSiteDescription}
|
savedSiteDescription={savedSiteDescription}
|
||||||
savedSiteType={savedSiteType}
|
|
||||||
onSiteTitleChange={handleNsiteSiteTitleChange}
|
onSiteTitleChange={handleNsiteSiteTitleChange}
|
||||||
onSiteDescriptionChange={handleNsiteSiteDescriptionChange}
|
onSiteDescriptionChange={handleNsiteSiteDescriptionChange}
|
||||||
onSiteTypeChange={handleNsiteSiteTypeChange}
|
|
||||||
/>
|
/>
|
||||||
{nsiteVfsConfig && (
|
{nsiteVfsConfig && (
|
||||||
<button
|
<button
|
||||||
@@ -977,7 +951,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
(selectedProvider.type === 'shakespeare' && !user) ||
|
(selectedProvider.type === 'shakespeare' && !user) ||
|
||||||
(selectedProvider.type === 'shakespeare' && !isShakespeareFormValid) ||
|
(selectedProvider.type === 'shakespeare' && !isShakespeareFormValid) ||
|
||||||
(selectedProvider.type === 'nsite' && !user) ||
|
(selectedProvider.type === 'nsite' && !user) ||
|
||||||
(selectedProvider.type === 'nsite' && nsiteForm.siteType === 'named' && !nsiteForm.dTag) ||
|
(selectedProvider.type === 'nsite' && !nsiteForm.dTag) ||
|
||||||
(selectedProvider.type === 'netlify' && !netlifyForm.siteId && !netlifyForm.siteName) ||
|
(selectedProvider.type === 'netlify' && !netlifyForm.siteId && !netlifyForm.siteName) ||
|
||||||
(selectedProvider.type === 'cloudflare' && !cloudflareForm.projectName) ||
|
(selectedProvider.type === 'cloudflare' && !cloudflareForm.projectName) ||
|
||||||
(selectedProvider.type === 'deno' && !denoDeployForm.projectName) ||
|
(selectedProvider.type === 'deno' && !denoDeployForm.projectName) ||
|
||||||
|
|||||||
@@ -1,39 +1,31 @@
|
|||||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import { AlertCircle, Globe, Tag } from 'lucide-react';
|
import { AlertCircle } from 'lucide-react';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import { Alert, AlertDescription } from '@/components/ui/alert';
|
import { Alert, AlertDescription } from '@/components/ui/alert';
|
||||||
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
|
|
||||||
|
|
||||||
interface NsiteDeployFormProps {
|
interface NsiteDeployFormProps {
|
||||||
/** Human-readable project name — used to default the title for named sites */
|
/** Human-readable project name — used to default the title */
|
||||||
projectName: string;
|
projectName: string;
|
||||||
/** Persisted values from a previous deployment */
|
/** Persisted values from a previous deployment */
|
||||||
savedSiteTitle?: string;
|
savedSiteTitle?: string;
|
||||||
savedSiteDescription?: string;
|
savedSiteDescription?: string;
|
||||||
savedSiteType?: 'named' | 'root';
|
|
||||||
/** Present only when the project was previously deployed with a dedicated keypair (v1) */
|
/** Present only when the project was previously deployed with a dedicated keypair (v1) */
|
||||||
savedNsec?: string;
|
savedNsec?: string;
|
||||||
onSiteTitleChange: (title: string) => void;
|
onSiteTitleChange: (title: string) => void;
|
||||||
onSiteDescriptionChange: (description: string) => void;
|
onSiteDescriptionChange: (description: string) => void;
|
||||||
onSiteTypeChange: (type: 'named' | 'root') => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NsiteDeployForm({
|
export function NsiteDeployForm({
|
||||||
projectName,
|
projectName,
|
||||||
savedSiteTitle,
|
savedSiteTitle,
|
||||||
savedSiteDescription,
|
savedSiteDescription,
|
||||||
savedSiteType,
|
|
||||||
savedNsec,
|
savedNsec,
|
||||||
onSiteTitleChange,
|
onSiteTitleChange,
|
||||||
onSiteDescriptionChange,
|
onSiteDescriptionChange,
|
||||||
onSiteTypeChange,
|
|
||||||
}: NsiteDeployFormProps) {
|
}: NsiteDeployFormProps) {
|
||||||
const [siteType, setSiteType] = useState<'named' | 'root'>(savedSiteType ?? 'named');
|
const [siteTitle, setSiteTitle] = useState(savedSiteTitle ?? projectName);
|
||||||
const [siteTitle, setSiteTitle] = useState(
|
|
||||||
savedSiteTitle ?? (savedSiteType === 'root' ? '' : projectName),
|
|
||||||
);
|
|
||||||
const [siteDescription, setSiteDescription] = useState(savedSiteDescription ?? '');
|
const [siteDescription, setSiteDescription] = useState(savedSiteDescription ?? '');
|
||||||
|
|
||||||
// On mount: sync all saved values to parent and set defaults.
|
// On mount: sync all saved values to parent and set defaults.
|
||||||
@@ -44,40 +36,17 @@ export function NsiteDeployForm({
|
|||||||
if (initializedRef.current) return;
|
if (initializedRef.current) return;
|
||||||
initializedRef.current = true;
|
initializedRef.current = true;
|
||||||
|
|
||||||
if (savedSiteType) onSiteTypeChange(savedSiteType);
|
|
||||||
if (savedSiteDescription) onSiteDescriptionChange(savedSiteDescription);
|
if (savedSiteDescription) onSiteDescriptionChange(savedSiteDescription);
|
||||||
|
|
||||||
const initialTitle = savedSiteTitle ?? (siteType === 'named' ? projectName : '');
|
const initialTitle = savedSiteTitle ?? projectName;
|
||||||
if (initialTitle !== siteTitle) setSiteTitle(initialTitle);
|
if (initialTitle !== siteTitle) setSiteTitle(initialTitle);
|
||||||
onSiteTitleChange(initialTitle);
|
onSiteTitleChange(initialTitle);
|
||||||
}, [savedSiteType, savedSiteDescription, savedSiteTitle, siteType, siteTitle, projectName, onSiteTypeChange, onSiteDescriptionChange, onSiteTitleChange]);
|
}, [savedSiteDescription, savedSiteTitle, siteTitle, projectName, onSiteDescriptionChange, onSiteTitleChange]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
stableSyncToParent();
|
stableSyncToParent();
|
||||||
}, [stableSyncToParent]);
|
}, [stableSyncToParent]);
|
||||||
|
|
||||||
// When the user switches site type, update the title default only if
|
|
||||||
// the current title still matches the previous type's auto-fill value.
|
|
||||||
const prevSiteTypeRef = useRef(siteType);
|
|
||||||
useEffect(() => {
|
|
||||||
const prev = prevSiteTypeRef.current;
|
|
||||||
prevSiteTypeRef.current = siteType;
|
|
||||||
if (prev === siteType) return;
|
|
||||||
|
|
||||||
if (siteType === 'named' && siteTitle === '') {
|
|
||||||
setSiteTitle(projectName);
|
|
||||||
onSiteTitleChange(projectName);
|
|
||||||
} else if (siteType === 'root' && siteTitle === projectName) {
|
|
||||||
setSiteTitle('');
|
|
||||||
onSiteTitleChange('');
|
|
||||||
}
|
|
||||||
}, [siteType, siteTitle, projectName, onSiteTitleChange]);
|
|
||||||
|
|
||||||
const handleSiteTypeChange = (value: 'named' | 'root') => {
|
|
||||||
setSiteType(value);
|
|
||||||
onSiteTypeChange(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSiteTitleChange = (value: string) => {
|
const handleSiteTitleChange = (value: string) => {
|
||||||
setSiteTitle(value);
|
setSiteTitle(value);
|
||||||
onSiteTitleChange(value);
|
onSiteTitleChange(value);
|
||||||
@@ -103,52 +72,6 @@ export function NsiteDeployForm({
|
|||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Site type */}
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Site Type</Label>
|
|
||||||
<RadioGroup
|
|
||||||
value={siteType}
|
|
||||||
onValueChange={handleSiteTypeChange}
|
|
||||||
className="space-y-2"
|
|
||||||
>
|
|
||||||
<div className="flex items-start gap-3 p-3 rounded-md border cursor-pointer hover:bg-muted/50 transition-colors">
|
|
||||||
<RadioGroupItem value="named" id="nsite-type-named" className="mt-0.5" />
|
|
||||||
<label htmlFor="nsite-type-named" className="flex-1 cursor-pointer">
|
|
||||||
<div className="flex items-center gap-2 font-medium text-sm">
|
|
||||||
<Tag className="h-3.5 w-3.5" />
|
|
||||||
Named site
|
|
||||||
</div>
|
|
||||||
<p className="text-xs text-muted-foreground mt-0.5">
|
|
||||||
A site with a unique identifier. You can have many named sites.
|
|
||||||
</p>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-start gap-3 p-3 rounded-md border cursor-pointer hover:bg-muted/50 transition-colors">
|
|
||||||
<RadioGroupItem value="root" id="nsite-type-root" className="mt-0.5" />
|
|
||||||
<label htmlFor="nsite-type-root" className="flex-1 cursor-pointer">
|
|
||||||
<div className="flex items-center gap-2 font-medium text-sm">
|
|
||||||
<Globe className="h-3.5 w-3.5" />
|
|
||||||
Root site
|
|
||||||
</div>
|
|
||||||
<p className="text-xs text-muted-foreground mt-0.5">
|
|
||||||
Your personal site at your npub address. You can only have one.
|
|
||||||
</p>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</RadioGroup>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Root site warning */}
|
|
||||||
{siteType === 'root' && (
|
|
||||||
<Alert>
|
|
||||||
<AlertCircle className="h-4 w-4" />
|
|
||||||
<AlertDescription>
|
|
||||||
You only have one root site per Nostr identity. Deploying here will replace any
|
|
||||||
existing root site published under your key.
|
|
||||||
</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Site title */}
|
{/* Site title */}
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label htmlFor="nsite-title">Site Title</Label>
|
<Label htmlFor="nsite-title">Site Title</Label>
|
||||||
|
|||||||
@@ -15,14 +15,13 @@ const nsiteProjectConfigSchema = z.object({
|
|||||||
type: z.literal('nsite'),
|
type: z.literal('nsite'),
|
||||||
url: z.string(),
|
url: z.string(),
|
||||||
data: z.object({
|
data: z.object({
|
||||||
/** Kept optional — only present on configs created before the signer migration */
|
|
||||||
/** Kept optional — only present on configs created before the signer migration */
|
/** Kept optional — only present on configs created before the signer migration */
|
||||||
nsec: z.string().optional(),
|
nsec: z.string().optional(),
|
||||||
siteTitle: z.string().optional(),
|
siteTitle: z.string().optional(),
|
||||||
siteDescription: z.string().optional(),
|
siteDescription: z.string().optional(),
|
||||||
/** Named-site dTag identifier (kind 35128). Absent → root site (kind 15128). */
|
/** Named-site dTag identifier (kind 35128). */
|
||||||
dTag: z.string().optional(),
|
dTag: z.string().optional(),
|
||||||
/** 'named' | 'root'. Absent on legacy configs — treated as 'named' by the form. */
|
/** @deprecated — Shakespeare always deploys named sites now. Kept for backward compat. */
|
||||||
siteType: z.enum(['named', 'root']).optional(),
|
siteType: z.enum(['named', 'root']).optional(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import git from 'isomorphic-git';
|
import git from 'isomorphic-git';
|
||||||
import { DotAI } from './DotAI';
|
import { DotAI } from './DotAI';
|
||||||
import { NostrURI } from './NostrURI';
|
import { NostrURI } from './NostrURI';
|
||||||
|
import { readNsiteVfsConfig } from './nsiteConfig';
|
||||||
import type { JSRuntimeFS } from './JSRuntime';
|
import type { JSRuntimeFS } from './JSRuntime';
|
||||||
|
|
||||||
/** Input for building a kind 31990 app event. */
|
/** Input for building a kind 31990 app event. */
|
||||||
@@ -97,6 +98,18 @@ export async function buildAppEvent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If an nsite deployment exists, add an "a" tag referencing the kind 35128 site manifest event
|
||||||
|
if (opts?.fs && opts.cwd && opts.pubkey) {
|
||||||
|
try {
|
||||||
|
const nsiteConfig = await readNsiteVfsConfig(opts.fs, opts.cwd);
|
||||||
|
if (nsiteConfig?.id) {
|
||||||
|
tags.push(['a', `35128:${opts.pubkey}:${nsiteConfig.id}`]);
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// No nsite config found, skip
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: JSON.stringify(content),
|
content: JSON.stringify(content),
|
||||||
tags,
|
tags,
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export function ChangelogPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<AppLayout>
|
<AppLayout>
|
||||||
<div className="max-w-2xl mx-auto">
|
<div className="max-w-2xl mr-auto">
|
||||||
<div className="flex items-center gap-3 mb-6">
|
<div className="flex items-center gap-3 mb-6">
|
||||||
<ScrollText className="size-6 text-primary" />
|
<ScrollText className="size-6 text-primary" />
|
||||||
<h1 className="text-2xl font-bold">Changelog</h1>
|
<h1 className="text-2xl font-bold">Changelog</h1>
|
||||||
@@ -120,7 +120,7 @@ function LatestRelease({ entry }: { entry: ChangelogEntry }) {
|
|||||||
href={`${GITLAB_REPO}/-/releases/v${entry.version}`}
|
href={`${GITLAB_REPO}/-/releases/v${entry.version}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="block text-center text-2xl font-bold tracking-tight hover:underline"
|
className="block text-2xl font-bold tracking-tight hover:underline"
|
||||||
>
|
>
|
||||||
v{entry.version}
|
v{entry.version}
|
||||||
</a>
|
</a>
|
||||||
@@ -128,7 +128,7 @@ function LatestRelease({ entry }: { entry: ChangelogEntry }) {
|
|||||||
href={`${GITLAB_REPO}/-/releases/v${entry.version}`}
|
href={`${GITLAB_REPO}/-/releases/v${entry.version}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="flex items-center justify-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors mt-1"
|
className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors mt-1"
|
||||||
>
|
>
|
||||||
{formatDate(entry.date)}
|
{formatDate(entry.date)}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in new issue
Block a user