folderblog 0.0.2 → 0.0.3

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.
Files changed (61) hide show
  1. package/dist/{chunk-24MKFHML.cjs → chunk-2TZSVPNP.cjs} +5 -0
  2. package/dist/{chunk-HMQIQUPB.cjs → chunk-6TFXNIO6.cjs} +108 -0
  3. package/dist/{chunk-ZRUBI3GH.js → chunk-B43UAOPC.js} +106 -1
  4. package/dist/{chunk-XP5J4LFJ.js → chunk-D26H5722.js} +5 -0
  5. package/dist/chunk-E7PYGJA7.cjs +39 -0
  6. package/dist/{chunk-QA4KPPTA.cjs → chunk-J3Y3HEBF.cjs} +84 -13
  7. package/dist/{chunk-PARGDJNY.js → chunk-K76XLEC7.js} +1 -1
  8. package/dist/{chunk-IXP35S24.js → chunk-LPPBVXJ7.js} +83 -12
  9. package/dist/chunk-Q6EXKX6K.js +17 -0
  10. package/dist/{chunk-4ZJGUMHS.cjs → chunk-Q6EYTOTM.cjs} +2 -2
  11. package/dist/chunk-UCXXH2MP.cjs +20 -0
  12. package/dist/chunk-XQD3UUL5.js +34 -0
  13. package/dist/cli/bin.cjs +5 -5
  14. package/dist/cli/bin.js +4 -4
  15. package/dist/cli/index.cjs +5 -5
  16. package/dist/cli/index.js +4 -4
  17. package/dist/config-ADPY6IQS.d.cts +473 -0
  18. package/dist/config-Dctsdeo6.d.ts +473 -0
  19. package/dist/index.cjs +157 -187
  20. package/dist/index.d.cts +4 -3
  21. package/dist/index.d.ts +4 -3
  22. package/dist/index.js +16 -69
  23. package/dist/local/index.cjs +785 -0
  24. package/dist/local/index.d.cts +268 -0
  25. package/dist/local/index.d.ts +268 -0
  26. package/dist/local/index.js +772 -0
  27. package/dist/output-0P0br3Jc.d.cts +452 -0
  28. package/dist/output-0P0br3Jc.d.ts +452 -0
  29. package/dist/plugins/embed-cloudflare-ai.cjs +166 -0
  30. package/dist/plugins/embed-cloudflare-ai.d.cts +73 -0
  31. package/dist/plugins/embed-cloudflare-ai.d.ts +73 -0
  32. package/dist/plugins/embed-cloudflare-ai.js +156 -0
  33. package/dist/plugins/embed-transformers.cjs +121 -0
  34. package/dist/plugins/embed-transformers.d.cts +55 -0
  35. package/dist/plugins/embed-transformers.d.ts +55 -0
  36. package/dist/plugins/embed-transformers.js +113 -0
  37. package/dist/plugins/similarity.cjs +19 -0
  38. package/dist/plugins/similarity.d.cts +41 -0
  39. package/dist/plugins/similarity.d.ts +41 -0
  40. package/dist/plugins/similarity.js +2 -0
  41. package/dist/processor/index.cjs +123 -111
  42. package/dist/processor/index.d.cts +6 -2
  43. package/dist/processor/index.d.ts +6 -2
  44. package/dist/processor/index.js +3 -3
  45. package/dist/processor/plugins.cjs +24 -12
  46. package/dist/processor/plugins.d.cts +4 -2
  47. package/dist/processor/plugins.d.ts +4 -2
  48. package/dist/processor/plugins.js +1 -1
  49. package/dist/processor/types.cjs +16 -16
  50. package/dist/processor/types.d.cts +3 -2
  51. package/dist/processor/types.d.ts +3 -2
  52. package/dist/processor/types.js +1 -1
  53. package/dist/seo/index.cjs +289 -0
  54. package/dist/seo/index.d.cts +95 -0
  55. package/dist/seo/index.d.ts +95 -0
  56. package/dist/seo/index.js +274 -0
  57. package/dist/server/index.cjs +2 -5
  58. package/dist/server/index.js +2 -5
  59. package/package.json +36 -1
  60. package/dist/config-DFr-htlO.d.cts +0 -887
  61. package/dist/config-DFr-htlO.d.ts +0 -887
package/dist/index.cjs CHANGED
@@ -1,106 +1,52 @@
1
1
  'use strict';
2
2
 
3
- var chunkQA4KPPTA_cjs = require('./chunk-QA4KPPTA.cjs');
4
- var chunkHMQIQUPB_cjs = require('./chunk-HMQIQUPB.cjs');
5
- var chunk24MKFHML_cjs = require('./chunk-24MKFHML.cjs');
3
+ var chunkE7PYGJA7_cjs = require('./chunk-E7PYGJA7.cjs');
4
+ var chunkUCXXH2MP_cjs = require('./chunk-UCXXH2MP.cjs');
5
+ var chunkJ3Y3HEBF_cjs = require('./chunk-J3Y3HEBF.cjs');
6
+ var chunk2TZSVPNP_cjs = require('./chunk-2TZSVPNP.cjs');
7
+ var chunk6TFXNIO6_cjs = require('./chunk-6TFXNIO6.cjs');
6
8
  require('./chunk-OBGZSXTJ.cjs');
7
9
 
8
- // src/errors.ts
9
- var FolderBlogError = class extends Error {
10
- /** HTTP status code if applicable */
11
- status;
12
- /** The URL that was requested */
13
- url;
14
- constructor(message, options) {
15
- super(message);
16
- this.name = "FolderBlogError";
17
- this.status = options?.status;
18
- this.url = options?.url;
19
- }
20
- };
21
- var NotFoundError = class extends FolderBlogError {
22
- constructor(resource, identifier, url) {
23
- super(`${resource} not found: ${identifier}`, { status: 404, url });
24
- this.name = "NotFoundError";
25
- }
26
- };
27
- var ApiError = class extends FolderBlogError {
28
- constructor(message, status, url) {
29
- super(message, { status, url });
30
- this.name = "ApiError";
31
- }
32
- };
33
- var NetworkError = class extends FolderBlogError {
34
- cause;
35
- constructor(message, cause) {
36
- super(message);
37
- this.name = "NetworkError";
38
- this.cause = cause;
39
- }
40
- };
41
-
42
10
  // src/client.ts
43
- function normalizeBaseUrl(domain) {
44
- let url = domain.trim();
45
- if (url.endsWith("/")) url = url.slice(0, -1);
46
- if (!url.startsWith("http://") && !url.startsWith("https://")) {
47
- url = `https://${url}`;
48
- }
49
- return url;
50
- }
51
11
  function folderBlog(domain, options = {}) {
52
- const baseUrl = normalizeBaseUrl(domain);
12
+ const baseUrl = chunkUCXXH2MP_cjs.normalizeBaseUrl(domain);
53
13
  const fetchFn = options.fetch ?? globalThis.fetch;
54
- async function request(path) {
14
+ async function fetchRaw(path, accept) {
55
15
  const url = `${baseUrl}${path}`;
56
16
  let response;
57
17
  try {
58
18
  response = await fetchFn(url, {
59
19
  method: "GET",
60
- headers: { Accept: "application/json" }
20
+ ...accept ? { headers: { Accept: accept } } : {}
61
21
  });
62
22
  } catch (error) {
63
- throw new NetworkError(
23
+ throw new chunkE7PYGJA7_cjs.NetworkError(
64
24
  `Failed to fetch ${url}`,
65
25
  error instanceof Error ? error : void 0
66
26
  );
67
27
  }
68
28
  if (!response.ok) {
69
29
  if (response.status === 404) {
70
- throw new NotFoundError("Resource", path, url);
30
+ throw new chunkE7PYGJA7_cjs.NotFoundError("Resource", path, url);
71
31
  }
72
- throw new ApiError(
32
+ throw new chunkE7PYGJA7_cjs.ApiError(
73
33
  `API request failed: ${response.statusText}`,
74
34
  response.status,
75
35
  url
76
36
  );
77
37
  }
38
+ return response;
39
+ }
40
+ async function request(path) {
41
+ const response = await fetchRaw(path, "application/json");
78
42
  try {
79
43
  return await response.json();
80
44
  } catch {
81
- throw new ApiError("Failed to parse JSON response", response.status, url);
45
+ throw new chunkE7PYGJA7_cjs.ApiError("Failed to parse JSON response", response.status, `${baseUrl}${path}`);
82
46
  }
83
47
  }
84
48
  async function requestText(path) {
85
- const url = `${baseUrl}${path}`;
86
- let response;
87
- try {
88
- response = await fetchFn(url, {
89
- method: "GET"
90
- });
91
- } catch (error) {
92
- throw new NetworkError(
93
- `Failed to fetch ${url}`,
94
- error instanceof Error ? error : void 0
95
- );
96
- }
97
- if (!response.ok) {
98
- throw new ApiError(
99
- `API request failed: ${response.statusText}`,
100
- response.status,
101
- url
102
- );
103
- }
49
+ const response = await fetchRaw(path);
104
50
  return response.text();
105
51
  }
106
52
  return {
@@ -110,12 +56,12 @@ function folderBlog(domain, options = {}) {
110
56
  return data.posts;
111
57
  },
112
58
  async get(slug) {
113
- if (!slug) throw new FolderBlogError("Post slug is required");
59
+ if (!slug) throw new chunkE7PYGJA7_cjs.FolderBlogError("Post slug is required");
114
60
  try {
115
61
  return await request(`/api/posts/${encodeURIComponent(slug)}`);
116
62
  } catch (error) {
117
- if (error instanceof NotFoundError) {
118
- throw new NotFoundError("Post", slug, error.url);
63
+ if (error instanceof chunkE7PYGJA7_cjs.NotFoundError) {
64
+ throw new chunkE7PYGJA7_cjs.NotFoundError("Post", slug, error.url);
119
65
  }
120
66
  throw error;
121
67
  }
@@ -150,339 +96,363 @@ function folderBlog(domain, options = {}) {
150
96
  }
151
97
 
152
98
  // src/index.ts
153
- var VERSION = "0.0.1";
99
+ var VERSION = "0.0.2";
154
100
 
101
+ Object.defineProperty(exports, "ApiError", {
102
+ enumerable: true,
103
+ get: function () { return chunkE7PYGJA7_cjs.ApiError; }
104
+ });
105
+ Object.defineProperty(exports, "FolderBlogError", {
106
+ enumerable: true,
107
+ get: function () { return chunkE7PYGJA7_cjs.FolderBlogError; }
108
+ });
109
+ Object.defineProperty(exports, "NetworkError", {
110
+ enumerable: true,
111
+ get: function () { return chunkE7PYGJA7_cjs.NetworkError; }
112
+ });
113
+ Object.defineProperty(exports, "NotFoundError", {
114
+ enumerable: true,
115
+ get: function () { return chunkE7PYGJA7_cjs.NotFoundError; }
116
+ });
155
117
  Object.defineProperty(exports, "DEFAULT_PIPELINE_OPTIONS", {
156
118
  enumerable: true,
157
- get: function () { return chunkQA4KPPTA_cjs.DEFAULT_PIPELINE_OPTIONS; }
119
+ get: function () { return chunkJ3Y3HEBF_cjs.DEFAULT_PIPELINE_OPTIONS; }
158
120
  });
159
121
  Object.defineProperty(exports, "IssueCollector", {
160
122
  enumerable: true,
161
- get: function () { return chunkQA4KPPTA_cjs.IssueCollector; }
123
+ get: function () { return chunkJ3Y3HEBF_cjs.IssueCollector; }
162
124
  });
163
125
  Object.defineProperty(exports, "Processor", {
164
126
  enumerable: true,
165
- get: function () { return chunkQA4KPPTA_cjs.Processor; }
127
+ get: function () { return chunkJ3Y3HEBF_cjs.Processor; }
166
128
  });
167
129
  Object.defineProperty(exports, "SlugManager", {
168
130
  enumerable: true,
169
- get: function () { return chunkQA4KPPTA_cjs.SlugManager; }
131
+ get: function () { return chunkJ3Y3HEBF_cjs.SlugManager; }
170
132
  });
171
133
  Object.defineProperty(exports, "buildFileMaps", {
172
134
  enumerable: true,
173
- get: function () { return chunkQA4KPPTA_cjs.buildFileMaps; }
135
+ get: function () { return chunkJ3Y3HEBF_cjs.buildFileMaps; }
174
136
  });
175
137
  Object.defineProperty(exports, "buildToc", {
176
138
  enumerable: true,
177
- get: function () { return chunkQA4KPPTA_cjs.buildToc; }
139
+ get: function () { return chunkJ3Y3HEBF_cjs.buildToc; }
178
140
  });
179
141
  Object.defineProperty(exports, "calculateSummary", {
180
142
  enumerable: true,
181
- get: function () { return chunkQA4KPPTA_cjs.calculateSummary; }
143
+ get: function () { return chunkJ3Y3HEBF_cjs.calculateSummary; }
182
144
  });
183
145
  Object.defineProperty(exports, "combineHashes", {
184
146
  enumerable: true,
185
- get: function () { return chunkQA4KPPTA_cjs.combineHashes; }
147
+ get: function () { return chunkJ3Y3HEBF_cjs.combineHashes; }
186
148
  });
187
149
  Object.defineProperty(exports, "copyFile", {
188
150
  enumerable: true,
189
- get: function () { return chunkQA4KPPTA_cjs.copyFile; }
151
+ get: function () { return chunkJ3Y3HEBF_cjs.copyFile; }
190
152
  });
191
153
  Object.defineProperty(exports, "countWords", {
192
154
  enumerable: true,
193
- get: function () { return chunkQA4KPPTA_cjs.countWords; }
155
+ get: function () { return chunkJ3Y3HEBF_cjs.countWords; }
194
156
  });
195
157
  Object.defineProperty(exports, "createBasePipeline", {
196
158
  enumerable: true,
197
- get: function () { return chunkQA4KPPTA_cjs.createBasePipeline; }
159
+ get: function () { return chunkJ3Y3HEBF_cjs.createBasePipeline; }
198
160
  });
199
161
  Object.defineProperty(exports, "createCustomToLink", {
200
162
  enumerable: true,
201
- get: function () { return chunkQA4KPPTA_cjs.createCustomToLink; }
163
+ get: function () { return chunkJ3Y3HEBF_cjs.createCustomToLink; }
202
164
  });
203
165
  Object.defineProperty(exports, "createPathVariations", {
204
166
  enumerable: true,
205
- get: function () { return chunkQA4KPPTA_cjs.createPathVariations; }
167
+ get: function () { return chunkJ3Y3HEBF_cjs.createPathVariations; }
206
168
  });
207
169
  Object.defineProperty(exports, "createProcessor", {
208
170
  enumerable: true,
209
- get: function () { return chunkQA4KPPTA_cjs.createProcessor; }
171
+ get: function () { return chunkJ3Y3HEBF_cjs.createProcessor; }
210
172
  });
211
173
  Object.defineProperty(exports, "ensureDir", {
212
174
  enumerable: true,
213
- get: function () { return chunkQA4KPPTA_cjs.ensureDir; }
175
+ get: function () { return chunkJ3Y3HEBF_cjs.ensureDir; }
214
176
  });
215
177
  Object.defineProperty(exports, "estimateReadingTime", {
216
178
  enumerable: true,
217
- get: function () { return chunkQA4KPPTA_cjs.estimateReadingTime; }
179
+ get: function () { return chunkJ3Y3HEBF_cjs.estimateReadingTime; }
218
180
  });
219
181
  Object.defineProperty(exports, "extractFirstParagraph", {
220
182
  enumerable: true,
221
- get: function () { return chunkQA4KPPTA_cjs.extractFirstParagraph; }
183
+ get: function () { return chunkJ3Y3HEBF_cjs.extractFirstParagraph; }
222
184
  });
223
185
  Object.defineProperty(exports, "extractHeadings", {
224
186
  enumerable: true,
225
- get: function () { return chunkQA4KPPTA_cjs.extractHeadings; }
187
+ get: function () { return chunkJ3Y3HEBF_cjs.extractHeadings; }
226
188
  });
227
189
  Object.defineProperty(exports, "fileExists", {
228
190
  enumerable: true,
229
- get: function () { return chunkQA4KPPTA_cjs.fileExists; }
191
+ get: function () { return chunkJ3Y3HEBF_cjs.fileExists; }
230
192
  });
231
193
  Object.defineProperty(exports, "filterIssues", {
232
194
  enumerable: true,
233
- get: function () { return chunkQA4KPPTA_cjs.filterIssues; }
195
+ get: function () { return chunkJ3Y3HEBF_cjs.filterIssues; }
234
196
  });
235
197
  Object.defineProperty(exports, "findByFileNameCaseInsensitive", {
236
198
  enumerable: true,
237
- get: function () { return chunkQA4KPPTA_cjs.findByFileNameCaseInsensitive; }
199
+ get: function () { return chunkJ3Y3HEBF_cjs.findByFileNameCaseInsensitive; }
238
200
  });
239
201
  Object.defineProperty(exports, "findFiles", {
240
202
  enumerable: true,
241
- get: function () { return chunkQA4KPPTA_cjs.findFiles; }
203
+ get: function () { return chunkJ3Y3HEBF_cjs.findFiles; }
242
204
  });
243
205
  Object.defineProperty(exports, "findMarkdownFiles", {
244
206
  enumerable: true,
245
- get: function () { return chunkQA4KPPTA_cjs.findMarkdownFiles; }
207
+ get: function () { return chunkJ3Y3HEBF_cjs.findMarkdownFiles; }
246
208
  });
247
209
  Object.defineProperty(exports, "generateBaseSlug", {
248
210
  enumerable: true,
249
- get: function () { return chunkQA4KPPTA_cjs.generateBaseSlug; }
211
+ get: function () { return chunkJ3Y3HEBF_cjs.generateBaseSlug; }
250
212
  });
251
213
  Object.defineProperty(exports, "generateIssueReport", {
252
214
  enumerable: true,
253
- get: function () { return chunkQA4KPPTA_cjs.generateIssueReport; }
215
+ get: function () { return chunkJ3Y3HEBF_cjs.generateIssueReport; }
254
216
  });
255
217
  Object.defineProperty(exports, "getContentStats", {
256
218
  enumerable: true,
257
- get: function () { return chunkQA4KPPTA_cjs.getContentStats; }
219
+ get: function () { return chunkJ3Y3HEBF_cjs.getContentStats; }
258
220
  });
259
221
  Object.defineProperty(exports, "getExtension", {
260
222
  enumerable: true,
261
- get: function () { return chunkQA4KPPTA_cjs.getExtension; }
223
+ get: function () { return chunkJ3Y3HEBF_cjs.getExtension; }
262
224
  });
263
225
  Object.defineProperty(exports, "getFileName", {
264
226
  enumerable: true,
265
- get: function () { return chunkQA4KPPTA_cjs.getFileName; }
227
+ get: function () { return chunkJ3Y3HEBF_cjs.getFileName; }
266
228
  });
267
229
  Object.defineProperty(exports, "getStats", {
268
230
  enumerable: true,
269
- get: function () { return chunkQA4KPPTA_cjs.getStats; }
231
+ get: function () { return chunkJ3Y3HEBF_cjs.getStats; }
270
232
  });
271
233
  Object.defineProperty(exports, "hashBuffer", {
272
234
  enumerable: true,
273
- get: function () { return chunkQA4KPPTA_cjs.hashBuffer; }
235
+ get: function () { return chunkJ3Y3HEBF_cjs.hashBuffer; }
274
236
  });
275
237
  Object.defineProperty(exports, "hashContent", {
276
238
  enumerable: true,
277
- get: function () { return chunkQA4KPPTA_cjs.hashContent; }
239
+ get: function () { return chunkJ3Y3HEBF_cjs.hashContent; }
278
240
  });
279
241
  Object.defineProperty(exports, "hastToHtml", {
280
242
  enumerable: true,
281
- get: function () { return chunkQA4KPPTA_cjs.hastToHtml; }
243
+ get: function () { return chunkJ3Y3HEBF_cjs.hastToHtml; }
282
244
  });
283
245
  Object.defineProperty(exports, "mdastToHast", {
284
246
  enumerable: true,
285
- get: function () { return chunkQA4KPPTA_cjs.mdastToHast; }
247
+ get: function () { return chunkJ3Y3HEBF_cjs.mdastToHast; }
286
248
  });
287
249
  Object.defineProperty(exports, "mdastToText", {
288
250
  enumerable: true,
289
- get: function () { return chunkQA4KPPTA_cjs.mdastToText; }
251
+ get: function () { return chunkJ3Y3HEBF_cjs.mdastToText; }
290
252
  });
291
253
  Object.defineProperty(exports, "normalizePath", {
292
254
  enumerable: true,
293
- get: function () { return chunkQA4KPPTA_cjs.normalizePath; }
255
+ get: function () { return chunkJ3Y3HEBF_cjs.normalizePath; }
294
256
  });
295
257
  Object.defineProperty(exports, "parseFrontmatter", {
296
258
  enumerable: true,
297
- get: function () { return chunkQA4KPPTA_cjs.parseFrontmatter; }
259
+ get: function () { return chunkJ3Y3HEBF_cjs.parseFrontmatter; }
298
260
  });
299
261
  Object.defineProperty(exports, "parseToMdast", {
300
262
  enumerable: true,
301
- get: function () { return chunkQA4KPPTA_cjs.parseToMdast; }
263
+ get: function () { return chunkJ3Y3HEBF_cjs.parseToMdast; }
302
264
  });
303
265
  Object.defineProperty(exports, "processFolder", {
304
266
  enumerable: true,
305
- get: function () { return chunkQA4KPPTA_cjs.processFolder; }
267
+ get: function () { return chunkJ3Y3HEBF_cjs.processFolder; }
306
268
  });
307
269
  Object.defineProperty(exports, "processMarkdown", {
308
270
  enumerable: true,
309
- get: function () { return chunkQA4KPPTA_cjs.processMarkdown; }
271
+ get: function () { return chunkJ3Y3HEBF_cjs.processMarkdown; }
310
272
  });
311
273
  Object.defineProperty(exports, "processVault", {
312
274
  enumerable: true,
313
- get: function () { return chunkQA4KPPTA_cjs.processVault; }
275
+ get: function () { return chunkJ3Y3HEBF_cjs.processVault; }
314
276
  });
315
277
  Object.defineProperty(exports, "readJson", {
316
278
  enumerable: true,
317
- get: function () { return chunkQA4KPPTA_cjs.readJson; }
279
+ get: function () { return chunkJ3Y3HEBF_cjs.readJson; }
318
280
  });
319
281
  Object.defineProperty(exports, "readText", {
320
282
  enumerable: true,
321
- get: function () { return chunkQA4KPPTA_cjs.readText; }
283
+ get: function () { return chunkJ3Y3HEBF_cjs.readText; }
322
284
  });
323
285
  Object.defineProperty(exports, "relativePath", {
324
286
  enumerable: true,
325
- get: function () { return chunkQA4KPPTA_cjs.relativePath; }
287
+ get: function () { return chunkJ3Y3HEBF_cjs.relativePath; }
326
288
  });
327
289
  Object.defineProperty(exports, "remarkMarkdownLinkResolver", {
328
290
  enumerable: true,
329
- get: function () { return chunkQA4KPPTA_cjs.remarkMarkdownLinkResolver; }
291
+ get: function () { return chunkJ3Y3HEBF_cjs.remarkMarkdownLinkResolver; }
330
292
  });
331
293
  Object.defineProperty(exports, "resolveFile", {
332
294
  enumerable: true,
333
- get: function () { return chunkQA4KPPTA_cjs.resolveFile; }
295
+ get: function () { return chunkJ3Y3HEBF_cjs.resolveFile; }
334
296
  });
335
297
  Object.defineProperty(exports, "resolveFromCandidates", {
336
298
  enumerable: true,
337
- get: function () { return chunkQA4KPPTA_cjs.resolveFromCandidates; }
299
+ get: function () { return chunkJ3Y3HEBF_cjs.resolveFromCandidates; }
338
300
  });
339
301
  Object.defineProperty(exports, "resolveMarkdownLink", {
340
302
  enumerable: true,
341
- get: function () { return chunkQA4KPPTA_cjs.resolveMarkdownLink; }
303
+ get: function () { return chunkJ3Y3HEBF_cjs.resolveMarkdownLink; }
342
304
  });
343
305
  Object.defineProperty(exports, "resolveMarkdownLinkPath", {
344
306
  enumerable: true,
345
- get: function () { return chunkQA4KPPTA_cjs.resolveMarkdownLinkPath; }
307
+ get: function () { return chunkJ3Y3HEBF_cjs.resolveMarkdownLinkPath; }
346
308
  });
347
309
  Object.defineProperty(exports, "resolveSlugConflict", {
348
310
  enumerable: true,
349
- get: function () { return chunkQA4KPPTA_cjs.resolveSlugConflict; }
311
+ get: function () { return chunkJ3Y3HEBF_cjs.resolveSlugConflict; }
350
312
  });
351
313
  Object.defineProperty(exports, "resolveWikilink", {
352
314
  enumerable: true,
353
- get: function () { return chunkQA4KPPTA_cjs.resolveWikilink; }
315
+ get: function () { return chunkJ3Y3HEBF_cjs.resolveWikilink; }
354
316
  });
355
317
  Object.defineProperty(exports, "shortHash", {
356
318
  enumerable: true,
357
- get: function () { return chunkQA4KPPTA_cjs.shortHash; }
319
+ get: function () { return chunkJ3Y3HEBF_cjs.shortHash; }
358
320
  });
359
321
  Object.defineProperty(exports, "toSlug", {
360
322
  enumerable: true,
361
- get: function () { return chunkQA4KPPTA_cjs.toSlug; }
323
+ get: function () { return chunkJ3Y3HEBF_cjs.toSlug; }
362
324
  });
363
325
  Object.defineProperty(exports, "wikiToObsidian", {
364
326
  enumerable: true,
365
- get: function () { return chunkQA4KPPTA_cjs.wikiToObsidian; }
327
+ get: function () { return chunkJ3Y3HEBF_cjs.wikiToObsidian; }
366
328
  });
367
329
  Object.defineProperty(exports, "wikilinkToMarkdownLink", {
368
330
  enumerable: true,
369
- get: function () { return chunkQA4KPPTA_cjs.wikilinkToMarkdownLink; }
331
+ get: function () { return chunkJ3Y3HEBF_cjs.wikilinkToMarkdownLink; }
370
332
  });
371
333
  Object.defineProperty(exports, "writeJson", {
372
334
  enumerable: true,
373
- get: function () { return chunkQA4KPPTA_cjs.writeJson; }
335
+ get: function () { return chunkJ3Y3HEBF_cjs.writeJson; }
374
336
  });
375
337
  Object.defineProperty(exports, "writeText", {
376
338
  enumerable: true,
377
- get: function () { return chunkQA4KPPTA_cjs.writeText; }
339
+ get: function () { return chunkJ3Y3HEBF_cjs.writeText; }
378
340
  });
379
- Object.defineProperty(exports, "CopyOnlyImageProcessor", {
341
+ Object.defineProperty(exports, "DEFAULT_IMAGE_SIZES", {
380
342
  enumerable: true,
381
- get: function () { return chunkHMQIQUPB_cjs.CopyOnlyImageProcessor; }
343
+ get: function () { return chunk2TZSVPNP_cjs.DEFAULT_IMAGE_SIZES; }
382
344
  });
383
- Object.defineProperty(exports, "NoOpDatabase", {
345
+ Object.defineProperty(exports, "OUTPUT_FILES", {
384
346
  enumerable: true,
385
- get: function () { return chunkHMQIQUPB_cjs.NoOpDatabase; }
347
+ get: function () { return chunk2TZSVPNP_cjs.OUTPUT_FILES; }
386
348
  });
387
- Object.defineProperty(exports, "NoOpImageEmbedder", {
349
+ Object.defineProperty(exports, "buildEmbeddingCacheFromManifest", {
388
350
  enumerable: true,
389
- get: function () { return chunkHMQIQUPB_cjs.NoOpImageEmbedder; }
351
+ get: function () { return chunk2TZSVPNP_cjs.buildEmbeddingCacheFromManifest; }
390
352
  });
391
- Object.defineProperty(exports, "NoOpSimilarity", {
353
+ Object.defineProperty(exports, "buildMediaCacheFromManifest", {
392
354
  enumerable: true,
393
- get: function () { return chunkHMQIQUPB_cjs.NoOpSimilarity; }
355
+ get: function () { return chunk2TZSVPNP_cjs.buildMediaCacheFromManifest; }
394
356
  });
395
- Object.defineProperty(exports, "NoOpTextEmbedder", {
357
+ Object.defineProperty(exports, "createEmptyCacheStats", {
396
358
  enumerable: true,
397
- get: function () { return chunkHMQIQUPB_cjs.NoOpTextEmbedder; }
359
+ get: function () { return chunk2TZSVPNP_cjs.createEmptyCacheStats; }
398
360
  });
399
- Object.defineProperty(exports, "PassthroughMermaidRenderer", {
361
+ Object.defineProperty(exports, "getMediaOutputDir", {
400
362
  enumerable: true,
401
- get: function () { return chunkHMQIQUPB_cjs.PassthroughMermaidRenderer; }
363
+ get: function () { return chunk2TZSVPNP_cjs.getMediaOutputDir; }
402
364
  });
403
- Object.defineProperty(exports, "PluginManager", {
365
+ Object.defineProperty(exports, "getOutputDir", {
404
366
  enumerable: true,
405
- get: function () { return chunkHMQIQUPB_cjs.PluginManager; }
367
+ get: function () { return chunk2TZSVPNP_cjs.getOutputDir; }
406
368
  });
407
- Object.defineProperty(exports, "createAllNoOpPlugins", {
369
+ Object.defineProperty(exports, "isBrokenLinkIssue", {
408
370
  enumerable: true,
409
- get: function () { return chunkHMQIQUPB_cjs.createAllNoOpPlugins; }
371
+ get: function () { return chunk2TZSVPNP_cjs.isBrokenLinkIssue; }
410
372
  });
411
- Object.defineProperty(exports, "createDefaultPlugins", {
373
+ Object.defineProperty(exports, "isEmbeddingErrorIssue", {
412
374
  enumerable: true,
413
- get: function () { return chunkHMQIQUPB_cjs.createDefaultPlugins; }
375
+ get: function () { return chunk2TZSVPNP_cjs.isEmbeddingErrorIssue; }
414
376
  });
415
- Object.defineProperty(exports, "createPluginManager", {
377
+ Object.defineProperty(exports, "isMediaProcessingIssue", {
416
378
  enumerable: true,
417
- get: function () { return chunkHMQIQUPB_cjs.createPluginManager; }
379
+ get: function () { return chunk2TZSVPNP_cjs.isMediaProcessingIssue; }
418
380
  });
419
- Object.defineProperty(exports, "topologicalSort", {
381
+ Object.defineProperty(exports, "isMermaidErrorIssue", {
420
382
  enumerable: true,
421
- get: function () { return chunkHMQIQUPB_cjs.topologicalSort; }
383
+ get: function () { return chunk2TZSVPNP_cjs.isMermaidErrorIssue; }
422
384
  });
423
- Object.defineProperty(exports, "DEFAULT_IMAGE_SIZES", {
385
+ Object.defineProperty(exports, "isMissingMediaIssue", {
424
386
  enumerable: true,
425
- get: function () { return chunk24MKFHML_cjs.DEFAULT_IMAGE_SIZES; }
387
+ get: function () { return chunk2TZSVPNP_cjs.isMissingMediaIssue; }
426
388
  });
427
- Object.defineProperty(exports, "OUTPUT_FILES", {
389
+ Object.defineProperty(exports, "isPluginErrorIssue", {
428
390
  enumerable: true,
429
- get: function () { return chunk24MKFHML_cjs.OUTPUT_FILES; }
391
+ get: function () { return chunk2TZSVPNP_cjs.isPluginErrorIssue; }
430
392
  });
431
- Object.defineProperty(exports, "buildEmbeddingCacheFromManifest", {
393
+ Object.defineProperty(exports, "isSlugConflictIssue", {
432
394
  enumerable: true,
433
- get: function () { return chunk24MKFHML_cjs.buildEmbeddingCacheFromManifest; }
395
+ get: function () { return chunk2TZSVPNP_cjs.isSlugConflictIssue; }
434
396
  });
435
- Object.defineProperty(exports, "buildMediaCacheFromManifest", {
397
+ Object.defineProperty(exports, "withDefaults", {
436
398
  enumerable: true,
437
- get: function () { return chunk24MKFHML_cjs.buildMediaCacheFromManifest; }
399
+ get: function () { return chunk2TZSVPNP_cjs.withDefaults; }
438
400
  });
439
- Object.defineProperty(exports, "createEmptyCacheStats", {
401
+ Object.defineProperty(exports, "CopyOnlyImageProcessor", {
440
402
  enumerable: true,
441
- get: function () { return chunk24MKFHML_cjs.createEmptyCacheStats; }
403
+ get: function () { return chunk6TFXNIO6_cjs.CopyOnlyImageProcessor; }
442
404
  });
443
- Object.defineProperty(exports, "getMediaOutputDir", {
405
+ Object.defineProperty(exports, "CosineSimilarityPlugin", {
444
406
  enumerable: true,
445
- get: function () { return chunk24MKFHML_cjs.getMediaOutputDir; }
407
+ get: function () { return chunk6TFXNIO6_cjs.CosineSimilarityPlugin; }
446
408
  });
447
- Object.defineProperty(exports, "getOutputDir", {
409
+ Object.defineProperty(exports, "NoOpDatabase", {
448
410
  enumerable: true,
449
- get: function () { return chunk24MKFHML_cjs.getOutputDir; }
411
+ get: function () { return chunk6TFXNIO6_cjs.NoOpDatabase; }
450
412
  });
451
- Object.defineProperty(exports, "isBrokenLinkIssue", {
413
+ Object.defineProperty(exports, "NoOpImageEmbedder", {
452
414
  enumerable: true,
453
- get: function () { return chunk24MKFHML_cjs.isBrokenLinkIssue; }
415
+ get: function () { return chunk6TFXNIO6_cjs.NoOpImageEmbedder; }
454
416
  });
455
- Object.defineProperty(exports, "isEmbeddingErrorIssue", {
417
+ Object.defineProperty(exports, "NoOpSimilarity", {
456
418
  enumerable: true,
457
- get: function () { return chunk24MKFHML_cjs.isEmbeddingErrorIssue; }
419
+ get: function () { return chunk6TFXNIO6_cjs.NoOpSimilarity; }
458
420
  });
459
- Object.defineProperty(exports, "isMediaProcessingIssue", {
421
+ Object.defineProperty(exports, "NoOpTextEmbedder", {
460
422
  enumerable: true,
461
- get: function () { return chunk24MKFHML_cjs.isMediaProcessingIssue; }
423
+ get: function () { return chunk6TFXNIO6_cjs.NoOpTextEmbedder; }
462
424
  });
463
- Object.defineProperty(exports, "isMermaidErrorIssue", {
425
+ Object.defineProperty(exports, "PassthroughMermaidRenderer", {
464
426
  enumerable: true,
465
- get: function () { return chunk24MKFHML_cjs.isMermaidErrorIssue; }
427
+ get: function () { return chunk6TFXNIO6_cjs.PassthroughMermaidRenderer; }
466
428
  });
467
- Object.defineProperty(exports, "isMissingMediaIssue", {
429
+ Object.defineProperty(exports, "PluginManager", {
468
430
  enumerable: true,
469
- get: function () { return chunk24MKFHML_cjs.isMissingMediaIssue; }
431
+ get: function () { return chunk6TFXNIO6_cjs.PluginManager; }
470
432
  });
471
- Object.defineProperty(exports, "isPluginErrorIssue", {
433
+ Object.defineProperty(exports, "cosineSimilarity", {
472
434
  enumerable: true,
473
- get: function () { return chunk24MKFHML_cjs.isPluginErrorIssue; }
435
+ get: function () { return chunk6TFXNIO6_cjs.cosineSimilarity; }
474
436
  });
475
- Object.defineProperty(exports, "isSlugConflictIssue", {
437
+ Object.defineProperty(exports, "createAllNoOpPlugins", {
476
438
  enumerable: true,
477
- get: function () { return chunk24MKFHML_cjs.isSlugConflictIssue; }
439
+ get: function () { return chunk6TFXNIO6_cjs.createAllNoOpPlugins; }
478
440
  });
479
- Object.defineProperty(exports, "withDefaults", {
441
+ Object.defineProperty(exports, "createDefaultPlugins", {
442
+ enumerable: true,
443
+ get: function () { return chunk6TFXNIO6_cjs.createDefaultPlugins; }
444
+ });
445
+ Object.defineProperty(exports, "createPluginManager", {
446
+ enumerable: true,
447
+ get: function () { return chunk6TFXNIO6_cjs.createPluginManager; }
448
+ });
449
+ Object.defineProperty(exports, "createSimilarityPlugin", {
450
+ enumerable: true,
451
+ get: function () { return chunk6TFXNIO6_cjs.createSimilarityPlugin; }
452
+ });
453
+ Object.defineProperty(exports, "topologicalSort", {
480
454
  enumerable: true,
481
- get: function () { return chunk24MKFHML_cjs.withDefaults; }
455
+ get: function () { return chunk6TFXNIO6_cjs.topologicalSort; }
482
456
  });
483
- exports.ApiError = ApiError;
484
- exports.FolderBlogError = FolderBlogError;
485
- exports.NetworkError = NetworkError;
486
- exports.NotFoundError = NotFoundError;
487
457
  exports.VERSION = VERSION;
488
458
  exports.folderBlog = folderBlog;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,8 @@
1
- export { B as BrokenLinkIssue, C as CacheContext, a as CacheStats, b as CachedMediaMetadata, c as CachedMediaSizeVariant, d as ContentConfig, D as DEFAULT_IMAGE_SIZES, e as DatabaseBuildInput, f as DatabasePlugin, g as DatabaseResult, h as DebugConfig, i as DirectoryConfig, E as EmbeddingErrorIssue, j as EmbeddingMap, G as GraphData, k as GraphEdge, l as GraphNode, I as ImageEmbeddingPlugin, m as ImageMetadata, n as ImageProcessOptions, o as ImageProcessResult, p as ImageProcessorPlugin, q as ImageSizeConfig, r as IssueCategory, s as IssueCollector, t as IssueCollectorState, u as IssueFilterOptions, v as IssueModule, w as IssueReport, x as IssueSeverity, y as IssueSummary, L as LogLevel, M as MediaConfig, z as MediaMetadata, A as MediaPathMap, F as MediaProcessingIssue, H as MediaSizeVariant, J as MermaidConfig, K as MermaidErrorIssue, N as MermaidRenderOptions, O as MermaidRendererPlugin, P as MermaidResult, Q as MermaidStrategy, R as MissingMediaIssue, S as OUTPUT_FILES, T as OutputFiles, U as PathHashMap, V as PipelineConfig, W as Plugin, X as PluginByName, Y as PluginConfig, Z as PluginContext, _ as PluginErrorIssue, $ as PluginName, a0 as PostCover, a1 as PostCoverError, a2 as PostCoverSize, a3 as PostMetadata, a4 as ProcessConfig, a5 as ProcessConfigWithDefaults, a6 as ProcessResult, a7 as ProcessedMedia, a8 as ProcessedPost, a9 as ProcessingIssue, aa as RelationshipType, ab as SimilarityPlugin, ac as SimilarityResult, ad as SlugConflictIssue, ae as SlugHashMap, af as TextEmbeddingPlugin, ag as TocItem, ah as buildEmbeddingCacheFromManifest, ai as buildMediaCacheFromManifest, aj as calculateSummary, ak as createEmptyCacheStats, al as filterIssues, am as generateIssueReport, an as getMediaOutputDir, ao as getOutputDir, ap as isBrokenLinkIssue, aq as isEmbeddingErrorIssue, ar as isMediaProcessingIssue, as as isMermaidErrorIssue, at as isMissingMediaIssue, au as isPluginErrorIssue, av as isSlugConflictIssue, aw as withDefaults } from './config-DFr-htlO.cjs';
1
+ export { C as ContentConfig, D as DEFAULT_IMAGE_SIZES, a as DatabaseBuildInput, b as DatabasePlugin, c as DatabaseResult, d as DebugConfig, e as DirectoryConfig, I as ImageEmbeddingPlugin, f as ImageMetadata, g as ImageProcessOptions, h as ImageProcessResult, i as ImageProcessorPlugin, j as ImageSizeConfig, k as IssueCollector, l as IssueCollectorState, L as LogLevel, M as MediaConfig, m as MermaidConfig, n as MermaidRenderOptions, o as MermaidRendererPlugin, p as MermaidResult, q as MermaidStrategy, r as PipelineConfig, s as Plugin, t as PluginByName, u as PluginConfig, P as PluginContext, v as PluginName, w as ProcessConfig, x as ProcessConfigWithDefaults, S as SimilarityConfig, y as SimilarityPlugin, z as SimilarityResult, T as TextEmbeddingPlugin, A as calculateSummary, B as filterIssues, E as generateIssueReport, F as getMediaOutputDir, G as getOutputDir, H as withDefaults } from './config-ADPY6IQS.cjs';
2
+ export { B as BrokenLinkIssue, f as BuildReport, C as CacheContext, g as CacheStats, h as CachedMediaMetadata, i as CachedMediaSizeVariant, E as EmbeddingErrorIssue, j as EmbeddingMap, G as GraphData, k as GraphEdge, l as GraphNode, m as IssueCategory, I as IssueFilterOptions, n as IssueModule, b as IssueReport, a as IssueSeverity, c as IssueSummary, M as MediaMetadata, o as MediaPathMap, p as MediaProcessingIssue, q as MediaSizeVariant, r as MermaidErrorIssue, s as MissingMediaIssue, O as OUTPUT_FILES, t as OutputFiles, u as PathHashMap, v as PluginErrorIssue, w as PostCover, x as PostCoverError, y as PostCoverSize, z as PostMetadata, A as ProcessResult, e as ProcessedMedia, d as ProcessedPost, P as ProcessingIssue, R as RelationshipType, S as SlugConflictIssue, D as SlugHashMap, T as TocItem, F as buildEmbeddingCacheFromManifest, H as buildMediaCacheFromManifest, J as createEmptyCacheStats, K as isBrokenLinkIssue, L as isEmbeddingErrorIssue, N as isMediaProcessingIssue, Q as isMermaidErrorIssue, U as isMissingMediaIssue, V as isPluginErrorIssue, W as isSlugConflictIssue } from './output-0P0br3Jc.cjs';
2
3
  export { BlockOnly, FileMap, HeaderOnly, LinkResolverOptions, ObsidianLink, PageAndBlock, PageAndHeader, PageOnly } from './processor/types.cjs';
3
4
  export { CopyOnlyImageProcessor, NoOpDatabase, NoOpImageEmbedder, NoOpSimilarity, NoOpTextEmbedder, PassthroughMermaidRenderer, PluginManager, PluginManagerConfig, createAllNoOpPlugins, createDefaultPlugins, createPluginManager, topologicalSort } from './processor/plugins.cjs';
5
+ export { CosineSimilarityPlugin, SimilarityPluginOptions, cosineSimilarity, createSimilarityPlugin } from './plugins/similarity.cjs';
4
6
  export { BaseSlugOptions, CustomToLinkOptions, DEFAULT_PIPELINE_OPTIONS, FileItem, FrontmatterResult, MarkdownResult, PipelineOptions, Processor, ProcessorOptions, RehypePlugin, RemarkPlugin, SlugAssignment, SlugConfig, SlugManager, buildFileMaps, buildToc, combineHashes, copyFile, countWords, createBasePipeline, createCustomToLink, createPathVariations, createProcessor, ensureDir, estimateReadingTime, extractFirstParagraph, extractHeadings, fileExists, findByFileNameCaseInsensitive, findFiles, findMarkdownFiles, generateBaseSlug, getContentStats, getExtension, getFileName, getStats, hashBuffer, hashContent, hastToHtml, mdastToHast, mdastToText, normalizePath, parseFrontmatter, parseToMdast, processFolder, processMarkdown, processVault, readJson, readText, relativePath, remarkMarkdownLinkResolver, resolveFile, resolveFromCandidates, resolveMarkdownLink, resolveMarkdownLinkPath, resolveSlugConflict, resolveWikilink, shortHash, toSlug, wikiToObsidian, wikilinkToMarkdownLink, writeJson, writeText } from './processor/index.cjs';
5
7
  import 'mdast';
6
8
  import 'hast';
@@ -125,7 +127,6 @@ declare class ApiError extends FolderBlogError {
125
127
  * Error thrown when network/fetch fails
126
128
  */
127
129
  declare class NetworkError extends FolderBlogError {
128
- readonly cause?: Error;
129
130
  constructor(message: string, cause?: Error);
130
131
  }
131
132
 
@@ -162,6 +163,6 @@ declare class NetworkError extends FolderBlogError {
162
163
  * @packageDocumentation
163
164
  */
164
165
 
165
- declare const VERSION = "0.0.1";
166
+ declare const VERSION = "0.0.2";
166
167
 
167
168
  export { ApiError, type FolderBlogClient, FolderBlogError, type FolderBlogOptions, NetworkError, NotFoundError, type Post, type PostSummary, type Site, VERSION, folderBlog };