@guren/server 2.19.0 → 2.21.0

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.
@@ -25,10 +25,49 @@ export interface GurenVitePluginOptions {
25
25
  chunkFileNames?: string;
26
26
  /** Rollup naming pattern for extracted assets (defaults to `[name]-[hash][extname]`). */
27
27
  assetFileNames?: string;
28
+ /** Prototype mode (`vite --mode prototype`, RFC 0021): the static, server-less build. */
29
+ prototype?: GurenPrototypeOptions;
28
30
  }
31
+ export interface GurenPrototypeOptions {
32
+ /** Vite `base` for a build hosted under a subpath (a GitHub project page, a preview URL). Defaults to `/`. */
33
+ base?: string;
34
+ /** Output directory (defaults to `dist/prototype`). */
35
+ outDir?: string;
36
+ /**
37
+ * The HTML shell, relative to the project root. Defaults to
38
+ * `resources/js/prototype/index.html` when that file exists, else a
39
+ * generated shell under `.guren/prototype/`.
40
+ */
41
+ shell?: string;
42
+ }
43
+ /** Where the generated shell goes; `.guren/` is already gitignored and codegen-owned. */
44
+ export declare const PROTOTYPE_SHELL_FILE = ".guren/prototype/index.html";
45
+ /** The override a project may ship instead of the generated shell. */
46
+ export declare const PROTOTYPE_SHELL_OVERRIDE = "resources/js/prototype/index.html";
47
+ export declare const PROTOTYPE_MODE = "prototype";
29
48
  export declare function gurenVitePlugin(options?: GurenVitePluginOptions): {
30
49
  name: string;
31
50
  enforce: 'pre';
32
51
  config(config: Record<string, any>, env: Record<string, any>): void;
52
+ configResolved(config: Record<string, any>): void;
53
+ configureServer(server: ViteDevServerLike): (() => void) | undefined;
54
+ writeBundle(): void;
33
55
  };
56
+ interface ViteDevServerLike {
57
+ middlewares: {
58
+ use(handler: (req: IncomingLike, res: ResponseLike, next: (error?: unknown) => void) => void): void;
59
+ };
60
+ transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
61
+ }
62
+ interface IncomingLike {
63
+ method?: string;
64
+ url?: string;
65
+ originalUrl?: string;
66
+ headers: Record<string, string | string[] | undefined>;
67
+ }
68
+ interface ResponseLike {
69
+ setHeader(name: string, value: string): void;
70
+ end(body: string): void;
71
+ }
72
+ export declare function renderPrototypeShell(entry: string): string;
34
73
  export default gurenVitePlugin;
@@ -34,7 +34,7 @@ function parseImportMap(value, options = {}) {
34
34
  const DEFAULT_DEV_STYLES_ENTRY = "/resources/css/app.css";
35
35
  //#endregion
36
36
  //#region package.json
37
- var version = "2.19.0";
37
+ var version = "2.21.0";
38
38
  //#endregion
39
39
  //#region src/http/dev-banner.ts
40
40
  figlet.parseFont("Standard", standard);
@@ -138,7 +138,7 @@ const DEFAULT_DEV_SERVER_URL = "http://localhost:5173";
138
138
  * `NODE_ENV` is `production` (E2E runs do exactly this).
139
139
  */
140
140
  function isViteProduction(devServerUrl = process.env.VITE_DEV_SERVER_URL) {
141
- return (process.env.NODE_ENV ?? "development") === "production" && typeof devServerUrl !== "string";
141
+ return process.env.NODE_ENV === "production" && typeof devServerUrl !== "string";
142
142
  }
143
143
  function normalizeDevServerUrl(value) {
144
144
  if (!value) return value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guren/server",
3
- "version": "2.19.0",
3
+ "version": "2.21.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -142,14 +142,14 @@
142
142
  "test": "bun test"
143
143
  },
144
144
  "dependencies": {
145
- "@guren/orm": "^2.6.3",
145
+ "@guren/orm": "^2.7.1",
146
146
  "@modelcontextprotocol/sdk": "^1.30.0",
147
147
  "chalk": "^5.3.0",
148
148
  "consola": "^3.4.2",
149
149
  "figlet": "^1.7.0",
150
- "hono": "^4.13.0",
150
+ "hono": "^4.13.7",
151
151
  "ioredis": "^5.11.1",
152
- "nodemailer": "^9.0.1"
152
+ "nodemailer": "^9.1.1"
153
153
  },
154
154
  "peerDependencies": {
155
155
  "@aws-sdk/client-s3": "^3.0.0",
@@ -2,8 +2,8 @@ import { r as ServiceProvider } from "./loopback-guard-DT9gHF0F.js";
2
2
  import { n as createDocsViewerAccessGuard, r as isDocsViewerEnabled, t as DOCS_VIEWER_PATH } from "./endpoint-BXipU2Jj.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { createHash } from "node:crypto";
5
- import { readFile } from "node:fs/promises";
6
5
  import { join } from "node:path";
6
+ import { readFile } from "node:fs/promises";
7
7
  //#region src/docs-viewer/DocsViewerServiceProvider.ts
8
8
  /**
9
9
  * How long a built `data.json` payload answers requests. Longer than the UI's
@@ -1,5 +1,5 @@
1
- import { readFile, readdir } from "node:fs/promises";
2
1
  import { basename, extname, join } from "node:path";
2
+ import { readFile, readdir } from "node:fs/promises";
3
3
  //#region src/i18n/pluralization.ts
4
4
  /**
5
5
  * Default pluralization rules per language, each returning the index of the
@@ -1,6 +1,6 @@
1
1
  import { t as trimSlashes } from "./trim-slashes-BLY9hKAa.js";
2
- import { copyFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
3
2
  import { dirname, join, resolve, sep } from "node:path";
3
+ import { copyFile, mkdir, open, readFile, readdir, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
4
4
  import { existsSync } from "node:fs";
5
5
  import { Readable } from "node:stream";
6
6
  //#region src/support/warn-once.ts