Skip to content

Commit 1aafc8e

Browse files
authored
feat: client config for documenting installation instructions (readmeio#207)
1 parent 3d25fef commit 1aafc8e

11 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/helpers/__snapshots__/utils.test.ts.snap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ exports[`availableTargets > returns all available targets 1`] = `
4444
{
4545
"description": "Simple REST and HTTP API Client for .NET",
4646
"extname": ".cs",
47+
"installation": "dotnet add package RestSharp",
4748
"key": "restsharp",
4849
"link": "http://restsharp.org/",
4950
"title": "RestSharp",
@@ -129,6 +130,7 @@ exports[`availableTargets > returns all available targets 1`] = `
129130
{
130131
"description": "Promise based HTTP client for the browser and node.js",
131132
"extname": ".js",
133+
"installation": "npm install axios --save",
132134
"key": "axios",
133135
"link": "https://github.com/axios/axios",
134136
"title": "Axios",
@@ -193,6 +195,7 @@ exports[`availableTargets > returns all available targets 1`] = `
193195
{
194196
"description": "Simplified HTTP request client",
195197
"extname": ".cjs",
198+
"installation": "npm install request --save",
196199
"key": "request",
197200
"link": "https://github.com/request/request",
198201
"title": "Request",
@@ -207,13 +210,15 @@ exports[`availableTargets > returns all available targets 1`] = `
207210
{
208211
"description": "Promise based HTTP client for the browser and node.js",
209212
"extname": ".cjs",
213+
"install": "npm install axios --save",
210214
"key": "axios",
211215
"link": "https://github.com/axios/axios",
212216
"title": "Axios",
213217
},
214218
{
215219
"description": "Simplified HTTP node-fetch client",
216220
"extname": ".cjs",
221+
"installation": "npm install node-fetch@2 --save",
217222
"key": "fetch",
218223
"link": "https://github.com/bitinn/node-fetch",
219224
"title": "Fetch",
@@ -242,6 +247,7 @@ exports[`availableTargets > returns all available targets 1`] = `
242247
{
243248
"description": "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",
244249
"extname": ".ml",
250+
"installation": "opam install cohttp-lwt-unix cohttp-async",
245251
"key": "cohttp",
246252
"link": "https://github.com/mirage/ocaml-cohttp",
247253
"title": "CoHTTP",
@@ -264,6 +270,7 @@ exports[`availableTargets > returns all available targets 1`] = `
264270
{
265271
"description": "PHP with Guzzle",
266272
"extname": ".php",
273+
"installation": "composer require guzzlehttp/guzzle",
267274
"key": "guzzle",
268275
"link": "http://docs.guzzlephp.org/en/stable/",
269276
"title": "Guzzle",
@@ -314,6 +321,7 @@ exports[`availableTargets > returns all available targets 1`] = `
314321
{
315322
"description": "Requests HTTP library",
316323
"extname": ".py",
324+
"installation": "python -m pip install requests",
317325
"key": "requests",
318326
"link": "http://docs.python-requests.org/en/latest/api/#requests.request",
319327
"title": "Requests",
@@ -364,6 +372,7 @@ exports[`availableTargets > returns all available targets 1`] = `
364372
{
365373
"description": "a CLI, cURL-like tool for humans",
366374
"extname": ".sh",
375+
"installation": "brew install httpie",
367376
"key": "httpie",
368377
"link": "http://httpie.org/",
369378
"title": "HTTPie",

src/targets/csharp/restsharp/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const restsharp: Client = {
1414
link: 'http://restsharp.org/',
1515
description: 'Simple REST and HTTP API Client for .NET',
1616
extname: '.cs',
17+
installation: 'dotnet add package RestSharp',
1718
},
1819
convert: ({ method, fullUrl, headersObj, cookies, postData, uriObj }) => {
1920
const { push, join } = new CodeBuilder();

src/targets/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export type ClientId = string;
2929
export interface ClientInfo {
3030
description: string;
3131
extname: Extension;
32+
installation?: string;
3233
key: ClientId;
3334
link: string;
3435
title: string;

src/targets/javascript/axios/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const axios: Client = {
2020
link: 'https://github.com/axios/axios',
2121
description: 'Promise based HTTP client for the browser and node.js',
2222
extname: '.js',
23+
installation: 'npm install axios --save',
2324
},
2425
convert: ({ allHeaders, method, url, queryObj, postData }, options) => {
2526
const opts = {

src/targets/node/axios/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const axios: Client = {
2020
link: 'https://github.com/axios/axios',
2121
description: 'Promise based HTTP client for the browser and node.js',
2222
extname: '.cjs',
23+
install: 'npm install axios --save',
2324
},
2425
convert: ({ method, fullUrl, allHeaders, postData }, options) => {
2526
const opts = {

src/targets/node/fetch/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const fetch: Client = {
2121
link: 'https://github.com/bitinn/node-fetch',
2222
description: 'Simplified HTTP node-fetch client',
2323
extname: '.cjs',
24+
installation: 'npm install node-fetch@2 --save',
2425
},
2526
convert: ({ method, fullUrl, postData, headersObj, cookies }, options) => {
2627
const opts = {

src/targets/node/request/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const request: Client = {
2020
link: 'https://github.com/request/request',
2121
description: 'Simplified HTTP request client',
2222
extname: '.cjs',
23+
installation: 'npm install request --save',
2324
},
2425
convert: ({ method, url, fullUrl, postData, headersObj, cookies }, options) => {
2526
const opts = {

src/targets/ocaml/cohttp/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const cohttp: Client = {
1919
link: 'https://github.com/mirage/ocaml-cohttp',
2020
description: 'Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml',
2121
extname: '.ml',
22+
installation: 'opam install cohttp-lwt-unix cohttp-async',
2223
},
2324
convert: ({ fullUrl, allHeaders, postData, method }, options) => {
2425
const opts = {

src/targets/php/guzzle/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const guzzle: Client<GuzzleOptions> = {
2828
link: 'http://docs.guzzlephp.org/en/stable/',
2929
description: 'PHP with Guzzle',
3030
extname: '.php',
31+
installation: 'composer require guzzlehttp/guzzle',
3132
},
3233
convert: ({ postData, fullUrl, method, cookies, headersObj }, options) => {
3334
const opts = {

src/targets/python/requests/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const requests: Client<RequestsOptions> = {
2727
link: 'http://docs.python-requests.org/en/latest/api/#requests.request',
2828
description: 'Requests HTTP library',
2929
extname: '.py',
30+
installation: 'python -m pip install requests',
3031
},
3132
convert: ({ fullUrl, postData, allHeaders, method }, options) => {
3233
const opts = {

0 commit comments

Comments
 (0)