Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3c4377d
feat: Setup do projeto
lucasn4s Dec 23, 2025
9c3d108
feat: Adiciona estrutura base do template
lucasn4s Dec 23, 2025
741d37a
feat: Cria estrutura do CLI do pacote
lucasn4s Dec 23, 2025
2c85941
feat: Cria testes para o projeto
lucasn4s Dec 23, 2025
71d0b7a
feat: Adiciona workflow do CI
lucasn4s Dec 23, 2025
99c54c9
feat: Cria .gitignore
lucasn4s Dec 23, 2025
12797e0
fix: Ajusta configurações de tipo
lucasn4s Dec 23, 2025
72cb4f1
feat: Adiciona interatividade ao CLI
lucasn4s Dec 23, 2025
d44a8c1
fix: Ajusta entrypoint do cli
lucasn4s Dec 23, 2025
82e6b62
Ajusta versões do node suportadas no CI
lucasn4s Jan 5, 2026
e1d03c6
Adiciona lógica de alteração de arquivo de rotas do projeto cliente, …
lucasn4s Jan 5, 2026
d0015a5
Ajusta testes para funcionarem levando em consideração o arquivo de r…
lucasn4s Jan 5, 2026
43efb38
Remove funcionamento do CLI com argumento passado na chamada
lucasn4s Jan 5, 2026
efe1964
Merge branch 'main' of https://github.com/Sysvale/cuids-fronterator i…
lucasn4s Jan 5, 2026
89010a3
1.0.1
lucasn4s Jan 5, 2026
72edc43
Adiciona asserção de log aos testes
lucasn4s Jan 6, 2026
51f047f
Otimiza compilação de arquivos
lucasn4s Jan 6, 2026
2a89872
Adiciona tipos do service
lucasn4s Jan 6, 2026
124bfb1
Corrige replacements nos testes
lucasn4s Jan 6, 2026
d28a391
Gera tipos do pacote
lucasn4s Jan 6, 2026
e9c4c29
1.0.2
lucasn4s Jan 6, 2026
4a2f186
Passa a receber o cliente http via construtor do cuids service
lucasn4s Jan 6, 2026
f7ef907
Ajusta localização do tipo Service
lucasn4s Jan 6, 2026
6ced9f1
Ajusta local de instanciação do service do domínio
lucasn4s Jan 6, 2026
ac04107
1.0.3
lucasn4s Jan 6, 2026
765485e
Ajusta condição de teste
lucasn4s Jan 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Build & Test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22, 24]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Type check
run: npx tsc --noEmit

- name: Build package
run: npm run build

- name: Run tests
run: npm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
/dist
/coverage
4 changes: 4 additions & 0 deletions bin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node
import { runCli } from './cli.js';

await runCli();
36 changes: 36 additions & 0 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env node
import prompts from 'prompts';
import { scaffoldFeature, scaffoldDomain } from './src/scaffold.js';
import { DOMAIN_DIR, STUBS_DIR } from './src/paths.js';

export async function runCli() {
const response = await prompts({
type: 'text',
name: 'entity',
message: 'Nome da entidade (singular, PascalCase):',
validate: value =>
value.trim() === '' ? 'Nome da entidade não pode ser vazio' : true,
});

if (!response.entity) {
console.log('Operação cancelada.');
process.exit(0);
return;
}

const projectRoot = process.cwd();

const replacements = {
ENTITY_CAPS: response.entity.toUpperCase(),
ENTITY_CAPS_PLURAL: `${response.entity.toUpperCase()}S`,
ENTITY: response.entity,
ENTITY_PLURAL: `${response.entity}s`,
entity: response.entity.toLowerCase(),
entityPlural: `${response.entity.toLowerCase()}s`,
};

await scaffoldFeature(STUBS_DIR, projectRoot, replacements);
await scaffoldDomain(DOMAIN_DIR, projectRoot, replacements);

console.log(`Feature ${response.entity} inserida com sucesso!`);
}
Loading