diff --git a/db/config.ts b/db/config.ts index 7f0b36d..abe06b4 100644 --- a/db/config.ts +++ b/db/config.ts @@ -212,7 +212,7 @@ const Subsession = defineTable({ season_short_name: column.text(), season_year: column.number(), series_id: column.number(), - series_logo: column.text(), + series_logo: column.text({ optional: true }), series_name: column.text(), series_short_name: column.text(), session_id: column.number(), @@ -258,7 +258,7 @@ const SubsessionSessionResults = defineTable({ qual_lap_time: column.number(), starting_position: column.number(), starting_position_in_class: column.number(), - car_class_id: column.number({ references: () => CarClass.columns.car_class_id }), + car_class_id: column.number(), car_class_name: column.text(), car_class_short_name: column.text(), club_id: column.number(), @@ -284,7 +284,7 @@ const SubsessionSessionResults = defineTable({ weight_penalty_kg: column.number(), league_points: column.number(), league_agg_points: column.number(), - car_id: column.number({ references: () => Car.columns.car_id }), + car_id: column.number(), car_name: column.text(), aggregate_champ_points: column.number(), livery: column.json(), diff --git a/db/seed.ts b/db/seed.ts index 48cddde..fb1cef7 100644 --- a/db/seed.ts +++ b/db/seed.ts @@ -19,9 +19,7 @@ import cars from "./cars.json"; import carClasses from "./car-classes.json"; import seasons from "./seasons.json"; import pastSeasons from "./past-seasons-output.json"; -import jackStandings from "./jack-standings-output.json"; -import jakeStandings from "./jake-standings-output.json"; -import kyleStandings from "./kyle-standings-output.json"; +import standings from "./standings-output.json"; import seasonIdArray from "./distinct-season-ids.json"; const batchSize = 100; @@ -41,7 +39,7 @@ function delay(delayInMilliseconds: number): Promise { ); } -// @todo Re-examine this, "works" but can be better +// @todo Re-write this so it is additive or "upsert-like" rather than starting from ground 0 every time // https://astro.build/db/seed export default async function seed() { await db.delete(SubsessionRaceResults); @@ -75,7 +73,8 @@ export default async function seed() { return { ...rest, created: new Date(created), - first_sale: new Date(first_sale), + // Appears the Mini Stock doesn't have this field so just assume "now" in these cases + first_sale: first_sale ? new Date(first_sale) : new Date(), }; }) ); @@ -108,50 +107,83 @@ export default async function seed() { .flat() ); console.log("Past Seasons Seeded!"); - const standings = [...jackStandings, ...jakeStandings, ...kyleStandings]; console.log("Seeding Standings..."); - await db.insert(Standing).values( - standings.map((standing: any) => { - const { car_class_id, season_driver_data, season_id, ...rest } = standing; - return { - id: `${season_id}_${car_class_id}_${season_driver_data.cust_id}`, - car_class_id: Number(car_class_id), - season_id: Number(season_id), - ...season_driver_data, - ...rest, - }; + const allStandings = standings.map((standing: any) => { + const { car_class_id, season_driver_data, season_id, ...rest } = standing; + return { + id: `${season_id}_${car_class_id}_${season_driver_data.cust_id}`, + car_class_id: Number(car_class_id), + season_id: Number(season_id), + ...season_driver_data, + ...rest, + }; + }); + await Promise.all( + batchInserts(allStandings).map(async (batch, index) => { + const trueIndex = index + 1; + await delay(2000 * trueIndex); + console.log( + `Processing up to the ${trueIndex * batchSize}th standings result` + ); + // The following seasons appear to have had their car classes removed: + // Ring Meister Ricmotech Series - Fixed - 2024 Season 3 + // Weekly Race Challenge - 2024 Season 1 + return db.insert(Standing).values(batch.filter((v) => carClasses.map((v) => v.car_class_id).includes(v.car_class_id))); }) ); console.log("Standings Seeded!"); console.log("Seeding Subsessions..."); - const raw = fs.readFileSync("./db/subsessions-output.json"); - const subsessions = JSON.parse(String(raw)); - const subsessionsTyped = subsessions as Record; + const subsessions: Array = []; + for (let i = 1; i <= 10; i += 1) { + const raw = fs.readFileSync(`./db/${i}-subsessions-output.json`); + const batchSubsessions = JSON.parse(String(raw)); + subsessions.push(...batchSubsessions); + } const { allPracticeResults, allQualifyingResults, allRaceResults, allSubsessions, - } = Object.keys(subsessionsTyped).reduce( + } = subsessions.reduce( // @todo Provide an accurate type for the unknown here - (object: Record>, key) => { + (object: Record>, subsession) => { const { session_results, end_time, start_time, ...rest } = - subsessionsTyped[key]; + subsession; session_results.forEach((sessionResult) => { const { results, ...rest } = sessionResult; results.forEach((result) => { - const resultWithSession = { - subsession_id: key, - ...result, - ...rest, - id: `${key}_${rest.simsession_name}_${result.cust_id}`, - }; - if (rest.simsession_type_name.match("Practice")) { - object.allPracticeResults.push(resultWithSession); - } else if (rest.simsession_type_name.match("Qualifying")) { - object.allQualifyingResults.push(resultWithSession); - } else if (rest.simsession_type_name.match("Race")) { - object.allRaceResults.push(resultWithSession); + if (!result.driver_results) { + const resultWithSession = { + subsession_id: subsession.subsession_id, + ...result, + ...rest, + id: `${subsession.subsession_id}_${rest.simsession_name}_${result.cust_id}`, + }; + if (rest.simsession_type_name.match("Practice")) { + object.allPracticeResults.push(resultWithSession); + } else if (rest.simsession_type_name.match("Qualifying")) { + object.allQualifyingResults.push(resultWithSession); + } else if (rest.simsession_type_name.match("Race")) { + object.allRaceResults.push(resultWithSession); + } + } else if (result.driver_results && Array.isArray(result.driver_results)) { + result.driver_results.forEach((driverResult) => { + const resultWithSession = { + subsession_id: subsession.subsession_id, + ...driverResult, + ...rest, + // Apparently you can be entered into the EXACT SAME SPLIT on multiple teams, this accounts for that. + // @ts-expect-error + id: `${subsession.subsession_id}_${rest.simsession_name}_${driverResult.cust_id}_${driverResult.team_id}`, + }; + if (rest.simsession_type_name.match("Practice")) { + object.allPracticeResults.push(resultWithSession); + } else if (rest.simsession_type_name.match("Qualifying")) { + object.allQualifyingResults.push(resultWithSession); + } else if (rest.simsession_type_name.match("Race")) { + object.allRaceResults.push(resultWithSession); + } + }); } }); }); diff --git a/package-lock.json b/package-lock.json index cb7d5d7..d6edd20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,14 +10,14 @@ "dependencies": { "@alpinejs/collapse": "^3.14.1", "@astrojs/alpinejs": "^0.4.0", - "@astrojs/db": "^0.12.0", + "@astrojs/db": "^0.14.1", "@astrojs/sitemap": "^3.1.6", "@astrojs/tailwind": "^5.1.0", "@types/alpinejs": "^3.13.10", "@types/alpinejs__collapse": "^3.13.4", "alpinejs": "^3.14.1", - "astro": "^4.13.2", - "tailwindcss": "^3.4.9" + "astro": "^4.15.4", + "tailwindcss": "^3.4.11" } }, "node_modules/@alloc/quick-lru": { @@ -58,26 +58,25 @@ } }, "node_modules/@astrojs/compiler": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.2.tgz", - "integrity": "sha512-bvH+v8AirwpRWCkYJEyWYdc5Cs/BjG2ZTxIJzttHilXgfKJAdW2496KsUQKzf5j2tOHtaHXKKn9hb9WZiBGpEg==" + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.3.tgz", + "integrity": "sha512-bL/O7YBxsFt55YHU021oL+xz+B/9HvGNId3F9xURN16aeqDK9juHGktdkCSXz+U4nqFACq6ZFvWomOzhV+zfPw==" }, "node_modules/@astrojs/db": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@astrojs/db/-/db-0.12.0.tgz", - "integrity": "sha512-ZrHuH4sJcPE0liTG+mWc6tR7pLax4vKsDBH5hBSo3mWiGjg/jWvMhZsSclYGZ8gRi7+zUh4FDqgcBeiHVmYf6Q==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@astrojs/db/-/db-0.14.1.tgz", + "integrity": "sha512-IkZNd965/u0EsWRWwA+HtvXqRJb3Dy72c2BZXjKbIiCMwiHYSXUADlyHTy1ed5lkuJVz4AS7oujt2f6hrFB/tw==", "dependencies": { "@astrojs/studio": "0.1.1", - "@libsql/client": "^0.7.0", + "@libsql/client": "^0.10.0", "async-listen": "^3.0.1", - "ci-info": "^4.0.0", "deep-diff": "^1.0.2", "drizzle-orm": "^0.31.2", "github-slugger": "^2.0.0", "kleur": "^4.1.5", "nanoid": "^5.0.7", "open": "^10.1.0", - "ora": "^8.0.1", + "ora": "^8.1.0", "prompts": "^2.4.2", "strip-ansi": "^7.1.0", "yargs-parser": "^21.1.1", @@ -398,11 +397,11 @@ } }, "node_modules/@babel/parser": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", - "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", "dependencies": { - "@babel/types": "^7.25.2" + "@babel/types": "^7.25.6" }, "bin": { "parser": "bin/babel-parser.js" @@ -474,9 +473,9 @@ } }, "node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dependencies": { "@babel/helper-string-parser": "^7.24.8", "@babel/helper-validator-identifier": "^7.24.7", @@ -1315,29 +1314,29 @@ } }, "node_modules/@libsql/client": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@libsql/client/-/client-0.7.0.tgz", - "integrity": "sha512-1aLDtWzsErr68GZ640TVyOLkL/+lB2YK8cYvJIfiI7Mt+DEPB22Jkoz2QfBDg5PVGX/efeRHog2j/oVbUhxO8Q==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@libsql/client/-/client-0.10.0.tgz", + "integrity": "sha512-2ERn08T4XOVx34yBtUPq0RDjAdd9TJ5qNH/izugr208ml2F94mk92qC64kXyDVQINodWJvp3kAdq6P4zTtCZ7g==", "dependencies": { - "@libsql/core": "^0.7.0", - "@libsql/hrana-client": "^0.6.0", + "@libsql/core": "^0.10.0", + "@libsql/hrana-client": "^0.6.2", "js-base64": "^3.7.5", - "libsql": "^0.3.10", + "libsql": "^0.4.1", "promise-limit": "^2.7.0" } }, "node_modules/@libsql/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@libsql/core/-/core-0.7.0.tgz", - "integrity": "sha512-hCYfXa0S4t9CJtxZIWacboylrcx94ZQO0dEngH4f0f/LHg6ymHSZiubbojAwD7tNy94ahICoGPjEi6aEIyhlcQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@libsql/core/-/core-0.10.0.tgz", + "integrity": "sha512-rqynAXGaiSpTsykOZdBtI1N4z4O+KZ6mt33K/aHeXAY0gSIfK/ctxuWa0Y1Bjo4FMz1idBTCXz4Ps5kITOvZZw==", "dependencies": { "js-base64": "^3.7.5" } }, "node_modules/@libsql/darwin-arm64": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/darwin-arm64/-/darwin-arm64-0.3.19.tgz", - "integrity": "sha512-rmOqsLcDI65zzxlUOoEiPJLhqmbFsZF6p4UJQ2kMqB+Kc0Rt5/A1OAdOZ/Wo8fQfJWjR1IbkbpEINFioyKf+nQ==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/darwin-arm64/-/darwin-arm64-0.4.4.tgz", + "integrity": "sha512-2JauQh/A5KNBO5FAeZpeZ12v+OtNBSBwN2fHq6q59dpVL0Jfe5CsYWIlKxionN/0R8QxHumQw4QWqrhqtlE9Vg==", "cpu": [ "arm64" ], @@ -1347,9 +1346,9 @@ ] }, "node_modules/@libsql/darwin-x64": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/darwin-x64/-/darwin-x64-0.3.19.tgz", - "integrity": "sha512-q9O55B646zU+644SMmOQL3FIfpmEvdWpRpzubwFc2trsa+zoBlSkHuzU9v/C+UNoPHQVRMP7KQctJ455I/h/xw==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/darwin-x64/-/darwin-x64-0.4.4.tgz", + "integrity": "sha512-Yajb7sp0hZ5d9w4ZXojTu2mC7oFQ7U+IVfq5X8pSTa7uOBpxpQ4H5CQcawA3r0vDnVoS+li32bIrqaGiyAvNsQ==", "cpu": [ "x64" ], @@ -1384,9 +1383,9 @@ } }, "node_modules/@libsql/linux-arm64-gnu": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-gnu/-/linux-arm64-gnu-0.3.19.tgz", - "integrity": "sha512-mgeAUU1oqqh57k7I3cQyU6Trpdsdt607eFyEmH5QO7dv303ti+LjUvh1pp21QWV6WX7wZyjeJV1/VzEImB+jRg==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-gnu/-/linux-arm64-gnu-0.4.4.tgz", + "integrity": "sha512-lAsuCpfnS6Cr7IOjDsRFAC3vfouJm3G/Rz14nLNxGKIQV/rWX7wLFKIxYvwFQQvw0f7VdJwjUg1rkq9kGOMBTA==", "cpu": [ "arm64" ], @@ -1396,9 +1395,9 @@ ] }, "node_modules/@libsql/linux-arm64-musl": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-musl/-/linux-arm64-musl-0.3.19.tgz", - "integrity": "sha512-VEZtxghyK6zwGzU9PHohvNxthruSxBEnRrX7BSL5jQ62tN4n2JNepJ6SdzXp70pdzTfwroOj/eMwiPt94gkVRg==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-musl/-/linux-arm64-musl-0.4.4.tgz", + "integrity": "sha512-Icp1HY5gLB2fsOsnbh9sAz++dXipedoH3LI/BRHDFXlCvm2Ph45Sy9gOYOFUfNq3SZKOuy1cqVvQremySiElmg==", "cpu": [ "arm64" ], @@ -1408,9 +1407,9 @@ ] }, "node_modules/@libsql/linux-x64-gnu": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/linux-x64-gnu/-/linux-x64-gnu-0.3.19.tgz", - "integrity": "sha512-2t/J7LD5w2f63wGihEO+0GxfTyYIyLGEvTFEsMO16XI5o7IS9vcSHrxsvAJs4w2Pf907uDjmc7fUfMg6L82BrQ==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/linux-x64-gnu/-/linux-x64-gnu-0.4.4.tgz", + "integrity": "sha512-ZRMAjMEo2TdbppfqHXkvzh7iWb4OxjA4ZTcxMIP7745eJocIarexHHYR4GHVp3e3sqiM7Wg63EnvQ9dSLQM4PQ==", "cpu": [ "x64" ], @@ -1420,9 +1419,9 @@ ] }, "node_modules/@libsql/linux-x64-musl": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.3.19.tgz", - "integrity": "sha512-BLsXyJaL8gZD8+3W2LU08lDEd9MIgGds0yPy5iNPp8tfhXx3pV/Fge2GErN0FC+nzt4DYQtjL+A9GUMglQefXQ==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.4.4.tgz", + "integrity": "sha512-bRVqiBcRNsr7it23258sTP+NR3Pr1DmcLCbporyYFYeCxYNEFQXHd2JDWaGNqqu2iBEOp/P2nrjizSOlp5aCMQ==", "cpu": [ "x64" ], @@ -1432,9 +1431,9 @@ ] }, "node_modules/@libsql/win32-x64-msvc": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.3.19.tgz", - "integrity": "sha512-ay1X9AobE4BpzG0XPw1gplyLZPGHIgJOovvW23gUrukRegiUP62uzhpRbKNogLlUOynyXeq//prHgPXiebUfWg==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.4.4.tgz", + "integrity": "sha512-Snqk2CB1uHL2dDtGizJEQR3oY5zWHRroXBp90J9VmMeZgqwfU+Ivgj1WaFzz980efxsPvqK1BoFxqG316BksjA==", "cpu": [ "x64" ], @@ -1480,10 +1479,41 @@ "node": ">= 8" } }, + "node_modules/@oslojs/encoding": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-0.4.1.tgz", + "integrity": "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q==" + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.0.tgz", - "integrity": "sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz", + "integrity": "sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg==", "cpu": [ "arm" ], @@ -1493,9 +1523,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.0.tgz", - "integrity": "sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz", + "integrity": "sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g==", "cpu": [ "arm64" ], @@ -1505,9 +1535,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.0.tgz", - "integrity": "sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz", + "integrity": "sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ==", "cpu": [ "arm64" ], @@ -1517,9 +1547,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.0.tgz", - "integrity": "sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz", + "integrity": "sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA==", "cpu": [ "x64" ], @@ -1529,9 +1559,21 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.0.tgz", - "integrity": "sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz", + "integrity": "sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz", + "integrity": "sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA==", "cpu": [ "arm" ], @@ -1541,9 +1583,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.0.tgz", - "integrity": "sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz", + "integrity": "sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw==", "cpu": [ "arm64" ], @@ -1553,9 +1595,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.0.tgz", - "integrity": "sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz", + "integrity": "sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ==", "cpu": [ "arm64" ], @@ -1565,11 +1607,11 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.0.tgz", - "integrity": "sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz", + "integrity": "sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw==", "cpu": [ - "ppc64le" + "ppc64" ], "optional": true, "os": [ @@ -1577,9 +1619,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.0.tgz", - "integrity": "sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz", + "integrity": "sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ==", "cpu": [ "riscv64" ], @@ -1589,9 +1631,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.0.tgz", - "integrity": "sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz", + "integrity": "sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg==", "cpu": [ "s390x" ], @@ -1601,9 +1643,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.0.tgz", - "integrity": "sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz", + "integrity": "sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==", "cpu": [ "x64" ], @@ -1613,9 +1655,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.0.tgz", - "integrity": "sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz", + "integrity": "sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg==", "cpu": [ "x64" ], @@ -1625,9 +1667,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.0.tgz", - "integrity": "sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz", + "integrity": "sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q==", "cpu": [ "arm64" ], @@ -1637,9 +1679,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.0.tgz", - "integrity": "sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz", + "integrity": "sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA==", "cpu": [ "ia32" ], @@ -1649,9 +1691,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.0.tgz", - "integrity": "sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz", + "integrity": "sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA==", "cpu": [ "x64" ], @@ -1661,13 +1703,50 @@ ] }, "node_modules/@shikijs/core": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.12.1.tgz", - "integrity": "sha512-biCz/mnkMktImI6hMfMX3H9kOeqsInxWEyCHbSlL8C/2TR1FqfmGxTLRNwYCKsyCyxWLbB8rEqXRVZuyxuLFmA==", + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.17.4.tgz", + "integrity": "sha512-d2RqLWGJDPGThosjMs472B+NLVRUbQSAez/UV9d9rKE/zLbSmPQ73me308ofPSALKwUv2RkuX8umkIdl97boig==", + "dependencies": { + "@shikijs/engine-javascript": "1.17.4", + "@shikijs/engine-oniguruma": "1.17.4", + "@shikijs/types": "1.17.4", + "@shikijs/vscode-textmate": "^9.2.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.2" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.17.4.tgz", + "integrity": "sha512-qWulwA32cbvVxdthAB1w4DIeXn2+HC1Q5rO0KChnVkFA9xzmy2VH1W3CvmMGEyXo0GjQerovhREcxZh1FlgJ1A==", + "dependencies": { + "@shikijs/types": "1.17.4", + "oniguruma-to-js": "0.4.0" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.17.4.tgz", + "integrity": "sha512-7yLBEwkwrr3zYF17tJk56SXHl+0GIMeb0dSKW9jxOsYPfjIU+19nHogURpr5r9Ey03m73i3pj2cthqj5Ui8MNg==", + "dependencies": { + "@shikijs/types": "1.17.4", + "@shikijs/vscode-textmate": "^9.2.2" + } + }, + "node_modules/@shikijs/types": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.17.4.tgz", + "integrity": "sha512-gh2PuD5wmqVlWWIyCpLpmVyl0PuN8IEBc86Mvj89g6LiEsqFOsCCdvk6znd0spRu+0y78aP0PA8mQV58RA3igA==", "dependencies": { + "@shikijs/vscode-textmate": "^9.2.2", "@types/hast": "^3.0.4" } }, + "node_modules/@shikijs/vscode-textmate": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.2.2.tgz", + "integrity": "sha512-TMp15K+GGYrWlZM8+Lnj9EaHEFmOen0WJBrfa17hF7taDOYthuPPV0GWzfd/9iMij0akS/8Yw2ikquH7uVi/fg==" + }, "node_modules/@types/alpinejs": { "version": "3.13.10", "resolved": "https://registry.npmjs.org/@types/alpinejs/-/alpinejs-3.13.10.tgz", @@ -1930,20 +2009,19 @@ } }, "node_modules/astro": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.13.2.tgz", - "integrity": "sha512-bdfUV6zfOWOV/IbROqVx+1cuAFXY0PZpVxr4JO9YxCKa5AfQRR8RKXJ2k8QUjalA6dmxQ9FgAQw3FRrzHVOGEQ==", + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.15.4.tgz", + "integrity": "sha512-wqy+m3qygt9DmCSqMsckxyK4ccCUFtti2d/WlLkEpAlqHgyDIg20zRTLHO2v/H4YeSlJ8sAcN0RW2FhOeYbINg==", "dependencies": { - "@astrojs/compiler": "^2.10.1", + "@astrojs/compiler": "^2.10.3", "@astrojs/internal-helpers": "0.4.1", "@astrojs/markdown-remark": "5.2.0", "@astrojs/telemetry": "3.1.0", "@babel/core": "^7.25.2", - "@babel/generator": "^7.25.0", - "@babel/parser": "^7.25.3", "@babel/plugin-transform-react-jsx": "^7.25.2", - "@babel/traverse": "^7.25.3", - "@babel/types": "^7.25.2", + "@babel/types": "^7.25.6", + "@oslojs/encoding": "^0.4.1", + "@rollup/pluginutils": "^5.1.0", "@types/babel__core": "^7.20.5", "@types/cookie": "^0.6.0", "acorn": "^8.12.1", @@ -1964,8 +2042,8 @@ "es-module-lexer": "^1.5.4", "esbuild": "^0.21.5", "estree-walker": "^3.0.3", - "execa": "^8.0.1", "fast-glob": "^3.3.2", + "fastq": "^1.17.1", "flattie": "^1.1.1", "github-slugger": "^2.0.0", "gray-matter": "^4.0.3", @@ -1974,8 +2052,11 @@ "js-yaml": "^4.1.0", "kleur": "^4.1.5", "magic-string": "^0.30.11", + "magicast": "^0.3.5", + "micromatch": "^4.0.8", "mrmime": "^2.0.0", - "ora": "^8.0.1", + "neotraverse": "^0.6.18", + "ora": "^8.1.0", "p-limit": "^6.1.0", "p-queue": "^8.0.1", "path-to-regexp": "^6.2.2", @@ -1983,18 +2064,21 @@ "prompts": "^2.4.2", "rehype": "^13.0.1", "semver": "^7.6.3", - "shiki": "^1.12.1", + "shiki": "^1.16.1", "string-width": "^7.2.0", "strip-ansi": "^7.1.0", - "tsconfck": "^3.1.1", + "tinyexec": "^0.3.0", + "tsconfck": "^3.1.3", "unist-util-visit": "^5.0.0", - "vfile": "^6.0.2", - "vite": "^5.3.5", - "vitefu": "^0.2.5", + "vfile": "^6.0.3", + "vite": "^5.4.2", + "vitefu": "^1.0.2", "which-pm": "^3.0.0", + "xxhash-wasm": "^1.0.2", "yargs-parser": "^21.1.1", "zod": "^3.23.8", - "zod-to-json-schema": "^3.23.2" + "zod-to-json-schema": "^3.23.2", + "zod-to-ts": "^1.2.0" }, "bin": { "astro": "astro.js" @@ -2341,14 +2425,14 @@ } }, "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", "dependencies": { - "restore-cursor": "^4.0.0" + "restore-cursor": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2467,19 +2551,6 @@ "node": ">= 0.6" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -2868,28 +2939,6 @@ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2922,9 +2971,9 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } @@ -3070,17 +3119,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/github-slugger": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", @@ -3259,15 +3297,14 @@ } }, "node_modules/hast-util-to-html": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.0.tgz", - "integrity": "sha512-IVGhNgg7vANuUA2XKrT6sOIIPgaYZnmLx3l/CCOAK0PtgfoHrZwX7jCSYyFxHTrGmC6S9q8aQQekjp4JPZF+cw==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.2.tgz", + "integrity": "sha512-RP5wNpj5nm1Z8cloDv4Sl4RS8jH5HYa0v93YB6Wb4poEzgMo/dAAL0KcT4974dCjcNG5pkLqTImeFHHCwwfY3g==", "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", "comma-separated-tokens": "^2.0.0", - "hast-util-raw": "^9.0.0", "hast-util-whitespace": "^3.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", @@ -3361,14 +3398,6 @@ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "engines": { - "node": ">=16.17.0" - } - }, "node_modules/import-meta-resolve": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz", @@ -3516,17 +3545,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-unicode-supported": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.0.0.tgz", @@ -3552,11 +3570,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, "node_modules/jiti": { "version": "1.21.0", "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", @@ -3630,9 +3643,9 @@ } }, "node_modules/libsql": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/libsql/-/libsql-0.3.19.tgz", - "integrity": "sha512-Aj5cQ5uk/6fHdmeW0TiXK42FqUlwx7ytmMLPSaUQPin5HKKKuUPD62MAbN4OEweGBBI7q1BekoEN4gPUEL6MZA==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/libsql/-/libsql-0.4.4.tgz", + "integrity": "sha512-Ub1YDlfAKOst9xoHMOb1dhgcu8qkMP6IM+xZoEptQuPtFe+w3ShRvJMa9FvI7FI5EEG/B4FXLLXPS9utMQq5xQ==", "cpu": [ "x64", "arm64", @@ -3645,17 +3658,16 @@ ], "dependencies": { "@neon-rs/load": "^0.0.4", - "detect-libc": "2.0.2", - "libsql": "^0.3.15" + "detect-libc": "2.0.2" }, "optionalDependencies": { - "@libsql/darwin-arm64": "0.3.19", - "@libsql/darwin-x64": "0.3.19", - "@libsql/linux-arm64-gnu": "0.3.19", - "@libsql/linux-arm64-musl": "0.3.19", - "@libsql/linux-x64-gnu": "0.3.19", - "@libsql/linux-x64-musl": "0.3.19", - "@libsql/win32-x64-msvc": "0.3.19" + "@libsql/darwin-arm64": "0.4.4", + "@libsql/darwin-x64": "0.4.4", + "@libsql/linux-arm64-gnu": "0.4.4", + "@libsql/linux-arm64-musl": "0.4.4", + "@libsql/linux-x64-gnu": "0.4.4", + "@libsql/linux-x64-musl": "0.4.4", + "@libsql/win32-x64-msvc": "0.4.4" } }, "node_modules/lilconfig": { @@ -3770,6 +3782,16 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/magicast": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", + "dependencies": { + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", + "source-map-js": "^1.2.0" + } + }, "node_modules/markdown-table": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", @@ -4000,11 +4022,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4549,23 +4566,23 @@ ] }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4622,6 +4639,14 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/neotraverse": { + "version": "0.6.18", + "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.18.tgz", + "integrity": "sha512-Z4SmBUweYa09+o6pG+eASabEpP6QkQ70yHj351pQoEXIs8uHbaU2DWVmzBANKgflPa47A50PtB2+NgRpQvr7vA==", + "engines": { + "node": ">= 10" + } + }, "node_modules/nlcst-to-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz", @@ -4690,31 +4715,6 @@ "node": ">=0.10.0" } }, - "node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -4740,19 +4740,30 @@ } }, "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", "dependencies": { - "mimic-fn": "^4.0.0" + "mimic-function": "^5.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/oniguruma-to-js": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.0.tgz", + "integrity": "sha512-GwNFPQygkpDjO9MOr54Rqi01dGS+h9VAS//Qxz9lTN5B09CxqiIc7rydvdV+Ex2Z8Vk+zqfHH7hU6ePn8uf+Mg==", + "dependencies": { + "regex": "^4.3.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/open": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", @@ -4771,18 +4782,18 @@ } }, "node_modules/ora": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-8.0.1.tgz", - "integrity": "sha512-ANIvzobt1rls2BDny5fWZ3ZVKyD6nscLvfFRpQgfWsythlcsVUC9kL0zq6j2Z5z9wwp1kd7wpsD/T9qNPVLCaQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-8.1.0.tgz", + "integrity": "sha512-GQEkNkH/GHOhPFXcqZs3IDahXEQcQxsSjEkK4KvEEST4t7eNzoMjxTzef+EZ+JluDEV+Raoi3WQ2CflnRdSVnQ==", "dependencies": { "chalk": "^5.3.0", - "cli-cursor": "^4.0.0", + "cli-cursor": "^5.0.0", "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.0.0", "log-symbols": "^6.0.0", - "stdin-discarder": "^0.2.1", - "string-width": "^7.0.0", + "stdin-discarder": "^0.2.2", + "string-width": "^7.2.0", "strip-ansi": "^7.1.0" }, "engines": { @@ -4920,14 +4931,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -4982,9 +4985,9 @@ } }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.45", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", + "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", "funding": [ { "type": "opencollective", @@ -5212,6 +5215,11 @@ "node": ">=8.10.0" } }, + "node_modules/regex": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/regex/-/regex-4.3.2.tgz", + "integrity": "sha512-kK/AA3A9K6q2js89+VMymcboLOlF5lZRCYJv3gzszXFHBr6kO6qLGzbm+UIugBEV8SMMKCTR59txoY6ctRHYVw==" + }, "node_modules/rehype": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.1.tgz", @@ -5362,47 +5370,20 @@ } }, "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/restore-cursor/node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/restore-cursor/node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", "dependencies": { - "mimic-fn": "^2.1.0" + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" }, "engines": { - "node": ">=6" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/restore-cursor/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, "node_modules/retext": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/retext/-/retext-9.0.0.tgz", @@ -5470,9 +5451,9 @@ } }, "node_modules/rollup": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.0.tgz", - "integrity": "sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.3.tgz", + "integrity": "sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA==", "dependencies": { "@types/estree": "1.0.5" }, @@ -5484,21 +5465,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.14.0", - "@rollup/rollup-android-arm64": "4.14.0", - "@rollup/rollup-darwin-arm64": "4.14.0", - "@rollup/rollup-darwin-x64": "4.14.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.14.0", - "@rollup/rollup-linux-arm64-gnu": "4.14.0", - "@rollup/rollup-linux-arm64-musl": "4.14.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.14.0", - "@rollup/rollup-linux-riscv64-gnu": "4.14.0", - "@rollup/rollup-linux-s390x-gnu": "4.14.0", - "@rollup/rollup-linux-x64-gnu": "4.14.0", - "@rollup/rollup-linux-x64-musl": "4.14.0", - "@rollup/rollup-win32-arm64-msvc": "4.14.0", - "@rollup/rollup-win32-ia32-msvc": "4.14.0", - "@rollup/rollup-win32-x64-msvc": "4.14.0", + "@rollup/rollup-android-arm-eabi": "4.21.3", + "@rollup/rollup-android-arm64": "4.21.3", + "@rollup/rollup-darwin-arm64": "4.21.3", + "@rollup/rollup-darwin-x64": "4.21.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.21.3", + "@rollup/rollup-linux-arm-musleabihf": "4.21.3", + "@rollup/rollup-linux-arm64-gnu": "4.21.3", + "@rollup/rollup-linux-arm64-musl": "4.21.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3", + "@rollup/rollup-linux-riscv64-gnu": "4.21.3", + "@rollup/rollup-linux-s390x-gnu": "4.21.3", + "@rollup/rollup-linux-x64-gnu": "4.21.3", + "@rollup/rollup-linux-x64-musl": "4.21.3", + "@rollup/rollup-win32-arm64-msvc": "4.21.3", + "@rollup/rollup-win32-ia32-msvc": "4.21.3", + "@rollup/rollup-win32-x64-msvc": "4.21.3", "fsevents": "~2.3.2" } }, @@ -5612,31 +5594,16 @@ "node": ">=8" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, "node_modules/shiki": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.12.1.tgz", - "integrity": "sha512-nwmjbHKnOYYAe1aaQyEBHvQymJgfm86ZSS7fT8OaPRr4sbAcBNz7PbfAikMEFSDQ6se2j2zobkXvVKcBOm0ysg==", - "dependencies": { - "@shikijs/core": "1.12.1", + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.17.4.tgz", + "integrity": "sha512-cuezOGFn2AA9b+ItofDOB6/ap3AosrgV7Wqxeo9c5L4Df0+HtiGt0WlBrM4gtWK5cR96+5Ef17syu4FDL9/Acg==", + "dependencies": { + "@shikijs/core": "1.17.4", + "@shikijs/engine-javascript": "1.17.4", + "@shikijs/engine-oniguruma": "1.17.4", + "@shikijs/types": "1.17.4", + "@shikijs/vscode-textmate": "^9.2.2", "@types/hast": "^3.0.4" } }, @@ -5801,17 +5768,6 @@ "node": ">=0.10.0" } }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/sucrase": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", @@ -5856,9 +5812,9 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.9.tgz", - "integrity": "sha512-1SEOvRr6sSdV5IDf9iC+NU4dhwdqzF4zKKq3sAbasUWHEM6lsMhX+eNN5gkPx1BvLFEnZQEUFbXnGj8Qlp83Pg==", + "version": "3.4.11", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.11.tgz", + "integrity": "sha512-qhEuBcLemjSJk5ajccN9xJFtM/h0AVCPaA6C92jNP+M2J8kX+eMJHI7R2HFKUvvAsMpcfLILMCFYSeDwpMmlUg==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", @@ -5929,6 +5885,11 @@ "node": ">=0.8" } }, + "node_modules/tinyexec": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.0.tgz", + "integrity": "sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==" + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -5972,9 +5933,9 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "node_modules/tsconfck": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.1.tgz", - "integrity": "sha512-00eoI6WY57SvZEVjm13stEVE90VkEdJAFGgpFLTsZbJyW/LwFQ7uQxJHWpZ2hzSWgCPKc9AnBnNP+0X7o3hAmQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.3.tgz", + "integrity": "sha512-ulNZP1SVpRDesxeMLON/LtWM8HIgAJEIVpVVhBM6gsmvQ8+Rh+ZG7FWGvHh7Ah3pRABwVJWklWCr/BTZSv0xnQ==", "bin": { "tsconfck": "bin/tsconfck.js" }, @@ -6007,6 +5968,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -6179,12 +6153,11 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/vfile": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.2.tgz", - "integrity": "sha512-zND7NlS8rJYb/sPqkb13ZvbbUoExdbi4w3SfRrMq6R3FvnLQmmfpajJNITuuYm6AZ5uao9vy4BAos3EXBPf2rg==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", "dependencies": { "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0", "vfile-message": "^4.0.0" }, "funding": { @@ -6219,13 +6192,13 @@ } }, "node_modules/vite": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", - "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.4.tgz", + "integrity": "sha512-RHFCkULitycHVTtelJ6jQLd+KSAAzOgEYorV32R2q++M6COBjKJR6BxqClwp5sf0XaBDjVMuJ9wnNfyAJwjMkA==", "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -6244,6 +6217,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -6261,6 +6235,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, @@ -6273,9 +6250,13 @@ } }, "node_modules/vitefu": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", - "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.0.2.tgz", + "integrity": "sha512-0/iAvbXyM3RiPPJ4lyD4w6Mjgtf4ejTK6TPvTNG3H32PLwuT0N/ZjJLiXug7ETE/LWtTeHw9WRv7uX/tIKYyKg==", + "workspaces": [ + "tests/deps/*", + "tests/projects/*" + ], "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, @@ -6302,20 +6283,6 @@ "node": ">= 8" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/which-pm": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-3.0.0.tgz", @@ -6443,6 +6410,11 @@ } } }, + "node_modules/xxhash-wasm": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.0.2.tgz", + "integrity": "sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==" + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -6491,6 +6463,15 @@ "zod": "^3.23.3" } }, + "node_modules/zod-to-ts": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-1.2.0.tgz", + "integrity": "sha512-x30XE43V+InwGpvTySRNz9kB7qFU8DlyEy7BsSTCHPH1R0QasMmHWZDCzYm6bVXtj/9NNJAZF3jW8rzFvH5OFA==", + "peerDependencies": { + "typescript": "^4.9.4 || ^5.0.2", + "zod": "^3" + } + }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", diff --git a/package.json b/package.json index 0ff367c..70fd474 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,13 @@ "dependencies": { "@alpinejs/collapse": "^3.14.1", "@astrojs/alpinejs": "^0.4.0", - "@astrojs/db": "^0.12.0", + "@astrojs/db": "^0.14.1", "@astrojs/sitemap": "^3.1.6", "@astrojs/tailwind": "^5.1.0", "@types/alpinejs": "^3.13.10", "@types/alpinejs__collapse": "^3.13.4", "alpinejs": "^3.14.1", - "astro": "^4.13.2", - "tailwindcss": "^3.4.9" + "astro": "^4.15.4", + "tailwindcss": "^3.4.11" } } diff --git a/src/lib/components/subsession/header.astro b/src/lib/components/subsession/header.astro index 48d6014..4fee2c3 100644 --- a/src/lib/components/subsession/header.astro +++ b/src/lib/components/subsession/header.astro @@ -6,16 +6,15 @@ const { series_logo, season_name, race_week_num, max_weeks } = subsession;
-
- + Series Logo -
+ />
) : <>}

{season_name}

Week {race_week_num + 1} of {max_weeks}

diff --git a/src/lib/layouts/default.astro b/src/lib/layouts/default.astro index 3050dc7..222d528 100644 --- a/src/lib/layouts/default.astro +++ b/src/lib/layouts/default.astro @@ -5,9 +5,7 @@ const seoDescription = description || "An iRacing planner and statistics analyzer"; const primaryNavigationLinks = [ { href: "/Stat-N-Track/", label: "Home" }, - { href: "/Stat-N-Track/user/300752/", label: "Jacob Collins" }, - { href: "/Stat-N-Track/user/815162/", label: "Jack Glenzinski" }, - { href: "/Stat-N-Track/user/251134", label: 'Kyle Klendworth' }, + { href: "/Stat-N-Track/users/", label: "Drivers" }, { href: "/Stat-N-Track/shared-subsessions/", label: "Shared Subsessions" }, ]; const schedulingLinks = id && ['300752', '815162'].includes(id) ? [ diff --git a/src/lib/types/index.ts b/src/lib/types/index.ts index 58d24a2..55e8168 100644 --- a/src/lib/types/index.ts +++ b/src/lib/types/index.ts @@ -135,6 +135,8 @@ export type SessionResult = { watched: boolean; friend: boolean; ai: boolean; + // @todo Determine if this needs to be migrated away from this type + driver_results?: Array }; export type Subsession = { diff --git a/src/lib/utils/background-color-by-user.ts b/src/lib/utils/background-color-by-user.ts index 8530e1f..bae5fba 100644 --- a/src/lib/utils/background-color-by-user.ts +++ b/src/lib/utils/background-color-by-user.ts @@ -1,25 +1,27 @@ -export const bgColorByUserId = (userId: number): string => { - if (userId === 251134) { - return "bg-red-700"; - } - if (userId === 300752) { - return "bg-orange-700"; - } - if (userId === 815162) { - return "bg-purple-700"; - } - return ""; -}; +const userIdMap: Map = new Map([ + [182407, "bg-amber-700"], + [188056, "bg-gray-700"], + [251134, "bg-red-700"], + [300752, "bg-orange-700"], + [589449, "bg-blue-700"], + [714312, "bg-yellow-700"], + [746377, "bg-green-700"], + [815162, "bg-purple-700"], +]); -export const bgColorByUserDisplayName = (displayName: string): string => { - if (displayName === "Kyle Klendworth") { - return "bg-red-700"; - } - if (displayName === "Jacob Collins") { - return "bg-orange-700"; - } - if (displayName === "Jack Glenzinski") { - return "bg-purple-700"; - } - return ""; -}; +const displayNameMap: Map = new Map([ + ["Antonio Estrada", "bg-amber-700"], + ["Doug South", "bg-gray-700"], + ["Kyle Klendworth", "bg-red-700"], + ["Jacob Collins", "bg-orange-700"], + ["Bryan Campbell2", "bg-blue-700"], + ["Sam Karasala", "bg-yellow-700"], + ["Ty Quila", "bg-green-700"], + ["Jack Glenzinski", "bg-purple-700"], +]); + +export const bgColorByUserId = (userId: number): string => + userIdMap.get(userId) || ""; + +export const bgColorByUserDisplayName = (displayName: string): string => + displayNameMap.get(displayName) || ""; diff --git a/src/lib/utils/generate-season-weeks.ts b/src/lib/utils/generate-season-weeks.ts index 1207373..56b793a 100644 --- a/src/lib/utils/generate-season-weeks.ts +++ b/src/lib/utils/generate-season-weeks.ts @@ -5,8 +5,8 @@ export default ({ }: { seasons: Array<{ schedules: Array<{ start_date: string }> }>; }) => { - const seasonStart = Date.UTC(2024, 5, 11, 0, 0, 0, 0); - const seasonEnd = Date.UTC(2024, 7, 28, 0, 0, 0, 0); + const seasonStart = Date.UTC(2024, 8, 10, 0, 0, 0, 0); + const seasonEnd = Date.UTC(2024, 11, 4, 0, 0, 0, 0); const startDates = seasons.reduce( ( set: Set, diff --git a/src/lib/utils/user-ids.ts b/src/lib/utils/user-ids.ts index f29b7c6..1ba0c70 100644 --- a/src/lib/utils/user-ids.ts +++ b/src/lib/utils/user-ids.ts @@ -1 +1 @@ -export default [251134, 300752, 815162]; +export default [182407, 188056, 251134, 300752, 589449, 714312, 746377, 815162]; diff --git a/src/pages/shared-subsessions.astro b/src/pages/shared-subsessions.astro index 9203e30..2148d89 100644 --- a/src/pages/shared-subsessions.astro +++ b/src/pages/shared-subsessions.astro @@ -53,59 +53,12 @@ const subsessionIdToSharedRaceResultsMap = sharedSubsessionRaceResults.reduce( new Map() ); const headToHeadWins: Record> = {}; -const results = sharedSubsessions.map((subsession) => { - const { - subsession_id, - track, - allowed_licenses, - license_category, - event_average_lap, - event_laps_complete, - event_strength_of_field, - num_caution_laps, - num_cautions, - num_lead_changes, - race_week_num, - season_name, - } = subsession; - // Current Users in race session - const subsessionResultsForId = - subsessionIdToSharedRaceResultsMap.get(subsession_id); - const results = - subsessionResultsForId && Array.isArray(subsessionResultsForId) - ? subsessionResultsForId.sort((x, y) => { - if (x.finish_position > y.finish_position) { - return 1; - } else if (y.finish_position > x.finish_position) { - return -1; - } - return 0; - }) - : []; - - const [winner] = results; - const { display_name, simsession_type_name } = winner; - const session = { - simsession_type_name, - results, - }; - if (headToHeadWins[display_name]) { - headToHeadWins[display_name].push(subsession_id); - } else { - headToHeadWins[display_name] = [subsession_id]; - } - const { group_name: License } = Array.isArray(allowed_licenses) - ? (allowed_licenses.slice(0, 2).pop() as LicenseType) - : { group_name: "" }; - const assertTrackAsTrackType = () => track as Track; - const trackInfo = assertTrackAsTrackType(); - return { - subsessionInfo: { +const results = sharedSubsessions + .map((subsession) => { + const { subsession_id, - Track: `${trackInfo.track_name} ${ - trackInfo.config_name !== "N/A" ? trackInfo.config_name : "" - }`, - License, + track, + allowed_licenses, license_category, event_average_lap, event_laps_complete, @@ -115,10 +68,65 @@ const results = sharedSubsessions.map((subsession) => { num_lead_changes, race_week_num, season_name, - }, - session, - }; -}); + } = subsession; + // Current Users in race session + const subsessionResultsForId = + subsessionIdToSharedRaceResultsMap.get(subsession_id); + const results = + subsessionResultsForId && + Array.isArray(subsessionResultsForId) && + new Set(subsessionResultsForId.map((result) => result.finish_position)) + .size > 1 + ? subsessionResultsForId.sort((x, y) => { + if (x.finish_position > y.finish_position) { + return 1; + } else if (y.finish_position > x.finish_position) { + return -1; + } + return 0; + }) + : []; + + if (results.length) { + const [winner] = results; + const { display_name, simsession_type_name } = winner; + const session = { + simsession_type_name, + results, + }; + if (headToHeadWins[display_name]) { + headToHeadWins[display_name].push(subsession_id); + } else { + headToHeadWins[display_name] = [subsession_id]; + } + const { group_name: License } = Array.isArray(allowed_licenses) + ? (allowed_licenses.slice(0, 2).pop() as LicenseType) + : { group_name: "" }; + const assertTrackAsTrackType = () => track as Track; + const trackInfo = assertTrackAsTrackType(); + return { + subsessionInfo: { + subsession_id, + Track: `${trackInfo.track_name} ${ + trackInfo.config_name !== "N/A" ? trackInfo.config_name : "" + }`, + License, + license_category, + event_average_lap, + event_laps_complete, + event_strength_of_field, + num_caution_laps, + num_cautions, + num_lead_changes, + race_week_num, + season_name, + }, + session, + }; + } + return null; + }) + .filter((v) => v); export const handleKey = ({ key, subsessionInfo, @@ -182,7 +190,7 @@ const description = "Shared subsessions for all Stat 'n' Track users"; x-data={JSON.stringify( results.reduce((object: Record, result) => { object.previouslyToggled = ""; - object[`toggle${result.subsessionInfo.subsession_id}`] = false; + object[`toggle${result?.subsessionInfo.subsession_id}`] = false; return object; }, {}) )} @@ -193,15 +201,15 @@ const description = "Shared subsessions for all Stat 'n' Track users"; { results.map((result) => ( )) } @@ -217,6 +225,7 @@ const description = "Shared subsessions for all Stat 'n' Track users"; { + // @ts-expect-error Object.keys(results[0].subsessionInfo).map((key) => ( - ))} + { + // @ts-expect-error + Object.keys(result.subsessionInfo).map((key) => ( + + )) + } )) } diff --git a/src/pages/user/[id]/subsessions/by-car-class/[carClassId].astro b/src/pages/user/[id]/subsessions/by-car-class/[carClassId].astro index b55622b..0cf0212 100644 --- a/src/pages/user/[id]/subsessions/by-car-class/[carClassId].astro +++ b/src/pages/user/[id]/subsessions/by-car-class/[carClassId].astro @@ -35,8 +35,33 @@ export async function getStaticPaths() { const { id, carClassId } = Astro.params; const seoTitle = `Subsessions list for user ID - ${id} and car class ID - ${carClassId}`; const seoDescription = seoTitle; -const subsessions = await db - .select() +const rawSubsessions = await db + .select({ + subsession_id: Subsession.subsession_id, + track: Subsession.track, + corners_per_lap: Subsession.corners_per_lap, + allowed_licenses: Subsession.allowed_licenses, + license_category: Subsession.license_category, + finish_position: SubsessionRaceResults.finish_position, + finish_position_in_class: SubsessionRaceResults.finish_position_in_class, + laps_lead: SubsessionRaceResults.laps_lead, + laps_complete: SubsessionRaceResults.laps_complete, + average_lap: SubsessionRaceResults.average_lap, + best_lap_time: SubsessionRaceResults.best_lap_time, + reason_out: SubsessionRaceResults.reason_out, + champ_points: SubsessionRaceResults.champ_points, + starting_position: SubsessionRaceResults.starting_position, + starting_position_in_class: + SubsessionRaceResults.starting_position_in_class, + car_class_short_name: SubsessionRaceResults.car_class_short_name, + division_name: SubsessionRaceResults.division_name, + new_license_level: SubsessionRaceResults.new_license_level, + new_cpi: SubsessionRaceResults.new_cpi, + newi_rating: SubsessionRaceResults.newi_rating, + incidents: SubsessionRaceResults.incidents, + car_name: SubsessionRaceResults.car_name, + aggregate_champ_points: SubsessionRaceResults.aggregate_champ_points, + }) .from(SubsessionRaceResults) .innerJoin( Subsession, @@ -50,6 +75,24 @@ const subsessions = await db ) ) .orderBy(desc(Subsession.subsession_id)); +const subsessions = rawSubsessions.map((subsession) => { + const { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + ...rest + } = subsession; + const Subsession = { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + }; + return { Subsession, SubsessionRaceResults: rest }; +}); --- diff --git a/src/pages/user/[id]/subsessions/by-track/[trackSlug].astro b/src/pages/user/[id]/subsessions/by-track/[trackSlug].astro index 45dbb82..9cc7e36 100644 --- a/src/pages/user/[id]/subsessions/by-track/[trackSlug].astro +++ b/src/pages/user/[id]/subsessions/by-track/[trackSlug].astro @@ -60,8 +60,33 @@ const tracksFromDb: Array<{ track: unknown | Track }> = await db const tracks = tracksFromDb as Array<{ track: Track }>; const generatedTrackMap = generateTrackMap({ tracks }); const { trackName, configName } = generatedTrackMap.get(trackSlug) || {}; -const allSubsessionsForTrack = await db - .select() +const rawSubsessions = await db + .select({ + subsession_id: Subsession.subsession_id, + track: Subsession.track, + corners_per_lap: Subsession.corners_per_lap, + allowed_licenses: Subsession.allowed_licenses, + license_category: Subsession.license_category, + finish_position: SubsessionRaceResults.finish_position, + finish_position_in_class: SubsessionRaceResults.finish_position_in_class, + laps_lead: SubsessionRaceResults.laps_lead, + laps_complete: SubsessionRaceResults.laps_complete, + average_lap: SubsessionRaceResults.average_lap, + best_lap_time: SubsessionRaceResults.best_lap_time, + reason_out: SubsessionRaceResults.reason_out, + champ_points: SubsessionRaceResults.champ_points, + starting_position: SubsessionRaceResults.starting_position, + starting_position_in_class: + SubsessionRaceResults.starting_position_in_class, + car_class_short_name: SubsessionRaceResults.car_class_short_name, + division_name: SubsessionRaceResults.division_name, + new_license_level: SubsessionRaceResults.new_license_level, + new_cpi: SubsessionRaceResults.new_cpi, + newi_rating: SubsessionRaceResults.newi_rating, + incidents: SubsessionRaceResults.incidents, + car_name: SubsessionRaceResults.car_name, + aggregate_champ_points: SubsessionRaceResults.aggregate_champ_points, + }) .from(Subsession) .innerJoin( SubsessionRaceResults, @@ -75,14 +100,31 @@ const allSubsessionsForTrack = await db ) ) .orderBy(desc(Subsession.subsession_id)); -const subsessions = allSubsessionsForTrack.filter( - ({ - Subsession: { +const subsessions = rawSubsessions + .filter( + ({ // @ts-expect-error track: { track_name, config_name }, - }, - }) => track_name === trackName && config_name === configName -); + }) => track_name === trackName && config_name === configName + ) + .map((subsession) => { + const { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + ...rest + } = subsession; + const Subsession = { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + }; + return { Subsession, SubsessionRaceResults: rest }; + }); --- diff --git a/src/pages/user/[id]/subsessions/by-year/[year].astro b/src/pages/user/[id]/subsessions/by-year/[year].astro index deba855..cbb9e1b 100644 --- a/src/pages/user/[id]/subsessions/by-year/[year].astro +++ b/src/pages/user/[id]/subsessions/by-year/[year].astro @@ -37,8 +37,33 @@ export async function getStaticPaths() { const { id, year } = Astro.params; const seoTitle = `Subsessions list for user ID - ${id} and year - ${year}`; const seoDescription = seoTitle; -const subsessions = await db - .select() +const rawSubsessions = await db + .select({ + subsession_id: Subsession.subsession_id, + track: Subsession.track, + corners_per_lap: Subsession.corners_per_lap, + allowed_licenses: Subsession.allowed_licenses, + license_category: Subsession.license_category, + finish_position: SubsessionRaceResults.finish_position, + finish_position_in_class: SubsessionRaceResults.finish_position_in_class, + laps_lead: SubsessionRaceResults.laps_lead, + laps_complete: SubsessionRaceResults.laps_complete, + average_lap: SubsessionRaceResults.average_lap, + best_lap_time: SubsessionRaceResults.best_lap_time, + reason_out: SubsessionRaceResults.reason_out, + champ_points: SubsessionRaceResults.champ_points, + starting_position: SubsessionRaceResults.starting_position, + starting_position_in_class: + SubsessionRaceResults.starting_position_in_class, + car_class_short_name: SubsessionRaceResults.car_class_short_name, + division_name: SubsessionRaceResults.division_name, + new_license_level: SubsessionRaceResults.new_license_level, + new_cpi: SubsessionRaceResults.new_cpi, + newi_rating: SubsessionRaceResults.newi_rating, + incidents: SubsessionRaceResults.incidents, + car_name: SubsessionRaceResults.car_name, + aggregate_champ_points: SubsessionRaceResults.aggregate_champ_points, + }) .from(SubsessionRaceResults) .innerJoin( Subsession, @@ -48,6 +73,24 @@ const subsessions = await db sql`${SubsessionRaceResults.cust_id} IS ${id} AND ${Subsession.season_year} IS ${Number(year)} AND ${SubsessionRaceResults.simsession_name} IN ${["RACE", "FEATURE", "N/A"]}` ) .orderBy(desc(Subsession.subsession_id)); +const subsessions = rawSubsessions.map((subsession) => { + const { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + ...rest + } = subsession; + const Subsession = { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + }; + return { Subsession, SubsessionRaceResults: rest }; +}); --- diff --git a/src/pages/user/[id]/subsessions/index.astro b/src/pages/user/[id]/subsessions/index.astro index cc43cdc..fe54788 100644 --- a/src/pages/user/[id]/subsessions/index.astro +++ b/src/pages/user/[id]/subsessions/index.astro @@ -16,8 +16,33 @@ export function getStaticPaths() { const { id } = Astro.params; const seoTitle = `Subsessions - ${id}`; const seoDescription = `Subsessions page for user ID: ${id}`; -const subsessions = await db - .select() +const rawSubsessions = await db + .select({ + subsession_id: Subsession.subsession_id, + track: Subsession.track, + corners_per_lap: Subsession.corners_per_lap, + allowed_licenses: Subsession.allowed_licenses, + license_category: Subsession.license_category, + finish_position: SubsessionRaceResults.finish_position, + finish_position_in_class: SubsessionRaceResults.finish_position_in_class, + laps_lead: SubsessionRaceResults.laps_lead, + laps_complete: SubsessionRaceResults.laps_complete, + average_lap: SubsessionRaceResults.average_lap, + best_lap_time: SubsessionRaceResults.best_lap_time, + reason_out: SubsessionRaceResults.reason_out, + champ_points: SubsessionRaceResults.champ_points, + starting_position: SubsessionRaceResults.starting_position, + starting_position_in_class: + SubsessionRaceResults.starting_position_in_class, + car_class_short_name: SubsessionRaceResults.car_class_short_name, + division_name: SubsessionRaceResults.division_name, + new_license_level: SubsessionRaceResults.new_license_level, + new_cpi: SubsessionRaceResults.new_cpi, + newi_rating: SubsessionRaceResults.newi_rating, + incidents: SubsessionRaceResults.incidents, + car_name: SubsessionRaceResults.car_name, + aggregate_champ_points: SubsessionRaceResults.aggregate_champ_points, + }) .from(SubsessionRaceResults) .innerJoin( Subsession, @@ -30,6 +55,24 @@ const subsessions = await db ) ) .orderBy(desc(Subsession.subsession_id)); +const subsessions = rawSubsessions.map((subsession) => { + const { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + ...rest + } = subsession; + const Subsession = { + subsession_id, + track, + corners_per_lap, + allowed_licenses, + license_category, + }; + return { Subsession, SubsessionRaceResults: rest }; +}); --- diff --git a/src/pages/users.astro b/src/pages/users.astro new file mode 100644 index 0000000..0460254 --- /dev/null +++ b/src/pages/users.astro @@ -0,0 +1,19 @@ +--- +import DefaultLayout from "$lib/layouts/default.astro"; +const driverLinks = [ + { href: "/Stat-N-Track/user/182407/", label: "Antonio Estrada" }, + { href: "/Stat-N-Track/user/188056/", label: "Doug South" }, + { href: "/Stat-N-Track/user/251134/", label: "Kyle Klendworth" }, + { href: "/Stat-N-Track/user/300752/", label: "Jacob Collins" }, + { href: "/Stat-N-Track/user/589449/", label: "Bryan Campbell2" }, + { href: "/Stat-N-Track/user/714312/", label: "Sam Karasala" }, + { href: "/Stat-N-Track/user/746377/", label: "Ty Quila" }, + { href: "/Stat-N-Track/user/815162/", label: "Jack Glenzinski" }, +]; +--- + + +
+ {driverLinks.map((link) => ())} +
+
- {Object.keys(result.subsessionInfo).map((key) => ( - - - + +