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.
- package/dist/{chunk-24MKFHML.cjs → chunk-2TZSVPNP.cjs} +5 -0
- package/dist/{chunk-HMQIQUPB.cjs → chunk-6TFXNIO6.cjs} +108 -0
- package/dist/{chunk-ZRUBI3GH.js → chunk-B43UAOPC.js} +106 -1
- package/dist/{chunk-XP5J4LFJ.js → chunk-D26H5722.js} +5 -0
- package/dist/chunk-E7PYGJA7.cjs +39 -0
- package/dist/{chunk-QA4KPPTA.cjs → chunk-J3Y3HEBF.cjs} +84 -13
- package/dist/{chunk-PARGDJNY.js → chunk-K76XLEC7.js} +1 -1
- package/dist/{chunk-IXP35S24.js → chunk-LPPBVXJ7.js} +83 -12
- package/dist/chunk-Q6EXKX6K.js +17 -0
- package/dist/{chunk-4ZJGUMHS.cjs → chunk-Q6EYTOTM.cjs} +2 -2
- package/dist/chunk-UCXXH2MP.cjs +20 -0
- package/dist/chunk-XQD3UUL5.js +34 -0
- package/dist/cli/bin.cjs +5 -5
- package/dist/cli/bin.js +4 -4
- package/dist/cli/index.cjs +5 -5
- package/dist/cli/index.js +4 -4
- package/dist/config-ADPY6IQS.d.cts +473 -0
- package/dist/config-Dctsdeo6.d.ts +473 -0
- package/dist/index.cjs +157 -187
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +16 -69
- package/dist/local/index.cjs +785 -0
- package/dist/local/index.d.cts +268 -0
- package/dist/local/index.d.ts +268 -0
- package/dist/local/index.js +772 -0
- package/dist/output-0P0br3Jc.d.cts +452 -0
- package/dist/output-0P0br3Jc.d.ts +452 -0
- package/dist/plugins/embed-cloudflare-ai.cjs +166 -0
- package/dist/plugins/embed-cloudflare-ai.d.cts +73 -0
- package/dist/plugins/embed-cloudflare-ai.d.ts +73 -0
- package/dist/plugins/embed-cloudflare-ai.js +156 -0
- package/dist/plugins/embed-transformers.cjs +121 -0
- package/dist/plugins/embed-transformers.d.cts +55 -0
- package/dist/plugins/embed-transformers.d.ts +55 -0
- package/dist/plugins/embed-transformers.js +113 -0
- package/dist/plugins/similarity.cjs +19 -0
- package/dist/plugins/similarity.d.cts +41 -0
- package/dist/plugins/similarity.d.ts +41 -0
- package/dist/plugins/similarity.js +2 -0
- package/dist/processor/index.cjs +123 -111
- package/dist/processor/index.d.cts +6 -2
- package/dist/processor/index.d.ts +6 -2
- package/dist/processor/index.js +3 -3
- package/dist/processor/plugins.cjs +24 -12
- package/dist/processor/plugins.d.cts +4 -2
- package/dist/processor/plugins.d.ts +4 -2
- package/dist/processor/plugins.js +1 -1
- package/dist/processor/types.cjs +16 -16
- package/dist/processor/types.d.cts +3 -2
- package/dist/processor/types.d.ts +3 -2
- package/dist/processor/types.js +1 -1
- package/dist/seo/index.cjs +289 -0
- package/dist/seo/index.d.cts +95 -0
- package/dist/seo/index.d.ts +95 -0
- package/dist/seo/index.js +274 -0
- package/dist/server/index.cjs +2 -5
- package/dist/server/index.js +2 -5
- package/package.json +36 -1
- package/dist/config-DFr-htlO.d.cts +0 -887
- package/dist/config-DFr-htlO.d.ts +0 -887
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export {
|
|
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-Dctsdeo6.js';
|
|
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.js';
|
|
2
3
|
export { BlockOnly, FileMap, HeaderOnly, LinkResolverOptions, ObsidianLink, PageAndBlock, PageAndHeader, PageOnly } from './processor/types.js';
|
|
3
4
|
export { CopyOnlyImageProcessor, NoOpDatabase, NoOpImageEmbedder, NoOpSimilarity, NoOpTextEmbedder, PassthroughMermaidRenderer, PluginManager, PluginManagerConfig, createAllNoOpPlugins, createDefaultPlugins, createPluginManager, topologicalSort } from './processor/plugins.js';
|
|
5
|
+
export { CosineSimilarityPlugin, SimilarityPluginOptions, cosineSimilarity, createSimilarityPlugin } from './plugins/similarity.js';
|
|
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.js';
|
|
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.
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,61 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
import { FolderBlogError, NotFoundError, ApiError, NetworkError } from './chunk-XQD3UUL5.js';
|
|
2
|
+
export { ApiError, FolderBlogError, NetworkError, NotFoundError } from './chunk-XQD3UUL5.js';
|
|
3
|
+
import { normalizeBaseUrl } from './chunk-Q6EXKX6K.js';
|
|
4
|
+
export { DEFAULT_PIPELINE_OPTIONS, IssueCollector, Processor, SlugManager, buildFileMaps, buildToc, calculateSummary, combineHashes, copyFile, countWords, createBasePipeline, createCustomToLink, createPathVariations, createProcessor, ensureDir, estimateReadingTime, extractFirstParagraph, extractHeadings, fileExists, filterIssues, findByFileNameCaseInsensitive, findFiles, findMarkdownFiles, generateBaseSlug, generateIssueReport, 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 './chunk-LPPBVXJ7.js';
|
|
5
|
+
export { DEFAULT_IMAGE_SIZES, OUTPUT_FILES, buildEmbeddingCacheFromManifest, buildMediaCacheFromManifest, createEmptyCacheStats, getMediaOutputDir, getOutputDir, isBrokenLinkIssue, isEmbeddingErrorIssue, isMediaProcessingIssue, isMermaidErrorIssue, isMissingMediaIssue, isPluginErrorIssue, isSlugConflictIssue, withDefaults } from './chunk-D26H5722.js';
|
|
6
|
+
export { CopyOnlyImageProcessor, CosineSimilarityPlugin, NoOpDatabase, NoOpImageEmbedder, NoOpSimilarity, NoOpTextEmbedder, PassthroughMermaidRenderer, PluginManager, cosineSimilarity, createAllNoOpPlugins, createDefaultPlugins, createPluginManager, createSimilarityPlugin, topologicalSort } from './chunk-B43UAOPC.js';
|
|
4
7
|
import './chunk-3RG5ZIWI.js';
|
|
5
8
|
|
|
6
|
-
// src/errors.ts
|
|
7
|
-
var FolderBlogError = class extends Error {
|
|
8
|
-
/** HTTP status code if applicable */
|
|
9
|
-
status;
|
|
10
|
-
/** The URL that was requested */
|
|
11
|
-
url;
|
|
12
|
-
constructor(message, options) {
|
|
13
|
-
super(message);
|
|
14
|
-
this.name = "FolderBlogError";
|
|
15
|
-
this.status = options?.status;
|
|
16
|
-
this.url = options?.url;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
var NotFoundError = class extends FolderBlogError {
|
|
20
|
-
constructor(resource, identifier, url) {
|
|
21
|
-
super(`${resource} not found: ${identifier}`, { status: 404, url });
|
|
22
|
-
this.name = "NotFoundError";
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var ApiError = class extends FolderBlogError {
|
|
26
|
-
constructor(message, status, url) {
|
|
27
|
-
super(message, { status, url });
|
|
28
|
-
this.name = "ApiError";
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var NetworkError = class extends FolderBlogError {
|
|
32
|
-
cause;
|
|
33
|
-
constructor(message, cause) {
|
|
34
|
-
super(message);
|
|
35
|
-
this.name = "NetworkError";
|
|
36
|
-
this.cause = cause;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
9
|
// src/client.ts
|
|
41
|
-
function normalizeBaseUrl(domain) {
|
|
42
|
-
let url = domain.trim();
|
|
43
|
-
if (url.endsWith("/")) url = url.slice(0, -1);
|
|
44
|
-
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
|
45
|
-
url = `https://${url}`;
|
|
46
|
-
}
|
|
47
|
-
return url;
|
|
48
|
-
}
|
|
49
10
|
function folderBlog(domain, options = {}) {
|
|
50
11
|
const baseUrl = normalizeBaseUrl(domain);
|
|
51
12
|
const fetchFn = options.fetch ?? globalThis.fetch;
|
|
52
|
-
async function
|
|
13
|
+
async function fetchRaw(path, accept) {
|
|
53
14
|
const url = `${baseUrl}${path}`;
|
|
54
15
|
let response;
|
|
55
16
|
try {
|
|
56
17
|
response = await fetchFn(url, {
|
|
57
18
|
method: "GET",
|
|
58
|
-
headers: { Accept:
|
|
19
|
+
...accept ? { headers: { Accept: accept } } : {}
|
|
59
20
|
});
|
|
60
21
|
} catch (error) {
|
|
61
22
|
throw new NetworkError(
|
|
@@ -73,32 +34,18 @@ function folderBlog(domain, options = {}) {
|
|
|
73
34
|
url
|
|
74
35
|
);
|
|
75
36
|
}
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
async function request(path) {
|
|
40
|
+
const response = await fetchRaw(path, "application/json");
|
|
76
41
|
try {
|
|
77
42
|
return await response.json();
|
|
78
43
|
} catch {
|
|
79
|
-
throw new ApiError("Failed to parse JSON response", response.status,
|
|
44
|
+
throw new ApiError("Failed to parse JSON response", response.status, `${baseUrl}${path}`);
|
|
80
45
|
}
|
|
81
46
|
}
|
|
82
47
|
async function requestText(path) {
|
|
83
|
-
const
|
|
84
|
-
let response;
|
|
85
|
-
try {
|
|
86
|
-
response = await fetchFn(url, {
|
|
87
|
-
method: "GET"
|
|
88
|
-
});
|
|
89
|
-
} catch (error) {
|
|
90
|
-
throw new NetworkError(
|
|
91
|
-
`Failed to fetch ${url}`,
|
|
92
|
-
error instanceof Error ? error : void 0
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
if (!response.ok) {
|
|
96
|
-
throw new ApiError(
|
|
97
|
-
`API request failed: ${response.statusText}`,
|
|
98
|
-
response.status,
|
|
99
|
-
url
|
|
100
|
-
);
|
|
101
|
-
}
|
|
48
|
+
const response = await fetchRaw(path);
|
|
102
49
|
return response.text();
|
|
103
50
|
}
|
|
104
51
|
return {
|
|
@@ -148,6 +95,6 @@ function folderBlog(domain, options = {}) {
|
|
|
148
95
|
}
|
|
149
96
|
|
|
150
97
|
// src/index.ts
|
|
151
|
-
var VERSION = "0.0.
|
|
98
|
+
var VERSION = "0.0.2";
|
|
152
99
|
|
|
153
|
-
export {
|
|
100
|
+
export { VERSION, folderBlog };
|