Skip to content

Commit 8629eae

Browse files
authored
Merge pull request #2 from 01Dri/development
Fix Alpha 0.0.4
2 parents 175c972 + 95f2a5c commit 8629eae

8 files changed

Lines changed: 151 additions & 3 deletions

File tree

MapperAI.sln.DotSettings.user

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ee3fe810_002Dfb62_002D402b_002Db9c5_002D8dab803c815e/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Test1" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
2+
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=5ca51f47_002De3fa_002D40db_002D8e16_002D940aee47c197/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="Test_Should_Create_4_Files_With_CSharp_Extension" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
3+
&lt;TestAncestor&gt;&#xD;
4+
&lt;TestId&gt;xUnit::8B3E109D-96CA-4B6D-B379-6AF70646DC25::net8.0::MapperAI.Test.FileMapperTests.Test_Should_Create_4_Files_With_CSharp_Extension&lt;/TestId&gt;&#xD;
5+
&lt;/TestAncestor&gt;&#xD;
6+
&lt;/SessionState&gt;</s:String>
7+
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=ee3fe810_002Dfb62_002D402b_002Db9c5_002D8dab803c815e/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="Test1" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
38
&lt;TestAncestor&gt;&#xD;
49
&lt;TestId&gt;xUnit::8B3E109D-96CA-4B6D-B379-6AF70646DC25::net8.0::MapperAI.Test.ClassMapperTests.Test1&lt;/TestId&gt;&#xD;
510
&lt;TestId&gt;xUnit::8B3E109D-96CA-4B6D-B379-6AF70646DC25::net8.0::MapperAI.Test.FileMapperTests.Test1&lt;/TestId&gt;&#xD;

src/MapperAI.Core/Clients/GeminiClientAI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ public async Task<ClientResponse> SendAsync(string prompt, CancellationToken can
5656
var cleanedJson = text
5757
.Replace("```json", string.Empty)
5858
.Replace("```", string.Empty)
59-
.Replace("\n", string.Empty)
59+
.Replace("\\$", "\\\\$")
6060
.Trim();
61+
6162
// var textSanitized = SanitizeJson(text);
6263
return new ClientResponse { Value = cleanedJson};
6364
}

src/MapperAI.Core/MapperAI.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Title>MapperAI-Alpha</Title>
88
<Authors>Dridev</Authors>
99
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
10-
<Version>0.0.4-alpha</Version>
10+
<Version>0.0.5-alpha</Version>
1111
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1212
<RepositoryUrl>https://github.com/01Dri/MapperAI</RepositoryUrl>
1313
<RootNamespace>MapperAI.Core</RootNamespace>

src/MapperAI.Core/Mappers/FileMapper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ private string CreatePrompt(List<ClassContent> filesToMap, FileMapperConfigurati
9494
- Follow **all best practices, conventions, and idiomatic usage** of {configuration.Extension}.
9595
- Use clean code principles: clear naming, proper formatting, consistent style, and modular design.
9696
- Avoid deprecated patterns or anti-patterns.
97+
- **Escape all backslashes properly for JSON**: every single `\` must become `\\` to ensure valid JSON strings (especially in paths, regexes, or PHP variables like `\$`).
9798
- **DO NOT** return markdown, explanations, comments, or any text outside of the JSON array.
9899
- Your response **must be directly deserializable** into List<ClassContent>.
99100
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace MapperAI.Test.MappedClasses {
2+
export class Carro {
3+
private marca: string;
4+
private modelo: string;
5+
private ano: number;
6+
7+
constructor(marca: string, modelo: string, ano: number) {
8+
this.marca = marca;
9+
this.modelo = modelo;
10+
this.ano = ano;
11+
}
12+
13+
public getMarca(): string {
14+
return this.marca;
15+
}
16+
17+
public getModelo(): string {
18+
return this.modelo;
19+
}
20+
21+
public getAno(): number {
22+
return this.ano;
23+
}
24+
25+
public exibirInformacoes(): void {
26+
console.log(`Marca: ${this.marca}`);
27+
console.log(`Modelo: ${this.modelo}`);
28+
console.log(`Ano: ${this.ano}`);
29+
}
30+
31+
public isAntigo(): boolean {
32+
const anoAtual = new Date().getFullYear();
33+
return (anoAtual - this.ano) > 20;
34+
}
35+
}
36+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
namespace MapperAI.Test.MappedClasses {
2+
export class ContaBancaria {
3+
private numero: string;
4+
private titular: string;
5+
private saldo: number;
6+
7+
constructor(numero: string, titular: string, saldo: number = 0) {
8+
this.numero = numero;
9+
this.titular = titular;
10+
this.saldo = saldo;
11+
}
12+
13+
public depositar(valor: number): string {
14+
if (valor > 0) {
15+
this.saldo += valor;
16+
return `Depósito de R$${valor} realizado com sucesso. Novo saldo: R$${this.saldo}.`;
17+
} else {
18+
return "Valor de depósito inválido.";
19+
}
20+
}
21+
22+
public sacar(valor: number): string {
23+
if (valor > 0 && valor <= this.saldo) {
24+
this.saldo -= valor;
25+
return `Saque de R$${valor} realizado com sucesso. Saldo restante: R$${this.saldo}.`;
26+
} else {
27+
return "Saldo insuficiente ou valor de saque inválido.";
28+
}
29+
}
30+
31+
public consultarSaldo(): string {
32+
return `Saldo atual: R$${this.saldo}.`;
33+
}
34+
}
35+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace MapperAI.Test.MappedClasses {
2+
export class Student {
3+
private name: string;
4+
private age: number;
5+
private student_id: string;
6+
7+
constructor(name: string, age: number, student_id: string) {
8+
this.name = name;
9+
this.age = age;
10+
this.student_id = student_id;
11+
}
12+
13+
public getName(): string {
14+
return this.name;
15+
}
16+
17+
public getAge(): number {
18+
return this.age;
19+
}
20+
21+
public getStudentId(): string {
22+
return this.student_id;
23+
}
24+
25+
public isAdult(): boolean {
26+
return this.age >= 18;
27+
}
28+
}
29+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
namespace MapperAI.Test.MappedClasses {
2+
export class Usuario {
3+
private username: string;
4+
private email: string;
5+
private password: string;
6+
7+
constructor(user: string, mail: string, pass: string) {
8+
this.username = user;
9+
this.email = mail;
10+
this.password = pass;
11+
}
12+
13+
public getUsername(): string {
14+
return this.username;
15+
}
16+
17+
public setUsername(user: string): void {
18+
this.username = user;
19+
}
20+
21+
public getEmail(): string {
22+
return this.email;
23+
}
24+
25+
public setEmail(mail: string): void {
26+
this.email = mail;
27+
}
28+
29+
public getPassword(): string {
30+
return this.password;
31+
}
32+
33+
public setPassword(pass: string): void {
34+
this.password = pass;
35+
}
36+
37+
public displayInfo(): void {
38+
console.log(`Username: ${this.username}, Email: ${this.email}`);
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)