@m13v/seo-components 0.8.6 → 0.8.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m13v/seo-components",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "scripts": {
5
5
  "build:css": "tailwind -i src/_build.css -o dist/styles.css --minify",
6
6
  "prepublishOnly": "npm run build:css"
@@ -14,7 +14,10 @@
14
14
  "./components/*": "./src/components/*",
15
15
  "./lib/*": "./src/lib/*",
16
16
  "./server": "./src/server.ts",
17
- "./next": "./src/next.ts",
17
+ "./next": {
18
+ "types": "./src/next.d.ts",
19
+ "default": "./src/next.js"
20
+ },
18
21
  "./styles.css": "./dist/styles.css",
19
22
  "./styles.src.css": "./src/styles.css"
20
23
  },
package/src/next.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { NextConfig } from "next";
2
+
3
+ export interface WithSeoContentOptions {
4
+ /** Relative path to your content directory. Default: "src/app/t". */
5
+ contentDir?: string;
6
+ }
7
+
8
+ export function withSeoContent(
9
+ config?: NextConfig,
10
+ opts?: WithSeoContentOptions,
11
+ ): NextConfig;
@@ -1,26 +1,20 @@
1
- import type { NextConfig } from "next";
2
-
3
- export interface WithSeoContentOptions {
4
- /** Relative path to your content directory. Default: "src/app/t". */
5
- contentDir?: string;
6
- }
7
-
8
1
  /**
9
2
  * Wrap a Next.js config so the guide-chat API route can read content files
10
3
  * at runtime on Vercel. Adds `outputFileTracingIncludes` for the guide-chat
11
- * endpoint so Next.js's file tracer includes every file under `contentDir`
4
+ * endpoint so Next.js's file tracer includes every page.tsx under `contentDir`
12
5
  * in the serverless function bundle.
13
6
  *
14
- * Usage (next.config.ts):
7
+ * Usage (next.config.ts or next.config.mjs):
15
8
  *
16
9
  * import { withSeoContent } from "@m13v/seo-components/next";
17
10
  * const nextConfig = { ... };
18
11
  * export default withSeoContent(nextConfig, { contentDir: "src/app/t" });
12
+ *
13
+ * @param {import('next').NextConfig} [config]
14
+ * @param {{ contentDir?: string }} [opts]
15
+ * @returns {import('next').NextConfig}
19
16
  */
20
- export function withSeoContent(
21
- config: NextConfig = {},
22
- opts: WithSeoContentOptions = {},
23
- ): NextConfig {
17
+ export function withSeoContent(config = {}, opts = {}) {
24
18
  const contentDir = opts.contentDir ?? "src/app/t";
25
19
  const glob = `./${contentDir}/**/*`;
26
20
  const existing = config.outputFileTracingIncludes ?? {};