@studio-fes/layer-strapi 0.2.16 → 0.2.18

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @studio-fes/layer-strapi
2
2
 
3
+ ## 0.2.18
4
+
5
+ ### Patch Changes
6
+
7
+ - update dependencies, server folder and media components to edit props
8
+
9
+ ## 0.2.17
10
+
11
+ ### Patch Changes
12
+
13
+ - fix empty object toReactive
14
+
3
15
  ## 0.2.16
4
16
 
5
17
  ### Patch Changes
@@ -7,10 +7,13 @@ export interface StrapiImageProps extends NuxtImgProps {
7
7
  }
8
8
 
9
9
  const props = defineProps<StrapiImageProps>()
10
- const imageProps = computed(() => ({
11
- ...reactiveOmit(props, 'image'),
12
- ...parseStrapiImage(props.image),
13
- }))
10
+ const imageProps = computed(() => {
11
+ const fromStrapi = parseStrapiImage(props.image)
12
+ const fromProps = Object.fromEntries(
13
+ Object.entries(reactiveOmit(props, 'image')).filter(([, v]) => v !== undefined),
14
+ )
15
+ return { ...fromStrapi, ...fromProps }
16
+ })
14
17
  </script>
15
18
 
16
19
  <template>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { StrapiImageProps } from '@studio-fes/layer-strapi/app/components/StrapiImage.vue'
3
- import type { StrapiVideoProps } from '~/components/StrapiVideo.vue'
3
+ import type { StrapiVideoProps } from '@studio-fes/layer-strapi/app/components/StrapiVideo.vue'
4
4
  import type { StrapiFileFragment } from '~/types/graphql-operations'
5
5
 
6
6
  const props = defineProps<{
@@ -8,11 +8,14 @@ export interface StrapiVideoProps extends VideoProps {
8
8
  }
9
9
 
10
10
  const props = defineProps<StrapiVideoProps>()
11
+ const videoProps = computed(() => {
12
+ const fromStrapi = parseStrapiVideo(props.video)
13
+ const fromProps = Object.fromEntries(
14
+ Object.entries(reactiveOmit(props, 'video')).filter(([, v]) => v !== undefined),
15
+ )
11
16
 
12
- const videoProps = computed(() => ({
13
- ...reactiveOmit(props, 'video'),
14
- ...parseStrapiVideo(props.video),
15
- }))
17
+ return { ...fromStrapi, ...fromProps }
18
+ })
16
19
  </script>
17
20
 
18
21
  <template>
@@ -1,4 +1,3 @@
1
- // import type { StrapiFileFragment } from '#graphql-operations'
2
1
  import type { NuxtImgProps } from '@studio-fes/layer-base/app/components/Image.vue'
3
2
  import type { StrapiFileFragment } from '~/types/graphql-operations'
4
3
 
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@studio-fes/layer-strapi",
3
3
  "type": "module",
4
- "version": "0.2.16",
4
+ "version": "0.2.18",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
7
7
  "@nuxt/eslint": "latest",
8
- "nuxt-graphql-middleware": "^5.3.2",
8
+ "nuxt-graphql-middleware": "^5.4.0",
9
9
  "nuxt-multi-cache": "^4.0.3",
10
10
  "vue-strapi-blocks-renderer": "1.1.1"
11
11
  },
12
12
  "devDependencies": {
13
- "@types/node": "^25.5.0",
14
- "eslint": "^10.0.3",
13
+ "@types/node": "^25.6.0",
14
+ "eslint": "^10.2.1",
15
15
  "nuxt": "^4.4.2",
16
- "typescript": "^5.9.3",
16
+ "typescript": "^6.0.3",
17
17
  "vue": "latest",
18
- "@studio-fes/layer-base": "0.2.16"
18
+ "@studio-fes/layer-base": "0.2.18"
19
19
  },
20
20
  "description": "Create Nuxt extendable layer with this GitHub template.",
21
21
  "repository": {
@@ -1,32 +0,0 @@
1
- import type { FetchResponse } from 'ofetch'
2
- import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/server-options'
3
-
4
- export default defineGraphqlServerOptions({
5
- async doGraphqlRequest(context) {
6
- const { operationName, variables, operationDocument } = context
7
-
8
- const config = useRuntimeConfig()
9
-
10
- function doRequest(): Promise<FetchResponse<{ data: any, errors: any[] }>> {
11
- return $fetch.raw(config.graphqlMiddleware.graphqlEndpoint, {
12
- method: 'POST',
13
- ignoreResponseError: true,
14
- body: {
15
- query: operationDocument,
16
- variables,
17
- operationName,
18
- }
19
- })
20
- }
21
-
22
- const res = await doRequest()
23
-
24
- return {
25
- data: res._data?.data,
26
- errors: res._data?.errors?.map(e => ({
27
- ...e,
28
- path: Array.isArray(e.path) ? e.path : [],
29
- })) || [],
30
- }
31
- },
32
- })
@@ -1,22 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- import { defineMultiCacheOptions } from 'nuxt-multi-cache/server-options'
4
- import fsDriver from 'unstorage/drivers/fs'
5
- import nullDriver from 'unstorage/drivers/null'
6
-
7
- export default defineMultiCacheOptions(() => {
8
- const config = useRuntimeConfig()
9
- const { multiCacheEnabled } = config
10
-
11
- const driver = multiCacheEnabled
12
- ? fsDriver({ base: '.nuxt-multi-cache' })
13
- : nullDriver()
14
-
15
- return {
16
- data: {
17
- storage: {
18
- driver,
19
- },
20
- },
21
- }
22
- })