[
  {
    "path": ".changeset/README.md",
    "content": "# Changesets\n\nHello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works\nwith multi-package repos, or single-package repos to help you version and publish your code. You can\nfind the full documentation for it [in our repository](https://github.com/changesets/changesets)\n\nWe have a quick list of common questions to get you started engaging with this project in\n[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)\n"
  },
  {
    "path": ".changeset/config.json",
    "content": "{\n  \"$schema\": \"https://unpkg.com/@changesets/config@2.1.1/schema.json\",\n  \"changelog\": \"@changesets/cli/changelog\",\n  \"commit\": false,\n  \"fixed\": [],\n  \"linked\": [],\n  \"access\": \"public\",\n  \"baseBranch\": \"main\",\n  \"updateInternalDependencies\": \"patch\",\n  \"ignore\": []\n}\n"
  },
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  extends: [require.resolve('@vercel/style-guide/eslint/node')],\n  overrides: [\n    {\n      files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],\n      extends: [require.resolve('@vercel/style-guide/eslint/jest')],\n      rules: {\n        'jest/no-disabled-tests': 'off',\n        'jest/expect-expect': 'off',\n        'jest/no-conditional-expect': 'off',\n      },\n    },\n  ],\n  rules: {\n    /* These rules are temporarily disabled.\n       The TypeScript rewrite will resolve all outstanding issues. */\n    'no-multi-assign': 'off',\n    'no-param-reassign': 'off',\n    'no-bitwise': 'off',\n    camelcase: 'off',\n    'func-names': 'off',\n    eqeqeq: 'off',\n  },\n};\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  push:\n    branches: ['main']\n  pull_request:\n    type: [opened, synchronize]\n\njobs:\n  test:\n    name: Test Node.js ${{ matrix.node-version }} on ${{ matrix.os }}\n\n    strategy:\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n        node-version: [12.x, 14.x, 16.x]\n\n    runs-on: ${{ matrix.os }}\n\n    steps:\n      - uses: actions/checkout@v2\n      - uses: pnpm/action-setup@v2.2.2\n        with:\n          version: 6.34.0\n      - uses: actions/setup-node@v2\n        with:\n          node-version: ${{ matrix.node-version }}\n          cache: 'pnpm'\n      - name: Install Dependencies\n        run: pnpm install\n      - name: Run Linter\n        run: pnpm lint\n      - name: Run Tests\n        run: pnpm test\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non:\n  push:\n    branches:\n      - main\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n\njobs:\n  release:\n    name: Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      - name: Setup pnpm\n        uses: pnpm/action-setup@v2.2.2\n        with:\n          version: 6.34.0\n\n      - name: Setup Node\n        uses: actions/setup-node@v2\n        with:\n          node-version: 16\n          cache: 'pnpm'\n\n      - name: Install Dependencies\n        run: pnpm install\n\n      - name: Create Release PR or Publish Packages\n        uses: changesets/action@v1\n        with:\n          publish: pnpm release\n          version: pnpm version-packages\n          commit: 'chore: update package versions'\n          title: 'chore: update package versions'\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n.pnp\n.pnp.js\n\n# testing\ncoverage\n\n# next.js\n.next/\nout/\nbuild\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n.pnpm-debug.log*\n\n# local env files\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\n# turbo\n.turbo"
  },
  {
    "path": ".husky/pre-commit",
    "content": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\npnpm pretty-quick --staged\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "## Code of Conduct\n\n### Our Pledge\n\nWe as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.\n\nWe pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.\n\n### Our Standards\n\nExamples of behavior that contributes to a positive environment for our community include:\n\n- Demonstrating empathy and kindness toward other people\n- Being respectful of differing opinions, viewpoints, and experiences\n- Giving and gracefully accepting constructive feedback\n- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience\n- Focusing on what is best not just for us as individuals, but for the overall community\n\nExamples of unacceptable behavior include:\n\n- The use of sexualized language or imagery, and sexual attention or advances of any kind\n- Trolling, insulting or derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others’ private information, such as a physical or email address, without their explicit permission\n- Other conduct which could reasonably be considered inappropriate in a professional setting\n\n### Enforcement Responsibilities\n\nProject maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.\n\n### Scope\n\nThis Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.\n\n### Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team responsible for enforcement at [coc@vercel.com](mailto:coc@vercel.com). All complaints will be reviewed and investigated promptly and fairly.\n\nAll project maintainers are obligated to respect the privacy and security of the reporter of any incident.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n### Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,\navailable at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: https://www.contributor-covenant.org/version/2/1\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nRead about our [Commitment to Open Source](https://vercel.com/oss).\n\nBefore jumping into a PR be sure to search [existing PRs](https://github.com/vercel/fetch/pulls) or [issues](https://github.com/vercel/fetch/issues) for an open or closed item that relates to your submission.\n\n## Developing\n\nThe development branch is `main`. This is the branch that all pull\nrequests should be made against.\n\nTo develop locally:\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your\n   own GitHub account and then\n   [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device.\n2. Create a new branch:\n   ```\n   git checkout -b MY_BRANCH_NAME\n   ```\n3. Install pnpm:\n   ```\n   npm install -g pnpm\n   ```\n4. Install the dependencies with:\n   ```\n   pnpm i\n   ```\n5. Make changes and run tests using:\n   ```\n   pnpm test\n   ```\n\n> This repo is powered by [Turborepo](https://turborepo.org/). Running commands such as `test`, `build`, and `lint` from the project root will utilize caching techniques to maximize developer productivity.\n\n## Testing\n\nEach package has its own approach to testing. They can be executed independantly or as a group using `turbo`.\n\nThe easiest way to run the complete test suite is to run `pnpm test` from the root of this repository.\n\n## Linting\n\n> 🏗 Coming Soon!\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"private\": true,\n  \"workspaces\": [\n    \"packages/fetch\",\n    \"packages/fetch-cached-dns\",\n    \"packages/fetch-retry\"\n  ],\n  \"scripts\": {\n    \"lint\": \"turbo run lint\",\n    \"test\": \"turbo run test\",\n    \"prettier\": \"prettier -w .\",\n    \"prepare\": \"husky install\",\n    \"eslint\": \"cross-env TIMING=1 eslint --max-warnings 0 --config .eslintrc.js\",\n    \"changeset\": \"changeset\",\n    \"release\": \"changeset publish\",\n    \"version-packages\": \"changeset version\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.17.10\",\n    \"@changesets/cli\": \"^2.24.4\",\n    \"@vercel/style-guide\": \"^3.0.0\",\n    \"cross-env\": \"^7.0.3\",\n    \"eslint\": \"^8.12.0\",\n    \"husky\": \"^7.0.4\",\n    \"prettier\": \"^2.6.1\",\n    \"pretty-quick\": \"^3.1.3\",\n    \"turbo\": \"^1.2.6\",\n    \"typescript\": \"^4.6.4\"\n  },\n  \"engines\": {\n    \"node\": \">=12.0.0\"\n  },\n  \"packageManager\": \"pnpm@6.34.0\",\n  \"prettier\": \"@vercel/style-guide/prettier\"\n}\n"
  },
  {
    "path": "packages/fetch/CHANGELOG.md",
    "content": "# @vercel/fetch\n\n## 7.0.0\n\n### Major Changes\n\n- 714c01e: Fix how default agent options are applied\n"
  },
  {
    "path": "packages/fetch/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017, 2018 ZEIT, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/fetch/index.d.ts",
    "content": "import * as http from 'http';\nimport * as https from 'http';\nimport { Options as BaseRetryOptions } from 'async-retry';\nimport { Headers, Request, RequestInit, Response } from 'node-fetch';\n\nexport interface RetryOptions extends BaseRetryOptions {\n  maxRetryAfter?: number;\n}\n\nexport type FetchOptions = RequestInit & {\n  agent?: https.Agent | http.Agent;\n  retry?: RetryOptions;\n};\n\nexport type Fetch = (\n  url: string | Request,\n  options?: FetchOptions,\n) => Promise<Response>;\n\nexport type FetchModule = {\n  default: Fetch;\n  Headers: typeof Headers;\n};\n\nexport default function SetupFetch(\n  fetchModule?: FetchModule,\n  agentOptions?: http.AgentOptions | https.AgentOptions,\n): Fetch;\n\nexport * from 'node-fetch';\n"
  },
  {
    "path": "packages/fetch/index.js",
    "content": "const { URLSearchParams, parse: parseUrl } = require('url');\nconst HttpAgent = require('agentkeepalive');\nconst debug = require('debug')('@vercel/fetch');\nconst setupFetchRetry = require('@vercel/fetch-retry');\nconst setupFetchCachedDns = require('@vercel/fetch-cached-dns');\n\nconst AGENT_OPTIONS = {\n  maxSockets: 200,\n  maxFreeSockets: 20,\n  timeout: 60000,\n  freeSocketTimeout: 30000,\n  freeSocketKeepAliveTimeout: 30000, // free socket keepalive for 30 seconds\n};\n\nlet defaultHttpGlobalAgent;\nlet defaultHttpsGlobalAgent;\n\nfunction getDefaultHttpGlobalAgent(agentOpts) {\n  return (defaultHttpGlobalAgent =\n    defaultHttpGlobalAgent ||\n    (debug('init http agent'), new HttpAgent(agentOpts)));\n}\n\nfunction getDefaultHttpsGlobalAgent(agentOpts) {\n  return (defaultHttpsGlobalAgent =\n    defaultHttpsGlobalAgent ||\n    (debug('init https agent'), new HttpAgent.HttpsAgent(agentOpts)));\n}\n\nfunction getAgent(url, agentOpts) {\n  return /^https/.test(url)\n    ? getDefaultHttpsGlobalAgent(agentOpts)\n    : getDefaultHttpGlobalAgent(agentOpts);\n}\n\nfunction setupVercelFetch(fetch, agentOpts = {}) {\n  return async function vercelFetch(url, opts = {}) {\n    if (!opts.agent) {\n      // Add default `agent` if none was provided\n      opts.agent = getAgent(url, { ...AGENT_OPTIONS, ...agentOpts });\n    }\n\n    opts.redirect = 'manual';\n    opts.headers = new fetch.Headers(opts.headers);\n    // Workaround for node-fetch + agentkeepalive bug/issue\n    opts.headers.set('host', opts.headers.get('host') || parseUrl(url).host);\n\n    // Convert Object bodies to JSON if they are JS objects\n    if (\n      opts.body &&\n      !(opts.body instanceof URLSearchParams) &&\n      typeof opts.body === 'object' &&\n      !Buffer.isBuffer(opts.body)\n    ) {\n      opts.body = JSON.stringify(opts.body);\n      opts.headers.set('Content-Type', 'application/json');\n      opts.headers.set('Content-Length', Buffer.byteLength(opts.body));\n    }\n\n    // Check the agent on redirections\n    opts.onRedirect = (res, redirectOpts) => {\n      redirectOpts.agent = getAgent(res.headers.get('Location'));\n    };\n\n    try {\n      debug('%s %s', opts.method || 'GET', url);\n      return await fetch(url, opts);\n    } catch (err) {\n      err.url = url;\n      err.opts = opts;\n      throw err;\n    }\n  };\n}\n\nfunction setup(fetch, options) {\n  if (!fetch) {\n    fetch = require('node-fetch');\n  }\n\n  const fd = fetch.default;\n  if (fd) {\n    // combines \"fetch.Headers\" with \"fetch.default\" function.\n    // workaround for \"fetch.Headers is not a constructor\"\n    fetch = Object.assign((...args) => fd(...args), fd, fetch);\n  }\n\n  if (typeof fetch !== 'function') {\n    throw new Error(\n      \"fetch() argument isn't a function; did you forget to initialize your `@vercel/fetch` import?\",\n    );\n  }\n\n  fetch = setupFetchCachedDns(fetch);\n  fetch = setupFetchRetry(fetch);\n  fetch = setupVercelFetch(fetch, options);\n  return fetch;\n}\n\nmodule.exports = setup;\n"
  },
  {
    "path": "packages/fetch/package.json",
    "content": "{\n  \"name\": \"@vercel/fetch\",\n  \"version\": \"7.0.0\",\n  \"description\": \"Opinionated `fetch` optimized for use inside microservices\",\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\"\n  ],\n  \"scripts\": {\n    \"test\": \"best --verbose\",\n    \"lint\": \"cd ../.. && pnpm eslint packages/fetch/**/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/vercel/fetch.git\",\n    \"directory\": \"packages/fetch\"\n  },\n  \"contributors\": [\n    \"Nathan Rajlich <nate@vercel.com>\",\n    \"Ethan Arrowood <ethan.arrowood@vercel.com>\"\n  ],\n  \"dependencies\": {\n    \"@types/async-retry\": \"^1.4.3\",\n    \"@vercel/fetch-cached-dns\": \"^2.0.2\",\n    \"@vercel/fetch-retry\": \"^5.0.3\",\n    \"agentkeepalive\": \"^4.2.1\",\n    \"debug\": \"^4.3.3\"\n  },\n  \"peerDependencies\": {\n    \"@types/node-fetch\": \"^2.6.1\",\n    \"node-fetch\": \"^2.6.7\"\n  },\n  \"devDependencies\": {\n    \"@zeit/best\": \"0.7.3\",\n    \"async-listen\": \"^1.2.0\",\n    \"node-fetch\": \"^2.6.7\",\n    \"raw-body\": \"^2.5.0\"\n  }\n}\n"
  },
  {
    "path": "packages/fetch/readme.md",
    "content": "# @vercel/fetch\n\n[![Build Status](https://github.com/vercel/fetch/workflows/CI/badge.svg)](https://github.com/vercel/fetch/actions?workflow=CI)\n\nOpinionated `fetch` optimized for use inside microservices. Bundles:\n\n- https://github.com/vercel/fetch/tree/main/packages/fetch-retry\n- https://github.com/vercel/fetch/tree/main/packages/fetch-cached-dns\n- https://github.com/node-modules/agentkeepalive\n\nIt automatically configures an `agent` via [agentkeepalive](https://github.com/node-modules/agentkeepalive),\nif not provided, with the following settings:\n\n| Name                         | Value |\n| ---------------------------- | ----- |\n| `maxSockets`                 | 200   |\n| `maxFreeSockets`             | 20    |\n| `timeout`                    | 60000 |\n| `freeSocketKeepAliveTimeout` | 30000 |\n\n## How to use\n\nJavaScript\n\n```js\nconst fetch = require('@vercel/fetch')(require('some-fetch-implementation'));\n```\n\nTypeScript\n\n```typescript\nimport createFetch from '@vercel/fetch';\nimport * as fetch from 'some-fetch-implementation';\nconst fetch = createFetch(fetch);\n```\n\nIf no fetch implementation is supplied, it will attempt to use peerDep `node-fetch`.\n"
  },
  {
    "path": "packages/fetch/test/index.js",
    "content": "const assert = require('assert');\nconst { createServer } = require('http');\nconst url = require('url');\nconst toBuffer = require('raw-body');\nconst listen = require('async-listen').default;\nconst fetch = require('../index')();\n\nexports.retriesUponHttp500 = async () => {\n  let i = 0;\n  const server = createServer((req, res) => {\n    if (i++ < 2) {\n      res.writeHead(500);\n      res.end();\n    } else {\n      res.end('ha');\n    }\n  });\n  await listen(server);\n  const { port } = server.address();\n\n  const res = await fetch(`http://127.0.0.1:${port}`);\n  const resBody = await res.text();\n  server.close();\n  assert.equal(resBody, 'ha');\n};\n\nexports.worksWithHttps = async () => {\n  const res = await fetch('https://vercel.com');\n  assert.equal(res.headers.get('Server'), 'Vercel');\n};\n\n/**\n * We know that http://zeit.co redirects to https so we can use it\n * as a test to make sure that we switch the agent when the it\n * happens\n */\nexports.switchesAgentsOnRedirect = async () => {\n  const res = await fetch('http://vercel.com');\n  assert.equal(res.url, 'https://vercel.com/');\n};\n\nexports.supportsBufferRequestBody = async () => {\n  const server = createServer(async (req, res) => {\n    const body = await toBuffer(req);\n    assert(Buffer.isBuffer(body));\n    assert.equal(body.toString(), 'foo');\n    res.end(JSON.stringify({ body: body.toString() }));\n  });\n  await listen(server);\n  const { port } = server.address();\n\n  const res = await fetch(`http://127.0.0.1:${port}`, {\n    method: 'POST',\n    body: Buffer.from('foo'),\n  });\n  const body = await res.json();\n  server.close();\n  assert.deepEqual(body, { body: 'foo' });\n};\n\nexports.supportsObjectRequestBody = async () => {\n  const server = createServer(async (req, res) => {\n    const body = await toBuffer(req);\n    assert(Buffer.isBuffer(body));\n    assert.deepEqual(JSON.parse(body.toString()), { foo: 'bar' });\n    assert.equal(req.headers['content-type'], 'application/json');\n    res.end();\n  });\n  await listen(server);\n  const { port } = server.address();\n\n  const res = await fetch(`http://127.0.0.1:${port}`, {\n    method: 'POST',\n    body: { foo: 'bar' },\n  });\n  await res.text();\n  server.close();\n};\n\nexports.supportsSearchParamsRequestBody = async () => {\n  const server = createServer(async (req, res) => {\n    const body = await toBuffer(req);\n    assert(Buffer.isBuffer(body));\n    assert.equal(body.toString(), 'foo=bar');\n    assert.equal(\n      req.headers['content-type'],\n      'application/x-www-form-urlencoded;charset=UTF-8',\n    );\n    res.end();\n  });\n  await listen(server);\n  const { port } = server.address();\n\n  const res = await fetch(`http://127.0.0.1:${port}`, {\n    method: 'POST',\n    body: new url.URLSearchParams({ foo: 'bar' }),\n  });\n  await res.text();\n  server.close();\n};\n\n// Similar to the other unescaped character test in fetch-retry, this is no\n// longer an error case as node-fetch has switched to using URL instead of\n// url.parse in its latest versions. This is only an assumption from a quick\n// investigation into the change history of node-fetch. We should keep this\n// code here until a more thorough investigation can be done to make sure it\n// cannot still occur in another way.\n//\n// exports.errorContext = async () => {\n// \tlet err;\n// \tconst u = `http://127.0.0.1/\\u0019`;\n// \ttry {\n// \t\tawait fetch(u);\n// \t} catch (_err) {\n// \t\terr = _err;\n// \t}\n// \tassert(err);\n// \tassert.equal(err.message, 'Request path contains unescaped characters');\n// \tassert.equal(err.url, u);\n// \tassert.equal(err.opts.redirect, 'manual');\n// };\n"
  },
  {
    "path": "packages/fetch-cached-dns/CHANGELOG.md",
    "content": "# @vercel/fetch-cached-dns\n\n## 2.1.2\n\n### Patch Changes\n\n- 98cba6d: Fix typings\n"
  },
  {
    "path": "packages/fetch-cached-dns/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022 Vercel, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/fetch-cached-dns/README.md",
    "content": "# @vercel/fetch-cached-dns\n\n[![Build Status](https://github.com/vercel/fetch/workflows/CI/badge.svg)](https://github.com/vercel/fetch/actions?workflow=CI)\n\nA decorator on top of `fetch` that caches the DNS query of the `hostname` of the passed URL.\n\n## How to use\n\n```js\nconst fetch = require('@vercel/fetch-cached-dns')(require('node-fetch'));\n```\n\nSince this implementation is implementing redirects we are providing an `onRedirect` extra\noption to the `fetch` call that gets called with the response object and the options that\nwill be used for the next request. This allows to access the request from outside and to\nmodify the options.\n\n_NOTE: if the fetch implementation is not supplied, it will attempt to use peerDep `node-fetch`_\n"
  },
  {
    "path": "packages/fetch-cached-dns/index.d.ts",
    "content": "import NodeFetch, { Request, RequestInit, Response } from 'node-fetch';\n\nexport default function createFetch(fetch?: typeof NodeFetch): (\n  url: string | Request,\n  init?: RequestInit,\n) => Promise<Response>;\n"
  },
  {
    "path": "packages/fetch-cached-dns/index.js",
    "content": "const { isIP } = require('net');\nconst { format, parse } = require('url');\nconst resolve = require('@zeit/dns-cached-resolve').default;\nconst { dnsCachedUrl } = require('./util');\n\nmodule.exports = setup;\n\nconst isRedirect = (v) => ((v / 100) | 0) === 3;\n\nfunction setup(fetch) {\n  if (!fetch) {\n    fetch = require('node-fetch');\n  }\n  const { Headers } = fetch;\n\n  async function fetchCachedDns(url, opts) {\n    const parsed = parse(url);\n    const originalHost = parsed.host;\n    const ip = isIP(parsed.hostname);\n    if (ip === 0) {\n      if (!opts) opts = {};\n      opts.headers = new Headers(opts.headers);\n      if (!opts.headers.has('Host')) {\n        opts.headers.set('Host', parsed.host);\n      }\n      opts.redirect = 'manual';\n      parsed.host = await resolve(parsed.hostname);\n      if (parsed.port) {\n        parsed.host += `:${parsed.port}`;\n      }\n      url = format(parsed);\n    }\n    const res = await fetch(url, opts);\n\n    // Update `res.url` to contain the original hostname instead of the IP address\n    res[dnsCachedUrl] = url;\n    Object.defineProperty(res, 'url', {\n      get() {\n        return parsed.href;\n      },\n    });\n\n    if (isRedirect(res.status)) {\n      const redirectOpts = { ...opts };\n      redirectOpts.headers = new Headers(opts.headers);\n\n      // Per fetch spec, for POST request with 301/302 response, or any\n      // request with 303 response, use GET when following redirect\n      if (\n        res.status === 303 ||\n        ((res.status === 301 || res.status === 302) && opts.method === 'POST')\n      ) {\n        redirectOpts.method = 'GET';\n        redirectOpts.body = null;\n        redirectOpts.headers.delete('content-length');\n      }\n\n      // Set the proper `Host` request header, considering that node-fetch will\n      // absolutize a relative redirect URL, so the IP address needs to be\n      // replaced with the original hostname as well.\n      const location = res.headers.get('Location');\n      const parsedLocation = parse(location);\n      if (parsedLocation.host === parsed.host) {\n        parsedLocation.host = originalHost;\n      }\n      redirectOpts.headers.set('Host', parsedLocation.host);\n\n      if (opts.onRedirect) {\n        opts.onRedirect(res, redirectOpts);\n      }\n\n      return fetchCachedDns(format(parsedLocation), redirectOpts);\n    }\n    return res;\n  }\n\n  for (const key of Object.keys(fetch)) {\n    fetchCachedDns[key] = fetch[key];\n  }\n\n  fetchCachedDns.default = fetchCachedDns;\n\n  return fetchCachedDns;\n}\n"
  },
  {
    "path": "packages/fetch-cached-dns/package.json",
    "content": "{\n  \"name\": \"@vercel/fetch-cached-dns\",\n  \"version\": \"2.1.2\",\n  \"description\": \"A decorator on top of `fetch` that caches the DNS query of the `hostname` of the passed URL\",\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"util.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"jest test\",\n    \"lint\": \"cd ../.. && pnpm eslint packages/fetch-cached-dns/**/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/vercel/fetch.git\",\n    \"directory\": \"packages/fetch-cached-dns\"\n  },\n  \"contributors\": [\n    \"Nathan Rajlich <nate@vercel.com>\",\n    \"Ethan Arrowood <ethan.arrowood@vercel.com>\"\n  ],\n  \"dependencies\": {\n    \"@types/node-fetch\": \"^2.6.1\",\n    \"@zeit/dns-cached-resolve\": \"^2.1.2\"\n  },\n  \"peerDependencies\": {\n    \"node-fetch\": \"^2.6.1\"\n  },\n  \"devDependencies\": {\n    \"async-listen\": \"^1.2.0\",\n    \"jest\": \"^27.5.1\",\n    \"node-fetch\": \"^2.6.1\"\n  }\n}\n"
  },
  {
    "path": "packages/fetch-cached-dns/test.js",
    "content": "const { createServer } = require('http');\nconst listen = require('async-listen').default;\nconst { dnsCachedUrl } = require('./util');\nconst cachedDNSFetch = require('./index')(require('node-fetch'));\n\n/**\n * Using `localtest.me` to use DNS to resolve to localhost\n * http://readme.localtest.me/\n */\n\ntest('works with localtest.me', async () => {\n  const server = createServer((req, res) => {\n    res.end(JSON.stringify({ url: req.url, headers: req.headers }));\n  });\n\n  await listen(server);\n  const { port } = server.address();\n\n  try {\n    const host = `localtest.me:${port}`;\n    const res = await cachedDNSFetch(`http://${host}`);\n    const body = await res.json();\n    expect(res.url).toBe(`http://${host}/`);\n    expect(res[dnsCachedUrl]).toBe(`http://127.0.0.1:${port}/`);\n    expect(body.url).toBe(`/`);\n    expect(body.headers.host).toBe(host);\n  } finally {\n    server.close();\n  }\n});\n\ntest('works with absolute redirects', async () => {\n  const serverA = createServer((req, res) => {\n    res.setHeader('Location', `http://localtest.me:${portB}`);\n    res.statusCode = 302;\n    res.end();\n  });\n  const serverB = createServer((req, res) => {\n    // ensure the Host header is properly re-written upon redirect\n    res.end(req.headers.host);\n  });\n\n  await listen(serverA);\n  await listen(serverB);\n  const portA = serverA.address().port;\n  const portB = serverB.address().port;\n\n  try {\n    const res = await cachedDNSFetch(`http://localtest.me:${portA}`);\n    expect(res.url).toBe(`http://localtest.me:${portB}/`);\n    expect(res[dnsCachedUrl]).toBe(`http://127.0.0.1:${portB}/`);\n    expect(await res.status).toBe(200);\n    expect(await res.text()).toBe(`localtest.me:${portB}`);\n  } finally {\n    serverA.close();\n    serverB.close();\n  }\n});\n\ntest('works with relative redirects', async () => {\n  let count = 0;\n  const server = createServer((req, res) => {\n    if (count++ === 0) {\n      res.setHeader('Location', `/foo`);\n      res.statusCode = 302;\n      res.end();\n    } else {\n      res.end(\n        JSON.stringify({\n          url: req.url,\n          headers: req.headers,\n        }),\n      );\n    }\n  });\n  await listen(server);\n  const { port } = server.address();\n\n  try {\n    const host = `localtest.me:${port}`;\n    const res = await cachedDNSFetch(`http://${host}`);\n    expect(count).toBe(2);\n    expect(res.url).toBe(`http://${host}/foo`);\n    expect(res[dnsCachedUrl]).toBe(`http://127.0.0.1:${port}/foo`);\n    expect(await res.status).toBe(200);\n    const body = await res.json();\n    expect(body.url).toBe(`/foo`);\n    expect(body.headers.host).toBe(host);\n  } finally {\n    server.close();\n  }\n});\n\ntest('works with `headers` as an Object', async () => {\n  const server = createServer((req, res) => {\n    res.end(req.headers['x-vercel']);\n  });\n\n  await listen(server);\n  const { port } = server.address();\n\n  try {\n    const res = await cachedDNSFetch(`http://localtest.me:${port}`, {\n      headers: {\n        'X-Vercel': 'geist',\n      },\n    });\n    expect(await res.text()).toBe('geist');\n  } finally {\n    server.close();\n  }\n});\n\ntest('works with `onRedirect` option to customize opts', async () => {\n  let count = 0;\n\n  const server = createServer((req, res) => {\n    if (count === 0) {\n      res.setHeader('Location', `/foo`);\n      res.statusCode = 302;\n      res.end();\n    } else {\n      res.end(req.url);\n    }\n    count++;\n  });\n\n  await listen(server);\n  const { port } = server.address();\n\n  try {\n    const options = {\n      onRedirect: jest.fn((res, opts) => {\n        opts.randomOption = true;\n      }),\n    };\n\n    await cachedDNSFetch(`http://localtest.me:${port}`, options);\n    expect(options.onRedirect.mock.calls.length).toBe(1);\n    const [res, opts] = options.onRedirect.mock.calls[0];\n    expect(res.status).toEqual(302);\n    expect(opts.headers).toBeDefined();\n    expect(opts.randomOption).toBe(true);\n  } finally {\n    server.close();\n  }\n});\n"
  },
  {
    "path": "packages/fetch-cached-dns/util.js",
    "content": "// Used for testing\nexports.dnsCachedUrl = Symbol('dnsCachedUrl');\n"
  },
  {
    "path": "packages/fetch-retry/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022 Vercel, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/fetch-retry/index.js",
    "content": "const retry = require('async-retry');\nconst debug = require('debug')('fetch-retry');\n\n// retry settings\nconst MIN_TIMEOUT = 10;\nconst MAX_RETRIES = 5;\nconst MAX_RETRY_AFTER = 20;\nconst FACTOR = 6;\n\nmodule.exports = exports = setup;\n\nfunction isClientError(err) {\n  if (!err) return false;\n  return (\n    err.code === 'ERR_UNESCAPED_CHARACTERS' ||\n    err.message === 'Request path contains unescaped characters'\n  );\n}\n\nfunction setup(fetch) {\n  if (!fetch) {\n    fetch = require('node-fetch');\n  }\n\n  async function fetchRetry(url, opts = {}) {\n    const retryOpts = {\n      // timeouts will be [10, 60, 360, 2160, 12960]\n      // (before randomization is added)\n      minTimeout: MIN_TIMEOUT,\n      retries: MAX_RETRIES,\n      factor: FACTOR,\n      maxRetryAfter: MAX_RETRY_AFTER,\n      ...opts.retry,\n    };\n\n    if (opts.onRetry) {\n      retryOpts.onRetry = (error) => {\n        opts.onRetry(error, opts);\n        if (opts.retry && opts.retry.onRetry) {\n          opts.retry.onRetry(error);\n        }\n      };\n    }\n\n    try {\n      return await retry(async (bail, attempt) => {\n        const { method = 'GET' } = opts;\n        try {\n          // this will be retried\n          const res = await fetch(url, opts);\n          debug('status %d', res.status);\n          if ((res.status >= 500 && res.status < 600) || res.status === 429) {\n            // NOTE: doesn't support http-date format\n            const retryAfter = parseInt(res.headers.get('retry-after'), 10);\n            if (retryAfter) {\n              if (retryAfter > retryOpts.maxRetryAfter) {\n                return res;\n              }\n              await new Promise((r) => {\n                setTimeout(r, retryAfter * 1e3);\n              });\n            }\n            throw new ResponseError(res);\n          } else {\n            return res;\n          }\n        } catch (err) {\n          if (err.type === 'aborted') {\n            return bail(err);\n          }\n          const clientError = isClientError(err);\n          const isRetry = !clientError && attempt <= retryOpts.retries;\n          debug(\n            `${method} ${url} error (status = ${err.status}). ${\n              isRetry ? 'retrying' : ''\n            }`,\n            err,\n          );\n          if (clientError) {\n            return bail(err);\n          }\n          throw err;\n        }\n      }, retryOpts);\n    } catch (err) {\n      if (err instanceof ResponseError) {\n        return err.res;\n      }\n      throw err;\n    }\n  }\n\n  for (const key of Object.keys(fetch)) {\n    fetchRetry[key] = fetch[key];\n  }\n  fetchRetry.default = fetchRetry;\n\n  return fetchRetry;\n}\n\nclass ResponseError extends Error {\n  constructor(res) {\n    super(res.statusText);\n\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, ResponseError);\n    }\n\n    this.name = this.constructor.name;\n    this.res = res;\n\n    // backward compat\n    this.code = this.status = this.statusCode = res.status;\n    this.url = res.url;\n  }\n}\n\nexports.ResponseError = ResponseError;\n"
  },
  {
    "path": "packages/fetch-retry/package.json",
    "content": "{\n  \"name\": \"@vercel/fetch-retry\",\n  \"version\": \"5.1.3\",\n  \"license\": \"MIT\",\n  \"main\": \"index.js\",\n  \"files\": [\n    \"index.js\"\n  ],\n  \"scripts\": {\n    \"test\": \"jest test\",\n    \"lint\": \"cd ../.. && pnpm eslint packages/fetch-retry/**/*.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/vercel/fetch.git\",\n    \"directory\": \"packages/fetch-retry\"\n  },\n  \"contributors\": [\n    \"Nathan Rajlich <nate@vercel.com>\",\n    \"Ethan Arrowood <ethan.arrowood@vercel.com>\"\n  ],\n  \"dependencies\": {\n    \"async-retry\": \"^1.3.3\",\n    \"debug\": \"^4.3.3\"\n  },\n  \"peerDependencies\": {\n    \"node-fetch\": \"^2.6.7\"\n  },\n  \"devDependencies\": {\n    \"abort-controller\": \"^3.0.0\",\n    \"jest\": \"^27.5.1\",\n    \"node-fetch\": \"^2.6.7\"\n  }\n}\n"
  },
  {
    "path": "packages/fetch-retry/readme.md",
    "content": "# @vercel/fetch-retry\n\n[![Build Status](https://github.com/vercel/fetch/workflows/CI/badge.svg)](https://github.com/vercel/fetch/actions?workflow=CI)\n\nA layer on top of `fetch` (via [node-fetch](https://www.npmjs.com/package/node-fetch))\nwith sensible defaults for retrying to prevent common errors.\n\n## How to use\n\n`fetch-retry` is a drop-in replacement for `fetch`:\n\n```js\nconst fetch = require('@vercel/fetch-retry')(require('node-fetch'));\n\nmodule.exports = async () => {\n  const res = await fetch('http://localhost:3000');\n  console.log(res.status);\n};\n```\n\nMake sure to `yarn add @vercel/fetch-retry` in your main package.\n\nNote that you can pass [retry options](https://github.com/vercel/async-retry) to using `opts.retry`.\nWe also provide a `opts.onRetry` and `opts.retry.maxRetryAfter` options.\n\n`opts.onRetry` is a customized version of `opts.retry.onRetry` and passes\nnot only the `error` object in each retry but also the current `opts` object.\n\n`opts.retry.maxRetryAfter` is the max wait time according to the `Retry-After` header.\nIf it exceeds the option value, stop retrying and returns the error response. It defaults to `20`.\n\n## Rationale\n\nSome errors are very common in production (like the underlying `Socket`\nyielding `ECONNRESET`), and can easily and instantly be remediated\nby retrying.\n\nThe default behavior of `fetch-retry` is to attempt retries **10**, **60**\n**360**, **2160** and **12960** milliseconds (a total of 5 retries) after\na _network error_, _429_ or _5xx_ error occur.\n\nThe idea is to provide a sensible default: most applications should\ncontinue to perform correctly with a worst case scenario of a given\nrequest having an additional 15550ms overhead.\n\nOn the other hand, most applications that use `fetch-retry` instead of\nvanilla `fetch` should see lower rates of common errors and fewer 'glitches'\nin production.\n\n## Tests\n\nTo run rests, execute\n\n```console\nnpm test\n```\n"
  },
  {
    "path": "packages/fetch-retry/test.js",
    "content": "const assert = require('assert');\nconst { createServer } = require('http');\nconst AbortController = require('abort-controller');\nconst setup = require('./index');\n\nconst { ResponseError } = setup;\nconst retryFetch = setup();\n\ntest('retries upon 500', async () => {\n  let i = 0;\n  const server = createServer((req, res) => {\n    if (i++ < 2) {\n      res.writeHead(500);\n      res.end();\n    } else {\n      res.end('ha');\n    }\n  });\n\n  return new Promise((resolve, reject) => {\n    server.listen(async () => {\n      try {\n        const { port } = server.address();\n        const res = await retryFetch(`http://127.0.0.1:${port}`);\n        expect(await res.text()).toBe('ha');\n        resolve();\n      } catch (err) {\n        reject(err);\n      } finally {\n        server.close();\n      }\n    });\n    server.on('error', reject);\n  });\n});\n\ntest('resolves on >MAX_RETRIES', async () => {\n  const server = createServer((req, res) => {\n    res.writeHead(500);\n    res.end();\n  });\n\n  return new Promise((resolve, reject) => {\n    server.listen(async () => {\n      try {\n        const { port } = server.address();\n        const res = await retryFetch(`http://127.0.0.1:${port}`, {\n          retry: {\n            retries: 3,\n          },\n        });\n        expect(res.status).toBe(500);\n        return resolve();\n      } finally {\n        server.close();\n      }\n    });\n    server.on('error', reject);\n  });\n});\n\ntest('accepts a custom onRetry option', async () => {\n  const server = createServer((req, res) => {\n    res.writeHead(500);\n    res.end();\n  });\n\n  return new Promise((resolve, reject) => {\n    const opts = {\n      onRetry: jest.fn(),\n      retry: {\n        retries: 3,\n      },\n    };\n\n    server.listen(async () => {\n      try {\n        const { port } = server.address();\n        const res = await retryFetch(`http://127.0.0.1:${port}`, opts);\n        expect(opts.onRetry.mock.calls.length).toBe(3);\n        expect(opts.onRetry.mock.calls[0][0]).toBeInstanceOf(ResponseError);\n        expect(opts.onRetry.mock.calls[0][1]).toEqual(opts);\n        expect(res.status).toBe(500);\n        return resolve();\n      } finally {\n        server.close();\n      }\n    });\n    server.on('error', reject);\n  });\n});\n\ntest('handles the Retry-After header', async () => {\n  const server = createServer((req, res) => {\n    res.writeHead(429, { 'Retry-After': 1 });\n    res.end();\n  });\n\n  return new Promise((resolve, reject) => {\n    server.listen(async () => {\n      const { port } = server.address();\n      try {\n        const startedAt = Date.now();\n        await retryFetch(`http://127.0.0.1:${port}`, {\n          retry: {\n            minTimeout: 10,\n            retries: 1,\n          },\n        });\n        expect(Date.now() - startedAt).toBeGreaterThanOrEqual(1010);\n        resolve();\n      } catch (err) {\n        reject(err);\n      } finally {\n        server.close();\n      }\n    });\n    server.on('error', reject);\n  });\n});\n\ntest('stops retrying when the Retry-After header exceeds the maxRetryAfter option', async () => {\n  const server = createServer((req, res) => {\n    res.writeHead(429, { 'Retry-After': 21 });\n    res.end();\n  });\n\n  return new Promise((resolve, reject) => {\n    const opts = {\n      onRetry: jest.fn(),\n    };\n\n    server.listen(async () => {\n      const { port } = server.address();\n      try {\n        const res = await retryFetch(`http://127.0.0.1:${port}`, opts);\n        expect(opts.onRetry.mock.calls.length).toBe(0);\n        expect(res.status).toBe(429);\n        resolve();\n      } catch (err) {\n        reject(err);\n      } finally {\n        server.close();\n      }\n    });\n    server.on('error', reject);\n  });\n});\n\ntest.skip('stops retrying when fetch throws `ERR_UNESCAPED_CHARACTERS` error', async () => {\n  const opts = {\n    onRetry: jest.fn(),\n  };\n\n  let err;\n  try {\n    await retryFetch(`http://127.0.0.1/\\u0019`, opts);\n  } catch (_err) {\n    err = _err;\n  }\n\n  assert(err);\n  assert.equal(err.message, 'Request path contains unescaped characters');\n  assert.equal(opts.onRetry.mock.calls.length, 0);\n});\n\ntest(\"don't retry if the request was aborted after timeout\", async () => {\n  const timeout = 50;\n  const responseAfter = 100;\n  const server = createServer((req, res) => {\n    setTimeout(() => {\n      res.end('ha');\n    }, responseAfter);\n  });\n\n  const controller = new AbortController();\n  const timeoutHandler = setTimeout(() => {\n    controller.abort();\n  }, timeout);\n\n  const opts = {\n    onRetry: jest.fn(),\n    signal: controller.signal,\n  };\n\n  return new Promise((resolve, reject) => {\n    server.listen(async () => {\n      try {\n        const { port } = server.address();\n        await retryFetch(`http://127.0.0.1:${port}`, opts);\n        resolve();\n      } catch (err) {\n        expect(opts.onRetry.mock.calls.length).toBe(0);\n        resolve();\n      } finally {\n        server.close();\n        clearTimeout(timeoutHandler);\n      }\n    });\n    server.on('error', reject);\n  });\n});\n"
  },
  {
    "path": "pnpm-workspace.yaml",
    "content": "packages:\n  - 'packages/**'\n"
  },
  {
    "path": "readme.md",
    "content": "This repository is now **archived**. See this post for more details: https://github.com/vercel/fetch/issues/83\n\n# Fetch Monorepo\n\nThis fetch monorepo contains three packages:\n\n- `@vercel/fetch`\n- `@vercel/fetch-retry`\n- `@vercel/fetch-cached-dns`\n\nThese packages are designed for use with Node.js in order to bring the familiarity of the Fetch API to the backend. There are future plans to make this project interoperable between both browser and server environments.\n\n## Getting Started\n\n`@vercel/fetch` bundles all packages inside this monorepo together into a super-powered [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) client. By default, this package will use its peer dependency [node-fetch](https://github.com/node-fetch/node-fetch), but it also supports other fetch implementations.\n\n```js\n// Basic Usage\nimport fetch from '@vercel/fetch';\n```\n\n```js\n// Bring your own fetch implementation\nimport createFetch from '@vercel/fetch';\nimport fetchImpl from 'some-fetch-implementation';\nconst fetch = createFetch(fetchImpl);\n```\n\n## Contributing\n\nPlease see our [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n## Code of Conduct\n\nPlease see our [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)\n"
  },
  {
    "path": "turbo.json",
    "content": "{\n  \"baseBranch\": \"origin/main\",\n  \"pipeline\": {\n    \"test\": {},\n    \"lint\": {}\n  }\n}\n"
  }
]