mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Update lockfile
This commit is contained in:
1 parent
cda2d0326b
commit
bae0ece813
2 files changed
+45
-1
No files matched your search
@@ -7,7 +7,7 @@ import { Send, Settings, Play, CloudUpload } from 'lucide-react';
|
||||
import { useAISettings } from '@/hooks/useAISettings';
|
||||
import { useFS } from '@/hooks/useFS';
|
||||
import { useJSRuntime } from '@/hooks/useJSRuntime';
|
||||
import { copyDirectory } from '@/lib/copyFiles';
|
||||
import { copyDirectory, copyFile } from '@/lib/copyFiles';
|
||||
import { generateSecretKey, getPublicKey, nip19 } from 'nostr-tools';
|
||||
import { bytesToHex } from 'nostr-tools/utils';
|
||||
import { MessageItem } from '@/components/ai/MessageItem';
|
||||
@@ -77,6 +77,15 @@ export function ChatPane({ projectId, projectName }: ChatPaneProps) {
|
||||
} catch (error) {
|
||||
console.error('Failed to copy dist:', error);
|
||||
}
|
||||
|
||||
// Copy package-lock.json from runtime back to project filesystem
|
||||
const packageLockPath = `/projects/${projectId}/package-lock.json`;
|
||||
try {
|
||||
await copyFile(runtimeFS, browserFS, 'package-lock.json', packageLockPath);
|
||||
console.log('Successfully copied package-lock.json from runtime');
|
||||
} catch (error) {
|
||||
console.error('Failed to copy package-lock.json:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const runDeploy = async () => {
|
||||
|
||||
@@ -59,6 +59,41 @@ export async function copyFiles(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a single file between JSRuntime filesystems
|
||||
* @param sourceFS Source filesystem
|
||||
* @param targetFS Target filesystem
|
||||
* @param sourcePath Source file path
|
||||
* @param targetPath Target file path
|
||||
*/
|
||||
export async function copyFile(
|
||||
sourceFS: JSRuntimeFS,
|
||||
targetFS: JSRuntimeFS,
|
||||
sourcePath: string,
|
||||
targetPath: string
|
||||
): Promise<void> {
|
||||
try {
|
||||
console.log(`Copying file: ${sourcePath} -> ${targetPath}`);
|
||||
|
||||
// Check if source exists and is a file
|
||||
const sourceStat = await sourceFS.stat(sourcePath);
|
||||
if (!sourceStat.isFile()) {
|
||||
throw new Error(`Source path ${sourcePath} is not a file`);
|
||||
}
|
||||
|
||||
// Read the file content
|
||||
const content = await sourceFS.readFile(sourcePath);
|
||||
|
||||
// Write to target
|
||||
await targetFS.writeFile(targetPath, content);
|
||||
|
||||
console.log(`Successfully copied file ${sourcePath} to ${targetPath}`);
|
||||
} catch (error) {
|
||||
console.error(`Failed to copy file ${sourcePath} to ${targetPath}:`, error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a directory between JSRuntime filesystems
|
||||
* Convenience wrapper for copyFiles with better error handling
|
||||
|
||||
Reference in new issue
Block a user