@wpnuxt/core 1.0.0-edge.27 → 1.0.0-edge.29

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.
Files changed (29) hide show
  1. package/dist/module.d.mts +2 -1
  2. package/dist/module.json +3 -3
  3. package/dist/module.mjs +11 -23
  4. package/dist/runtime/components/ContentRenderer.vue +4 -6
  5. package/dist/runtime/components/ContentRenderer.vue.d.ts +6 -0
  6. package/dist/runtime/components/StagingBanner.vue +23 -26
  7. package/dist/runtime/components/StagingBanner.vue.d.ts +2 -0
  8. package/dist/runtime/components/WPContent.vue +12 -15
  9. package/dist/runtime/components/WPContent.vue.d.ts +6 -0
  10. package/dist/runtime/components/WPNuxtLogo.vue +6 -6
  11. package/dist/runtime/components/WPNuxtLogo.vue.d.ts +5 -0
  12. package/dist/runtime/components/WordPressLogo.vue.d.ts +2 -0
  13. package/dist/runtime/queries/GeneralSettings.gql +0 -2
  14. package/dist/runtime/queries/Menu.gql +0 -2
  15. package/dist/runtime/queries/Node.gql +0 -3
  16. package/dist/runtime/queries/Pages.gql +0 -2
  17. package/dist/runtime/queries/Posts.gql +0 -2
  18. package/dist/runtime/queries/fragments/GeneralSettings.fragment.gql +0 -1
  19. package/dist/runtime/queries/fragments/NodeWithFeaturedImage.fragment.gql +0 -2
  20. package/dist/runtime/queries/fragments/NodeWithFeaturedImageToMediaItemConnectionEdge.fragment.gql +0 -2
  21. package/dist/runtime/queries/fragments/Page.fragment.gql +0 -4
  22. package/dist/runtime/queries/fragments/Post.fragment.gql +0 -5
  23. package/dist/runtime/server/api/config.js +1 -2
  24. package/dist/runtime/server/api/wpContent.post.js +1 -1
  25. package/dist/types.d.mts +4 -2
  26. package/package.json +24 -28
  27. package/dist/module.cjs +0 -5
  28. package/dist/module.d.ts +0 -100
  29. package/dist/types.d.ts +0 -7
package/dist/module.d.mts CHANGED
@@ -97,4 +97,5 @@ declare module '@nuxt/schema' {
97
97
  }
98
98
  }
99
99
 
100
- export { type WPNuxtConfig, type WPNuxtConfigQueries, type WPNuxtQuery, _default as default };
100
+ export { _default as default };
101
+ export type { WPNuxtConfig, WPNuxtConfigQueries, WPNuxtQuery };
package/dist/module.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@wpnuxt/core",
3
- "version": "1.0.0-edge.27",
3
+ "version": "1.0.0-edge.29",
4
4
  "configKey": "wpNuxt",
5
5
  "nuxt": ">=3.1.0",
6
6
  "builder": {
7
- "@nuxt/module-builder": "0.8.4",
8
- "unbuild": "2.0.0"
7
+ "@nuxt/module-builder": "1.0.1",
8
+ "unbuild": "3.5.0"
9
9
  }
10
10
  }
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createResolver, hasNuxtModule, addTemplate, resolveFiles, defineNuxtModule, addPlugin, addImports, addComponentsDir, addServerHandler, installModule, addTypeTemplate } from '@nuxt/kit';
2
- import consola, { createConsola } from 'consola';
2
+ import { createConsola, consola } from 'consola';
3
3
  import { promises, existsSync, cpSync, statSync } from 'node:fs';
4
4
  import { ref } from 'vue';
5
5
  import { join } from 'pathe';
@@ -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.27";
10
+ const version = "1.0.0-edge.29";
11
11
 
12
12
  const loggerRef = ref();
13
13
  const initLogger = (logLevel) => {
@@ -103,14 +103,13 @@ const _parseDoc = async (doc) => {
103
103
  return operations;
104
104
  };
105
105
  function processSelections(selections, level, query) {
106
- if (!selections || selections.length === 0)
107
- return;
108
- if (selections.length === 1 && selections[0].kind === "Field") {
109
- query.nodes.push(selections[0].name.value.trim());
106
+ if (!selections || selections.length === 0) return;
107
+ if (selections.length === 1 && selections[0]?.kind === "Field") {
108
+ query.nodes?.push(selections[0].name.value.trim());
110
109
  }
111
110
  selections.forEach((s) => {
112
111
  if (s.kind === "FragmentSpread") {
113
- query.fragments.push(s.name.value.trim());
112
+ query.fragments?.push(s.name.value.trim());
114
113
  } else if (s.selectionSet?.selections) {
115
114
  processSelections(s.selectionSet.selections, level + 1, query);
116
115
  }
@@ -227,11 +226,9 @@ const module = defineNuxtModule({
227
226
  logger.info("config:", publicWPNuxtConfig);
228
227
  logger.info("Connecting GraphQL to", publicWPNuxtConfig.wordpressUrl);
229
228
  logger.info("frontendUrl:", publicWPNuxtConfig.frontendUrl);
230
- if (publicWPNuxtConfig.enableCache)
231
- logger.info("Cache enabled");
229
+ if (publicWPNuxtConfig.enableCache) logger.info("Cache enabled");
232
230
  logger.debug("Debug mode enabled, log level:", publicWPNuxtConfig.logLevel);
233
- if (publicWPNuxtConfig.staging)
234
- logger.info("Staging enabled");
231
+ if (publicWPNuxtConfig.staging) logger.info("Staging enabled");
235
232
  const { resolve } = createResolver(import.meta.url);
236
233
  const resolveRuntimeModule = (path) => resolve("./runtime", path);
237
234
  const srcResolver = createResolver(nuxt.options.srcDir);
@@ -279,16 +276,8 @@ const module = defineNuxtModule({
279
276
  graphqlEndpoint: `${publicWPNuxtConfig.wordpressUrl}/graphql`,
280
277
  downloadSchema: publicWPNuxtConfig.downloadSchema,
281
278
  codegenConfig: {
282
- skipTypename: true,
283
- useTypeImports: true,
284
- // inlineFragmentTypes: 'combine',
285
- dedupeFragments: true,
286
- onlyOperationTypes: true,
287
- avoidOptionals: false,
288
- maybeValue: "T | undefined",
289
- namingConvention: {
290
- enumValues: "change-case-all#upperCaseFirst"
291
- }
279
+ debugMode: publicWPNuxtConfig.logLevel ? publicWPNuxtConfig.logLevel > 3 : false,
280
+ useCache: false
292
281
  },
293
282
  codegenSchemaConfig: {
294
283
  urlSchemaOptions: {
@@ -325,8 +314,7 @@ const module = defineNuxtModule({
325
314
  nuxt.hook("nitro:init", async (nitro) => {
326
315
  const keys = await nitro.storage.getKeys("cache:api:wpContent");
327
316
  keys.forEach(async (key) => {
328
- if (key.startsWith("cache:api:wpContent"))
329
- await nitro.storage.removeItem(key);
317
+ if (key.startsWith("cache:api:wpContent")) await nitro.storage.removeItem(key);
330
318
  });
331
319
  });
332
320
  const endTime = (/* @__PURE__ */ new Date()).getTime();
@@ -1,9 +1,7 @@
1
- <script setup lang="ts">
2
- import type { NodeWithContentEditorFragment } from '#build/graphql-operations'
3
-
4
- defineProps<{
5
- node: NodeWithContentEditorFragment
6
- }>()
1
+ <script setup>
2
+ defineProps({
3
+ node: { type: null, required: true }
4
+ });
7
5
  </script>
8
6
 
9
7
  <template>
@@ -0,0 +1,6 @@
1
+ import type { NodeWithContentEditorFragment } from '#build/graphql-operations';
2
+ type __VLS_Props = {
3
+ node: NodeWithContentEditorFragment;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -1,37 +1,34 @@
1
- <script setup lang="ts">
2
- import { OperationTypeNode } from 'graphql'
3
- import { useWPUri } from '../composables/useWPUri'
4
- import { useWPContent } from '../composables'
5
- import WPNuxtLogo from './WPNuxtLogo.vue'
6
- import WordPressLogo from './WordPressLogo.vue'
7
- import { useRuntimeConfig, useHead, useRoute } from '#imports'
8
-
9
- const config = useRuntimeConfig()
10
- const frontendUrl = config.public.wpNuxt.frontendUrl
11
- const wordpressUrl = config.public.wpNuxt.wordpressUrl
12
- const wpUri = useWPUri()
1
+ <script setup>
2
+ import { OperationTypeNode } from "graphql";
3
+ import { useWPUri } from "../composables/useWPUri";
4
+ import { useWPContent } from "../composables";
5
+ import WPNuxtLogo from "./WPNuxtLogo.vue";
6
+ import WordPressLogo from "./WordPressLogo.vue";
7
+ import { useRuntimeConfig, useHead, useRoute } from "#imports";
8
+ const config = useRuntimeConfig();
9
+ const frontendUrl = config.public.wpNuxt.frontendUrl;
10
+ const wordpressUrl = config.public.wpNuxt.wordpressUrl;
11
+ const wpUri = useWPUri();
13
12
  useHead({
14
- title: 'Staging',
13
+ title: "Staging",
15
14
  link: [
16
15
  {
17
- type: 'stylesheet',
18
- href: wordpressUrl + '/wp-admin/load-styles.php?c=0&dir=ltr&load%5Bchunk_0%5D=dashicons,admin-bar,site-health,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-poi&load%5Bchunk_1%5D=nter,widgets,site-icon,l10n,buttons,wp-auth-check&ver=6.4.3'
16
+ type: "stylesheet",
17
+ href: wordpressUrl + "/wp-admin/load-styles.php?c=0&dir=ltr&load%5Bchunk_0%5D=dashicons,admin-bar,site-health,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,wp-poi&load%5Bchunk_1%5D=nter,widgets,site-icon,l10n,buttons,wp-auth-check&ver=6.4.3"
19
18
  }
20
19
  ]
21
- })
22
-
23
- const route = useRoute()
24
- let uri = route.path === '/' ? 'home' : route.path
25
- if (uri.startsWith('/')) {
26
- uri = uri.substring(1)
20
+ });
21
+ const route = useRoute();
22
+ let uri = route.path === "/" ? "home" : route.path;
23
+ if (uri.startsWith("/")) {
24
+ uri = uri.substring(1);
27
25
  }
28
- if (uri.endsWith('/')) {
29
- uri = uri.substring(0, uri.length - 1)
26
+ if (uri.endsWith("/")) {
27
+ uri = uri.substring(0, uri.length - 1);
30
28
  }
31
- const { data: post } = await useWPContent(OperationTypeNode.QUERY, 'NodeByUri', ['nodeByUri'], false, { uri: uri })
32
-
29
+ const { data: post } = await useWPContent(OperationTypeNode.QUERY, "NodeByUri", ["nodeByUri"], false, { uri });
33
30
  if (import.meta.client) {
34
- document.body.style.marginBottom = '40px'
31
+ document.body.style.marginBottom = "40px";
35
32
  }
36
33
  </script>
37
34
 
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,20 +1,17 @@
1
- <script setup lang="ts">
2
- import type { NodeWithContentEditorFragment, NodeWithEditorBlocksFragment } from '#build/graphql-operations'
3
- import { resolveComponent } from '#imports'
4
-
5
- defineProps<{
6
- node: NodeWithContentEditorFragment | NodeWithEditorBlocksFragment
7
- }>()
8
-
9
- const manifest = await import('#wpnuxt/blocks').catch(() => ({}))
1
+ <script setup>
2
+ import { resolveComponent } from "#imports";
3
+ defineProps({
4
+ node: { type: null, required: true }
5
+ });
6
+ const manifest = await import("#wpnuxt/blocks").catch(() => ({}));
10
7
  const findComponentToRender = async () => {
11
- const componentImporter = manifest['BlockRenderer']
12
- if (typeof componentImporter === 'function') {
13
- return await componentImporter()
8
+ const componentImporter = manifest["BlockRenderer"];
9
+ if (typeof componentImporter === "function") {
10
+ return await componentImporter();
14
11
  }
15
- return await resolveComponent('ContentRenderer')
16
- }
17
- const componentToRender = await findComponentToRender()
12
+ return await resolveComponent("ContentRenderer");
13
+ };
14
+ const componentToRender = await findComponentToRender();
18
15
  </script>
19
16
 
20
17
  <template>
@@ -0,0 +1,6 @@
1
+ import type { NodeWithContentEditorFragment, NodeWithEditorBlocksFragment } from '#build/graphql-operations';
2
+ type __VLS_Props = {
3
+ node: NodeWithContentEditorFragment | NodeWithEditorBlocksFragment;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -1,9 +1,9 @@
1
- <script setup lang="ts">
2
- const props = defineProps<{
3
- wpColor?: string
4
- }>()
5
- const wpLight = props.wpColor ? props.wpColor : 'back'
6
- const wpDark = props.wpColor ? props.wpColor : 'white'
1
+ <script setup>
2
+ const props = defineProps({
3
+ wpColor: { type: String, required: false }
4
+ });
5
+ const wpLight = props.wpColor ? props.wpColor : "back";
6
+ const wpDark = props.wpColor ? props.wpColor : "white";
7
7
  </script>
8
8
 
9
9
  <template>
@@ -0,0 +1,5 @@
1
+ type __VLS_Props = {
2
+ wpColor?: string;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,5 +1,3 @@
1
- #import "~/.queries/fragments/GeneralSettings.fragment.gql"
2
-
3
1
  query GeneralSettings {
4
2
  generalSettings {
5
3
  ...GeneralSettings
@@ -1,5 +1,3 @@
1
- #import "~/.queries/fragments/MenuItem.fragment.gql"
2
-
3
1
  query Menu($name: ID! = "main", $idType: MenuNodeIdTypeEnum! = NAME) {
4
2
  menu(id: $name, idType: $idType) {
5
3
  menuItems {
@@ -1,6 +1,3 @@
1
- #import "~/.queries/fragments/Page.fragment.gql"
2
- #import "~/.queries/fragments/Post.fragment.gql"
3
-
4
1
  query NodeByUri($uri: String!) {
5
2
  nodeByUri(uri: $uri) {
6
3
  ...Page
@@ -1,5 +1,3 @@
1
- #import "~/.queries/fragments/Page.fragment.gql"
2
-
3
1
  query Pages($limit: Int = 10) {
4
2
  pages(first: $limit) {
5
3
  nodes {
@@ -1,5 +1,3 @@
1
- #import "~/.queries/fragments/Post.fragment.gql"
2
-
3
1
  query Posts($limit: Int = 10) {
4
2
  posts(first: $limit) {
5
3
  nodes {
@@ -7,5 +7,4 @@ fragment GeneralSettings on GeneralSettings {
7
7
  startOfWeek
8
8
  timezone
9
9
  timeFormat
10
- email
11
10
  }
@@ -1,5 +1,3 @@
1
- #import '~/.queries/fragments/NodeWithFeaturedImageToMediaItemConnectionEdge.fragment.gql';
2
-
3
1
  fragment NodeWithFeaturedImage on NodeWithFeaturedImage {
4
2
  featuredImage {
5
3
  ...NodeWithFeaturedImageToMediaItemConnectionEdge
@@ -1,5 +1,3 @@
1
- #import '~/.queries/fragments/MediaItem.fragment.gql';
2
-
3
1
  fragment NodeWithFeaturedImageToMediaItemConnectionEdge on NodeWithFeaturedImageToMediaItemConnectionEdge {
4
2
  cursor
5
3
  node {
@@ -1,7 +1,3 @@
1
- #import '~/.queries/fragments/ContentNode.fragment.gql';
2
- #import '~/.queries/fragments/NodeWithFeaturedImage.fragment.gql';
3
- #import '~/.queries/fragments/NodeWithContentEditor.fragment.gql';
4
-
5
1
  fragment Page on Page {
6
2
  ...ContentNode
7
3
  ...NodeWithFeaturedImage
@@ -1,8 +1,3 @@
1
- #import "~/.queries/fragments/NodeWithExcerpt.fragment.gql";
2
- #import '~/.queries/fragments/ContentNode.fragment.gql';
3
- #import '~/.queries/fragments/NodeWithFeaturedImage.fragment.gql';
4
- #import '~/.queries/fragments/NodeWithContentEditor.fragment.gql';
5
-
6
1
  fragment Post on Post {
7
2
  ...NodeWithExcerpt
8
3
  ...ContentNode
@@ -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/dist/types.d.mts CHANGED
@@ -1,7 +1,9 @@
1
1
  import type { NuxtModule } from '@nuxt/schema'
2
2
 
3
- import type { default as Module } from './module.js'
3
+ import type { default as Module } from './module.mjs'
4
4
 
5
5
  export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
6
 
7
- export { type WPNuxtConfig, type WPNuxtConfigQueries, type WPNuxtQuery, default } from './module.js'
7
+ export { default } from './module.mjs'
8
+
9
+ export { type WPNuxtConfig, type WPNuxtConfigQueries, type WPNuxtQuery } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpnuxt/core",
3
- "version": "1.0.0-edge.27",
3
+ "version": "1.0.0-edge.29",
4
4
  "description": "WPNuxt",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,13 +10,12 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
- "types": "./dist/types.d.ts",
13
+ "types": "./dist/types.d.mts",
14
14
  "import": "./dist/module.mjs",
15
- "require": "./dist/module.cjs"
15
+ "require": "./dist/module.mjs"
16
16
  }
17
17
  },
18
- "main": "./dist/module.cjs",
19
- "types": "./dist/types.d.ts",
18
+ "main": "./dist/module.mjs",
20
19
  "files": [
21
20
  "dist"
22
21
  ],
@@ -52,39 +51,36 @@
52
51
  "start": "pnpm run wp-env:create && pnpm run dev"
53
52
  },
54
53
  "dependencies": {
55
- "@nuxt/kit": "3.16.0",
56
- "@vueuse/nuxt": "^13.0.0",
54
+ "@nuxt/kit": "3.17.1",
55
+ "@vueuse/nuxt": "^13.1.0",
57
56
  "defu": "^6.1.4",
58
- "graphql": "^16.10.0",
59
- "nuxt-graphql-middleware": "4.3.2",
57
+ "graphql": "^16.11.0",
58
+ "nuxt-graphql-middleware": "5.0.0",
60
59
  "vue-sanitize-directive": "^0.2.1"
61
60
  },
62
61
  "devDependencies": {
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",
68
- "@nuxt/module-builder": "^0.8.4",
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",
62
+ "@nuxt/devtools": "^2.4.0",
63
+ "@nuxt/eslint-config": "^1.3.0",
64
+ "@nuxt/module-builder": "^1.0.1",
65
+ "@nuxt/schema": "3.17.1",
66
+ "@nuxt/test-utils": "^3.18.0",
67
+ "@rollup/rollup-linux-arm64-gnu": "^4.40.1",
68
+ "@rollup/rollup-linux-arm64-musl": "^4.40.1",
69
+ "@types/node": "22.15.3",
70
+ "@vitest/coverage-v8": "^3.1.2",
75
71
  "@vue/test-utils": "^2.4.6",
76
- "@wordpress/env": "^10.17.0",
72
+ "@wordpress/env": "^10.22.0",
77
73
  "changelogen": "^0.6.1",
78
74
  "markdownlint-cli": "^0.44.0",
79
- "nuxt": "^3.16.0",
75
+ "nuxt": "^3.17.1",
80
76
  "nuxt-content-twoslash": "^0.1.2",
81
- "release-it": "^18.1.2",
82
- "typescript": "^5.7.3",
77
+ "release-it": "^19.0.1",
78
+ "typescript": "^5.8.3",
83
79
  "untyped": "2.0.0",
84
- "vite": "^6.1.0",
85
- "vitest": "^3.0.5",
80
+ "vite": "^6.3.4",
81
+ "vitest": "^3.1.2",
86
82
  "vue-docgen-web-types": "^0.1.8",
87
- "vue-tsc": "2.2.8"
83
+ "vue-tsc": "2.2.10"
88
84
  },
89
85
  "peerDependencies": {
90
86
  "consola": "^3.3.3",
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
package/dist/module.d.ts DELETED
@@ -1,100 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
- interface WPNuxtConfig {
4
-
5
- /**
6
- * Log level for the WPNuxt module
7
- * @default 3
8
- * @example 0 = silent, 1 = error, 2 = warn, 3 = info, 4 = debug, 5 = trace
9
- */
10
- logLevel?: number
11
- /**
12
- * URL of the WordPress site
13
- *
14
- * There is no default value for this option, so it's required.
15
- *
16
- * @example 'https://wordpress.wpnuxt.com'
17
- */
18
- wordpressUrl: string
19
- frontendUrl: string
20
-
21
- defaultMenuName?: string
22
-
23
- enableCache?: boolean
24
-
25
- staging?: boolean
26
-
27
- /**
28
- * @default 'useWP'
29
- */
30
- composablesPrefix: string
31
-
32
- queries?: WPNuxtConfigQueries
33
-
34
- /**
35
- * Download the GraphQL schema and store it on disk.
36
- *
37
- * When setting this to false, the module will expect a graphql.schema file to be available.
38
- * You could first enable this, commit the schema file and then set downloadSchema to false to avoid have to query the graphql introspection on each start of the application
39
- *
40
- * @default true
41
- */
42
- downloadSchema?: boolean
43
-
44
- hasBlocksModule?: boolean
45
- hasAuthModule?: boolean
46
- }
47
-
48
- interface WPNuxtConfigQueries {
49
-
50
- /**
51
- * Folder for user defined queries
52
- *
53
- * relative to the src dir of your nuxt app
54
- *
55
- * @default extend/queries
56
- */
57
- extendDir?: string
58
-
59
- /**
60
- * The predefined queries & the user defined queries will be merged and placed in the queries output folder
61
- *
62
- * relative to the src dir of your nuxt app
63
- *
64
- * @default queries
65
- */
66
- outputDir?: string
67
- }
68
-
69
- type WPNuxtQuery = {
70
- name: string
71
- nodes?: string[]
72
- fragments: string[]
73
- params: Record<string, string>
74
- operation: OperationTypeNode
75
- }
76
-
77
- declare const _default: _nuxt_schema.NuxtModule<WPNuxtConfig, WPNuxtConfig, false>;
78
-
79
- declare module '@nuxt/schema' {
80
- interface RuntimeConfig {
81
- wpNuxt: {
82
- faustSecretKey: string;
83
- };
84
- }
85
- interface PublicRuntimeConfig {
86
- wpNuxt: WPNuxtConfig;
87
- }
88
- interface ConfigSchema {
89
- wpNuxt: {
90
- faustSecretKey: string;
91
- };
92
- runtimeConfig: {
93
- public?: {
94
- wpNuxt: WPNuxtConfig;
95
- };
96
- };
97
- }
98
- }
99
-
100
- export { type WPNuxtConfig, type WPNuxtConfigQueries, type WPNuxtQuery, _default as default };
package/dist/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { type WPNuxtConfig, type WPNuxtConfigQueries, type WPNuxtQuery, default } from './module'