You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+57-12Lines changed: 57 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,23 +22,25 @@ Then, if it appears that it's a real bug, you may report it using GitHub by foll
22
22
23
23
### Writing a Pull Request
24
24
25
-
Please base your changes on the `master` branch.
25
+
Please base your changes on the `main` branch.
26
26
27
-
### Installing the Source Version
27
+
### Two ways to write your patch
28
28
29
-
To install the source version of API Platform Admin in your project and contribute a patch, follow the instructions below.
29
+
You can patch `@api-platform/admin` by two different ways:
30
+
- by linking `@api-platform/admin` sources to an existing project;
31
+
- by installing this project and running it through Storybook.
30
32
31
-
Create your client that will use `api-platform-admin` (replace `<yourproject>` by your project's name):
33
+
> Prerequiste: running Api-Platform backend. See the [Getting Started guide](https://api-platform.com/docs/distribution/) to learn more.
32
34
33
-
```shell
34
-
yarn create react-app <yourproject>
35
-
cd<yourproject>
36
-
yarn add @api-platform/admin
37
-
```
35
+
#### Linking the Source Version to an existing project
36
+
37
+
If you already have a project in progress, you can develop directly from it.
38
+
39
+
The instructions below explain how to install the source version of API Platform Admin in your project and contribute a patch.
38
40
39
-
Replace `src/App.js` by this one:
41
+
Your client should already uses `@api-platform/admin` and its bootstrap file (usually: `src/App.tsx`) should at least contains:
40
42
41
-
```javascript
43
+
```tsx
42
44
importReactfrom'react';
43
45
import { HydraAdmin } from'@api-platform/admin';
44
46
@@ -86,7 +88,50 @@ cd ../<yourproject>/
86
88
yarn start
87
89
```
88
90
89
-
You can now hack in the cloned repository of `api-platform-admin`.
91
+
> You can now hack in the cloned repository of `api-platform-admin`.
92
+
93
+
#### Running Admin through Storybook
94
+
95
+
If you don't have an existing API Platform application, you can use one of the bundled example APIs, and visualize the admin through [Storybook](https://storybook.js.org/).
start-simple: ## Start the simple Api-Platform backend and the Storybook frontend
15
+
cd backend/simple && make build && make up HTTP_PORT=${SIMPLE_HTTP_PORT} HTTP3_PORT=${SIMPLE_HTTPS_PORT} HTTPS_PORT=${SIMPLE_HTTPS_PORT}&&cd .. && yarn run storybook
16
+
17
+
stop-simple: ## Stop and prune the simple Api-Platform backend
0 commit comments