@wpnuxt/core 1.0.0-edge.26 → 1.0.0-edge.28

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": "@wpnuxt/core",
3
- "version": "1.0.0-edge.26",
3
+ "version": "1.0.0-edge.28",
4
4
  "configKey": "wpNuxt",
5
5
  "nuxt": ">=3.1.0",
6
6
  "builder": {
package/dist/module.mjs CHANGED
@@ -7,7 +7,7 @@ import { upperFirst } from 'scule';
7
7
  import { parse } from 'graphql';
8
8
 
9
9
  const name = "@wpnuxt/core";
10
- const version = "1.0.0-edge.26";
10
+ const version = "1.0.0-edge.28";
11
11
 
12
12
  const loggerRef = ref();
13
13
  const initLogger = (logLevel) => {
@@ -1,4 +1,4 @@
1
- export declare const usePrevNextPost: (currentPostSlug: string) => Promise<{
1
+ export declare const usePrevNextPost: (currentPostPath: string) => Promise<{
2
2
  prev: any;
3
3
  next: any;
4
4
  }>;
@@ -1,6 +1,7 @@
1
1
  import { OperationTypeNode } from "graphql";
2
2
  import { useWPContent } from "./useWPContent.js";
3
- const _usePrevNextPost = async (currentPostSlug) => {
3
+ const _usePrevNextPost = async (currentPostPath) => {
4
+ const currentPostSlug = currentPostPath.replaceAll("/", "");
4
5
  const allPosts = await getAllPosts();
5
6
  if (!allPosts) return { prev: null, next: null };
6
7
  const currentIndex = allPosts.slugs.findIndex((slug) => slug === currentPostSlug);
@@ -17,3 +17,18 @@ query PostById($id: ID!, $asPreview: Boolean = false) {
17
17
  ...Post
18
18
  }
19
19
  }
20
+
21
+ query PostsByCategoryName($categoryName: String!, $limit: Int = 10) {
22
+ posts(first: $limit, where: {categoryName: $categoryName}) {
23
+ nodes {
24
+ ...Post
25
+ }
26
+ }
27
+ }
28
+ query PostsByCategoryId($categoryId: Int!, $limit: Int = 10) {
29
+ posts(first: $limit, where: {categoryId: $categoryId}) {
30
+ nodes {
31
+ ...Post
32
+ }
33
+ }
34
+ }
@@ -9,4 +9,12 @@ fragment Post on Post {
9
9
  ...NodeWithFeaturedImage
10
10
  ...NodeWithContentEditor
11
11
  title
12
+ categories {
13
+ nodes {
14
+ id
15
+ name
16
+ uri
17
+ description
18
+ }
19
+ }
12
20
  }
@@ -1,5 +1,4 @@
1
- import { defineCachedEventHandler } from "#internal/nitro";
2
- import { useRuntimeConfig } from "#imports";
1
+ import { defineCachedEventHandler, useRuntimeConfig } from "#imports";
3
2
  export default defineCachedEventHandler(async (event) => {
4
3
  const config = useRuntimeConfig(event);
5
4
  return {
@@ -1,5 +1,5 @@
1
1
  import { readBody } from "h3";
2
- import { defineCachedEventHandler } from "#internal/nitro";
2
+ import { defineCachedEventHandler } from "#imports";
3
3
  export default defineCachedEventHandler(async (event) => {
4
4
  const body = await readBody(event);
5
5
  if (!body || !body.queryName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpnuxt/core",
3
- "version": "1.0.0-edge.26",
3
+ "version": "1.0.0-edge.28",
4
4
  "description": "WPNuxt",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,43 +52,39 @@
52
52
  "start": "pnpm run wp-env:create && pnpm run dev"
53
53
  },
54
54
  "dependencies": {
55
- "@nuxt/kit": "3.15.1",
56
- "@vueuse/nuxt": "^12.3.0",
55
+ "@nuxt/kit": "3.16.0",
56
+ "@vueuse/nuxt": "^13.0.0",
57
57
  "defu": "^6.1.4",
58
58
  "graphql": "^16.10.0",
59
59
  "nuxt-graphql-middleware": "4.3.2",
60
- "ohash": "^1.1.4",
61
- "unstorage": "^1.14.4",
62
60
  "vue-sanitize-directive": "^0.2.1"
63
61
  },
64
62
  "devDependencies": {
65
- "@graphql-codegen/cli": "^5.0.3",
66
- "@graphql-codegen/client-preset": "^4.5.1",
67
- "@graphql-codegen/typescript-operations": "^4.4.0",
68
- "@nuxt/devtools": "^1.7.0",
69
- "@nuxt/eslint-config": "^0.7.5",
63
+ "@graphql-codegen/cli": "^5.0.4",
64
+ "@graphql-codegen/client-preset": "^4.6.2",
65
+ "@graphql-codegen/typescript-operations": "^4.4.1",
66
+ "@nuxt/devtools": "^2.0.0",
67
+ "@nuxt/eslint-config": "^1.0.1",
70
68
  "@nuxt/module-builder": "^0.8.4",
71
- "@nuxt/schema": "3.15.1",
72
- "@nuxt/test-utils": "^3.15.1",
73
- "@rollup/rollup-linux-arm64-gnu": "^4.30.1",
74
- "@rollup/rollup-linux-arm64-musl": "^4.30.1",
75
- "@types/node": "22.10.5",
76
- "@vitest/coverage-v8": "^2.1.8",
69
+ "@nuxt/schema": "3.16.0",
70
+ "@nuxt/test-utils": "^3.15.4",
71
+ "@rollup/rollup-linux-arm64-gnu": "^4.34.6",
72
+ "@rollup/rollup-linux-arm64-musl": "^4.34.6",
73
+ "@types/node": "22.13.10",
74
+ "@vitest/coverage-v8": "^3.0.5",
77
75
  "@vue/test-utils": "^2.4.6",
78
- "@wordpress/env": "^10.15.0",
79
- "changelogen": "^0.5.7",
80
- "markdownlint-cli": "^0.43.0",
81
- "nuxt": "^3.15.1",
76
+ "@wordpress/env": "^10.17.0",
77
+ "changelogen": "^0.6.1",
78
+ "markdownlint-cli": "^0.44.0",
79
+ "nuxt": "^3.16.0",
82
80
  "nuxt-content-twoslash": "^0.1.2",
83
- "release-it": "^18.1.1",
84
- "shiki": "^1.26.1",
85
- "twoslash": "^0.2.12",
81
+ "release-it": "^18.1.2",
86
82
  "typescript": "^5.7.3",
87
- "untyped": "1.5.2",
88
- "vite": "^6.0.7",
89
- "vitest": "^2.1.8",
83
+ "untyped": "2.0.0",
84
+ "vite": "^6.1.0",
85
+ "vitest": "^3.0.5",
90
86
  "vue-docgen-web-types": "^0.1.8",
91
- "vue-tsc": "2.2.0"
87
+ "vue-tsc": "2.2.8"
92
88
  },
93
89
  "peerDependencies": {
94
90
  "consola": "^3.3.3",
@@ -98,6 +94,6 @@
98
94
  "scule": "^1.3.0"
99
95
  },
100
96
  "engines": {
101
- "node": ">=18"
97
+ "node": ">=20"
102
98
  }
103
99
  }