@riebeckite/honox 0.0.46 → 0.0.49
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.js +2204 -1778
- package/dist/runtime.js +30 -0
- package/dist/server.js +80 -49
- package/dist/src/client_module.d.ts +1 -3
- package/dist/src/client_module_part1.d.ts +5 -0
- package/dist/src/client_module_part2.d.ts +2 -0
- package/dist/src/content_route.d.ts +3 -88
- package/dist/src/content_route_part1.d.ts +37 -0
- package/dist/src/content_route_part2.d.ts +8 -0
- package/dist/src/runtime_modules.d.ts +1 -0
- package/dist/src/spa_diagnostics.d.ts +4 -0
- package/dist/src/ssg/output_cache.d.ts +5 -37
- package/dist/src/ssg/output_cache_decision.d.ts +9 -0
- package/dist/src/ssg/output_cache_entries.d.ts +5 -0
- package/dist/src/ssg/output_cache_fastpath.d.ts +12 -0
- package/dist/src/ssg/output_cache_load.d.ts +8 -0
- package/dist/src/ssg/output_cache_paths.d.ts +13 -0
- package/dist/src/ssg/output_cache_replace.d.ts +6 -0
- package/dist/src/ssg/output_cache_save.d.ts +2 -0
- package/dist/src/ssg/output_cache_types.d.ts +33 -0
- package/dist/src/ssg/output_cache_validate.d.ts +8 -0
- package/dist/src/ssg/standalone.d.ts +1 -0
- package/dist/src/ssg_plugin.d.ts +3 -12
- package/dist/src/ssg_plugin_cleanup.d.ts +3 -0
- package/dist/src/ssg_plugin_close.d.ts +2 -0
- package/dist/src/ssg_plugin_generate_finalize.d.ts +3 -0
- package/dist/src/ssg_plugin_generate_prepare.d.ts +52 -0
- package/dist/src/ssg_plugin_generate_run.d.ts +3 -0
- package/dist/src/ssg_plugin_helpers.d.ts +21 -0
- package/dist/src/ssg_plugin_setup.d.ts +20 -0
- package/dist/src/ssg_plugin_state.d.ts +52 -0
- package/dist/src/ui/primitives.d.ts +4 -126
- package/dist/src/ui/primitives.js +110 -88
- package/dist/src/ui/primitives_article.d.ts +9 -0
- package/dist/src/ui/primitives_head.d.ts +8 -0
- package/dist/src/ui/primitives_page.d.ts +3 -0
- package/dist/src/ui/primitives_theme.d.ts +7 -0
- package/dist/src/ui/primitives_types.d.ts +82 -0
- package/dist/src/virtual_modules.d.ts +4 -0
- package/dist/src/vite_plugin.d.ts +4 -9
- package/dist/src/vite_plugin_helpers.d.ts +12 -0
- package/dist/src/vite_runner.d.ts +3 -36
- package/dist/src/vite_runner_helpers.d.ts +40 -0
- package/package.json +11 -11
- package/style.css +6 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ResolvedConfig } from "vite";
|
|
2
|
+
import { type OutputCacheState } from "./ssg/output_cache.js";
|
|
3
|
+
import type { OutputCacheDecision, SsgOutputMetrics } from "./ssg/types.js";
|
|
4
|
+
import type { SsgPluginLogger, SsgPluginState } from "./ssg_plugin_state.js";
|
|
5
|
+
export declare function prepareSsgGeneration(plugin: SsgPluginLogger, state: SsgPluginState, bundle: Record<string, {
|
|
6
|
+
type: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
moduleIds?: string[];
|
|
9
|
+
}>): Promise<{
|
|
10
|
+
config: ResolvedConfig;
|
|
11
|
+
timingsMs: Record<string, number>;
|
|
12
|
+
outDir: string;
|
|
13
|
+
viteClientAssetPaths: string[];
|
|
14
|
+
bundleDirectory: string;
|
|
15
|
+
app: import("hono").Hono<any, any, any>;
|
|
16
|
+
module: import("./ssg/types.js").SsgModule;
|
|
17
|
+
outputChangeSet: {
|
|
18
|
+
affected: readonly import("@riebeckite/core").OutputDescriptor[];
|
|
19
|
+
removed: readonly import("@riebeckite/core").OutputDescriptor[];
|
|
20
|
+
unchanged: readonly import("@riebeckite/core").OutputDescriptor[];
|
|
21
|
+
fullRegenerationRequired: boolean;
|
|
22
|
+
candidateOutputCount: number;
|
|
23
|
+
affectedOutputCount: number;
|
|
24
|
+
removedOutputCount: number;
|
|
25
|
+
unchangedOutputCount: number;
|
|
26
|
+
};
|
|
27
|
+
appFingerprint: string;
|
|
28
|
+
bundleFingerprint: string;
|
|
29
|
+
outputCachePath: string;
|
|
30
|
+
previousOutputCache: OutputCacheState & {
|
|
31
|
+
fileSizeBytes?: number;
|
|
32
|
+
};
|
|
33
|
+
siteOwnedOutputPaths: Set<string>;
|
|
34
|
+
outputCacheDecision: OutputCacheDecision;
|
|
35
|
+
outputCacheRejectionReason: import("./ssg_plugin.js").OutputCacheRejectionReason;
|
|
36
|
+
canUseIncremental: boolean;
|
|
37
|
+
reusablePaths: Set<string>;
|
|
38
|
+
inventory: import("@riebeckite/core").OutputDescriptor[];
|
|
39
|
+
inventoryPaths: Set<string>;
|
|
40
|
+
honoStaticRoutePaths: Set<string>;
|
|
41
|
+
shadowedOutputs: Set<string>;
|
|
42
|
+
skippedRouteCount: number;
|
|
43
|
+
generatedHtml: {
|
|
44
|
+
path: string;
|
|
45
|
+
html: string;
|
|
46
|
+
}[];
|
|
47
|
+
nextOutputCache: OutputCacheState;
|
|
48
|
+
metrics: SsgOutputMetrics;
|
|
49
|
+
artifactWriter: import("./ssg/artifact_writer.js").BuildArtifactWriter;
|
|
50
|
+
outputChecksums: Map<string, string>;
|
|
51
|
+
}>;
|
|
52
|
+
export type SsgGeneration = Awaited<ReturnType<typeof prepareSsgGeneration>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SsgGeneration } from "./ssg_plugin_generate_prepare.js";
|
|
2
|
+
import type { RiebeckiteSsgOptions, SsgPluginLogger } from "./ssg_plugin_state.js";
|
|
3
|
+
export declare function runSsgGeneration(_plugin: SsgPluginLogger, ctx: SsgGeneration, options: RiebeckiteSsgOptions): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OutputCacheState } from "./ssg/output_cache.js";
|
|
2
|
+
import type { GeneratedOutputAsset, SsgModule } from "./ssg/types.js";
|
|
3
|
+
export declare function isDirectory(path: string): Promise<boolean>;
|
|
4
|
+
export declare function findBuildOutputSiteCollisions(buildOutputPaths: Iterable<string>, siteOwnedOutputPaths: ReadonlySet<string>): readonly string[];
|
|
5
|
+
export declare function assertRequiredOutputsWereGenerated(comparison: {
|
|
6
|
+
readonly missingInDist: readonly string[];
|
|
7
|
+
}): void;
|
|
8
|
+
export declare function outputCacheEntryFor(previous: OutputCacheState | undefined, path: string, checksum: string): OutputCacheState["outputs"][string];
|
|
9
|
+
export declare function emitGeneratedOutputs(module: SsgModule, emit: (asset: GeneratedOutputAsset) => Promise<void>, affectedPaths?: ReadonlySet<string>, shadowedPaths?: ReadonlySet<string>, onShadowed?: (path: string) => void): Promise<number>;
|
|
10
|
+
export declare function removeVirtualEntryChunk(bundle: Record<string, {
|
|
11
|
+
type: string;
|
|
12
|
+
fileName: string;
|
|
13
|
+
moduleIds?: string[];
|
|
14
|
+
}>, virtualEntryId: string): void;
|
|
15
|
+
export declare function writePublicationMarker(input: {
|
|
16
|
+
readonly root: string;
|
|
17
|
+
readonly outputDirectory: string;
|
|
18
|
+
readonly publicationFingerprint?: string;
|
|
19
|
+
readonly artifactFingerprint?: string;
|
|
20
|
+
readonly warn: (message: string) => void;
|
|
21
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConfigEnv, ResolvedConfig } from "vite";
|
|
2
|
+
import type { SsgPluginLogger, SsgPluginState } from "./ssg_plugin_state.js";
|
|
3
|
+
export declare function createSsgConfigHook(state: SsgPluginState): (config: {
|
|
4
|
+
root?: string;
|
|
5
|
+
build?: {
|
|
6
|
+
outDir?: string;
|
|
7
|
+
};
|
|
8
|
+
}, env: ConfigEnv) => {
|
|
9
|
+
build: {
|
|
10
|
+
rollupOptions?: {
|
|
11
|
+
input: string[];
|
|
12
|
+
};
|
|
13
|
+
outDir: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function resolveSsgConfig(state: SsgPluginState, config: ResolvedConfig): Promise<void>;
|
|
17
|
+
export declare function startSsgBuild(state: SsgPluginState, plugin: SsgPluginLogger): Promise<void>;
|
|
18
|
+
export declare function resolveSsgId(state: SsgPluginState, id: string): string | undefined;
|
|
19
|
+
export declare function loadSsgEntry(state: SsgPluginState, id: string): string | undefined;
|
|
20
|
+
export declare function endSsgBuild(state: SsgPluginState, error: Error | undefined): Promise<void>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { toSSG } from "hono/ssg";
|
|
2
|
+
import type { ResolvedConfig } from "vite";
|
|
3
|
+
import type { BuildArtifactWriter } from "./ssg/artifact_writer.js";
|
|
4
|
+
import type { ClientBuildArtifacts } from "./ssg/build_output.js";
|
|
5
|
+
import type { OutputCacheState } from "./ssg/output_cache.js";
|
|
6
|
+
import type { SsgModule, SsgOutputChangeSet, SsgOutputMetrics } from "./ssg/types.js";
|
|
7
|
+
type ToSsgOptions = NonNullable<Parameters<typeof toSSG>[2]>;
|
|
8
|
+
export type RiebeckiteSsgOptions = {
|
|
9
|
+
entry?: string;
|
|
10
|
+
plugins?: ToSsgOptions["plugins"];
|
|
11
|
+
extensionMap?: Record<string, string>;
|
|
12
|
+
concurrency?: number;
|
|
13
|
+
};
|
|
14
|
+
export type PendingOutputCache = {
|
|
15
|
+
path: string;
|
|
16
|
+
state: OutputCacheState;
|
|
17
|
+
metrics: SsgOutputMetrics;
|
|
18
|
+
timingsMs: Record<string, number> | undefined;
|
|
19
|
+
outDir: string;
|
|
20
|
+
publicDir: string | false | undefined;
|
|
21
|
+
configFile: string | undefined;
|
|
22
|
+
publicationFingerprint?: string;
|
|
23
|
+
outputPlanInput: {
|
|
24
|
+
inventory: SsgOutputChangeSet["affected"];
|
|
25
|
+
affectedPaths: ReadonlySet<string>;
|
|
26
|
+
removed: SsgOutputChangeSet["removed"];
|
|
27
|
+
cacheAvailable: boolean;
|
|
28
|
+
honoStaticRoutePaths: ReadonlySet<string>;
|
|
29
|
+
viteClientAssetPaths: ReadonlySet<string>;
|
|
30
|
+
sitePublicAssetPaths: ReadonlySet<string>;
|
|
31
|
+
};
|
|
32
|
+
provenance: ReturnType<NonNullable<SsgModule["content"]>["getProvenance"]>;
|
|
33
|
+
content: NonNullable<SsgModule["content"]> | undefined;
|
|
34
|
+
reusablePaths: ReadonlySet<string>;
|
|
35
|
+
};
|
|
36
|
+
export type SsgPluginLogger = {
|
|
37
|
+
warn(message: string): void;
|
|
38
|
+
info(message: string): void;
|
|
39
|
+
};
|
|
40
|
+
export interface SsgPluginState {
|
|
41
|
+
virtualId: string;
|
|
42
|
+
resolvedVirtualId: string;
|
|
43
|
+
entry: string;
|
|
44
|
+
resolvedConfig: ResolvedConfig | undefined;
|
|
45
|
+
publicationOutputDirectory: string | undefined;
|
|
46
|
+
clientOutputDirectory: string | undefined;
|
|
47
|
+
artifactWriter: BuildArtifactWriter | undefined;
|
|
48
|
+
pendingOutputCache: PendingOutputCache | undefined;
|
|
49
|
+
clientBuildArtifacts: ClientBuildArtifacts | undefined;
|
|
50
|
+
outputChecksums: Map<string, string>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -1,126 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
};
|
|
8
|
-
type PrimitiveClassProps = {
|
|
9
|
-
class?: string;
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
type ArticleProps = PrimitiveProps & {
|
|
13
|
-
post?: PostContent;
|
|
14
|
-
entry?: PublicContentEntry;
|
|
15
|
-
};
|
|
16
|
-
type ArticleLayoutProps = PrimitiveProps;
|
|
17
|
-
type ArticleHeaderProps = (PrimitiveClassProps & {
|
|
18
|
-
dangerouslySetInnerHTML: {
|
|
19
|
-
__html: string;
|
|
20
|
-
};
|
|
21
|
-
children?: never;
|
|
22
|
-
}) | (PrimitiveClassProps & {
|
|
23
|
-
dangerouslySetInnerHTML?: never;
|
|
24
|
-
children?: PrimitiveChildren;
|
|
25
|
-
});
|
|
26
|
-
type ArticleContentProps = PrimitiveClassProps & {
|
|
27
|
-
children?: PrimitiveChildren;
|
|
28
|
-
};
|
|
29
|
-
type ArticleMetaProps = PrimitiveProps & {
|
|
30
|
-
label?: string;
|
|
31
|
-
};
|
|
32
|
-
type SidebarProps = PrimitiveProps & {
|
|
33
|
-
label?: string;
|
|
34
|
-
};
|
|
35
|
-
type ArticleFooterProps = PrimitiveProps;
|
|
36
|
-
export declare function Article(props: ArticleProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
37
|
-
export declare function ArticleLayout(props: ArticleLayoutProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
38
|
-
export declare function ArticleHeader(props: ArticleHeaderProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
39
|
-
export declare function ArticleMeta(props: ArticleMetaProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
40
|
-
export declare function ArticleContent(props: ArticleContentProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
41
|
-
type ArticleBodyProps = PrimitiveClassProps & {
|
|
42
|
-
html?: string;
|
|
43
|
-
};
|
|
44
|
-
type HtmlFragmentSource = "markdown" | "plugin-page";
|
|
45
|
-
type HtmlFragmentProps = {
|
|
46
|
-
html: string;
|
|
47
|
-
source: HtmlFragmentSource;
|
|
48
|
-
};
|
|
49
|
-
export declare function HtmlFragment(props: HtmlFragmentProps): import("hono/utils/html").HtmlEscapedString;
|
|
50
|
-
/**
|
|
51
|
-
* Renders Markdown-produced HTML as the canonical article body.
|
|
52
|
-
*
|
|
53
|
-
* Owns the `.rb-article-content` Stable Hook so Sites never hand-write it.
|
|
54
|
-
*/
|
|
55
|
-
export declare function ArticleBody(props: ArticleBodyProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
56
|
-
type PageBodyProps = PrimitiveClassProps & {
|
|
57
|
-
html: string;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Renders framework-resolved Plugin Page HTML.
|
|
61
|
-
*
|
|
62
|
-
* Owns the raw injection of a `PluginPageType` body so Sites never hand-write
|
|
63
|
-
* `dangerouslySetInnerHTML` for a resolved page.
|
|
64
|
-
*/
|
|
65
|
-
export declare function PageBody(props: PageBodyProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
66
|
-
export declare function ArticleFooter(props: ArticleFooterProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
67
|
-
export declare function Sidebar(props: SidebarProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
68
|
-
type ThemeRootProps = {
|
|
69
|
-
theme?: ResolvedRiebeckiteConfig["theme"];
|
|
70
|
-
lang?: string;
|
|
71
|
-
children?: PrimitiveChildren;
|
|
72
|
-
};
|
|
73
|
-
export declare function themeRootAttributes(theme: ResolvedRiebeckiteConfig["theme"]): Record<string, string | undefined>;
|
|
74
|
-
/**
|
|
75
|
-
* Root `<html>` element carrying the resolved theme's attributes.
|
|
76
|
-
*
|
|
77
|
-
* The Site keeps ownership of the document composition by rendering its own
|
|
78
|
-
* `<head>` and `<body>` as children.
|
|
79
|
-
*/
|
|
80
|
-
export declare function ThemeRoot(props: ThemeRootProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
81
|
-
type PluginHeadTagsProps = {
|
|
82
|
-
tags?: readonly PluginHeadTag[];
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Renders Plugin-provided head tags as `meta` / `link` / `script` elements.
|
|
86
|
-
*
|
|
87
|
-
* The Site owns placement; this primitive owns the conversion and ordering.
|
|
88
|
-
*/
|
|
89
|
-
export declare function PluginHeadTags(props: PluginHeadTagsProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
90
|
-
type RiebeckiteHeadProps = {
|
|
91
|
-
title?: string;
|
|
92
|
-
seo?: SeoMetadata;
|
|
93
|
-
headTags?: readonly PluginHeadTag[];
|
|
94
|
-
faviconHref?: string | null;
|
|
95
|
-
colorModeScript?: boolean;
|
|
96
|
-
stylesheets?: readonly string[];
|
|
97
|
-
themeStyle?: string;
|
|
98
|
-
themeStylesheets?: readonly string[];
|
|
99
|
-
clientSrc?: string | null;
|
|
100
|
-
prod?: boolean;
|
|
101
|
-
children?: PrimitiveChildren;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Renders the standard Riebeckite `<head>` contents.
|
|
105
|
-
*
|
|
106
|
-
* Owns the charset, viewport, default title, favicon, color-mode bootstrap,
|
|
107
|
-
* stylesheet and client entries, and Plugin head tags. The Site keeps the
|
|
108
|
-
* surrounding `<head>` so it can add its own elements next to this primitive.
|
|
109
|
-
*/
|
|
110
|
-
export declare function RiebeckiteHead(props: RiebeckiteHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
111
|
-
type SeoHeadProps = {
|
|
112
|
-
seo: SeoMetadata;
|
|
113
|
-
siteTitle: string;
|
|
114
|
-
author?: string;
|
|
115
|
-
ogLocale?: string;
|
|
116
|
-
ogAlternates?: readonly string[];
|
|
117
|
-
twitterSite?: string;
|
|
118
|
-
feedLinks?: readonly {
|
|
119
|
-
href: string;
|
|
120
|
-
type: string;
|
|
121
|
-
}[];
|
|
122
|
-
};
|
|
123
|
-
export declare function SeoHead(props: SeoHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
124
|
-
export declare function getThemeStyle(theme: ResolvedRiebeckiteConfig["theme"]): string;
|
|
125
|
-
export declare function getThemeStylesheets(stylesheets: readonly string[]): string[];
|
|
126
|
-
export {};
|
|
1
|
+
export { Article, ArticleBody, ArticleContent, ArticleFooter, ArticleHeader, ArticleLayout, ArticleMeta, Sidebar, } from "./primitives_article.js";
|
|
2
|
+
export { PluginHeadTags, RiebeckiteHead, SeoHead } from "./primitives_head.js";
|
|
3
|
+
export { HtmlFragment, PageBody } from "./primitives_page.js";
|
|
4
|
+
export { getThemeStyle, getThemeStylesheets, ThemeRoot, themeRootAttributes, } from "./primitives_theme.js";
|