@lukoweb/apitogo 0.1.6 → 0.1.8
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 +24 -16
- package/dist/declarations/config/config.d.ts +1 -1
- package/dist/declarations/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/config/config.ts +35 -35
- package/src/index.ts +1 -1
- package/src/lib/components/navigation/PoweredByZudoku.tsx +39 -35
- package/src/lib/plugins/markdown/MdxPage.tsx +1 -26
package/dist/cli/cli.js
CHANGED
|
@@ -3816,7 +3816,7 @@ import {
|
|
|
3816
3816
|
// package.json
|
|
3817
3817
|
var package_default = {
|
|
3818
3818
|
name: "@lukoweb/apitogo",
|
|
3819
|
-
version: "0.1.
|
|
3819
|
+
version: "0.1.7",
|
|
3820
3820
|
type: "module",
|
|
3821
3821
|
sideEffects: [
|
|
3822
3822
|
"**/*.css",
|
|
@@ -8274,7 +8274,7 @@ async function preview(argv) {
|
|
|
8274
8274
|
// src/cli/build/handler.ts
|
|
8275
8275
|
async function build(argv) {
|
|
8276
8276
|
const packageJson2 = getZudokuPackageJson();
|
|
8277
|
-
printDiagnosticsToConsole(`Starting
|
|
8277
|
+
printDiagnosticsToConsole(`Starting APIToGo build v${packageJson2.version}`);
|
|
8278
8278
|
printDiagnosticsToConsole("");
|
|
8279
8279
|
printDiagnosticsToConsole("");
|
|
8280
8280
|
const dir = path24.resolve(process.cwd(), argv.dir);
|
|
@@ -9003,17 +9003,19 @@ var buildTree = (routePaths) => {
|
|
|
9003
9003
|
};
|
|
9004
9004
|
var treeToNavigationItems = (node) => {
|
|
9005
9005
|
const docs = sortDocPaths(node.docs);
|
|
9006
|
-
const categories = sortDirectoryNames([...node.children.keys()]).map(
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9006
|
+
const categories = sortDirectoryNames([...node.children.keys()]).map(
|
|
9007
|
+
(directoryName) => {
|
|
9008
|
+
const childNode = node.children.get(directoryName);
|
|
9009
|
+
if (!childNode) {
|
|
9010
|
+
throw new Error(`Missing child node for directory '${directoryName}'.`);
|
|
9011
|
+
}
|
|
9012
|
+
return {
|
|
9013
|
+
type: "category",
|
|
9014
|
+
label: titleCase(directoryName),
|
|
9015
|
+
items: treeToNavigationItems(childNode)
|
|
9016
|
+
};
|
|
9017
|
+
}
|
|
9018
|
+
);
|
|
9017
9019
|
return [...docs, ...categories];
|
|
9018
9020
|
};
|
|
9019
9021
|
var formatNavigationItem = (item, indentLevel) => {
|
|
@@ -9021,7 +9023,9 @@ var formatNavigationItem = (item, indentLevel) => {
|
|
|
9021
9023
|
if (typeof item === "string") {
|
|
9022
9024
|
return `${indent}"${item}"`;
|
|
9023
9025
|
}
|
|
9024
|
-
const items = item.items.map(
|
|
9026
|
+
const items = item.items.map(
|
|
9027
|
+
(subItem) => formatNavigationItem(subItem, indentLevel + 2)
|
|
9028
|
+
);
|
|
9025
9029
|
return [
|
|
9026
9030
|
`${indent}{`,
|
|
9027
9031
|
`${indent} type: "category",`,
|
|
@@ -9146,7 +9150,9 @@ var findConfigPath = async (dir) => {
|
|
|
9146
9150
|
};
|
|
9147
9151
|
async function syncConfig(argv) {
|
|
9148
9152
|
const dir = path29.resolve(process.cwd(), argv.dir);
|
|
9149
|
-
const pagesDir = toPosixPath2(
|
|
9153
|
+
const pagesDir = toPosixPath2(
|
|
9154
|
+
argv.pagesDir.replace(/^[./]+/, "").replace(/\/+$/, "")
|
|
9155
|
+
);
|
|
9150
9156
|
try {
|
|
9151
9157
|
const configPath = await findConfigPath(dir);
|
|
9152
9158
|
const pageFiles = await glob4(`${pagesDir}/**/*.{md,mdx}`, {
|
|
@@ -9174,7 +9180,9 @@ async function syncConfig(argv) {
|
|
|
9174
9180
|
buildRedirectsCode(routePaths[0])
|
|
9175
9181
|
);
|
|
9176
9182
|
await writeFile6(configPath, withRedirects, "utf8");
|
|
9177
|
-
printResultToConsole(
|
|
9183
|
+
printResultToConsole(
|
|
9184
|
+
`Updated ${path29.basename(configPath)} from ${pagesDir}/`
|
|
9185
|
+
);
|
|
9178
9186
|
} catch (error) {
|
|
9179
9187
|
await printCriticalFailureToConsoleAndExit(
|
|
9180
9188
|
error instanceof Error ? error.message : String(error)
|
|
@@ -3,7 +3,7 @@ import type { BuildConfig } from "./validators/BuildSchema.js";
|
|
|
3
3
|
import type { AuthenticationConfig, ZudokuConfig } from "./validators/ZudokuConfig.js";
|
|
4
4
|
export type ZudokuBuildConfig = BuildConfig;
|
|
5
5
|
export type LoadedConfig = ConfigWithMeta;
|
|
6
|
-
export type { ZudokuConfig };
|
|
6
|
+
export type { ZudokuConfig as ApitogoConfig };
|
|
7
7
|
export type ClerkAuthenticationConfig = Extract<AuthenticationConfig, {
|
|
8
8
|
type: "clerk";
|
|
9
9
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { ApitogoConfig, ZudokuBuildConfig } from "./config/config.js";
|
|
2
2
|
export { createPlugin } from "./config/create-plugin.js";
|
|
3
3
|
export type { InputNavigation as Navigation } from "./config/validators/InputNavigationSchema.js";
|
|
4
4
|
export type { SlotType } from "./lib/components/context/SlotProvider.js";
|
package/package.json
CHANGED
package/src/config/config.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import type { ConfigWithMeta } from "./loader.js";
|
|
2
|
-
import type { BuildConfig } from "./validators/BuildSchema.js";
|
|
3
|
-
import type {
|
|
4
|
-
AuthenticationConfig,
|
|
5
|
-
ZudokuConfig,
|
|
6
|
-
} from "./validators/ZudokuConfig.js";
|
|
7
|
-
|
|
8
|
-
export type ZudokuBuildConfig = BuildConfig;
|
|
9
|
-
export type LoadedConfig = ConfigWithMeta;
|
|
10
|
-
export type { ZudokuConfig };
|
|
11
|
-
|
|
12
|
-
export type ClerkAuthenticationConfig = Extract<
|
|
13
|
-
AuthenticationConfig,
|
|
14
|
-
{ type: "clerk" }
|
|
15
|
-
>;
|
|
16
|
-
export type OpenIDAuthenticationConfig = Extract<
|
|
17
|
-
AuthenticationConfig,
|
|
18
|
-
{ type: "openid" }
|
|
19
|
-
>;
|
|
20
|
-
export type Auth0AuthenticationConfig = Extract<
|
|
21
|
-
AuthenticationConfig,
|
|
22
|
-
{ type: "auth0" }
|
|
23
|
-
>;
|
|
24
|
-
export type SupabaseAuthenticationConfig = Extract<
|
|
25
|
-
AuthenticationConfig,
|
|
26
|
-
{ type: "supabase" }
|
|
27
|
-
>;
|
|
28
|
-
export type FirebaseAuthenticationConfig = Extract<
|
|
29
|
-
AuthenticationConfig,
|
|
30
|
-
{ type: "firebase" }
|
|
31
|
-
>;
|
|
32
|
-
export type AzureB2CAuthenticationConfig = Extract<
|
|
33
|
-
AuthenticationConfig,
|
|
34
|
-
{ type: "azureb2c" }
|
|
35
|
-
>;
|
|
1
|
+
import type { ConfigWithMeta } from "./loader.js";
|
|
2
|
+
import type { BuildConfig } from "./validators/BuildSchema.js";
|
|
3
|
+
import type {
|
|
4
|
+
AuthenticationConfig,
|
|
5
|
+
ZudokuConfig,
|
|
6
|
+
} from "./validators/ZudokuConfig.js";
|
|
7
|
+
|
|
8
|
+
export type ZudokuBuildConfig = BuildConfig;
|
|
9
|
+
export type LoadedConfig = ConfigWithMeta;
|
|
10
|
+
export type { ZudokuConfig as ApitogoConfig };
|
|
11
|
+
|
|
12
|
+
export type ClerkAuthenticationConfig = Extract<
|
|
13
|
+
AuthenticationConfig,
|
|
14
|
+
{ type: "clerk" }
|
|
15
|
+
>;
|
|
16
|
+
export type OpenIDAuthenticationConfig = Extract<
|
|
17
|
+
AuthenticationConfig,
|
|
18
|
+
{ type: "openid" }
|
|
19
|
+
>;
|
|
20
|
+
export type Auth0AuthenticationConfig = Extract<
|
|
21
|
+
AuthenticationConfig,
|
|
22
|
+
{ type: "auth0" }
|
|
23
|
+
>;
|
|
24
|
+
export type SupabaseAuthenticationConfig = Extract<
|
|
25
|
+
AuthenticationConfig,
|
|
26
|
+
{ type: "supabase" }
|
|
27
|
+
>;
|
|
28
|
+
export type FirebaseAuthenticationConfig = Extract<
|
|
29
|
+
AuthenticationConfig,
|
|
30
|
+
{ type: "firebase" }
|
|
31
|
+
>;
|
|
32
|
+
export type AzureB2CAuthenticationConfig = Extract<
|
|
33
|
+
AuthenticationConfig,
|
|
34
|
+
{ type: "azureb2c" }
|
|
35
|
+
>;
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { ApitogoConfig, ZudokuBuildConfig } from "./config/config.js";
|
|
2
2
|
export { createPlugin } from "./config/create-plugin.js";
|
|
3
3
|
export type { InputNavigation as Navigation } from "./config/validators/InputNavigationSchema.js";
|
|
4
4
|
export type { SlotType } from "./lib/components/context/SlotProvider.js";
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import { ChevronRightIcon } from "lucide-react";
|
|
2
|
-
import { cn } from "../../util/cn.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import { ChevronRightIcon } from "lucide-react";
|
|
2
|
+
import { cn } from "../../util/cn.js";
|
|
3
|
+
import ZuploLogo from "./ZuploLogo.js";
|
|
4
|
+
|
|
5
|
+
export const PoweredByZudoku = ({ className }: { className?: string }) => (
|
|
6
|
+
<a
|
|
7
|
+
href={
|
|
8
|
+
import.meta.env.IS_ZUPLO ? "https://zuplo.com" : "https://apitogo.com"
|
|
9
|
+
}
|
|
10
|
+
target="_blank"
|
|
11
|
+
rel="noopener noreferrer"
|
|
12
|
+
className={cn(
|
|
13
|
+
"flex justify-between items-center w-full border border-transparent hover:border-border rounded-full hover:shadow-xs h-7 px-3 text-nowrap hover:bg-muted/80 transition-all",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
<div className="opacity-70 hover:opacity-100 transition-opacity gap-1.5 text-[11px] font-medium rounded-full h-7 flex items-center text-nowrap">
|
|
18
|
+
{import.meta.env.IS_ZUPLO ? (
|
|
19
|
+
<ZuploLogo className="w-3.5 h-3.5 dark:fill-white" />
|
|
20
|
+
) : (
|
|
21
|
+
<img
|
|
22
|
+
src="/Icon.png"
|
|
23
|
+
alt=""
|
|
24
|
+
aria-hidden="true"
|
|
25
|
+
className="w-3.5 h-3.5"
|
|
26
|
+
/>
|
|
27
|
+
)}
|
|
28
|
+
powered by {import.meta.env.IS_ZUPLO ? "Zuplo" : "apitogo"}
|
|
29
|
+
</div>
|
|
30
|
+
<div className="text-xs font-medium opacity-70 hover:text-foreground transition-colors cursor-pointer">
|
|
31
|
+
<ChevronRightIcon
|
|
32
|
+
size={12}
|
|
33
|
+
absoluteStrokeWidth
|
|
34
|
+
strokeWidth={1.5}
|
|
35
|
+
className="rtl:rotate-180"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</a>
|
|
39
|
+
);
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
CheckIcon,
|
|
13
13
|
ChevronDownIcon,
|
|
14
14
|
CopyIcon,
|
|
15
|
-
EditIcon,
|
|
16
15
|
ExternalLinkIcon,
|
|
17
16
|
Link2Icon,
|
|
18
17
|
} from "lucide-react";
|
|
@@ -95,15 +94,6 @@ export const MdxPage = ({
|
|
|
95
94
|
? new Date(frontmatter.lastModifiedTime)
|
|
96
95
|
: null;
|
|
97
96
|
|
|
98
|
-
const editConfig =
|
|
99
|
-
frontmatter.suggestEdit !== false &&
|
|
100
|
-
(frontmatter.suggestEdit ?? defaultOptions?.suggestEdit);
|
|
101
|
-
|
|
102
|
-
const editUrl = editConfig
|
|
103
|
-
? editConfig.url.replaceAll("{filePath}", __filepath)
|
|
104
|
-
: null;
|
|
105
|
-
const editText = editConfig ? editConfig.text || "Edit this page" : null;
|
|
106
|
-
|
|
107
97
|
const copyMarkdownConfig =
|
|
108
98
|
frontmatter.copyPage !== false && defaultOptions?.copyPage !== false;
|
|
109
99
|
|
|
@@ -227,25 +217,10 @@ export const MdxPage = ({
|
|
|
227
217
|
components={{ ...useMDXComponents(), ...MarkdownHeadings }}
|
|
228
218
|
/>
|
|
229
219
|
<div className="h-16" />
|
|
230
|
-
{
|
|
220
|
+
{showLastModified && lastModifiedDate ? (
|
|
231
221
|
<div className="flex justify-between text-xs text-muted-foreground ">
|
|
232
222
|
<div />
|
|
233
223
|
<div className="flex items-center gap-2">
|
|
234
|
-
<div>
|
|
235
|
-
{editUrl && (
|
|
236
|
-
<Button asChild variant="ghost" size="sm">
|
|
237
|
-
<a
|
|
238
|
-
href={editUrl}
|
|
239
|
-
target="_blank"
|
|
240
|
-
rel="noopener noreferrer"
|
|
241
|
-
className="flex items-center gap-1"
|
|
242
|
-
>
|
|
243
|
-
<EditIcon size={12} />
|
|
244
|
-
{editText}
|
|
245
|
-
</a>
|
|
246
|
-
</Button>
|
|
247
|
-
)}
|
|
248
|
-
</div>
|
|
249
224
|
<div>
|
|
250
225
|
{showLastModified && lastModifiedDate && (
|
|
251
226
|
<div
|