Rocky_Mountain_Vending/.pnpm-store/v10/files/ff/55ed72438c487b26f4fa699f78aea007e2c8071fd3395f924b0b6f8a3b903b620d287558d0d59fe39f1e730b61c5c23eb6f127db5b11ca68b18671dbb87f39
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

50 lines
2.3 KiB
Text

/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as Lantern from '../lib/lantern/lantern.js';
import {makeComputedArtifact} from './computed-artifact.js';
import {NetworkRequest} from '../lib/network-request.js';
import {ProcessedTrace} from './processed-trace.js';
import {NetworkRecords} from './network-records.js';
import {TraceEngineResult} from './trace-engine-result.js';
class PageDependencyGraph {
/**
* @param {{trace: LH.Trace, devtoolsLog: LH.DevtoolsLog, settings: LH.Audit.Context['settings'], URL: LH.Artifacts['URL'], SourceMaps: LH.Artifacts['SourceMaps'], fromTrace: boolean}} data
* @param {LH.Artifacts.ComputedContext} context
* @return {Promise<LH.Gatherer.Simulation.GraphNode>}
*/
static async compute_(data, context) {
const {trace, settings, devtoolsLog, URL, SourceMaps} = data;
const [{mainThreadEvents}, networkRecords] = await Promise.all([
ProcessedTrace.request(trace, context),
NetworkRecords.request(devtoolsLog, context),
]);
if (data.fromTrace) {
const traceEngineResult =
await TraceEngineResult.request({trace, settings, SourceMaps}, context);
const parsedTrace = traceEngineResult.parsedTrace;
const requests =
Lantern.TraceEngineComputationData.createNetworkRequests(trace, parsedTrace);
const graph =
Lantern.TraceEngineComputationData.createGraph(requests, trace, parsedTrace, URL);
// @ts-expect-error for now, ignore that this is a SyntheticNetworkEvent instead of LH's NetworkEvent.
return graph;
}
// TODO: currently the trace version has no requests that failed, or requests that have "Preflight".
// so the following gets the devtools log version _closer_ to the exact same results as the trace.
// const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest).filter(r => !r.failed && r.resourceType !== 'Preflight');
const lanternRequests = networkRecords.map(NetworkRequest.asLanternNetworkRequest);
return Lantern.Graph.PageDependencyGraph.createGraph(mainThreadEvents, lanternRequests, URL);
}
}
const PageDependencyGraphComputed = makeComputedArtifact(PageDependencyGraph,
['devtoolsLog', 'settings', 'trace', 'URL', 'SourceMaps', 'fromTrace']);
export {PageDependencyGraphComputed as PageDependencyGraph};