@peam-ai/next 0.1.3 → 0.1.5

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/index.d.mts CHANGED
@@ -1,16 +1,12 @@
1
- import { NextConfig, NextAdapter } from 'next';
1
+ import { NextConfig } from 'next';
2
+ import { SearchExporterConfig } from '@peam-ai/search';
2
3
 
3
- interface PeamAdapterConfig {
4
+ interface PeamConfig {
4
5
  /**
5
- * Directory where the search index and pages.json will be output
6
- * @default '.peam'
6
+ * Search exporter configuration
7
+ * @default { type: 'fileBased', config: { indexPath: '.peam/index.json' } }
7
8
  */
8
- outputDir?: string;
9
- /**
10
- * Filename for the search index
11
- * @default 'index.json'
12
- */
13
- indexFilename?: string;
9
+ searchExporter?: SearchExporterConfig;
14
10
  /**
15
11
  * Whether to respect robots.txt rules when indexing pages
16
12
  * @default true
@@ -31,20 +27,6 @@ interface PeamAdapterConfig {
31
27
  */
32
28
  exclude?: string[];
33
29
  }
34
- type ResolvedPeamAdapterConfig = Required<Omit<PeamAdapterConfig, 'robotsTxtPath'>> & {
35
- robotsTxtPath?: string;
36
- };
37
- declare const defaultConfig: {
38
- outputDir: string;
39
- indexFilename: string;
40
- respectRobotsTxt: true;
41
- robotsTxtPath: undefined;
42
- exclude: never[];
43
- };
44
- declare const getConfig: () => ResolvedPeamAdapterConfig;
45
- declare function setNextConfig(nextConfig: NextConfig, peamConfig: PeamAdapterConfig): void;
46
-
47
- declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapter;
48
30
 
49
31
  /**
50
32
  * Wraps Next.js config to enable Peam content extraction during build.
@@ -52,13 +34,23 @@ declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapt
52
34
  * @example
53
35
  * ```typescript
54
36
  * // next.config.ts
55
- * import { withPeam } from '@peam-ai/next';
37
+ * import withPeam from '@peam-ai/next';
56
38
  *
57
39
  * export default withPeam()({
58
40
  * // your Next.js config
59
41
  * });
60
42
  * ```
43
+ *
44
+ * Or with `require()`:
45
+ * ```javascript
46
+ * // next.config.js
47
+ * const withPeam = require('@peam-ai/next');
48
+ *
49
+ * module.exports = withPeam()({
50
+ * // your Next.js config
51
+ * });
52
+ * ```
61
53
  */
62
- declare function withPeam(peamConfig?: PeamAdapterConfig): (nextConfig?: NextConfig) => NextConfig;
54
+ declare function withPeam(peamConfig?: PeamConfig): (nextConfig?: NextConfig) => NextConfig;
63
55
 
64
- export { type PeamAdapterConfig, type ResolvedPeamAdapterConfig, createPeamAdapter, defaultConfig, getConfig, setNextConfig, withPeam };
56
+ export { withPeam as default };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,12 @@
1
- import { NextConfig, NextAdapter } from 'next';
1
+ import { NextConfig } from 'next';
2
+ import { SearchExporterConfig } from '@peam-ai/search';
2
3
 
3
- interface PeamAdapterConfig {
4
+ interface PeamConfig {
4
5
  /**
5
- * Directory where the search index and pages.json will be output
6
- * @default '.peam'
6
+ * Search exporter configuration
7
+ * @default { type: 'fileBased', config: { indexPath: '.peam/index.json' } }
7
8
  */
8
- outputDir?: string;
9
- /**
10
- * Filename for the search index
11
- * @default 'index.json'
12
- */
13
- indexFilename?: string;
9
+ searchExporter?: SearchExporterConfig;
14
10
  /**
15
11
  * Whether to respect robots.txt rules when indexing pages
16
12
  * @default true
@@ -31,20 +27,6 @@ interface PeamAdapterConfig {
31
27
  */
32
28
  exclude?: string[];
33
29
  }
34
- type ResolvedPeamAdapterConfig = Required<Omit<PeamAdapterConfig, 'robotsTxtPath'>> & {
35
- robotsTxtPath?: string;
36
- };
37
- declare const defaultConfig: {
38
- outputDir: string;
39
- indexFilename: string;
40
- respectRobotsTxt: true;
41
- robotsTxtPath: undefined;
42
- exclude: never[];
43
- };
44
- declare const getConfig: () => ResolvedPeamAdapterConfig;
45
- declare function setNextConfig(nextConfig: NextConfig, peamConfig: PeamAdapterConfig): void;
46
-
47
- declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapter;
48
30
 
49
31
  /**
50
32
  * Wraps Next.js config to enable Peam content extraction during build.
@@ -52,13 +34,23 @@ declare function createPeamAdapter(config: ResolvedPeamAdapterConfig): NextAdapt
52
34
  * @example
53
35
  * ```typescript
54
36
  * // next.config.ts
55
- * import { withPeam } from '@peam-ai/next';
37
+ * import withPeam from '@peam-ai/next';
56
38
  *
57
39
  * export default withPeam()({
58
40
  * // your Next.js config
59
41
  * });
60
42
  * ```
43
+ *
44
+ * Or with `require()`:
45
+ * ```javascript
46
+ * // next.config.js
47
+ * const withPeam = require('@peam-ai/next');
48
+ *
49
+ * module.exports = withPeam()({
50
+ * // your Next.js config
51
+ * });
52
+ * ```
61
53
  */
62
- declare function withPeam(peamConfig?: PeamAdapterConfig): (nextConfig?: NextConfig) => NextConfig;
54
+ declare function withPeam(peamConfig?: PeamConfig): (nextConfig?: NextConfig) => NextConfig;
63
55
 
64
- export { type PeamAdapterConfig, type ResolvedPeamAdapterConfig, createPeamAdapter, defaultConfig, getConfig, setNextConfig, withPeam };
56
+ export { withPeam as default };