@yassidev/nuxt-directus 0.0.29 → 0.0.31

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,7 +1,7 @@
1
1
  {
2
2
  "name": "directus",
3
3
  "configKey": "directus",
4
- "version": "0.0.29",
4
+ "version": "0.0.31",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1866,7 +1866,7 @@ function normalizeConfig(options, nuxt) {
1866
1866
  url: process.env.DIRECTUS_URL ?? "http://localhost:8055",
1867
1867
  accessToken: process.env.DIRECTUS_ACCESS_TOKEN || process.env.DIRECTUS_ADMIN_TOKEN || "",
1868
1868
  i18n: { enabled: hasNuxtModule("@nuxtjs/i18n"), sync: nuxt.options.dev, prefix: void 0 },
1869
- types: { enabled: nuxt.options.dev, transform: [] },
1869
+ types: { enabled: nuxt.options.dev || nuxt.options._prepare, transform: [] },
1870
1870
  proxy: { enabled: true, path: "/directus", options: {} },
1871
1871
  image: { enabled: hasNuxtModule("@nuxt/image"), alias: "directus" }
1872
1872
  });
@@ -1918,11 +1918,18 @@ async function setupTypes(config, nuxt, logger) {
1918
1918
  addTypeTemplate({
1919
1919
  filename: "directus/types.d.ts",
1920
1920
  getContents: async () => {
1921
- let types = await generateDirectusTypes({
1922
- directusUrl: withoutTrailingSlash(config.url),
1923
- outputPath: "",
1924
- directusToken: config.accessToken
1925
- });
1921
+ let types = "";
1922
+ try {
1923
+ types = await generateDirectusTypes({
1924
+ directusUrl: withoutTrailingSlash(config.url),
1925
+ outputPath: "",
1926
+ directusToken: config.accessToken
1927
+ });
1928
+ } catch (error) {
1929
+ if (!nuxt.options._prepare) {
1930
+ logger.error("Failed to generate Directus types:", error);
1931
+ }
1932
+ }
1926
1933
  if (config.types.transform && config.types.transform.length > 0) {
1927
1934
  for (const { from, to } of config.types.transform) {
1928
1935
  const regex = typeof from === "string" ? new RegExp(from, "g") : from;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yassidev/nuxt-directus",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "A Nuxt module for better integration with Directus CMS.",
5
5
  "repository": "yassilah/nuxt-directus",
6
6
  "license": "MIT",