@lukoweb/apitogo 0.1.9 → 0.1.11

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.8",
3819
+ version: "0.1.9",
3820
3820
  type: "module",
3821
3821
  sideEffects: [
3822
3822
  "**/*.css",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -212,10 +212,13 @@ export async function loadZudokuConfig(
212
212
  const loadedConfig = await loadZudokuConfigWithMeta(rootDir);
213
213
  config = await runPluginTransformConfig(loadedConfig);
214
214
 
215
- logger.info(
216
- colors.cyan(`loaded config file `) + colors.dim(config.__meta.configPath),
217
- { timestamp: true },
218
- );
215
+ if (!process.env.APITOGO_JSON_ONLY) {
216
+ logger.info(
217
+ colors.cyan(`loaded config file `) +
218
+ colors.dim(config.__meta.configPath),
219
+ { timestamp: true },
220
+ );
221
+ }
219
222
 
220
223
  return { config, envPrefix, publicEnv };
221
224
  } catch (error) {
package/src/vite/build.ts CHANGED
@@ -2,7 +2,7 @@ import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { build as esbuild } from "esbuild";
4
4
  import type { Rollup } from "vite";
5
- import { build as viteBuild } from "vite";
5
+ import { build as viteBuild, mergeConfig } from "vite";
6
6
  import { ZuploEnv } from "../app/env.js";
7
7
  import { getZudokuRootDir } from "../cli/common/package-json.js";
8
8
  import {
@@ -38,10 +38,12 @@ export type BuildOptions = {
38
38
  dir: string;
39
39
  ssr?: boolean;
40
40
  adapter?: "node" | "cloudflare" | "vercel";
41
+ /** Suppress Vite build table and most build logs (used with `apitogo deploy --json-only`). */
42
+ jsonOnly?: boolean;
41
43
  };
42
44
 
43
45
  export async function runBuild(options: BuildOptions) {
44
- const { dir, ssr, adapter = "node" } = options;
46
+ const { dir, ssr, adapter = "node", jsonOnly = false } = options;
45
47
 
46
48
  // Build client and server bundles
47
49
  const viteClientConfig = await getViteConfig(dir, {
@@ -54,7 +56,11 @@ export async function runBuild(options: BuildOptions) {
54
56
  isSsrBuild: true,
55
57
  });
56
58
 
57
- const clientResult = await viteBuild(viteClientConfig);
59
+ const clientResult = await viteBuild(
60
+ jsonOnly
61
+ ? mergeConfig(viteClientConfig, { logLevel: "silent" as const })
62
+ : viteClientConfig,
63
+ );
58
64
  const serverResult = await viteBuild({
59
65
  ...viteServerConfig,
60
66
  logLevel: "silent",
package/src/vite/llms.ts CHANGED
@@ -60,8 +60,10 @@ export async function generateLlmsTxtFiles({
60
60
  const llmsTxt = llmsTxtParts.join("\n");
61
61
  await writeFile(path.join(baseOutputDir, "llms.txt"), llmsTxt, "utf-8");
62
62
 
63
- // biome-ignore lint/suspicious/noConsole: Logging allowed here
64
- console.log(colors.blue("✓ generated llms.txt"));
63
+ if (process.env.APITOGO_JSON_ONLY !== "1") {
64
+ // biome-ignore lint/suspicious/noConsole: Logging allowed here
65
+ console.log(colors.blue("✓ generated llms.txt"));
66
+ }
65
67
  }
66
68
 
67
69
  // Generate llms-full.txt (full content of all markdown documents)
@@ -89,7 +91,9 @@ export async function generateLlmsTxtFiles({
89
91
  "utf-8",
90
92
  );
91
93
 
92
- // biome-ignore lint/suspicious/noConsole: Allowed here
93
- console.log(colors.blue("✓ generated llms-full.txt"));
94
+ if (process.env.APITOGO_JSON_ONLY !== "1") {
95
+ // biome-ignore lint/suspicious/noConsole: Allowed here
96
+ console.log(colors.blue("✓ generated llms-full.txt"));
97
+ }
94
98
  }
95
99
  }
@@ -91,13 +91,16 @@ export const prerender = async ({
91
91
  const LOG_INTERVAL_MS = 30_000; // Log every 30 seconds
92
92
  let lastLogTime = start;
93
93
 
94
+ const quietDeployJson = process.env.APITOGO_JSON_ONLY === "1";
95
+
94
96
  const writeProgress = throttle(
95
97
  (count: number, total: number, urlPath: string) => {
98
+ if (quietDeployJson) return;
96
99
  writeLine(`prerendering (${count}/${total}) ${colors.dim(urlPath)}`);
97
100
  },
98
101
  );
99
102
 
100
- if (!isTTY()) {
103
+ if (!isTTY() && !quietDeployJson) {
101
104
  logger.info(
102
105
  colors.dim(
103
106
  `prerendering ${paths.length} routes using ${maxThreads} workers...`,
@@ -143,7 +146,9 @@ export const prerender = async ({
143
146
 
144
147
  completedCount++;
145
148
 
146
- if (isTTY()) {
149
+ if (quietDeployJson) {
150
+ // no progress output
151
+ } else if (isTTY()) {
147
152
  writeProgress(completedCount, paths.length, urlPath);
148
153
  } else {
149
154
  const now = performance.now();
@@ -168,15 +173,17 @@ export const prerender = async ({
168
173
 
169
174
  const message = `✓ finished prerendering ${paths.length} routes in ${seconds} seconds using ${maxThreads} workers`;
170
175
 
171
- if (isTTY()) {
172
- writeLine(colors.blue(`${message}\n`));
173
- } else {
174
- logger.info(colors.blue(message));
175
- }
176
- if (pagefindWriteResult?.outputPath) {
177
- logger.info(
178
- colors.blue(`✓ pagefind index built: ${pagefindWriteResult.outputPath}`),
179
- );
176
+ if (!quietDeployJson) {
177
+ if (isTTY()) {
178
+ writeLine(colors.blue(`${message}\n`));
179
+ } else {
180
+ logger.info(colors.blue(message));
181
+ }
182
+ if (pagefindWriteResult?.outputPath) {
183
+ logger.info(
184
+ colors.blue(`✓ pagefind index built: ${pagefindWriteResult.outputPath}`),
185
+ );
186
+ }
180
187
  }
181
188
 
182
189
  const redirectUrls = getRedirectUrls(workerResults, config.basePath);