Rocky_Mountain_Vending/.pnpm-store/v10/files/38/56ce1d169b77f0104c1afc19ba690b08a7a816bcb3ae777c4545e7645a942d7a2556d0ed6fea7b96ff25064710d36b2be50c9765f1d906d7ed8bcd671948e2
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

67 lines
1.9 KiB
Text

/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import log from 'lighthouse-logger';
import {Driver} from './driver.js';
import {Runner} from '../runner.js';
import {getEmptyArtifactState, collectPhaseArtifacts, awaitArtifacts} from './runner-helpers.js';
import {initializeConfig} from '../config/config.js';
import {getBaseArtifacts, finalizeArtifacts} from './base-artifacts.js';
/**
* @param {LH.Puppeteer.Page} page
* @param {{config?: LH.Config, flags?: LH.Flags}} [options]
* @return {Promise<LH.Gatherer.GatherResult>}
*/
async function snapshotGather(page, options = {}) {
const {flags = {}, config} = options;
log.setLevel(flags.logLevel || 'error');
const {resolvedConfig} = await initializeConfig('snapshot', config, flags);
const driver = new Driver(page);
await driver.connect();
/** @type {Map<string, LH.ArbitraryEqualityMap>} */
const computedCache = new Map();
const url = await driver.url();
const runnerOptions = {resolvedConfig, computedCache};
const gatherFn = async () => {
const baseArtifacts =
await getBaseArtifacts(resolvedConfig, driver, {gatherMode: 'snapshot'});
baseArtifacts.URL = {
finalDisplayedUrl: url,
};
const artifactDefinitions = resolvedConfig.artifacts || [];
const artifactState = getEmptyArtifactState();
await collectPhaseArtifacts({
phase: 'getArtifact',
gatherMode: 'snapshot',
driver,
page,
baseArtifacts,
artifactDefinitions,
artifactState,
computedCache,
settings: resolvedConfig.settings,
});
await driver.disconnect();
const artifacts = await awaitArtifacts(artifactState);
return finalizeArtifacts(baseArtifacts, artifacts);
};
const artifacts = await Runner.gather(gatherFn, runnerOptions);
return {artifacts, runnerOptions};
}
export {
snapshotGather,
};