Skip to content

Commit

Permalink
Mate -> Crafter
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 29, 2024
1 parent 2c4f835 commit c9868ad
Show file tree
Hide file tree
Showing 172 changed files with 1,831 additions and 1,706 deletions.
56 changes: 25 additions & 31 deletions .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
## Installation

```bash
composer require contributte/mate --dev
composer require contributte/crafter --dev
```

## Quickstart

1. Create `.mate.neon` in your project root.
1. Create `crafter.neon` in your project root.

You can initialize it by running `vendor/bin/mate init`. Or you can create it manually.
You can initialize it by running `vendor/bin/crafter init`. Or you can create it manually.

```neon
data:
Expand All @@ -21,14 +21,14 @@ data:
username: {type: string}
email: {type: string}
password: {type: string}
createdAt: {type: Nette\Utils\DateTime}
updatedAt: {type: Nette\Utils\DateTime}
createdAt: {type: datetime}
updatedAt: {type: datetime}
```

2. Run `vendor/bin/mate` or `php mate.phar` in your project root.
2. Run `vendor/bin/crafter` or `php crafter.phar` in your project root.

```
vendor/bin/mate craft
vendor/bin/crafter craft
```

## Configuration
Expand All @@ -37,39 +37,33 @@ Under construction.

## Usage

### `mate init`
### `crafter init`

Create `.mate.neon` in your project.
Create `crafter.neon` in your project.

### `mate craft`
### `crafter craft`

Generate files based on `.mate.neon`.
Generate files based on `crafter.neon`.

```bash
vendor/bin/mate craft --struct user
```
You can define:

- `--data|-k` - data structure key
- `--scope|-s` - scope of generation

```bash
vendor/bin/mate craft --struct user --crafter=entity
vendor/bin/mate craft --struct user --crafter=repository

vendor/bin/mate craft --struct user --crafter=bus --mode=create
vendor/bin/mate craft --struct user --crafter=bus --mode=update
vendor/bin/mate craft --struct user --crafter=bus --mode=delete
vendor/bin/mate craft --struct user --crafter=bus --mode=list
vendor/bin/mate craft --struct user --crafter=bus --mode=get

vendor/bin/mate craft --struct user --crafter=api --mode=create
vendor/bin/mate craft --struct user --crafter=api --mode=update
vendor/bin/mate craft --struct user --crafter=api --mode=delete
vendor/bin/mate craft --struct user --crafter=api --mode=list
vendor/bin/mate craft --struct user --crafter=api --mode=get
vendor/bin/crafter craft -k user
vendor/bin/crafter craft -k user -s database
```

### `mate generate`
### `crafter generate`

Generate whole project based on template.

You can define:

Generate whole project based on `.mate.neon`.
- `--template|-t` - project template
- `--directory|-d` - output folder

```bash
vendor/bin/mate generate --template api
vendor/bin/crafter generate -t nella -d demo
```
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
![](https://heatbadger.now.sh/github/readme/contributte/mate/)
![](https://heatbadger.now.sh/github/readme/contributte/crafter/)

<p align=center>
<a href="https://github.com/contributte/mate/actions"><img src="https://badgen.net/github/checks/contributte/mate/master?cache=300"></a>
<a href="https://coveralls.io/r/contributte/mate"> <img src="https://badgen.net/coveralls/c/github/contributte/mate?cache=300"> </a>
<a href="https://packagist.org/packages/contributte/mate"> <img src="https://badgen.net/packagist/dm/contributte/mate"> </a>
<a href="https://packagist.org/packages/contributte/mate"> <img src="https://badgen.net/packagist/v/contributte/mate"> </a>
<a href="https://github.com/contributte/crafter/actions"><img src="https://badgen.net/github/checks/contributte/crafter/master?cache=300"></a>
<a href="https://coveralls.io/r/contributte/crafter"> <img src="https://badgen.net/coveralls/c/github/contributte/crafter?cache=300"> </a>
<a href="https://packagist.org/packages/contributte/crafter"> <img src="https://badgen.net/packagist/dm/contributte/crafter"> </a>
<a href="https://packagist.org/packages/contributte/crafter"> <img src="https://badgen.net/packagist/v/contributte/crafter"> </a>
</p>
<p align=center>
<a href="https://packagist.org/packages/contributte/mate"><img src="https://badgen.net/packagist/php/contributte/mate"></a>
<a href="https://github.com/contributte/mate"><img src="https://badgen.net/github/license/contributte/mate"></a>
<a href="https://packagist.org/packages/contributte/crafter"><img src="https://badgen.net/packagist/php/contributte/crafter"></a>
<a href="https://github.com/contributte/crafter"><img src="https://badgen.net/github/license/contributte/crafter"></a>
<a href="https://bit.ly/ctteg"><img src="https://badgen.net/badge/support/gitter/cyan"></a>
<a href="https://bit.ly/cttfo"><img src="https://badgen.net/badge/support/forum/yellow"></a>
<a href="https://contributte.org/partners.html"><img src="https://badgen.net/badge/become/a%20patron/F96854"></a>
Expand All @@ -20,10 +20,10 @@ Website 🚀 <a href="https://contributte.org">contributte.org</a> | Contact

## Usage

To install the latest version of `contributte/mate` use [Composer](https://getcomposer.org).
To install the latest version of `contributte/crafter` use [Composer](https://getcomposer.org).

```
composer require contributte/mate
composer require contributte/crafter
```

## Documentation
Expand Down
4 changes: 4 additions & 0 deletions bin/crafter
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/crafter.php';
2 changes: 1 addition & 1 deletion bin/mate.php → bin/crafter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
exit(1);
}

Contributte\Mate\Bootstrap::run();
Contributte\Crafter\Bootstrap::run();
4 changes: 0 additions & 4 deletions bin/mate

This file was deleted.

4 changes: 2 additions & 2 deletions box.json.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main": "bin/mate.php",
"main": "bin/crafter.php",
"chmod": "0775",
"output": "dist/mate.phar",
"output": "dist/crafter.phar",
"force-autodiscovery": true,
"directories": [
"resources"
Expand Down
20 changes: 9 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "contributte/mate",
"name": "contributte/crafter",
"description": "Yummy opinionated PHP generator for web masters.",
"keywords": [
"mate",
"crafter",
"generator",
"project",
"assistant",
"make"
],
"type": "library",
"license": "MIT",
"homepage": "https://github.com/contributte/mate",
"homepage": "https://github.com/contributte/crafter",
"authors": [
{
"name": "Milan Felix Šulc",
Expand All @@ -27,21 +27,19 @@
"latte/latte": "^3.0.18",
"symfony/console": "^7.1.5",
"nette/safe": "^1.0.0",
"psr/log": "^3.0.2"
"psr/log": "^3.0.2",
"nyholm/dsn": "^2.0.1"
},
"require-dev": {
"contributte/qa": "^0.4.0",
"contributte/tester": "^0.1.0",
"contributte/tester": "^0.4.0",
"mockery/mockery": "^1.5.0",
"phpstan/phpstan": "^1.2.0",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
"phpstan/phpstan-nette": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.1.0",
"contributte/phpstan": "^0.3.0",
"humbug/box": "^4.6.2"
},
"autoload": {
"psr-4": {
"Contributte\\Mate\\": "src"
"Contributte\\Crafter\\": "src"
}
},
"autoload-dev": {
Expand All @@ -50,7 +48,7 @@
}
},
"bin": [
"bin/mate"
"bin/crafter"
],
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
28 changes: 0 additions & 28 deletions examples/d01/app/Api/User/Create/CreateUserController.php

This file was deleted.

16 changes: 0 additions & 16 deletions examples/d01/app/Api/User/Create/CreateUserRequest.php

This file was deleted.

38 changes: 0 additions & 38 deletions examples/d01/app/Api/User/Create/CreateUserRequestBody.php

This file was deleted.

20 changes: 0 additions & 20 deletions examples/d01/app/Api/User/Create/CreateUserResponse.php

This file was deleted.

28 changes: 0 additions & 28 deletions examples/d01/app/Api/User/Delete/DeleteUserController.php

This file was deleted.

19 changes: 0 additions & 19 deletions examples/d01/app/Api/User/Delete/DeleteUserResponse.php

This file was deleted.

28 changes: 0 additions & 28 deletions examples/d01/app/Api/User/Get/GetUserController.php

This file was deleted.

Loading

0 comments on commit c9868ad

Please sign in to comment.