Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: npm/make-fetch-happen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.1.0
Choose a base ref
...
head repository: npm/make-fetch-happen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.1.1
Choose a head ref
  • 4 commits
  • 7 files changed
  • 4 contributors

Commits on Mar 28, 2022

  1. chore: bump @npmcli/template-oss from 3.1.2 to 3.2.0 (#133)

    * chore: bump @npmcli/template-oss from 3.1.2 to 3.2.0
    
    Bumps [@npmcli/template-oss](https://github.com/npm/template-oss) from 3.1.2 to 3.2.0.
    - [Release notes](https://github.com/npm/template-oss/releases)
    - [Changelog](https://github.com/npm/template-oss/blob/main/CHANGELOG.md)
    - [Commits](npm/template-oss@v3.1.2...v3.2.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@npmcli/template-oss"
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * chore: postinstall for dependabot template-oss PR
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Gar <gar+gh@danger.computer>
    dependabot[bot] and wraithgar authored Mar 28, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    thoughtpolice Austin Seipp
    Copy the full SHA
    16af8da View commit details

Commits on Mar 29, 2022

  1. Copy the full SHA
    be0cf6a View commit details
  2. Copy the full SHA
    a7f1b55 View commit details
  3. chore(main): release 10.1.1 (#137)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Mar 29, 2022
    Copy the full SHA
    4d9ec61 View commit details
Showing with 20 additions and 47 deletions.
  1. +1 −1 .github/workflows/audit.yml
  2. +2 −2 .github/workflows/ci.yml
  3. +1 −1 .github/workflows/post-dependabot.yml
  4. +12 −0 CHANGELOG.md
  5. +0 −39 README.md
  6. +1 −1 lib/dns.js
  7. +3 −3 package.json
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -23,5 +23,5 @@ jobs:
- name: Update npm to latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- run: npm i --package-lock
- run: npm i --ignore-scripts --package-lock
- run: npm audit
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ jobs:
- name: Update npm to latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- run: npm i
- run: npm i --ignore-scripts
- run: npm run lint

test:
@@ -82,5 +82,5 @@ jobs:
if: ${{ !startsWith(matrix.node-version, '10.') }}
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- run: npm -v
- run: npm i
- run: npm i --ignore-scripts
- run: npm test --ignore-scripts
2 changes: 1 addition & 1 deletion .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
npm install --no-scripts
npm install --ignore-scripts
npm run template-oss-apply
git add .
git commit -am "chore: postinstall for dependabot template-oss PR"
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

### [10.1.1](https://github.com/npm/make-fetch-happen/compare/v10.1.0...v10.1.1) (2022-03-29)


### Bug Fixes

* default verbatim to undefined ([#135](https://github.com/npm/make-fetch-happen/issues/135)) ([be0cf6a](https://github.com/npm/make-fetch-happen/commit/be0cf6a15949c0511b40ed086aeab29fb86c2259))


### Documentation

* remove mention of custom cache provider ([#136](https://github.com/npm/make-fetch-happen/issues/136)) ([a7f1b55](https://github.com/npm/make-fetch-happen/commit/a7f1b554bc0072a1545d96f316e252ec52e81b23))

## [10.1.0](https://github.com/npm/make-fetch-happen/compare/v10.0.6...v10.1.0) (2022-03-24)


39 changes: 0 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -184,45 +184,6 @@ fetch('https://registry.npmjs.org/make-fetch-happen', {
}) // -> 200-level response will be written to disk
```

A possible (minimal) implementation for `MyCustomRedisCache`:

```javascript
const bluebird = require('bluebird')
const redis = require("redis")
bluebird.promisifyAll(redis.RedisClient.prototype)
class MyCustomRedisCache {
constructor (opts) {
this.redis = redis.createClient(opts)
}
match (req) {
return this.redis.getAsync(req.url).then(res => {
if (res) {
const parsed = JSON.parse(res)
return new fetch.Response(parsed.body, {
url: req.url,
headers: parsed.headers,
status: 200
})
}
})
}
put (req, res) {
return res.buffer().then(body => {
return this.redis.setAsync(req.url, JSON.stringify({
body: body,
headers: res.headers.raw()
}))
}).then(() => {
// return the response itself
return res
})
}
'delete' (req) {
return this.redis.unlinkAsync(req.url)
}
}
```

#### <a name="opts-cache"></a> `> opts.cache`

This option follows the standard `fetch` API cache option. This option will do nothing if [`opts.cachePath`](#opts-cache-path) is null. The following values are accepted (as strings):
2 changes: 1 addition & 1 deletion lib/dns.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const defaultOptions = exports.defaultOptions = {
family: undefined,
hints: dns.ADDRCONFIG,
all: false,
verbatim: true,
verbatim: undefined,
}

const lookupCache = exports.lookupCache = new LRUCache({ max: 50 })
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "make-fetch-happen",
"version": "10.1.0",
"version": "10.1.1",
"description": "Opinionated, caching, retrying fetch client",
"main": "lib/index.js",
"files": [
@@ -55,7 +55,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.1.2",
"@npmcli/template-oss": "3.2.0",
"mkdirp": "^1.0.4",
"nock": "^13.2.4",
"rimraf": "^3.0.2",
@@ -73,6 +73,6 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.1.2"
"version": "3.2.0"
}
}