Skip to content

Commit 3d63e53

Browse files
committed
apply changes from suggestion
1 parent a5bb1fc commit 3d63e53

File tree

2 files changed

+40
-25
lines changed

2 files changed

+40
-25
lines changed

docs/addNewClient.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,33 @@ Adding a client requires a few manual steps in order to setup the tooling, gener
44

55
> See [README](../README.md) to `setup the repository tooling` and `setup dev environment`.
66
7-
## Configuring the environment
7+
## 1. Writing specs
88

9-
After setting up the dev environment from [README](../README.md), you need to update the configuration files to properly generate clients that are maintainable.
9+
We recommend to have a look at [existing spec files](../specs/). The `bundled` folder is automatically generated, manual changes shouldn't be done in these files.
10+
11+
### [common spec folder](../specs/common/)
12+
13+
Properties that are common to Algolia or used in multiple clients.
14+
15+
### <clientName> spec folder
16+
17+
> Example with the [search client spec](../specs/search/)
18+
19+
#### `spec.yml` file
20+
21+
This file is the entry point of the client spec, it contains `servers`, `paths` and other specific imformations of the API. We recommend to copy an existing [`spec.yml` file](../specs/search/spec.yml) to get started.
22+
23+
#### <clientName>/common folder
24+
25+
Properties that are common to the client.
26+
27+
#### <clientName>/paths folder
28+
29+
Path definition of the paths defined in the [spec file](#specyml-file)
30+
31+
## 2. Configuring the environment
32+
33+
After setting up the dev environment from [README](../README.md) and [writing your spec files](#1-writing-specs), you need to update the configuration files to properly generate clients that are maintainable.
1034

1135
### Generation config
1236

@@ -36,7 +60,7 @@ You can copy an existing object of a client and replace the `<clientName>` value
3660

3761
### GitHub actions
3862

39-
The built clients are cached with the [Cache GitHub Action](../.github/actions/cache/action.yml) to avoid useless CI tasks.
63+
The built clients are cached with the [Cache GitHub Action](../.github/actions/cache/action.yml) to avoid unnecessary CI tasks.
4064

4165
> TODO: Automate this step
4266
@@ -51,26 +75,10 @@ You can copy [an existing client caching step](../.github/actions/cache/action.y
5175
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-<LANGUAGE>-<CLIENT_NAME>-${{ hashFiles('clients/<LANGUAGE_FOLDER>/<CLIENT_NAME>/**') }}-${{ hashFiles('specs/bundled/<CLIENT_SPEC>.yml') }}
5276
```
5377
54-
## Writing specs
55-
56-
We recommend to have a look at [existing spec files](../specs/). The `bundled` folder is automatically generated, manual changes shouldn't be done in these files.
57-
58-
### [common spec folder](../specs/common/)
59-
60-
Properties that are common to Algolia or used in multiple clients.
61-
62-
### [clientName spec folder](../specs/search)
78+
## 3. Generate new client
6379
64-
#### [spec file](../specs/search/spec.yml)
80+
> You can find more commands in the [README](../README.md#generate-all-clients).
6581
66-
We recommend to copy an of existing [spec file](../specs/search/spec.yml) and edit the `paths` and `servers
67-
68-
This file is the entry point of the spec, it contains `servers` and `paths` of the API spec.
69-
70-
#### [spec common folder](../specs/search/common)
71-
72-
Properties that are common to the client.
73-
74-
#### [paths folder](../specs/search/paths)
75-
76-
Path definition of the paths defined in the [spec file](../specs/search/spec.yml)
82+
```bash
83+
yarn docker generate <languageName> <clientName>
84+
```

docs/playground.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All of the existing clients should have an active playground for you to test gen
55
## Usage
66

77
```bash
8-
yarn docker playground <language> <client>
8+
yarn docker playground <languageName> <clientName>
99
```
1010

1111
### JavaScript
@@ -19,3 +19,10 @@ yarn docker playground javascript search
1919
```bash
2020
yarn docker playground java search
2121
```
22+
23+
## Add new playground
24+
25+
To add a new supported language to the playground, you need to:
26+
27+
- Create a new folder with your <languageName> in [the playground folder](../playground/)
28+
- Edit the [playground script](../scripts/playground.sh) with the command to run i§t.

0 commit comments

Comments
 (0)