diff --git a/packages/next-drupal/package.json b/packages/next-drupal/package.json index a4baf853..d22717ef 100644 --- a/packages/next-drupal/package.json +++ b/packages/next-drupal/package.json @@ -3,7 +3,10 @@ "description": "Helpers for Next.js + Drupal.", "version": "1.6.0", "sideEffects": false, - "source": "src/index.ts", + "source": [ + "src/index.ts", + "src/navigation.ts" + ], "type": "module", "main": "dist/index.cjs", "module": "dist/index.modern.js", @@ -17,6 +20,16 @@ "types": "./dist/index.cjs.d.ts", "default": "./dist/index.cjs" } + }, + "./navigation": { + "import": { + "types": "./dist/navigation.d.ts", + "default": "./dist/navigation.modern.js" + }, + "require": { + "types": "./dist/navigation.cjs.d.ts", + "default": "./dist/navigation.cjs" + } } }, "types": "dist/types.d.ts", diff --git a/packages/next-drupal/src/index.ts b/packages/next-drupal/src/index.ts index bc107a47..fb7c2513 100644 --- a/packages/next-drupal/src/index.ts +++ b/packages/next-drupal/src/index.ts @@ -8,7 +8,6 @@ export * from "./get-resource" export * from "./get-search-index" export * from "./get-view" export * from "./types" -export * from "./use-menu" export * from "./translate-path" export { deserialize, diff --git a/packages/next-drupal/src/navigation.ts b/packages/next-drupal/src/navigation.ts new file mode 100644 index 00000000..33d5f232 --- /dev/null +++ b/packages/next-drupal/src/navigation.ts @@ -0,0 +1 @@ +export { useMenu } from "./navigation/use-menu" diff --git a/packages/next-drupal/src/use-menu.tsx b/packages/next-drupal/src/navigation/use-menu.tsx similarity index 90% rename from packages/next-drupal/src/use-menu.tsx rename to packages/next-drupal/src/navigation/use-menu.tsx index 441a2a43..cbc4b3f6 100644 --- a/packages/next-drupal/src/use-menu.tsx +++ b/packages/next-drupal/src/navigation/use-menu.tsx @@ -1,7 +1,7 @@ import { useRouter } from "next/router" import { useEffect, useState } from "react" -import { getMenu } from "./get-menu" -import type { DrupalMenuLinkContent } from "./types" +import { getMenu } from "../get-menu" +import type { DrupalMenuLinkContent } from "../types" export function useMenu( name: string