Skip to content

Commit

Permalink
feat: client config for documenting installation instructions (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion authored Oct 25, 2023
1 parent 3d25fef commit 1aafc8e
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/helpers/__snapshots__/utils.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "Simple REST and HTTP API Client for .NET",
"extname": ".cs",
"installation": "dotnet add package RestSharp",
"key": "restsharp",
"link": "http://restsharp.org/",
"title": "RestSharp",
Expand Down Expand Up @@ -129,6 +130,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "Promise based HTTP client for the browser and node.js",
"extname": ".js",
"installation": "npm install axios --save",
"key": "axios",
"link": "https://github.com/axios/axios",
"title": "Axios",
Expand Down Expand Up @@ -193,6 +195,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "Simplified HTTP request client",
"extname": ".cjs",
"installation": "npm install request --save",
"key": "request",
"link": "https://github.com/request/request",
"title": "Request",
Expand All @@ -207,13 +210,15 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "Promise based HTTP client for the browser and node.js",
"extname": ".cjs",
"install": "npm install axios --save",
"key": "axios",
"link": "https://github.com/axios/axios",
"title": "Axios",
},
{
"description": "Simplified HTTP node-fetch client",
"extname": ".cjs",
"installation": "npm install node-fetch@2 --save",
"key": "fetch",
"link": "https://github.com/bitinn/node-fetch",
"title": "Fetch",
Expand Down Expand Up @@ -242,6 +247,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",
"extname": ".ml",
"installation": "opam install cohttp-lwt-unix cohttp-async",
"key": "cohttp",
"link": "https://github.com/mirage/ocaml-cohttp",
"title": "CoHTTP",
Expand All @@ -264,6 +270,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "PHP with Guzzle",
"extname": ".php",
"installation": "composer require guzzlehttp/guzzle",
"key": "guzzle",
"link": "http://docs.guzzlephp.org/en/stable/",
"title": "Guzzle",
Expand Down Expand Up @@ -314,6 +321,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "Requests HTTP library",
"extname": ".py",
"installation": "python -m pip install requests",
"key": "requests",
"link": "http://docs.python-requests.org/en/latest/api/#requests.request",
"title": "Requests",
Expand Down Expand Up @@ -364,6 +372,7 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"description": "a CLI, cURL-like tool for humans",
"extname": ".sh",
"installation": "brew install httpie",
"key": "httpie",
"link": "http://httpie.org/",
"title": "HTTPie",
Expand Down
1 change: 1 addition & 0 deletions src/targets/csharp/restsharp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const restsharp: Client = {
link: 'http://restsharp.org/',
description: 'Simple REST and HTTP API Client for .NET',
extname: '.cs',
installation: 'dotnet add package RestSharp',
},
convert: ({ method, fullUrl, headersObj, cookies, postData, uriObj }) => {
const { push, join } = new CodeBuilder();
Expand Down
1 change: 1 addition & 0 deletions src/targets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type ClientId = string;
export interface ClientInfo {
description: string;
extname: Extension;
installation?: string;
key: ClientId;
link: string;
title: string;
Expand Down
1 change: 1 addition & 0 deletions src/targets/javascript/axios/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const axios: Client = {
link: 'https://github.com/axios/axios',
description: 'Promise based HTTP client for the browser and node.js',
extname: '.js',
installation: 'npm install axios --save',
},
convert: ({ allHeaders, method, url, queryObj, postData }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/node/axios/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const axios: Client = {
link: 'https://github.com/axios/axios',
description: 'Promise based HTTP client for the browser and node.js',
extname: '.cjs',
install: 'npm install axios --save',
},
convert: ({ method, fullUrl, allHeaders, postData }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/node/fetch/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const fetch: Client = {
link: 'https://github.com/bitinn/node-fetch',
description: 'Simplified HTTP node-fetch client',
extname: '.cjs',
installation: 'npm install node-fetch@2 --save',
},
convert: ({ method, fullUrl, postData, headersObj, cookies }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/node/request/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const request: Client = {
link: 'https://github.com/request/request',
description: 'Simplified HTTP request client',
extname: '.cjs',
installation: 'npm install request --save',
},
convert: ({ method, url, fullUrl, postData, headersObj, cookies }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/ocaml/cohttp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const cohttp: Client = {
link: 'https://github.com/mirage/ocaml-cohttp',
description: 'Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml',
extname: '.ml',
installation: 'opam install cohttp-lwt-unix cohttp-async',
},
convert: ({ fullUrl, allHeaders, postData, method }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/php/guzzle/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const guzzle: Client<GuzzleOptions> = {
link: 'http://docs.guzzlephp.org/en/stable/',
description: 'PHP with Guzzle',
extname: '.php',
installation: 'composer require guzzlehttp/guzzle',
},
convert: ({ postData, fullUrl, method, cookies, headersObj }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/python/requests/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const requests: Client<RequestsOptions> = {
link: 'http://docs.python-requests.org/en/latest/api/#requests.request',
description: 'Requests HTTP library',
extname: '.py',
installation: 'python -m pip install requests',
},
convert: ({ fullUrl, postData, allHeaders, method }, options) => {
const opts = {
Expand Down
1 change: 1 addition & 0 deletions src/targets/shell/httpie/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const httpie: Client<HttpieOptions> = {
link: 'http://httpie.org/',
description: 'a CLI, cURL-like tool for humans',
extname: '.sh',
installation: 'brew install httpie',
},
convert: ({ allHeaders, postData, queryObj, fullUrl, method, url }, options) => {
const opts = {
Expand Down

0 comments on commit 1aafc8e

Please sign in to comment.