Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aloe for MVC v4 #17

Draft
wants to merge 45 commits into
base: v2.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8bffbfe
feat: update migrate command to use schema
mychidarko Dec 11, 2024
4ee61d6
chore: update version
mychidarko Dec 12, 2024
a33812f
feat: add concurrent mode to serve command
mychidarko Dec 18, 2024
c3cf064
feat: remove all seed, migration and factory commands
mychidarko Dec 20, 2024
65e19a3
feat: update themes and stubs
mychidarko Dec 20, 2024
1b22dee
feat: update to new paths
mychidarko Dec 20, 2024
ae7abd5
feat: add new mvc 4 commands
mychidarko Dec 20, 2024
37f5046
feat: add db drop command to remove tables
mychidarko Dec 20, 2024
ddcb878
feat: add db:install to db:migrate
mychidarko Dec 20, 2024
97dce4a
feat: merge scaffolds and themes
mychidarko Dec 20, 2024
269b685
fix: remove all legacy stubs and generators
mychidarko Dec 20, 2024
5cac066
fix: patch up install errors from external packages
mychidarko Dec 20, 2024
d1b2d17
feat: db:rollback will only revert db to prev state
mychidarko Dec 20, 2024
c5eb129
feat: rename auth:scaffold to scaffold:auth
mychidarko Dec 20, 2024
920cb33
feat: add generate schema command
mychidarko Dec 20, 2024
5105089
feat: update tailwind install
mychidarko Dec 22, 2024
798e668
feat: rename config:mail to scaffold mail
mychidarko Dec 23, 2024
07ac20c
fix: add scaffold:auth command
mychidarko Dec 23, 2024
2ca76df
fix: patch up scaffold auth command
mychidarko Dec 23, 2024
da4125b
feat: install auth in scaffold command
mychidarko Dec 24, 2024
a0c8667
feat: add svelte to view:install
mychidarko Jan 6, 2025
e13f408
chore: install alchemy for linting
mychidarko Jan 6, 2025
84bdc75
feat: generate templates for svelte
mychidarko Jan 7, 2025
82c98f5
fix: patch up view install command
mychidarko Jan 8, 2025
f629242
feat: update commands to match new leaf version
mychidarko Jan 8, 2025
93873c2
feat: remove db:drop command
mychidarko Jan 10, 2025
1d90f51
feat: add db:seed command
mychidarko Jan 10, 2025
60ffbf4
feat: add db:reset command
mychidarko Jan 10, 2025
fc820a4
feat: update db create
mychidarko Jan 10, 2025
e846e29
feat: add db:rollback command
mychidarko Jan 10, 2025
fba5d3e
fix: add step to rollback command
mychidarko Jan 10, 2025
7e5cc0f
feat: verify db on migrate
mychidarko Jan 17, 2025
de20ed1
feat: update auth pages
mychidarko Jan 18, 2025
b0db552
feat: update dashboard UI
mychidarko Jan 19, 2025
2d0f4ab
feat: update dashboard
mychidarko Jan 20, 2025
160a8cf
feat: update layouts
mychidarko Jan 20, 2025
4a253b1
fix: update schema seeds
mychidarko Jan 20, 2025
e04e900
feat: switch tailwind install to v4
mychidarko Jan 25, 2025
a65cb9a
feat: update default config
mychidarko Feb 17, 2025
c67726e
feat: automatically setup workers with servers
mychidarko Feb 18, 2025
e33a6dc
feat: update queue commands
mychidarko Feb 18, 2025
d66a13e
fix: patch up config message
mychidarko Feb 18, 2025
7b8d0dd
feat: automatically start redis on serve
mychidarko Feb 19, 2025
b52ca51
fix: patch up no concurrent on serve
mychidarko Feb 19, 2025
695dda0
feat: switch deps to latest stable
mychidarko Feb 21, 2025
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
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
test
vendor
composer.lock
AloeUninstallCommand.php
AloeUninstallCommand.php

# Alchemy
.alchemy
.phpunit.result.cache
43 changes: 43 additions & 0 deletions alchemy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
app:
- src

lint:
preset: PSR12
rules:
single_quote: true
phpdoc_scalar: true
no_unused_imports: true
unary_operator_spaces: true
binary_operator_spaces: true
phpdoc_var_without_name: true
trailing_comma_in_multiline: true
phpdoc_single_line_var_spacing: true
single_trait_insert_per_statement: true
not_operator_with_successor_space: false
array_syntax:
syntax: short
ordered_imports:
sort_algorithm: alpha
method_argument_space:
on_multiline: ensure_fully_multiline
keep_multiple_spaces_after_comma: true
blank_line_before_statement:
statements:
- try
- break
- throw
- return
- declare
- continue

actions:
run:
- lint
os:
- ubuntu-latest
php:
versions:
- '8.3'
events:
- push
- pull_request
28 changes: 24 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"name": "leafs/aloe",
"version": "2.1.2",
"version": "4.0-alpha",
"description": "Overpowered command line tool for your leaf apps.",
"keywords": ["cli", "console", "cmd", "bash", "leaf", "php"],
"keywords": [
"cli",
"console",
"cmd",
"bash",
"leaf",
"php"
],
"homepage": "https://leafphp.dev/docs/mvc/console.html",
"type": "library",
"license": "MIT",
Expand All @@ -20,7 +27,7 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"prefer-stable": true,
"require": {
"illuminate/support": "*",
"leafs/fs": "2.0",
Expand All @@ -30,6 +37,19 @@
"symfony/process": "^5.0|^6.0"
},
"require-dev": {
"leafs/leaf": "*"
"leafs/leaf": "*",
"leafs/alchemy": "^2.2",
"friendsofphp/php-cs-fixer": "^3.66"
},
"scripts": {
"alchemy": "./vendor/bin/alchemy setup",
"test": "./vendor/bin/alchemy setup --test",
"lint": "./vendor/bin/alchemy setup --lint",
"actions": "./vendor/bin/alchemy setup --actions"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
29 changes: 17 additions & 12 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/**
* Base class for Aloe Commands.
*
*
* @author Michael Darko <mickdd22@gmail.com>
*/
class Command extends BaseCommand
Expand All @@ -43,14 +43,14 @@ class Command extends BaseCommand

/**
* The input object
*
*
* @var InputInterface
*/
protected $input;

/**
* The output object
*
*
* @var OutputInterface
*/
protected $output;
Expand Down Expand Up @@ -79,7 +79,7 @@ protected function configure()
$this->setHelp($this->help);
$this->config();
}

protected function config()
{
//
Expand Down Expand Up @@ -188,32 +188,36 @@ public function run(InputInterface $input, OutputInterface $output)

/**
* Get an argument or return the input object
*
*
* @param string $data The argument to return
*/
public function input($data = null)
{
if (!$data) return $this->input;
if (!$data) {
return $this->input;
}

return $this->argument($data);
}

/**
* Output data or return the output object
*
*
* @param string $data The argument to return
*/
public function output($data = null)
{
if (!$data) return $this->output;
if (!$data) {
return $this->output;
}

return $this->writeln($data);
}

/**
* Add a new argument
*/
public function setArgument($name, $mode = null, $description = "", $default = null)
public function setArgument($name, $mode = null, $description = '', $default = null)
{
if (strtoupper($mode) === 'OPTIONAL') {
$mode = InputArgument::OPTIONAL;
Expand Down Expand Up @@ -339,7 +343,7 @@ public function autoComplete(string $question, array $potentialAnswers, $default
/**
* Ask a question with possible answers
*/
public function choice(string $question, array $choices, string $errorMessage = "Invalid choice", $default = 0)
public function choice(string $question, array $choices, string $errorMessage = 'Invalid choice', $default = 0)
{
$helper = $this->getHelper('question');
$question = new ChoiceQuestion("$question ", $choices, $default);
Expand All @@ -352,7 +356,7 @@ public function choice(string $question, array $choices, string $errorMessage =
/**
* Ask a question with possible answers + multiple choice
*/
public function multiChoice(string $question, array $choices, string $errorMessage = "Invalid choice", $default = 0)
public function multiChoice(string $question, array $choices, string $errorMessage = 'Invalid choice', $default = 0)
{
$helper = $this->getHelper('question');
$question = new ChoiceQuestion("$question ", $choices, $default);
Expand Down Expand Up @@ -380,7 +384,7 @@ public function secret(string $question, bool $useFallback = false)
/**
* Prompt user for confirmation
*/
public function confirm($question, $param = false, $regex = "/^y/i")
public function confirm($question, $param = false, $regex = '/^y/i')
{
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion("$question ", $param, $regex);
Expand Down Expand Up @@ -454,6 +458,7 @@ public function link($link, $display, $options = 0)
public function runProcess(array $process)
{
$process = new Process($process);

return $process->run();
}
}
1 change: 1 addition & 0 deletions src/Command/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static function paths($path = null)
public static function rootpath($file = null)
{
$path = dirname(__DIR__, 5) . "/$file";

return str_replace('//', '/', $path);
}
}
12 changes: 0 additions & 12 deletions src/Command/ConfigLibCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ protected function handle()
\Leaf\FS\Directory::create(LibPath());
}

$publicIndex = trim(PublicPath('index.php'), '/');

\Leaf\FS\File::write($publicIndex, function ($content) {
$content = str_replace(
'// \Leaf\Core::loadLibs()',
'\Leaf\Core::loadLibs()',
$content
);

return $content;
});

$this->comment('lib folder setup successfully!');

return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ConfigPublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function handle()
);
}

$this->comment('lib folder setup successfully!');
$this->comment('Config published successfully!');

return 0;
}
Expand Down
38 changes: 0 additions & 38 deletions src/Command/DatabaseInstallCommand.php

This file was deleted.

Loading