From eae7728515a79cfe9158c02c60709af1cf02cffc Mon Sep 17 00:00:00 2001 From: roman Date: Mon, 18 Nov 2024 17:44:19 +0600 Subject: [PATCH 1/6] feat: move init command from empty project refs: https://github.com/RonasIT/laravel-project-initializator/issues/1 --- .templates/CONTACTS.md | 7 - .templates/CREDENTIALS_AND_ACCESS.md | 13 - .templates/ENVIRONMENTS.md | 10 - .templates/GETTING_STARTED.md | 21 -- .templates/PREREQUISITES.md | 6 - .templates/README.md | 3 - .templates/RESOURCES.md | 11 - .templates/RESOURCES_AND_CONTACTS.md | 5 - app/Console/Commands/Init.php | 336 ------------------ composer.json | 11 +- composer.lock | 54 ++- resources/views/add_default_user.blade.php | 29 -- tests/InitCommandTest.php | 277 --------------- tests/Support/InitCommandMockTrait.php | 38 -- .../fixtures/InitCommandTest/default.env.yml | 42 --- .../InitCommandTest/default_readme.md | 83 ----- .../InitCommandTest/env.ci-testing.yml | 42 --- .../InitCommandTest/env.development.yml | 39 -- .../fixtures/InitCommandTest/env.example.yml | 42 --- .../fixtures/InitCommandTest/env.testing.yml | 43 --- tests/fixtures/InitCommandTest/full_readme.md | 83 ----- tests/fixtures/InitCommandTest/migration.php | 31 -- .../InitCommandTest/partial_readme.md | 36 -- 23 files changed, 61 insertions(+), 1201 deletions(-) delete mode 100644 .templates/CONTACTS.md delete mode 100644 .templates/CREDENTIALS_AND_ACCESS.md delete mode 100644 .templates/ENVIRONMENTS.md delete mode 100644 .templates/GETTING_STARTED.md delete mode 100644 .templates/PREREQUISITES.md delete mode 100644 .templates/README.md delete mode 100644 .templates/RESOURCES.md delete mode 100644 .templates/RESOURCES_AND_CONTACTS.md delete mode 100755 app/Console/Commands/Init.php delete mode 100644 resources/views/add_default_user.blade.php delete mode 100644 tests/InitCommandTest.php delete mode 100644 tests/Support/InitCommandMockTrait.php delete mode 100644 tests/fixtures/InitCommandTest/default.env.yml delete mode 100644 tests/fixtures/InitCommandTest/default_readme.md delete mode 100644 tests/fixtures/InitCommandTest/env.ci-testing.yml delete mode 100644 tests/fixtures/InitCommandTest/env.development.yml delete mode 100644 tests/fixtures/InitCommandTest/env.example.yml delete mode 100644 tests/fixtures/InitCommandTest/env.testing.yml delete mode 100644 tests/fixtures/InitCommandTest/full_readme.md delete mode 100644 tests/fixtures/InitCommandTest/migration.php delete mode 100644 tests/fixtures/InitCommandTest/partial_readme.md diff --git a/.templates/CONTACTS.md b/.templates/CONTACTS.md deleted file mode 100644 index c1da016..0000000 --- a/.templates/CONTACTS.md +++ /dev/null @@ -1,7 +0,0 @@ -### Contacts - -Should you need assistance or have questions, feel free to connect with the following individuals: -- Manager: If you have any high-level project concerns, feel free to get in touch with our project manager. [Connect with Manager](mailto::manager_link) -- Code Owner/Team Lead: For specific questions about the codebase or technical aspects, reach out to our team lead. [Connect with Team Lead](mailto::team_lead_link) - -Please be mindful of each individual's preferred contact method and office hours. diff --git a/.templates/CREDENTIALS_AND_ACCESS.md b/.templates/CREDENTIALS_AND_ACCESS.md deleted file mode 100644 index c73ab80..0000000 --- a/.templates/CREDENTIALS_AND_ACCESS.md +++ /dev/null @@ -1,13 +0,0 @@ -## Credentials and Access - -{admin_credentials}Default admin access: -- email `:admin_email` -- password `:admin_password`{/admin_credentials} - -{telescope_credentials}Laravel Telescope access: -- email `:telescope_email` -- password `:telescope_password`{/telescope_credentials} - -{nova_credentials}Laravel Nova access: -- email `:nova_email` -- password `:nova_password`{/nova_credentials} diff --git a/.templates/ENVIRONMENTS.md b/.templates/ENVIRONMENTS.md deleted file mode 100644 index bc2868d..0000000 --- a/.templates/ENVIRONMENTS.md +++ /dev/null @@ -1,10 +0,0 @@ -## Environments - -This repository by default supports three environments: `local`, `development`, -and `testing`. Each environment is represented by an appropriate environment file: - -| Environment | File | URL | -| --- | --- |--------------------------------------| -| local | .env | [http://localhost](http://localhost) | -| testing | .env.testing | - | -| development | .env.development | [:api_link](:api_link) | diff --git a/.templates/GETTING_STARTED.md b/.templates/GETTING_STARTED.md deleted file mode 100644 index be4371e..0000000 --- a/.templates/GETTING_STARTED.md +++ /dev/null @@ -1,21 +0,0 @@ -## Getting Started - -To get started with this repository, follow these steps: - -Clone this repository to your local machine: - -```sh -git clone :git_project_path -``` - -Open project directory: - -```sh -cd :project_directory -``` - -Build and start containers, it may takes some time: - -```sh -docker compose up -d -``` diff --git a/.templates/PREREQUISITES.md b/.templates/PREREQUISITES.md deleted file mode 100644 index dd8d4f3..0000000 --- a/.templates/PREREQUISITES.md +++ /dev/null @@ -1,6 +0,0 @@ -## Prerequisites - -To work with this repository, you will need to have the following -installed: - -- [Docker](https://www.docker.com) diff --git a/.templates/README.md b/.templates/README.md deleted file mode 100644 index 5f58ef7..0000000 --- a/.templates/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :project_name - -This project implements an API for the :project_name :type app. diff --git a/.templates/RESOURCES.md b/.templates/RESOURCES.md deleted file mode 100644 index f9e4022..0000000 --- a/.templates/RESOURCES.md +++ /dev/null @@ -1,11 +0,0 @@ -### Resources - -Below are links to tools and services used in this project: -{issue_tracker}- [Issue Tracker](:issue_tracker_link): Here, you can report any issues or bugs related to the project. :issue_tracker_later{/issue_tracker} -{figma}- [Figma](:figma_link): This is where we maintain all our design assets and mock-ups. :figma_later{/figma} -{sentry}- [Sentry](:sentry_link): To monitor application performance and error tracking. :sentry_later{/sentry} -{datadog}- [DataDog](:datadog_link): This is where we monitor our logs, and server performance, and receive alerts. :datadog_later{/datadog} -{argocd}- [ArgoCD](:argocd_link): Is a kubernetes controller which continuously monitors running applications. :argocd_later{/argocd} -{telescope}- [Laravel Telescope](:telescope_link): This is debug assistant for the Laravel framework. :telescope_later{/telescope} -{nova}- [Laravel Nova](:nova_link): This is admin panel for the Laravel framework. :nova_later{/nova} -- [API Documentation](:api_link) diff --git a/.templates/RESOURCES_AND_CONTACTS.md b/.templates/RESOURCES_AND_CONTACTS.md deleted file mode 100644 index 8e2f971..0000000 --- a/.templates/RESOURCES_AND_CONTACTS.md +++ /dev/null @@ -1,5 +0,0 @@ -## Project Resources & Contacts - -This section provides quick links to various resources and contacts associated -with this project. It's here to streamline your navigation and communication -process, so you can efficiently find what you need or reach out to who you need. diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php deleted file mode 100755 index 7fb8c9a..0000000 --- a/app/Console/Commands/Init.php +++ /dev/null @@ -1,336 +0,0 @@ - 'Issue Tracker', - 'figma' => 'Figma', - 'sentry' => 'Sentry', - 'datadog' => 'DataDog', - 'argocd' => 'ArgoCD', - 'telescope' => 'Laravel Telescope', - 'nova' => 'Laravel Nova', - ]; - - public const array CONTACTS_ITEMS = [ - 'manager' => 'Manager', - 'team_lead' => 'Code Owner/Team Lead', - ]; - - public const array CREDENTIALS_ITEMS = [ - 'telescope' => 'Laravel Telescope', - 'nova' => 'Laravel Nova', - ]; - - public const array DEFAULT_URLS = [ - 'telescope', - 'nova', - ]; - - protected $signature = 'init {application-name : The application name }'; - - protected $description = 'Initialize required project parameters to run DEV environment'; - - protected array $resources = []; - - protected array $adminCredentials = []; - - protected string $appUrl; - - protected array $emptyValuesList = []; - - protected string $readmeContent = ''; - - public function handle(): void - { - $appName = $this->argument('application-name'); - $kebabName = Str::kebab($appName); - - $this->appUrl = $this->ask('Please enter an application URL', "https://api.dev.{$kebabName}.com"); - - $envFile = (file_exists('.env')) ? '.env' : '.env.example'; - - $this->updateConfigFile($envFile, '=', [ - 'APP_NAME' => $appName, - ]); - - $this->updateConfigFile('.env.development', '=', [ - 'APP_NAME' => $appName, - 'APP_URL' => $this->appUrl, - ]); - - $this->info('Project initialized successfully!'); - - if ($this->confirm('Do you want to generate an admin user?', true)) { - $this->createAdminUser($kebabName); - } - - if ($this->confirm('Do you want to generate a README file?', true)) { - $this->fillReadme(); - - if ($this->confirm('Do you need a `Resources & Contacts` part?', true)) { - $this->fillResourcesAndContacts(); - $this->fillResources(); - $this->fillContacts(); - } - - if ($this->confirm('Do you need a `Prerequisites` part?', true)) { - $this->fillPrerequisites(); - } - - if ($this->confirm('Do you need a `Getting Started` part?', true)) { - $this->fillGettingStarted(); - } - - if ($this->confirm('Do you need an `Environments` part?', true)) { - $this->fillEnvironments(); - } - - if ($this->confirm('Do you need a `Credentials and Access` part?', true)) { - $this->fillCredentialsAndAccess($kebabName); - } - - $this->saveReadme(); - - $this->info('README generated successfully!'); - - if ($this->emptyValuesList) { - $this->warn('Don`t forget to fill the following empty values:'); - - foreach ($this->emptyValuesList as $value) { - $this->warn("- {$value}"); - } - } - } - } - - protected function createAdminUser(string $kebabName): void - { - $defaultPassword = substr(md5(uniqid()), 0, 8); - - $this->adminCredentials = [ - 'name' => $this->ask('Please enter an admin name', 'Admin'), - 'email' => $this->ask('Please enter an admin email', "admin@{$kebabName}.com"), - 'password' => $this->ask('Please enter an admin password', $defaultPassword), - 'role_id' => Role::ADMIN, - ]; - - $this->publishMigration(); - } - - protected function fillReadme(): void - { - $appName = $this->argument('application-name'); - $file = $this->loadReadmePart('README.md'); - - $this->setReadmeValue($file, 'project_name', $appName); - - $type = $this->choice( - question: 'What type of application will your API serve?', - choices: ['Mobile', 'Web', 'Multiplatform'], - default: 'Multiplatform' - ); - - $this->setReadmeValue($file, 'type', $type); - - $this->readmeContent = $file; - } - - protected function fillResourcesAndContacts(): void - { - $filePart = $this->loadReadmePart('RESOURCES_AND_CONTACTS.md'); - - $this->updateReadmeFile($filePart); - } - - protected function fillResources(): void - { - $filePart = $this->loadReadmePart('RESOURCES.md'); - $laterText = '(will be added later)'; - - foreach (self::RESOURCES_ITEMS as $key => $title) { - $defaultAnswer = (in_array($key, self::DEFAULT_URLS)) ? $this->appUrl . "/{$key}" : 'later'; - $text = "Are you going to use {$title}? " - . "Please enter a link or select `later` to do it later, otherwise select `no`."; - - $link = $this->anticipate( - $text, - ['later', 'no'], - $defaultAnswer - ); - - if ($link === 'later') { - $this->emptyValuesList[] = "{$title} link"; - $this->setReadmeValue($filePart, "{$key}_link"); - $this->setReadmeValue($filePart, "{$key}_later", $laterText); - } elseif ($link !== 'no') { - $this->setReadmeValue($filePart, "{$key}_link", $link); - $this->setReadmeValue($filePart, "{$key}_later"); - } - - $this->resources[$key] = ($link !== 'no'); - - $this->removeTag($filePart, $key, $link === 'no'); - } - - $this->setReadmeValue($filePart, 'api_link', $this->appUrl); - $this->updateReadmeFile($filePart); - } - - protected function fillContacts(): void - { - $filePart = $this->loadReadmePart('CONTACTS.md'); - - foreach (self::CONTACTS_ITEMS as $key => $title) { - if ($link = $this->ask("Please enter a {$title}'s email", '')) { - $this->setReadmeValue($filePart, "{$key}_link", $link); - } else { - $this->emptyValuesList[] = "{$title}'s email"; - } - - $this->removeTag($filePart, $key); - } - - $this->updateReadmeFile($filePart); - } - - protected function fillPrerequisites(): void - { - $filePart = $this->loadReadmePart('PREREQUISITES.md'); - - $this->updateReadmeFile($filePart); - } - - protected function fillGettingStarted(): void - { - $gitProjectPath = trim((string) shell_exec('git ls-remote --get-url origin')); - $projectDirectory = basename($gitProjectPath, '.git'); - $filePart = $this->loadReadmePart('GETTING_STARTED.md'); - - $this->setReadmeValue($filePart, 'git_project_path', $gitProjectPath); - $this->setReadmeValue($filePart, 'project_directory', $projectDirectory); - - $this->updateReadmeFile($filePart); - } - - protected function fillEnvironments(): void - { - $filePart = $this->loadReadmePart('ENVIRONMENTS.md'); - - $this->setReadmeValue($filePart, 'api_link', $this->appUrl); - $this->updateReadmeFile($filePart); - } - - protected function fillCredentialsAndAccess(string $kebabName): void - { - $filePart = $this->loadReadmePart('CREDENTIALS_AND_ACCESS.md'); - - if ($this->adminCredentials) { - $this->setReadmeValue($filePart, 'admin_email', $this->adminCredentials['email']); - $this->setReadmeValue($filePart, 'admin_password', $this->adminCredentials['password']); - } - - $this->removeTag($filePart, 'admin_credentials', !$this->adminCredentials); - - foreach (self::CREDENTIALS_ITEMS as $key => $title) { - if (!Arr::get($this->resources, $key)) { - $this->removeTag($filePart, "{$key}_credentials", true); - - continue; - } - - if ($this->confirm("Is {$title}'s admin the same as default one?", true)) { - $email = $this->adminCredentials['email']; - $password = $this->adminCredentials['password']; - } else { - $defaultPassword = substr(md5(uniqid()), 0, 8); - - $email = $this->ask("Please enter a {$title}'s admin email", "admin@{$kebabName}.com"); - $password = $this->ask("Please enter a {$title}'s admin password", $defaultPassword); - } - - $this->setReadmeValue($filePart, "{$key}_email", $email); - $this->setReadmeValue($filePart, "{$key}_password", $password); - $this->removeTag($filePart, "{$key}_credentials"); - } - - $this->updateReadmeFile($filePart); - } - - protected function addQuotes($string): string - { - return (Str::contains($string, ' ')) ? "\"{$string}\"" : $string; - } - - protected function publishMigration(): void - { - $data = view('add_default_user')->with($this->adminCredentials)->render(); - $fileName = Carbon::now()->format('Y_m_d_His') . '_add_default_user.php'; - - file_put_contents("database/migrations/{$fileName}", " $value) { - if (Str::contains($line, "{$key}{$separator}")) { - $exploded = explode($separator, $line); - $key = array_shift($exploded); - $value = $this->addQuotes($value); - $line = "{$key}{$separator}{$value}"; - } - } - } - - $ymlSettings = implode("\n", $lines); - - file_put_contents($fileName, $ymlSettings); - } - - protected function loadReadmePart(string $fileName): string - { - return file_get_contents(self::TEMPLATES_PATH . DIRECTORY_SEPARATOR . $fileName); - } - - protected function updateReadmeFile(string $filePart): void - { - $filePart = preg_replace('#(\n){3,}#', "\n", $filePart); - - $this->readmeContent .= "\n" . $filePart; - } - - protected function removeTag(string &$text, string $tag, bool $removeWholeString = false): void - { - $regex = ($removeWholeString) - ? "#({{$tag}})(.|\s)*?({/{$tag}})#" - : "# {0,1}{(/*){$tag}}#"; - - $text = preg_replace($regex, '', $text); - } - - protected function setReadmeValue(string &$file, string $key, string $value = ''): void - { - $file = str_replace(":{$key}", $value, $file); - } - - protected function saveReadme(): void - { - file_put_contents('README.md', $this->readmeContent); - } -} diff --git a/composer.json b/composer.json index bf34eeb..92eb84c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "spatie/laravel-ignition": "^2.8", "symfony/http-client": "^7.1.3", "symfony/mailgun-mailer": "^7.1.3", - "symfony/postmark-mailer": "^7.1" + "symfony/postmark-mailer": "^7.1", + "ronasit/laravel-project-initializator": "dev-move_init_commant_from_empty_project" }, "require-dev": { "ext-json": "*", @@ -92,5 +93,11 @@ ] } }, - "minimum-stability": "beta" + "minimum-stability": "beta", + "repositories": [ + { + "type": "git", + "url": "https://github.com/RonasIT/laravel-project-initializator.git" + } + ] } diff --git a/composer.lock b/composer.lock index cd391fa..d30b2d8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fc0e6212c853ec6a259501ca1fc0c6fb", + "content-hash": "3ae54ffbec5eeff60e735237f29eace3", "packages": [ { "name": "brick/math", @@ -5733,6 +5733,55 @@ }, "time": "2024-11-04T10:52:30+00:00" }, + { + "name": "ronasit/laravel-project-initializator", + "version": "dev-move_init_commant_from_empty_project", + "source": { + "type": "git", + "url": "https://github.com/RonasIT/laravel-project-initializator.git", + "reference": "8bc1cb4c8d1f8aa5e009a53d7a68d66b9ab28e0b" + }, + "require": { + "ext-json": "*", + "laravel/framework": "^11.30", + "php": ">=8.3", + "php-mock/php-mock-phpunit": "^2.10", + "ronasit/laravel-helpers": "^3.0.0-beta" + }, + "require-dev": { + "brainmaestro/composer-git-hooks": "^3.0", + "fakerphp/faker": "^1.23.1", + "friendsofphp/php-cs-fixer": "^3.62", + "mockery/mockery": "^1.6.12", + "orchestra/testbench": "^9.3", + "php-coveralls/php-coveralls": "^2.7", + "phpunit/phpunit": "^10.5.30" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "RonasIT\\ProjectInitializator\\ProjectInitializatorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "RonasIT\\ProjectInitializator\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "RonasIT\\ProjectInitializator\\Tests\\": "tests/", + "RonasIT\\ProjectInitializator\\Tests\\Support\\": "tests/Support/" + } + }, + "license": [ + "MIT" + ], + "description": "Provided tools for project initialization.", + "time": "2024-11-18T11:24:18+00:00" + }, { "name": "ronasit/laravel-swagger", "version": "3.0.2", @@ -12439,7 +12488,8 @@ "aliases": [], "minimum-stability": "beta", "stability-flags": { - "ronasit/laravel-helpers": 10 + "ronasit/laravel-helpers": 10, + "ronasit/laravel-project-initializator": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/resources/views/add_default_user.blade.php b/resources/views/add_default_user.blade.php deleted file mode 100644 index 77f4138..0000000 --- a/resources/views/add_default_user.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -use Illuminate\Database\Migrations\Migration; -use Illuminate\Support\Facades\Hash; -use RonasIT\Support\Traits\MigrationTrait; - -class AddDefaultUser extends Migration -{ - use MigrationTrait; - - public function up() - { - if (config('app.env') !== 'testing') { - DB::table('users')->insert([ - 'name' => '{{ $name }}', - 'email' => '{{ $email }}', - 'password' => Hash::make('{{ $password }}'), - 'role_id' => '{{ $role_id }}' - ]); - } - } - - public function down() - { - if (config('app.env') !== 'testing') { - DB::table('users') - ->where('email', '{{ $email }}') - ->delete(); - } - } -} diff --git a/tests/InitCommandTest.php b/tests/InitCommandTest.php deleted file mode 100644 index 3ec077a..0000000 --- a/tests/InitCommandTest.php +++ /dev/null @@ -1,277 +0,0 @@ -mockFilePutContent(); - - $this - ->artisan('init "My App"') - ->expectsOutput('Project initialized successfully!') - ->expectsQuestion('Please enter an application URL', 'https://mysite.com') - ->expectsConfirmation('Do you want to generate an admin user?') - ->expectsConfirmation('Do you want to generate a README file?') - ->assertExitCode(0); - } - - public function testRunWithAdminAndWithoutReadmeCreation() - { - $this->mockFilePutContent( - [ - 'database/migrations/2018_11_11_111111_add_default_user.php', - $this->getFixture('migration.php'), - 'optionalParameter', - 'optionalParameter', - ] - ); - - $this - ->artisan('init "My App"') - ->expectsOutput('Project initialized successfully!') - ->expectsQuestion('Please enter an application URL', 'https://mysite.com') - ->expectsConfirmation('Do you want to generate an admin user?', 'yes') - ->expectsQuestion('Please enter an admin name', 'TestAdmin') - ->expectsQuestion('Please enter an admin email', 'mail@mail.com') - ->expectsQuestion('Please enter an admin password', '123456') - ->expectsConfirmation('Do you want to generate a README file?') - ->assertExitCode(0); - } - - public function testRunWithAdminAndDefaultReadmeCreation() - { - $this->mockShellExec(); - - $this->mockFilePutContent( - [ - 'database/migrations/2018_11_11_111111_add_default_user.php', - $this->getFixture('migration.php'), - 'optionalParameter', - 'optionalParameter', - ], - [ - 'README.md', - $this->getFixture('default_readme.md'), - 'optionalParameter', - 'optionalParameter', - ] - ); - - $this - ->artisan('init "My App"') - ->expectsOutput('Project initialized successfully!') - ->expectsQuestion('Please enter an application URL', 'https://mysite.com') - ->expectsConfirmation('Do you want to generate an admin user?', 'yes') - ->expectsQuestion('Please enter an admin name', 'TestAdmin') - ->expectsQuestion('Please enter an admin email', 'mail@mail.com') - ->expectsQuestion('Please enter an admin password', '123456') - ->expectsConfirmation('Do you want to generate a README file?', 'yes') - ->expectsQuestion('What type of application will your API serve?', 'Multiplatform') - ->expectsConfirmation('Do you need a `Resources & Contacts` part?', 'yes') - ->expectsQuestion( - 'Are you going to use Issue Tracker? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use Figma? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use Sentry? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use DataDog? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use ArgoCD? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use Laravel Telescope? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use Laravel Nova? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion('Please enter a Manager\'s email', '') - ->expectsQuestion('Please enter a Code Owner/Team Lead\'s email', '') - ->expectsConfirmation('Do you need a `Prerequisites` part?', 'yes') - ->expectsConfirmation('Do you need a `Getting Started` part?', 'yes') - ->expectsConfirmation('Do you need an `Environments` part?', 'yes') - ->expectsConfirmation('Do you need a `Credentials and Access` part?', 'yes') - ->expectsConfirmation('Is Laravel Telescope\'s admin the same as default one?', 'yes') - ->expectsConfirmation('Is Laravel Nova\'s admin the same as default one?', 'yes') - ->expectsOutput('README generated successfully!') - ->expectsOutput('Don`t forget to fill the following empty values:') - ->expectsOutput('- Issue Tracker link') - ->expectsOutput('- Figma link') - ->expectsOutput('- Sentry link') - ->expectsOutput('- DataDog link') - ->expectsOutput('- ArgoCD link') - ->expectsOutput('- Manager\'s email') - ->expectsOutput('- Code Owner/Team Lead\'s email') - ->assertExitCode(0); - } - - public function testRunWithAdminAndPartialReadmeCreation() - { - $this->mockFilePutContent( - [ - 'README.md', - $this->getFixture('partial_readme.md'), - 'optionalParameter', - 'optionalParameter', - ] - ); - - $this - ->artisan('init "My App"') - ->expectsOutput('Project initialized successfully!') - ->expectsQuestion('Please enter an application URL', 'https://mysite.com') - ->expectsConfirmation('Do you want to generate an admin user?') - ->expectsConfirmation('Do you want to generate a README file?', 'yes') - ->expectsQuestion('What type of application will your API serve?', 'Web') - ->expectsConfirmation('Do you need a `Resources & Contacts` part?', 'yes') - ->expectsQuestion( - 'Are you going to use Issue Tracker? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'later' - ) - ->expectsQuestion( - 'Are you going to use Figma? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'no' - ) - ->expectsQuestion( - 'Are you going to use Sentry? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'no' - ) - ->expectsQuestion( - 'Are you going to use DataDog? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'no' - ) - ->expectsQuestion( - 'Are you going to use ArgoCD? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'no' - ) - ->expectsQuestion( - 'Are you going to use Laravel Telescope? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'no' - ) - ->expectsQuestion( - 'Are you going to use Laravel Nova? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'no' - ) - ->expectsQuestion('Please enter a Manager\'s email', 'manager@mail.com') - ->expectsQuestion('Please enter a Code Owner/Team Lead\'s email', '') - ->expectsConfirmation('Do you need a `Prerequisites` part?') - ->expectsConfirmation('Do you need a `Getting Started` part?') - ->expectsConfirmation('Do you need an `Environments` part?', 'yes') - ->expectsConfirmation('Do you need a `Credentials and Access` part?', 'yes') - ->expectsOutput('README generated successfully!') - ->expectsOutput('Don`t forget to fill the following empty values:') - ->expectsOutput('- Issue Tracker link') - ->expectsOutput('- Code Owner/Team Lead\'s email') - ->assertExitCode(0); - } - - public function testRunWithAdminAndFullReadmeCreation() - { - $this->mockShellExec(); - - $this->mockFilePutContent( - [ - 'database/migrations/2018_11_11_111111_add_default_user.php', - $this->getFixture('migration.php'), - 'optionalParameter', - 'optionalParameter', - ], - [ - 'README.md', - $this->getFixture('full_readme.md'), - 'optionalParameter', - 'optionalParameter', - ] - ); - - $this - ->artisan('init "My App"') - ->expectsOutput('Project initialized successfully!') - ->expectsQuestion('Please enter an application URL', 'https://mysite.com') - ->expectsConfirmation('Do you want to generate an admin user?', 'yes') - ->expectsQuestion('Please enter an admin name', 'TestAdmin') - ->expectsQuestion('Please enter an admin email', 'mail@mail.com') - ->expectsQuestion('Please enter an admin password', '123456') - ->expectsConfirmation('Do you want to generate a README file?', 'yes') - ->expectsQuestion('What type of application will your API serve?', 'Mobile') - ->expectsConfirmation('Do you need a `Resources & Contacts` part?', 'yes') - ->expectsQuestion( - 'Are you going to use Issue Tracker? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://gitlab.com/my-project' - ) - ->expectsQuestion( - 'Are you going to use Figma? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://figma.com/my-project' - ) - ->expectsQuestion( - 'Are you going to use Sentry? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://sentry.com/my-project' - ) - ->expectsQuestion( - 'Are you going to use DataDog? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://datadoghq.com/my-project' - ) - ->expectsQuestion( - 'Are you going to use ArgoCD? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://argocd.com/my-project' - ) - ->expectsQuestion( - 'Are you going to use Laravel Telescope? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://mypsite.com/telescope-link' - ) - ->expectsQuestion( - 'Are you going to use Laravel Nova? ' - . 'Please enter a link or select `later` to do it later, otherwise select `no`.', - 'https://mypsite.com/nova-link' - ) - ->expectsQuestion('Please enter a Manager\'s email', 'manager@mail.com') - ->expectsQuestion('Please enter a Code Owner/Team Lead\'s email', 'lead@mail.com') - ->expectsConfirmation('Do you need a `Prerequisites` part?', 'yes') - ->expectsConfirmation('Do you need a `Getting Started` part?', 'yes') - ->expectsConfirmation('Do you need an `Environments` part?', 'yes') - ->expectsConfirmation('Do you need a `Credentials and Access` part?', 'yes') - ->expectsConfirmation('Is Laravel Telescope\'s admin the same as default one?', 'yes') - ->expectsConfirmation('Is Laravel Nova\'s admin the same as default one?') - ->expectsQuestion('Please enter a Laravel Nova\'s admin email', 'nova_mail@mail.com') - ->expectsQuestion('Please enter a Laravel Nova\'s admin password', '654321') - ->expectsOutput('README generated successfully!') - ->assertExitCode(0); - } -} diff --git a/tests/Support/InitCommandMockTrait.php b/tests/Support/InitCommandMockTrait.php deleted file mode 100644 index 773721b..0000000 --- a/tests/Support/InitCommandMockTrait.php +++ /dev/null @@ -1,38 +0,0 @@ -getFixture('env.example.yml'), 'optionalParameter', 'optionalParameter'], - ['.env.development', $this->getFixture('env.development.yml'), 'optionalParameter', 'optionalParameter'], - ...$arguments, - ]; - - $this->mockNativeFunction( - namespace: 'App\Console\Commands', - callChain: array_map( - fn ($call) => $this->functionCall('file_put_contents', $call), - $callChain - ) - ); - } - - public function mockShellExec(): void - { - $this->mockNativeFunction('App\Console\Commands', [ - $this->functionCall( - name: 'shell_exec', - arguments: ['git ls-remote --get-url origin'], - result: 'https://github.com/ronasit/laravel-helpers.git' - ), - ]); - } -} diff --git a/tests/fixtures/InitCommandTest/default.env.yml b/tests/fixtures/InitCommandTest/default.env.yml deleted file mode 100644 index 4ce18d9..0000000 --- a/tests/fixtures/InitCommandTest/default.env.yml +++ /dev/null @@ -1,42 +0,0 @@ -APP_NAME= -APP_ENV=local -APP_KEY=base64:RMlWJrRHIuHLYRplJvWaLNwWvRoVkQdDTZe6U1Z4xRY= -APP_DEBUG=true -APP_LOG_LEVEL=debug -APP_URL=http://localhost - -DB_CONNECTION=pgsql -DB_HOST=pgsql -DB_PORT=5432 -DB_DATABASE=pgdb -DB_USERNAME=pguser -DB_PASSWORD="" - -BROADCAST_DRIVER=log -CACHE_DRIVER=redis -SESSION_DRIVER=redis -QUEUE_CONNECTION=sync - -REDIS_HOST=redis -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null - -FILESYSTEM_DISK=local -GOOGLE_CLOUD_STORAGE_BUCKET=ronasit-development -GOOGLE_CLOUD_PROJECT_ID=ronas-it-development - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= - -FRONTEND_URL=http://localhost - -JWT_SECRET=av30tMhdKMXfF3OT1OPljEJ7e9KRG7Y4ruqfOPYWx1jRtqpgKwIohtp2n30uZtfs -JWT_SHOW_BLACKLIST_EXCEPTION=true diff --git a/tests/fixtures/InitCommandTest/default_readme.md b/tests/fixtures/InitCommandTest/default_readme.md deleted file mode 100644 index dc2a276..0000000 --- a/tests/fixtures/InitCommandTest/default_readme.md +++ /dev/null @@ -1,83 +0,0 @@ -# My App - -This project implements an API for the My App Multiplatform app. - -## Project Resources & Contacts - -This section provides quick links to various resources and contacts associated -with this project. It's here to streamline your navigation and communication -process, so you can efficiently find what you need or reach out to who you need. - -### Resources - -Below are links to tools and services used in this project: -- [Issue Tracker](): Here, you can report any issues or bugs related to the project. (will be added later) -- [Figma](): This is where we maintain all our design assets and mock-ups. (will be added later) -- [Sentry](): To monitor application performance and error tracking. (will be added later) -- [DataDog](): This is where we monitor our logs, and server performance, and receive alerts. (will be added later) -- [ArgoCD](): Is a kubernetes controller which continuously monitors running applications. (will be added later) -- [Laravel Telescope](): This is debug assistant for the Laravel framework. (will be added later) -- [Laravel Nova](): This is admin panel for the Laravel framework. (will be added later) -- [API Documentation](https://mysite.com) - -### Contacts - -Should you need assistance or have questions, feel free to connect with the following individuals: -- Manager: If you have any high-level project concerns, feel free to get in touch with our project manager. [Connect with Manager](mailto::manager_link) -- Code Owner/Team Lead: For specific questions about the codebase or technical aspects, reach out to our team lead. [Connect with Team Lead](mailto::team_lead_link) - -Please be mindful of each individual's preferred contact method and office hours. - -## Prerequisites - -To work with this repository, you will need to have the following -installed: - -- [Docker](https://www.docker.com) - -## Getting Started - -To get started with this repository, follow these steps: - -Clone this repository to your local machine: - -```sh -git clone https://github.com/ronasit/laravel-helpers.git -``` - -Open project directory: - -```sh -cd laravel-helpers -``` - -Build and start containers, it may takes some time: - -```sh -docker compose up -d -``` - -## Environments - -This repository by default supports three environments: `local`, `development`, -and `testing`. Each environment is represented by an appropriate environment file: - -| Environment | File | URL | -| --- | --- |--------------------------------------| -| local | .env | [http://localhost](http://localhost) | -| testing | .env.testing | - | -| development | .env.development | [https://mysite.com](https://mysite.com) | - -## Credentials and Access - -Default admin access: -- email `mail@mail.com` -- password `123456` - -Laravel Telescope access: -- email `mail@mail.com` -- password `123456` - -Laravel Nova access: -- email `mail@mail.com` -- password `123456` diff --git a/tests/fixtures/InitCommandTest/env.ci-testing.yml b/tests/fixtures/InitCommandTest/env.ci-testing.yml deleted file mode 100644 index d1b64d3..0000000 --- a/tests/fixtures/InitCommandTest/env.ci-testing.yml +++ /dev/null @@ -1,42 +0,0 @@ -APP_NAME=Laravel -APP_ENV=testing -APP_KEY=base64:RMlWJrRHIuHLYRplJvWaLNwWvRoVkQdDTZe6U1Z4xRY= -APP_DEBUG=true -APP_LOG_LEVEL=debug -APP_URL=http://localhost - -DB_CONNECTION=pgsql -DB_HOST=pgsql_test -DB_PORT=5432 -DB_DATABASE=forge -DB_USERNAME=forge -DB_PASSWORD="" - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -SESSION_DRIVER=file -QUEUE_CONNECTION=sync - -REDIS_HOST=redis -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null - -FILESYSTEM_DISK=local - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= - -FRONTEND_URL=http://localhost - -JWT_SECRET=av30tMhdKMXfF3OT1OPljEJ7e9KRG7Y4ruqfOPYWx1jRtqpgKwIohtp2n30uZtfs - -NOVA_GUARD=nova -NOVA_PASSWORDS=nova diff --git a/tests/fixtures/InitCommandTest/env.development.yml b/tests/fixtures/InitCommandTest/env.development.yml deleted file mode 100644 index 2a5b9d7..0000000 --- a/tests/fixtures/InitCommandTest/env.development.yml +++ /dev/null @@ -1,39 +0,0 @@ -APP_NAME="My App" -APP_ENV=development -APP_KEY= -APP_DEBUG=true -APP_LOG_LEVEL=debug -APP_URL=https://mysite.com - -DB_CONNECTION=pgsql -DB_HOST= -DB_PORT= -DB_DATABASE= -DB_USERNAME= -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -SESSION_DRIVER=redis -QUEUE_CONNECTION=redis - -REDIS_HOST=redis -REDIS_PASSWORD= -REDIS_PORT= - -MAIL_DRIVER=smtp -MAIL_HOST= -MAIL_PORT= -MAIL_USERNAME= -MAIL_PASSWORD= -MAIL_ENCRYPTION= - -FILESYSTEM_DISK=gcs - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= - -FRONTEND_URL= - -JWT_SHOW_BLACKLIST_EXCEPTION=true diff --git a/tests/fixtures/InitCommandTest/env.example.yml b/tests/fixtures/InitCommandTest/env.example.yml deleted file mode 100644 index be3d5ef..0000000 --- a/tests/fixtures/InitCommandTest/env.example.yml +++ /dev/null @@ -1,42 +0,0 @@ -APP_NAME="My App" -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_LOG_LEVEL=debug -APP_URL=http://localhost - -DB_CONNECTION=pgsql -DB_HOST=pgsql -DB_PORT=5432 -DB_DATABASE=postgres -DB_USERNAME=postgres -DB_PASSWORD="" - -BROADCAST_DRIVER=log -CACHE_DRIVER=redis -SESSION_DRIVER=redis -QUEUE_CONNECTION=sync - -REDIS_HOST=redis -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=smtp -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null - -FILESYSTEM_DISK=local -GOOGLE_CLOUD_STORAGE_BUCKET=ronasit-development -GOOGLE_CLOUD_PROJECT_ID=ronas-it-development - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= - -FRONTEND_URL=http://localhost - -JWT_SECRET= -JWT_SHOW_BLACKLIST_EXCEPTION=true diff --git a/tests/fixtures/InitCommandTest/env.testing.yml b/tests/fixtures/InitCommandTest/env.testing.yml deleted file mode 100644 index 94e41d7..0000000 --- a/tests/fixtures/InitCommandTest/env.testing.yml +++ /dev/null @@ -1,43 +0,0 @@ -APP_NAME=Laravel -APP_ENV=testing -APP_KEY=base64:RMlWJrRHIuHLYRplJvWaLNwWvRoVkQdDTZe6U1Z4xRY= -APP_DEBUG=true -APP_LOG_LEVEL=debug -APP_URL=http://localhost -FAIL_EXPORT_JSON=false - -DB_CONNECTION=pgsql -DB_HOST=pgsql_test -DB_PORT=5432 -DB_DATABASE=forge -DB_USERNAME=forge -DB_PASSWORD="" - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -SESSION_DRIVER=file -QUEUE_CONNECTION=sync - -REDIS_HOST=redis -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_DRIVER=log -MAIL_HOST=smtp.mailtrap.io -MAIL_PORT=2525 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null - -FILESYSTEM_DISK=local -GOOGLE_CLOUD_STORAGE_BUCKET=ronasit-development -GOOGLE_CLOUD_PROJECT_ID=ronas-it-development - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= - -FRONTEND_URL=http://localhost - -JWT_SECRET=av30tMhdKMXfF3OT1OPljEJ7e9KRG7Y4ruqfOPYWx1jRtqpgKwIohtp2n30uZtfs -JWT_SHOW_BLACKLIST_EXCEPTION=true diff --git a/tests/fixtures/InitCommandTest/full_readme.md b/tests/fixtures/InitCommandTest/full_readme.md deleted file mode 100644 index 83aac0e..0000000 --- a/tests/fixtures/InitCommandTest/full_readme.md +++ /dev/null @@ -1,83 +0,0 @@ -# My App - -This project implements an API for the My App Mobile app. - -## Project Resources & Contacts - -This section provides quick links to various resources and contacts associated -with this project. It's here to streamline your navigation and communication -process, so you can efficiently find what you need or reach out to who you need. - -### Resources - -Below are links to tools and services used in this project: -- [Issue Tracker](https://gitlab.com/my-project): Here, you can report any issues or bugs related to the project. -- [Figma](https://figma.com/my-project): This is where we maintain all our design assets and mock-ups. -- [Sentry](https://sentry.com/my-project): To monitor application performance and error tracking. -- [DataDog](https://datadoghq.com/my-project): This is where we monitor our logs, and server performance, and receive alerts. -- [ArgoCD](https://argocd.com/my-project): Is a kubernetes controller which continuously monitors running applications. -- [Laravel Telescope](https://mypsite.com/telescope-link): This is debug assistant for the Laravel framework. -- [Laravel Nova](https://mypsite.com/nova-link): This is admin panel for the Laravel framework. -- [API Documentation](https://mysite.com) - -### Contacts - -Should you need assistance or have questions, feel free to connect with the following individuals: -- Manager: If you have any high-level project concerns, feel free to get in touch with our project manager. [Connect with Manager](mailto:manager@mail.com) -- Code Owner/Team Lead: For specific questions about the codebase or technical aspects, reach out to our team lead. [Connect with Team Lead](mailto:lead@mail.com) - -Please be mindful of each individual's preferred contact method and office hours. - -## Prerequisites - -To work with this repository, you will need to have the following -installed: - -- [Docker](https://www.docker.com) - -## Getting Started - -To get started with this repository, follow these steps: - -Clone this repository to your local machine: - -```sh -git clone https://github.com/ronasit/laravel-helpers.git -``` - -Open project directory: - -```sh -cd laravel-helpers -``` - -Build and start containers, it may takes some time: - -```sh -docker compose up -d -``` - -## Environments - -This repository by default supports three environments: `local`, `development`, -and `testing`. Each environment is represented by an appropriate environment file: - -| Environment | File | URL | -| --- | --- |--------------------------------------| -| local | .env | [http://localhost](http://localhost) | -| testing | .env.testing | - | -| development | .env.development | [https://mysite.com](https://mysite.com) | - -## Credentials and Access - -Default admin access: -- email `mail@mail.com` -- password `123456` - -Laravel Telescope access: -- email `mail@mail.com` -- password `123456` - -Laravel Nova access: -- email `nova_mail@mail.com` -- password `654321` diff --git a/tests/fixtures/InitCommandTest/migration.php b/tests/fixtures/InitCommandTest/migration.php deleted file mode 100644 index cc0abd6..0000000 --- a/tests/fixtures/InitCommandTest/migration.php +++ /dev/null @@ -1,31 +0,0 @@ -insert([ - 'name' => 'TestAdmin', - 'email' => 'mail@mail.com', - 'password' => Hash::make('123456'), - 'role_id' => '1' - ]); - } - } - - public function down() - { - if (config('app.env') !== 'testing') { - DB::table('users') - ->where('email', 'mail@mail.com') - ->delete(); - } - } -} diff --git a/tests/fixtures/InitCommandTest/partial_readme.md b/tests/fixtures/InitCommandTest/partial_readme.md deleted file mode 100644 index 9df464c..0000000 --- a/tests/fixtures/InitCommandTest/partial_readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# My App - -This project implements an API for the My App Web app. - -## Project Resources & Contacts - -This section provides quick links to various resources and contacts associated -with this project. It's here to streamline your navigation and communication -process, so you can efficiently find what you need or reach out to who you need. - -### Resources - -Below are links to tools and services used in this project: -- [Issue Tracker](): Here, you can report any issues or bugs related to the project. (will be added later) -- [API Documentation](https://mysite.com) - -### Contacts - -Should you need assistance or have questions, feel free to connect with the following individuals: -- Manager: If you have any high-level project concerns, feel free to get in touch with our project manager. [Connect with Manager](mailto:manager@mail.com) -- Code Owner/Team Lead: For specific questions about the codebase or technical aspects, reach out to our team lead. [Connect with Team Lead](mailto::team_lead_link) - -Please be mindful of each individual's preferred contact method and office hours. - -## Environments - -This repository by default supports three environments: `local`, `development`, -and `testing`. Each environment is represented by an appropriate environment file: - -| Environment | File | URL | -| --- | --- |--------------------------------------| -| local | .env | [http://localhost](http://localhost) | -| testing | .env.testing | - | -| development | .env.development | [https://mysite.com](https://mysite.com) | - -## Credentials and Access From 6e53a0b48329d48b968a56c626d70e9bc455fe0d Mon Sep 17 00:00:00 2001 From: roman Date: Mon, 18 Nov 2024 17:48:06 +0600 Subject: [PATCH 2/6] fix: conflicts refs: https://github.com/RonasIT/laravel-project-initializator/issues/1 --- composer.lock | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 9d9850e..4647801 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cb92368e18e287849532ab4282e79b1e", + "content-hash": "1fa78ed9c20446e60a37bb2de7fcfd74", "packages": [ { "name": "brick/math", @@ -5735,6 +5735,55 @@ }, "time": "2024-11-04T10:52:30+00:00" }, + { + "name": "ronasit/laravel-project-initializator", + "version": "dev-move_init_commant_from_empty_project", + "source": { + "type": "git", + "url": "https://github.com/RonasIT/laravel-project-initializator.git", + "reference": "8bc1cb4c8d1f8aa5e009a53d7a68d66b9ab28e0b" + }, + "require": { + "ext-json": "*", + "laravel/framework": "^11.30", + "php": ">=8.3", + "php-mock/php-mock-phpunit": "^2.10", + "ronasit/laravel-helpers": "^3.0.0-beta" + }, + "require-dev": { + "brainmaestro/composer-git-hooks": "^3.0", + "fakerphp/faker": "^1.23.1", + "friendsofphp/php-cs-fixer": "^3.62", + "mockery/mockery": "^1.6.12", + "orchestra/testbench": "^9.3", + "php-coveralls/php-coveralls": "^2.7", + "phpunit/phpunit": "^10.5.30" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "RonasIT\\ProjectInitializator\\ProjectInitializatorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "RonasIT\\ProjectInitializator\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "RonasIT\\ProjectInitializator\\Tests\\": "tests/", + "RonasIT\\ProjectInitializator\\Tests\\Support\\": "tests/Support/" + } + }, + "license": [ + "MIT" + ], + "description": "Provided tools for project initialization.", + "time": "2024-11-18T11:24:18+00:00" + }, { "name": "ronasit/laravel-swagger", "version": "3.0.2", @@ -11438,7 +11487,8 @@ "aliases": [], "minimum-stability": "beta", "stability-flags": { - "ronasit/laravel-helpers": 10 + "ronasit/laravel-helpers": 10, + "ronasit/laravel-project-initializator": 20 }, "prefer-stable": false, "prefer-lowest": false, From cd01e1fc7bda781098b5d4a632a90a2218c4b2d6 Mon Sep 17 00:00:00 2001 From: roman Date: Mon, 18 Nov 2024 19:39:11 +0600 Subject: [PATCH 3/6] feat: update library refs: https://github.com/RonasIT/laravel-project-initializator/issues/1 --- composer.lock | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/composer.lock b/composer.lock index 4647801..c6df546 100644 --- a/composer.lock +++ b/composer.lock @@ -5741,7 +5741,7 @@ "source": { "type": "git", "url": "https://github.com/RonasIT/laravel-project-initializator.git", - "reference": "8bc1cb4c8d1f8aa5e009a53d7a68d66b9ab28e0b" + "reference": "890935c6eb792c58d7894e6ab0e2ccb56e32e7d7" }, "require": { "ext-json": "*", @@ -5781,8 +5781,20 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Ronas IT", + "homepage": "https://github.com/RonasIT/laravel-project-initializator/graphs/contributors" + } + ], "description": "Provided tools for project initialization.", - "time": "2024-11-18T11:24:18+00:00" + "keywords": [ + "init", + "laravel", + "project-initializator", + "readme" + ], + "time": "2024-11-18T13:28:17+00:00" }, { "name": "ronasit/laravel-swagger", From d74842bb0a783868fdcd915a6cf11dc211d58980 Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 19 Nov 2024 10:57:00 +0600 Subject: [PATCH 4/6] feat: update library refs: https://github.com/RonasIT/laravel-project-initializator/issues/1 --- composer.json | 2 +- composer.lock | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index d5def95..317d0dc 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "symfony/http-client": "^7.1.3", "symfony/mailgun-mailer": "^7.1.3", "symfony/postmark-mailer": "^7.1", - "ronasit/laravel-project-initializator": "dev-move_init_commant_from_empty_project" + "ronasit/laravel-project-initializator": "dev-main" }, "require-dev": { "ext-json": "*", diff --git a/composer.lock b/composer.lock index c6df546..88f0688 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1fa78ed9c20446e60a37bb2de7fcfd74", + "content-hash": "f93e6cf6c8b471b4ff6516d36e075529", "packages": [ { "name": "brick/math", @@ -5737,11 +5737,11 @@ }, { "name": "ronasit/laravel-project-initializator", - "version": "dev-move_init_commant_from_empty_project", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/RonasIT/laravel-project-initializator.git", - "reference": "890935c6eb792c58d7894e6ab0e2ccb56e32e7d7" + "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254" }, "require": { "ext-json": "*", @@ -5759,6 +5759,7 @@ "php-coveralls/php-coveralls": "^2.7", "phpunit/phpunit": "^10.5.30" }, + "default-branch": true, "type": "library", "extra": { "laravel": { @@ -5794,7 +5795,7 @@ "project-initializator", "readme" ], - "time": "2024-11-18T13:28:17+00:00" + "time": "2024-11-19T04:17:03+00:00" }, { "name": "ronasit/laravel-swagger", From b68ed41a4720286de2c7d7b3610270a889df381c Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 19 Nov 2024 13:12:33 +0600 Subject: [PATCH 5/6] feat: update library refs: https://github.com/RonasIT/laravel-project-initializator/issues/1 --- composer.json | 10 ++-------- composer.lock | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 317d0dc..9937111 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "symfony/http-client": "^7.1.3", "symfony/mailgun-mailer": "^7.1.3", "symfony/postmark-mailer": "^7.1", - "ronasit/laravel-project-initializator": "dev-main" + "ronasit/laravel-project-initializator": "0.0.1-beta" }, "require-dev": { "ext-json": "*", @@ -93,11 +93,5 @@ ] } }, - "minimum-stability": "beta", - "repositories": [ - { - "type": "git", - "url": "https://github.com/RonasIT/laravel-project-initializator.git" - } - ] + "minimum-stability": "beta" } diff --git a/composer.lock b/composer.lock index 88f0688..f232fdd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f93e6cf6c8b471b4ff6516d36e075529", + "content-hash": "fe5f33cc51a8a76b9ac287c1908742f5", "packages": [ { "name": "brick/math", @@ -5737,12 +5737,18 @@ }, { "name": "ronasit/laravel-project-initializator", - "version": "dev-main", + "version": "0.0.1-beta", "source": { "type": "git", "url": "https://github.com/RonasIT/laravel-project-initializator.git", "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254" }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/RonasIT/laravel-project-initializator/zipball/ae2173bd5b410b8b6560ee50ad88395830de8254", + "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254", + "shasum": "" + }, "require": { "ext-json": "*", "laravel/framework": "^11.30", @@ -5759,7 +5765,6 @@ "php-coveralls/php-coveralls": "^2.7", "phpunit/phpunit": "^10.5.30" }, - "default-branch": true, "type": "library", "extra": { "laravel": { @@ -5773,12 +5778,7 @@ "RonasIT\\ProjectInitializator\\": "src/" } }, - "autoload-dev": { - "psr-4": { - "RonasIT\\ProjectInitializator\\Tests\\": "tests/", - "RonasIT\\ProjectInitializator\\Tests\\Support\\": "tests/Support/" - } - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5795,6 +5795,10 @@ "project-initializator", "readme" ], + "support": { + "issues": "https://github.com/RonasIT/laravel-project-initializator/issues", + "source": "https://github.com/RonasIT/laravel-project-initializator/tree/0.0.1-beta" + }, "time": "2024-11-19T04:17:03+00:00" }, { @@ -11501,7 +11505,7 @@ "minimum-stability": "beta", "stability-flags": { "ronasit/laravel-helpers": 10, - "ronasit/laravel-project-initializator": 20 + "ronasit/laravel-project-initializator": 10 }, "prefer-stable": false, "prefer-lowest": false, From 45be8c803df5349c8aaa339ee733d4606d06ebfc Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 19 Nov 2024 15:21:56 +0600 Subject: [PATCH 6/6] feat: move to require-dev refs: https://github.com/RonasIT/laravel-project-initializator/issues/1 --- composer.json | 6 +-- composer.lock | 134 +++++++++++++++++++++++++------------------------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/composer.json b/composer.json index 9937111..6e11199 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,7 @@ "spatie/laravel-ignition": "^2.8", "symfony/http-client": "^7.1.3", "symfony/mailgun-mailer": "^7.1.3", - "symfony/postmark-mailer": "^7.1", - "ronasit/laravel-project-initializator": "0.0.1-beta" + "symfony/postmark-mailer": "^7.1" }, "require-dev": { "ext-json": "*", @@ -37,7 +36,8 @@ "mockery/mockery": "^1.6", "php-coveralls/php-coveralls": "^2.7", "phpunit/phpunit": "^10.5", - "ronasit/laravel-entity-generator": "^3.1" + "ronasit/laravel-entity-generator": "^3.1", + "ronasit/laravel-project-initializator": "0.0.1-beta" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index f232fdd..0ab731a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fe5f33cc51a8a76b9ac287c1908742f5", + "content-hash": "3d61e61f0591fc0461b09ed930328a58", "packages": [ { "name": "brick/math", @@ -5735,72 +5735,6 @@ }, "time": "2024-11-04T10:52:30+00:00" }, - { - "name": "ronasit/laravel-project-initializator", - "version": "0.0.1-beta", - "source": { - "type": "git", - "url": "https://github.com/RonasIT/laravel-project-initializator.git", - "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/RonasIT/laravel-project-initializator/zipball/ae2173bd5b410b8b6560ee50ad88395830de8254", - "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254", - "shasum": "" - }, - "require": { - "ext-json": "*", - "laravel/framework": "^11.30", - "php": ">=8.3", - "php-mock/php-mock-phpunit": "^2.10", - "ronasit/laravel-helpers": "^3.0.0-beta" - }, - "require-dev": { - "brainmaestro/composer-git-hooks": "^3.0", - "fakerphp/faker": "^1.23.1", - "friendsofphp/php-cs-fixer": "^3.62", - "mockery/mockery": "^1.6.12", - "orchestra/testbench": "^9.3", - "php-coveralls/php-coveralls": "^2.7", - "phpunit/phpunit": "^10.5.30" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "RonasIT\\ProjectInitializator\\ProjectInitializatorServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "RonasIT\\ProjectInitializator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ronas IT", - "homepage": "https://github.com/RonasIT/laravel-project-initializator/graphs/contributors" - } - ], - "description": "Provided tools for project initialization.", - "keywords": [ - "init", - "laravel", - "project-initializator", - "readme" - ], - "support": { - "issues": "https://github.com/RonasIT/laravel-project-initializator/issues", - "source": "https://github.com/RonasIT/laravel-project-initializator/tree/0.0.1-beta" - }, - "time": "2024-11-19T04:17:03+00:00" - }, { "name": "ronasit/laravel-swagger", "version": "3.0.2", @@ -11225,6 +11159,72 @@ }, "time": "2024-11-11T14:44:05+00:00" }, + { + "name": "ronasit/laravel-project-initializator", + "version": "0.0.1-beta", + "source": { + "type": "git", + "url": "https://github.com/RonasIT/laravel-project-initializator.git", + "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/RonasIT/laravel-project-initializator/zipball/ae2173bd5b410b8b6560ee50ad88395830de8254", + "reference": "ae2173bd5b410b8b6560ee50ad88395830de8254", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel/framework": "^11.30", + "php": ">=8.3", + "php-mock/php-mock-phpunit": "^2.10", + "ronasit/laravel-helpers": "^3.0.0-beta" + }, + "require-dev": { + "brainmaestro/composer-git-hooks": "^3.0", + "fakerphp/faker": "^1.23.1", + "friendsofphp/php-cs-fixer": "^3.62", + "mockery/mockery": "^1.6.12", + "orchestra/testbench": "^9.3", + "php-coveralls/php-coveralls": "^2.7", + "phpunit/phpunit": "^10.5.30" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "RonasIT\\ProjectInitializator\\ProjectInitializatorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "RonasIT\\ProjectInitializator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ronas IT", + "homepage": "https://github.com/RonasIT/laravel-project-initializator/graphs/contributors" + } + ], + "description": "Provided tools for project initialization.", + "keywords": [ + "init", + "laravel", + "project-initializator", + "readme" + ], + "support": { + "issues": "https://github.com/RonasIT/laravel-project-initializator/issues", + "source": "https://github.com/RonasIT/laravel-project-initializator/tree/0.0.1-beta" + }, + "time": "2024-11-19T04:17:03+00:00" + }, { "name": "symfony/config", "version": "v7.2.0-RC1",