@wpnuxt/core 2.0.0-beta.1 → 2.0.0-beta.2

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": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "configKey": "wpNuxt",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
package/dist/module.mjs CHANGED
@@ -9,7 +9,7 @@ import { ref } from 'vue';
9
9
  import { parse, GraphQLError } from 'graphql';
10
10
  import { execSync } from 'node:child_process';
11
11
 
12
- const version = "2.0.0-beta.1";
12
+ const version = "2.0.0-beta.2";
13
13
 
14
14
  function createModuleError(module, message) {
15
15
  return new Error(formatErrorMessage(module, message));
@@ -865,13 +865,13 @@ const module$1 = defineNuxtModule({
865
865
  const nitroOptions = nuxt.options;
866
866
  nitroOptions.nitro = nitroOptions.nitro || {};
867
867
  nitroOptions.nitro.routeRules = nitroOptions.nitro.routeRules || {};
868
- nitroOptions.nitro.routeRules["/api/wpnuxt/**"] = {
868
+ nitroOptions.nitro.routeRules["/api/wpnuxt/query/**"] = {
869
869
  cache: {
870
870
  maxAge,
871
871
  swr: wpNuxtConfig.cache?.swr !== false
872
872
  }
873
873
  };
874
- logger.debug(`Server-side caching enabled for GraphQL requests (maxAge: ${maxAge}s, SWR: ${wpNuxtConfig.cache?.swr !== false})`);
874
+ logger.debug(`Server-side caching enabled for GraphQL queries (maxAge: ${maxAge}s, SWR: ${wpNuxtConfig.cache?.swr !== false})`);
875
875
  }
876
876
  {
877
877
  const nitroOptions = nuxt.options;
@@ -882,23 +882,25 @@ const module$1 = defineNuxtModule({
882
882
  };
883
883
  logger.debug(`Configured WordPress uploads proxy: /wp-content/uploads/** \u2192 ${wpNuxtConfig.wordpressUrl}/wp-content/uploads/**`);
884
884
  }
885
- if (hasNuxtModule("@nuxt/image")) {
886
- const imageConfig = nuxt.options.image || {};
887
- const provider = process.env.NUXT_IMAGE_PROVIDER || imageConfig.provider || "ipx";
888
- if (provider === "ipx") {
889
- const wpHost = new URL(wpNuxtConfig.wordpressUrl).host;
890
- const domains = imageConfig.domains || [];
891
- if (!domains.includes(wpHost)) {
892
- domains.push(wpHost);
885
+ nuxt.hook("modules:done", () => {
886
+ if (hasNuxtModule("@nuxt/image")) {
887
+ const imageConfig = nuxt.options.image || {};
888
+ const provider = process.env.NUXT_IMAGE_PROVIDER || imageConfig.provider || "ipx";
889
+ if (provider === "ipx") {
890
+ const wpHost = new URL(wpNuxtConfig.wordpressUrl).host;
891
+ const domains = imageConfig.domains || [];
892
+ if (!domains.includes(wpHost)) {
893
+ domains.push(wpHost);
894
+ }
895
+ imageConfig.domains = domains;
896
+ const alias = imageConfig.alias || {};
897
+ alias["/wp-content"] = `${wpNuxtConfig.wordpressUrl}/wp-content`;
898
+ imageConfig.alias = alias;
899
+ nuxt.options.image = imageConfig;
900
+ logger.debug(`Configured IPX for WordPress: alias /wp-content \u2192 ${wpNuxtConfig.wordpressUrl}/wp-content, domain '${wpHost}' added`);
893
901
  }
894
- imageConfig.domains = domains;
895
- const alias = imageConfig.alias || {};
896
- alias["/wp-content"] = `${wpNuxtConfig.wordpressUrl}/wp-content`;
897
- imageConfig.alias = alias;
898
- nuxt.options.image = imageConfig;
899
- logger.debug(`Configured IPX for WordPress: alias /wp-content \u2192 ${wpNuxtConfig.wordpressUrl}/wp-content, domain '${wpHost}' added`);
900
902
  }
901
- }
903
+ });
902
904
  configureVercelSettings(nuxt, logger);
903
905
  addImports([
904
906
  { name: "useWPContent", as: "useWPContent", from: resolver.resolve("./runtime/composables/useWPContent") },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpnuxt/core",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "Nuxt module for WordPress integration via GraphQL (WPGraphQL)",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -23,15 +23,18 @@
23
23
  "exports": {
24
24
  ".": {
25
25
  "types": "./dist/types.d.mts",
26
- "import": "./dist/module.mjs"
26
+ "import": "./dist/module.mjs",
27
+ "default": "./dist/module.mjs"
27
28
  },
28
29
  "./server-options": {
29
30
  "types": "./dist/server-options.d.mts",
30
- "import": "./dist/server-options.mjs"
31
+ "import": "./dist/server-options.mjs",
32
+ "default": "./dist/server-options.mjs"
31
33
  },
32
34
  "./client-options": {
33
35
  "types": "./dist/client-options.d.mts",
34
- "import": "./dist/client-options.mjs"
36
+ "import": "./dist/client-options.mjs",
37
+ "default": "./dist/client-options.mjs"
35
38
  }
36
39
  },
37
40
  "main": "./dist/module.mjs",
@@ -44,19 +47,19 @@
44
47
  },
45
48
  "dependencies": {
46
49
  "@nuxt/kit": "4.3.1",
47
- "dompurify": "^3.1.7",
48
50
  "consola": "^3.4.0",
49
51
  "defu": "^6.1.4",
52
+ "dompurify": "^3.1.7",
50
53
  "graphql": "^16.12.0",
51
54
  "nuxt-graphql-middleware": "5.3.2",
52
55
  "scule": "^1.3.0"
53
56
  },
54
57
  "devDependencies": {
55
- "@nuxt/devtools": "^3.1.1",
58
+ "@nuxt/devtools": "^3.2.0",
56
59
  "@nuxt/module-builder": "^1.0.2",
57
60
  "@nuxt/schema": "4.3.1",
58
61
  "@nuxt/test-utils": "^4.0.0",
59
- "@types/node": "^25.2.2",
62
+ "@types/node": "^25.2.3",
60
63
  "nuxt": "4.3.1",
61
64
  "vitest": "^4.0.18",
62
65
  "vue-tsc": "^3.2.3"