@lukoweb/apitogo 0.1.56 → 0.1.58
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/cli/cli.js +45 -31
- package/dist/declarations/config/landing-manifest.d.ts +1 -9
- package/dist/declarations/config/local-manifest.d.ts +0 -8
- package/dist/declarations/config/resolve-modules.d.ts +1 -1
- package/dist/declarations/config/validators/ModulesSchema.d.ts +0 -40
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +0 -8
- package/dist/flat-config.d.ts +0 -8
- package/package.json +1 -1
- package/src/config/default-landing-content.ts +8 -13
- package/src/config/landing-manifest.ts +1 -1
- package/src/config/landing-openapi-showcase.ts +10 -1
- package/src/config/local-manifest.ts +4 -8
- package/src/config/resolve-modules.ts +3 -9
- package/src/config/validators/ModulesSchema.ts +3 -18
- package/src/vite/plugin-theme.ts +41 -0
package/dist/cli/cli.js
CHANGED
|
@@ -667,7 +667,7 @@ var init_file_exists = __esm({
|
|
|
667
667
|
|
|
668
668
|
// src/config/validators/ModulesSchema.ts
|
|
669
669
|
import { z as z3 } from "zod";
|
|
670
|
-
var ModuleToggleSchema, DocsModuleSchema, LandingLinkSchema, LandingFeatureSchema, LandingCodeExampleSchema, LandingHeroSchema, LandingFeaturesSectionSchema,
|
|
670
|
+
var ModuleToggleSchema, DocsModuleSchema, LandingLinkSchema, LandingFeatureSchema, LandingCodeExampleSchema, LandingHeroSchema, LandingFeaturesSectionSchema, LandingTrustSchema, LandingApiShowcaseItemSchema, LandingApiShowcaseSchema, LandingPricingCtaSchema, LandingContentSchema, DashboardContentSchema, ProfileContentSchema, PlanTierSchema, PlansContentSchema, SubmodulePageFields, LandingModuleSchema, UserManagementModuleSchema, ApiKeysModuleSchema, PlanCatalogItemSchema, PlansModuleSchema, DashboardModuleSchema, UserPanelModuleSchema, ModulesSchema;
|
|
671
671
|
var init_ModulesSchema = __esm({
|
|
672
672
|
"src/config/validators/ModulesSchema.ts"() {
|
|
673
673
|
ModuleToggleSchema = z3.object({
|
|
@@ -708,7 +708,9 @@ var init_ModulesSchema = __esm({
|
|
|
708
708
|
}).optional();
|
|
709
709
|
LandingHeroSchema = z3.object({
|
|
710
710
|
title: z3.string().optional(),
|
|
711
|
-
titleAccent: z3.string().optional().describe(
|
|
711
|
+
titleAccent: z3.string().optional().describe(
|
|
712
|
+
"Accent-colored word or phrase shown on a new line after the title."
|
|
713
|
+
),
|
|
712
714
|
subtitle: z3.string().optional(),
|
|
713
715
|
description: z3.string().optional(),
|
|
714
716
|
badge: z3.string().optional(),
|
|
@@ -720,15 +722,6 @@ var init_ModulesSchema = __esm({
|
|
|
720
722
|
title: z3.string().optional(),
|
|
721
723
|
description: z3.string().optional()
|
|
722
724
|
}).optional();
|
|
723
|
-
LandingTickerItemSchema = z3.object({
|
|
724
|
-
label: z3.string(),
|
|
725
|
-
value: z3.string(),
|
|
726
|
-
change: z3.string().optional()
|
|
727
|
-
});
|
|
728
|
-
LandingTickerSchema = z3.object({
|
|
729
|
-
enabled: z3.boolean().optional(),
|
|
730
|
-
items: z3.array(LandingTickerItemSchema).optional()
|
|
731
|
-
}).optional();
|
|
732
725
|
LandingTrustSchema = z3.object({
|
|
733
726
|
enabled: z3.boolean().optional(),
|
|
734
727
|
title: z3.string().optional(),
|
|
@@ -763,7 +756,6 @@ var init_ModulesSchema = __esm({
|
|
|
763
756
|
features: z3.array(LandingFeatureSchema).optional(),
|
|
764
757
|
primaryAction: LandingLinkSchema.optional(),
|
|
765
758
|
secondaryAction: LandingLinkSchema.optional(),
|
|
766
|
-
ticker: LandingTickerSchema,
|
|
767
759
|
trust: LandingTrustSchema,
|
|
768
760
|
apiShowcase: LandingApiShowcaseSchema,
|
|
769
761
|
pricingCta: LandingPricingCtaSchema,
|
|
@@ -1071,21 +1063,16 @@ var init_default_landing_content = __esm({
|
|
|
1071
1063
|
},
|
|
1072
1064
|
primaryAction: { label: "Get your API key", href: "/register" },
|
|
1073
1065
|
secondaryAction: { label: "Read the docs", href: "/introduction" },
|
|
1074
|
-
ticker: {
|
|
1075
|
-
items: [
|
|
1076
|
-
{ label: "GET", value: "/v1/items", change: "28ms" },
|
|
1077
|
-
{ label: "POST", value: "/v1/items", change: "34ms" },
|
|
1078
|
-
{ label: "GET", value: "/v1/users", change: "19ms" },
|
|
1079
|
-
{ label: "PATCH", value: "/v1/users/{id}", change: "41ms" },
|
|
1080
|
-
{ label: "GET", value: "/v1/health", change: "16ms" },
|
|
1081
|
-
{ label: "DELETE", value: "/v1/items/{id}", change: "22ms" },
|
|
1082
|
-
{ label: "GET", value: "/v1/search", change: "47ms" },
|
|
1083
|
-
{ label: "POST", value: "/v1/auth/token", change: "52ms" }
|
|
1084
|
-
]
|
|
1085
|
-
},
|
|
1086
1066
|
trust: {
|
|
1087
1067
|
title: "Trusted by teams shipping production APIs",
|
|
1088
|
-
logos: [
|
|
1068
|
+
logos: [
|
|
1069
|
+
"Acme Corp",
|
|
1070
|
+
"BuildFast",
|
|
1071
|
+
"DataFlow",
|
|
1072
|
+
"ShipKit",
|
|
1073
|
+
"DevStack",
|
|
1074
|
+
"LaunchPad"
|
|
1075
|
+
]
|
|
1089
1076
|
},
|
|
1090
1077
|
featuresSection: {
|
|
1091
1078
|
label: "// why us",
|
|
@@ -1270,7 +1257,6 @@ var init_resolve_modules = __esm({
|
|
|
1270
1257
|
primaryAction: content?.primaryAction ?? defaults.primaryAction,
|
|
1271
1258
|
secondaryAction: content?.secondaryAction ?? defaults.secondaryAction,
|
|
1272
1259
|
showPoweredBy: content?.showPoweredBy ?? defaults.showPoweredBy,
|
|
1273
|
-
ticker: mergeLandingSection(defaults.ticker, content?.ticker),
|
|
1274
1260
|
trust: mergeLandingSection(defaults.trust, content?.trust),
|
|
1275
1261
|
apiShowcase: mergeLandingSection(
|
|
1276
1262
|
defaults.apiShowcase,
|
|
@@ -1296,7 +1282,6 @@ var init_resolve_modules = __esm({
|
|
|
1296
1282
|
primaryAction: content.primaryAction,
|
|
1297
1283
|
secondaryAction: content.secondaryAction,
|
|
1298
1284
|
showPoweredBy: content.showPoweredBy ?? true,
|
|
1299
|
-
ticker: content.ticker ? mergeLandingSection(void 0, content.ticker) : void 0,
|
|
1300
1285
|
trust: content.trust ? mergeLandingSection(void 0, content.trust) : void 0,
|
|
1301
1286
|
apiShowcase: content.apiShowcase ? mergeLandingSection(void 0, content.apiShowcase) : void 0,
|
|
1302
1287
|
pricingCta: content.pricingCta ? mergeLandingSection(void 0, content.pricingCta) : void 0
|
|
@@ -1334,7 +1319,7 @@ var init_resolve_modules = __esm({
|
|
|
1334
1319
|
const userManagementConfig = userPanelModule?.userManagement;
|
|
1335
1320
|
const apiKeysModuleConfig = userPanelModule?.apiKeys;
|
|
1336
1321
|
const plansConfig = userPanelModule?.plans;
|
|
1337
|
-
const dashboardEnabled = dashboardConfig?.enabled ??
|
|
1322
|
+
const dashboardEnabled = dashboardConfig?.enabled ?? false;
|
|
1338
1323
|
const userManagementEnabled = explicit ? userManagementConfig?.enabled ?? !!config2.authentication : !!config2.authentication;
|
|
1339
1324
|
const apiKeysEnabled = explicit ? apiKeysModuleConfig?.enabled ?? false : false;
|
|
1340
1325
|
const billingEnabled = config2.__meta?.pricingEnabled === true || plansConfig?.enabled === true;
|
|
@@ -1584,9 +1569,10 @@ var init_shadcn_registry = __esm({
|
|
|
1584
1569
|
});
|
|
1585
1570
|
|
|
1586
1571
|
// src/vite/plugin-theme.ts
|
|
1572
|
+
import { createRequire } from "node:module";
|
|
1587
1573
|
import path4 from "node:path";
|
|
1588
1574
|
import { normalizeTheme } from "shiki";
|
|
1589
|
-
var THEME_VARIABLES, uncamelize, processColorValue, generateCss, generateRegistryCss, processCustomCss, MAIN_REPLACE, DEFAULT_THEME_REPLACE, GOOGLE_FONTS, getGoogleFontUrl, processFont, processFontConfig, processFonts, virtualModuleId, resolvedVirtualModuleId, viteThemePlugin;
|
|
1575
|
+
var THEME_VARIABLES, uncamelize, processColorValue, generateCss, generateRegistryCss, processCustomCss, MAIN_REPLACE, DEFAULT_THEME_REPLACE, GOOGLE_FONTS, getGoogleFontUrl, processFont, processFontConfig, processFonts, MODULE_SOURCE_PACKAGES, resolveModuleSourceDirs, virtualModuleId, resolvedVirtualModuleId, viteThemePlugin;
|
|
1590
1576
|
var init_plugin_theme = __esm({
|
|
1591
1577
|
"src/vite/plugin-theme.ts"() {
|
|
1592
1578
|
init_loader();
|
|
@@ -1754,6 +1740,33 @@ var init_plugin_theme = __esm({
|
|
|
1754
1740
|
}
|
|
1755
1741
|
return { imports, families };
|
|
1756
1742
|
};
|
|
1743
|
+
MODULE_SOURCE_PACKAGES = [
|
|
1744
|
+
"@lukoweb/apitogo-module-landing",
|
|
1745
|
+
"@lukoweb/apitogo-module-user-panel"
|
|
1746
|
+
];
|
|
1747
|
+
resolveModuleSourceDirs = (config2) => {
|
|
1748
|
+
if (config2.__meta.mode === "internal") {
|
|
1749
|
+
return MODULE_SOURCE_PACKAGES.map(
|
|
1750
|
+
(pkg) => path4.join(
|
|
1751
|
+
config2.__meta.moduleDir,
|
|
1752
|
+
"..",
|
|
1753
|
+
pkg.replace("@lukoweb/apitogo-", ""),
|
|
1754
|
+
"src"
|
|
1755
|
+
)
|
|
1756
|
+
);
|
|
1757
|
+
}
|
|
1758
|
+
const require2 = createRequire(
|
|
1759
|
+
path4.join(config2.__meta.rootDir, "package.json")
|
|
1760
|
+
);
|
|
1761
|
+
const dirs = [];
|
|
1762
|
+
for (const pkg of MODULE_SOURCE_PACKAGES) {
|
|
1763
|
+
try {
|
|
1764
|
+
dirs.push(path4.dirname(require2.resolve(pkg)));
|
|
1765
|
+
} catch {
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
return dirs;
|
|
1769
|
+
};
|
|
1757
1770
|
virtualModuleId = "virtual:zudoku-theme.css";
|
|
1758
1771
|
resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
1759
1772
|
viteThemePlugin = () => {
|
|
@@ -1871,7 +1884,8 @@ ${rootVars.join("\n")}
|
|
|
1871
1884
|
[
|
|
1872
1885
|
config2.__meta.rootDir,
|
|
1873
1886
|
...config2.__meta.dependencies,
|
|
1874
|
-
...config2.__pluginDirs ?? []
|
|
1887
|
+
...config2.__pluginDirs ?? [],
|
|
1888
|
+
...resolveModuleSourceDirs(config2)
|
|
1875
1889
|
].map((file) => path4.relative(path4.dirname(id), file))
|
|
1876
1890
|
);
|
|
1877
1891
|
const code = [...files].map((file) => `@source "${file}";`);
|
|
@@ -5185,7 +5199,7 @@ import {
|
|
|
5185
5199
|
// package.json
|
|
5186
5200
|
var package_default = {
|
|
5187
5201
|
name: "@lukoweb/apitogo",
|
|
5188
|
-
version: "0.1.
|
|
5202
|
+
version: "0.1.58",
|
|
5189
5203
|
type: "module",
|
|
5190
5204
|
sideEffects: [
|
|
5191
5205
|
"**/*.css",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import type { z } from "zod";
|
|
2
2
|
import { LandingContentSchema } from "./validators/ModulesSchema.js";
|
|
3
3
|
export declare const LandingManifestContentSchema: z.ZodOptional<z.ZodObject<{
|
|
4
4
|
hero: z.ZodOptional<z.ZodObject<{
|
|
@@ -32,14 +32,6 @@ export declare const LandingManifestContentSchema: z.ZodOptional<z.ZodObject<{
|
|
|
32
32
|
label: z.ZodString;
|
|
33
33
|
href: z.ZodString;
|
|
34
34
|
}, z.core.$strip>>;
|
|
35
|
-
ticker: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
-
label: z.ZodString;
|
|
39
|
-
value: z.ZodString;
|
|
40
|
-
change: z.ZodOptional<z.ZodString>;
|
|
41
|
-
}, z.core.$strip>>>;
|
|
42
|
-
}, z.core.$strip>>;
|
|
43
35
|
trust: z.ZodOptional<z.ZodObject<{
|
|
44
36
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
45
37
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -120,14 +120,6 @@ export declare const DevPortalLocalManifestSchema: z.ZodObject<{
|
|
|
120
120
|
label: z.ZodString;
|
|
121
121
|
href: z.ZodString;
|
|
122
122
|
}, z.core.$strip>>;
|
|
123
|
-
ticker: z.ZodOptional<z.ZodObject<{
|
|
124
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
126
|
-
label: z.ZodString;
|
|
127
|
-
value: z.ZodString;
|
|
128
|
-
change: z.ZodOptional<z.ZodString>;
|
|
129
|
-
}, z.core.$strip>>>;
|
|
130
|
-
}, z.core.$strip>>;
|
|
131
123
|
trust: z.ZodOptional<z.ZodObject<{
|
|
132
124
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
133
125
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -12,7 +12,7 @@ export declare const getEffectiveRedirects: (config: ZudokuConfig, resolved: Res
|
|
|
12
12
|
from: string;
|
|
13
13
|
to: string;
|
|
14
14
|
}[];
|
|
15
|
-
export declare const getEffectiveDocsConfig: (
|
|
15
|
+
export declare const getEffectiveDocsConfig: (_config: ZudokuConfig, resolved: ResolvedModulesConfig) => {
|
|
16
16
|
files: string | string[];
|
|
17
17
|
publishMarkdown: boolean;
|
|
18
18
|
defaultOptions: {
|
|
@@ -52,19 +52,6 @@ export declare const LandingFeaturesSectionSchema: z.ZodOptional<z.ZodObject<{
|
|
|
52
52
|
title: z.ZodOptional<z.ZodString>;
|
|
53
53
|
description: z.ZodOptional<z.ZodString>;
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
|
-
export declare const LandingTickerItemSchema: z.ZodObject<{
|
|
56
|
-
label: z.ZodString;
|
|
57
|
-
value: z.ZodString;
|
|
58
|
-
change: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
export declare const LandingTickerSchema: z.ZodOptional<z.ZodObject<{
|
|
61
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
63
|
-
label: z.ZodString;
|
|
64
|
-
value: z.ZodString;
|
|
65
|
-
change: z.ZodOptional<z.ZodString>;
|
|
66
|
-
}, z.core.$strip>>>;
|
|
67
|
-
}, z.core.$strip>>;
|
|
68
55
|
export declare const LandingTrustSchema: z.ZodOptional<z.ZodObject<{
|
|
69
56
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
70
57
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -137,14 +124,6 @@ export declare const LandingContentSchema: z.ZodOptional<z.ZodObject<{
|
|
|
137
124
|
label: z.ZodString;
|
|
138
125
|
href: z.ZodString;
|
|
139
126
|
}, z.core.$strip>>;
|
|
140
|
-
ticker: z.ZodOptional<z.ZodObject<{
|
|
141
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
143
|
-
label: z.ZodString;
|
|
144
|
-
value: z.ZodString;
|
|
145
|
-
change: z.ZodOptional<z.ZodString>;
|
|
146
|
-
}, z.core.$strip>>>;
|
|
147
|
-
}, z.core.$strip>>;
|
|
148
127
|
trust: z.ZodOptional<z.ZodObject<{
|
|
149
128
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
150
129
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -253,14 +232,6 @@ export declare const LandingModuleSchema: z.ZodObject<{
|
|
|
253
232
|
label: z.ZodString;
|
|
254
233
|
href: z.ZodString;
|
|
255
234
|
}, z.core.$strip>>;
|
|
256
|
-
ticker: z.ZodOptional<z.ZodObject<{
|
|
257
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
259
|
-
label: z.ZodString;
|
|
260
|
-
value: z.ZodString;
|
|
261
|
-
change: z.ZodOptional<z.ZodString>;
|
|
262
|
-
}, z.core.$strip>>>;
|
|
263
|
-
}, z.core.$strip>>;
|
|
264
235
|
trust: z.ZodOptional<z.ZodObject<{
|
|
265
236
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
266
237
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -490,14 +461,6 @@ export declare const ModulesSchema: z.ZodOptional<z.ZodObject<{
|
|
|
490
461
|
label: z.ZodString;
|
|
491
462
|
href: z.ZodString;
|
|
492
463
|
}, z.core.$strip>>;
|
|
493
|
-
ticker: z.ZodOptional<z.ZodObject<{
|
|
494
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
495
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
496
|
-
label: z.ZodString;
|
|
497
|
-
value: z.ZodString;
|
|
498
|
-
change: z.ZodOptional<z.ZodString>;
|
|
499
|
-
}, z.core.$strip>>>;
|
|
500
|
-
}, z.core.$strip>>;
|
|
501
464
|
trust: z.ZodOptional<z.ZodObject<{
|
|
502
465
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
503
466
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -621,8 +584,6 @@ export type ProfileContentConfig = z.infer<typeof ProfileContentSchema>;
|
|
|
621
584
|
export type PlansContentConfig = z.infer<typeof PlansContentSchema>;
|
|
622
585
|
export type PlanTierConfig = z.infer<typeof PlanTierSchema>;
|
|
623
586
|
export type LandingCodeExampleConfig = z.infer<typeof LandingCodeExampleSchema>;
|
|
624
|
-
export type LandingTickerItemConfig = z.infer<typeof LandingTickerItemSchema>;
|
|
625
|
-
export type LandingTickerConfig = z.infer<typeof LandingTickerSchema>;
|
|
626
587
|
export type LandingTrustConfig = z.infer<typeof LandingTrustSchema>;
|
|
627
588
|
export type LandingApiShowcaseItemConfig = z.infer<typeof LandingApiShowcaseItemSchema>;
|
|
628
589
|
export type LandingApiShowcaseConfig = z.infer<typeof LandingApiShowcaseSchema>;
|
|
@@ -645,7 +606,6 @@ export type ResolvedLandingContent = {
|
|
|
645
606
|
features?: LandingFeatureConfig[];
|
|
646
607
|
primaryAction?: LandingLinkConfig;
|
|
647
608
|
secondaryAction?: LandingLinkConfig;
|
|
648
|
-
ticker?: LandingTickerConfig;
|
|
649
609
|
trust?: LandingTrustConfig;
|
|
650
610
|
apiShowcase?: LandingApiShowcaseConfig;
|
|
651
611
|
pricingCta?: LandingPricingCtaConfig;
|
|
@@ -6919,14 +6919,6 @@ export declare const ZudokuConfig: z.ZodObject<{
|
|
|
6919
6919
|
label: z.ZodString;
|
|
6920
6920
|
href: z.ZodString;
|
|
6921
6921
|
}, z.core.$strip>>;
|
|
6922
|
-
ticker: z.ZodOptional<z.ZodObject<{
|
|
6923
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
6924
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6925
|
-
label: z.ZodString;
|
|
6926
|
-
value: z.ZodString;
|
|
6927
|
-
change: z.ZodOptional<z.ZodString>;
|
|
6928
|
-
}, z.core.$strip>>>;
|
|
6929
|
-
}, z.core.$strip>>;
|
|
6930
6922
|
trust: z.ZodOptional<z.ZodObject<{
|
|
6931
6923
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
6932
6924
|
title: z.ZodOptional<z.ZodString>;
|
package/dist/flat-config.d.ts
CHANGED
|
@@ -562,14 +562,6 @@ export interface _Schema21 {
|
|
|
562
562
|
}[]
|
|
563
563
|
primaryAction?: _Schema23
|
|
564
564
|
secondaryAction?: _Schema23
|
|
565
|
-
ticker?: {
|
|
566
|
-
enabled?: boolean
|
|
567
|
-
items?: {
|
|
568
|
-
label: string
|
|
569
|
-
value: string
|
|
570
|
-
change?: string
|
|
571
|
-
}[]
|
|
572
|
-
}
|
|
573
565
|
trust?: {
|
|
574
566
|
enabled?: boolean
|
|
575
567
|
title?: string
|
package/package.json
CHANGED
|
@@ -27,21 +27,16 @@ export const DEFAULT_LANDING_CONTENT: ResolvedLandingContent = {
|
|
|
27
27
|
},
|
|
28
28
|
primaryAction: { label: "Get your API key", href: "/register" },
|
|
29
29
|
secondaryAction: { label: "Read the docs", href: "/introduction" },
|
|
30
|
-
ticker: {
|
|
31
|
-
items: [
|
|
32
|
-
{ label: "GET", value: "/v1/items", change: "28ms" },
|
|
33
|
-
{ label: "POST", value: "/v1/items", change: "34ms" },
|
|
34
|
-
{ label: "GET", value: "/v1/users", change: "19ms" },
|
|
35
|
-
{ label: "PATCH", value: "/v1/users/{id}", change: "41ms" },
|
|
36
|
-
{ label: "GET", value: "/v1/health", change: "16ms" },
|
|
37
|
-
{ label: "DELETE", value: "/v1/items/{id}", change: "22ms" },
|
|
38
|
-
{ label: "GET", value: "/v1/search", change: "47ms" },
|
|
39
|
-
{ label: "POST", value: "/v1/auth/token", change: "52ms" },
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
30
|
trust: {
|
|
43
31
|
title: "Trusted by teams shipping production APIs",
|
|
44
|
-
logos: [
|
|
32
|
+
logos: [
|
|
33
|
+
"Acme Corp",
|
|
34
|
+
"BuildFast",
|
|
35
|
+
"DataFlow",
|
|
36
|
+
"ShipKit",
|
|
37
|
+
"DevStack",
|
|
38
|
+
"LaunchPad",
|
|
39
|
+
],
|
|
45
40
|
},
|
|
46
41
|
featuresSection: {
|
|
47
42
|
label: "// why us",
|
|
@@ -100,7 +100,16 @@ export function extractApiShowcaseItemsFromOpenApi(
|
|
|
100
100
|
|
|
101
101
|
export function enrichResolvedLandingApiShowcase(
|
|
102
102
|
config: ZudokuConfig,
|
|
103
|
-
resolved: {
|
|
103
|
+
resolved: {
|
|
104
|
+
landing: {
|
|
105
|
+
content: {
|
|
106
|
+
apiShowcase?: {
|
|
107
|
+
autoFromOpenApi?: boolean;
|
|
108
|
+
items?: LandingApiShowcaseItemConfig[];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
},
|
|
104
113
|
rootDir: string,
|
|
105
114
|
): void {
|
|
106
115
|
const showcase = resolved.landing.content.apiShowcase;
|
|
@@ -261,13 +261,6 @@ export function mergeLandingContent(
|
|
|
261
261
|
merged.features = Array.from(byTitle.values());
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
if (patch.ticker) {
|
|
265
|
-
merged.ticker = { ...existing.ticker, ...patch.ticker };
|
|
266
|
-
if (patch.ticker.items) {
|
|
267
|
-
merged.ticker.items = patch.ticker.items;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
264
|
if (patch.trust) {
|
|
272
265
|
merged.trust = { ...existing.trust, ...patch.trust };
|
|
273
266
|
if (patch.trust.logos) {
|
|
@@ -294,7 +287,10 @@ export function mergeLandingContent(
|
|
|
294
287
|
}
|
|
295
288
|
|
|
296
289
|
if (patch.primaryAction) {
|
|
297
|
-
merged.primaryAction = {
|
|
290
|
+
merged.primaryAction = {
|
|
291
|
+
...existing.primaryAction,
|
|
292
|
+
...patch.primaryAction,
|
|
293
|
+
};
|
|
298
294
|
}
|
|
299
295
|
if (patch.secondaryAction) {
|
|
300
296
|
merged.secondaryAction = {
|
|
@@ -119,7 +119,6 @@ export const resolveLandingContent = (
|
|
|
119
119
|
primaryAction: content?.primaryAction ?? defaults.primaryAction,
|
|
120
120
|
secondaryAction: content?.secondaryAction ?? defaults.secondaryAction,
|
|
121
121
|
showPoweredBy: content?.showPoweredBy ?? defaults.showPoweredBy,
|
|
122
|
-
ticker: mergeLandingSection(defaults.ticker, content?.ticker),
|
|
123
122
|
trust: mergeLandingSection(defaults.trust, content?.trust),
|
|
124
123
|
apiShowcase: mergeLandingSection(
|
|
125
124
|
defaults.apiShowcase,
|
|
@@ -129,8 +128,7 @@ export const resolveLandingContent = (
|
|
|
129
128
|
};
|
|
130
129
|
}
|
|
131
130
|
|
|
132
|
-
const hasContent =
|
|
133
|
-
content !== undefined && Object.keys(content).length > 0;
|
|
131
|
+
const hasContent = content !== undefined && Object.keys(content).length > 0;
|
|
134
132
|
|
|
135
133
|
if (!hasContent) {
|
|
136
134
|
return {
|
|
@@ -151,9 +149,6 @@ export const resolveLandingContent = (
|
|
|
151
149
|
primaryAction: content.primaryAction,
|
|
152
150
|
secondaryAction: content.secondaryAction,
|
|
153
151
|
showPoweredBy: content.showPoweredBy ?? true,
|
|
154
|
-
ticker: content.ticker
|
|
155
|
-
? mergeLandingSection(undefined, content.ticker)
|
|
156
|
-
: undefined,
|
|
157
152
|
trust: content.trust
|
|
158
153
|
? mergeLandingSection(undefined, content.trust)
|
|
159
154
|
: undefined,
|
|
@@ -220,8 +215,7 @@ export const resolveModulesConfig = (
|
|
|
220
215
|
const apiKeysModuleConfig = userPanelModule?.apiKeys;
|
|
221
216
|
const plansConfig = userPanelModule?.plans;
|
|
222
217
|
|
|
223
|
-
const dashboardEnabled =
|
|
224
|
-
dashboardConfig?.enabled ?? (explicit ? false : false);
|
|
218
|
+
const dashboardEnabled = dashboardConfig?.enabled ?? false;
|
|
225
219
|
|
|
226
220
|
const userManagementEnabled = explicit
|
|
227
221
|
? (userManagementConfig?.enabled ?? !!config.authentication)
|
|
@@ -327,7 +321,7 @@ const normalizePath = (path: string) => {
|
|
|
327
321
|
};
|
|
328
322
|
|
|
329
323
|
export const getEffectiveDocsConfig = (
|
|
330
|
-
|
|
324
|
+
_config: ZudokuConfig,
|
|
331
325
|
resolved: ResolvedModulesConfig,
|
|
332
326
|
) => {
|
|
333
327
|
if (!resolved.docs.enabled) {
|
|
@@ -61,7 +61,9 @@ export const LandingHeroSchema = z
|
|
|
61
61
|
titleAccent: z
|
|
62
62
|
.string()
|
|
63
63
|
.optional()
|
|
64
|
-
.describe(
|
|
64
|
+
.describe(
|
|
65
|
+
"Accent-colored word or phrase shown on a new line after the title.",
|
|
66
|
+
),
|
|
65
67
|
subtitle: z.string().optional(),
|
|
66
68
|
description: z.string().optional(),
|
|
67
69
|
badge: z.string().optional(),
|
|
@@ -78,19 +80,6 @@ export const LandingFeaturesSectionSchema = z
|
|
|
78
80
|
})
|
|
79
81
|
.optional();
|
|
80
82
|
|
|
81
|
-
export const LandingTickerItemSchema = z.object({
|
|
82
|
-
label: z.string(),
|
|
83
|
-
value: z.string(),
|
|
84
|
-
change: z.string().optional(),
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
export const LandingTickerSchema = z
|
|
88
|
-
.object({
|
|
89
|
-
enabled: z.boolean().optional(),
|
|
90
|
-
items: z.array(LandingTickerItemSchema).optional(),
|
|
91
|
-
})
|
|
92
|
-
.optional();
|
|
93
|
-
|
|
94
83
|
export const LandingTrustSchema = z
|
|
95
84
|
.object({
|
|
96
85
|
enabled: z.boolean().optional(),
|
|
@@ -136,7 +125,6 @@ export const LandingContentSchema = z
|
|
|
136
125
|
features: z.array(LandingFeatureSchema).optional(),
|
|
137
126
|
primaryAction: LandingLinkSchema.optional(),
|
|
138
127
|
secondaryAction: LandingLinkSchema.optional(),
|
|
139
|
-
ticker: LandingTickerSchema,
|
|
140
128
|
trust: LandingTrustSchema,
|
|
141
129
|
apiShowcase: LandingApiShowcaseSchema,
|
|
142
130
|
pricingCta: LandingPricingCtaSchema,
|
|
@@ -333,8 +321,6 @@ export type PlansContentConfig = z.infer<typeof PlansContentSchema>;
|
|
|
333
321
|
export type PlanTierConfig = z.infer<typeof PlanTierSchema>;
|
|
334
322
|
|
|
335
323
|
export type LandingCodeExampleConfig = z.infer<typeof LandingCodeExampleSchema>;
|
|
336
|
-
export type LandingTickerItemConfig = z.infer<typeof LandingTickerItemSchema>;
|
|
337
|
-
export type LandingTickerConfig = z.infer<typeof LandingTickerSchema>;
|
|
338
324
|
export type LandingTrustConfig = z.infer<typeof LandingTrustSchema>;
|
|
339
325
|
export type LandingApiShowcaseItemConfig = z.infer<
|
|
340
326
|
typeof LandingApiShowcaseItemSchema
|
|
@@ -360,7 +346,6 @@ export type ResolvedLandingContent = {
|
|
|
360
346
|
features?: LandingFeatureConfig[];
|
|
361
347
|
primaryAction?: LandingLinkConfig;
|
|
362
348
|
secondaryAction?: LandingLinkConfig;
|
|
363
|
-
ticker?: LandingTickerConfig;
|
|
364
349
|
trust?: LandingTrustConfig;
|
|
365
350
|
apiShowcase?: LandingApiShowcaseConfig;
|
|
366
351
|
pricingCta?: LandingPricingCtaConfig;
|
package/src/vite/plugin-theme.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { normalizeTheme, type ThemeRegistration } from "shiki";
|
|
3
4
|
import type { Plugin } from "vite";
|
|
5
|
+
import type { ConfigWithMeta } from "../config/loader.js";
|
|
4
6
|
import { getCurrentConfig } from "../config/loader.js";
|
|
5
7
|
import type {
|
|
6
8
|
FontConfig,
|
|
@@ -200,6 +202,44 @@ const processFonts = async (themeConfig: ZudokuConfig["theme"]) => {
|
|
|
200
202
|
return { imports, families };
|
|
201
203
|
};
|
|
202
204
|
|
|
205
|
+
const MODULE_SOURCE_PACKAGES = [
|
|
206
|
+
"@lukoweb/apitogo-module-landing",
|
|
207
|
+
"@lukoweb/apitogo-module-user-panel",
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Directories of module packages (landing, user panel) that use Tailwind
|
|
212
|
+
* utility classes. They live outside the Tailwind `source("..")` root set in
|
|
213
|
+
* main.css, so they must be added as explicit `@source` scan paths — otherwise
|
|
214
|
+
* their arbitrary-value utilities (e.g. the landing hero grid template and
|
|
215
|
+
* terminal card colors) are missing from the generated CSS.
|
|
216
|
+
*/
|
|
217
|
+
const resolveModuleSourceDirs = (config: ConfigWithMeta): string[] => {
|
|
218
|
+
if (config.__meta.mode === "internal") {
|
|
219
|
+
return MODULE_SOURCE_PACKAGES.map((pkg) =>
|
|
220
|
+
path.join(
|
|
221
|
+
config.__meta.moduleDir,
|
|
222
|
+
"..",
|
|
223
|
+
pkg.replace("@lukoweb/apitogo-", ""),
|
|
224
|
+
"src",
|
|
225
|
+
),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const require = createRequire(
|
|
230
|
+
path.join(config.__meta.rootDir, "package.json"),
|
|
231
|
+
);
|
|
232
|
+
const dirs: string[] = [];
|
|
233
|
+
for (const pkg of MODULE_SOURCE_PACKAGES) {
|
|
234
|
+
try {
|
|
235
|
+
dirs.push(path.dirname(require.resolve(pkg)));
|
|
236
|
+
} catch {
|
|
237
|
+
// Module package not installed — nothing to scan.
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return dirs;
|
|
241
|
+
};
|
|
242
|
+
|
|
203
243
|
export const virtualModuleId = "virtual:zudoku-theme.css";
|
|
204
244
|
export const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
205
245
|
|
|
@@ -348,6 +388,7 @@ export const viteThemePlugin = (): Plugin => {
|
|
|
348
388
|
config.__meta.rootDir,
|
|
349
389
|
...config.__meta.dependencies,
|
|
350
390
|
...(config.__pluginDirs ?? []),
|
|
391
|
+
...resolveModuleSourceDirs(config),
|
|
351
392
|
].map((file) => path.relative(path.dirname(id), file)),
|
|
352
393
|
);
|
|
353
394
|
|