r2pde-ai 0.1.4 → 0.1.5

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.
@@ -102,6 +102,21 @@ async function scaffoldCreateHandler(opts) {
102
102
  }
103
103
  }
104
104
  }
105
+ // Copiar a pasta dist do projeto original para o scaffold gerado
106
+ try {
107
+ const sourceDist = path.resolve(__dirname, '../../dist');
108
+ const targetDist = path.join(cwd, 'dist');
109
+ if (fs.existsSync(sourceDist)) {
110
+ copyFolderRecursiveSync(sourceDist, targetDist);
111
+ logSuccess('Pasta dist copiada para o scaffold gerado.');
112
+ }
113
+ else {
114
+ logWarn('Pasta dist não encontrada para copiar.');
115
+ }
116
+ }
117
+ catch (err) {
118
+ logError('Erro ao copiar pasta dist: ' + err);
119
+ }
105
120
  if (!hasCriticalError) {
106
121
  logSuccess('Scaffold concluído com sucesso!');
107
122
  }
@@ -109,6 +124,25 @@ async function scaffoldCreateHandler(opts) {
109
124
  logError('Scaffold finalizado com erros críticos. Revise as mensagens acima.');
110
125
  }
111
126
  }
127
+ // Função utilitária para cópia recursiva de pastas
128
+ function copyFolderRecursiveSync(source, target) {
129
+ if (!fs.existsSync(target)) {
130
+ fs.mkdirSync(target, { recursive: true });
131
+ }
132
+ if (fs.lstatSync(source).isDirectory()) {
133
+ const files = fs.readdirSync(source);
134
+ for (const file of files) {
135
+ const curSource = path.join(source, file);
136
+ const curTarget = path.join(target, file);
137
+ if (fs.lstatSync(curSource).isDirectory()) {
138
+ copyFolderRecursiveSync(curSource, curTarget);
139
+ }
140
+ else {
141
+ fs.copyFileSync(curSource, curTarget);
142
+ }
143
+ }
144
+ }
145
+ }
112
146
  export const scaffoldCreateCommand = new Command('scaffold-create')
113
147
  .description('Gera um projeto de exemplo a partir de um arquivo de guia YAML')
114
148
  .option('--guide <yaml>', 'Caminho para o arquivo de guia YAML (busca automática se não especificado)')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "r2pde-ai",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Pilot Driven Engineering — A CLI framework that bridges the gap between architectural intent and AI-generated code.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",