-
Notifications
You must be signed in to change notification settings - Fork 324
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
refactor: working necromancy tests #1101
Merged
Merged
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
db64576
Adding esm config
whizzzkid 2f5f41d
Moving to import/export - it builds
whizzzkid b00a823
Fixed tests
whizzzkid 9cf9c79
Fixing Test
whizzzkid b5d28ce
typo
whizzzkid 442ac60
fixing breaking is-ip changes
whizzzkid 66d3594
Fixing coverage reporting
whizzzkid 4f3cab1
adding missing webExt config
whizzzkid d6c84df
Fixing test
whizzzkid 82b7089
Passing abort-controller as dep
whizzzkid 9a70e80
Fixing Lint
whizzzkid 9184147
chore: remove window.ipfs ACL tests
lidel 3ff5d3d
chore: bump terser deps
lidel c8fc841
chore: pin all dependency versions
lidel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
/* eslint-env browser, webextensions */ | ||
|
||
exports.welcomePage = '/dist/landing-pages/welcome/index.html' | ||
exports.optionsPage = '/dist/options/options.html' | ||
exports.tickMs = 250 // no CPU spike, but still responsive enough | ||
export const welcomePage = '/dist/landing-pages/welcome/index.html' | ||
export const optionsPage = '/dist/options/options.html' | ||
export const tickMs = 250 // no CPU spike, but still responsive enough | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
'use strict' | ||
/* eslint-env browser */ | ||
|
||
const debug = require('debug') | ||
import Pqueue from 'p-queue' | ||
|
||
import debug from 'debug' | ||
import IsIpfs from 'is-ipfs' | ||
import LRU from 'lru-cache' | ||
import { offlinePeerCount } from './state.js' | ||
import { ipfsContentPath, sameGateway, pathAtHttpGateway } from './ipfs-path.js' | ||
Comment on lines
+4
to
+10
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. nit: spacing - I personally prefer organizing imports in four (potentially 5 groups depending on how large your 1st party import sections are):
eslint-plugin-imports allows you to automate this |
||
|
||
const log = debug('ipfs-companion:dnslink') | ||
log.error = debug('ipfs-companion:dnslink:error') | ||
|
||
const IsIpfs = require('is-ipfs') | ||
const LRU = require('lru-cache') | ||
const { default: PQueue } = require('p-queue') | ||
const { offlinePeerCount } = require('./state') | ||
const { ipfsContentPath, sameGateway, pathAtHttpGateway } = require('./ipfs-path') | ||
|
||
module.exports = function createDnslinkResolver (getState) { | ||
export default function createDnslinkResolver(getState) { | ||
// DNSLink lookup result cache | ||
const cacheOptions = { max: 1000, maxAge: 1000 * 60 * 60 * 12 } | ||
const cache = new LRU(cacheOptions) | ||
// upper bound for concurrent background lookups done by resolve(url) | ||
const lookupQueue = new PQueue({ concurrency: 4 }) | ||
const lookupQueue = new Pqueue({ concurrency: 4 }) | ||
// preload of DNSLink data | ||
const preloadUrlCache = new LRU(cacheOptions) | ||
const preloadQueue = new PQueue({ concurrency: 4 }) | ||
const preloadQueue = new Pqueue({ concurrency: 4 }) | ||
|
||
const dnslinkResolver = { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would love a JSdoc comment on this to explain its intention. I can guess, but it's better if we don't force others to.