@@ -30,14 +30,29 @@ publicly**. We will disclose details of the issue and credit you after having re
30
30
First of all, you must decide on what branch your changes will be based depending of the nature of the change.
31
31
See [ the dedicated documentation entry] ( https://api-platform.com/docs/extra/releases/ ) .
32
32
33
+ To prepare your patch directly in the ` vendor/ ` of an existing project (convenient to fix a bug):
34
+
35
+ 1 . Remove the existing copy of the library: ` rm -Rf vendor/api-platform/core `
36
+ 2 . Reinstall the lib while keeping Git metadata: ` composer install --prefer-source `
37
+ 3 . You can now work directly in ` vendor/api-platform/core ` , create a new branch: ` git checkout -b my_patch `
38
+ 4 . When your patch is ready, fork the project and add your Git remote:
` git remote add <your-name> [email protected] :<your-name>/core.git `
39
+ 5 . You can now push your code and open your Pull Request: ` git push <your-name> my_patch `
40
+
41
+ Alternatively, you can also work with the test application we provide:
42
+
43
+ cd tests/Fixtures/app
44
+ ./console assets:install --symlink
45
+ symfony serve
46
+
47
+ # or if you prefer using the PHP built-in web server
48
+ php -S localhost:8000 -t public/
49
+
33
50
### Matching Coding Standards
34
51
35
52
The API Platform project follows [ Symfony coding standards] ( https://symfony.com/doc/current/contributing/code/standards.html ) .
36
53
But don't worry, you can fix CS issues automatically using the [ PHP CS Fixer] ( http://cs.sensiolabs.org/ ) tool:
37
54
38
- ``` shell
39
- php-cs-fixer.phar fix
40
- ```
55
+ php-cs-fixer.phar fix
41
56
42
57
And then, add the fixed file to your commit before pushing.
43
58
Be sure to add only ** your modified files** . If any other file is fixed by cs tools, just revert it before committing.
@@ -66,45 +81,33 @@ Both `phpunit` and `behat` are development dependencies and should be available
66
81
67
82
To launch unit tests:
68
83
69
- ``` shell
70
- vendor/bin/phpunit --stop-on-failure -vvv
71
- ```
84
+ vendor/bin/phpunit --stop-on-failure -vvv
72
85
73
- If you want coverage, you will need the ` phpdbg ` package and run:
86
+ If you want coverage, you will need the ` pcov ` PHP extension and run:
74
87
75
- ``` shell
76
- phpdbg -qrr vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
77
- ```
88
+ vendor/bin/phpunit --coverage-html coverage -vvv --stop-on-failure
78
89
79
90
Sometimes there might be an error with too many open files when generating coverage. To fix this, you can increase the ` ulimit ` , for example:
80
91
81
- ``` shell
82
- ulimit -n 4000
83
- ```
92
+ ulimit -n 4000
84
93
85
94
Coverage will be available in ` coverage/index.html ` .
86
95
87
96
#### Behat
88
97
89
98
The command to launch Behat tests is:
90
99
91
- ``` shell
92
- ./vendor/bin/behat --suite=default --stop-on-failure -vvv
93
- ```
100
+ ./vendor/bin/behat --suite=default --stop-on-failure -vvv
94
101
95
102
If you want to launch Behat tests for MongoDB, the command is:
96
103
97
- ``` shell
98
- APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
99
- ```
104
+ APP_ENV=mongodb ./vendor/bin/behat --suite=mongodb --stop-on-failure -vvv
100
105
101
106
## Squash your Commits
102
107
103
108
If you have 3 commits, start with:
104
109
105
- ``` shell
106
- git rebase -i HEAD~3
107
- ```
110
+ git rebase -i HEAD~3
108
111
109
112
An editor will be opened with your 3 commits, all prefixed by ` pick ` .
110
113
@@ -116,15 +119,11 @@ After that, all your commits will be squashed into the first one and the commit
116
119
117
120
If you would like to rename your commit message, type:
118
121
119
- ``` shell
120
- git commit --amend
121
- ```
122
+ git commit --amend
122
123
123
124
Now force push to update your PR:
124
125
125
- ``` shell
126
- git push --force-with-lease
127
- ```
126
+ git push --force-with-lease
128
127
129
128
# License and Copyright Attribution
130
129
@@ -134,3 +133,13 @@ and to transfer the copyright on the submitted code to Kévin Dunglas.
134
133
Be sure to you have the right to do that (if you are a professional, ask your company)!
135
134
136
135
If you include code from another project, please mention it in the Pull Request description and credit the original author.
136
+
137
+ # Releases
138
+
139
+ This section is dedicated to maintainers.
140
+
141
+ 1 . Update the JavaScript dependencies by running ` ./update-js.sh ` (always check if it works in a browser)
142
+ 2 . Update the ` CHANGELOG.md ` file (be sure to include Pull Request numbers when appropriate)
143
+ 3 . Create a signed tag: ` git tag -s vX.Y.Z -m "Version X.Y.Z" `
144
+ 4 . Create a release using GitHub's UI and copy the changelog
145
+ 5 . Create a new release of ` api-platform/api-platform `
0 commit comments