-
Notifications
You must be signed in to change notification settings - Fork 28
docs: update contribution guides [skip-bc] #4051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d553b61
f84e15f
ce6e870
9f88ae8
0c00ff3
48afb6c
d0a58e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| --- | ||
| title: Build commands | ||
| --- | ||
|
|
||
| # Build commands | ||
|
|
||
| :::info | ||
|
|
||
| You can use `yarn cli` as a drop in replacement for `apic`. | ||
|
|
||
| ::: | ||
|
|
||
| The Build commands are used to [`build`](#build) API specs, clients, playground, snippets and guides. | ||
|
|
||
| ## Usage for specs | ||
|
|
||
| > `client` defaults to `all` | ||
|
|
||
| > The `client` parameter is variadic, you can pass multiple `client` name | ||
|
|
||
| ```bash | ||
| apic build specs <client... | all> | ||
| ``` | ||
|
|
||
| ### Available options | ||
|
|
||
| | Option | Command | Description | | ||
| | ---------- | :--------------- | :------------------------------------------------------------- | | ||
| | verbose | -v, --verbose | Make the process verbose, display logs from third party tools | | ||
| | skip cache | -s, --skip-cache | Skip cache checking to force building specs | | ||
| | docs | -d, --docs | Builds the specs for the Algolia doc, which embeds the snippets| | ||
|
|
||
| ## Build specs | ||
|
|
||
| ### Build all specs | ||
|
|
||
| ```bash | ||
| apic build specs | ||
| ``` | ||
|
|
||
| ### Build specific spec | ||
|
|
||
| ```bash | ||
| apic build specs recommend | ||
| ``` | ||
|
|
||
| ### Build many spec | ||
|
|
||
| ```bash | ||
| apic build specs recommend search ingestion | ||
| ``` | ||
|
|
||
| ## Lint | ||
|
|
||
| ### Fix specs | ||
|
|
||
| > Automatically done when building specs | ||
|
|
||
| ```bash | ||
| yarn specs:fix | ||
| ``` | ||
|
|
||
| ### Check specs | ||
|
|
||
| If you just want to check the format (not override the files) | ||
|
|
||
| ```bash | ||
| yarn specs:lint search | ||
| ``` | ||
|
|
||
| ## Usage for clients, playground, snippets and guides | ||
|
|
||
| > `language` and `client` defaults to `all` | ||
|
|
||
| > The `client` parameter is variadic, you can pass multiple `client` name | ||
|
|
||
| > scope is one of: `clients` | `playground` | `snippets` | `guides` | ||
|
|
||
| ```bash | ||
| apic build <scope> <language | all> <client... | all> | ||
| ``` | ||
|
|
||
| ### Available options | ||
|
|
||
| | Option | Command | Description | | ||
| | ------- | :------------ | :------------------------------------------------------------ | | ||
| | verbose | -v, --verbose | Make the process verbose, display logs from third party tools | | ||
|
|
||
| ## Build | ||
|
|
||
| ### Build all clients for all supported languages | ||
|
|
||
| ```bash | ||
| apic build clients | ||
| ``` | ||
|
|
||
| ### Build playground for specific language | ||
|
|
||
| ```bash | ||
| apic build playground javascript recommend | ||
| ``` | ||
|
|
||
| ### Build many snippets for specific language | ||
|
|
||
| ```bash | ||
| apic build snippets java insights recommend search | ||
| ``` |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,9 @@ title: Setup repository | |
|
|
||
| :::info | ||
|
|
||
| Make sure to have Docker installed so you don't have to install the tooling for every API clients. [Installation guide](https://docs.docker.com/desktop/mac/install/) | ||
| Make sure to have: | ||
| - [Docker installed so you don't have to install the tooling for every API clients](https://docs.docker.com/desktop/mac/install/) | ||
| - [jq because it's nice](https://jqlang.github.io/jq/download/) | ||
|
|
||
| ::: | ||
|
|
||
|
|
@@ -18,28 +20,19 @@ nvm use && yarn | |
|
|
||
| ## Mounting the docker images | ||
|
|
||
| ```bash | ||
| yarn docker:setup | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| #### Build | ||
|
|
||
| We use 1 docker image per language to simplify the build, and reuse them on the CI. | ||
| There is one base image containing node, java, scala and kotlin, located in [scripts/docker/Dockerfile](https://github.com/algolia/api-clients-automation/blob/main/scripts/docker/Dockerfile) | ||
| We use multiple docker images to simplify the build. There is [one base image](https://github.com/algolia/api-clients-automation/blob/main/scripts/docker/Dockerfile.base) that contains everything except [swift](https://github.com/algolia/api-clients-automation/blob/main/scripts/docker/Dockerfile.swift) and [ruby](https://github.com/algolia/api-clients-automation/blob/main/scripts/docker/Dockerfile.ruby), they have their own Dockerfile | ||
|
|
||
| ```bash | ||
| yarn docker:setup | ||
| ``` | ||
|
|
||
| :::caution | ||
| ## Tooling | ||
|
|
||
| The swift images takes a really long time to build (~5 minutes) because of swift-format, but it's only needed when you want to format swift. | ||
| :::info | ||
|
|
||
| ::: | ||
| This step is optional, using `yarn cli ...` should work perfectly as well. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup but a bit intrusive so... that's fine I guess
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ## Tooling | ||
| ::: | ||
|
|
||
| Install the CLI tool by following the instructions at the top of [scripts/install.sh](https://github.com/algolia/api-clients-automation/blob/main/scripts/install.sh) to acces `apic` from your terminal, with bash autocompletion. | ||
| You can run `apic help` to check if it's working properly. | ||
|
|
@@ -58,10 +51,10 @@ Once you've successfully built and mounted the Docker image, you can now play wi | |
|
|
||
| - [How to add a new client](/docs/add-new-api-client) | ||
| - [How to add a new language](/docs/add-new-language) | ||
| - [Use CLI specs commands](/docs/CLI/specs-commands) | ||
| - [Use CLI clients commands](/docs/CLI/clients-commands) | ||
| - [Use CLI specs commands](/docs/CLI/build-commands) | ||
| - [Use CLI clients commands](/docs/CLI/generate-commands) | ||
| - [Use CLI release commands](/docs/CLI/release-commands) | ||
| - [Use CLI Common Test Suite commands](/docs/CLI/specs-commands) | ||
| - [Use CLI Common Test Suite commands](/docs/CLI/build-commands) | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️