@lukoweb/apitogo 0.1.7 → 0.1.9

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 CHANGED
@@ -3816,7 +3816,7 @@ import {
3816
3816
  // package.json
3817
3817
  var package_default = {
3818
3818
  name: "@lukoweb/apitogo",
3819
- version: "0.1.7",
3819
+ version: "0.1.8",
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 Zudoku build v${packageJson2.version}`);
8277
+ printDiagnosticsToConsole(`Starting APIToGo build v${packageJson2.version}`);
8278
8278
  printDiagnosticsToConsole("");
8279
8279
  printDiagnosticsToConsole("");
8280
8280
  const dir = path24.resolve(process.cwd(), argv.dir);
@@ -8433,7 +8433,8 @@ var build_default = {
8433
8433
  import { access, readFile as readFile4 } from "node:fs/promises";
8434
8434
  import path25 from "node:path";
8435
8435
  import { create as createTar } from "tar";
8436
- var DEPLOY_ENDPOINT = "http://localhost:3000/deploy";
8436
+ var DEPLOY_ENDPOINT = "https://deployserver.apitogo.com/deploy";
8437
+ var DEPLOY_API_KEY = "qRVLTP22TFStdN6";
8437
8438
  var ARCHIVE_NAME = "dist.tgz";
8438
8439
  var createDeploymentArchive = async (dir) => {
8439
8440
  const distDir = path25.join(dir, "dist");
@@ -8453,14 +8454,17 @@ var createDeploymentArchive = async (dir) => {
8453
8454
  async function deploy(argv) {
8454
8455
  await build({ ...argv, preview: void 0 });
8455
8456
  const dir = path25.resolve(process.cwd(), argv.dir);
8456
- const deploymentToken = argv.deploymentToken?.trim();
8457
+ const deploymentToken = argv.deploymentToken?.trim() || process.env.npm_config_deployment_token?.trim();
8458
+ const env = argv.env?.trim() || process.env.npm_config_env?.trim() || "production";
8457
8459
  try {
8458
8460
  if (!deploymentToken) {
8459
8461
  throw new Error("A deployment token is required.");
8460
8462
  }
8461
8463
  printDiagnosticsToConsole("Creating deployment archive...");
8462
8464
  const archivePath = await createDeploymentArchive(dir);
8463
- printDiagnosticsToConsole(`Uploading ${path25.basename(archivePath)}...`);
8465
+ printDiagnosticsToConsole(
8466
+ `Uploading ${path25.basename(archivePath)} to ${env}...`
8467
+ );
8464
8468
  const archiveBuffer = await readFile4(archivePath);
8465
8469
  const formData = new FormData();
8466
8470
  formData.append(
@@ -8469,8 +8473,12 @@ async function deploy(argv) {
8469
8473
  path25.basename(archivePath)
8470
8474
  );
8471
8475
  formData.append("deploymentToken", deploymentToken);
8476
+ formData.append("env", env);
8472
8477
  const response = await fetch(DEPLOY_ENDPOINT, {
8473
8478
  method: "POST",
8479
+ headers: {
8480
+ "x-api-key": DEPLOY_API_KEY
8481
+ },
8474
8482
  body: formData
8475
8483
  });
8476
8484
  const responseText = await response.text();
@@ -8495,10 +8503,14 @@ async function deploy(argv) {
8495
8503
  // src/cli/cmds/deploy.ts
8496
8504
  var deploy_default = {
8497
8505
  desc: "Build, archive, and deploy",
8498
- command: "deploy [deploymentToken]",
8499
- builder: (yargs2) => yargs2.positional("deploymentToken", {
8506
+ command: "deploy",
8507
+ builder: (yargs2) => yargs2.option("deployment-token", {
8500
8508
  type: "string",
8501
8509
  describe: "Deployment token sent to the deploy endpoint"
8510
+ }).option("env", {
8511
+ type: "string",
8512
+ describe: "Deployment environment name",
8513
+ default: "production"
8502
8514
  }).option("dir", {
8503
8515
  type: "string",
8504
8516
  describe: "The directory containing your project",
@@ -9003,17 +9015,19 @@ var buildTree = (routePaths) => {
9003
9015
  };
9004
9016
  var treeToNavigationItems = (node) => {
9005
9017
  const docs = sortDocPaths(node.docs);
9006
- const categories = sortDirectoryNames([...node.children.keys()]).map((directoryName) => {
9007
- const childNode = node.children.get(directoryName);
9008
- if (!childNode) {
9009
- throw new Error(`Missing child node for directory '${directoryName}'.`);
9010
- }
9011
- return {
9012
- type: "category",
9013
- label: titleCase(directoryName),
9014
- items: treeToNavigationItems(childNode)
9015
- };
9016
- });
9018
+ const categories = sortDirectoryNames([...node.children.keys()]).map(
9019
+ (directoryName) => {
9020
+ const childNode = node.children.get(directoryName);
9021
+ if (!childNode) {
9022
+ throw new Error(`Missing child node for directory '${directoryName}'.`);
9023
+ }
9024
+ return {
9025
+ type: "category",
9026
+ label: titleCase(directoryName),
9027
+ items: treeToNavigationItems(childNode)
9028
+ };
9029
+ }
9030
+ );
9017
9031
  return [...docs, ...categories];
9018
9032
  };
9019
9033
  var formatNavigationItem = (item, indentLevel) => {
@@ -9021,7 +9035,9 @@ var formatNavigationItem = (item, indentLevel) => {
9021
9035
  if (typeof item === "string") {
9022
9036
  return `${indent}"${item}"`;
9023
9037
  }
9024
- const items = item.items.map((subItem) => formatNavigationItem(subItem, indentLevel + 2));
9038
+ const items = item.items.map(
9039
+ (subItem) => formatNavigationItem(subItem, indentLevel + 2)
9040
+ );
9025
9041
  return [
9026
9042
  `${indent}{`,
9027
9043
  `${indent} type: "category",`,
@@ -9146,7 +9162,9 @@ var findConfigPath = async (dir) => {
9146
9162
  };
9147
9163
  async function syncConfig(argv) {
9148
9164
  const dir = path29.resolve(process.cwd(), argv.dir);
9149
- const pagesDir = toPosixPath2(argv.pagesDir.replace(/^[./]+/, "").replace(/\/+$/, ""));
9165
+ const pagesDir = toPosixPath2(
9166
+ argv.pagesDir.replace(/^[./]+/, "").replace(/\/+$/, "")
9167
+ );
9150
9168
  try {
9151
9169
  const configPath = await findConfigPath(dir);
9152
9170
  const pageFiles = await glob4(`${pagesDir}/**/*.{md,mdx}`, {
@@ -9174,7 +9192,9 @@ async function syncConfig(argv) {
9174
9192
  buildRedirectsCode(routePaths[0])
9175
9193
  );
9176
9194
  await writeFile6(configPath, withRedirects, "utf8");
9177
- printResultToConsole(`Updated ${path29.basename(configPath)} from ${pagesDir}/`);
9195
+ printResultToConsole(
9196
+ `Updated ${path29.basename(configPath)} from ${pagesDir}/`
9197
+ );
9178
9198
  } catch (error) {
9179
9199
  await printCriticalFailureToConsoleAndExit(
9180
9200
  error instanceof Error ? error.message : String(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -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 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
- >;
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
+ >;
@@ -1,35 +1,39 @@
1
- import { ChevronRightIcon } from "lucide-react";
2
- import { cn } from "../../util/cn.js";
3
- import ZudokuLogo from "./ZudokuLogo.js";
4
- import ZuploLogo from "./ZuploLogo.js";
5
-
6
- export const PoweredByZudoku = ({ className }: { className?: string }) => (
7
- <a
8
- href={
9
- import.meta.env.IS_ZUPLO ? "https://zuplo.com" : "https://apitogo.com"
10
- }
11
- target="_blank"
12
- rel="noopener noreferrer"
13
- className={cn(
14
- "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",
15
- className,
16
- )}
17
- >
18
- <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">
19
- {import.meta.env.IS_ZUPLO ? (
20
- <ZuploLogo className="w-3.5 h-3.5 dark:fill-white" />
21
- ) : (
22
- <ZudokuLogo className="w-3.5 h-3.5 dark:fill-white" />
23
- )}
24
- powered by {import.meta.env.IS_ZUPLO ? "Zuplo" : "apitogo"}
25
- </div>
26
- <div className="text-xs font-medium opacity-70 hover:text-foreground transition-colors cursor-pointer">
27
- <ChevronRightIcon
28
- size={12}
29
- absoluteStrokeWidth
30
- strokeWidth={1.5}
31
- className="rtl:rotate-180"
32
- />
33
- </div>
34
- </a>
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
- {(showLastModified && lastModifiedDate) || editUrl ? (
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