Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/convertProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ ${content}`;
}
}

export function exportProjectWithBufferAssetsToZip(project: Project): JSZip {
const converted = project.toLeopard({});
export async function exportProjectWithBufferAssetsToZip(project: Project): Promise<JSZip> {
const converted = await project.toLeopard({});
postProcessLeopardFiles(converted);

const zip = new JSZip();
Expand Down Expand Up @@ -65,7 +65,7 @@ export function exportProjectWithBufferAssetsToZip(project: Project): JSZip {
export async function exportProjectWithURLAssetsToCodeSandbox(
project: Project,
): Promise<string> {
const converted = project.toLeopard({});
const converted = await project.toLeopard({});
postProcessLeopardFiles(converted);

let files: { [name: string]: { content: string; isBinary: boolean } } = {};
Expand Down
2 changes: 1 addition & 1 deletion pages/api/[projectId]/leopard-website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default async function convertToLeopardWebsite(
},
});

const converted = project.toLeopard();
const converted = await project.toLeopard();

let assetUploadPromises = [];
let alreadyUploadedAssetNames: Set<string> = new Set();
Expand Down
2 changes: 1 addition & 1 deletion pages/api/[projectId]/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function convertToZip(
},
});

const convertedZip = exportProjectWithBufferAssetsToZip(project);
const convertedZip = await exportProjectWithBufferAssetsToZip(project);
const buffer = await convertedZip.generateAsync({ type: "nodebuffer" });
res.setHeader("Content-Type", "application/zip");
res.setHeader("Content-Disposition", "attachment; filename=converted.zip");
Expand Down
2 changes: 1 addition & 1 deletion pages/api/upload/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function uploadToZip(
},
});

const convertedZip = exportProjectWithBufferAssetsToZip(project);
const convertedZip = await exportProjectWithBufferAssetsToZip(project);
const buffer = await convertedZip.generateAsync({ type: "nodebuffer" });
res.setHeader("Content-Type", "application/zip");
res.setHeader("Content-Disposition", "attachment; filename=converted.zip");
Expand Down