r2pde-ai 0.1.7 → 0.1.8

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.
@@ -11,37 +11,3 @@ project:
11
11
 
12
12
 
13
13
  # Essenciais
14
- - type: file
15
- path: README.md
16
- content: |
17
- # Corporate Agenda
18
- Aplicação de agenda corporativa com gestão de usuários e integração com Outlook/Google Calendar.
19
- Gerada via onboarding automatizado r2pde-ai.
20
- - type: file
21
- path: .r2pde-ai/pde.index.md
22
- content: |
23
- # PDE Index
24
- - manifests: .r2pde-ai/manifests/
25
- - contracts: .r2pde-ai/contracts/
26
- - requirements: .r2pde-ai/requirements/
27
- - type: file
28
- path: .r2pde-ai/pde.config.json
29
- content: |
30
- {
31
- "version": "0.1.0",
32
- "language": "en",
33
- "artifactsLanguage": "en",
34
- "git": { "autoCommit": false, "commitMessagePrefix": "pde:" },
35
- "score": { "green": { "max": 30 }, "yellow": { "max": 70 }, "red": { "max": 100 } },
36
- "ai": { "apiUrl": "", "apiKey": "", "model": "" },
37
- "project": {
38
- "type": "dashboard",
39
- "architecture": "monolith",
40
- "maturity": "production",
41
- "hasAuth": true,
42
- "hasPayment": false,
43
- "hasIntegrations": true,
44
- "audience": "b2b",
45
- "stack": "Node.js / TypeScript"
46
- }
47
- }
@@ -99,10 +99,14 @@ export async function contractCreateCommand() {
99
99
  return;
100
100
  }
101
101
  let template = fs.readFileSync(templatePath, { encoding: 'utf8' });
102
- template = template.replace('[Name]', name);
103
- const meta = `---\nname: ${name}\ntype: ${type}\nenforcement: ${enforcement}\ndescription: ${description}\nchangeType: ${changeType}\ncreatedAt: ${new Date().toISOString()}\n---\n\n`;
104
- const content = meta + template;
105
- fs.writeFileSync(filePath, content, { encoding: 'utf8' });
102
+ // Substituir todos os placeholders do template
103
+ template = template.replace(/\{\{name\}\}/gi, name)
104
+ .replace(/\{\{type\}\}/gi, type)
105
+ .replace(/\{\{enforcement\}\}/gi, enforcement)
106
+ .replace(/\{\{description\}\}/gi, description)
107
+ .replace(/\{\{changeType\}\}/gi, changeType)
108
+ .replace(/\{\{createdAt\}\}/gi, new Date().toISOString());
109
+ fs.writeFileSync(filePath, template, { encoding: 'utf8' });
106
110
  // Step 5 — Update pde.index.md
107
111
  if (fs.existsSync(paths.index)) {
108
112
  let indexContent = fs.readFileSync(paths.index, { encoding: 'utf8' });
@@ -94,10 +94,13 @@ export async function manifestCreateCommand() {
94
94
  return;
95
95
  }
96
96
  let template = fs.readFileSync(templatePath, 'utf8');
97
- template = template.replace('[Name]', name);
98
- const meta = `---\nname: ${name}\nscope: ${scope}\ndescription: ${description}\nchangeType: ${changeType}\ncreatedAt: ${new Date().toISOString()}\n---\n\n`;
99
- const content = meta + template;
100
- fs.writeFileSync(filePath, content, { encoding: 'utf8' });
97
+ // Substituir todos os placeholders do template
98
+ template = template.replace(/\{\{name\}\}/gi, name)
99
+ .replace(/\{\{scope\}\}/gi, scope)
100
+ .replace(/\{\{description\}\}/gi, description)
101
+ .replace(/\{\{changeType\}\}/gi, changeType)
102
+ .replace(/\{\{createdAt\}\}/gi, new Date().toISOString());
103
+ fs.writeFileSync(filePath, template, { encoding: 'utf8' });
101
104
  // Step 5 — Update pde.index.md
102
105
  if (fs.existsSync(paths.index)) {
103
106
  let indexContent = fs.readFileSync(paths.index, { encoding: 'utf8' });
@@ -99,12 +99,15 @@ export async function requirementCreateCommand() {
99
99
  return;
100
100
  }
101
101
  let template = fs.readFileSync(templatePath, { encoding: 'utf8' });
102
- template = template.replace('[Name]', name);
103
- const meta = `---\nname: ${name}\ntype: ${type}\npriority: ${priority}\ndescription: ${description}\nchangeType: ${changeType}\ncreatedAt: ${new Date().toISOString()}\n---\n\n`;
104
- const criteriaLines = criteria.split(',').map((c) => `- ${c.trim()}`).join('\n');
105
- const criteriaSection = `## Acceptance Criteria\n${criteriaLines}\n\n`;
106
- const content = meta + criteriaSection + template;
107
- fs.writeFileSync(filePath, content, { encoding: 'utf8' });
102
+ // Substituir todos os placeholders do template
103
+ template = template.replace(/\{\{name\}\}/gi, name)
104
+ .replace(/\{\{type\}\}/gi, type)
105
+ .replace(/\{\{priority\}\}/gi, priority)
106
+ .replace(/\{\{description\}\}/gi, description)
107
+ .replace(/\{\{changeType\}\}/gi, changeType)
108
+ .replace(/\{\{criteria\}\}/gi, criteria)
109
+ .replace(/\{\{createdAt\}\}/gi, new Date().toISOString());
110
+ fs.writeFileSync(filePath, template, { encoding: 'utf8' });
108
111
  // Step 5 — Update pde.index.md
109
112
  if (fs.existsSync(paths.index)) {
110
113
  let indexContent = fs.readFileSync(paths.index, { encoding: 'utf8' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "r2pde-ai",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
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",
@@ -11,37 +11,3 @@ project:
11
11
 
12
12
 
13
13
  # Essenciais
14
- - type: file
15
- path: README.md
16
- content: |
17
- # Corporate Agenda
18
- Aplicação de agenda corporativa com gestão de usuários e integração com Outlook/Google Calendar.
19
- Gerada via onboarding automatizado r2pde-ai.
20
- - type: file
21
- path: .r2pde-ai/pde.index.md
22
- content: |
23
- # PDE Index
24
- - manifests: .r2pde-ai/manifests/
25
- - contracts: .r2pde-ai/contracts/
26
- - requirements: .r2pde-ai/requirements/
27
- - type: file
28
- path: .r2pde-ai/pde.config.json
29
- content: |
30
- {
31
- "version": "0.1.0",
32
- "language": "en",
33
- "artifactsLanguage": "en",
34
- "git": { "autoCommit": false, "commitMessagePrefix": "pde:" },
35
- "score": { "green": { "max": 30 }, "yellow": { "max": 70 }, "red": { "max": 100 } },
36
- "ai": { "apiUrl": "", "apiKey": "", "model": "" },
37
- "project": {
38
- "type": "dashboard",
39
- "architecture": "monolith",
40
- "maturity": "production",
41
- "hasAuth": true,
42
- "hasPayment": false,
43
- "hasIntegrations": true,
44
- "audience": "b2b",
45
- "stack": "Node.js / TypeScript"
46
- }
47
- }