const fs = require('fs');
const path = require('path');

function listFiles(dir) {
  if (!fs.existsSync(dir)) {
    console.log(`${dir} does not exist`);
    return;
  }
  const files = fs.readdirSync(dir);
  for (const file of files) {
    const fullPath = path.join(dir, file);
    const stat = fs.statSync(fullPath);
    console.log((stat.isDirectory() ? '[DIR] ' : '[FILE] ') + fullPath);
    if (stat.isDirectory()) {
      listFiles(fullPath);
    }
  }
}

listFiles('dist');
