@laioutr/app-hygraph 1.6.1 → 1.7.1

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/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laioutr/app-hygraph",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
4
4
  "configKey": "@laioutr/app-hygraph",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import { defu } from 'defu';
3
3
  import { registerLaioutrApp } from '@laioutr-core/kit';
4
4
 
5
5
  const name = "@laioutr/app-hygraph";
6
- const version = "1.6.1";
6
+ const version = "1.7.1";
7
7
 
8
8
  const module = defineNuxtModule({
9
9
  meta: {
@@ -8043,6 +8043,8 @@ export type BlogFragment = {
8043
8043
  title: string;
8044
8044
  slug: string;
8045
8045
  publishedAt?: string | null;
8046
+ metaTitle?: string | null;
8047
+ metaDescription?: string | null;
8046
8048
  content: {
8047
8049
  html: string;
8048
8050
  };
@@ -11,7 +11,8 @@ export const mapHygraphMedia = (asset) => {
11
11
  src: asset.url,
12
12
  width: asset.width ?? void 0,
13
13
  height: asset.height ?? void 0,
14
- format: mimeType.slice("video/".length)
14
+ // Full MIME type (e.g. `video/mp4`) — the frontend binds this to `<source type>`.
15
+ format: mimeType
15
16
  }
16
17
  ],
17
18
  alt: filenameToAlt(asset.fileName)
@@ -1,11 +1,11 @@
1
- import { BlogPostBase, BlogPostContent, BlogPostExcerpt, BlogPostMedia } from "@laioutr-core/canonical-types/entity/blog-post";
1
+ import { BlogPostBase, BlogPostContent, BlogPostExcerpt, BlogPostMedia, BlogPostSeo } from "@laioutr-core/canonical-types/entity/blog-post";
2
2
  import { blogPostsToken } from "../../const/passthroughTokens.js";
3
3
  import { mapHygraphMedia } from "../../hygraph-utils/mediaMapper.js";
4
4
  import { defineHygraph } from "../../middleware/defineHygraph.js";
5
5
  export default defineHygraph.componentResolver({
6
6
  entityType: "BlogPost",
7
7
  label: "Blog Post",
8
- provides: [BlogPostBase, BlogPostExcerpt, BlogPostContent, BlogPostMedia],
8
+ provides: [BlogPostBase, BlogPostExcerpt, BlogPostContent, BlogPostMedia, BlogPostSeo],
9
9
  resolve: async ({ passthrough, $entity }) => {
10
10
  const posts = passthrough.require(blogPostsToken);
11
11
  return {
@@ -29,6 +29,10 @@ export default defineHygraph.componentResolver({
29
29
  },
30
30
  media: {
31
31
  image: post.image ? mapHygraphMedia(post.image) : { type: "image", sources: [{ provider: "none", src: "/placeholders/1x1.svg" }] }
32
+ },
33
+ seo: {
34
+ title: post.metaTitle ?? void 0,
35
+ description: post.metaDescription ?? void 0
32
36
  }
33
37
  })
34
38
  )
@@ -1,4 +1,4 @@
1
- export declare const BLOGS_QUERY = "\n #graphql\n \n #graphql\n \n #graphql\n fragment Asset on Asset {\n url\n fileName\n mimeType\n width\n height\n handle\n }\n\n fragment Blog on Blog {\n id\n title\n slug\n content {\n html\n }\n image {\n ...Asset\n }\n publishedAt\n }\n\n query Blogs($skip: Int, $first: Int, $collectionId: ID, $locales: [Locale!]!) {\n blogs(\n skip: $skip\n first: $first\n orderBy: createdAt_DESC\n where: { blogCollection: { id: $collectionId } }\n locales: $locales\n ) {\n ...Blog\n }\n blogsConnection(where: { blogCollection: { id: $collectionId } }, locales: $locales) {\n aggregate {\n count\n }\n }\n }\n";
2
- export declare const BLOG_POST_BY_SLUG_QUERY = "\n #graphql\n \n #graphql\n \n #graphql\n fragment Asset on Asset {\n url\n fileName\n mimeType\n width\n height\n handle\n }\n\n fragment Blog on Blog {\n id\n title\n slug\n content {\n html\n }\n image {\n ...Asset\n }\n publishedAt\n }\n\n query BlogPostBySlug($slug: String!, $locales: [Locale!]!) {\n blog(where: { slug: $slug }, locales: $locales) {\n ...Blog\n }\n }\n";
1
+ export declare const BLOGS_QUERY = "\n #graphql\n \n #graphql\n \n #graphql\n fragment Asset on Asset {\n url\n fileName\n mimeType\n width\n height\n handle\n }\n\n fragment Blog on Blog {\n id\n title\n slug\n content {\n html\n }\n image {\n ...Asset\n }\n publishedAt\n metaTitle\n metaDescription\n }\n\n query Blogs($skip: Int, $first: Int, $collectionId: ID, $locales: [Locale!]!) {\n blogs(\n skip: $skip\n first: $first\n orderBy: createdAt_DESC\n where: { blogCollection: { id: $collectionId } }\n locales: $locales\n ) {\n ...Blog\n }\n blogsConnection(where: { blogCollection: { id: $collectionId } }, locales: $locales) {\n aggregate {\n count\n }\n }\n }\n";
2
+ export declare const BLOG_POST_BY_SLUG_QUERY = "\n #graphql\n \n #graphql\n \n #graphql\n fragment Asset on Asset {\n url\n fileName\n mimeType\n width\n height\n handle\n }\n\n fragment Blog on Blog {\n id\n title\n slug\n content {\n html\n }\n image {\n ...Asset\n }\n publishedAt\n metaTitle\n metaDescription\n }\n\n query BlogPostBySlug($slug: String!, $locales: [Locale!]!) {\n blog(where: { slug: $slug }, locales: $locales) {\n ...Blog\n }\n }\n";
3
3
  export declare const BLOG_COLLECTION_BY_SLUG_QUERY = "\n #graphql\n query BlogCollectionBySlug($slug: String!, $locales: [Locale!]!) {\n blogCollection(where: { slug: $slug }, locales: $locales) {\n id\n slug\n title\n }\n }\n";
4
4
  export declare const BLOG_COLLECTIONS_QUERY = "\n #graphql\n query BlogCollections($locales: [Locale!]!) {\n blogCollections(locales: $locales) {\n slug\n title\n }\n }\n";
@@ -15,6 +15,8 @@ const BlogFragment = (
15
15
  ...Asset
16
16
  }
17
17
  publishedAt
18
+ metaTitle
19
+ metaDescription
18
20
  }
19
21
  `
20
22
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laioutr/app-hygraph",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
4
4
  "description": "Laioutr Hygraph App",
5
5
  "repository": "your-org/@laioutr/app-hygraph",
6
6
  "license": "MIT",
@@ -43,17 +43,6 @@
43
43
  "files": [
44
44
  "dist"
45
45
  ],
46
- "scripts": {
47
- "dev": "npm run dev:prepare && nuxi dev playground",
48
- "dev:build": "nuxi build playground",
49
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
50
- "lint": "eslint .",
51
- "prepack": "nuxt-module-build build",
52
- "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish --access public && git push --follow-tags",
53
- "test": "vitest run",
54
- "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
55
- "test:watch": "vitest watch"
56
- },
57
46
  "dependencies": {
58
47
  "@nuxt/kit": "3.16.2",
59
48
  "zod": "3.25.61"
@@ -103,5 +92,15 @@
103
92
  "engines": {
104
93
  "node": ">=22.12.0",
105
94
  "pnpm": ">=10.15.0"
95
+ },
96
+ "scripts": {
97
+ "dev": "npm run dev:prepare && nuxi dev playground",
98
+ "dev:build": "nuxi build playground",
99
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
100
+ "lint": "eslint .",
101
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish --access public && git push --follow-tags",
102
+ "test": "vitest run",
103
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
104
+ "test:watch": "vitest watch"
106
105
  }
107
- }
106
+ }