Use Nut API development server instead of webcontainers (#50)

This commit is contained in:
Brian Hackett
2025-03-13 07:59:10 -07:00
committed by GitHub
parent 58f2cb0f58
commit 9e58d6bb64
40 changed files with 297 additions and 2356 deletions

View File

@@ -1,6 +1,6 @@
import { createTwoFilesPatch } from 'diff';
import type { FileMap } from '~/lib/stores/files';
import { MODIFICATIONS_TAG_NAME, WORK_DIR } from './constants';
import { MODIFICATIONS_TAG_NAME } from './constants';
export const modificationsRegex = new RegExp(
`^<${MODIFICATIONS_TAG_NAME}>[\\s\\S]*?<\\/${MODIFICATIONS_TAG_NAME}>\\s+`,
@@ -22,7 +22,7 @@ export function computeFileModifications(files: FileMap, modifiedFiles: Map<stri
for (const [filePath, originalContent] of modifiedFiles) {
const file = files[filePath];
if (file?.type !== 'file') {
if (!file) {
continue;
}
@@ -75,15 +75,6 @@ export function diffFiles(fileName: string, oldFileContent: string, newFileConte
return unifiedDiff;
}
const regex = new RegExp(`^${WORK_DIR}\/`);
/**
* Strips out the work directory from the file path.
*/
export function extractRelativePath(filePath: string) {
return filePath.replace(regex, '');
}
/**
* Converts the unified diff to HTML.
*