Skip to content
Permalink
Browse files

Chore: Update packages to use @hint/utils-network

  • Loading branch information
sarvaje committed Nov 4, 2019
1 parent 19ad5c6 commit baa55a4ebd47e21eabffef9f7be74672125aef9b
Showing with 178 additions and 107 deletions.
  1. +2 โˆ’0 packages/connector-jsdom/package.json
  2. +3 โˆ’3 packages/connector-jsdom/src/connector.ts
  3. +3 โˆ’1 packages/connector-jsdom/tsconfig.json
  4. +1 โˆ’0 packages/connector-local/package.json
  5. +1 โˆ’3 packages/connector-local/src/connector.ts
  6. +1 โˆ’4 packages/connector-local/tests/tests.ts
  7. +2 โˆ’1 packages/connector-local/tsconfig.json
  8. +2 โˆ’0 packages/connector-puppeteer/package.json
  9. +3 โˆ’3 packages/connector-puppeteer/src/connector.ts
  10. +2 โˆ’1 packages/connector-puppeteer/src/lib/create-fetchend-payload.ts
  11. +3 โˆ’1 packages/connector-puppeteer/tsconfig.json
  12. +1 โˆ’2 packages/create-hintrc/package.json
  13. +1 โˆ’1 packages/extension-browser/src/content-script/fetcher.ts
  14. +1 โˆ’1 packages/extension-browser/src/shared/headers.ts
  15. +1 โˆ’1 packages/extension-browser/webpack.config.js
  16. +1 โˆ’0 packages/hint-apple-touch-icons/package.json
  17. +2 โˆ’1 packages/hint-apple-touch-icons/src/hint.ts
  18. +1 โˆ’0 packages/hint-apple-touch-icons/tsconfig.json
  19. +1 โˆ’0 packages/hint-content-type/package.json
  20. +2 โˆ’2 packages/hint-content-type/src/hint.ts
  21. +1 โˆ’0 packages/hint-content-type/tsconfig.json
  22. +1 โˆ’0 packages/hint-disown-opener/package.json
  23. +1 โˆ’1 packages/hint-disown-opener/src/hint.ts
  24. +1 โˆ’0 packages/hint-disown-opener/tsconfig.json
  25. +1 โˆ’0 packages/hint-highest-available-document-mode/package.json
  26. +2 โˆ’2 packages/hint-highest-available-document-mode/src/hint.ts
  27. +1 โˆ’0 packages/hint-highest-available-document-mode/tsconfig.json
  28. +1 โˆ’0 packages/hint-html-checker/package.json
  29. +1 โˆ’1 packages/hint-html-checker/src/hint.ts
  30. +4 โˆ’4 packages/hint-html-checker/tests/tests.ts
  31. +1 โˆ’0 packages/hint-html-checker/tsconfig.json
  32. +1 โˆ’0 packages/hint-http-cache/package.json
  33. +2 โˆ’2 packages/hint-http-cache/src/hint.ts
  34. +1 โˆ’0 packages/hint-http-cache/tsconfig.json
  35. +1 โˆ’0 packages/hint-http-compression/package.json
  36. +2 โˆ’4 packages/hint-http-compression/src/hint.ts
  37. +5 โˆ’4 packages/hint-http-compression/tests/_tests.ts
  38. +1 โˆ’0 packages/hint-http-compression/tsconfig.json
  39. +1 โˆ’0 packages/hint-https-only/package.json
  40. +1 โˆ’1 packages/hint-https-only/src/hint.ts
  41. +1 โˆ’0 packages/hint-https-only/tsconfig.json
  42. +1 โˆ’0 packages/hint-no-bom/package.json
  43. +2 โˆ’1 packages/hint-no-bom/src/hint.ts
  44. +1 โˆ’0 packages/hint-no-bom/tsconfig.json
  45. +1 โˆ’0 packages/hint-no-broken-links/package.json
  46. +1 โˆ’1 packages/hint-no-broken-links/src/hint.ts
  47. +1 โˆ’0 packages/hint-no-broken-links/tsconfig.json
  48. +1 โˆ’0 packages/hint-no-disallowed-headers/package.json
  49. +3 โˆ’3 packages/hint-no-disallowed-headers/src/hint.ts
  50. +1 โˆ’0 packages/hint-no-disallowed-headers/tsconfig.json
  51. +1 โˆ’0 packages/hint-no-friendly-error-pages/package.json
  52. +1 โˆ’1 packages/hint-no-friendly-error-pages/src/hint.ts
  53. +1 โˆ’0 packages/hint-no-friendly-error-pages/tsconfig.json
  54. +1 โˆ’0 packages/hint-no-html-only-headers/package.json
  55. +2 โˆ’2 packages/hint-no-html-only-headers/src/hint.ts
  56. +1 โˆ’0 packages/hint-no-html-only-headers/tsconfig.json
  57. +1 โˆ’0 packages/hint-no-p3p/package.json
  58. +2 โˆ’1 packages/hint-no-p3p/src/hint.ts
  59. +1 โˆ’0 packages/hint-no-p3p/tsconfig.json
  60. +1 โˆ’0 packages/hint-no-vulnerable-javascript-libraries/package.json
  61. +1 โˆ’1 packages/hint-no-vulnerable-javascript-libraries/src/hint.ts
  62. +1 โˆ’1 packages/hint-no-vulnerable-javascript-libraries/src/snyk-snapshot.json
  63. +1 โˆ’0 packages/hint-no-vulnerable-javascript-libraries/tsconfig.json
  64. +1 โˆ’0 packages/hint-performance-budget/package.json
  65. +1 โˆ’1 packages/hint-performance-budget/src/hint.ts
  66. +1 โˆ’0 packages/hint-performance-budget/tsconfig.json
  67. +1 โˆ’0 packages/hint-sri/package.json
  68. +1 โˆ’1 packages/hint-sri/src/hint.ts
  69. +1 โˆ’0 packages/hint-sri/tsconfig.json
  70. +1 โˆ’0 packages/hint-strict-transport-security/package.json
  71. +3 โˆ’3 packages/hint-strict-transport-security/src/hint.ts
  72. +6 โˆ’11 packages/hint-strict-transport-security/tests/_common.ts
  73. +1 โˆ’0 packages/hint-strict-transport-security/tsconfig.json
  74. +1 โˆ’0 packages/hint-validate-set-cookie-header/package.json
  75. +2 โˆ’2 packages/hint-validate-set-cookie-header/src/hint.ts
  76. +1 โˆ’0 packages/hint-validate-set-cookie-header/tsconfig.json
  77. +1 โˆ’0 packages/hint-x-content-type-options/package.json
  78. +1 โˆ’1 packages/hint-x-content-type-options/src/hint.ts
  79. +1 โˆ’0 packages/hint-x-content-type-options/tsconfig.json
  80. +1 โˆ’0 packages/hint/package.json
  81. +1 โˆ’1 packages/hint/src/lib/cli/analyze.ts
  82. +1 โˆ’1 packages/hint/src/lib/engine.ts
  83. +1 โˆ’1 packages/hint/src/lib/types/connector.ts
  84. +1 โˆ’1 packages/hint/src/lib/types/network.ts
  85. +2 โˆ’2 packages/hint/src/lib/types/parser.ts
  86. +2 โˆ’1 packages/hint/tests/lib/cli/analyze.ts
  87. +1 โˆ’0 packages/hint/tsconfig.json
  88. +1 โˆ’0 packages/parser-babel-config/package.json
  89. +2 โˆ’1 packages/parser-babel-config/tests/tests.ts
  90. +2 โˆ’1 packages/parser-babel-config/tsconfig.json
  91. +1 โˆ’0 packages/parser-manifest/package.json
  92. +2 โˆ’2 packages/parser-manifest/src/parser.ts
  93. +1 โˆ’0 packages/parser-manifest/tsconfig.json
  94. +2 โˆ’1 packages/parser-package-json/package.json
  95. +2 โˆ’1 packages/parser-package-json/tests/tests.ts
  96. +2 โˆ’1 packages/parser-package-json/tsconfig.json
  97. +1 โˆ’0 packages/parser-typescript-config/package.json
  98. +2 โˆ’1 packages/parser-typescript-config/src/parser.ts
  99. +6 โˆ’3 packages/parser-typescript-config/tests/tests.ts
  100. +2 โˆ’1 packages/parser-typescript-config/tsconfig.json
  101. +2 โˆ’1 packages/parser-webpack-config/package.json
  102. +1 โˆ’1 packages/parser-webpack-config/src/parser.ts
  103. +4 โˆ’4 packages/parser-webpack-config/tests/webpack-config.ts
  104. +2 โˆ’1 packages/parser-webpack-config/tsconfig.json
  105. +2 โˆ’0 packages/utils-connector-tools/package.json
  106. +1 โˆ’1 packages/utils-connector-tools/src/normalize-headers.ts
  107. +2 โˆ’2 packages/utils-connector-tools/src/requester.ts
  108. +3 โˆ’1 packages/utils-connector-tools/tsconfig.json
  109. +1 โˆ’0 packages/utils-create-server/package.json
  110. +2 โˆ’1 packages/utils-create-server/src/same-thread-server.ts
  111. +2 โˆ’1 packages/utils-create-server/tsconfig.json
  112. +1 โˆ’0 packages/utils-tests-helpers/package.json
  113. +2 โˆ’1 packages/utils-tests-helpers/src/hint-runner.ts
  114. +1 โˆ’0 packages/utils-tests-helpers/tsconfig.json
@@ -12,6 +12,8 @@
"@hint/utils-connector-tools": "^4.0.14",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"@types/tough-cookie": "^2.3.5",
"jsdom": "^15.2.0",
"mutationobserver-shim": "^0.3.3"
@@ -33,10 +33,10 @@ import { JSDOM, ResourceLoader, VirtualConsole } from 'jsdom';

import {
getContentTypeData,
getType,
HttpHeaders,
isHTMLDocument
getType
} from '@hint/utils';
import { HttpHeaders } from '@hint/utils-types';
import { isHTMLDocument } from '@hint/utils-network';
import { createHTMLDocument, HTMLDocument, HTMLElement, traverse } from '@hint/utils-dom';
import { debug as d } from '@hint/utils-debug';
import { Engine, Event, FetchEnd, FetchError, IConnector, NetworkData } from 'hint';
@@ -19,6 +19,8 @@
{ "path": "../utils-connector-tools" },
{ "path": "../utils-create-server" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" }
{ "path": "../utils-dom" },
{ "path": "../utils-network" },
{ "path": "../utils-types" }
]
}
@@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"chokidar": "^3.2.3",
"globby": "^10.0.1",
"jsdom": "^15.2.0"
@@ -46,17 +46,15 @@ import * as globby from 'globby';
import { JSDOM } from 'jsdom';

import {
asPathString,
cwd,
getAsUri,
getContentTypeData,
getType,

isFile,
isTextMediaType,
logger,
readFileAsync
} from '@hint/utils';
import { asPathString, getAsUri} from '@hint/utils-network';
import {
HTMLDocument,
HTMLElement,
@@ -8,12 +8,11 @@ import * as proxyquire from 'proxyquire';
import { EventEmitter2 } from 'eventemitter2';

import {
asPathString,
delay,
getAsUri,
logger,
readFileAsync
} from '@hint/utils';
import { asPathString, getAsUri} from '@hint/utils-network';
import { Engine, FetchEnd } from 'hint';
import { HTMLEvents } from '@hint/parser-html';

@@ -56,9 +55,7 @@ const mockContext = (context: SandboxContext) => {

const script = proxyquire('../src/connector', {
'@hint/utils': {
asPathString,
cwd: cwdStub,
getAsUri,
isFile: isFileStub,
logger,
readFileAsync
@@ -17,6 +17,7 @@
{ "path": "../parser-html" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" }
{ "path": "../utils-i18n" },
{ "path": "../utils-network" }
]
}
@@ -12,6 +12,8 @@
"@hint/utils-connector-tools": "^4.0.14",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"is-ci": "^2.0.0",
"lockfile": "^1.0.4",
"puppeteer-core": "^1.20.0"
@@ -7,10 +7,10 @@ import * as puppeteer from 'puppeteer-core';
import {
Browser,
getInstallationPath,
HttpHeaders,
getPlatform,
isRegularProtocol
getPlatform
} from '@hint/utils';
import { isRegularProtocol } from '@hint/utils-network';
import { HttpHeaders } from '@hint/utils-types';
import {
createHTMLDocument,
HTMLElement,
@@ -1,5 +1,6 @@
import * as puppeteer from 'puppeteer-core';
import { getContentTypeData, HttpHeaders } from '@hint/utils';
import { HttpHeaders } from '@hint/utils-types';
import { getContentTypeData } from '@hint/utils';
import { HTMLDocument } from '@hint/utils-dom';
import { normalizeHeaders } from '@hint/utils-connector-tools';
import { FetchEnd, NetworkData } from 'hint';
@@ -19,6 +19,8 @@
{ "path": "../utils-connector-tools" },
{ "path": "../utils-create-server" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" }
{ "path": "../utils-dom" },
{ "path": "../utils-network" },
{ "path": "../utils-types" }
]
}
@@ -11,14 +11,13 @@
"create-hintrc": "./dist/src/create-hintrc.js"
},
"dependencies": {
"@hint/utils": "^6.0.0",
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"browserslist": "^4.7.2",
"inquirer": "^7.0.0"
},
"description": "webhint's configuration file initializer package",
"devDependencies": {
"@hint/utils": "^6.1.0",
"@types/inquirer": "^6.0.3",
"@types/lodash": "^4.14.141",
"@types/node": "^12.7.5",
@@ -1,5 +1,5 @@
import { HttpHeaders } from '@hint/utils-types/dist/src/http-headers';
import { FetchEnd, NetworkData } from 'hint/dist/src/lib/types';
import { HttpHeaders } from '@hint/utils/dist/src/types/http-header';
import { getContentTypeData } from '@hint/utils/dist/src/content-type';

import { fetch } from '../shared/globals';
@@ -1,4 +1,4 @@
import { HttpHeaders } from '@hint/utils';
import { HttpHeaders } from '@hint/utils-types/dist/src/http-headers';

/** Convert `webRequest` or `devtools.network` headers to `hint` headers. */
export const mapHeaders = (webRequestHeaders: { name: string; value?: string }[]): HttpHeaders => {
@@ -84,7 +84,7 @@ module.exports = (env) => {
alias: {
'./get-message$': path.resolve(__dirname, 'dist/src/shims/get-message.js'),
'@hint/utils-i18n/dist/src/get-message$': path.resolve(__dirname, 'dist/src/shims/get-message.js'),
'@hint/utils/dist/src/network/request-async$': path.resolve(__dirname, 'dist/src/shims/request-async.js'),
'@hint/utils-network/dist/src/request-async$': path.resolve(__dirname, 'dist/src/shims/request-async.js'),
'acorn-jsx$': path.resolve(__dirname, 'dist/src/shims/acorn-jsx.js'),
'acorn-jsx-walk$': path.resolve(__dirname, 'dist/src/shims/acorn-jsx-walk.js'),
'axe-core': require.resolve('axe-core/axe.min.js'),
@@ -10,6 +10,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"image-size": "^0.8.3"
},
@@ -3,7 +3,8 @@
*/
import { imageSize as getImageData } from 'image-size';

import { isRegularProtocol, normalizeString } from '@hint/utils';
import { normalizeString } from '@hint/utils';
import { isRegularProtocol } from '@hint/utils-network';
import { debug as d } from '@hint/utils-debug';
import { HintContext, IHint, NetworkData, TraverseEnd } from 'hint';
import { HTMLDocument } from '@hint/utils-dom/dist/src/htmldocument';
@@ -18,6 +18,7 @@
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"content-type": "^1.0.4",
"@hint/utils-types": "^1.0.0"
},
@@ -13,8 +13,8 @@ import { MediaType, parse } from 'content-type';

import { debug as d } from '@hint/utils-debug';
import { normalizeString } from '@hint/utils/dist/src/misc/normalize-string';
import { isDataURI } from '@hint/utils/dist/src/network/is-data-uri';
import { normalizeHeaderValue } from '@hint/utils/dist/src/network/normalize-header-value';
import { isDataURI } from '@hint/utils-network/dist/src/is-data-uri';
import { normalizeHeaderValue } from '@hint/utils-network/dist/src/normalize-header-value';
import { IHint, FetchEnd } from 'hint/dist/src/lib/types';
import { isTextMediaType } from '@hint/utils/dist/src/content-type';
import { HintContext } from 'hint/dist/src/lib/hint-context';
@@ -17,6 +17,7 @@
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -12,6 +12,7 @@
"@hint/utils-compat-data": "^1.0.1",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "hint that that checks if external links disown the opener",
@@ -14,7 +14,7 @@ import { URL } from 'url';

import { debug as d } from '@hint/utils-debug';
import { isSupported } from '@hint/utils-compat-data';
import { isRegularProtocol } from '@hint/utils/dist/src/network/is-regular-protocol';
import { isRegularProtocol } from '@hint/utils-network/dist/src/is-regular-protocol';
import { cutString } from '@hint/utils/dist/src/misc/cut-string';
import { normalizeString } from '@hint/utils/dist/src/misc/normalize-string';
import { prettyPrintArray } from '@hint/utils/dist/src/misc/pretty-print-array';
@@ -19,6 +19,7 @@
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -10,6 +10,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "hint for best practices related to usage of the X-UA-Compatible meta tag and response header",
@@ -9,9 +9,9 @@
* ------------------------------------------------------------------------------
*/

import { HttpHeaders } from '@hint/utils/dist/src/types/http-header';
import { HttpHeaders } from '@hint/utils-types/dist/src/http-headers';
import { normalizeString } from '@hint/utils/dist/src/misc/normalize-string';
import { isLocalFile } from '@hint/utils/dist/src/network/is-local-file';
import { isLocalFile } from '@hint/utils-network/dist/src/is-local-file';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';
import { HTMLDocument } from '@hint/utils-dom/dist/src/htmldocument';
import { IHint, TraverseEnd } from 'hint/dist/src/lib/types';
@@ -17,6 +17,7 @@
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"lodash": "^4.17.15"
},
@@ -115,7 +115,7 @@ export default class HtmlCheckerHint implements IHint {
};

const requestRetry = async (options: OptionsWithUrl, retries: number = 3): Promise<any> => {
const requestAsync = (await import('@hint/utils')).requestAsync;
const requestAsync = (await import('@hint/utils-network')).requestAsync;
const delay = (await import('@hint/utils')).delay;

try {
@@ -3,9 +3,9 @@
import * as mock from 'mock-require';

import { HintTest, testHint } from '@hint/utils-tests-helpers';
import * as utils from '@hint/utils';
import { getHintPath } from '@hint/utils';
import * as utilsNetwork from '@hint/utils-network';

const { getHintPath } = utils;
const hintPath = getHintPath(__filename);
const exampleUrl = 'https://empty.webhint.io/';
const validatorError = 'error';
@@ -95,9 +95,9 @@ const htmlCheckerMock = (response: any) => {
return Promise.reject(validatorError); // Error with the validator
};

(utils as any).requestAsync = requestAsync;
(utilsNetwork as any).requestAsync = requestAsync;

mock('@hint/utils', utils);
mock('@hint/utils-network', utilsNetwork);
};

const testsForDefaults: HintTest[] = [
@@ -18,6 +18,7 @@
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "hint for HTTP caching related best practices",
@@ -3,8 +3,8 @@
*/

import { debug as d } from '@hint/utils-debug';
import { isDataURI } from '@hint/utils/dist/src/network/is-data-uri';
import { normalizeHeaderValue } from '@hint/utils/dist/src/network/normalize-header-value';
import { isDataURI } from '@hint/utils-network/dist/src/is-data-uri';
import { normalizeHeaderValue } from '@hint/utils-network/dist/src/normalize-header-value';
import { IHint, FetchEnd } from 'hint/dist/src/lib/types';
import { HintContext } from 'hint/dist/src/lib/hint-context';

@@ -17,6 +17,7 @@
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -10,6 +10,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"iltorb": "^2.4.3"
},
@@ -15,13 +15,11 @@ import {
asyncTry,
getFileExtension,
isTextMediaType,
HttpHeaders,
isHTTP,
isRegularProtocol,
normalizeHeaderValue,
normalizeString
} from '@hint/utils';
import { HttpHeaders } from '@hint/utils-types';
import { HTMLElement } from '@hint/utils-dom';
import { isHTTP, isRegularProtocol, normalizeHeaderValue } from '@hint/utils-network';
import { FetchEnd, HintContext, IHint, NetworkData, Response } from 'hint';

import { CompressionCheckOptions } from './types';

0 comments on commit baa55a4

Please sign in to comment.
You canโ€™t perform that action at this time.