@semacode/cli 2.0.1 → 2.1.0
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/LICENSE +39 -39
- package/README.md +125 -121
- package/dist/agentEntryPoints.js +499 -499
- package/dist/doctorCommand.js +28 -0
- package/dist/geracaoCore.js +97 -1
- package/dist/iaPrompts.d.ts +1 -1
- package/dist/iaPrompts.js +307 -307
- package/dist/index.part01.js +4 -3
- package/dist/index.part02.js +21 -21
- package/dist/index.part04.js +96 -96
- package/dist/index.part06.js +1 -1
- package/dist/index.part07.js +35 -24
- package/dist/init/templates.part01.js +393 -393
- package/dist/init/templates.part02.js +189 -189
- package/dist/initTemplatesBackend.js +73 -73
- package/dist/initTemplatesBase.js +81 -81
- package/dist/initTemplatesFlutter.js +137 -137
- package/dist/initTemplatesRuntime.js +350 -350
- package/dist/initTemplatesWeb.js +309 -309
- package/dist/nativeToolchains.d.ts +15 -0
- package/dist/nativeToolchains.js +132 -0
- package/dist/projetoConfig.js +7 -1
- package/dist/projetoResolucao.js +21 -6
- package/dist/sync/index.js +35 -35
- package/docs/README.md +25 -25
- package/docs/ai-onboarding.md +62 -62
- package/docs/ai-workflow.md +1 -1
- package/docs/auth.md +26 -26
- package/docs/cli.md +79 -72
- package/docs/commands.md +1 -1
- package/docs/database.md +15 -15
- package/docs/deploy.md +41 -36
- package/docs/documentation.md +39 -39
- package/docs/env.md +16 -16
- package/docs/frontend.md +41 -41
- package/docs/getting-started.md +57 -57
- package/docs/i18n.md +15 -15
- package/docs/profiles.md +45 -43
- package/docs/repositories.md +43 -43
- package/docs/rollback.md +31 -31
- package/docs/security.md +32 -32
- package/docs/support.md +8 -8
- package/docs/syntax.md +1 -1
- package/docs/testing.md +35 -28
- package/docs/vocabulary.md +29 -29
- package/exemplos/agendamento.sema +1 -1
- package/exemplos/assinatura.sema +1 -1
- package/exemplos/auditoria.sema +1 -1
- package/exemplos/autenticacao.sema +1 -1
- package/exemplos/author_obra_comum.sema +1 -1
- package/exemplos/author_tema_sensivel.sema +1 -1
- package/exemplos/automacao.sema +1 -1
- package/exemplos/cadastro_usuario.sema +1 -1
- package/exemplos/calculadora.sema +1 -1
- package/exemplos/crud_simples.sema +1 -1
- package/exemplos/estoque.sema +1 -1
- package/exemplos/exportacao.sema +1 -1
- package/exemplos/fila.sema +1 -1
- package/exemplos/integracao_externa.sema +1 -1
- package/exemplos/multi_tenant.sema +1 -1
- package/exemplos/notificacao.sema +1 -1
- package/exemplos/operacao_estrategia.sema +132 -132
- package/exemplos/operacao_estrategia_discovery.sema +220 -220
- package/exemplos/operacao_estrategia_fluxo.sema +114 -114
- package/exemplos/operacao_estrategia_gates.sema +106 -106
- package/exemplos/operacao_estrategia_quarentena.sema +133 -133
- package/exemplos/operacao_estrategia_rollout.sema +124 -124
- package/exemplos/pagamento.sema +1 -1
- package/exemplos/pagamento_dominio.sema +1 -1
- package/exemplos/pedido.sema +1 -1
- package/exemplos/permissao.sema +1 -1
- package/exemplos/persistencia_vendor_first.sema +1 -1
- package/exemplos/profile_conversas.sema +165 -165
- package/exemplos/profile_game.sema +1 -1
- package/exemplos/profile_legal.sema +1 -1
- package/exemplos/profile_ops.sema +1 -1
- package/exemplos/profile_research.sema +1 -1
- package/exemplos/profile_software.sema +1 -1
- package/exemplos/profile_workflow_n8n.sema +1 -1
- package/exemplos/relatorio.sema +1 -1
- package/exemplos/replica_analitica_erp.sema +1 -1
- package/exemplos/testes_embutidos.sema +1 -1
- package/exemplos/tratamento_erro.sema +1 -1
- package/exemplos/upload_arquivo.sema +1 -1
- package/exemplos/webhook.sema +1 -1
- package/node_modules/@sema/gerador-cpp/dist/index.d.ts +3 -0
- package/node_modules/@sema/gerador-cpp/dist/index.js +859 -0
- package/node_modules/@sema/gerador-cpp/dist/index.js.map +1 -0
- package/node_modules/@sema/gerador-cpp/package.json +7 -0
- package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
- package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
- package/node_modules/@sema/gerador-dotnet/dist/index.d.ts +3 -0
- package/node_modules/@sema/gerador-dotnet/dist/index.js +828 -0
- package/node_modules/@sema/gerador-dotnet/dist/index.js.map +1 -0
- package/node_modules/@sema/gerador-dotnet/package.json +7 -0
- package/node_modules/@sema/gerador-html/dist/index.js +17 -17
- package/node_modules/@sema/gerador-lua/dist/index.js +5 -5
- package/node_modules/@sema/gerador-php/dist/index.js +113 -113
- package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
- package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
- package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
- package/node_modules/@sema/padroes/dist/index.d.ts +1 -1
- package/package.json +5 -1
|
@@ -8,54 +8,54 @@ export function arquivosBaseIniciar() {
|
|
|
8
8
|
return [
|
|
9
9
|
{
|
|
10
10
|
caminhoRelativo: "contratos/pedidos.sema",
|
|
11
|
-
conteudo: `module app.pedidos {
|
|
12
|
-
entity Pedido {
|
|
13
|
-
fields {
|
|
14
|
-
id: Id
|
|
15
|
-
status: Texto
|
|
16
|
-
total: Decimal
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
task criar_pedido {
|
|
21
|
-
input {
|
|
22
|
-
cliente_id: Id required
|
|
23
|
-
total: Decimal required
|
|
24
|
-
}
|
|
25
|
-
output {
|
|
26
|
-
pedido_id: Id
|
|
27
|
-
status: Texto
|
|
28
|
-
}
|
|
29
|
-
rules {
|
|
30
|
-
total > 0
|
|
31
|
-
}
|
|
32
|
-
effects {
|
|
33
|
-
persistencia Pedido criticidade=alta
|
|
34
|
-
auditoria pedidos
|
|
35
|
-
}
|
|
36
|
-
guarantees {
|
|
37
|
-
pedido_id existe
|
|
38
|
-
status existe
|
|
39
|
-
}
|
|
40
|
-
tests {
|
|
41
|
-
caso "pedido valido" {
|
|
42
|
-
given {
|
|
43
|
-
cliente_id: "cli-1"
|
|
44
|
-
total: 10
|
|
45
|
-
}
|
|
46
|
-
expect {
|
|
47
|
-
sucesso: verdadeiro
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
route criar_pedido_publico {
|
|
54
|
-
metodo: POST
|
|
55
|
-
caminho: /pedidos
|
|
56
|
-
task: criar_pedido
|
|
57
|
-
}
|
|
58
|
-
}
|
|
11
|
+
conteudo: `module app.pedidos {
|
|
12
|
+
entity Pedido {
|
|
13
|
+
fields {
|
|
14
|
+
id: Id
|
|
15
|
+
status: Texto
|
|
16
|
+
total: Decimal
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
task criar_pedido {
|
|
21
|
+
input {
|
|
22
|
+
cliente_id: Id required
|
|
23
|
+
total: Decimal required
|
|
24
|
+
}
|
|
25
|
+
output {
|
|
26
|
+
pedido_id: Id
|
|
27
|
+
status: Texto
|
|
28
|
+
}
|
|
29
|
+
rules {
|
|
30
|
+
total > 0
|
|
31
|
+
}
|
|
32
|
+
effects {
|
|
33
|
+
persistencia Pedido criticidade=alta
|
|
34
|
+
auditoria pedidos
|
|
35
|
+
}
|
|
36
|
+
guarantees {
|
|
37
|
+
pedido_id existe
|
|
38
|
+
status existe
|
|
39
|
+
}
|
|
40
|
+
tests {
|
|
41
|
+
caso "pedido valido" {
|
|
42
|
+
given {
|
|
43
|
+
cliente_id: "cli-1"
|
|
44
|
+
total: 10
|
|
45
|
+
}
|
|
46
|
+
expect {
|
|
47
|
+
sucesso: verdadeiro
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
route criar_pedido_publico {
|
|
54
|
+
metodo: POST
|
|
55
|
+
caminho: /pedidos
|
|
56
|
+
task: criar_pedido
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
59
|
`,
|
|
60
60
|
},
|
|
61
61
|
];
|
|
@@ -64,38 +64,38 @@ function arquivosApoioIaIniciar() {
|
|
|
64
64
|
return [
|
|
65
65
|
{
|
|
66
66
|
caminhoRelativo: "README.md",
|
|
67
|
-
conteudo: `# Projeto Sema
|
|
68
|
-
|
|
69
|
-
Este projeto foi inicializado com Sema.
|
|
70
|
-
|
|
71
|
-
## Entrada oficial do Codex
|
|
72
|
-
|
|
73
|
-
Antes de alterar codigo, contrato ou documentacao:
|
|
74
|
-
|
|
75
|
-
1. leia \`AGENTS.md\`;
|
|
76
|
-
2. rode \`sema --version\`;
|
|
77
|
-
3. rode \`sema resumo\`;
|
|
78
|
-
4. rode \`sema docs-impacto --intencao "<acao>" --json\`;
|
|
79
|
-
5. leia \`docs/commands.md\` antes de escolher comando ou interpretar \`--saida\`;
|
|
80
|
-
6. use \`exemplos/\` e \`docs/syntax.md\` antes de criar ou corrigir \`.sema\`.
|
|
81
|
-
|
|
82
|
-
## Estrutura criada
|
|
83
|
-
|
|
84
|
-
- \`contratos/\`: contratos semanticamente governados.
|
|
85
|
-
- \`AGENTS.md\`: entrypoint oficial do Codex.
|
|
86
|
-
- \`exemplos/\`: exemplos oficiais da DSL Sema.
|
|
87
|
-
- \`docs/commands.md\`: catalogo de comandos, gates e regra de \`--saida\`.
|
|
88
|
-
- \`docs/syntax.md\`: referencia curta para escrever \`.sema\`.
|
|
89
|
-
- \`docs/ai-workflow.md\`: fluxo minimo para agentes.
|
|
90
|
-
- \`SEMA_BOOT.md\`, \`SEMA_SMALL_MODEL.md\`, \`AGENT_CONTEXT_PACK.json\` e \`SEMA_INDEX.json\`: contexto IA-first.
|
|
91
|
-
|
|
92
|
-
## Geracao
|
|
93
|
-
|
|
94
|
-
O template base ja declara alvo JavaScript. Exemplo:
|
|
95
|
-
|
|
96
|
-
\`\`\`bash
|
|
97
|
-
sema compilar contratos/pedidos.sema --alvo javascript --saida ./generated/javascript
|
|
98
|
-
\`\`\`
|
|
67
|
+
conteudo: `# Projeto Sema
|
|
68
|
+
|
|
69
|
+
Este projeto foi inicializado com Sema.
|
|
70
|
+
|
|
71
|
+
## Entrada oficial do Codex
|
|
72
|
+
|
|
73
|
+
Antes de alterar codigo, contrato ou documentacao:
|
|
74
|
+
|
|
75
|
+
1. leia \`AGENTS.md\`;
|
|
76
|
+
2. rode \`sema --version\`;
|
|
77
|
+
3. rode \`sema resumo\`;
|
|
78
|
+
4. rode \`sema docs-impacto --intencao "<acao>" --json\`;
|
|
79
|
+
5. leia \`docs/commands.md\` antes de escolher comando ou interpretar \`--saida\`;
|
|
80
|
+
6. use \`exemplos/\` e \`docs/syntax.md\` antes de criar ou corrigir \`.sema\`.
|
|
81
|
+
|
|
82
|
+
## Estrutura criada
|
|
83
|
+
|
|
84
|
+
- \`contratos/\`: contratos semanticamente governados.
|
|
85
|
+
- \`AGENTS.md\`: entrypoint oficial do Codex.
|
|
86
|
+
- \`exemplos/\`: exemplos oficiais da DSL Sema.
|
|
87
|
+
- \`docs/commands.md\`: catalogo de comandos, gates e regra de \`--saida\`.
|
|
88
|
+
- \`docs/syntax.md\`: referencia curta para escrever \`.sema\`.
|
|
89
|
+
- \`docs/ai-workflow.md\`: fluxo minimo para agentes.
|
|
90
|
+
- \`SEMA_BOOT.md\`, \`SEMA_SMALL_MODEL.md\`, \`AGENT_CONTEXT_PACK.json\` e \`SEMA_INDEX.json\`: contexto IA-first.
|
|
91
|
+
|
|
92
|
+
## Geracao
|
|
93
|
+
|
|
94
|
+
O template base ja declara alvo JavaScript. Exemplo:
|
|
95
|
+
|
|
96
|
+
\`\`\`bash
|
|
97
|
+
sema compilar contratos/pedidos.sema --alvo javascript --saida ./generated/javascript
|
|
98
|
+
\`\`\`
|
|
99
99
|
`,
|
|
100
100
|
},
|
|
101
101
|
];
|
|
@@ -116,7 +116,7 @@ export function arquivosTemplateIniciar(template) {
|
|
|
116
116
|
?? [
|
|
117
117
|
{
|
|
118
118
|
caminhoRelativo: "sema.config.json",
|
|
119
|
-
conteudo: "{\n \"origens\": [\"./contratos\"],\n \"saida\": \"./generated\",\n \"alvos\": [\"typescript\", \"javascript\", \"python\", \"php\", \"dart\", \"lua\", \"html\", \"css\"],\n \"alvoPadrao\": \"typescript\",\n \"estruturaSaida\": \"modulos\",\n \"framework\": \"base\",\n \"modoEstrito\": true,\n \"diretoriosSaidaPorAlvo\": {\n \"typescript\": \"./generated/typescript\",\n \"javascript\": \"./generated/javascript\",\n \"python\": \"./generated/python\",\n \"php\": \"./generated/php\",\n \"dart\": \"./generated/dart\",\n \"lua\": \"./generated/lua\",\n \"html\": \"./generated/html\",\n \"css\": \"./generated/css\"\n },\n \"convencoesGeracaoPorProjeto\": \"base\"\n}\n",
|
|
119
|
+
conteudo: "{\n \"origens\": [\"./contratos\"],\n \"saida\": \"./generated\",\n \"alvos\": [\"typescript\", \"javascript\", \"python\", \"php\", \"dart\", \"lua\", \"html\", \"css\"],\n \"alvoPadrao\": \"typescript\",\n \"estruturaSaida\": \"modulos\",\n \"framework\": \"base\",\n \"modoEstrito\": true,\n \"diretoriosSaidaPorAlvo\": {\n \"typescript\": \"./generated/typescript\",\n \"javascript\": \"./generated/javascript\",\n \"python\": \"./generated/python\",\n \"php\": \"./generated/php\",\n \"dart\": \"./generated/dart\",\n \"lua\": \"./generated/lua\",\n \"html\": \"./generated/html\",\n \"css\": \"./generated/css\",\n \"dotnet\": \"./generated/dotnet\",\n \"cpp\": \"./generated/cpp\"\n },\n \"convencoesGeracaoPorProjeto\": \"base\"\n}\n",
|
|
120
120
|
},
|
|
121
121
|
...arquivosBase,
|
|
122
122
|
];
|
|
@@ -8,171 +8,171 @@ export function arquivosInitTemplatesFlutter(template, arquivosBase) {
|
|
|
8
8
|
arquivos = [
|
|
9
9
|
{
|
|
10
10
|
caminhoRelativo: "sema.config.json",
|
|
11
|
-
conteudo: `{
|
|
12
|
-
"origens": ["./contratos"],
|
|
13
|
-
"saida": "./generated",
|
|
14
|
-
"alvos": ["dart"],
|
|
15
|
-
"alvoPadrao": "dart",
|
|
16
|
-
"estruturaSaida": "modulos",
|
|
17
|
-
"framework": "base",
|
|
18
|
-
"modoEstrito": true,
|
|
19
|
-
"diretoriosCodigo": ["./lib"],
|
|
20
|
-
"fontesLegado": ["flutter-consumer", "dart"],
|
|
21
|
-
"diretoriosSaidaPorAlvo": {
|
|
22
|
-
"dart": "./generated/dart"
|
|
23
|
-
},
|
|
24
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
25
|
-
}
|
|
11
|
+
conteudo: `{
|
|
12
|
+
"origens": ["./contratos"],
|
|
13
|
+
"saida": "./generated",
|
|
14
|
+
"alvos": ["dart"],
|
|
15
|
+
"alvoPadrao": "dart",
|
|
16
|
+
"estruturaSaida": "modulos",
|
|
17
|
+
"framework": "base",
|
|
18
|
+
"modoEstrito": true,
|
|
19
|
+
"diretoriosCodigo": ["./lib"],
|
|
20
|
+
"fontesLegado": ["flutter-consumer", "dart"],
|
|
21
|
+
"diretoriosSaidaPorAlvo": {
|
|
22
|
+
"dart": "./generated/dart"
|
|
23
|
+
},
|
|
24
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
25
|
+
}
|
|
26
26
|
`,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
caminhoRelativo: "pubspec.yaml",
|
|
30
|
-
conteudo: `name: sema_flutter_consumer
|
|
31
|
-
description: Starter Flutter consumer IA-first com Sema
|
|
32
|
-
publish_to: "none"
|
|
33
|
-
|
|
34
|
-
environment:
|
|
35
|
-
sdk: ">=3.3.0 <4.0.0"
|
|
36
|
-
|
|
37
|
-
dependencies:
|
|
38
|
-
flutter:
|
|
39
|
-
sdk: flutter
|
|
40
|
-
go_router: ^14.0.0
|
|
30
|
+
conteudo: `name: sema_flutter_consumer
|
|
31
|
+
description: Starter Flutter consumer IA-first com Sema
|
|
32
|
+
publish_to: "none"
|
|
33
|
+
|
|
34
|
+
environment:
|
|
35
|
+
sdk: ">=3.3.0 <4.0.0"
|
|
36
|
+
|
|
37
|
+
dependencies:
|
|
38
|
+
flutter:
|
|
39
|
+
sdk: flutter
|
|
40
|
+
go_router: ^14.0.0
|
|
41
41
|
`,
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
caminhoRelativo: "contratos/showroom_consumer.sema",
|
|
45
|
-
conteudo: `module showroom.consumer {
|
|
46
|
-
task fetch_showroom_ranking {
|
|
47
|
-
input {
|
|
48
|
-
}
|
|
49
|
-
output {
|
|
50
|
-
resultado: Json
|
|
51
|
-
}
|
|
52
|
-
impl {
|
|
53
|
-
dart: lib.sema_consumer_bridge.semaFetchShowroomRanking
|
|
54
|
-
}
|
|
55
|
-
vinculos {
|
|
56
|
-
arquivo: "lib/sema_consumer_bridge.dart"
|
|
57
|
-
simbolo: lib.sema_consumer_bridge.semaFetchShowroomRanking
|
|
58
|
-
superficie: "/ranking"
|
|
59
|
-
arquivo: "lib/router.dart"
|
|
60
|
-
arquivo: "lib/screens/ranking_screen.dart"
|
|
61
|
-
}
|
|
62
|
-
guarantees {
|
|
63
|
-
resultado existe
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
45
|
+
conteudo: `module showroom.consumer {
|
|
46
|
+
task fetch_showroom_ranking {
|
|
47
|
+
input {
|
|
48
|
+
}
|
|
49
|
+
output {
|
|
50
|
+
resultado: Json
|
|
51
|
+
}
|
|
52
|
+
impl {
|
|
53
|
+
dart: lib.sema_consumer_bridge.semaFetchShowroomRanking
|
|
54
|
+
}
|
|
55
|
+
vinculos {
|
|
56
|
+
arquivo: "lib/sema_consumer_bridge.dart"
|
|
57
|
+
simbolo: lib.sema_consumer_bridge.semaFetchShowroomRanking
|
|
58
|
+
superficie: "/ranking"
|
|
59
|
+
arquivo: "lib/router.dart"
|
|
60
|
+
arquivo: "lib/screens/ranking_screen.dart"
|
|
61
|
+
}
|
|
62
|
+
guarantees {
|
|
63
|
+
resultado existe
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
67
|
`,
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
caminhoRelativo: "lib/sema_consumer_bridge.dart",
|
|
71
|
-
conteudo: `Future<Map<String, dynamic>> semaFetchShowroomRanking() async {
|
|
72
|
-
return {
|
|
73
|
-
"ranking": [
|
|
74
|
-
{"clube": "Tigres do Norte", "pontos": 33},
|
|
75
|
-
{"clube": "Porto Azul", "pontos": 31},
|
|
76
|
-
{"clube": "Galo de Ouro", "pontos": 28},
|
|
77
|
-
],
|
|
78
|
-
};
|
|
79
|
-
}
|
|
71
|
+
conteudo: `Future<Map<String, dynamic>> semaFetchShowroomRanking() async {
|
|
72
|
+
return {
|
|
73
|
+
"ranking": [
|
|
74
|
+
{"clube": "Tigres do Norte", "pontos": 33},
|
|
75
|
+
{"clube": "Porto Azul", "pontos": 31},
|
|
76
|
+
{"clube": "Galo de Ouro", "pontos": 28},
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
80
|
`,
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
caminhoRelativo: "lib/router.dart",
|
|
84
|
-
conteudo: `import "package:go_router/go_router.dart";
|
|
85
|
-
import "package:flutter/widgets.dart";
|
|
86
|
-
import "screens/ranking_screen.dart";
|
|
87
|
-
|
|
88
|
-
final appRouter = GoRouter(
|
|
89
|
-
routes: [
|
|
90
|
-
GoRoute(
|
|
91
|
-
path: "/ranking",
|
|
92
|
-
builder: (BuildContext context, GoRouterState state) => const RankingScreen(),
|
|
93
|
-
),
|
|
94
|
-
],
|
|
95
|
-
);
|
|
84
|
+
conteudo: `import "package:go_router/go_router.dart";
|
|
85
|
+
import "package:flutter/widgets.dart";
|
|
86
|
+
import "screens/ranking_screen.dart";
|
|
87
|
+
|
|
88
|
+
final appRouter = GoRouter(
|
|
89
|
+
routes: [
|
|
90
|
+
GoRoute(
|
|
91
|
+
path: "/ranking",
|
|
92
|
+
builder: (BuildContext context, GoRouterState state) => const RankingScreen(),
|
|
93
|
+
),
|
|
94
|
+
],
|
|
95
|
+
);
|
|
96
96
|
`,
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
caminhoRelativo: "lib/screens/ranking_screen.dart",
|
|
100
|
-
conteudo: `import "package:flutter/widgets.dart";
|
|
101
|
-
import "../sema_consumer_bridge.dart";
|
|
102
|
-
|
|
103
|
-
class RankingScreen extends StatefulWidget {
|
|
104
|
-
const RankingScreen({super.key});
|
|
105
|
-
|
|
106
|
-
@override
|
|
107
|
-
State<RankingScreen> createState() => _RankingScreenState();
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
class _RankingScreenState extends State<RankingScreen> {
|
|
111
|
-
List<Map<String, dynamic>> ranking = const [];
|
|
112
|
-
|
|
113
|
-
@override
|
|
114
|
-
void initState() {
|
|
115
|
-
super.initState();
|
|
116
|
-
semaFetchShowroomRanking().then((payload) {
|
|
117
|
-
final itens = (payload["ranking"] as List<dynamic>? ?? const [])
|
|
118
|
-
.whereType<Map<String, dynamic>>()
|
|
119
|
-
.toList();
|
|
120
|
-
if (!mounted) return;
|
|
121
|
-
setState(() {
|
|
122
|
-
ranking = itens;
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
@override
|
|
128
|
-
Widget build(BuildContext context) {
|
|
129
|
-
return ListView(
|
|
130
|
-
children: [
|
|
131
|
-
const Padding(
|
|
132
|
-
padding: EdgeInsets.all(16),
|
|
133
|
-
child: Text("Ranking showroom"),
|
|
134
|
-
),
|
|
135
|
-
...ranking.map((item) => Padding(
|
|
136
|
-
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
137
|
-
child: Text("\${item["clube"]} - \${item["pontos"]} pts"),
|
|
138
|
-
)),
|
|
139
|
-
],
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
100
|
+
conteudo: `import "package:flutter/widgets.dart";
|
|
101
|
+
import "../sema_consumer_bridge.dart";
|
|
102
|
+
|
|
103
|
+
class RankingScreen extends StatefulWidget {
|
|
104
|
+
const RankingScreen({super.key});
|
|
105
|
+
|
|
106
|
+
@override
|
|
107
|
+
State<RankingScreen> createState() => _RankingScreenState();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
class _RankingScreenState extends State<RankingScreen> {
|
|
111
|
+
List<Map<String, dynamic>> ranking = const [];
|
|
112
|
+
|
|
113
|
+
@override
|
|
114
|
+
void initState() {
|
|
115
|
+
super.initState();
|
|
116
|
+
semaFetchShowroomRanking().then((payload) {
|
|
117
|
+
final itens = (payload["ranking"] as List<dynamic>? ?? const [])
|
|
118
|
+
.whereType<Map<String, dynamic>>()
|
|
119
|
+
.toList();
|
|
120
|
+
if (!mounted) return;
|
|
121
|
+
setState(() {
|
|
122
|
+
ranking = itens;
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@override
|
|
128
|
+
Widget build(BuildContext context) {
|
|
129
|
+
return ListView(
|
|
130
|
+
children: [
|
|
131
|
+
const Padding(
|
|
132
|
+
padding: EdgeInsets.all(16),
|
|
133
|
+
child: Text("Ranking showroom"),
|
|
134
|
+
),
|
|
135
|
+
...ranking.map((item) => Padding(
|
|
136
|
+
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
137
|
+
child: Text("\${item["clube"]} - \${item["pontos"]} pts"),
|
|
138
|
+
)),
|
|
139
|
+
],
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
143
|
`,
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
caminhoRelativo: "lib/main.dart",
|
|
147
|
-
conteudo: `import "package:flutter/material.dart";
|
|
148
|
-
import "router.dart";
|
|
149
|
-
|
|
150
|
-
void main() {
|
|
151
|
-
runApp(const ShowroomApp());
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
class ShowroomApp extends StatelessWidget {
|
|
155
|
-
const ShowroomApp({super.key});
|
|
156
|
-
|
|
157
|
-
@override
|
|
158
|
-
Widget build(BuildContext context) {
|
|
159
|
-
return MaterialApp.router(
|
|
160
|
-
routerConfig: appRouter,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
147
|
+
conteudo: `import "package:flutter/material.dart";
|
|
148
|
+
import "router.dart";
|
|
149
|
+
|
|
150
|
+
void main() {
|
|
151
|
+
runApp(const ShowroomApp());
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
class ShowroomApp extends StatelessWidget {
|
|
155
|
+
const ShowroomApp({super.key});
|
|
156
|
+
|
|
157
|
+
@override
|
|
158
|
+
Widget build(BuildContext context) {
|
|
159
|
+
return MaterialApp.router(
|
|
160
|
+
routerConfig: appRouter,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
164
|
`,
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
caminhoRelativo: "README.md",
|
|
168
|
-
conteudo: `# Starter Flutter Consumer + Sema
|
|
169
|
-
|
|
170
|
-
- Contratos em \`contratos/\`
|
|
171
|
-
- Bridge consumer canonico em \`lib/sema_consumer_bridge.dart\`
|
|
172
|
-
- Rotas consumer em \`lib/router.dart\`
|
|
173
|
-
- Superficies consumer em \`lib/screens/\`
|
|
174
|
-
- O slice oficial desta fase e \`consumer bridge + router/screen surfaces\`
|
|
175
|
-
- \`drift\` valida \`impl\`, \`vinculos\`, bridge e superficies, sem prometer visual diff
|
|
168
|
+
conteudo: `# Starter Flutter Consumer + Sema
|
|
169
|
+
|
|
170
|
+
- Contratos em \`contratos/\`
|
|
171
|
+
- Bridge consumer canonico em \`lib/sema_consumer_bridge.dart\`
|
|
172
|
+
- Rotas consumer em \`lib/router.dart\`
|
|
173
|
+
- Superficies consumer em \`lib/screens/\`
|
|
174
|
+
- O slice oficial desta fase e \`consumer bridge + router/screen surfaces\`
|
|
175
|
+
- \`drift\` valida \`impl\`, \`vinculos\`, bridge e superficies, sem prometer visual diff
|
|
176
176
|
`,
|
|
177
177
|
},
|
|
178
178
|
];
|