Rocky_Mountain_Vending/.pnpm-store/v10/files/15/dcbe591cc280075104b3b7507381c323d11919ff495229ef96a047584e68d8e971c55a9fa7568084cb98fa81b07c9004bdffc5be801e0238355fd8ef7bbade
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

58 lines
1.5 KiB
Text

/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {Audit} from './audit.js';
import {MainThreadTasks as MainThreadTasksComputed} from '../computed/main-thread-tasks.js';
class MainThreadTasks extends Audit {
/**
* @return {LH.Audit.Meta}
*/
static get meta() {
return {
id: 'main-thread-tasks',
scoreDisplayMode: Audit.SCORING_MODES.INFORMATIVE,
title: 'Tasks',
description: 'Lists the toplevel main thread tasks that executed during page load.',
requiredArtifacts: ['Trace'],
};
}
/**
* @param {LH.Artifacts} artifacts
* @param {LH.Audit.Context} context
* @return {Promise<LH.Audit.Product>}
*/
static async audit(artifacts, context) {
const trace = artifacts.Trace;
const tasks = await MainThreadTasksComputed.request(trace, context);
const results = tasks
// Filter to just the sizable toplevel tasks; toplevel tasks are tasks without a parent.
.filter(task => task.duration > 5 && !task.parent)
.map(task => {
return {
duration: task.duration,
startTime: task.startTime,
};
});
/** @type {LH.Audit.Details.Table['headings']} */
const headings = [
{key: 'startTime', valueType: 'ms', granularity: 1, label: 'Start Time'},
{key: 'duration', valueType: 'ms', granularity: 1, label: 'End Time'},
];
const tableDetails = Audit.makeTableDetails(headings, results);
return {
score: 1,
details: tableDetails,
};
}
}
export default MainThreadTasks;