mdsmith 1.0.0 → 1.0.2
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.
- package/bin/index.js +15 -14
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// npx
|
|
4
|
-
// npx
|
|
5
|
-
// npx
|
|
6
|
-
// npx
|
|
3
|
+
// npx mdsmith --help # ajuda
|
|
4
|
+
// npx mdsmith --tree # mostra estrutura
|
|
5
|
+
// npx mdsmith --deps # mostra dependências
|
|
6
|
+
// npx mdsmith --readme # gera README
|
|
7
7
|
|
|
8
8
|
const fs = require("fs");
|
|
9
9
|
|
|
@@ -63,7 +63,7 @@ function generateReadme(packageJson, tree){
|
|
|
63
63
|
const content = `
|
|
64
64
|
# ${packageJson.name || "Nome não informado."}
|
|
65
65
|
|
|
66
|
-
${packageJson.description || "Projeto Node.js analisado automaticamente pelo
|
|
66
|
+
${packageJson.description || "Projeto Node.js analisado automaticamente pelo mdSmith."}
|
|
67
67
|
|
|
68
68
|
## 🔖 Informações
|
|
69
69
|
- **Versão:** ${packageJson.version || "Versão não informada."}
|
|
@@ -78,7 +78,7 @@ ${formatDependencies(packageJson.dependencies)}
|
|
|
78
78
|
${tree}
|
|
79
79
|
\`\`\`
|
|
80
80
|
|
|
81
|
-
📄 *README gerado automaticamente pelo **
|
|
81
|
+
📄 *README gerado automaticamente pelo **mdSmith***
|
|
82
82
|
`
|
|
83
83
|
|
|
84
84
|
return content
|
|
@@ -87,18 +87,18 @@ ${tree}
|
|
|
87
87
|
|
|
88
88
|
if(args.length == 0){
|
|
89
89
|
console.log(`
|
|
90
|
-
Bem vindo ao
|
|
90
|
+
Bem vindo ao mdSmith!
|
|
91
91
|
Analisador de projetos Node.js
|
|
92
92
|
|
|
93
|
-
Digite
|
|
93
|
+
Digite npx mdsmith --help se quiser ver os comandos disponíveis
|
|
94
94
|
`);
|
|
95
95
|
process.exit(0);
|
|
96
96
|
} else if(args.includes("--help")){
|
|
97
97
|
console.log(`
|
|
98
|
-
npx
|
|
99
|
-
npx
|
|
100
|
-
npx
|
|
101
|
-
npx
|
|
98
|
+
npx mdsmith --help Mostra os comandos possíveis
|
|
99
|
+
npx mdsmith --tree Mostra a estrutura do projeto
|
|
100
|
+
npx mdsmith --deps Mostra as dependências
|
|
101
|
+
npx mdsmith --readme Gera um README automaticamente
|
|
102
102
|
`)
|
|
103
103
|
} else if (args.includes("--tree")){
|
|
104
104
|
console.log("\n🌳 Estrutura do projeto:\n");
|
|
@@ -110,7 +110,8 @@ if(args.length == 0){
|
|
|
110
110
|
} else if (args.includes("--readme")){
|
|
111
111
|
const content = generateReadme(packageJson, scanDir(projectRoot, 0))
|
|
112
112
|
|
|
113
|
-
fs.writeFileSync("README-
|
|
113
|
+
fs.writeFileSync("README-MDSMITH.md", content)
|
|
114
|
+
console.log("✅ README-MDSMITH.md gerado com sucesso!")
|
|
114
115
|
} else {
|
|
115
|
-
console.log("❌ Comando não reconhecido. Use --help para ver as opções.")
|
|
116
|
+
console.log("❌ Comando não reconhecido. Use npx mdsmith --help para ver as opções.")
|
|
116
117
|
}
|
package/package.json
CHANGED