luyadev / luya-env-dev
The LUYA DEV ENV repo helps you developing new extension and modules or making pull requests to the luya core repos.
Installs: 66
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 6
Open Issues: 1
Type:luya-core
Requires
- aws/aws-sdk-php: ^3.0
- cebe/php-openapi: ^1.4
- cpliakas/git-wrapper: 2.1.0
- fabpot/goutte: ~3.1.0
- jakeasmith/http_build_url: ^1.0
- luyadev/luya: ^1.0
- luyadev/luya-headless: ^2.5
- luyadev/luya-module-admin: ^3.0
- luyadev/luya-module-cms: ^3.0
- luyadev/yii-helpers: ^1.0
- nadar/stemming: ^1.0
- paypal/rest-api-sdk-php: ^1.0
- robthree/twofactorauth: ^1.7
- sizeg/yii2-jwt: ^1.2
- stripe/stripe-php: ^6.19
- whichbrowser/parser: ^2.0
Requires (Dev)
- yiisoft/yii2-debug: ^2.0
- yiisoft/yii2-gii: ^2.0
README
LUYA Dev Environment
The LUYA DEV ENV repo helps you developing new extension and modules or making pull requests to the luya core repos.
Installation
Before installing the env dev project, fork the repos you like to work with.
- Clone the luya env dev
git clone https://github.com/luyadev/luya-env-dev.git
- Rename
configs/env.php.dist
toconfigs/env.php
(mv configs/env.php.dist configs/env.php
- Install composer and init repos
composer install
and afterwards./vendor/bin/luyadev repo/init
- Start the env with docker-compose
docker-compose up
- You can now ssh (f.e
docker exec -it luya-env-dev_luya_web_1 /bin/bash
) into the web container and execute the commands./luya migrate
,./luya import
,./luya admin/setup
,./luya health
. - Test your setup and visit
localhost:8080
(Maybe you need to create thepublic_html/assets
andruntime
storage and enable permissions fro them)
We recommend using docker and therefore using docker-compose up
, because this will also run an unglue server you can compile styles with
Working on CMS and Admin
If you need to work on CMS or Admin modules, we recommend the above steps has been done and you are running with docker-compose up
.
- Edit the module files in the folder
repos/luya-module-...
- Install deps from the module with
composer install
(inside the folder of that module, f.erepos/luya-module-admin
) (this will install the unglue binary f.e) - If you change js or css code run the unglue watch command in the modules folder:
./vendor/bin/unglue watch --server=localhost:3000
Update your local luya-env-dev repos
To fetch the upstream for all forked modules from the repos
folder run:
./vendor/bin/luyadev repo/update
Make sure you push each module after update to get your remote fork even with the upstream.
Its highly recommend to leave the master branch of the modules untouched to ensure that rebasing works properly. Always create a new branch to work on it.
Changes, collaboration and contribution
For all the FORKED repos (not the read only repos) you can now make changes directly in the repos/
folder. Assuming you want to make a change in the luya-admin-module which you have forked to your account:
- Go into the luya-module-admin
cd /repos/luya-module-admin
. - Create new branch and commit your changes
git branch my-fix
go into branchgit checkout my-fix
. - Make your changes and add them
git add .
and commitgit commit -m 'Added something ...'
. - Push branch to your fork
git push origin my-fix
. - Create pull request from GitHub.
Run Unit Tests for a Repo
In order to run your tests for the repo please keep in mind that first of all you have to run composer install
in the root of the repo (e.g. replos/luya-admin-module
) to install all dependencies afterwards run ./vendor/bin/phpunit tests
in the root of the repo to run the tests in the tests-folder.
Develop your own module or extension
- Clone your repo into the repos folder with
./vendor/bin/luyadev repo/clone USERNAME/REPO_NAME
. - Create a
Module.php
file accordingly to the LUYA guide specifications. - Adding your module via psr-4 binding to your
composer.json
at the autoload section from luya-env-dev root directory. - Run
composer dump-autoload
for luya-env-dev. - Include your module in
configs/env.php
.
If you would like to use the
@bower
alias inside your own module to include dependencies fromvendor/bower
keep in mind that dependecies need to be installed via composer inside your luya-env-dev root directory.
Managing assets and vendors in modules and extensions
Please keep in mind that all modules and extensions are treated as independent projects, so do not forget to run in the root directory of the module composer install
and probably npm install
in the /resources
directories of modules to download all needed dependencies.