@shevky/core 0.0.1 → 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/engines/menuEngine.js +117 -0
- package/engines/metaEngine.js +786 -0
- package/engines/pluginEngine.js +102 -0
- package/engines/renderEngine.js +823 -0
- package/lib/contentBody.js +12 -0
- package/lib/contentFile.js +170 -0
- package/lib/contentHeader.js +295 -0
- package/lib/contentSummary.js +85 -0
- package/lib/menuItem.js +51 -0
- package/lib/page.js +103 -0
- package/lib/project.js +82 -0
- package/lib/template.js +50 -0
- package/package.json +6 -2
- package/registries/contentRegistry.js +286 -0
- package/registries/pageRegistry.js +29 -0
- package/registries/pluginRegistry.js +94 -0
- package/registries/templateRegistry.js +152 -0
- package/types/command-line-args.d.ts +20 -0
- package/types/command-line-usage.d.ts +12 -0
- package/types/degit.d.ts +15 -0
- package/types/index.d.ts +79 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare module "command-line-args" {
|
|
2
|
+
export type OptionDefinition = {
|
|
3
|
+
name: string;
|
|
4
|
+
alias?: string;
|
|
5
|
+
type?: unknown;
|
|
6
|
+
description?: string;
|
|
7
|
+
defaultValue?: unknown;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
defaultOption?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type CommandLineOptions = Record<string, unknown>;
|
|
13
|
+
|
|
14
|
+
function commandLineArgs(
|
|
15
|
+
options?: readonly OptionDefinition[],
|
|
16
|
+
argv?: readonly string[],
|
|
17
|
+
): CommandLineOptions;
|
|
18
|
+
|
|
19
|
+
export default commandLineArgs;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module "command-line-usage" {
|
|
2
|
+
export type Section = {
|
|
3
|
+
header?: string;
|
|
4
|
+
content?: string | string[];
|
|
5
|
+
optionList?: unknown[];
|
|
6
|
+
group?: string | string[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function commandLineUsage(sections: readonly Section[] | Section): string;
|
|
10
|
+
|
|
11
|
+
export default commandLineUsage;
|
|
12
|
+
}
|
package/types/degit.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare module "degit" {
|
|
2
|
+
type DegitOptions = {
|
|
3
|
+
cache?: boolean;
|
|
4
|
+
force?: boolean;
|
|
5
|
+
verbose?: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type DegitEmitter = {
|
|
9
|
+
clone: (dest: string) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function degit(repo: string, options?: DegitOptions): DegitEmitter;
|
|
13
|
+
|
|
14
|
+
export default degit;
|
|
15
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BasePluginContext,
|
|
3
|
+
PluginHooks,
|
|
4
|
+
PluginLoadContext as BasePluginLoadContext,
|
|
5
|
+
} from "@shevky/base";
|
|
6
|
+
|
|
7
|
+
export type ProjectPaths = {
|
|
8
|
+
root: string;
|
|
9
|
+
src: string;
|
|
10
|
+
dist: string;
|
|
11
|
+
tmp: string;
|
|
12
|
+
content: string;
|
|
13
|
+
layouts: string;
|
|
14
|
+
components: string;
|
|
15
|
+
templates: string;
|
|
16
|
+
assets: string;
|
|
17
|
+
siteConfig: string;
|
|
18
|
+
i18nConfig: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type PluginInstance = {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
hooks: PluginHooks;
|
|
25
|
+
load: (ctx: PluginLoadContext) => void;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type PluginLoadContext = BasePluginLoadContext;
|
|
29
|
+
|
|
30
|
+
export interface PluginExecutionContext extends BasePluginContext {
|
|
31
|
+
paths: ProjectPaths;
|
|
32
|
+
contentFiles?: import("@shevky/base").ContentFileLike[];
|
|
33
|
+
pages?: CollectionsByLang;
|
|
34
|
+
contentIndex?: Record<
|
|
35
|
+
string,
|
|
36
|
+
Record<string, { id: string; lang: string; title: string; canonical: string }>
|
|
37
|
+
>;
|
|
38
|
+
footerPolicies?: Record<string, FooterPolicy[]>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type Placeholder = {
|
|
42
|
+
token: string;
|
|
43
|
+
marker: string;
|
|
44
|
+
html: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type FooterPolicy = {
|
|
48
|
+
key: string;
|
|
49
|
+
label: string;
|
|
50
|
+
url: string;
|
|
51
|
+
lang: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type ContentSummaryLike = {
|
|
55
|
+
id: string;
|
|
56
|
+
title: string;
|
|
57
|
+
slug: string;
|
|
58
|
+
lang: string;
|
|
59
|
+
canonical: string;
|
|
60
|
+
date: string | number | Date;
|
|
61
|
+
updated: string | number | Date;
|
|
62
|
+
description: string;
|
|
63
|
+
cover: string;
|
|
64
|
+
coverAlt: string;
|
|
65
|
+
coverCaption: string;
|
|
66
|
+
readingTime: number;
|
|
67
|
+
dateDisplay: string | null;
|
|
68
|
+
seriesTitle: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type CollectionEntry = ContentSummaryLike & {
|
|
72
|
+
type?: string;
|
|
73
|
+
seriesTitle?: string;
|
|
74
|
+
canonical?: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type CollectionsByLang = Record<string, Record<string, CollectionEntry[]>>;
|
|
78
|
+
|
|
79
|
+
export type FrontMatter = Record<string, any>;
|