Skip to content

Commit

Permalink
docs: split contribution and usage (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Apr 26, 2022
1 parent 265b3cb commit b73da52
Show file tree
Hide file tree
Showing 26 changed files with 474 additions and 472 deletions.
2 changes: 1 addition & 1 deletion .github/.cache_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.9
8.0.9.0.8
101 changes: 7 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,18 @@ nvm use && yarn

## Setup dev environment

You can also execute docker commands one by one, see [Docker commands](#docker)

```bash
yarn docker:setup
```

### Docker

#### Build

Build docker image from [Dockerfile](./Dockerfile)

[How to add a new client](https://api-clients-automation.netlify.app/docs/addNewClient) | [How to add a new language](https://api-clients-automation.netlify.app/docs/addNewLanguage) | [Common Test Suite](https://api-clients-automation.netlify.app/docs/commonTestSuite) | [Run the playground](https://api-clients-automation.netlify.app/docs/playground)

```bash
yarn docker:build
```

#### Mount

Mount docker image on `dev` container

```bash
yarn docker:mount
```

#### Clean

Stops `dev` container and clean the built image

```bash
yarn docker:clean
```
[Read more on our documentation](https://api-clients-automation.netlify.app/docs/automation/setupRepository)

## Contributing

You can make changes locally and run commands through the docker container.

[Specs CLI commands](https://api-clients-automation.netlify.app/docs/automation/CLI/specsCommands)[Clients CLI commands](https://api-clients-automation.netlify.app/docs/automation/CLI/clientsCommands)[CTS CLI commands](https://api-clients-automation.netlify.app/docs/automation/CLI/ctsCommands)

### Build and validate specs

#### Usage
Expand All @@ -56,32 +30,7 @@ You can make changes locally and run commands through the docker container.
yarn docker build specs <client | all>
```

#### Build all specs

```bash
yarn docker build specs
```

#### Build specific spec

```bash
yarn docker build specs recommend
```

#### Fix the specs format

This is used by the build script and should not need to be called manually but if you want to format all specs file do:

```bash
yarn specs:fix
```

If you just want to check the format (not override the files), run:

```bash
yarn specs:lint <client>
yarn specs:lint search
```
[Read more on our documentation](https://api-clients-automation.netlify.app/docs/automation/addNewApiClient)

### Generate clients based on the [`specs`](./specs/)

Expand All @@ -91,47 +40,11 @@ yarn specs:lint search
yarn docker generate <language | all> <client | all>
```

#### Generate all clients

```bash
yarn docker generate
```

### Generate specific client for specific language

#### Usage

```bash
yarn docker build clients <language | all> <client | all>
```

### Build specific client for specific language

```bash
yarn docker build clients java recommend
```

### Verbose command

You can add `-v` to almost every command to have a more verbose output.

### Interactive command

If you want to choose the language and client from a list you can add the `--interactive` option, or `-i`.
[Read more on our documentation](https://api-clients-automation.netlify.app/docs/automation/addNewLanguage)

## Testing clients

You can test our generated clients by running:

- The playground [`playground`](./playground) ([Playground README](./docs/playground.md))
- Tests with our [`Common Test Suite`](./tests/) ([CTS README](./docs/commonTestSuite.md)).

# Troubleshooting

> `Error: The operation couldn't be completed. Unable to locate a Java Runtime.`
Java is not located in your PATH, either source the right `.bash_profile`, `.zshrc`, etc. file or do the following command in this repository:

```bash
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' > .bash_profile && source .bash_profile
```
- The playground [`playground`](./playground) ([Playground](https://api-clients-automation.netlify.app/docs/automation/testing/playground.md))
- Tests with our [`Common Test Suite`](./tests/) ([Common Test Suite](https://api-clients-automation.netlify.app/docs/automation/testing/commonTestSuite.md)).
2 changes: 2 additions & 0 deletions clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This folder hosts the generated clients.

[Read more on our documentation](https://api-clients-automation.netlify.app/docs/clients/introduction)

## Generated clients

### Java
Expand Down
8 changes: 1 addition & 7 deletions clients/algoliasearch-client-javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
</p>

<p align="center">
<a href="https://www.algolia.com/doc/api-client/getting-started/install/javascript/" target="_blank">Documentation</a> •
<a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> •
<a href="https://discourse.algolia.com" target="_blank">Community Forum</a> •
<a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> •
<a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> •
<a href="https://www.algolia.com/doc/api-client/troubleshooting/faq/javascript/" target="_blank">FAQ</a> •
<a href="https://www.algolia.com/support" target="_blank">Support</a>
<a href="https://api-clients-automation.netlify.app/docs/clients/introduction" target="_blank">Documentation</a>
</p>

# Contributing to this repository
Expand Down
77 changes: 0 additions & 77 deletions docs/submodules.md

This file was deleted.

2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build]
command="yarn website:build"
publish="website/build"
ignore="git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- website/ specs/bundled/"
ignore="git diff --quiet origin/main -- website/"

[build.environment]
YARN_VERSION = "3.1.1"
6 changes: 5 additions & 1 deletion scripts/ci/setRunVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ const VARIABLES_TO_CHECK = [
},
{
name: 'JS_CLIENT_CHANGED',
path: [JS_CLIENT_FOLDER, `:!${JS_CLIENT_FOLDER}/.github`],
path: [
JS_CLIENT_FOLDER,
`:!${JS_CLIENT_FOLDER}/.github`,
`:!${JS_CLIENT_FOLDER}/README.md`,
],
},
{
name: 'JS_ALGOLIASEARCH_CHANGED',
Expand Down
2 changes: 2 additions & 0 deletions specs/bundled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ This folder hosts the bundled specs used to:
- Generate clients.
- Generate documentation.
- Share single readable spec file for a specific client.

[Read more on our documentation](https://api-clients-automation.netlify.app/docs/automation/introduction)
100 changes: 0 additions & 100 deletions website/docs/addNewClient.md

This file was deleted.

Loading

0 comments on commit b73da52

Please sign in to comment.