mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 08:23:34 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9390ae4152 | ||
|
|
7ecab519ed | ||
|
|
85afb6828e | ||
|
|
d4d6ff0d89 | ||
|
|
f29510ed00 |
No files matched your search
@@ -1,5 +1,15 @@
|
||||
# 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
|
||||
|
||||
### Added
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
|
||||
"homepage": "https://shakespeare.diy",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"version": "9.9.1",
|
||||
"version": "9.9.2",
|
||||
"type": "module",
|
||||
"author": {
|
||||
"name": "shakespeare.diy",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# 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
|
||||
|
||||
### Added
|
||||
|
||||
+1
-4
@@ -8,7 +8,6 @@ import { Suspense, useEffect } from 'react';
|
||||
import LightningFS from '@isomorphic-git/lightning-fs';
|
||||
import NostrProvider from '@/components/NostrProvider';
|
||||
import { NostrSync } from '@/components/NostrSync';
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { NostrLoginProvider } from '@nostrify/react/login';
|
||||
import { AppProvider } from '@/components/AppProvider';
|
||||
@@ -30,7 +29,7 @@ import { OfflineIndicator } from '@/components/OfflineIndicator';
|
||||
import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt';
|
||||
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
||||
import { LockdownModeDetector } from '@/components/LockdownModeDetector';
|
||||
import { VersionCheck } from '@/components/VersionCheck';
|
||||
|
||||
|
||||
import AppRouter from './AppRouter';
|
||||
|
||||
@@ -149,11 +148,9 @@ export function App() {
|
||||
<GitSyncProvider>
|
||||
<SessionManagerProvider>
|
||||
<TooltipProvider>
|
||||
<Toaster />
|
||||
<DynamicFavicon />
|
||||
<OfflineIndicator />
|
||||
<PWAUpdatePrompt />
|
||||
<VersionCheck />
|
||||
<LockdownModeDetector />
|
||||
<Suspense>
|
||||
<AppRouter />
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
||||
import { Toaster } from "./components/ui/toaster";
|
||||
import { ScrollToTop } from "./components/ScrollToTop";
|
||||
import { SessionMonitor } from "./components/SessionMonitor";
|
||||
import { URLFragmentHandler } from "./components/URLFragmentHandler";
|
||||
import { VersionCheck } from "./components/VersionCheck";
|
||||
|
||||
import Index from "./pages/Index";
|
||||
import Clone from "./pages/Clone";
|
||||
@@ -28,6 +30,8 @@ import { ChangelogPage } from "./pages/ChangelogPage";
|
||||
export function AppRouter() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Toaster />
|
||||
<VersionCheck />
|
||||
<ScrollToTop />
|
||||
<SessionMonitor />
|
||||
<URLFragmentHandler />
|
||||
|
||||
@@ -19,8 +19,11 @@ async function fetchChangelogExcerpt(version: string): Promise<string | undefine
|
||||
const entry = entries.find((e) => e.version === version) ?? entries[0];
|
||||
if (!entry) return undefined;
|
||||
|
||||
// Return the first item from the first section.
|
||||
return entry.sections[0]?.items[0];
|
||||
// Return a truncated first item from the first section.
|
||||
const item = entry.sections[0]?.items[0];
|
||||
if (!item) return undefined;
|
||||
if (item.length <= 60) return item;
|
||||
return item.slice(0, 60).trimEnd() + '…';
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,6 @@ interface NsiteFormData {
|
||||
siteTitle: string;
|
||||
siteDescription: string;
|
||||
dTag: string;
|
||||
siteType: 'named' | 'root';
|
||||
}
|
||||
|
||||
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 not, show the full form so the user can configure for the first time.
|
||||
if (cfg) {
|
||||
const derivedSiteType = cfg.id === null ? 'root' : 'named';
|
||||
setNsiteForm({
|
||||
siteTitle: cfg.title ?? '',
|
||||
siteDescription: cfg.description ?? '',
|
||||
dTag: (cfg.id != null && cfg.id !== '') ? cfg.id : '',
|
||||
siteType: derivedSiteType,
|
||||
});
|
||||
setNsiteShowFullForm(false);
|
||||
} else {
|
||||
@@ -197,7 +194,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
siteTitle: '',
|
||||
siteDescription: '',
|
||||
dTag: '',
|
||||
siteType: 'named',
|
||||
});
|
||||
const [netlifyForm, setNetlifyForm] = useState<NetlifyFormData>({
|
||||
siteId: '',
|
||||
@@ -283,9 +279,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
siteTitle: nsiteForm.siteTitle || undefined,
|
||||
siteDescription: nsiteForm.siteDescription || undefined,
|
||||
sourceUrl,
|
||||
siteIdentifier: nsiteForm.siteType === 'named' && nsiteForm.dTag
|
||||
? nsiteForm.dTag
|
||||
: undefined,
|
||||
siteIdentifier: nsiteForm.dTag || undefined,
|
||||
});
|
||||
} else if (selectedProvider.type === 'netlify') {
|
||||
const netlifyProvider = selectedProvider;
|
||||
@@ -397,7 +391,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
siteTitle: nsiteForm.siteTitle || undefined,
|
||||
siteDescription: nsiteForm.siteDescription || undefined,
|
||||
dTag: nsiteForm.dTag || undefined,
|
||||
siteType: nsiteForm.siteType,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -407,7 +400,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
const newNsiteVfsConfig: NsiteVfsConfig = {
|
||||
relays: nsiteProvider.relayUrls,
|
||||
servers: nsiteProvider.blossomServers,
|
||||
id: nsiteForm.siteType === 'root' ? null : (nsiteForm.dTag || undefined),
|
||||
id: nsiteForm.dTag || undefined,
|
||||
title: nsiteForm.siteTitle || undefined,
|
||||
description: nsiteForm.siteDescription || undefined,
|
||||
fallback: '/index.html',
|
||||
@@ -524,7 +517,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
setError(null);
|
||||
// Reset forms
|
||||
setShakespeareForm({ subdomain: projectId });
|
||||
setNsiteForm({ siteTitle: '', siteDescription: '', dTag: '', siteType: 'named' });
|
||||
setNsiteForm({ siteTitle: '', siteDescription: '', dTag: '' });
|
||||
setNetlifyForm({ siteId: '', siteName: '' });
|
||||
setVercelForm({ projectName: projectName || projectId, teamId: '' });
|
||||
setCloudflareForm({ projectName: projectName || projectId });
|
||||
@@ -556,10 +549,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
setNsiteForm(prev => ({ ...prev, siteDescription }));
|
||||
}, []);
|
||||
|
||||
const handleNsiteSiteTypeChange = useCallback((siteType: 'named' | 'root') => {
|
||||
setNsiteForm(prev => ({ ...prev, siteType }));
|
||||
}, []);
|
||||
|
||||
const handleNetlifySiteChange = useCallback((siteId: string, siteName: string) => {
|
||||
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
|
||||
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 serverCount = nsiteVfsConfig.servers?.length ?? 0;
|
||||
|
||||
@@ -629,10 +612,6 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
<span className="font-medium">{nsiteVfsConfig.title}</span>
|
||||
</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">
|
||||
<span className="text-muted-foreground">Relays</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
|
||||
const savedSiteTitle = nsiteVfsConfig?.title ?? legacy?.siteTitle;
|
||||
const savedSiteDescription = nsiteVfsConfig?.description ?? legacy?.siteDescription;
|
||||
const savedSiteType = nsiteVfsConfig
|
||||
? (nsiteVfsConfig.id === null ? 'root' : 'named')
|
||||
: legacy?.siteType;
|
||||
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
@@ -672,10 +648,8 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
savedNsec={legacy?.nsec}
|
||||
savedSiteTitle={savedSiteTitle}
|
||||
savedSiteDescription={savedSiteDescription}
|
||||
savedSiteType={savedSiteType}
|
||||
onSiteTitleChange={handleNsiteSiteTitleChange}
|
||||
onSiteDescriptionChange={handleNsiteSiteDescriptionChange}
|
||||
onSiteTypeChange={handleNsiteSiteTypeChange}
|
||||
/>
|
||||
{nsiteVfsConfig && (
|
||||
<button
|
||||
@@ -977,7 +951,7 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
||||
(selectedProvider.type === 'shakespeare' && !user) ||
|
||||
(selectedProvider.type === 'shakespeare' && !isShakespeareFormValid) ||
|
||||
(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 === 'cloudflare' && !cloudflareForm.projectName) ||
|
||||
(selectedProvider.type === 'deno' && !denoDeployForm.projectName) ||
|
||||
|
||||
@@ -1,39 +1,31 @@
|
||||
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 { Input } from '@/components/ui/input';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { Alert, AlertDescription } from '@/components/ui/alert';
|
||||
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
|
||||
|
||||
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;
|
||||
/** Persisted values from a previous deployment */
|
||||
savedSiteTitle?: string;
|
||||
savedSiteDescription?: string;
|
||||
savedSiteType?: 'named' | 'root';
|
||||
/** Present only when the project was previously deployed with a dedicated keypair (v1) */
|
||||
savedNsec?: string;
|
||||
onSiteTitleChange: (title: string) => void;
|
||||
onSiteDescriptionChange: (description: string) => void;
|
||||
onSiteTypeChange: (type: 'named' | 'root') => void;
|
||||
}
|
||||
|
||||
export function NsiteDeployForm({
|
||||
projectName,
|
||||
savedSiteTitle,
|
||||
savedSiteDescription,
|
||||
savedSiteType,
|
||||
savedNsec,
|
||||
onSiteTitleChange,
|
||||
onSiteDescriptionChange,
|
||||
onSiteTypeChange,
|
||||
}: NsiteDeployFormProps) {
|
||||
const [siteType, setSiteType] = useState<'named' | 'root'>(savedSiteType ?? 'named');
|
||||
const [siteTitle, setSiteTitle] = useState(
|
||||
savedSiteTitle ?? (savedSiteType === 'root' ? '' : projectName),
|
||||
);
|
||||
const [siteTitle, setSiteTitle] = useState(savedSiteTitle ?? projectName);
|
||||
const [siteDescription, setSiteDescription] = useState(savedSiteDescription ?? '');
|
||||
|
||||
// On mount: sync all saved values to parent and set defaults.
|
||||
@@ -44,40 +36,17 @@ export function NsiteDeployForm({
|
||||
if (initializedRef.current) return;
|
||||
initializedRef.current = true;
|
||||
|
||||
if (savedSiteType) onSiteTypeChange(savedSiteType);
|
||||
if (savedSiteDescription) onSiteDescriptionChange(savedSiteDescription);
|
||||
|
||||
const initialTitle = savedSiteTitle ?? (siteType === 'named' ? projectName : '');
|
||||
const initialTitle = savedSiteTitle ?? projectName;
|
||||
if (initialTitle !== siteTitle) setSiteTitle(initialTitle);
|
||||
onSiteTitleChange(initialTitle);
|
||||
}, [savedSiteType, savedSiteDescription, savedSiteTitle, siteType, siteTitle, projectName, onSiteTypeChange, onSiteDescriptionChange, onSiteTitleChange]);
|
||||
}, [savedSiteDescription, savedSiteTitle, siteTitle, projectName, onSiteDescriptionChange, onSiteTitleChange]);
|
||||
|
||||
useEffect(() => {
|
||||
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) => {
|
||||
setSiteTitle(value);
|
||||
onSiteTitleChange(value);
|
||||
@@ -103,52 +72,6 @@ export function NsiteDeployForm({
|
||||
</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 */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="nsite-title">Site Title</Label>
|
||||
|
||||
@@ -15,14 +15,13 @@ const nsiteProjectConfigSchema = z.object({
|
||||
type: z.literal('nsite'),
|
||||
url: z.string(),
|
||||
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 */
|
||||
nsec: z.string().optional(),
|
||||
siteTitle: 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(),
|
||||
/** '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(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import git from 'isomorphic-git';
|
||||
import { DotAI } from './DotAI';
|
||||
import { NostrURI } from './NostrURI';
|
||||
import { readNsiteVfsConfig } from './nsiteConfig';
|
||||
import type { JSRuntimeFS } from './JSRuntime';
|
||||
|
||||
/** 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 {
|
||||
content: JSON.stringify(content),
|
||||
tags,
|
||||
|
||||
@@ -56,7 +56,7 @@ export function ChangelogPage() {
|
||||
|
||||
return (
|
||||
<AppLayout>
|
||||
<div className="max-w-2xl mx-auto">
|
||||
<div className="max-w-2xl mr-auto">
|
||||
<div className="flex items-center gap-3 mb-6">
|
||||
<ScrollText className="size-6 text-primary" />
|
||||
<h1 className="text-2xl font-bold">Changelog</h1>
|
||||
@@ -120,7 +120,7 @@ function LatestRelease({ entry }: { entry: ChangelogEntry }) {
|
||||
href={`${GITLAB_REPO}/-/releases/v${entry.version}`}
|
||||
target="_blank"
|
||||
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}
|
||||
</a>
|
||||
@@ -128,7 +128,7 @@ function LatestRelease({ entry }: { entry: ChangelogEntry }) {
|
||||
href={`${GITLAB_REPO}/-/releases/v${entry.version}`}
|
||||
target="_blank"
|
||||
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)}
|
||||
</a>
|
||||
|
||||
Reference in new issue
Block a user