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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed apps/dashboard/public/assets/learn/hero.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
28 changes: 28 additions & 0 deletions apps/dashboard/scripts/deleteUnusedAssets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { promises as fs } from "node:fs";
import path from "node:path";

// after running logUnusedAssets.ts,
// 1. validate the output
// 2. If you think that a file should not be deleted, remove it from the output
// 3. paste the output files in `filesToDelete` and run this script to delete them
const filesToDelete: string[] = [];

async function deleteFiles() {
for (const filePath of filesToDelete) {
try {
const fullPath = path.join(process.cwd(), filePath);
await fs.unlink(fullPath);
console.log(`Deleted: ${filePath}`);
} catch (error) {
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
console.warn(`File not found: ${filePath}`);
} else {
console.error(`Error deleting ${filePath}:`, error);
}
}
}

console.log("--- DONE ---");
}

deleteFiles();
3 changes: 0 additions & 3 deletions apps/dashboard/scripts/logUnusedAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ const filesToIgnore = new Set([
// macOS stuff
"public/assets/product-pages/.DS_Store",
"public/assets/.DS_Store",
// pdfs
"public/Thirdweb_Terms_of_Service.pdf",
"public/thirdweb_Privacy_Policy_May_2022.pdf",
]);

function getAllFilesInFolder(folderPath: string) {
Expand Down
Loading