@okam/directus-next-component 1.0.0

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/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # directus-next-component
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## directusRouteMiddleware usage
6
+
7
+ Create a middleware.js file in your project and add the following code to it.
8
+
9
+ ```jsx
10
+ // middleware.js
11
+
12
+ import {directusRouteMiddleware, directusRouteMiddlewareConfig} from @okam/directus-next-component
13
+
14
+ export function middleware(request) {
15
+ return directusRouteMiddleware(request);
16
+ }
17
+
18
+ export config = {
19
+ ...directusRouteMiddlewareConfig
20
+ }
21
+ ```
22
+
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
package/index.esm.js ADDED
@@ -0,0 +1 @@
1
+
package/package.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@okam/directus-next-component",
3
+ "version": "1.0.0",
4
+ "module": "./index.esm.js",
5
+ "type": "module",
6
+ "main": "./index.esm.js"
7
+ }
package/src/index.d.ts ADDED
File without changes
@@ -0,0 +1,7 @@
1
+ import type { NextRequest } from 'next/server';
2
+ import { NextResponse } from 'next/server';
3
+ export declare function fetchPageSettings(pathName: string, lang?: string): Promise<string | null>;
4
+ export declare function directusRouteMiddleware(request: NextRequest, locales: string[]): Promise<NextResponse<unknown>>;
5
+ export declare const config: {
6
+ matcher: string[];
7
+ };
@@ -0,0 +1 @@
1
+ export declare function HelloServer(): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,6 @@
1
+ import type { NextConfig } from 'next';
2
+ interface CustomPluginOptions {
3
+ [key: string]: string;
4
+ }
5
+ declare const withDirectus: (nextConfig?: NextConfig, pluginOptions?: CustomPluginOptions) => NextConfig;
6
+ export default withDirectus;
@@ -0,0 +1,3 @@
1
+ export * from './lib/hello-server';
2
+ export { default as withDirectus } from './lib/withDirectus';
3
+ export * from './lib/directus-next-rewrite';