Skip to content
Permalink
Browse files

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

  • Loading branch information
sarvaje committed Nov 4, 2019
1 parent 9adaff1 commit 5ed37ce719dfed3c78619f1717450a04b25644d4
Showing with 186 additions and 102 deletions.
  1. +1 βˆ’0 packages/connector-jsdom/package.json
  2. +1 βˆ’1 packages/connector-jsdom/src/before-parse.ts
  3. +1 βˆ’0 packages/connector-jsdom/tsconfig.json
  4. +1 βˆ’0 packages/connector-local/package.json
  5. +7 βˆ’5 packages/connector-local/src/connector.ts
  6. +5 βˆ’5 packages/connector-local/tests/tests.ts
  7. +1 βˆ’0 packages/connector-local/tsconfig.json
  8. +1 βˆ’0 packages/connector-puppeteer/package.json
  9. +1 βˆ’1 packages/connector-puppeteer/src/lib/lifecycle.ts
  10. +1 βˆ’0 packages/connector-puppeteer/tsconfig.json
  11. +1 βˆ’0 packages/create-hint/package.json
  12. +6 βˆ’4 packages/create-hint/src/create-hint.ts
  13. +1 βˆ’1 packages/create-hint/src/handlebars-utils.ts
  14. +4 βˆ’4 packages/create-hint/tests/create-hint.ts
  15. +1 βˆ’0 packages/create-hint/tsconfig.json
  16. +1 βˆ’0 packages/create-hintrc/package.json
  17. +1 βˆ’1 packages/create-hintrc/src/create-hintrc.ts
  18. +0 βˆ’1 packages/create-hintrc/tests/create-hintrc.ts
  19. +2 βˆ’1 packages/create-hintrc/tsconfig.json
  20. +3 βˆ’1 packages/create-parser/package.json
  21. +1 βˆ’1 packages/create-parser/src/handlebars-utils.ts
  22. +2 βˆ’2 packages/create-parser/src/new-parser.ts
  23. +3 βˆ’0 packages/create-parser/tests/new-parser.ts
  24. +2 βˆ’1 packages/create-parser/tsconfig.json
  25. +1 βˆ’0 packages/extension-browser/package.json
  26. +2 βˆ’1 packages/extension-browser/tests/devtools.ts
  27. +1 βˆ’1 packages/extension-browser/tests/helpers/host-ui.ts
  28. +1 βˆ’0 packages/extension-browser/tsconfig.json
  29. +1 βˆ’0 packages/formatter-codeframe/package.json
  30. +2 βˆ’1 packages/formatter-codeframe/src/formatter.ts
  31. +3 βˆ’4 packages/formatter-codeframe/tests/tests.ts
  32. +1 βˆ’0 packages/formatter-codeframe/tsconfig.json
  33. +1 βˆ’0 packages/formatter-excel/package.json
  34. +2 βˆ’1 packages/formatter-excel/src/formatter.ts
  35. +1 βˆ’0 packages/formatter-excel/tsconfig.json
  36. +1 βˆ’0 packages/formatter-html/package.json
  37. +2 βˆ’1 packages/formatter-html/src/formatter.ts
  38. +1 βˆ’1 packages/formatter-html/src/result.ts
  39. +1 βˆ’0 packages/formatter-html/tsconfig.json
  40. +1 βˆ’0 packages/formatter-json/package.json
  41. +2 βˆ’1 packages/formatter-json/src/formatter.ts
  42. +2 βˆ’4 packages/formatter-json/tests/tests.ts
  43. +1 βˆ’0 packages/formatter-json/tsconfig.json
  44. +1 βˆ’0 packages/formatter-stylish/package.json
  45. +2 βˆ’1 packages/formatter-stylish/src/formatter.ts
  46. +3 βˆ’3 packages/formatter-stylish/tests/tests.ts
  47. +1 βˆ’0 packages/formatter-stylish/tsconfig.json
  48. +1 βˆ’0 packages/formatter-summary/package.json
  49. +2 βˆ’1 packages/formatter-summary/src/formatter.ts
  50. +2 βˆ’4 packages/formatter-summary/tests/tests.ts
  51. +1 βˆ’0 packages/formatter-summary/tsconfig.json
  52. +1 βˆ’0 packages/hint-amp-validator/package.json
  53. +2 βˆ’1 packages/hint-amp-validator/tests/tests.ts
  54. +1 βˆ’0 packages/hint-amp-validator/tsconfig.json
  55. +1 βˆ’0 packages/hint-axe/package.json
  56. +1 βˆ’1 packages/hint-axe/src/util/axe.ts
  57. +1 βˆ’0 packages/hint-axe/tsconfig.json
  58. +1 βˆ’0 packages/hint-compat-api/package.json
  59. +2 βˆ’1 packages/hint-compat-api/tests/css.ts
  60. +2 βˆ’1 packages/hint-compat-api/tests/html.ts
  61. +1 βˆ’0 packages/hint-compat-api/tsconfig.json
  62. +1 βˆ’0 packages/hint-create-element-svg/package.json
  63. +2 βˆ’1 packages/hint-create-element-svg/tests/tests.ts
  64. +1 βˆ’0 packages/hint-create-element-svg/tsconfig.json
  65. +1 βˆ’0 packages/hint-css-prefix-order/package.json
  66. +2 βˆ’1 packages/hint-css-prefix-order/tests/tests.ts
  67. +1 βˆ’0 packages/hint-css-prefix-order/tsconfig.json
  68. +1 βˆ’0 packages/hint-manifest-file-extension/package.json
  69. +1 βˆ’1 packages/hint-manifest-file-extension/src/hint.ts
  70. +1 βˆ’0 packages/hint-manifest-file-extension/tsconfig.json
  71. +1 βˆ’0 packages/hint-no-vulnerable-javascript-libraries/package.json
  72. +2 βˆ’2 packages/hint-no-vulnerable-javascript-libraries/src/hint.ts
  73. +1 βˆ’0 packages/hint-no-vulnerable-javascript-libraries/tsconfig.json
  74. +1 βˆ’0 packages/hint-performance-budget/package.json
  75. +1 βˆ’1 packages/hint-performance-budget/src/connections.ts
  76. +1 βˆ’0 packages/hint-performance-budget/tsconfig.json
  77. +1 βˆ’0 packages/hint-scoped-svg-styles/package.json
  78. +2 βˆ’1 packages/hint-scoped-svg-styles/tests/hint.ts
  79. +1 βˆ’0 packages/hint-scoped-svg-styles/tsconfig.json
  80. +1 βˆ’0 packages/hint-sri/package.json
  81. +2 βˆ’1 packages/hint-sri/tests/tests-http.ts
  82. +2 βˆ’1 packages/hint-sri/tests/tests-https.ts
  83. +1 βˆ’0 packages/hint-sri/tsconfig.json
  84. +1 βˆ’0 packages/hint-summary-display/package.json
  85. +2 βˆ’1 packages/hint-summary-display/tests/tests.ts
  86. +1 βˆ’0 packages/hint-summary-display/tsconfig.json
  87. +1 βˆ’0 packages/hint-webpack-config/package.json
  88. +2 βˆ’1 packages/hint-webpack-config/tests/is-installed.ts
  89. +2 βˆ’1 packages/hint-webpack-config/tests/module-esnext-typescript.ts
  90. +2 βˆ’1 packages/hint-webpack-config/tests/modules-false-babel.ts
  91. +2 βˆ’1 packages/hint-webpack-config/tests/no-devtool-in-prod.ts
  92. +1 βˆ’0 packages/hint-webpack-config/tsconfig.json
  93. +1 βˆ’0 packages/hint/package.json
  94. +4 βˆ’2 packages/hint/src/lib/analyzer.ts
  95. +1 βˆ’1 packages/hint/src/lib/cli/analyze.ts
  96. +3 βˆ’3 packages/hint/src/lib/config.ts
  97. +1 βˆ’1 packages/hint/src/lib/types/parser.ts
  98. +1 βˆ’1 packages/hint/src/lib/utils/resource-loader.ts
  99. +4 βˆ’2 packages/hint/tests/lib/analyzer.ts
  100. +1 βˆ’1 packages/hint/tests/lib/config.ts
  101. +1 βˆ’1 packages/hint/tests/lib/types/parser.ts
  102. +0 βˆ’1 packages/hint/tests/lib/utils/resource-loader.ts
  103. +1 βˆ’0 packages/hint/tsconfig.json
  104. +1 βˆ’1 packages/parser-babel-config/package.json
  105. +1 βˆ’1 packages/parser-babel-config/src/parser.ts
  106. +1 βˆ’1 packages/parser-babel-config/tests/tests.ts
  107. +1 βˆ’1 packages/parser-babel-config/tsconfig.json
  108. +1 βˆ’0 packages/parser-package-json/package.json
  109. +1 βˆ’1 packages/parser-package-json/src/parser.ts
  110. +1 βˆ’1 packages/parser-package-json/tests/tests.ts
  111. +1 βˆ’0 packages/parser-package-json/tsconfig.json
  112. +1 βˆ’0 packages/parser-typescript-config/package.json
  113. +1 βˆ’1 packages/parser-typescript-config/src/parser.ts
  114. +6 βˆ’5 packages/parser-typescript-config/tests/tests.ts
  115. +1 βˆ’0 packages/parser-typescript-config/tsconfig.json
  116. +1 βˆ’0 packages/utils-network/package.json
  117. +3 βˆ’3 packages/utils-network/src/as-uri.ts
  118. +1 βˆ’0 packages/utils-network/tsconfig.json
  119. +1 βˆ’1 packages/utils-tests-helpers/package.json
  120. +1 βˆ’1 packages/utils-tests-helpers/src/hint-runner.ts
  121. +1 βˆ’1 packages/utils-tests-helpers/tsconfig.json
@@ -12,6 +12,7 @@
"@hint/utils-connector-tools": "^4.0.14",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"@types/tough-cookie": "^2.3.5",
@@ -8,7 +8,7 @@ import * as path from 'path';
import { DOMWindow } from 'jsdom';

import * as jsdomutils from 'jsdom/lib/jsdom/living/generated/utils';
import { readFile } from '@hint/utils';
import { readFile } from '@hint/utils-fs';

export const beforeParse = (finalHref: string) => {
return (window: DOMWindow) => {
@@ -20,6 +20,7 @@
{ "path": "../utils-create-server" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-fs" },
{ "path": "../utils-network" },
{ "path": "../utils-types" }
]
@@ -10,6 +10,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"chokidar": "^3.2.3",
@@ -46,15 +46,17 @@ import * as globby from 'globby';
import { JSDOM } from 'jsdom';

import {
cwd,
getContentTypeData,
getType,
isFile,
isTextMediaType,
logger,
readFileAsync
logger
} from '@hint/utils';
import { asPathString, getAsUri} from '@hint/utils-network';
import {
cwd,
isFile,
readFileAsync
} from '@hint/utils-fs';
import { asPathString, getAsUri } from '@hint/utils-network';
import {
HTMLDocument,
HTMLElement,
@@ -9,10 +9,10 @@ import { EventEmitter2 } from 'eventemitter2';

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

@@ -54,10 +54,10 @@ const mockContext = (context: SandboxContext) => {
const isFileStub = context.sandbox.stub(fsMocks, 'isFile');

const script = proxyquire('../src/connector', {
'@hint/utils': {
'@hint/utils': { logger },
'@hint/utils-fs': {
cwd: cwdStub,
isFile: isFileStub,
logger,
readFileAsync
},
chokidar
@@ -17,6 +17,7 @@
{ "path": "../parser-html" },
{ "path": "../utils" },
{ "path": "../utils-dom" },
{ "path": "../utils-fs" },
{ "path": "../utils-i18n" },
{ "path": "../utils-network" }
]
@@ -12,6 +12,7 @@
"@hint/utils-connector-tools": "^4.0.14",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-network": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"is-ci": "^2.0.0",
@@ -6,7 +6,7 @@ import { spawn } from 'child_process';
import * as locker from 'lockfile';
import * as puppeteer from 'puppeteer-core';

import { readFileAsync, writeFileAsync } from '@hint/utils';
import { readFileAsync, writeFileAsync } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';
import { LaunchOptions } from 'puppeteer-core';

@@ -20,6 +20,7 @@
{ "path": "../utils-create-server" },
{ "path": "../utils-debug" },
{ "path": "../utils-dom" },
{ "path": "../utils-fs" },
{ "path": "../utils-network" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"create-hint": "./dist/src/create-hint.js"
},
"dependencies": {
"@hint/utils-fs": "^1.0.0",
"@hint/utils-types": "^1.0.0"
},
"description": "webhint's hint initializer package",
@@ -6,15 +6,17 @@ import * as inquirer from 'inquirer';
import * as mkdirp from 'mkdirp';

import {
cwd,
logger,
isOfficial,
normalizeStringByDelimiter,
readFile,
toCamelCase,
toPascalCase,
writeFileAsync
toPascalCase
} from '@hint/utils';
import {
cwd,
readFile,
writeFileAsync
} from '@hint/utils-fs';
import { Category } from '@hint/utils-types';
import { HintScope } from 'hint';

@@ -1,5 +1,5 @@
import * as Handlebars from 'handlebars';
import { readFileAsync } from '@hint/utils';
import { readFileAsync } from '@hint/utils-fs';
import { loadCreateHintPackage } from './utils';

const pkg = loadCreateHintPackage();
@@ -4,7 +4,7 @@ import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
import anyTest, { TestInterface, ExecutionContext } from 'ava';

import * as utils from '@hint/utils';
import * as utilsFs from '@hint/utils-fs';

import * as handlebarsUtils from '../src/handlebars-utils';

@@ -69,10 +69,10 @@ const initContext = (t: ExecutionContext<CreateHintContext>) => {
const loadScript = (context: CreateHintContext) => {
const script = proxyquire('../src/create-hint', {
'../src/handlebars-utils': context.handlebarsUtils,
'@hint/utils': {
'@hint/utils': { isOfficial: context.isOfficialModule },
'@hint/utils-fs': {
cwd: context.cwd,
isOfficial: context.isOfficialModule,
readFile: utils.readFile,
readFile: utilsFs.readFile,
writeFileAsync: context.writeFileAsyncModule
},
'fs-extra': context.fsExtra,
@@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-fs" },
{ "path": "../utils-tests-helpers" },
{ "path": "../utils-types" }
]
@@ -13,6 +13,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"browserslist": "^4.7.2",
"inquirer": "^7.0.0"
},
@@ -17,12 +17,12 @@ import * as inquirer from 'inquirer';
import { ResourceType, UserConfig, utils } from 'hint';
import {
appInsights,
cwd,
getOfficialPackages,
installPackages,
logger,
NpmPackage
} from '@hint/utils';
import { cwd } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';

import { generateBrowserslistConfig } from './browserslist';
@@ -86,7 +86,6 @@ const loadScript = (context: CreateHintRCContext): () => Promise<boolean> => {
sendPendingData() { },
trackEvent() { }
},
cwd: utils.cwd,
getOfficialPackages: context.npm.getOfficialPackages,
installPackages: context.npm.installPackages,
logger: context.logger
@@ -15,6 +15,7 @@
"references": [
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-debug" }
{ "path": "../utils-debug" },
{ "path": "../utils-fs" }
]
}
@@ -10,7 +10,9 @@
"bin": {
"create-parser": "./dist/src/create-parser.js"
},
"dependencies": {},
"dependencies": {
"@hint/utils-fs": "^1.0.0"
},
"description": "webhint's parser initializer package",
"devDependencies": {
"@hint/utils": "^6.1.0",
@@ -1,6 +1,6 @@
import * as Handlebars from 'handlebars';

import { readFileAsync } from '@hint/utils';
import { readFileAsync } from '@hint/utils-fs';
import { utils } from 'hint';

const { packages: { loadHintPackage } } = utils;
@@ -9,9 +9,9 @@ import {
appInsights,
isOfficial,
logger,
normalizeStringByDelimiter,
writeFileAsync
normalizeStringByDelimiter
} from '@hint/utils';
import { writeFileAsync } from '@hint/utils-fs';

import { escapeSafeString, compileTemplate } from './handlebars-utils';

@@ -82,6 +82,9 @@ const loadScript = (context: NewParserContext) => {
},
isOfficial: context.isOfficial,
normalizeStringByDelimiter: context.normalizeStringByDelimiter,

},
'@hint/utils-fs': {
readFileAsync: context.readFileAsync,
writeFileAsync: context.writeFileAsync
},
@@ -14,6 +14,7 @@
],
"references": [
{ "path": "../hint" },
{ "path": "../utils" }
{ "path": "../utils" },
{ "path": "../utils-fs" }
]
}
@@ -44,6 +44,7 @@
"@hint/utils": "^6.1.0",
"@hint/utils-create-server": "^3.3.0",
"@hint/utils-dom": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"@microsoft/applicationinsights-web-basic": "^2.2.0",
@@ -4,7 +4,8 @@ import test from 'ava';

import { Category } from '@hint/utils-types';

import { getInstallationPath, readFileAsync } from '@hint/utils';
import { getInstallationPath } from '@hint/utils';
import { readFileAsync } from '@hint/utils-fs';
import { Server } from '@hint/utils-create-server';

import { Events, InjectDetails, Results } from '../src/shared/types';
@@ -1,6 +1,6 @@
import * as path from 'path';

import { readFileAsync } from '@hint/utils';
import { readFileAsync } from '@hint/utils-fs';
import { IServer, Server, ServerConfiguration } from '@hint/utils-create-server';

import { Page, Props as AppProps } from '../../src/devtools/views/app';
@@ -48,6 +48,7 @@
{ "path": "../utils" },
{ "path": "../utils-create-server" },
{ "path": "../utils-dom" },
{ "path": "../utils-fs" },
{ "path": "../utils-i18n" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"chalk": "^2.4.2",
@@ -18,7 +18,8 @@ import sortBy = require('lodash/sortBy');
import * as logSymbols from 'log-symbols';
const stripAnsi = require('strip-ansi');

import { cutString, logger, writeFileAsync } from '@hint/utils';
import { cutString, logger } from '@hint/utils';
import { writeFileAsync } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';
import { FormatterOptions, IFormatter } from 'hint';
import { Problem, ProblemLocation, Severity } from '@hint/utils-types';
@@ -35,10 +35,9 @@ const loadScript = (context: CodeframeContext) => {
const script = proxyquire('../src/formatter', {
'@hint/utils': {
cutString: utils.cutString,
fs: { },
logger: context.logging,
writeFileAsync: context.writeFileAsync
}
logger: context.logging
},
'@hint/utils-fs': { writeFileAsync: context.writeFileAsync }
});

return script.default;
@@ -16,6 +16,7 @@
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-fs" },
{ "path": "../utils-i18n" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"exceljs": "3.0.0",
@@ -16,7 +16,8 @@ import forEach = require('lodash/forEach');
import groupBy = require('lodash/groupBy');
import sortBy = require('lodash/sortBy');

import { cwd, logger } from '@hint/utils';
import { logger } from '@hint/utils';
import { cwd } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';
import { FormatterOptions, IFormatter } from 'hint';
import { Problem } from '@hint/utils-types';
@@ -16,6 +16,7 @@
{ "path": "../hint" },
{ "path": "../utils" },
{ "path": "../utils-debug" },
{ "path": "../utils-fs" },
{ "path": "../utils-i18n" },
{ "path": "../utils-types" }
]
@@ -11,6 +11,7 @@
"dependencies": {
"@hint/utils": "^6.1.0",
"@hint/utils-debug": "^1.0.0",
"@hint/utils-fs": "^1.0.0",
"@hint/utils-i18n": "^1.0.0",
"@hint/utils-types": "^1.0.0",
"ejs": "^2.7.1",
@@ -14,7 +14,8 @@ import * as ejs from 'ejs';
import * as fs from 'fs-extra';

import { Category, Problem } from '@hint/utils-types';
import { cwd, logger } from '@hint/utils';
import { logger } from '@hint/utils';
import { cwd } from '@hint/utils-fs';
import { debug as d } from '@hint/utils-debug';
import { FormatterOptions, HintResources, IFormatter } from 'hint';

@@ -5,7 +5,7 @@ import * as moment from 'moment';
import cloneDeep = require('lodash/cloneDeep');

import { Category, Problem, Severity } from '@hint/utils-types';
import { loadJSONFile } from '@hint/utils';
import { loadJSONFile } from '@hint/utils-fs';
import { getCategoryName } from '@hint/utils-i18n';
import { FormatterOptions } from 'hint';

0 comments on commit 5ed37ce

Please sign in to comment.
You can’t perform that action at this time.