23 Commits
v1.3.8 ... main

Author SHA1 Message Date
902c0fd5a2 Merge pull request 'chore: update README with new CLI options for configuration and linting & add NOTICE' (#66) from feat/update-docu into main
Reviewed-on: #66
Reviewed-by: blas <me@blassanto.me>
2026-03-27 14:11:28 +00:00
ef804b74c2 Merge branch 'main' into feat/update-docu
All checks were successful
Lint / lint (pull_request) Successful in 13s
2026-03-27 14:11:12 +00:00
98cd7a5edb Merge pull request 'chore: fix releases to npm' (#70) from fix/dist-result into main
Reviewed-on: #70
Reviewed-by: didavila <diego.davilafreitas@gmail.com>
2026-03-27 14:10:45 +00:00
3ede53ae3b chore: bump to version v1.3.14 2026-03-27 13:54:17 +00:00
aa7c6cf338 chore: add dist to package.json
All checks were successful
Publish / publish (push) Successful in 1m47s
Lint / lint (pull_request) Successful in 13s
2026-03-27 14:53:39 +01:00
0075717a1f chore: bump to version v1.3.13 2026-03-27 13:47:08 +00:00
7c5af2f3ab chore: add dist to package.json
All checks were successful
Publish / publish (push) Successful in 1m44s
2026-03-27 14:45:53 +01:00
e667c7bf04 chore: bump to version v1.3.12 2026-03-27 13:45:13 +00:00
2e9aecdffe chore: bump to version v1.3.11 2026-03-27 13:38:06 +00:00
5304ed7047 chore: bump to version v0.1 2026-03-27 13:30:51 +00:00
56bd6f4e9f chore: bump to version v0.1-test 2026-03-27 13:28:49 +00:00
cbef98a077 chore: add dist to package.json
Some checks failed
Publish / publish (push) Has been cancelled
2026-03-27 14:26:09 +01:00
3eb604c95f chore: update copyright year in NOTICE file to 2026
All checks were successful
Lint / lint (pull_request) Successful in 13s
2026-03-27 12:15:36 +01:00
4293857a7d chore: add NOTICE file with third-party licenses and copyright information
All checks were successful
Lint / lint (pull_request) Successful in 13s
2026-03-27 11:35:23 +01:00
07e4559133 chore: update README with new command options for skipping linting and using config files
All checks were successful
Lint / lint (pull_request) Successful in 13s
2026-03-27 11:29:52 +01:00
bdd0e4873e chore: update README with new CLI options for configuration and linting
All checks were successful
Lint / lint (pull_request) Successful in 39s
2026-03-27 11:26:54 +01:00
ddca01e4e9 chore: bump to version v1.3.10 2026-03-27 08:37:33 +00:00
59ff941fda Merge pull request 'chore: update installation instructions and add mock files to README' (#65) from feat/update-docu into main
Reviewed-on: #65
Reviewed-by: blas <me@blassanto.me>
2026-03-27 08:33:50 +00:00
8881e9494c chore: update installation instructions and add mock files to README
All checks were successful
Lint / lint (pull_request) Successful in 13s
Publish / publish (push) Successful in 2m48s
2026-03-27 09:28:51 +01:00
720748b73d chore: bump to version v1.3.9 2026-03-27 08:03:10 +00:00
7063796e28 Merge pull request 'chore: update installation instructions for npm registry in release body' (#64) from chore/change-registry-to-npm into main
All checks were successful
Publish / publish (push) Successful in 2m21s
Reviewed-on: #64
2026-03-27 08:02:13 +00:00
f349b7b2a3 chore: update installation instructions for npm registry in release body
All checks were successful
Lint / lint (pull_request) Successful in 19s
2026-03-27 08:59:28 +01:00
b59084dec6 chore: bump to version v1.3.8 2026-03-26 20:39:57 +00:00
4 changed files with 136 additions and 38 deletions

View File

@@ -62,17 +62,18 @@ jobs:
- name: Build binaries
run: bun run binaries
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm registry
run: npm publish --access public
- name: Configure npm registry auth
run: |
echo "registry=https://registry.npmjs.org" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm registry
run: bun publish --access public
env:
BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Gitea release and upload binaries
run: |
VERSION=${GITHUB_REF_NAME#v}

50
NOTICE Normal file
View File

@@ -0,0 +1,50 @@
OpenAPI Clean Architecture Generator
Copyright (c) 2026 Blas Santomé Ocampo
This product includes software developed by third parties.
All third-party packages listed below are distributed under the MIT License.
---
chalk v4.1.2
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
License: MIT
https://github.com/chalk/chalk
---
commander v11.1.0
Copyright (c) TJ Holowaychuk <tj@vision-media.ca>
License: MIT
https://github.com/tj/commander.js
---
fs-extra v11.3.4
Copyright (c) JP Richardson <jprichardson@gmail.com>
License: MIT
https://github.com/jprichardson/node-fs-extra
---
js-yaml v4.1.1
Copyright (c) Vladimir Zapparov <dervus.grim@gmail.com>
Copyright (c) Aleksey V Zapparov <ixti@member.fsf.org>
Copyright (c) Vitaly Puzrin <vitaly@rcdesign.ru>
Copyright (c) Martin Grenfell <martin.grenfell@gmail.com>
License: MIT
https://github.com/nodeca/js-yaml
---
mustache v4.2.0
Copyright (c) mustache.js Authors (http://github.com/janl/mustache.js)
License: MIT
https://github.com/janl/mustache.js
---
prompts v2.4.2
Copyright (c) Terkel Gjervig
License: MIT
https://github.com/terkelg/prompts

View File

@@ -15,29 +15,29 @@ Download the binary for your platform from the releases page and run it directly
```bash
# macOS (Apple Silicon)
curl -L <release-url>/generate-clean-arch-macos-arm64 -o generate-clean-arch
curl -L https://git.blassanto.me/blas/openapi-clean-arch-gen/releases/latest/download/generate-clean-arch-macos-arm64 -o generate-clean-arch
chmod +x generate-clean-arch && ./generate-clean-arch -i swagger.yaml
# macOS (Intel)
curl -L <release-url>/generate-clean-arch-macos-x64 -o generate-clean-arch
curl -L https://git.blassanto.me/blas/openapi-clean-arch-gen/releases/latest/download/generate-clean-arch-macos-x64 -o generate-clean-arch
chmod +x generate-clean-arch && ./generate-clean-arch -i swagger.yaml
# Linux x64
curl -L <release-url>/generate-clean-arch-linux-x64 -o generate-clean-arch
curl -L https://git.blassanto.me/blas/openapi-clean-arch-gen/releases/latest/download/generate-clean-arch-linux-x64 -o generate-clean-arch
chmod +x generate-clean-arch && ./generate-clean-arch -i swagger.yaml
# Windows (PowerShell)
curl -L <release-url>/generate-clean-arch-windows-x64.exe -o generate-clean-arch.exe
curl -L https://git.blassanto.me/blas/openapi-clean-arch-gen/releases/latest/download/generate-clean-arch-windows-x64.exe -o generate-clean-arch.exe
.\generate-clean-arch.exe -i swagger.yaml
```
### Option 1: Install as a global CLI from the registry
### Option 1: Install as a global CLI from npm
```bash
bun add -g @blas/openapi-clean-arch-generator --registry https://git.blassanto.me/api/packages/blas/npm/
bun add -g @0kmpo/openapi-clean-arch-generator
```
Or configure the registry in your `.npmrc` / `bunfig.toml` and then run:
Then run:
```bash
generate-clean-arch -i swagger.yaml
@@ -76,7 +76,10 @@ Options:
-o, --output <dir> Output directory [default: ./src/app]
-t, --templates <dir> Custom templates directory [default: ./templates]
-s, --select-endpoints Interactively select tags and endpoints to generate
-c, --config <file> Use a JSON configuration file (skips interactive prompts)
--init-config [file] Generate a JSON configuration file instead of generating code
--skip-install Skip dependency installation
--skip-lint Skip post-generation linting and formatting
--dry-run Simulate without writing files
-h, --help Show help
```
@@ -96,6 +99,15 @@ generate-clean-arch -i api.yaml -t ./my-templates
# Dry run (no files written)
generate-clean-arch -i swagger.yaml --dry-run
# Skip linting after generation
generate-clean-arch -i swagger.yaml --skip-lint
# Generate a config file to reuse later
generate-clean-arch --init-config generation-config.json
# Run using a config file (no interactive prompts)
generate-clean-arch -c generation-config.json
# Full example with all options
generate-clean-arch -i ./docs/api.yaml -o ./frontend/src/app -t ./custom-templates
```
@@ -109,48 +121,54 @@ src/app/
├── data/ # Data layer
│ ├── dtos/ # Data Transfer Objects
│ │ ├── node/
│ │ │ ── node.dto.ts
│ │ │ ── node.dto.ts
│ │ │ └── node.dto.mock.ts
│ │ ├── order-type/
│ │ │ ── order-type.dto.ts
│ │ │ ── order-type.dto.ts
│ │ │ └── order-type.dto.mock.ts
│ │ └── supply-mode/
│ │ ── supply-mode.dto.ts
│ │ ── supply-mode.dto.ts
│ │ └── supply-mode.dto.mock.ts
│ ├── repositories/ # Repository implementations
│ │ ├── node.repository.impl.ts
│ │ ├── node.repository.impl.mock.ts
│ │ ├── node.repository.impl.spec.ts
│ │ ├── order-type.repository.impl.ts
│ │ ── supply-mode.repository.impl.ts
│ │ ── order-type.repository.impl.mock.ts
│ │ ├── order-type.repository.impl.spec.ts
│ │ └── ...
│ └── mappers/ # DTO → Entity transformers
│ ├── node.mapper.ts
│ ├── node.mapper.spec.ts
│ ├── order-type.mapper.ts
── supply-mode.mapper.ts
── order-type.mapper.spec.ts
│ └── ...
├── domain/ # Domain layer
│ ├── repositories/ # Repository contracts
│ │ ├── node.repository.contract.ts
│ │ ── order-type.repository.contract.ts
│ │ └── supply-mode.repository.contract.ts
│ │ ── ...
│ └── use-cases/ # Use cases
│ ├── node/
│ │ ├── node.use-cases.contract.ts
│ │ ── node.use-cases.impl.ts
├── order-type/
│ │ ── order-type.use-cases.contract.ts
│ └── order-type.use-cases.impl.ts
│ └── supply-mode/
│ ├── supply-mode.use-cases.contract.ts
│ └── supply-mode.use-cases.impl.ts
│ │ ── node.use-cases.impl.ts
│ ├── node.use-cases.mock.ts
│ │ ── node.use-cases.impl.spec.ts
└── ...
├── di/ # Dependency injection
│ ├── repositories/ # Repository providers
│ │ ├── node.repository.provider.ts
│ │ ├── order-type.repository.provider.ts
│ │ └── supply-mode.repository.provider.ts
│ │ ├── node.repository.provider.mock.ts
│ │ └── ...
│ └── use-cases/ # Use case providers
│ ├── node.use-cases.provider.ts
│ ├── order-type.use-cases.provider.ts
│ └── supply-mode.use-cases.provider.ts
│ ├── node.use-cases.provider.mock.ts
│ └── ...
└── entities/ # Domain entities
└── models/
├── node.model.ts
├── order-type.model.ts
── supply-mode.model.ts
├── node.model.mock.ts
── node.model.spec.ts
└── ...
```
## 🔧 Template Customization
@@ -160,14 +178,24 @@ Templates live in `templates/` and use [Mustache](https://mustache.github.io/) s
| Template | Generates |
|---|---|
| `model.mustache` | DTOs |
| `model.mock.mustache` | DTO mocks |
| `dto.mock.mustache` | DTO mocks (alternative) |
| `model-entity.mustache` | Domain entity models |
| `model-entity.spec.mustache` | Entity model specs |
| `mapper.mustache` | DTO → Entity mappers |
| `mapper.spec.mustache` | Mapper specs |
| `api.repository.contract.mustache` | Repository contracts |
| `api.repository.impl.mustache` | Repository implementations |
| `api.repository.impl.mock.mustache` | Repository mocks |
| `api.repository.impl.spec.mustache` | Repository specs |
| `api.use-cases.contract.mustache` | Use case contracts |
| `api.use-cases.impl.mustache` | Use case implementations |
| `api.use-cases.mock.mustache` | Use case mocks |
| `api.use-cases.impl.spec.mustache` | Use case specs |
| `repository.provider.mustache` | Repository DI providers |
| `repository.provider.mock.mustache` | Repository provider mocks |
| `use-cases.provider.mustache` | Use case DI providers |
| `use-cases.provider.mock.mustache` | Use case provider mocks |
### Available Mustache variables
@@ -194,12 +222,23 @@ After each run a `generation-report.json` file is created:
"timestamp": "2025-01-15T10:30:00.000Z",
"tags": 3,
"endpoints": 8,
"tagDetails": [
{ "name": "User", "description": "User operations", "endpoints": 3 },
{ "name": "Product", "description": "Product operations", "endpoints": 2 }
],
"outputDirectory": "./src/app",
"linting": {
"prettier": { "ran": true, "filesFormatted": 42 },
"eslint": { "ran": true, "filesFixed": 42 }
},
"structure": {
"dtos": 15,
"repositories": 9,
"mappers": 3,
"useCases": 6
"mappers": 5,
"useCases": 6,
"providers": 12,
"mocks": 18,
"specs": 14
}
}
```

View File

@@ -1,6 +1,6 @@
{
"name": "@0kmpo/openapi-clean-arch-generator",
"version": "1.3.7",
"version": "1.3.14",
"description": "Angular Clean Architecture generator from OpenAPI/Swagger",
"main": "dist/main.js",
"bin": {
@@ -39,6 +39,14 @@
}
],
"license": "MIT",
"files": [
"dist/main.js",
"dist/package.json",
"dist/src/",
"dist/templates/",
"README.md",
"LICENSE"
],
"dependencies": {
"chalk": "^4.1.2",
"commander": "^11.1.0",