Skip to content

Commit

Permalink
Merge pull request #10 from TheMaaarc/start-collaboration
Browse files Browse the repository at this point in the history
Added "Start collaboration" doc
  • Loading branch information
Basil committed Jan 27, 2015
2 parents 9b69fd4 + 47bc34d commit 8b34c1a
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
Binary file added docs/guide/img/start-collaboration-fork.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions docs/guide/start-collaboration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
Start collaboration
===================

How to collaborate with us and contribute to the LUYA Project.

1. Fork Luya
2. Recommended directory structure
3. Clone luya fork
4. Create luya-kickstarter project
4.1. Update config
4.2. Update composer.json
5. Define the upstream repo
6. Work routine
7. Add changes to zephir/luya (Pull request)

1. Fork Luya
-------------
Fork the Luya project on Github: [https://github.com/zephir/luya](https://github.com/zephir/luya).
![fork-luya](img/start-collaboration-fork.jpg "Fork Luya")

2. Recommended directory structure
------------------------------------
You will have two directories that depends on each other.

1. The «luya» directory
2. The «luya-kickstarter» directory

I will work with the following structure:
```
luya/
├ luya/ # luya
├ website/ # luya-kickstarter
```

3. Clone luya fork
-------------------
Working directory: luya/luya/

Use following command to clone the forked Luya project.

Don't forget to replace "username" with your Github username
```
git clone https://github.com/username/luya.git .
```

Install Luya. For the complete guide, visit: [https://github.com/zephir/luya](https://github.com/zephir/luya)

4. Create luya-kickstarter project
------------------------------------
Working directory: luya/website/

1. Create the luya-kickstarter project with composer.
2. Move all files from the created directory into luya/website/
```
composer create-project zephir/luya-kickstarter:dev-master
```
You will be asked if you want to remove the .git files. Answer with Y if you want to push the luya-kickstarter project into your own repository.
```
Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]?
```
Now you have to move all files to your main folder.
```
mv luya-kickstarter/* . && mv luya-kickstarter/.* .
rm -rf luya-kickstarter/
```
All files are now in the right place.

### 4.1 Updated config
Copy local config template:
```
cp config/local.php.dist config/local.php
```
Edit local config and update db informations:
```
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=your_dbname;unix_socket=your_unix_socket',
'username' => 'your_username',
'password' => 'your_password'
]
```

### 4.2 Updated composer
To work on luya modules, we have to update the composer.json.
Change it's content to the following:
```
{
...
"require": {
"yiisoft/yii2": "2.0.*"
},
...
"autoload" : {
"psr-4" : {
"luya\\" : "../luya/src/",
"admin\\" : "../luya/modules/admin",
"cms\\" : "../luya/modules/cms",
"cmsadmin\\" : "../luya/modules/cmsadmin"
}
},
...
}
```
**Run:**
```
composer update
```

All luya relevant files are now loaded from the luya/luya/ folder.

For more informations and troubleshooting: https://github.com/zephir/luya-kickstarter

Define the upstream repo
-------------------------
Working directory: luya/luya/

To update your fork you have to add the original repo:
```
git remote add upstream https://github.com/zephir/luya.git
```

Working routine
----------------
Before working on luya, you have to update your local master branch to the newest version:
```
git checkout master
git fetch upstream
git rebase upstream/master
```

Now that you're on the newest release, create a branch from master:
Don't forget to replace "newBranch" with a meaningful name.
```
git checkout -b newBranch master
```

Commit & Push all changes to this new branch.

Add changes to zephir/luya (Pull request)
-----------------------------------------
Now that you've committed and pushed all of your files, go to your forked luya project on Github.
Click on «Pull request» on the right side and then on the green button «New pull request».

On the following screen, choose your branch to merge, check everything and create the pull request.
![pull-request](img/start-collaboration-pull-request.jpg "Pull request")

0 comments on commit 8b34c1a

Please sign in to comment.