From 0405bcf9c893d5fa967ccfd9668aa8c6c3e9f2c5 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Mon, 1 Nov 2021 17:53:12 -0700 Subject: [PATCH 1/2] misc: rename lighthouse-cli to cli --- .eslintignore | 2 +- .eslintrc.js | 2 +- .gitignore | 2 +- .npmignore | 8 ++++---- CONTRIBUTING.md | 4 ++-- build/build-lightrider-bundles.js | 2 +- build/build-smokehouse-bundle.js | 4 ++-- {lighthouse-cli => cli}/.eslintrc.cjs | 0 {lighthouse-cli => cli}/bin.js | 0 {lighthouse-cli => cli}/cli-flags.js | 0 {lighthouse-cli => cli}/commands/commands.js | 0 .../commands/list-audits.js | 0 .../commands/list-locales.js | 0 .../commands/list-trace-categories.js | 0 {lighthouse-cli => cli}/index.js | 0 {lighthouse-cli => cli}/package.json | 0 {lighthouse-cli => cli}/printer.js | 0 {lighthouse-cli => cli}/run.js | 0 {lighthouse-cli => cli}/sentry-prompt.js | 0 .../test/cli/__snapshots__/index-test.js.snap | 0 {lighthouse-cli => cli}/test/cli/bin-test.js | 6 +++--- .../test/cli/cli-flags-test.js | 4 ++-- .../test/cli/index-test.js | 4 ++-- .../test/cli/printer-test.js | 0 {lighthouse-cli => cli}/test/cli/run-test.js | 0 .../test/fixtures/a11y/a11y_tester.html | 0 .../test/fixtures/badssl-iframe.html | 0 .../test/fixtures/byte-efficiency/bundle.js | 0 .../fixtures/byte-efficiency/bundle.js.map | 0 .../test/fixtures/byte-efficiency/gzip.html | 0 .../test/fixtures/byte-efficiency/large.svg | 0 .../byte-efficiency/lighthouse-1024x680.jpg | Bin .../byte-efficiency/lighthouse-2048x1356.webp | Bin .../lighthouse-320x212-poor.jpg | Bin .../byte-efficiency/lighthouse-480x320.jpg | Bin .../byte-efficiency/lighthouse-480x320.webp | Bin .../lighthouse-unoptimized.jpg | Bin .../test/fixtures/byte-efficiency/script.js | 0 .../test/fixtures/byte-efficiency/tester.html | 0 .../test/fixtures/cli-flags-path.json | 0 .../test/fixtures/csp.html | 0 .../test/fixtures/debugger.html | 0 .../test/fixtures/delayed-fcp.html | 0 .../test/fixtures/delayed-lcp.html | 0 .../fixtures/dobetterweb/dbw_disabled.css | 0 .../test/fixtures/dobetterweb/dbw_tester.css | 0 .../test/fixtures/dobetterweb/dbw_tester.html | 0 .../test/fixtures/dobetterweb/dbw_tester.js | 0 .../test/fixtures/dobetterweb/empty.css | 0 .../test/fixtures/dobetterweb/empty_module.js | 0 .../dobetterweb/lighthouse-480x318.jpg | Bin .../dobetterweb/lighthouse-rotating.gif | Bin .../aggressive-promise-polyfill.js | 0 .../test/fixtures/extra-headers/invalid.txt | 0 .../test/fixtures/extra-headers/valid.json | 0 .../test/fixtures/form.html | 0 .../test/fixtures/infinite-loop.html | 0 .../test/fixtures/js-redirect.html | 0 .../test/fixtures/lantern-data.json | 0 .../test/fixtures/launcher-icon-100x100.png | Bin .../test/fixtures/launcher-icon-4x.png | Bin .../test/fixtures/legacy-javascript.html | 0 .../test/fixtures/legacy-javascript.js | 0 .../test/fixtures/manifest.json | 0 .../test/fixtures/offline-ready-sw.js | 0 .../test/fixtures/offline-ready.html | 0 .../test/fixtures/online-only.html | 0 .../test/fixtures/oopif.html | 0 .../test/fixtures/perf/animations.html | 0 .../test/fixtures/perf/cors-fonts.css | 0 .../test/fixtures/perf/debug.html | 0 .../test/fixtures/perf/delayed-element.js | 0 .../test/fixtures/perf/fonts.html | 0 .../fixtures/perf/frame-metrics-inner.html | 0 .../test/fixtures/perf/frame-metrics.html | 0 .../test/fixtures/perf/level-2.js | 0 .../test/fixtures/perf/level-3.js | 0 .../perf/lobster-two-v10-latin-700.woff2 | Bin .../perf/lobster-v20-latin-regular.woff2 | Bin .../fixtures/perf/perf-budgets/big-script.js | 0 .../perf/perf-budgets/load-things.html | 0 .../test/fixtures/perf/preload_style.css | 0 .../test/fixtures/perf/preload_tester.js | 0 .../test/fixtures/perf/third-party.html | 0 .../test/fixtures/perf/trace-elements.html | 0 .../test/fixtures/perf/unsized-images.html | 0 .../test/fixtures/preload.html | 0 .../test/fixtures/redirects-final.html | 0 .../test/fixtures/ric-shim.html | 0 .../test/fixtures/robots.txt | 0 .../test/fixtures/screenshot.gif | Bin .../test/fixtures/screenshot.html | 0 .../test/fixtures/seo/seo-failure-cases.html | 0 .../test/fixtures/seo/seo-tap-targets.html | 0 .../test/fixtures/seo/seo-tester-styles.css | 0 .../test/fixtures/seo/seo-tester.html | 0 .../test/fixtures/source-map/script.js.map | 0 .../source-map/source-map-tester.html | 0 .../test/fixtures/static-server-test.js | 0 .../test/fixtures/static-server.js | 2 +- .../fixtures/tricky-main-thread-consumer.js | 0 .../fixtures/tricky-main-thread-library.js | 0 .../test/fixtures/tricky-main-thread.html | 0 .../test/fixtures/tricky-tti-late-fcp.html | 0 .../test/fixtures/tricky-tti.html | 0 .../smokehouse/frontends/back-compat-util.js | 0 .../test/smokehouse/frontends/lib.js | 0 .../test/smokehouse/frontends/node.js | 0 .../smokehouse/frontends/smokehouse-bin.js | 2 +- .../smokehouse/lib/child-process-error.js | 0 .../test/smokehouse/lib/concurrent-mapper.js | 0 .../test/smokehouse/lib/local-console.js | 0 .../smokehouse/lighthouse-runners/bundle.js | 0 .../test/smokehouse/lighthouse-runners/cli.js | 2 +- .../test/smokehouse/readme.md | 2 +- .../test/smokehouse/report-assert.js | 0 .../test/smokehouse/smokehouse.js | 0 .../test-definitions/a11y/a11y-config.js | 0 .../test-definitions/a11y/expectations.js | 0 .../byte-efficiency/byte-config.js | 0 .../byte-efficiency/expectations.js | 0 .../smokehouse/test-definitions/core-tests.js | 0 .../test-definitions/csp/csp-config.js | 0 .../test-definitions/csp/csp-expectations.js | 0 .../dobetterweb/dbw-config.js | 0 .../dobetterweb/dbw-expectations.js | 0 .../test-definitions/errors/error-config.js | 0 .../errors/error-expectations.js | 0 .../test-definitions/forms/form-config.js | 0 .../forms/form-expectations.js | 0 .../issues/mixed-content-expectations.js | 0 .../lantern/lantern-config.js | 0 .../lantern/lantern-expectations.js | 0 .../legacy-javascript/expectations.js | 0 .../legacy-javascript-config.js | 0 .../offline-local/offline-config.js | 0 .../offline-local/offline-expectations.js | 0 .../test-definitions/oopif/oopif-config.js | 0 .../oopif/oopif-expectations.js | 0 .../perf-diagnostics/expectations.js | 0 .../perf-diagnostics-config.js | 0 .../test-definitions/perf/expectations.js | 0 .../test-definitions/perf/perf-config.js | 0 .../test-definitions/pubads/expectations.js | 0 .../test-definitions/pubads/pubads-config.js | 0 .../test-definitions/pwa/pwa-config.js | 0 .../pwa/pwa-expectations-details.js | 0 .../test-definitions/pwa/pwa-expectations.js | 0 .../test-definitions/pwa/pwa2-expectations.js | 0 .../test-definitions/pwa/pwa3-expectations.js | 0 .../redirects/expectations.js | 0 .../redirects/redirects-config.js | 0 .../screenshot/expectations.js | 0 .../screenshot/screenshot-config.js | 0 .../test-definitions/seo/expectations.js | 0 .../test-definitions/seo/seo-config.js | 0 .../source-maps/expectations.js | 2 +- .../source-maps/source-maps-config.js | 0 .../tricky-metrics/expectations.js | 0 .../tricky-metrics/no-throttling-config.js | 0 docs/hacking-tips.md | 2 +- docs/variability.md | 2 +- jest.config.js | 2 +- lighthouse-core/index.js | 2 +- .../scripts/assert-golden-lhr-unchanged.sh | 2 +- lighthouse-core/scripts/c8.sh | 2 +- lighthouse-core/scripts/compare-runs.js | 4 ++-- .../scripts/lantern/collect/collect.js | 2 +- .../scripts/release/package-test.sh | 2 +- .../scripts/update-report-fixtures.js | 6 +++--- .../fraggle-rock/scenarios/pptr-test-utils.js | 4 ++-- package.json | 18 +++++++++--------- readme.md | 6 +++--- treemap/test/treemap-test-pptr.js | 2 +- tsconfig.json | 6 +++--- viewer/test/viewer-test-pptr.js | 2 +- 176 files changed, 56 insertions(+), 56 deletions(-) rename {lighthouse-cli => cli}/.eslintrc.cjs (100%) rename {lighthouse-cli => cli}/bin.js (100%) rename {lighthouse-cli => cli}/cli-flags.js (100%) rename {lighthouse-cli => cli}/commands/commands.js (100%) rename {lighthouse-cli => cli}/commands/list-audits.js (100%) rename {lighthouse-cli => cli}/commands/list-locales.js (100%) rename {lighthouse-cli => cli}/commands/list-trace-categories.js (100%) rename {lighthouse-cli => cli}/index.js (100%) rename {lighthouse-cli => cli}/package.json (100%) rename {lighthouse-cli => cli}/printer.js (100%) rename {lighthouse-cli => cli}/run.js (100%) rename {lighthouse-cli => cli}/sentry-prompt.js (100%) rename {lighthouse-cli => cli}/test/cli/__snapshots__/index-test.js.snap (100%) rename {lighthouse-cli => cli}/test/cli/bin-test.js (96%) rename {lighthouse-cli => cli}/test/cli/cli-flags-test.js (97%) rename {lighthouse-cli => cli}/test/cli/index-test.js (97%) rename {lighthouse-cli => cli}/test/cli/printer-test.js (100%) rename {lighthouse-cli => cli}/test/cli/run-test.js (100%) rename {lighthouse-cli => cli}/test/fixtures/a11y/a11y_tester.html (100%) rename {lighthouse-cli => cli}/test/fixtures/badssl-iframe.html (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/bundle.js (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/bundle.js.map (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/gzip.html (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/large.svg (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/lighthouse-1024x680.jpg (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/lighthouse-2048x1356.webp (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/lighthouse-320x212-poor.jpg (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/lighthouse-480x320.jpg (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/lighthouse-480x320.webp (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/lighthouse-unoptimized.jpg (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/script.js (100%) rename {lighthouse-cli => cli}/test/fixtures/byte-efficiency/tester.html (100%) rename {lighthouse-cli => cli}/test/fixtures/cli-flags-path.json (100%) rename {lighthouse-cli => cli}/test/fixtures/csp.html (100%) rename {lighthouse-cli => cli}/test/fixtures/debugger.html (100%) rename {lighthouse-cli => cli}/test/fixtures/delayed-fcp.html (100%) rename {lighthouse-cli => cli}/test/fixtures/delayed-lcp.html (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/dbw_disabled.css (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/dbw_tester.css (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/dbw_tester.html (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/dbw_tester.js (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/empty.css (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/empty_module.js (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/lighthouse-480x318.jpg (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/lighthouse-rotating.gif (100%) rename {lighthouse-cli => cli}/test/fixtures/dobetterweb/third_party/aggressive-promise-polyfill.js (100%) rename {lighthouse-cli => cli}/test/fixtures/extra-headers/invalid.txt (100%) rename {lighthouse-cli => cli}/test/fixtures/extra-headers/valid.json (100%) rename {lighthouse-cli => cli}/test/fixtures/form.html (100%) rename {lighthouse-cli => cli}/test/fixtures/infinite-loop.html (100%) rename {lighthouse-cli => cli}/test/fixtures/js-redirect.html (100%) rename {lighthouse-cli => cli}/test/fixtures/lantern-data.json (100%) rename {lighthouse-cli => cli}/test/fixtures/launcher-icon-100x100.png (100%) rename {lighthouse-cli => cli}/test/fixtures/launcher-icon-4x.png (100%) rename {lighthouse-cli => cli}/test/fixtures/legacy-javascript.html (100%) rename {lighthouse-cli => cli}/test/fixtures/legacy-javascript.js (100%) rename {lighthouse-cli => cli}/test/fixtures/manifest.json (100%) rename {lighthouse-cli => cli}/test/fixtures/offline-ready-sw.js (100%) rename {lighthouse-cli => cli}/test/fixtures/offline-ready.html (100%) rename {lighthouse-cli => cli}/test/fixtures/online-only.html (100%) rename {lighthouse-cli => cli}/test/fixtures/oopif.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/animations.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/cors-fonts.css (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/debug.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/delayed-element.js (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/fonts.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/frame-metrics-inner.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/frame-metrics.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/level-2.js (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/level-3.js (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/lobster-two-v10-latin-700.woff2 (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/lobster-v20-latin-regular.woff2 (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/perf-budgets/big-script.js (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/perf-budgets/load-things.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/preload_style.css (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/preload_tester.js (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/third-party.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/trace-elements.html (100%) rename {lighthouse-cli => cli}/test/fixtures/perf/unsized-images.html (100%) rename {lighthouse-cli => cli}/test/fixtures/preload.html (100%) rename {lighthouse-cli => cli}/test/fixtures/redirects-final.html (100%) rename {lighthouse-cli => cli}/test/fixtures/ric-shim.html (100%) rename {lighthouse-cli => cli}/test/fixtures/robots.txt (100%) rename {lighthouse-cli => cli}/test/fixtures/screenshot.gif (100%) rename {lighthouse-cli => cli}/test/fixtures/screenshot.html (100%) rename {lighthouse-cli => cli}/test/fixtures/seo/seo-failure-cases.html (100%) rename {lighthouse-cli => cli}/test/fixtures/seo/seo-tap-targets.html (100%) rename {lighthouse-cli => cli}/test/fixtures/seo/seo-tester-styles.css (100%) rename {lighthouse-cli => cli}/test/fixtures/seo/seo-tester.html (100%) rename {lighthouse-cli => cli}/test/fixtures/source-map/script.js.map (100%) rename {lighthouse-cli => cli}/test/fixtures/source-map/source-map-tester.html (100%) rename {lighthouse-cli => cli}/test/fixtures/static-server-test.js (100%) rename {lighthouse-cli => cli}/test/fixtures/static-server.js (99%) rename {lighthouse-cli => cli}/test/fixtures/tricky-main-thread-consumer.js (100%) rename {lighthouse-cli => cli}/test/fixtures/tricky-main-thread-library.js (100%) rename {lighthouse-cli => cli}/test/fixtures/tricky-main-thread.html (100%) rename {lighthouse-cli => cli}/test/fixtures/tricky-tti-late-fcp.html (100%) rename {lighthouse-cli => cli}/test/fixtures/tricky-tti.html (100%) rename {lighthouse-cli => cli}/test/smokehouse/frontends/back-compat-util.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/frontends/lib.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/frontends/node.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/frontends/smokehouse-bin.js (99%) rename {lighthouse-cli => cli}/test/smokehouse/lib/child-process-error.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/lib/concurrent-mapper.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/lib/local-console.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/lighthouse-runners/bundle.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/lighthouse-runners/cli.js (99%) rename {lighthouse-cli => cli}/test/smokehouse/readme.md (99%) rename {lighthouse-cli => cli}/test/smokehouse/report-assert.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/smokehouse.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/a11y/a11y-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/a11y/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/byte-efficiency/byte-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/byte-efficiency/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/core-tests.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/csp/csp-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/csp/csp-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/dobetterweb/dbw-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/errors/error-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/errors/error-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/forms/form-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/forms/form-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/issues/mixed-content-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/lantern/lantern-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/lantern/lantern-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/legacy-javascript/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/legacy-javascript/legacy-javascript-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/offline-local/offline-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/offline-local/offline-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/oopif/oopif-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/oopif/oopif-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/perf-diagnostics/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/perf-diagnostics/perf-diagnostics-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/perf/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/perf/perf-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pubads/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pubads/pubads-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pwa/pwa-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pwa/pwa-expectations-details.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pwa/pwa-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pwa/pwa2-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/pwa/pwa3-expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/redirects/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/redirects/redirects-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/screenshot/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/screenshot/screenshot-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/seo/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/seo/seo-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/source-maps/expectations.js (94%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/source-maps/source-maps-config.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/tricky-metrics/expectations.js (100%) rename {lighthouse-cli => cli}/test/smokehouse/test-definitions/tricky-metrics/no-throttling-config.js (100%) diff --git a/.eslintignore b/.eslintignore index 1d3d4b8a6b80..6c965b9572e8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,7 +2,7 @@ **/third_party/** **/source-maps/** -lighthouse-cli/test/fixtures/byte-efficiency/bundle.js +cli/test/fixtures/byte-efficiency/bundle.js /dist/** diff --git a/.eslintrc.js b/.eslintrc.js index 336344813542..9fd927e3f92d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -80,7 +80,7 @@ module.exports = { }, overrides: [ { - files: ['lighthouse-cli/test/smokehouse/**/*expectations.js'], + files: ['cli/test/smokehouse/**/*expectations.js'], rules: { 'max-len': 0, }, diff --git a/.gitignore b/.gitignore index 7efee4c5cc93..3919c1b18653 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ lcov.info .nyc_output *.lcov -lighthouse-cli/results +cli/results results.html last-run-results.html diff --git a/.npmignore b/.npmignore index b6f2c9c348ae..45fa4e82966c 100644 --- a/.npmignore +++ b/.npmignore @@ -16,7 +16,7 @@ lighthouse-core/third_party/src/ viewer/ treemap/ clients/ -lighthouse-cli/results/ +cli/results/ lighthouse-logger/ # keep a few scripts useful for CI @@ -25,9 +25,9 @@ lighthouse-logger/ # Exclude the CLI smoketests but keep the smoketest runner that is used # by downstream projects (e.g. publisher ads). -lighthouse-cli/test/* -!lighthouse-cli/test/smokehouse/ -lighthouse-cli/test/smokehouse/test-definitions/ +cli/test/* +!cli/test/smokehouse/ +cli/test/smokehouse/test-definitions/ results/ lantern-data/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a0d2b8f534a..480a39a9b0fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ A PR for a new audit or changing an existing audit almost always needs the follo 1. **Unit tests**: in the matching test file (e.g. tests for `lighthouse-core/audits/my-swell-audit.js` go in `lighthouse-core/test/audits/my-swell-audit-test.js`). -1. **Smoke (end-to-end) tests**: search through the [existing test expectations](lighthouse-cli/test/smokehouse/test-definitions/) to see if there's a logical place to add a check for your change, or (as a last resort) add a new smoke test. +1. **Smoke (end-to-end) tests**: search through the [existing test expectations](cli/test/smokehouse/test-definitions/) to see if there's a logical place to add a check for your change, or (as a last resort) add a new smoke test. 1. Run `yarn update:sample-json` to update the [sample Lighthouse result JSON](lighthouse-core/test/results/sample_v2.json) kept in the repo for testing. This will also pull any strings needed for localization into the correct files. @@ -74,7 +74,7 @@ A PR adding or changing a gatherer almost always needs to include the following: As a result, we mostly rely on smoke testing for gatherers. However, if there are parts of a gatherer that naturally lend themselves to unit testing, the new tests would go in the matching test file (e.g. tests for `lighthouse-core/gather/gatherers/reap.js` go in `lighthouse-core/test/gather/gatherers/reap-test.js`). -1. **Smoke (end-to-end) tests**: search through the [existing test expectations](lighthouse-cli/test/smokehouse/test-definitions/) to see if there's a logical place to add a check for your change, or (as a last resort) add a new smoke test if one is required. +1. **Smoke (end-to-end) tests**: search through the [existing test expectations](cli/test/smokehouse/test-definitions/) to see if there's a logical place to add a check for your change, or (as a last resort) add a new smoke test if one is required. It's most important to get true end-to-end coverage, so be sure that audits that consume the new gatherer output are in the expectations. Artifacts can also have expectations for those intermediate results. diff --git a/build/build-lightrider-bundles.js b/build/build-lightrider-bundles.js index 3fcf2ca760f3..d64744ebcb00 100644 --- a/build/build-lightrider-bundles.js +++ b/build/build-lightrider-bundles.js @@ -48,7 +48,7 @@ function buildReportGenerator() { async function buildStaticServerBundle() { const bundle = await rollup.rollup({ - input: 'lighthouse-cli/test/fixtures/static-server.js', + input: 'cli/test/fixtures/static-server.js', plugins: [ rollupPlugins.shim({ 'es-main': 'export default function() { return false; }', diff --git a/build/build-smokehouse-bundle.js b/build/build-smokehouse-bundle.js index 6b6dd492bed2..78c9973e65ed 100644 --- a/build/build-smokehouse-bundle.js +++ b/build/build-smokehouse-bundle.js @@ -11,8 +11,8 @@ const {LH_ROOT} = require('../root.js'); const distDir = `${LH_ROOT}/dist`; const bundleOutFile = `${distDir}/smokehouse-bundle.js`; -const smokehouseLibFilename = './lighthouse-cli/test/smokehouse/frontends/lib.js'; -const smokehouseCliFilename = `${LH_ROOT}/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js`; +const smokehouseLibFilename = './cli/test/smokehouse/frontends/lib.js'; +const smokehouseCliFilename = `${LH_ROOT}/cli/test/smokehouse/lighthouse-runners/cli.js`; async function build() { const bundle = await rollup.rollup({ diff --git a/lighthouse-cli/.eslintrc.cjs b/cli/.eslintrc.cjs similarity index 100% rename from lighthouse-cli/.eslintrc.cjs rename to cli/.eslintrc.cjs diff --git a/lighthouse-cli/bin.js b/cli/bin.js similarity index 100% rename from lighthouse-cli/bin.js rename to cli/bin.js diff --git a/lighthouse-cli/cli-flags.js b/cli/cli-flags.js similarity index 100% rename from lighthouse-cli/cli-flags.js rename to cli/cli-flags.js diff --git a/lighthouse-cli/commands/commands.js b/cli/commands/commands.js similarity index 100% rename from lighthouse-cli/commands/commands.js rename to cli/commands/commands.js diff --git a/lighthouse-cli/commands/list-audits.js b/cli/commands/list-audits.js similarity index 100% rename from lighthouse-cli/commands/list-audits.js rename to cli/commands/list-audits.js diff --git a/lighthouse-cli/commands/list-locales.js b/cli/commands/list-locales.js similarity index 100% rename from lighthouse-cli/commands/list-locales.js rename to cli/commands/list-locales.js diff --git a/lighthouse-cli/commands/list-trace-categories.js b/cli/commands/list-trace-categories.js similarity index 100% rename from lighthouse-cli/commands/list-trace-categories.js rename to cli/commands/list-trace-categories.js diff --git a/lighthouse-cli/index.js b/cli/index.js similarity index 100% rename from lighthouse-cli/index.js rename to cli/index.js diff --git a/lighthouse-cli/package.json b/cli/package.json similarity index 100% rename from lighthouse-cli/package.json rename to cli/package.json diff --git a/lighthouse-cli/printer.js b/cli/printer.js similarity index 100% rename from lighthouse-cli/printer.js rename to cli/printer.js diff --git a/lighthouse-cli/run.js b/cli/run.js similarity index 100% rename from lighthouse-cli/run.js rename to cli/run.js diff --git a/lighthouse-cli/sentry-prompt.js b/cli/sentry-prompt.js similarity index 100% rename from lighthouse-cli/sentry-prompt.js rename to cli/sentry-prompt.js diff --git a/lighthouse-cli/test/cli/__snapshots__/index-test.js.snap b/cli/test/cli/__snapshots__/index-test.js.snap similarity index 100% rename from lighthouse-cli/test/cli/__snapshots__/index-test.js.snap rename to cli/test/cli/__snapshots__/index-test.js.snap diff --git a/lighthouse-cli/test/cli/bin-test.js b/cli/test/cli/bin-test.js similarity index 96% rename from lighthouse-cli/test/cli/bin-test.js rename to cli/test/cli/bin-test.js index 20a9a23a5d16..3ff083379bd3 100644 --- a/lighthouse-cli/test/cli/bin-test.js +++ b/cli/test/cli/bin-test.js @@ -109,7 +109,7 @@ describe('CLI bin', function() { it('should load the config from the path (es modules)', async () => { const configPath = - `${LH_ROOT}/lighthouse-cli/test/smokehouse/test-definitions/a11y/a11y-config.js`; + `${LH_ROOT}/cli/test/smokehouse/test-definitions/a11y/a11y-config.js`; cliFlags = {...cliFlags, configPath: configPath}; const actualConfig = (await import(configPath)).default; await bin.begin(); @@ -181,7 +181,7 @@ describe('CLI bin', function() { describe('precomputedLanternData', () => { it('should read lantern data from file', async () => { - const lanternDataFile = `${LH_ROOT}/lighthouse-cli/test/fixtures/lantern-data.json`; + const lanternDataFile = `${LH_ROOT}/cli/test/fixtures/lantern-data.json`; cliFlags = {...cliFlags, precomputedLanternDataPath: lanternDataFile}; await bin.begin(); @@ -192,7 +192,7 @@ describe('CLI bin', function() { }); it('should throw when invalid lantern data used', async () => { - const headersFile = `${LH_ROOT}/lighthouse-cli/test/fixtures/extra-headers/valid.json`; + const headersFile = `${LH_ROOT}/cli/test/fixtures/extra-headers/valid.json`; cliFlags = {...cliFlags, precomputedLanternDataPath: headersFile}; await expect(bin.begin()).rejects.toBeTruthy(); }); diff --git a/lighthouse-cli/test/cli/cli-flags-test.js b/cli/test/cli/cli-flags-test.js similarity index 97% rename from lighthouse-cli/test/cli/cli-flags-test.js rename to cli/test/cli/cli-flags-test.js index 4089d08e03b8..187b47c242db 100644 --- a/lighthouse-cli/test/cli/cli-flags-test.js +++ b/cli/test/cli/cli-flags-test.js @@ -37,7 +37,7 @@ describe('CLI flags', function() { it('settings are accepted from a file path', () => { const flags = getFlags([ 'http://www.example.com', - `--cli-flags-path="${LH_ROOT}/lighthouse-cli/test/fixtures/cli-flags-path.json"`, + `--cli-flags-path="${LH_ROOT}/cli/test/fixtures/cli-flags-path.json"`, '--budgets-path=path/to/my/budget-from-command-line.json', // this should override the config value ].join(' ')); @@ -90,7 +90,7 @@ describe('CLI flags', function() { }); it('should read extra headers from file', () => { - const headersFile = `${LH_ROOT}/lighthouse-cli/test/fixtures/extra-headers/valid.json`; + const headersFile = `${LH_ROOT}/cli/test/fixtures/extra-headers/valid.json`; const headers = JSON.parse(fs.readFileSync(headersFile, 'utf-8')); const flags = getFlags([ 'http://www.example.com', diff --git a/lighthouse-cli/test/cli/index-test.js b/cli/test/cli/index-test.js similarity index 97% rename from lighthouse-cli/test/cli/index-test.js rename to cli/test/cli/index-test.js index e02d368c4700..0915ec1452c0 100644 --- a/lighthouse-cli/test/cli/index-test.js +++ b/cli/test/cli/index-test.js @@ -12,7 +12,7 @@ import {spawnSync} from 'child_process'; import {LH_ROOT} from '../../../root.js'; -const indexPath = `${LH_ROOT}/lighthouse-cli/index.js`; +const indexPath = `${LH_ROOT}/cli/index.js`; describe('CLI Tests', function() { it('fails if a url is not provided', () => { @@ -69,7 +69,7 @@ describe('CLI Tests', function() { it('should exit with a error if the file does not contain valid JSON', () => { const ret = spawnSync('node', [indexPath, 'https://www.google.com', '--extra-headers', - `${LH_ROOT}/lighthouse-cli/test/fixtures/extra-headers/invalid.txt`], {encoding: 'utf8'}); + `${LH_ROOT}/cli/test/fixtures/extra-headers/invalid.txt`], {encoding: 'utf8'}); assert.ok(ret.stderr.includes('Unexpected token')); assert.equal(ret.status, 1); diff --git a/lighthouse-cli/test/cli/printer-test.js b/cli/test/cli/printer-test.js similarity index 100% rename from lighthouse-cli/test/cli/printer-test.js rename to cli/test/cli/printer-test.js diff --git a/lighthouse-cli/test/cli/run-test.js b/cli/test/cli/run-test.js similarity index 100% rename from lighthouse-cli/test/cli/run-test.js rename to cli/test/cli/run-test.js diff --git a/lighthouse-cli/test/fixtures/a11y/a11y_tester.html b/cli/test/fixtures/a11y/a11y_tester.html similarity index 100% rename from lighthouse-cli/test/fixtures/a11y/a11y_tester.html rename to cli/test/fixtures/a11y/a11y_tester.html diff --git a/lighthouse-cli/test/fixtures/badssl-iframe.html b/cli/test/fixtures/badssl-iframe.html similarity index 100% rename from lighthouse-cli/test/fixtures/badssl-iframe.html rename to cli/test/fixtures/badssl-iframe.html diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/bundle.js b/cli/test/fixtures/byte-efficiency/bundle.js similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/bundle.js rename to cli/test/fixtures/byte-efficiency/bundle.js diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/bundle.js.map b/cli/test/fixtures/byte-efficiency/bundle.js.map similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/bundle.js.map rename to cli/test/fixtures/byte-efficiency/bundle.js.map diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/gzip.html b/cli/test/fixtures/byte-efficiency/gzip.html similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/gzip.html rename to cli/test/fixtures/byte-efficiency/gzip.html diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/large.svg b/cli/test/fixtures/byte-efficiency/large.svg similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/large.svg rename to cli/test/fixtures/byte-efficiency/large.svg diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-1024x680.jpg b/cli/test/fixtures/byte-efficiency/lighthouse-1024x680.jpg similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-1024x680.jpg rename to cli/test/fixtures/byte-efficiency/lighthouse-1024x680.jpg diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-2048x1356.webp b/cli/test/fixtures/byte-efficiency/lighthouse-2048x1356.webp similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-2048x1356.webp rename to cli/test/fixtures/byte-efficiency/lighthouse-2048x1356.webp diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-320x212-poor.jpg b/cli/test/fixtures/byte-efficiency/lighthouse-320x212-poor.jpg similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-320x212-poor.jpg rename to cli/test/fixtures/byte-efficiency/lighthouse-320x212-poor.jpg diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-480x320.jpg b/cli/test/fixtures/byte-efficiency/lighthouse-480x320.jpg similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-480x320.jpg rename to cli/test/fixtures/byte-efficiency/lighthouse-480x320.jpg diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-480x320.webp b/cli/test/fixtures/byte-efficiency/lighthouse-480x320.webp similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-480x320.webp rename to cli/test/fixtures/byte-efficiency/lighthouse-480x320.webp diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-unoptimized.jpg b/cli/test/fixtures/byte-efficiency/lighthouse-unoptimized.jpg similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/lighthouse-unoptimized.jpg rename to cli/test/fixtures/byte-efficiency/lighthouse-unoptimized.jpg diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/script.js b/cli/test/fixtures/byte-efficiency/script.js similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/script.js rename to cli/test/fixtures/byte-efficiency/script.js diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/tester.html b/cli/test/fixtures/byte-efficiency/tester.html similarity index 100% rename from lighthouse-cli/test/fixtures/byte-efficiency/tester.html rename to cli/test/fixtures/byte-efficiency/tester.html diff --git a/lighthouse-cli/test/fixtures/cli-flags-path.json b/cli/test/fixtures/cli-flags-path.json similarity index 100% rename from lighthouse-cli/test/fixtures/cli-flags-path.json rename to cli/test/fixtures/cli-flags-path.json diff --git a/lighthouse-cli/test/fixtures/csp.html b/cli/test/fixtures/csp.html similarity index 100% rename from lighthouse-cli/test/fixtures/csp.html rename to cli/test/fixtures/csp.html diff --git a/lighthouse-cli/test/fixtures/debugger.html b/cli/test/fixtures/debugger.html similarity index 100% rename from lighthouse-cli/test/fixtures/debugger.html rename to cli/test/fixtures/debugger.html diff --git a/lighthouse-cli/test/fixtures/delayed-fcp.html b/cli/test/fixtures/delayed-fcp.html similarity index 100% rename from lighthouse-cli/test/fixtures/delayed-fcp.html rename to cli/test/fixtures/delayed-fcp.html diff --git a/lighthouse-cli/test/fixtures/delayed-lcp.html b/cli/test/fixtures/delayed-lcp.html similarity index 100% rename from lighthouse-cli/test/fixtures/delayed-lcp.html rename to cli/test/fixtures/delayed-lcp.html diff --git a/lighthouse-cli/test/fixtures/dobetterweb/dbw_disabled.css b/cli/test/fixtures/dobetterweb/dbw_disabled.css similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/dbw_disabled.css rename to cli/test/fixtures/dobetterweb/dbw_disabled.css diff --git a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.css b/cli/test/fixtures/dobetterweb/dbw_tester.css similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.css rename to cli/test/fixtures/dobetterweb/dbw_tester.css diff --git a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html b/cli/test/fixtures/dobetterweb/dbw_tester.html similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html rename to cli/test/fixtures/dobetterweb/dbw_tester.html diff --git a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.js b/cli/test/fixtures/dobetterweb/dbw_tester.js similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.js rename to cli/test/fixtures/dobetterweb/dbw_tester.js diff --git a/lighthouse-cli/test/fixtures/dobetterweb/empty.css b/cli/test/fixtures/dobetterweb/empty.css similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/empty.css rename to cli/test/fixtures/dobetterweb/empty.css diff --git a/lighthouse-cli/test/fixtures/dobetterweb/empty_module.js b/cli/test/fixtures/dobetterweb/empty_module.js similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/empty_module.js rename to cli/test/fixtures/dobetterweb/empty_module.js diff --git a/lighthouse-cli/test/fixtures/dobetterweb/lighthouse-480x318.jpg b/cli/test/fixtures/dobetterweb/lighthouse-480x318.jpg similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/lighthouse-480x318.jpg rename to cli/test/fixtures/dobetterweb/lighthouse-480x318.jpg diff --git a/lighthouse-cli/test/fixtures/dobetterweb/lighthouse-rotating.gif b/cli/test/fixtures/dobetterweb/lighthouse-rotating.gif similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/lighthouse-rotating.gif rename to cli/test/fixtures/dobetterweb/lighthouse-rotating.gif diff --git a/lighthouse-cli/test/fixtures/dobetterweb/third_party/aggressive-promise-polyfill.js b/cli/test/fixtures/dobetterweb/third_party/aggressive-promise-polyfill.js similarity index 100% rename from lighthouse-cli/test/fixtures/dobetterweb/third_party/aggressive-promise-polyfill.js rename to cli/test/fixtures/dobetterweb/third_party/aggressive-promise-polyfill.js diff --git a/lighthouse-cli/test/fixtures/extra-headers/invalid.txt b/cli/test/fixtures/extra-headers/invalid.txt similarity index 100% rename from lighthouse-cli/test/fixtures/extra-headers/invalid.txt rename to cli/test/fixtures/extra-headers/invalid.txt diff --git a/lighthouse-cli/test/fixtures/extra-headers/valid.json b/cli/test/fixtures/extra-headers/valid.json similarity index 100% rename from lighthouse-cli/test/fixtures/extra-headers/valid.json rename to cli/test/fixtures/extra-headers/valid.json diff --git a/lighthouse-cli/test/fixtures/form.html b/cli/test/fixtures/form.html similarity index 100% rename from lighthouse-cli/test/fixtures/form.html rename to cli/test/fixtures/form.html diff --git a/lighthouse-cli/test/fixtures/infinite-loop.html b/cli/test/fixtures/infinite-loop.html similarity index 100% rename from lighthouse-cli/test/fixtures/infinite-loop.html rename to cli/test/fixtures/infinite-loop.html diff --git a/lighthouse-cli/test/fixtures/js-redirect.html b/cli/test/fixtures/js-redirect.html similarity index 100% rename from lighthouse-cli/test/fixtures/js-redirect.html rename to cli/test/fixtures/js-redirect.html diff --git a/lighthouse-cli/test/fixtures/lantern-data.json b/cli/test/fixtures/lantern-data.json similarity index 100% rename from lighthouse-cli/test/fixtures/lantern-data.json rename to cli/test/fixtures/lantern-data.json diff --git a/lighthouse-cli/test/fixtures/launcher-icon-100x100.png b/cli/test/fixtures/launcher-icon-100x100.png similarity index 100% rename from lighthouse-cli/test/fixtures/launcher-icon-100x100.png rename to cli/test/fixtures/launcher-icon-100x100.png diff --git a/lighthouse-cli/test/fixtures/launcher-icon-4x.png b/cli/test/fixtures/launcher-icon-4x.png similarity index 100% rename from lighthouse-cli/test/fixtures/launcher-icon-4x.png rename to cli/test/fixtures/launcher-icon-4x.png diff --git a/lighthouse-cli/test/fixtures/legacy-javascript.html b/cli/test/fixtures/legacy-javascript.html similarity index 100% rename from lighthouse-cli/test/fixtures/legacy-javascript.html rename to cli/test/fixtures/legacy-javascript.html diff --git a/lighthouse-cli/test/fixtures/legacy-javascript.js b/cli/test/fixtures/legacy-javascript.js similarity index 100% rename from lighthouse-cli/test/fixtures/legacy-javascript.js rename to cli/test/fixtures/legacy-javascript.js diff --git a/lighthouse-cli/test/fixtures/manifest.json b/cli/test/fixtures/manifest.json similarity index 100% rename from lighthouse-cli/test/fixtures/manifest.json rename to cli/test/fixtures/manifest.json diff --git a/lighthouse-cli/test/fixtures/offline-ready-sw.js b/cli/test/fixtures/offline-ready-sw.js similarity index 100% rename from lighthouse-cli/test/fixtures/offline-ready-sw.js rename to cli/test/fixtures/offline-ready-sw.js diff --git a/lighthouse-cli/test/fixtures/offline-ready.html b/cli/test/fixtures/offline-ready.html similarity index 100% rename from lighthouse-cli/test/fixtures/offline-ready.html rename to cli/test/fixtures/offline-ready.html diff --git a/lighthouse-cli/test/fixtures/online-only.html b/cli/test/fixtures/online-only.html similarity index 100% rename from lighthouse-cli/test/fixtures/online-only.html rename to cli/test/fixtures/online-only.html diff --git a/lighthouse-cli/test/fixtures/oopif.html b/cli/test/fixtures/oopif.html similarity index 100% rename from lighthouse-cli/test/fixtures/oopif.html rename to cli/test/fixtures/oopif.html diff --git a/lighthouse-cli/test/fixtures/perf/animations.html b/cli/test/fixtures/perf/animations.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/animations.html rename to cli/test/fixtures/perf/animations.html diff --git a/lighthouse-cli/test/fixtures/perf/cors-fonts.css b/cli/test/fixtures/perf/cors-fonts.css similarity index 100% rename from lighthouse-cli/test/fixtures/perf/cors-fonts.css rename to cli/test/fixtures/perf/cors-fonts.css diff --git a/lighthouse-cli/test/fixtures/perf/debug.html b/cli/test/fixtures/perf/debug.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/debug.html rename to cli/test/fixtures/perf/debug.html diff --git a/lighthouse-cli/test/fixtures/perf/delayed-element.js b/cli/test/fixtures/perf/delayed-element.js similarity index 100% rename from lighthouse-cli/test/fixtures/perf/delayed-element.js rename to cli/test/fixtures/perf/delayed-element.js diff --git a/lighthouse-cli/test/fixtures/perf/fonts.html b/cli/test/fixtures/perf/fonts.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/fonts.html rename to cli/test/fixtures/perf/fonts.html diff --git a/lighthouse-cli/test/fixtures/perf/frame-metrics-inner.html b/cli/test/fixtures/perf/frame-metrics-inner.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/frame-metrics-inner.html rename to cli/test/fixtures/perf/frame-metrics-inner.html diff --git a/lighthouse-cli/test/fixtures/perf/frame-metrics.html b/cli/test/fixtures/perf/frame-metrics.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/frame-metrics.html rename to cli/test/fixtures/perf/frame-metrics.html diff --git a/lighthouse-cli/test/fixtures/perf/level-2.js b/cli/test/fixtures/perf/level-2.js similarity index 100% rename from lighthouse-cli/test/fixtures/perf/level-2.js rename to cli/test/fixtures/perf/level-2.js diff --git a/lighthouse-cli/test/fixtures/perf/level-3.js b/cli/test/fixtures/perf/level-3.js similarity index 100% rename from lighthouse-cli/test/fixtures/perf/level-3.js rename to cli/test/fixtures/perf/level-3.js diff --git a/lighthouse-cli/test/fixtures/perf/lobster-two-v10-latin-700.woff2 b/cli/test/fixtures/perf/lobster-two-v10-latin-700.woff2 similarity index 100% rename from lighthouse-cli/test/fixtures/perf/lobster-two-v10-latin-700.woff2 rename to cli/test/fixtures/perf/lobster-two-v10-latin-700.woff2 diff --git a/lighthouse-cli/test/fixtures/perf/lobster-v20-latin-regular.woff2 b/cli/test/fixtures/perf/lobster-v20-latin-regular.woff2 similarity index 100% rename from lighthouse-cli/test/fixtures/perf/lobster-v20-latin-regular.woff2 rename to cli/test/fixtures/perf/lobster-v20-latin-regular.woff2 diff --git a/lighthouse-cli/test/fixtures/perf/perf-budgets/big-script.js b/cli/test/fixtures/perf/perf-budgets/big-script.js similarity index 100% rename from lighthouse-cli/test/fixtures/perf/perf-budgets/big-script.js rename to cli/test/fixtures/perf/perf-budgets/big-script.js diff --git a/lighthouse-cli/test/fixtures/perf/perf-budgets/load-things.html b/cli/test/fixtures/perf/perf-budgets/load-things.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/perf-budgets/load-things.html rename to cli/test/fixtures/perf/perf-budgets/load-things.html diff --git a/lighthouse-cli/test/fixtures/perf/preload_style.css b/cli/test/fixtures/perf/preload_style.css similarity index 100% rename from lighthouse-cli/test/fixtures/perf/preload_style.css rename to cli/test/fixtures/perf/preload_style.css diff --git a/lighthouse-cli/test/fixtures/perf/preload_tester.js b/cli/test/fixtures/perf/preload_tester.js similarity index 100% rename from lighthouse-cli/test/fixtures/perf/preload_tester.js rename to cli/test/fixtures/perf/preload_tester.js diff --git a/lighthouse-cli/test/fixtures/perf/third-party.html b/cli/test/fixtures/perf/third-party.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/third-party.html rename to cli/test/fixtures/perf/third-party.html diff --git a/lighthouse-cli/test/fixtures/perf/trace-elements.html b/cli/test/fixtures/perf/trace-elements.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/trace-elements.html rename to cli/test/fixtures/perf/trace-elements.html diff --git a/lighthouse-cli/test/fixtures/perf/unsized-images.html b/cli/test/fixtures/perf/unsized-images.html similarity index 100% rename from lighthouse-cli/test/fixtures/perf/unsized-images.html rename to cli/test/fixtures/perf/unsized-images.html diff --git a/lighthouse-cli/test/fixtures/preload.html b/cli/test/fixtures/preload.html similarity index 100% rename from lighthouse-cli/test/fixtures/preload.html rename to cli/test/fixtures/preload.html diff --git a/lighthouse-cli/test/fixtures/redirects-final.html b/cli/test/fixtures/redirects-final.html similarity index 100% rename from lighthouse-cli/test/fixtures/redirects-final.html rename to cli/test/fixtures/redirects-final.html diff --git a/lighthouse-cli/test/fixtures/ric-shim.html b/cli/test/fixtures/ric-shim.html similarity index 100% rename from lighthouse-cli/test/fixtures/ric-shim.html rename to cli/test/fixtures/ric-shim.html diff --git a/lighthouse-cli/test/fixtures/robots.txt b/cli/test/fixtures/robots.txt similarity index 100% rename from lighthouse-cli/test/fixtures/robots.txt rename to cli/test/fixtures/robots.txt diff --git a/lighthouse-cli/test/fixtures/screenshot.gif b/cli/test/fixtures/screenshot.gif similarity index 100% rename from lighthouse-cli/test/fixtures/screenshot.gif rename to cli/test/fixtures/screenshot.gif diff --git a/lighthouse-cli/test/fixtures/screenshot.html b/cli/test/fixtures/screenshot.html similarity index 100% rename from lighthouse-cli/test/fixtures/screenshot.html rename to cli/test/fixtures/screenshot.html diff --git a/lighthouse-cli/test/fixtures/seo/seo-failure-cases.html b/cli/test/fixtures/seo/seo-failure-cases.html similarity index 100% rename from lighthouse-cli/test/fixtures/seo/seo-failure-cases.html rename to cli/test/fixtures/seo/seo-failure-cases.html diff --git a/lighthouse-cli/test/fixtures/seo/seo-tap-targets.html b/cli/test/fixtures/seo/seo-tap-targets.html similarity index 100% rename from lighthouse-cli/test/fixtures/seo/seo-tap-targets.html rename to cli/test/fixtures/seo/seo-tap-targets.html diff --git a/lighthouse-cli/test/fixtures/seo/seo-tester-styles.css b/cli/test/fixtures/seo/seo-tester-styles.css similarity index 100% rename from lighthouse-cli/test/fixtures/seo/seo-tester-styles.css rename to cli/test/fixtures/seo/seo-tester-styles.css diff --git a/lighthouse-cli/test/fixtures/seo/seo-tester.html b/cli/test/fixtures/seo/seo-tester.html similarity index 100% rename from lighthouse-cli/test/fixtures/seo/seo-tester.html rename to cli/test/fixtures/seo/seo-tester.html diff --git a/lighthouse-cli/test/fixtures/source-map/script.js.map b/cli/test/fixtures/source-map/script.js.map similarity index 100% rename from lighthouse-cli/test/fixtures/source-map/script.js.map rename to cli/test/fixtures/source-map/script.js.map diff --git a/lighthouse-cli/test/fixtures/source-map/source-map-tester.html b/cli/test/fixtures/source-map/source-map-tester.html similarity index 100% rename from lighthouse-cli/test/fixtures/source-map/source-map-tester.html rename to cli/test/fixtures/source-map/source-map-tester.html diff --git a/lighthouse-cli/test/fixtures/static-server-test.js b/cli/test/fixtures/static-server-test.js similarity index 100% rename from lighthouse-cli/test/fixtures/static-server-test.js rename to cli/test/fixtures/static-server-test.js diff --git a/lighthouse-cli/test/fixtures/static-server.js b/cli/test/fixtures/static-server.js similarity index 99% rename from lighthouse-cli/test/fixtures/static-server.js rename to cli/test/fixtures/static-server.js index df051391f62f..eb59d5c92de8 100644 --- a/lighthouse-cli/test/fixtures/static-server.js +++ b/cli/test/fixtures/static-server.js @@ -25,7 +25,7 @@ import {LH_ROOT} from '../../../root.js'; const HEADER_SAFELIST = new Set(['x-robots-tag', 'link', 'content-security-policy']); class Server { - baseDir = `${LH_ROOT}/lighthouse-cli/test/fixtures`; + baseDir = `${LH_ROOT}/cli/test/fixtures`; constructor() { this._server = http.createServer(this._requestHandler.bind(this)); diff --git a/lighthouse-cli/test/fixtures/tricky-main-thread-consumer.js b/cli/test/fixtures/tricky-main-thread-consumer.js similarity index 100% rename from lighthouse-cli/test/fixtures/tricky-main-thread-consumer.js rename to cli/test/fixtures/tricky-main-thread-consumer.js diff --git a/lighthouse-cli/test/fixtures/tricky-main-thread-library.js b/cli/test/fixtures/tricky-main-thread-library.js similarity index 100% rename from lighthouse-cli/test/fixtures/tricky-main-thread-library.js rename to cli/test/fixtures/tricky-main-thread-library.js diff --git a/lighthouse-cli/test/fixtures/tricky-main-thread.html b/cli/test/fixtures/tricky-main-thread.html similarity index 100% rename from lighthouse-cli/test/fixtures/tricky-main-thread.html rename to cli/test/fixtures/tricky-main-thread.html diff --git a/lighthouse-cli/test/fixtures/tricky-tti-late-fcp.html b/cli/test/fixtures/tricky-tti-late-fcp.html similarity index 100% rename from lighthouse-cli/test/fixtures/tricky-tti-late-fcp.html rename to cli/test/fixtures/tricky-tti-late-fcp.html diff --git a/lighthouse-cli/test/fixtures/tricky-tti.html b/cli/test/fixtures/tricky-tti.html similarity index 100% rename from lighthouse-cli/test/fixtures/tricky-tti.html rename to cli/test/fixtures/tricky-tti.html diff --git a/lighthouse-cli/test/smokehouse/frontends/back-compat-util.js b/cli/test/smokehouse/frontends/back-compat-util.js similarity index 100% rename from lighthouse-cli/test/smokehouse/frontends/back-compat-util.js rename to cli/test/smokehouse/frontends/back-compat-util.js diff --git a/lighthouse-cli/test/smokehouse/frontends/lib.js b/cli/test/smokehouse/frontends/lib.js similarity index 100% rename from lighthouse-cli/test/smokehouse/frontends/lib.js rename to cli/test/smokehouse/frontends/lib.js diff --git a/lighthouse-cli/test/smokehouse/frontends/node.js b/cli/test/smokehouse/frontends/node.js similarity index 100% rename from lighthouse-cli/test/smokehouse/frontends/node.js rename to cli/test/smokehouse/frontends/node.js diff --git a/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js b/cli/test/smokehouse/frontends/smokehouse-bin.js similarity index 99% rename from lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js rename to cli/test/smokehouse/frontends/smokehouse-bin.js index 414cadd7428b..f0acf23c1862 100644 --- a/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +++ b/cli/test/smokehouse/frontends/smokehouse-bin.js @@ -28,7 +28,7 @@ import {updateTestDefnFormat} from './back-compat-util.js'; import {LH_ROOT} from '../../../../root.js'; const coreTestDefnsPath = - path.join(LH_ROOT, 'lighthouse-cli/test/smokehouse/test-definitions/core-tests.js'); + path.join(LH_ROOT, 'cli/test/smokehouse/test-definitions/core-tests.js'); /** * Possible Lighthouse runners. Loaded dynamically so e.g. a CLI run isn't diff --git a/lighthouse-cli/test/smokehouse/lib/child-process-error.js b/cli/test/smokehouse/lib/child-process-error.js similarity index 100% rename from lighthouse-cli/test/smokehouse/lib/child-process-error.js rename to cli/test/smokehouse/lib/child-process-error.js diff --git a/lighthouse-cli/test/smokehouse/lib/concurrent-mapper.js b/cli/test/smokehouse/lib/concurrent-mapper.js similarity index 100% rename from lighthouse-cli/test/smokehouse/lib/concurrent-mapper.js rename to cli/test/smokehouse/lib/concurrent-mapper.js diff --git a/lighthouse-cli/test/smokehouse/lib/local-console.js b/cli/test/smokehouse/lib/local-console.js similarity index 100% rename from lighthouse-cli/test/smokehouse/lib/local-console.js rename to cli/test/smokehouse/lib/local-console.js diff --git a/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js b/cli/test/smokehouse/lighthouse-runners/bundle.js similarity index 100% rename from lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js rename to cli/test/smokehouse/lighthouse-runners/bundle.js diff --git a/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js b/cli/test/smokehouse/lighthouse-runners/cli.js similarity index 99% rename from lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js rename to cli/test/smokehouse/lighthouse-runners/cli.js index 7a25d28efba1..cd2def6355d4 100644 --- a/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +++ b/cli/test/smokehouse/lighthouse-runners/cli.js @@ -72,7 +72,7 @@ async function internalRun(url, tmpPath, configJson, options) { const artifactsDirectory = `${tmpPath}/artifacts/`; const args = [ - `${LH_ROOT}/lighthouse-cli/index.js`, + `${LH_ROOT}/cli/index.js`, `${url}`, `--output-path=${outputPath}`, '--output=json', diff --git a/lighthouse-cli/test/smokehouse/readme.md b/cli/test/smokehouse/readme.md similarity index 99% rename from lighthouse-cli/test/smokehouse/readme.md rename to cli/test/smokehouse/readme.md index cda37cae3c76..76183b966624 100644 --- a/lighthouse-cli/test/smokehouse/readme.md +++ b/cli/test/smokehouse/readme.md @@ -6,7 +6,7 @@ By default this is done using the Lighthouse CLI (to exercise the full pipeline) ## Options -See [`SmokehouseOptions`](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-cli/test/smokehouse/smokehouse.js#L23). +See [`SmokehouseOptions`](https://github.com/GoogleChrome/lighthouse/blob/master/cli/test/smokehouse/smokehouse.js#L23). ## Test definitions diff --git a/lighthouse-cli/test/smokehouse/report-assert.js b/cli/test/smokehouse/report-assert.js similarity index 100% rename from lighthouse-cli/test/smokehouse/report-assert.js rename to cli/test/smokehouse/report-assert.js diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/cli/test/smokehouse/smokehouse.js similarity index 100% rename from lighthouse-cli/test/smokehouse/smokehouse.js rename to cli/test/smokehouse/smokehouse.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/a11y/a11y-config.js b/cli/test/smokehouse/test-definitions/a11y/a11y-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/a11y/a11y-config.js rename to cli/test/smokehouse/test-definitions/a11y/a11y-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/a11y/expectations.js b/cli/test/smokehouse/test-definitions/a11y/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/a11y/expectations.js rename to cli/test/smokehouse/test-definitions/a11y/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/byte-config.js b/cli/test/smokehouse/test-definitions/byte-efficiency/byte-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/byte-config.js rename to cli/test/smokehouse/test-definitions/byte-efficiency/byte-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js b/cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js rename to cli/test/smokehouse/test-definitions/byte-efficiency/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/core-tests.js b/cli/test/smokehouse/test-definitions/core-tests.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/core-tests.js rename to cli/test/smokehouse/test-definitions/core-tests.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/csp/csp-config.js b/cli/test/smokehouse/test-definitions/csp/csp-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/csp/csp-config.js rename to cli/test/smokehouse/test-definitions/csp/csp-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/csp/csp-expectations.js b/cli/test/smokehouse/test-definitions/csp/csp-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/csp/csp-expectations.js rename to cli/test/smokehouse/test-definitions/csp/csp-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-config.js b/cli/test/smokehouse/test-definitions/dobetterweb/dbw-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-config.js rename to cli/test/smokehouse/test-definitions/dobetterweb/dbw-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js b/cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js rename to cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/errors/error-config.js b/cli/test/smokehouse/test-definitions/errors/error-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/errors/error-config.js rename to cli/test/smokehouse/test-definitions/errors/error-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/errors/error-expectations.js b/cli/test/smokehouse/test-definitions/errors/error-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/errors/error-expectations.js rename to cli/test/smokehouse/test-definitions/errors/error-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/forms/form-config.js b/cli/test/smokehouse/test-definitions/forms/form-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/forms/form-config.js rename to cli/test/smokehouse/test-definitions/forms/form-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/forms/form-expectations.js b/cli/test/smokehouse/test-definitions/forms/form-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/forms/form-expectations.js rename to cli/test/smokehouse/test-definitions/forms/form-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/issues/mixed-content-expectations.js b/cli/test/smokehouse/test-definitions/issues/mixed-content-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/issues/mixed-content-expectations.js rename to cli/test/smokehouse/test-definitions/issues/mixed-content-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/lantern/lantern-config.js b/cli/test/smokehouse/test-definitions/lantern/lantern-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/lantern/lantern-config.js rename to cli/test/smokehouse/test-definitions/lantern/lantern-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/lantern/lantern-expectations.js b/cli/test/smokehouse/test-definitions/lantern/lantern-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/lantern/lantern-expectations.js rename to cli/test/smokehouse/test-definitions/lantern/lantern-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/legacy-javascript/expectations.js b/cli/test/smokehouse/test-definitions/legacy-javascript/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/legacy-javascript/expectations.js rename to cli/test/smokehouse/test-definitions/legacy-javascript/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/legacy-javascript/legacy-javascript-config.js b/cli/test/smokehouse/test-definitions/legacy-javascript/legacy-javascript-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/legacy-javascript/legacy-javascript-config.js rename to cli/test/smokehouse/test-definitions/legacy-javascript/legacy-javascript-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-config.js b/cli/test/smokehouse/test-definitions/offline-local/offline-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-config.js rename to cli/test/smokehouse/test-definitions/offline-local/offline-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js b/cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js rename to cli/test/smokehouse/test-definitions/offline-local/offline-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/oopif/oopif-config.js b/cli/test/smokehouse/test-definitions/oopif/oopif-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/oopif/oopif-config.js rename to cli/test/smokehouse/test-definitions/oopif/oopif-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/oopif/oopif-expectations.js b/cli/test/smokehouse/test-definitions/oopif/oopif-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/oopif/oopif-expectations.js rename to cli/test/smokehouse/test-definitions/oopif/oopif-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/perf-diagnostics/expectations.js b/cli/test/smokehouse/test-definitions/perf-diagnostics/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/perf-diagnostics/expectations.js rename to cli/test/smokehouse/test-definitions/perf-diagnostics/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/perf-diagnostics/perf-diagnostics-config.js b/cli/test/smokehouse/test-definitions/perf-diagnostics/perf-diagnostics-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/perf-diagnostics/perf-diagnostics-config.js rename to cli/test/smokehouse/test-definitions/perf-diagnostics/perf-diagnostics-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/perf/expectations.js b/cli/test/smokehouse/test-definitions/perf/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/perf/expectations.js rename to cli/test/smokehouse/test-definitions/perf/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/perf/perf-config.js b/cli/test/smokehouse/test-definitions/perf/perf-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/perf/perf-config.js rename to cli/test/smokehouse/test-definitions/perf/perf-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pubads/expectations.js b/cli/test/smokehouse/test-definitions/pubads/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pubads/expectations.js rename to cli/test/smokehouse/test-definitions/pubads/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pubads/pubads-config.js b/cli/test/smokehouse/test-definitions/pubads/pubads-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pubads/pubads-config.js rename to cli/test/smokehouse/test-definitions/pubads/pubads-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa-config.js b/cli/test/smokehouse/test-definitions/pwa/pwa-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa-config.js rename to cli/test/smokehouse/test-definitions/pwa/pwa-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa-expectations-details.js b/cli/test/smokehouse/test-definitions/pwa/pwa-expectations-details.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa-expectations-details.js rename to cli/test/smokehouse/test-definitions/pwa/pwa-expectations-details.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa-expectations.js b/cli/test/smokehouse/test-definitions/pwa/pwa-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa-expectations.js rename to cli/test/smokehouse/test-definitions/pwa/pwa-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa2-expectations.js b/cli/test/smokehouse/test-definitions/pwa/pwa2-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa2-expectations.js rename to cli/test/smokehouse/test-definitions/pwa/pwa2-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa3-expectations.js b/cli/test/smokehouse/test-definitions/pwa/pwa3-expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/pwa/pwa3-expectations.js rename to cli/test/smokehouse/test-definitions/pwa/pwa3-expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/redirects/expectations.js b/cli/test/smokehouse/test-definitions/redirects/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/redirects/expectations.js rename to cli/test/smokehouse/test-definitions/redirects/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/redirects/redirects-config.js b/cli/test/smokehouse/test-definitions/redirects/redirects-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/redirects/redirects-config.js rename to cli/test/smokehouse/test-definitions/redirects/redirects-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/screenshot/expectations.js b/cli/test/smokehouse/test-definitions/screenshot/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/screenshot/expectations.js rename to cli/test/smokehouse/test-definitions/screenshot/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/screenshot/screenshot-config.js b/cli/test/smokehouse/test-definitions/screenshot/screenshot-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/screenshot/screenshot-config.js rename to cli/test/smokehouse/test-definitions/screenshot/screenshot-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/seo/expectations.js b/cli/test/smokehouse/test-definitions/seo/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/seo/expectations.js rename to cli/test/smokehouse/test-definitions/seo/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/seo/seo-config.js b/cli/test/smokehouse/test-definitions/seo/seo-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/seo/seo-config.js rename to cli/test/smokehouse/test-definitions/seo/seo-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/source-maps/expectations.js b/cli/test/smokehouse/test-definitions/source-maps/expectations.js similarity index 94% rename from lighthouse-cli/test/smokehouse/test-definitions/source-maps/expectations.js rename to cli/test/smokehouse/test-definitions/source-maps/expectations.js index 48d53434d565..08bdb1ab9834 100644 --- a/lighthouse-cli/test/smokehouse/test-definitions/source-maps/expectations.js +++ b/cli/test/smokehouse/test-definitions/source-maps/expectations.js @@ -9,7 +9,7 @@ import fs from 'fs'; import {LH_ROOT} from '../../../../../root.js'; const mapJson = - fs.readFileSync(`${LH_ROOT}/lighthouse-cli/test/fixtures/source-map/script.js.map`, 'utf-8'); + fs.readFileSync(`${LH_ROOT}/cli/test/fixtures/source-map/script.js.map`, 'utf-8'); const map = JSON.parse(mapJson); /** diff --git a/lighthouse-cli/test/smokehouse/test-definitions/source-maps/source-maps-config.js b/cli/test/smokehouse/test-definitions/source-maps/source-maps-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/source-maps/source-maps-config.js rename to cli/test/smokehouse/test-definitions/source-maps/source-maps-config.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/tricky-metrics/expectations.js b/cli/test/smokehouse/test-definitions/tricky-metrics/expectations.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/tricky-metrics/expectations.js rename to cli/test/smokehouse/test-definitions/tricky-metrics/expectations.js diff --git a/lighthouse-cli/test/smokehouse/test-definitions/tricky-metrics/no-throttling-config.js b/cli/test/smokehouse/test-definitions/tricky-metrics/no-throttling-config.js similarity index 100% rename from lighthouse-cli/test/smokehouse/test-definitions/tricky-metrics/no-throttling-config.js rename to cli/test/smokehouse/test-definitions/tricky-metrics/no-throttling-config.js diff --git a/docs/hacking-tips.md b/docs/hacking-tips.md index 1d22ef297a3d..c52b6b9de309 100644 --- a/docs/hacking-tips.md +++ b/docs/hacking-tips.md @@ -30,7 +30,7 @@ Getting errors like these? Use [`--trace-warnings`](https://medium.com/@jasnell/introducing-process-warnings-in-node-v6-3096700537ee) to get actual stack traces. ```sh -node --trace-warnings lighthouse-cli http://example.com +node --trace-warnings cli http://example.com ``` ## Iterating on the report diff --git a/docs/variability.md b/docs/variability.md index f682b2fb04ab..1a9793175c3e 100644 --- a/docs/variability.md +++ b/docs/variability.md @@ -121,7 +121,7 @@ If you're running Lighthouse directly via node, you can use the `computeMedianRu ```js const spawnSync = require('child_process').spawnSync; -const lighthouseCli = require.resolve('lighthouse/lighthouse-cli'); +const lighthouseCli = require.resolve('lighthouse/cli'); const {computeMedianRun} = require('lighthouse/lighthouse-core/lib/median-run.js'); const results = []; diff --git a/jest.config.js b/jest.config.js index f31de459a1cb..f8d612777919 100644 --- a/jest.config.js +++ b/jest.config.js @@ -10,7 +10,7 @@ module.exports = { testEnvironment: 'node', testMatch: [ '**/lighthouse-core/**/*-test.js', - '**/lighthouse-cli/**/*-test.js', + '**/cli/**/*-test.js', '**/report/**/*-test.js', '**/lighthouse-core/test/fraggle-rock/**/*-test-pptr.js', '**/treemap/**/*-test.js', diff --git a/lighthouse-core/index.js b/lighthouse-core/index.js index 373a8cc1eee9..bb62f4a83d6b 100644 --- a/lighthouse-core/index.js +++ b/lighthouse-core/index.js @@ -20,7 +20,7 @@ const Config = require('./config/config.js'); * runner.js - marshalls the actions that must be taken (Gather / Audit) * config file is used to determine which of these actions are needed * - * lighthouse-cli \ + * cli \ * -- core/index.js ----> runner.js ----> [Gather / Audit] * clients / */ diff --git a/lighthouse-core/scripts/assert-golden-lhr-unchanged.sh b/lighthouse-core/scripts/assert-golden-lhr-unchanged.sh index eb9b842b19f2..6c79c7b8eb79 100644 --- a/lighthouse-core/scripts/assert-golden-lhr-unchanged.sh +++ b/lighthouse-core/scripts/assert-golden-lhr-unchanged.sh @@ -33,7 +33,7 @@ trap teardown EXIT colorText "Generating a fresh LHR..." "$purple" set -x -node "$lhroot_path/lighthouse-cli" -A="$lh_tmp_artifacts_path" --config-path="$lhroot_path/lighthouse-core/test/results/sample-config.js" --quiet --output=json --output-path="$freshLHRPath" +node "$lhroot_path/cli" -A="$lh_tmp_artifacts_path" --config-path="$lhroot_path/lighthouse-core/test/results/sample-config.js" --quiet --output=json --output-path="$freshLHRPath" set +x # remove timing from both diff --git a/lighthouse-core/scripts/c8.sh b/lighthouse-core/scripts/c8.sh index a4ffe256f030..56c7affce02c 100644 --- a/lighthouse-core/scripts/c8.sh +++ b/lighthouse-core/scripts/c8.sh @@ -11,7 +11,7 @@ set -euxo pipefail echo $* node node_modules/.bin/c8 \ - --include '{lighthouse-core,lighthouse-cli,viewer,treemap,build/plugins,report,flow-report}' \ + --include '{lighthouse-core,cli,viewer,treemap,build/plugins,report,flow-report}' \ --exclude third_party \ --exclude '**/test/' \ --exclude '**/scripts/' \ diff --git a/lighthouse-core/scripts/compare-runs.js b/lighthouse-core/scripts/compare-runs.js index 03c70747da5e..1ccabcfbf902 100644 --- a/lighthouse-core/scripts/compare-runs.js +++ b/lighthouse-core/scripts/compare-runs.js @@ -164,7 +164,7 @@ async function gather() { if (fs.existsSync(gatherDir)) continue; await execFile('node', [ - `${LH_ROOT}/lighthouse-cli`, + `${LH_ROOT}/cli`, url, `--gather-mode=${gatherDir}`, argv.lhFlags, @@ -197,7 +197,7 @@ async function audit() { try { const args = [ - `${LH_ROOT}/lighthouse-cli`, + `${LH_ROOT}/cli`, url, `--audit-mode=${gatherDir}`, `--output-path=${outputPath}`, diff --git a/lighthouse-core/scripts/lantern/collect/collect.js b/lighthouse-core/scripts/lantern/collect/collect.js index 5773ab9c8d62..20fe4f3832ab 100644 --- a/lighthouse-core/scripts/lantern/collect/collect.js +++ b/lighthouse-core/scripts/lantern/collect/collect.js @@ -98,7 +98,7 @@ async function startWptTest(url) { async function runUnthrottledLocally(url) { const artifactsFolder = `${LH_ROOT}/.tmp/collect-traces-artifacts`; const {stdout} = await execFileAsync('node', [ - `${LH_ROOT}/lighthouse-cli`, + `${LH_ROOT}/cli`, url, '--throttling-method=provided', '--output=json', diff --git a/lighthouse-core/scripts/release/package-test.sh b/lighthouse-core/scripts/release/package-test.sh index 00afb8c7ecd9..2462d4965029 100644 --- a/lighthouse-core/scripts/release/package-test.sh +++ b/lighthouse-core/scripts/release/package-test.sh @@ -25,7 +25,7 @@ npm explore lighthouse -- npm run fast -- http://example.com # Packaged smokehouse/lighthouse using root's static-server and test fixtures. # This is because we don't have access to any of the dev dependencies. -CI="" yarn smokehouse --tests-path="$LH_ROOT/lighthouse-cli/test/smokehouse/test-definitions/core-tests.js" --retries=2 +CI="" yarn smokehouse --tests-path="$LH_ROOT/cli/test/smokehouse/test-definitions/core-tests.js" --retries=2 cd "$LH_ROOT" rm -rf /tmp/lighthouse-local-test diff --git a/lighthouse-core/scripts/update-report-fixtures.js b/lighthouse-core/scripts/update-report-fixtures.js index 225d343a9da7..2500a0ec99ce 100644 --- a/lighthouse-core/scripts/update-report-fixtures.js +++ b/lighthouse-core/scripts/update-report-fixtures.js @@ -7,10 +7,10 @@ import fs from 'fs'; -import * as cli from '../../lighthouse-cli/run.js'; -import * as cliFlags from '../../lighthouse-cli/cli-flags.js'; +import * as cli from '../../cli/run.js'; +import * as cliFlags from '../../cli/cli-flags.js'; import assetSaver from '../lib/asset-saver.js'; -import {server} from '../../lighthouse-cli/test/fixtures/static-server.js'; +import {server} from '../../cli/test/fixtures/static-server.js'; import budgetedConfig from '../test/results/sample-config.js'; import {LH_ROOT} from '../../root.js'; diff --git a/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js b/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js index e43b4ba29fc2..cde8ffbf969c 100644 --- a/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js +++ b/lighthouse-core/test/fraggle-rock/scenarios/pptr-test-utils.js @@ -7,9 +7,9 @@ import {beforeAll, beforeEach, afterAll, afterEach} from '@jest/globals'; import puppeteer from 'puppeteer'; -import {Server} from '../../../../lighthouse-cli/test/fixtures/static-server.js'; +import {Server} from '../../../../cli/test/fixtures/static-server.js'; -/** @typedef {InstanceType} StaticServer */ +/** @typedef {InstanceType} StaticServer */ /** * Some audits can be notApplicable based on machine timing information. diff --git a/package.json b/package.json index 40f0000b1384..8026181a601c 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "Automated auditing, performance metrics, and best practices for the web.", "main": "./lighthouse-core/index.js", "bin": { - "lighthouse": "./lighthouse-cli/index.js", + "lighthouse": "./cli/index.js", "chrome-debug": "./lighthouse-core/scripts/manual-chrome-launcher.js", - "smokehouse": "./lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js" + "smokehouse": "./cli/test/smokehouse/frontends/smokehouse-bin.js" }, "engines": { "node": ">=14.15" @@ -32,9 +32,9 @@ "c8": "bash lighthouse-core/scripts/c8.sh", "clean": "rm -r dist proto/scripts/*.json proto/scripts/*_pb2.* proto/scripts/*_pb.* proto/scripts/__pycache__ proto/scripts/*.pyc *.report.html *.report.dom.html *.report.json *.devtoolslog.json *.trace.json shared/localization/locales/*.ctc.json || true", "lint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe . || eslint .", - "smoke": "node lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js", - "debug": "node --inspect-brk ./lighthouse-cli/index.js", - "start": "yarn build-report --standalone && node ./lighthouse-cli/index.js", + "smoke": "node cli/test/smokehouse/frontends/smokehouse-bin.js", + "debug": "node --inspect-brk ./cli/index.js", + "start": "yarn build-report --standalone && node ./cli/index.js", "jest": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js", "test": "yarn diff:sample-json && yarn lint --quiet && yarn unit && yarn type-check", "test-bundle": "yarn smoke --runner bundle -j=1 --retries=2 --invert-match forms", @@ -46,7 +46,7 @@ "test-docs": "yarn --cwd docs/recipes/ test", "test-proto": "yarn compile-proto && yarn build-proto-roundtrip", "unit-core": "yarn jest \"lighthouse-core\"", - "unit-cli": "yarn jest \"lighthouse-cli/\"", + "unit-cli": "yarn jest \"cli/\"", "unit-report": "yarn jest \"report/\"", "unit-treemap": "yarn jest \"treemap/.*-test.js\"", "unit-viewer": "yarn jest \"viewer/.*-test.js\"", @@ -62,7 +62,7 @@ "coverage:smoke": "yarn c8 yarn smoke -j=1 && c8 report --reporter html", "devtools": "bash lighthouse-core/scripts/roll-to-devtools.sh", "chrome": "node lighthouse-core/scripts/manual-chrome-launcher.js", - "fast": "node ./lighthouse-cli/index.js --preset=desktop --throttlingMethod=provided", + "fast": "node ./cli/index.js --preset=desktop --throttlingMethod=provided", "deploy-treemap": "yarn build-treemap --deploy", "deploy-viewer": "yarn build-viewer --deploy", "vercel-build": "yarn build-sample-reports && yarn build-viewer && yarn build-treemap", @@ -74,7 +74,7 @@ "i18n:collect-strings": "node lighthouse-core/scripts/i18n/collect-strings.js", "update:lantern-baseline": "node lighthouse-core/scripts/lantern/update-baseline-lantern-values.js", "update:sample-artifacts": "node lighthouse-core/scripts/update-report-fixtures.js", - "update:sample-json": "yarn i18n:collect-strings && node ./lighthouse-cli -A=./lighthouse-core/test/results/artifacts --config-path=./lighthouse-core/test/results/sample-config.js --output=json --output-path=./lighthouse-core/test/results/sample_v2.json && node lighthouse-core/scripts/cleanup-LHR-for-diff.js ./lighthouse-core/test/results/sample_v2.json --only-remove-timing", + "update:sample-json": "yarn i18n:collect-strings && node ./cli -A=./lighthouse-core/test/results/artifacts --config-path=./lighthouse-core/test/results/sample-config.js --output=json --output-path=./lighthouse-core/test/results/sample_v2.json && node lighthouse-core/scripts/cleanup-LHR-for-diff.js ./lighthouse-core/test/results/sample_v2.json --only-remove-timing", "update:flow-sample-json": "node ./lighthouse-core/scripts/update-flow-fixtures.js", "update:test-devtools": "bash lighthouse-core/test/chromium-web-tests/test-locally.sh --reset-results", "test-devtools": "bash lighthouse-core/test/chromium-web-tests/test-locally.sh", @@ -86,7 +86,7 @@ "save-latest-run": "./lighthouse-core/scripts/save-latest-run.sh", "compile-proto": "protoc --python_out=./ ./proto/lighthouse-result.proto && mv ./proto/*_pb2.py ./proto/scripts || (echo \"❌ Install protobuf ≥ 3.7.1 to compile the proto file.\" && false)", "build-proto-roundtrip": "mkdir -p .tmp && cross-env PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 python proto/scripts/json_roundtrip_via_proto.py", - "static-server": "node lighthouse-cli/test/fixtures/static-server.js", + "static-server": "node cli/test/fixtures/static-server.js", "serve-dist": "cd dist && python -m SimpleHTTPServer", "serve-gh-pages": "cd dist/gh-pages && python -m SimpleHTTPServer", "serve-treemap": "yarn serve-gh-pages", diff --git a/readme.md b/readme.md index 5e388f06170e..08f1a5454438 100644 --- a/readme.md +++ b/readme.md @@ -69,7 +69,7 @@ By default, Lighthouse writes the report to an HTML file. You can control the ou ### CLI options ``` @@ -283,11 +283,11 @@ yarn build-all ### Run ```sh -node lighthouse-cli http://example.com +yarn start http://example.com # append --chrome-flags="--no-sandbox --headless --disable-gpu" if you run into problems connecting to Chrome ``` -> **Getting started tip**: `node --inspect-brk lighthouse-cli http://example.com` to open up Chrome DevTools and step +> **Getting started tip**: `node --inspect-brk cli http://example.com` to open up Chrome DevTools and step through the entire app. See [Debugging Node.js with Chrome DevTools](https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27#.59rma3ukm) for more info. diff --git a/treemap/test/treemap-test-pptr.js b/treemap/test/treemap-test-pptr.js index dbf62b5563c0..431b7b8e71a0 100644 --- a/treemap/test/treemap-test-pptr.js +++ b/treemap/test/treemap-test-pptr.js @@ -12,7 +12,7 @@ import fs from 'fs'; import {jest} from '@jest/globals'; import puppeteer from 'puppeteer'; -import {server} from '../../lighthouse-cli/test/fixtures/static-server.js'; +import {server} from '../../cli/test/fixtures/static-server.js'; import {LH_ROOT} from '../../root.js'; const debugOptions = JSON.parse( diff --git a/tsconfig.json b/tsconfig.json index 43960e3a88bf..acf8a069c459 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ ], "include": [ "root.js", - "lighthouse-cli/**/*.js", + "cli/**/*.js", "lighthouse-core/**/*.js", "clients/**/*.js", "build/**/*.js", @@ -36,7 +36,7 @@ "lighthouse-core/test/fixtures/**/*.js", "lighthouse-core/test/computed/**/*.js", "clients/test/**/*.js", - "lighthouse-cli/test/fixtures/**/*.js", + "cli/test/fixtures/**/*.js", "lighthouse-core/scripts/legacy-javascript/variants", "lighthouse-core/test/chromium-web-tests/webtests", // These test files require further changes before they can be type checked. @@ -110,7 +110,7 @@ "files": [ // Opt-in to typechecking for some core tests and test-support files. "lighthouse-core/test/audits/script-treemap-data-test.js", - "lighthouse-cli/test/fixtures/static-server.js", + "cli/test/fixtures/static-server.js", "lighthouse-core/test/fixtures/config-plugins/lighthouse-plugin-simple/plugin-simple.js", ], } diff --git a/viewer/test/viewer-test-pptr.js b/viewer/test/viewer-test-pptr.js index db19f937ee6c..8bacfd2a3b49 100644 --- a/viewer/test/viewer-test-pptr.js +++ b/viewer/test/viewer-test-pptr.js @@ -13,7 +13,7 @@ import assert from 'assert'; import {jest} from '@jest/globals'; import puppeteer from 'puppeteer'; -import {server} from '../../lighthouse-cli/test/fixtures/static-server.js'; +import {server} from '../../cli/test/fixtures/static-server.js'; import defaultConfig from '../../lighthouse-core/config/default-config.js'; import {LH_ROOT} from '../../root.js'; import {getCanonicalLocales} from '../../shared/localization/format.js'; From bf52154c1af541ee1507ea0a75437a01d9b777a0 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 2 Nov 2021 13:50:20 -0700 Subject: [PATCH 2/2] exports --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 8026181a601c..f97a43dc161a 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,10 @@ "chrome-debug": "./lighthouse-core/scripts/manual-chrome-launcher.js", "smokehouse": "./cli/test/smokehouse/frontends/smokehouse-bin.js" }, + "exports": { + ".": "./lighthouse-core/index.js", + "./lighthouse-cli/*": "./cli/*" + }, "engines": { "node": ">=14.15" },