Skip to content

Commit

Permalink
Chore: Update packages to use @hint/utils-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvaje authored and Jesus David García Gomez committed Nov 8, 2019
1 parent 411182d commit d95dc4a
Show file tree
Hide file tree
Showing 83 changed files with 135 additions and 75 deletions.
1 change: 1 addition & 0 deletions packages/connector-jsdom/package.json
Expand Up @@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-connector-tools": "^4.0.14",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-dom": "^1.0.0",
"@types/tough-cookie": "^2.3.5",
"jsdom": "^15.2.0",
"mutationobserver-shim": "^0.3.3"
Expand Down
7 changes: 2 additions & 5 deletions packages/connector-jsdom/src/connector.ts
Expand Up @@ -32,15 +32,12 @@ import { fork, ChildProcess } from 'child_process';
import { JSDOM, ResourceLoader, VirtualConsole } from 'jsdom';

import {
createHTMLDocument,
getContentTypeData,
getType,
HTMLDocument,
HTMLElement,
HttpHeaders,
isHTMLDocument,
traverse
isHTMLDocument
} from '@hint/utils';
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';
import { Requester } from '@hint/utils-connector-tools';
Expand Down
5 changes: 2 additions & 3 deletions packages/connector-jsdom/src/resource-loader.ts
Expand Up @@ -2,10 +2,9 @@ import { URL } from 'url';

import {
getContentTypeData,
getElementByUrl,
getType,
HTMLDocument
getType
} from '@hint/utils';
import { getElementByUrl, HTMLDocument } from '@hint/utils-dom';
import { debug as d } from '@hint/utils-debug';
import { ResourceLoader } from 'jsdom';

Expand Down
3 changes: 2 additions & 1 deletion packages/connector-jsdom/tsconfig.json
Expand Up @@ -18,6 +18,7 @@
{ "path": "../utils" },
{ "path": "../utils-connector-tools" },
{ "path": "../utils-create-server" },
{ "path": "../utils-debug" }
{ "path": "../utils-debug" },
{ "path": "../utils-dom" }
]
}
1 change: 1 addition & 0 deletions packages/connector-local/package.json
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"chokidar": "^3.2.3",
"globby": "^10.0.1",
Expand Down
11 changes: 7 additions & 4 deletions packages/connector-local/src/connector.ts
Expand Up @@ -51,14 +51,17 @@ import {
getAsUri,
getContentTypeData,
getType,
HTMLDocument,
HTMLElement,

isFile,
isTextMediaType,
logger,
readFileAsync,
traverse
readFileAsync
} from '@hint/utils';
import {
HTMLDocument,
HTMLElement,
traverse
} from '@hint/utils-dom';

import {
Engine,
Expand Down
1 change: 1 addition & 0 deletions packages/connector-local/tsconfig.json
Expand Up @@ -16,6 +16,7 @@
{ "path": "../hint" },
{ "path": "../parser-html" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" }
]
}
1 change: 1 addition & 0 deletions packages/connector-puppeteer/package.json
Expand Up @@ -11,6 +11,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-connector-tools": "^4.0.14",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-dom": "^1.0.0",
"is-ci": "^2.0.0",
"lockfile": "^1.0.4",
"puppeteer-core": "^1.20.0"
Expand Down
10 changes: 6 additions & 4 deletions packages/connector-puppeteer/src/connector.ts
Expand Up @@ -7,14 +7,16 @@ import * as puppeteer from 'puppeteer-core';
import {
Browser,
getInstallationPath,
createHTMLDocument,
traverse,
HTMLElement,
HTMLDocument,
HttpHeaders,
getPlatform,
isRegularProtocol
} from '@hint/utils';
import {
createHTMLDocument,
HTMLElement,
HTMLDocument,
traverse
} from '@hint/utils-dom';
import { debug as d } from '@hint/utils-debug';
import { normalizeHeaders, Requester } from '@hint/utils-connector-tools';
import { IConnector, Engine, NetworkData } from 'hint';
Expand Down
@@ -1,5 +1,6 @@
import * as puppeteer from 'puppeteer-core';
import { getContentTypeData, HTMLDocument, HttpHeaders } from '@hint/utils';
import { getContentTypeData, HttpHeaders } from '@hint/utils';
import { HTMLDocument } from '@hint/utils-dom';
import { normalizeHeaders } from '@hint/utils-connector-tools';
import { FetchEnd, NetworkData } from 'hint';
import { getElementFromResponse } from './get-element-from-response';
Expand Down
3 changes: 2 additions & 1 deletion packages/connector-puppeteer/src/lib/events.ts
@@ -1,5 +1,6 @@
import * as puppeteer from 'puppeteer-core';
import { getType, HTMLDocument } from '@hint/utils';
import { getType } from '@hint/utils';
import { HTMLDocument } from '@hint/utils-dom';
import { debug as d } from '@hint/utils-debug';
import { Events } from 'hint';
import { createFetchEndPayload, Fetcher } from './create-fetchend-payload';
Expand Down
@@ -1,6 +1,6 @@
import * as puppeteer from 'puppeteer-core';

import { getElementByUrl, HTMLElement, HTMLDocument } from '@hint/utils';
import { getElementByUrl, HTMLElement, HTMLDocument } from '@hint/utils-dom';

/** Returns the HTMLElement that initiated a request */
export const getElementFromResponse = (source: puppeteer.Response | puppeteer.Request, dom?: HTMLDocument): HTMLElement | null => {
Expand Down
2 changes: 1 addition & 1 deletion packages/connector-puppeteer/src/lib/get-favicon.ts
@@ -1,6 +1,6 @@
import { URL } from 'url';

import { HTMLDocument } from '@hint/utils';
import { HTMLDocument } from '@hint/utils-dom';
import { debug as d } from '@hint/utils-debug';
import { Engine } from 'hint';

Expand Down
3 changes: 2 additions & 1 deletion packages/connector-puppeteer/tsconfig.json
Expand Up @@ -18,6 +18,7 @@
{ "path": "../utils" },
{ "path": "../utils-connector-tools" },
{ "path": "../utils-create-server" },
{ "path": "../utils-debug" }
{ "path": "../utils-debug" },
{ "path": "../utils-dom" }
]
}
1 change: 1 addition & 0 deletions packages/extension-browser/package.json
Expand Up @@ -43,6 +43,7 @@
"@hint/parser-manifest": "^2.2.12",
"@hint/utils": "^6.1.0",
"@hint/utils-create-server": "^3.3.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"@microsoft/applicationinsights-web-basic": "^2.2.0",
Expand Down
12 changes: 9 additions & 3 deletions packages/extension-browser/src/content-script/connector.ts
@@ -1,9 +1,15 @@
import { URL } from 'url';

import { Engine } from 'hint';
import { getElementByUrl, HTMLDocument, HTMLElement, traverse } from '@hint/utils/dist/src/dom';
import { createHelpers, restoreReferences } from '@hint/utils/dist/src/dom/snapshot';
import { DocumentData } from '@hint/utils/dist/src/types/snapshot';
import {
createHelpers,
DocumentData,
getElementByUrl,
HTMLDocument,
HTMLElement,
restoreReferences,
traverse
} from '@hint/utils-dom';

import {
ConnectorOptionsConfig,
Expand Down
1 change: 1 addition & 0 deletions packages/extension-browser/tsconfig.json
Expand Up @@ -47,6 +47,7 @@
{ "path": "../parser-manifest" },
{ "path": "../utils" },
{ "path": "../utils-create-server" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-types" }
]
Expand Down
1 change: 1 addition & 0 deletions packages/hint-apple-touch-icons/package.json
Expand Up @@ -16,6 +16,7 @@
"description": "hint for best practices related to the apple-touch-icons",
"devDependencies": {
"@hint/utils-tests-helpers": "^5.1.0",
"@hint/utils-dom": "^1.0.0",
"@types/image-size": "^0.7.0",
"@types/node": "^12.7.5",
"@typescript-eslint/eslint-plugin": "^1.13.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/hint-apple-touch-icons/src/hint.ts
Expand Up @@ -6,7 +6,8 @@ import { imageSize as getImageData } from 'image-size';
import { isRegularProtocol, normalizeString } from '@hint/utils';
import { debug as d } from '@hint/utils-debug';
import { HintContext, IHint, NetworkData, TraverseEnd } from 'hint';
import { HTMLElement, HTMLDocument } from '@hint/utils/dist/src/dom/html';
import { HTMLDocument } from '@hint/utils-dom/dist/src/htmldocument';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';

import meta from './meta';
import { getMessage } from './i18n.import';
Expand Down
1 change: 1 addition & 0 deletions packages/hint-apple-touch-icons/tsconfig.json
Expand Up @@ -16,6 +16,7 @@
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-axe/package.json
Expand Up @@ -16,6 +16,7 @@
"description": "hint that that checks using axe for accessibility related best practices",
"devDependencies": {
"@hint/utils-tests-helpers": "^5.1.0",
"@hint/utils-dom": "^1.0.0",
"@types/node": "^12.7.5",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.12.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/hint-axe/src/util/axe.ts
@@ -1,6 +1,7 @@
import { CheckResult, AxeResults, ImpactValue, NodeResult as AxeNodeResult } from 'axe-core';

import { HTMLDocument, HTMLElement } from '@hint/utils/dist/src/dom/html';
import { HTMLDocument } from '@hint/utils-dom/dist/src/htmldocument';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';
import { readFileAsync } from '@hint/utils/dist/src/fs/read-file-async';
import { CanEvaluateScript } from 'hint/dist/src/lib/types';
import { HintContext } from 'hint/dist/src/lib/hint-context';
Expand Down
1 change: 1 addition & 0 deletions packages/hint-axe/tsconfig.json
Expand Up @@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-compat-api/package.json
Expand Up @@ -17,6 +17,7 @@
"description": "hint to validate if the HTML, CSS, and JavaScript APIs of the project are deprecated or not broadly supported",
"devDependencies": {
"@hint/parser-css": "^3.0.14",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-tests-helpers": "^5.1.0",
"@types/lodash": "^4.14.141",
"@types/node": "^12.7.5",
Expand Down
3 changes: 2 additions & 1 deletion packages/hint-compat-api/src/html.ts
Expand Up @@ -4,7 +4,8 @@

import { HintContext } from 'hint/dist/src/lib/hint-context';
import { IHint } from 'hint/dist/src/lib/types';
import { HTMLAttribute, HTMLElement } from '@hint/utils';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';
import { HTMLAttribute } from '@hint/utils-dom/dist/src/types';
import { getUnsupportedDetails, UnsupportedBrowsers } from '@hint/utils-compat-data';

import { filterBrowsers, joinBrowsers } from './utils/browsers';
Expand Down
1 change: 1 addition & 0 deletions packages/hint-compat-api/tsconfig.json
Expand Up @@ -17,6 +17,7 @@
{ "path": "../parser-css" },
{ "path": "../utils" },
{ "path": "../utils-compat-data" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-disown-opener/package.json
Expand Up @@ -16,6 +16,7 @@
},
"description": "hint that that checks if external links disown the opener",
"devDependencies": {
"@hint/utils-dom": "^1.0.0",
"@hint/utils-tests-helpers": "^5.1.0",
"@types/node": "^12.7.5",
"@typescript-eslint/eslint-plugin": "^1.13.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/hint-disown-opener/src/hint.ts
Expand Up @@ -15,10 +15,10 @@ 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 { HTMLElement } from '@hint/utils/dist/src/dom/html';
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';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';
import { ElementFound, IHint } from 'hint/dist/src/lib/types';
import { HintContext } from 'hint/dist/src/lib/hint-context';

Expand Down
1 change: 1 addition & 0 deletions packages/hint-disown-opener/tsconfig.json
Expand Up @@ -17,6 +17,7 @@
{ "path": "../utils" },
{ "path": "../utils-compat-data" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-highest-available-document-mode/package.json
Expand Up @@ -14,6 +14,7 @@
},
"description": "hint for best practices related to usage of the X-UA-Compatible meta tag and response header",
"devDependencies": {
"@hint/utils-dom": "^1.0.0",
"@hint/utils-tests-helpers": "^5.1.0",
"@types/node": "^12.7.5",
"@typescript-eslint/eslint-plugin": "^1.13.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/hint-highest-available-document-mode/src/hint.ts
Expand Up @@ -12,7 +12,8 @@
import { HttpHeaders } from '@hint/utils/dist/src/types/http-header';
import { normalizeString } from '@hint/utils/dist/src/misc/normalize-string';
import { isLocalFile } from '@hint/utils/dist/src/network/is-local-file';
import { HTMLDocument, HTMLElement } from '@hint/utils/dist/src/dom/html';
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';
import { HintContext } from 'hint/dist/src/lib/hint-context';

Expand Down
Expand Up @@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-http-compression/package.json
Expand Up @@ -15,6 +15,7 @@
},
"description": "hint for HTTP compression related best practices",
"devDependencies": {
"@hint/utils-dom": "^1.0.0",
"@hint/utils-tests-helpers": "^5.1.0",
"@types/iltorb": "^2.3.0",
"@types/mock-require": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/hint-http-compression/src/hint.ts
Expand Up @@ -15,13 +15,13 @@ import {
asyncTry,
getFileExtension,
isTextMediaType,
HTMLElement,
HttpHeaders,
isHTTP,
isRegularProtocol,
normalizeHeaderValue,
normalizeString
} from '@hint/utils';
import { HTMLElement } from '@hint/utils-dom';
import { FetchEnd, HintContext, IHint, NetworkData, Response } from 'hint';

import { CompressionCheckOptions } from './types';
Expand Down
1 change: 1 addition & 0 deletions packages/hint-http-compression/tsconfig.json
Expand Up @@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-image-optimization-cloudinary/package.json
Expand Up @@ -17,6 +17,7 @@
},
"description": "hint that that checks using Cloudinary's API if images are optimized",
"devDependencies": {
"@hint/utils-dom": "^1.0.0",
"@hint/utils-tests-helpers": "^5.1.0",
"@types/mock-require": "^2.0.0",
"@types/node": "^12.7.5",
Expand Down
@@ -1,5 +1,5 @@
/* eslint-disable camelcase */
import { HTMLElement } from '@hint/utils/dist/src/dom/html';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';

export type cloudinaryResult = {
bytes: number;
Expand Down
1 change: 1 addition & 0 deletions packages/hint-image-optimization-cloudinary/tsconfig.json
Expand Up @@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-i18n" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
Expand Down
1 change: 1 addition & 0 deletions packages/hint-meta-theme-color/package.json
Expand Up @@ -16,6 +16,7 @@
},
"description": "hint for best practices related to the 'theme-color' meta tag",
"devDependencies": {
"@hint/utils-dom": "^1.0.0",
"@hint/utils-tests-helpers": "^5.1.0",
"@types/color-string": "^1.5.0",
"@types/node": "^12.7.5",
Expand Down
3 changes: 2 additions & 1 deletion packages/hint-meta-theme-color/src/hint.ts
Expand Up @@ -17,7 +17,8 @@ import {
IHint,
TraverseEnd
} from 'hint';
import { HTMLElement, normalizeString } from '@hint/utils';
import { normalizeString } from '@hint/utils';
import { HTMLElement } from '@hint/utils-dom/dist/src/htmlelement';
import { isSupported } from '@hint/utils-compat-data';

import meta from './meta';
Expand Down

0 comments on commit d95dc4a

Please sign in to comment.