Skip to content

Commit

Permalink
chore: bump deps, typescript 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jan 1, 2025
1 parent 99fc61a commit 76fd2c2
Show file tree
Hide file tree
Showing 22 changed files with 1,676 additions and 1,187 deletions.
6 changes: 3 additions & 3 deletions crux-api/server/app/services/crux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { useRuntimeConfig } from '#imports'
import { $fetch } from 'ofetch'
import { withHttps, withTrailingSlash } from 'ufo'

const cwvKeys = [
type cwvKeys = [
'largest_contentful_paint',
'cumulative_layout_shift',
'interaction_to_next_paint',
] as const
]

export async function fetchCrux(domain: string, formFactor: 'PHONE' | 'TABLET' | 'DESKTOP' = 'PHONE') {
const origin = withTrailingSlash(withHttps(domain))
Expand Down Expand Up @@ -45,7 +45,7 @@ interface CrUXHistoryResult {
origin: string
}
metrics: {
[key in typeof cwvKeys[number]]: {
[key in cwvKeys[number]]: {
histogramTimeseries: Array<{
start: number | string
end?: number | string
Expand Down
24 changes: 12 additions & 12 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
"preview": "nuxi preview"
},
"devDependencies": {
"@iconify-json/carbon": "^1.2.4",
"@iconify-json/heroicons": "^1.2.1",
"@iconify-json/logos": "^1.2.3",
"@iconify-json/noto": "^1.2.1",
"@iconify-json/ph": "^1.2.1",
"@iconify-json/simple-icons": "^1.2.12",
"@iconify-json/carbon": "^1.2.5",
"@iconify-json/heroicons": "^1.2.2",
"@iconify-json/logos": "^1.2.4",
"@iconify-json/noto": "^1.2.2",
"@iconify-json/ph": "^1.2.2",
"@iconify-json/simple-icons": "^1.2.17",
"@nuxt/content": "^2.13.4",
"@nuxt/devtools": "1.3.9",
"@nuxt/ui": "^2.19.2",
"@nuxt/ui-pro": "^1.5.0",
"@nuxtjs/seo": "2.0.0-rc.12",
"@vueuse/nuxt": "^11.3.0",
"nuxt": "^3.14.1592",
"@nuxt/ui": "^2.20.0",
"@nuxt/ui-pro": "^1.6.0",
"@nuxtjs/seo": "2.0.0",
"@vueuse/nuxt": "^12.2.0",
"nuxt": "^3.15.0",
"nuxt-icon": "^0.6.10",
"nuxt-lego": "^0.0.14",
"nuxt-lodash": "^2.5.3",
"three": "0.138.3",
"troisjs": "^0.3.4",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
}
}
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "0.14.1",
"private": true,
"packageManager": "pnpm@9.14.2",
"packageManager": "pnpm@9.15.2",
"license": "MIT",
"scripts": {
"cli": "JITI_ESM_RESOLVE=1 node packages/cli/dist/cli.mjs",
Expand All @@ -22,13 +22,13 @@
"docs:serve": "npm -C docs run serve"
},
"devDependencies": {
"@antfu/eslint-config": "^3.9.2",
"bumpp": "^9.8.1",
"eslint": "^9.15.0",
"typescript": "5.3.3",
"unbuild": "^2.0.0",
"vite": "^5.4.11",
"vitest": "^2.1.5"
"@antfu/eslint-config": "^3.12.1",
"bumpp": "^9.9.2",
"eslint": "^9.17.0",
"typescript": "5.7.2",
"unbuild": "^3.2.0",
"vite": "^6.0.6",
"vitest": "^2.1.8"
},
"pnpm": {
"packageExtensions": {
Expand All @@ -43,8 +43,5 @@
}
}
}
},
"resolutions": {
"typescript": "5.3.3"
}
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@unlighthouse/server": "workspace:*",
"better-opn": "^3.0.2",
"cac": "^6.7.14",
"consola": "^3.2.3",
"consola": "^3.3.3",
"defu": "^6.1.4",
"fs-extra": "^11.2.0",
"globby": "^14.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function isValidUrl(s: string) {
const url = new URL(s)
return !!url
}
catch (err) {
catch {
return false
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
8 changes: 4 additions & 4 deletions packages/client/logic/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export const unlighthouseReports = computed<UnlighthouseRouteReport[]>(() => {
export const fetchedScanMeta = isStatic
? null
: reactive(
useFetch('/scan-meta')
.get()
.json<ScanMeta>(),
)
useFetch('/scan-meta')
.get()
.json<ScanMeta>(),
)

export const lastScanMeta = ref<ScanMeta | null>(null)

Expand Down
4 changes: 2 additions & 2 deletions packages/client/logic/static.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { UnlighthouseRouteReport } from '@unlighthouse/core'
import { startCase } from 'lodash-es'
import { $URL, joinURL } from 'ufo'
// pull out client accessible options
import MdiAccessibility from '~icons/mdi/accessibility'
import MdiCellphone from '~icons/mdi/cellphone'
Expand All @@ -7,8 +9,6 @@ import MdiThumbUp from '~icons/mdi/thumb-up'
import MdiViewDashboard from '~icons/mdi/view-dashboard'
import MdiWeb from '~icons/mdi/web'
import MdiWorld from '~icons/mdi/world'
import { startCase } from 'lodash-es'
import { $URL, joinURL } from 'ufo'
import CellColorContrast from '../components/Cell/CellColorContrast.vue'
import CellImage from '../components/Cell/CellImage.vue'
import CellImageIssues from '../components/Cell/CellImageIssues.vue'
Expand Down
18 changes: 9 additions & 9 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dayjs": "^1.11.13",
"defu": "^6.1.4",
"fuse.js": "^7.0.0",
"lightweight-charts": "^4.2.1",
"lightweight-charts": "^4.2.2",
"lodash-es": "^4.17.21",
"ufo": "^1.5.4",
"vue": "^3.5.13"
Expand All @@ -43,21 +43,21 @@
"@iconify-json/simple-line-icons": "latest",
"@iconify-json/vscode-icons": "latest",
"@types/lodash": "^4.17.13",
"@types/three": "^0.170.0",
"@types/three": "^0.171.0",
"@unlighthouse/core": "workspace:*",
"@vitejs/plugin-vue": "2.3.4",
"@vue/compiler-sfc": "^3.5.13",
"@vueuse/core": "^11.3.0",
"@vueuse/router": "^11.3.0",
"@vueuse/core": "^12.2.0",
"@vueuse/router": "^12.2.0",
"date-fns": "^4.1.0",
"three": "0.138.3",
"troisjs": "^0.3.4",
"typescript": "^5.6.3",
"unplugin-auto-import": "^0.18.5",
"unplugin-icons": "^0.20.1",
"unplugin-vue-components": "^0.27.4",
"typescript": "^5.7.2",
"unplugin-auto-import": "^0.19.0",
"unplugin-icons": "^0.22.0",
"unplugin-vue-components": "^0.28.0",
"vite": "2.9.17",
"vite-plugin-pages": "0.23.0",
"vite-plugin-windicss": "^1.9.3"
"vite-plugin-windicss": "^1.9.4"
}
}
2 changes: 1 addition & 1 deletion packages/client/windi.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'windicss/helpers'

function range(size: number, startAt = 1) {
return Array.from(new Array(size).keys()).map(i => i + startAt)
return Array.from(Array.from({ length: size }).keys()).map(i => i + startAt)
}

export default defineConfig(
Expand Down
10 changes: 1 addition & 9 deletions packages/core/build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ export default defineBuildConfig({
rollup: {
emitCJS: true,
inlineDependencies: true,
// puppeteer-cluster uses puppeteer, but we want to use puppeteer-core
alias: {
entries: {
puppeteer: 'puppeteer-core',
},
},
replace: {
puppeteer: 'puppeteer-core',
},
},
entries: [
{ input: 'src/index' },
Expand All @@ -26,6 +17,7 @@ export default defineBuildConfig({
'puppeteer-core',
'devtools-protocol',
'puppeteer-cluster',
'puppeteer-core',
'lighthouse',
'@unrouted/core',
'h3',
Expand Down
16 changes: 8 additions & 8 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,39 +45,39 @@
}
},
"dependencies": {
"@puppeteer/browsers": "^2.4.1",
"@puppeteer/browsers": "^2.6.1",
"@unrouted/core": "^0.6.0",
"@unrouted/fetch": "^0.6.0",
"@unrouted/plugins": "^0.6.0",
"@unrouted/preset-api": "^0.6.0",
"@unrouted/preset-node": "^0.6.0",
"axios": "^1.7.7",
"axios": "^1.7.9",
"cheerio": "1.0.0",
"chrome-launcher": "^1.1.2",
"consola": "^3.2.3",
"consola": "^3.3.3",
"defu": "^6.1.4",
"execa": "^9.5.1",
"execa": "^9.5.2",
"fs-extra": "^11.2.0",
"globby": "^14.0.2",
"h3": "^1.13.0",
"hookable": "^5.5.3",
"launch-editor": "^2.9.1",
"lighthouse": "^12.2.2",
"lighthouse": "^12.3.0",
"lodash-es": "^4.17.21",
"minimist": "^1.2.8",
"mlly": "^1.7.3",
"object-hash": "^3.0.0",
"ofetch": "^1.4.1",
"pathe": "^1.1.2",
"puppeteer-cluster": "^0.24.0",
"puppeteer-core": "^23.9.0",
"puppeteer-core": "^23.11.1",
"regexparam": "^3.0.0",
"sanitize-filename": "^1.6.3",
"sitemapper": "^3.2.18",
"sitemapper": "^3.2.20",
"slugify": "^1.6.6",
"ufo": "^1.5.4",
"unconfig": "^0.6.0",
"unctx": "^2.3.1",
"unctx": "^2.4.1",
"wrap-ansi": "^9.0.0",
"ws": "^8.18.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { dirname, join, resolve } from 'node:path'
import fs from 'fs-extra'
import { pick } from 'lodash-es'
import { withLeadingSlash, withTrailingSlash } from 'ufo'
import { createScanMeta } from './data'
import { createScanMeta } from './data/scanMeta'
import { useLogger, useUnlighthouse } from './unlighthouse'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/puppeteer/tasks/html.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CheerioAPI } from 'cheerio'
import type { Page } from 'puppeteer-core'
import type { HTMLExtractPayload, PuppeteerTask } from '../../types'
import type { Page } from '../../types/puppeteer'
import { join } from 'node:path'
import { load as cheerio } from 'cheerio'
import fs from 'fs-extra'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/puppeteer/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Page } from 'puppeteer-core'
import type { Page } from '../types/puppeteer'
import { useLogger, useUnlighthouse } from '../unlighthouse'

export async function setupPage(page: Page) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/puppeteer/worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { TaskFunction } from 'puppeteer-cluster/dist/Cluster'
import type {
NormalisedRoute,
PuppeteerTaskArgs,
Expand All @@ -8,6 +7,7 @@ import type {
UnlighthouseWorker,
UnlighthouseWorkerStats,
} from '../types'
import type { TaskFunction } from '../types/puppeteer'
import fs from 'node:fs'
import { join } from 'node:path'
import { colorize } from 'consola/utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/router/broadcasting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class WS {
try {
client.send(jsonData)
}
catch (err) {
catch {
// Ignore error (if client not ready to receive event)
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,7 @@ export interface ResolvedUserConfig {
export type ClientOptionsPayload = Pick<ResolvedUserConfig, 'client' | 'site' | 'lighthouseOptions' | 'scanner' | 'routerPrefix'>
& Pick<RuntimeSettings, 'websocketUrl' | 'apiUrl'>

export type DeepPartial<T> = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T)
export type UserConfig = DeepPartial<ResolvedUserConfig>
export type UserConfig = Partial<ResolvedUserConfig>

export interface RuntimeSettings {
/**
Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/types/puppeteer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { Cluster, TaskFunction } from 'puppeteer-cluster'
import type { Page } from 'puppeteer-core'

export { Cluster, Page, TaskFunction }
8 changes: 3 additions & 5 deletions packages/core/src/unlighthouse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export async function createUnlighthouse(userConfig: UserConfig, provider?: Prov
configFile = configDefinition.sources[0]
// @ts-expect-error fixes issue with default being returned for mjs loads
const config = configDefinition.config?.default || configDefinition.config
// @ts-ignore broken types
userConfig = defu(config, userConfig)
}
const runtimeSettings: { moduleWorkingDir: string, lighthouseProcessPath: string } & Partial<RuntimeSettings> = {
Expand Down Expand Up @@ -142,7 +141,6 @@ export async function createUnlighthouse(userConfig: UserConfig, provider?: Prov
runLighthouseTask,
}

// @ts-ignore broken types
const worker = await createUnlighthouseWorker(tasks)

if (resolvedConfig.hooks?.authenticate) {
Expand All @@ -161,7 +159,7 @@ export async function createUnlighthouse(userConfig: UserConfig, provider?: Prov
json[key] = localStorage.getItem(key)
}
return json
}).catch((e) => {
}).catch((e: any) => {
logger.warn('Failed to collect authentication localStorage.\n', e)
return {}
})
Expand All @@ -173,7 +171,7 @@ export async function createUnlighthouse(userConfig: UserConfig, provider?: Prov
json[key] = sessionStorage.getItem(key)
}
return json
}).catch((e) => {
}).catch((e: any) => {
logger.warn('Failed to collect authentication sessionStorage.\n', e)
return {}
})
Expand Down Expand Up @@ -347,7 +345,7 @@ export async function createUnlighthouse(userConfig: UserConfig, provider?: Prov
try {
latestTag = (await $fetch<any>('https://ungh.unjs.io/repos/harlan-zw/unlighthouse/releases/latest')).release.tag
}
catch (e) {}
catch {}

const title = [
`⛵ ${colorize('bold', colorize('blueBright', AppName))} ${colorize('dim', `${provider?.name} @ v${version}`)}`,
Expand Down
Loading

0 comments on commit 76fd2c2

Please sign in to comment.