Skip to content

Commit

Permalink
chore: upgrade packages
Browse files Browse the repository at this point in the history
  • Loading branch information
toniengelhardt committed Nov 11, 2023
1 parent e1b87be commit c2ae419
Show file tree
Hide file tree
Showing 8 changed files with 1,172 additions and 2,509 deletions.
20 changes: 10 additions & 10 deletions components/api/list/List.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<script setup lang="ts">
defineProps<{
apis: WebApi[]
}>()
const sharedStatus = useSharedStatus()
const webApiStatuses = useWebApiStatuses()
</script>

<template>
<div class="grid grid-cols-1 gap-0.5 py-0.5">
<ApiListItem
v-for="api in apis"
:key="api.id"
:api="api"
:available="!!webApiStatuses[api.id]"
:detailsEnabled="!sharedStatus"
:details-enabled="!sharedStatus"
/>
</div>
</template>

<script setup lang="ts">
defineProps<{
apis: WebApi[]
}>()
const sharedStatus = useSharedStatus()
const webApiStatuses = useWebApiStatuses()
</script>
10 changes: 6 additions & 4 deletions composables/webapis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function useWebApiStatus(api: WebApi, available?: boolean) {
/**
* Check the availability of each WebAPI on the current device.
* This can only run on the client obviously.
* @param webApis: list of WebAPIs to test, defaults to all.
* @param force: by default WebAPIs that have been checked already are skipped, unless this flag is set to true.
* @param webApis - list of WebAPIs to test, defaults to all.
* @param force - by default WebAPIs that have been checked already are skipped, unless this flag is set to true.
*/
export function useTestWebApis(webApis?: WebApi[], force = false) {
if (window && navigator) {
Expand All @@ -66,15 +66,17 @@ export function useTestWebApis(webApis?: WebApi[], force = false) {
for (const [key, val] of Object.entries(decodeStatus(sharedStatus.split('-')[1]))) {
webApiStatuses.value[key] = val
}
} else {
}
else {
webApis = webApis || useWebApiList().value
webApis.forEach((webApi) => {
if (force || !webApiStatuses.value[webApi.id]) {
const check = webApi.check || defaultWebApiCheck
if (check.constructor.name === 'AsyncFunction') {
(check(webApi) as Promise<boolean>)
.then((available: boolean) => webApiStatuses.value[webApi.id] = available)
} else {
}
else {
webApiStatuses.value[webApi.id] = check(webApi) as boolean
}
}
Expand Down
2 changes: 0 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,5 @@ export default defineNuxtConfig({
},
plausible: {
domain: 'webapicheck.com',
trackLocalhost: false,
autoOutboundTracking: false,
},
})
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webapicheck",
"version": "1.4.3",
"type": "module",
"version": "1.4.3",
"packageManager": "[email protected]",
"scripts": {
"dev": "nuxt dev --host --no-qr",
Expand All @@ -16,31 +16,31 @@
"test:ci": "vitest",
"coverage": "vitest run --coverage"
},
"dependencies": {
"@sentry/browser": "^7.80.0",
"@sentry/tracing": "^7.80.0",
"@sentry/vue": "^7.80.0",
"fuse.js": "^7.0.0",
"postcss-nested": "^6.0.1",
"shvl": "^3.0.0"
},
"devDependencies": {
"@antfu/eslint-config": "^1.1.0",
"@kevinmarrec/nuxt-pwa": "^0.17.0",
"@nuxt/devtools": "^1.0.0",
"@nuxt/devtools": "^1.0.1",
"@nuxtjs/color-mode": "^3.3.0",
"@nuxtjs/plausible": "^0.2.3",
"@nuxtseo/module": "2.0.0-beta.40",
"@sentry/vite-plugin": "^2.9.0",
"@sentry/vite-plugin": "^2.10.0",
"@total-typescript/ts-reset": "^0.5.1",
"@unocss/nuxt": "^0.57.2",
"@vueuse/nuxt": "^10.5.0",
"@unocss/nuxt": "^0.57.3",
"@vueuse/nuxt": "^10.6.0",
"eslint": "^8.53.0",
"nuxt": "^3.8.0",
"nuxt-icon": "^0.6.1",
"nuxt-vitest": "^0.11.2",
"nuxt": "^3.8.1",
"nuxt-icon": "^0.6.5",
"nuxt-vitest": "^0.11.3",
"typescript": "^5.2.2",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.22"
},
"dependencies": {
"@sentry/browser": "^7.77.0",
"@sentry/tracing": "^7.77.0",
"@sentry/vue": "^7.77.0",
"fuse.js": "^7.0.0",
"postcss-nested": "^6.0.1",
"shvl": "^3.0.0"
}
}
86 changes: 43 additions & 43 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
<template>
<NuxtLayout>
<template #header-center>
<AppSearch
v-model:searchTerm="searchTerm"
v-model:searchMode="searchMode"
/>
</template>
<template #header-right>
<div flex w-full lt-md:py-3 md:justify-end>
<div class="flex lt-md:(w-1/3 justify-center) md:mr-4">
<ApiCounter :supported-count="supportedAPICount" :total-count="totalAPICount" />
</div>
<div class="flex lt-md:(w-1/3 justify-center) md:mr-4">
<ApiModeSelector
:modelValue="displayMode"
@update:modelValue="updateMode($event)"
/>
</div>
<div class="flex lt-md:(w-1/3 justify-center)">
<ContextStatus />
</div>
<div
v-if="!sharedStatus"
lt-md:hidden flex-center ml-4 text-sm font-bold text-black bg-yellow-400 hover:bg-yellow-400:90 h-7 px-2.5 py-0 rounded cursor-pointer
@click="shareDialogOpen = true"
>
<Icon name="ph:arrow-up-bold" />
<span ml-1 mr-0.5>Share</span>
</div>
</div>
</template>
<div
v-if="filteredAPIs && !filteredAPIs.length"
flex-center h-full text-dim italic
>
There are no APIs matching your search...
</div>
<ApiList v-else-if="displayMode === 'rows'" :apis="filteredAPIs" />
<ApiGrid v-else-if="displayMode === 'tiles'" :apis="filteredAPIs" />
</NuxtLayout>
</template>

<script setup lang="ts">
import Fuse from 'fuse.js'
import type { FuseResult } from 'fuse.js'
Expand Down Expand Up @@ -90,3 +47,46 @@ function updateMode(newValue: DisplayMode) {
onMounted(() => useTestWebApis())
</script>

<template>
<NuxtLayout>
<template #header-center>
<AppSearch
v-model:searchTerm="searchTerm"
v-model:searchMode="searchMode"
/>
</template>
<template #header-right>
<div flex w-full lt-md:py-3 md:justify-end>
<div class="flex lt-md:(w-1/3 justify-center) md:mr-4">
<ApiCounter :supported-count="supportedAPICount" :total-count="totalAPICount" />
</div>
<div class="flex lt-md:(w-1/3 justify-center) md:mr-4">
<ApiModeSelector
:model-value="displayMode"
@update:model-value="updateMode($event)"
/>
</div>
<div class="flex lt-md:(w-1/3 justify-center)">
<ContextStatus />
</div>
<div
v-if="!sharedStatus"
lt-md:hidden flex-center ml-4 text-sm font-bold text-black bg-yellow-400 hover:bg-yellow-400:90 h-7 px-2.5 py-0 rounded cursor-pointer
@click="shareDialogOpen = true"
>
<Icon name="ph:arrow-up-bold" />
<span ml-1 mr-0.5>Share</span>
</div>
</div>
</template>
<div
v-if="filteredAPIs && !filteredAPIs.length"
flex-center h-full text-dim italic
>
There are no APIs matching your search...
</div>
<ApiList v-else-if="displayMode === 'rows'" :apis="filteredAPIs" />
<ApiGrid v-else-if="displayMode === 'tiles'" :apis="filteredAPIs" />
</NuxtLayout>
</template>
Loading

1 comment on commit c2ae419

@vercel
Copy link

@vercel vercel bot commented on c2ae419 Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.