docuapi 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/index.js +21 -17
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -45,31 +45,35 @@ console.log(`caminho da pasta: ${packageJsonPath}`)
45
45
 
46
46
  const packageJsonRaw = fs.readFileSync(packageJsonPath, "utf-8");
47
47
 
48
- console.log(packageJsonRaw)
48
+ //console.log(packageJsonRaw)
49
49
 
50
50
  const packageJson = JSON.parse(packageJsonRaw);
51
51
 
52
52
  console.log(`O projeto ${packageJson.name} na versão ${packageJson.version}, tem as seguintes dependencias:`)
53
53
  console.log(packageJson.dependencies)
54
54
 
55
- // const IGNORE_DIRS = ["node_modules", ".git", ".vscode"];
55
+ const IGNORE_DIRS = ["node_modules", ".git", ".vscode"];
56
+
57
+ function scanDir(dirPath, padding) {
58
+ const entries = fs.readdirSync(dirPath, { withFileTypes: true });
56
59
 
57
- // function scanDir(dirPath) {
58
- // const entries = fs.readdirSync(dirPath, { withFileTypes: true });
59
60
 
60
- // for (const entry of entries) {
61
- // if (IGNORE_DIRS.includes(entry.name)) continue;
61
+ for (const entry of entries) {
62
+ if (IGNORE_DIRS.includes(entry.name)) continue;
62
63
 
63
- // const fullPath = path.join(dirPath, entry.name);
64
+ const fullPath = path.join(dirPath, entry.name);
64
65
 
65
- // if (entry.isDirectory()) {
66
- // console.log("📂 Pasta:", fullPath);
67
- // scanDir(fullPath);
68
- // } else {
69
- // console.log("📄 Arquivo:", fullPath);
70
- // }
71
- // }
72
- // }
66
+ if (entry.isDirectory()) {
67
+
68
+ console.log(" ".repeat(padding*2), "📂", entry.name);
69
+ padding ++
70
+ scanDir(fullPath, padding);
71
+ padding --
72
+ } else {
73
+ console.log(" ".repeat(padding*2), "📄", entry.name);
74
+ }
75
+ }
76
+ }
73
77
 
74
- // console.log("\n🌳 Estrutura do projeto:\n");
75
- // scanDir(projectRoot);
78
+ console.log("\n🌳 Estrutura do projeto:\n");
79
+ scanDir(projectRoot, 0);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "bin": {
4
4
  "analyze": "./bin/index.js"
5
5
  },
6
- "version": "1.0.2",
6
+ "version": "1.0.3",
7
7
  "description": "CLI de teste para gerar documentação automática de APIs",
8
8
  "main": "index.js",
9
9
  "scripts": {