@studio-fes/layer-strapi 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/app/components/StrapiImage.vue +1 -1
- package/app/components/StrapiMedia.vue +1 -1
- package/app/components/StrapiVideo.vue +1 -1
- package/app/composables/useStrapiPage.ts +0 -1
- package/app/composables/useStrapiSEO.ts +7 -2
- package/app/utils/check-page-data.ts +2 -2
- package/app/utils/media-is-image.ts +1 -1
- package/app/utils/parse-strapi-image.ts +1 -1
- package/app/utils/parse-strapi-video.ts +1 -1
- package/eslint.config.js +7 -7
- package/nuxt.config.ts +8 -2
- package/package.json +6 -4
- package/.nuxtrc +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NuxtImgProps } from '@studio-fes/layer-base/app/components/Image.vue'
|
|
3
|
-
import type { StrapiFileFragment } from '
|
|
3
|
+
import type { StrapiFileFragment } from '../types/graphql-operations'
|
|
4
4
|
|
|
5
5
|
export interface StrapiImageProps extends NuxtImgProps {
|
|
6
6
|
image?: StrapiFileFragment
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { StrapiImageProps } from '@studio-fes/layer-strapi/app/components/StrapiImage.vue'
|
|
3
3
|
import type { StrapiVideoProps } from '@studio-fes/layer-strapi/app/components/StrapiVideo.vue'
|
|
4
|
-
import type { StrapiFileFragment } from '
|
|
4
|
+
import type { StrapiFileFragment } from '../types/graphql-operations'
|
|
5
5
|
|
|
6
6
|
const props = defineProps<{
|
|
7
7
|
media: StrapiFileFragment
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { VideoProps } from '@studio-fes/layer-base/app/components/Video.vue'
|
|
3
|
-
import type { StrapiFileFragment } from '
|
|
3
|
+
import type { StrapiFileFragment } from '../types/graphql-operations'
|
|
4
4
|
import Video from '@studio-fes/layer-base/app/components/Video.vue'
|
|
5
5
|
|
|
6
6
|
export interface StrapiVideoProps extends VideoProps {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export async function useStrapiPage<T>(queryName: never, variables?: Record<string, unknown>): Promise<T> {
|
|
2
2
|
const nuxtApp = useNuxtApp()
|
|
3
3
|
|
|
4
|
-
// @ts-expect-error i18n is not used yet
|
|
5
4
|
const locale = '$i18n' in nuxtApp ? nuxtApp.$i18n?.locale?.value : undefined
|
|
6
5
|
|
|
7
6
|
// @ts-expect-error queryName is not used yet
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SeoMetaFragment } from '
|
|
1
|
+
import type { SeoMetaFragment } from '../types/graphql-operations'
|
|
2
2
|
|
|
3
3
|
function getFallbackImage(): string | null {
|
|
4
4
|
const runtimeConfig = useRuntimeConfig()
|
|
@@ -31,6 +31,11 @@ export function useStrapiSEO(seoData?: MaybeRefOrGetter<SeoMetaFragment>) {
|
|
|
31
31
|
ogImageAlt: ogImageData?.alternativeText || metaTitle,
|
|
32
32
|
twitterCard: 'summary_large_image',
|
|
33
33
|
robots: metaRobots,
|
|
34
|
-
keywords,
|
|
35
34
|
})
|
|
35
|
+
|
|
36
|
+
if (keywords) {
|
|
37
|
+
useHead({
|
|
38
|
+
meta: [{ name: 'keywords', content: keywords }],
|
|
39
|
+
})
|
|
40
|
+
}
|
|
36
41
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { NuxtError } from 'nuxt/app'
|
|
1
2
|
// import type { EntryQuery } from '#graphql-operations'
|
|
2
3
|
import type { GraphqlResponse } from '#nuxt-graphql-middleware/response'
|
|
3
|
-
import type {
|
|
4
|
-
import type { EntryInterfaceTypeFragment } from '~/types/graphql-operations'
|
|
4
|
+
import type { EntryInterfaceTypeFragment } from '../types/graphql-operations'
|
|
5
5
|
|
|
6
6
|
import { createError } from 'nuxt/app'
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NuxtImgProps } from '@studio-fes/layer-base/app/components/Image.vue'
|
|
2
|
-
import type { StrapiFileFragment } from '
|
|
2
|
+
import type { StrapiFileFragment } from '../types/graphql-operations'
|
|
3
3
|
|
|
4
4
|
export function parseStrapiImage(image: StrapiFileFragment | undefined): NuxtImgProps | null {
|
|
5
5
|
if (!image)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VideoProps } from '@studio-fes/layer-base/app/components/Video.vue'
|
|
2
|
-
import type { StrapiFileFragment } from '
|
|
2
|
+
import type { StrapiFileFragment } from '../types/graphql-operations'
|
|
3
3
|
|
|
4
4
|
export function parseStrapiVideo(video: StrapiFileFragment | null | undefined): VideoProps {
|
|
5
5
|
if (!video)
|
package/eslint.config.js
CHANGED
|
@@ -4,12 +4,13 @@ import graphqlPlugin from '@graphql-eslint/eslint-plugin'
|
|
|
4
4
|
import { globalIgnores } from 'eslint/config'
|
|
5
5
|
|
|
6
6
|
export default antfu(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
{
|
|
8
|
+
formatters: true,
|
|
9
|
+
vue: true,
|
|
10
|
+
pnpm: false,
|
|
11
|
+
unocss: true,
|
|
12
|
+
antislop: true,
|
|
13
|
+
},
|
|
13
14
|
globalIgnores([
|
|
14
15
|
'dist',
|
|
15
16
|
'node_modules',
|
|
@@ -43,7 +44,6 @@ export default antfu(
|
|
|
43
44
|
'unocss/order': 'error', // or "error",
|
|
44
45
|
},
|
|
45
46
|
},
|
|
46
|
-
// @ts-expect-error
|
|
47
47
|
{
|
|
48
48
|
files: ['**/*.graphql', '**/*.gql'],
|
|
49
49
|
languageOptions: {
|
package/nuxt.config.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { parseEnv } from './parse-env'
|
|
|
2
2
|
|
|
3
3
|
const { graphqlEndpoint, hostname } = parseEnv()
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Assigning the config to a variable before passing it to `defineNuxtConfig` sidesteps
|
|
6
|
+
// TypeScript's excess-property check on `graphqlMiddleware`, whose type comes from
|
|
7
|
+
// nuxt-graphql-middleware's `nuxt/schema` augmentation and doesn't reliably merge into
|
|
8
|
+
// `NuxtConfig` when this file is type-checked from a consuming app's own `nuxt` instance.
|
|
9
|
+
const config = {
|
|
6
10
|
extends: ['@studio-fes/layer-base'],
|
|
7
11
|
|
|
8
12
|
modules: [
|
|
@@ -30,4 +34,6 @@ export default defineNuxtConfig({
|
|
|
30
34
|
image: {
|
|
31
35
|
domains: [hostname],
|
|
32
36
|
},
|
|
33
|
-
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default defineNuxtConfig(config)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studio-fes/layer-strapi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.9",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "nuxi dev",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"generate": "nuxt generate",
|
|
12
12
|
"preview": "nuxt preview",
|
|
13
13
|
"lint": "eslint .",
|
|
14
|
-
"lint:fix": "eslint . --fix"
|
|
14
|
+
"lint:fix": "eslint . --fix",
|
|
15
|
+
"typecheck": "nuxi typecheck"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@nuxt/eslint": "latest",
|
|
@@ -24,8 +25,9 @@
|
|
|
24
25
|
"@types/node": "^26.6.1",
|
|
25
26
|
"eslint": "^10.10.0",
|
|
26
27
|
"nuxt": "^4.5.2",
|
|
27
|
-
"typescript": "^
|
|
28
|
-
"vue": "latest"
|
|
28
|
+
"typescript": "^5.9.3",
|
|
29
|
+
"vue": "latest",
|
|
30
|
+
"vue-tsc": "^3.0.0"
|
|
29
31
|
},
|
|
30
32
|
"description": "Create Nuxt extendable layer with this GitHub template.",
|
|
31
33
|
"repository": {
|
package/.nuxtrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
typescript.includeWorkspace = true
|