Skip to content

Commit

Permalink
add .js ext and LH to work with nodenext
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Jan 18, 2023
1 parent 14ca719 commit ba3104f
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 19 deletions.
1 change: 1 addition & 0 deletions core/audits/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../types/lh.js';
import {isUnderTest} from '../lib/lh-env.js';
import * as statistics from '../lib/statistics.js';
import {Util} from '../util.cjs';
Expand Down
1 change: 1 addition & 0 deletions core/computed/network-records.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../types/lh.js';
import {makeComputedArtifact} from './computed-artifact.js';
import {NetworkRecorder} from '../lib/network-recorder.js';

Expand Down
1 change: 1 addition & 0 deletions core/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/* eslint-disable max-len */

import * as LH from '../../types/lh.js';
import * as constants from './constants.js';
import * as i18n from '../lib/i18n/i18n.js';
import {metricsToAudits} from './metrics-to-audits.js';
Expand Down
1 change: 1 addition & 0 deletions core/config/desktop-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../types/lh.js';
import * as constants from './constants.js';

/** @type {LH.Config} */
Expand Down
2 changes: 2 additions & 0 deletions core/gather/base-gatherer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../types/lh.js';

/* eslint-disable no-unused-vars */

/**
Expand Down
1 change: 1 addition & 0 deletions core/gather/driver/execution-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/* global window */

import * as LH from '../../../types/lh.js';
import {pageFunctions} from '../../lib/page-functions.js';

class ExecutionContext {
Expand Down
2 changes: 2 additions & 0 deletions core/gather/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../types/lh.js';

/**
* @fileoverview Fetcher is a utility for making requests to any arbitrary resource,
* ignoring normal browser constraints such as CORS.
Expand Down
1 change: 1 addition & 0 deletions core/legacy/gather/connections/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {EventEmitter} from 'events';

import log from 'lighthouse-logger';

import * as LH from '../../../../types/lh.js';
import {LighthouseError} from '../../../lib/lh-error.js';

// TODO(bckenny): CommandCallback properties should be tied by command type after
Expand Down
1 change: 1 addition & 0 deletions core/legacy/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {EventEmitter} from 'events';

import log from 'lighthouse-logger';

import * as LH from '../../../types/lh.js';
import {Fetcher} from '../../gather/fetcher.js';
import {ExecutionContext} from '../../gather/driver/execution-context.js';
import {LighthouseError} from '../../lib/lh-error.js';
Expand Down
1 change: 1 addition & 0 deletions core/lib/dependency-graph/cpu-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../../types/lh.js';
import {BaseNode} from './base-node.js';

class CPUNode extends BaseNode {
Expand Down
1 change: 1 addition & 0 deletions core/lib/dependency-graph/network-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../../types/lh.js';
import {BaseNode} from './base-node.js';
import {NetworkRequest} from '../network-request.js';

Expand Down
1 change: 1 addition & 0 deletions core/lib/dependency-graph/simulator/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../../../types/lh.js';
import {NetworkAnalyzer} from './network-analyzer.js';
import {TcpConnection} from './tcp-connection.js';

Expand Down
2 changes: 2 additions & 0 deletions core/lib/dependency-graph/simulator/dns-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../../../types/lh.js';

// A DNS lookup will usually take ~1-2 roundtrips of connection latency plus the extra DNS routing time.
// Example: https://www.webpagetest.org/result/180703_3A_e33ec79747c002ed4d7bcbfc81462203/1/details/#waterfall_view_step1
// Example: https://www.webpagetest.org/result/180707_1M_89673eb633b5d98386de95dfcf9b33d5/1/details/#waterfall_view_step1
Expand Down
4 changes: 2 additions & 2 deletions core/lib/dependency-graph/simulator/simulator-timing-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {BaseNode} from '../base-node.js';


/** @typedef {import('../base-node.js').Node} Node */
/** @typedef {import('../network-node').NetworkNode} NetworkNode */
/** @typedef {import('../cpu-node').CPUNode} CpuNode */
/** @typedef {import('../network-node.js').NetworkNode} NetworkNode */
/** @typedef {import('../cpu-node.js').CPUNode} CpuNode */

/**
* @typedef NodeTimingComplete
Expand Down
5 changes: 3 additions & 2 deletions core/lib/dependency-graph/simulator/simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../../../types/lh.js';
import {BaseNode} from '../base-node.js';
import {TcpConnection} from './tcp-connection.js';
import {ConnectionPool} from './connection-pool.js';
Expand All @@ -14,8 +15,8 @@ import * as constants from '../../../config/constants.js';
const mobileSlow4G = constants.throttling.mobileSlow4G;

/** @typedef {import('../base-node.js').Node} Node */
/** @typedef {import('../network-node').NetworkNode} NetworkNode */
/** @typedef {import('../cpu-node').CPUNode} CpuNode */
/** @typedef {import('../network-node.js').NetworkNode} NetworkNode */
/** @typedef {import('../cpu-node.js').CPUNode} CpuNode */
/** @typedef {import('./simulator-timing-map.js').CpuNodeTimingComplete | import('./simulator-timing-map.js').NetworkNodeTimingComplete} CompleteNodeTiming */
/** @typedef {import('./simulator-timing-map.js').ConnectionTiming} ConnectionTiming */

Expand Down
1 change: 1 addition & 0 deletions core/lib/network-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
Trace: ResourceFinish.ts
*/

import * as LH from '../../types/lh.js';
import UrlUtils from './url-utils.js';

// Lightrider X-Header names for timing information.
Expand Down
1 change: 1 addition & 0 deletions core/lib/tracehouse/main-thread-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import * as LH from '../../../types/lh.js';
import {taskGroups, taskNameToGroup} from './task-groups.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion types/artifacts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import Crdp from 'devtools-protocol/types/protocol';
import {Protocol as Crdp} from 'devtools-protocol/types/protocol.js';

import {parseManifest} from '../core/lib/manifest-parser.js';
import {Simulator} from '../core/lib/dependency-graph/simulator/simulator.js';
Expand Down
20 changes: 10 additions & 10 deletions types/gatherer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import Crdp from 'devtools-protocol/types/protocol';
import CrdpMappings from 'devtools-protocol/types/protocol-mapping';
import {Protocol as Crdp} from 'devtools-protocol/types/protocol.js';
import {ProtocolMapping as CrdpMappings} from 'devtools-protocol/types/protocol-mapping.js';

import {NetworkNode as _NetworkNode} from '../core/lib/dependency-graph/network-node';
import {CPUNode as _CPUNode} from '../core/lib/dependency-graph/cpu-node';
import {Simulator as _Simulator} from '../core/lib/dependency-graph/simulator/simulator';
import {Driver} from '../core/legacy/gather/driver';
import {ExecutionContext} from '../core/gather/driver/execution-context';
import {Fetcher} from '../core/gather/fetcher';
import {ArbitraryEqualityMap} from '../core/lib/arbitrary-equality-map';
import {NetworkNode as _NetworkNode} from '../core/lib/dependency-graph/network-node.js';
import {CPUNode as _CPUNode} from '../core/lib/dependency-graph/cpu-node.js';
import {Simulator as _Simulator} from '../core/lib/dependency-graph/simulator/simulator.js';
import {Driver} from '../core/legacy/gather/driver.js';
import {ExecutionContext} from '../core/gather/driver/execution-context.js';
import {Fetcher} from '../core/gather/fetcher.js';
import {ArbitraryEqualityMap} from '../core/lib/arbitrary-equality-map.js';

import {Artifacts, BaseArtifacts, FRBaseArtifacts, GathererArtifacts, DevtoolsLog, Trace} from './artifacts.js';
import Config from './config.js';
Expand Down Expand Up @@ -155,7 +155,7 @@ declare module Gatherer {
type AnyFRGathererInstance = FRGathererInstanceExpander<Gatherer.DependencyKey>

namespace Simulation {
type GraphNode = import('../core/lib/dependency-graph/base-node').Node;
type GraphNode = import('../core/lib/dependency-graph/base-node.js').Node;
type GraphNetworkNode = _NetworkNode;
type GraphCPUNode = _CPUNode;
type Simulator = _Simulator;
Expand Down
2 changes: 1 addition & 1 deletion types/internal/query-selector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @fileoverview Stricter querySelector/querySelectorAll using typed-query-selector.
*/

import {ParseSelectorToTagNames} from 'typed-query-selector/parser';
import {ParseSelectorToTagNames} from 'typed-query-selector/parser.js';

/** Merge properties of the types in union `T`. Where properties overlap, property types becomes the union of the two (or more) possible types. */
type MergeTypes<T> = {
Expand Down
4 changes: 2 additions & 2 deletions types/lh.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import * as Artifacts_ from './artifacts.js';
import Audit_ from './audit.js';
import Budget_ from './lhr/budget.js';
import Config_ from './config.js';
import _Crdp from 'devtools-protocol/types/protocol';
import _CrdpMappings from 'devtools-protocol/types/protocol-mapping';
import {Protocol as _Crdp} from 'devtools-protocol/types/protocol.js';
import {ProtocolMapping as _CrdpMappings} from 'devtools-protocol/types/protocol-mapping.js';
import * as Externs from './externs.js';
import Gatherer_ from './gatherer.js';
import * as I18n from './lhr/i18n.js';
Expand Down
2 changes: 1 addition & 1 deletion types/protocol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import CrdpMappings from 'devtools-protocol/types/protocol-mapping';
import {ProtocolMapping as CrdpMappings} from 'devtools-protocol/types/protocol-mapping.js';

type CrdpEvents = CrdpMappings.Events;
type CrdpCommands = CrdpMappings.Commands;
Expand Down

0 comments on commit ba3104f

Please sign in to comment.