Merge remote-tracking branch 'origin/main' into nostr-git-support

This commit is contained in:
Alex Gleason committed 2025-10-15 14:59:02 -05:00
commit 6a456e64f0
17 files changed
+151 -28

No files matched your search

+1
View File
@@ -49,6 +49,7 @@ describe('useAIProjectId', () => {
previewDomain: 'local-shakespeare.dev',
showcaseEnabled: true,
showcaseModerator: 'npub1jvnpg4c6ljadf5t6ry0w9q0rnm4mksde87kglkrc993z46c39axsgq89sc',
ngitServers: ['git.shakespeare.diy', 'relay.ngit.dev'],
},
updateConfig: vi.fn(),
});
+4
View File
@@ -41,6 +41,7 @@ function createWrapper(corsProxy: string) {
previewDomain: 'local-test.dev',
showcaseEnabled: true,
showcaseModerator: 'npub1jvnpg4c6ljadf5t6ry0w9q0rnm4mksde87kglkrc993z46c39axsgq89sc',
ngitServers: ['git.shakespeare.diy', 'relay.ngit.dev'],
};
return createElement(
@@ -81,6 +82,7 @@ describe('useGit', () => {
fs: mockFS,
nostr: mockNostr,
corsProxy: 'https://cors.isomorphic-git.org',
ngitServers: ['git.shakespeare.diy', 'relay.ngit.dev'],
});
expect(result.current).toEqual({ git: expect.any(Object) });
});
@@ -94,6 +96,7 @@ describe('useGit', () => {
fs: mockFS,
nostr: mockNostr,
corsProxy: 'https://custom-cors.example.com',
ngitServers: ['git.shakespeare.diy', 'relay.ngit.dev'],
});
expect(result.current).toEqual({ git: expect.any(Object) });
});
@@ -107,6 +110,7 @@ describe('useGit', () => {
fs: mockFS,
nostr: mockNostr,
corsProxy: 'https://cors.isomorphic-git.org',
ngitServers: ['git.shakespeare.diy', 'relay.ngit.dev'],
});
// Rerender with a different wrapper (different CORS proxy)
+3 -3
View File
@@ -12,11 +12,11 @@ export function useGit(): { git: Git } {
const { fs } = useFS();
const { nostr } = useNostr();
const { config } = useAppContext();
const { corsProxy } = config;
const { corsProxy, ngitServers } = config;
const git = useMemo(() => {
return new Git({ fs, nostr, corsProxy });
}, [fs, nostr, corsProxy]);
return new Git({ fs, nostr, corsProxy, ngitServers });
}, [fs, nostr, corsProxy, ngitServers]);
return { git };
}
+1
View File
@@ -22,6 +22,7 @@ function Wrapper({ children }: { children: React.ReactNode }) {
previewDomain: 'local-test.dev',
showcaseEnabled: true,
showcaseModerator: 'npub1jvnpg4c6ljadf5t6ry0w9q0rnm4mksde87kglkrc993z46c39axsgq89sc',
ngitServers: ['git.shakespeare.diy', 'relay.ngit.dev'],
};
return createElement(