@vistagenic/vista 0.3.2 → 0.3.3
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/bin/vista.js +79 -109
- package/dist/ai/embeddings.d.ts +11 -11
- package/dist/ai/embeddings.js +71 -71
- package/dist/ai/index.d.ts +10 -10
- package/dist/ai/index.js +26 -26
- package/dist/ai/providers/base.js +85 -85
- package/dist/ai/react/react-server.d.ts +1 -1
- package/dist/ai/react/react-server.js +17 -17
- package/dist/ai/react/use-agent.js +138 -138
- package/dist/auth/core.d.ts +140 -140
- package/dist/auth/core.js +165 -165
- package/dist/auth/index.d.ts +20 -20
- package/dist/auth/index.js +369 -369
- package/dist/auth/react-server.d.ts +1 -1
- package/dist/auth/react-server.js +10 -10
- package/dist/auth/react.d.ts +18 -18
- package/dist/auth/react.js +71 -71
- package/dist/bin/build-rsc-flashpack.js +6 -0
- package/dist/bin/build-rsc.js +537 -492
- package/dist/bin/build.js +355 -353
- package/dist/bin/generate.js +513 -510
- package/dist/bin/webpack.config.js +4 -3
- package/dist/build/manifest.d.ts +169 -169
- package/dist/build/manifest.js +423 -423
- package/dist/build/rsc/client-manifest.d.ts +62 -62
- package/dist/build/rsc/client-manifest.js +295 -295
- package/dist/build/rsc/compiler.js +5 -4
- package/dist/build/rsc/native-scanner.d.ts +135 -135
- package/dist/build/rsc/native-scanner.js +203 -203
- package/dist/build/rsc/react-client-reference-manifest.d.ts +28 -28
- package/dist/build/rsc/react-client-reference-manifest.js +240 -240
- package/dist/build/standalone.js +260 -254
- package/dist/client/dynamic.react-server.d.ts +2 -2
- package/dist/client/dynamic.react-server.js +23 -23
- package/dist/client/link.react-server.d.ts +2 -2
- package/dist/client/link.react-server.js +11 -11
- package/dist/client/navigation.react-server.d.ts +1 -1
- package/dist/client/navigation.react-server.js +17 -17
- package/dist/client/router.react-server.d.ts +1 -1
- package/dist/client/router.react-server.js +17 -17
- package/dist/client/rsc-router.react-server.d.ts +1 -1
- package/dist/client/rsc-router.react-server.js +17 -17
- package/dist/client/script.react-server.d.ts +2 -2
- package/dist/client/script.react-server.js +23 -23
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -7
- package/dist/deploy/adapters/cloudflare.js +43 -19
- package/dist/deploy/adapters/docker.d.ts +1 -0
- package/dist/deploy/adapters/docker.js +5 -4
- package/dist/deploy/adapters/netlify.js +62 -17
- package/dist/deploy/adapters/vercel.js +80 -50
- package/dist/deploy/preflight.js +4 -3
- package/dist/deploy/runtime-pack.d.ts +11 -0
- package/dist/deploy/runtime-pack.js +300 -0
- package/dist/deploy/utils.d.ts +1 -1
- package/dist/deploy/utils.js +31 -2
- package/dist/flashpack/command.js +1 -0
- package/dist/flashpack/runtime.js +2 -1
- package/dist/index.d.ts +23 -23
- package/dist/index.js +61 -61
- package/dist/server/app-dir.d.ts +22 -0
- package/dist/server/app-dir.js +77 -0
- package/dist/server/cookie-parse.d.ts +4 -4
- package/dist/server/cookie-parse.js +14 -14
- package/dist/server/engine.js +5 -5
- package/dist/server/image-optimizer.js +2 -1
- package/dist/server/index.d.ts +109 -109
- package/dist/server/index.js +315 -315
- package/dist/server/middleware-runner.d.ts +125 -125
- package/dist/server/middleware-runner.js +607 -615
- package/dist/server/middleware-security.d.ts +36 -36
- package/dist/server/middleware-security.js +183 -183
- package/dist/server/module-compile-hook.js +695 -695
- package/dist/server/root-resolver.js +6 -5
- package/dist/server/rsc-engine-flashpack.d.ts +3 -1
- package/dist/server/rsc-engine-flashpack.js +12 -1
- package/dist/server/rsc-engine.d.ts +6 -1
- package/dist/server/rsc-engine.js +203 -219
- package/dist/server/rsc-upstream.js +893 -892
- package/dist/server/static-generator.js +4 -3
- package/dist/server/structure-validator.js +2 -1
- package/dist/server/structure-watch.js +2 -0
- package/dist/server/typed-api-runtime.js +639 -635
- package/dist/server/vista-import-map.js +134 -134
- package/dist/stack/index.d.ts +34 -34
- package/dist/stack/index.js +49 -49
- package/dist/stack/server/caller.d.ts +13 -13
- package/dist/stack/server/caller.js +42 -42
- package/dist/stack/server/executor.d.ts +40 -40
- package/dist/stack/server/executor.js +222 -222
- package/dist/stack/server/index.d.ts +11 -11
- package/dist/stack/server/index.js +24 -24
- package/dist/stack/server/procedure.d.ts +20 -20
- package/dist/stack/server/procedure.js +66 -66
- package/dist/stack/server/types.d.ts +113 -113
- package/dist/theme/react-server.d.ts +10 -10
- package/dist/theme/react-server.js +16 -16
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ exports.resolveNotFoundComponent = resolveNotFoundComponent;
|
|
|
9
9
|
exports.resolveLayoutChain = resolveLayoutChain;
|
|
10
10
|
const fs_1 = __importDefault(require("fs"));
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const app_dir_1 = require("./app-dir");
|
|
12
13
|
const FILE_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js'];
|
|
13
14
|
let hasWarnedLayoutFallback = false;
|
|
14
15
|
function resolveAppModuleByStem(appDir, stem) {
|
|
@@ -42,12 +43,12 @@ function detectRootMode(rootPath) {
|
|
|
42
43
|
return 'legacy';
|
|
43
44
|
}
|
|
44
45
|
function resolveRootLayout(cwd, isDev) {
|
|
45
|
-
const appDir =
|
|
46
|
+
const appDir = (0, app_dir_1.resolveAppDir)(cwd);
|
|
46
47
|
const rootPath = resolveAppModuleByStem(appDir, 'root');
|
|
47
48
|
const layoutPath = resolveAppModuleByStem(appDir, 'layout');
|
|
48
49
|
const selectedPath = rootPath ?? layoutPath;
|
|
49
50
|
if (!selectedPath) {
|
|
50
|
-
throw new Error('Missing app/root.(tsx|ts|jsx|js). Add app/root.tsx (canonical) or app/layout.tsx (fallback).');
|
|
51
|
+
throw new Error('Missing app/root.(tsx|ts|jsx|js). Add app/root.tsx or src/app/root.tsx (canonical), or app/layout.tsx / src/app/layout.tsx (fallback).');
|
|
51
52
|
}
|
|
52
53
|
const usedLayoutFallback = !rootPath && !!layoutPath;
|
|
53
54
|
if (usedLayoutFallback && !hasWarnedLayoutFallback) {
|
|
@@ -80,7 +81,7 @@ function resolveRootLayout(cwd, isDev) {
|
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
function resolveRoutePagePath(cwd, routePath) {
|
|
83
|
-
const appDir =
|
|
84
|
+
const appDir = (0, app_dir_1.resolveAppDir)(cwd);
|
|
84
85
|
const normalizedRoute = normalizeNotFoundRoute(routePath);
|
|
85
86
|
if (normalizedRoute === '/' || normalizedRoute === '/index') {
|
|
86
87
|
for (const ext of FILE_EXTENSIONS) {
|
|
@@ -111,7 +112,7 @@ function resolveRoutePagePath(cwd, routePath) {
|
|
|
111
112
|
return null;
|
|
112
113
|
}
|
|
113
114
|
function resolveNotFoundComponent(cwd, rootLayout, isDev) {
|
|
114
|
-
const appDir =
|
|
115
|
+
const appDir = (0, app_dir_1.resolveAppDir)(cwd);
|
|
115
116
|
const candidates = [];
|
|
116
117
|
// 1. Explicit notFoundRoute (highest priority)
|
|
117
118
|
if (rootLayout.notFoundRoute) {
|
|
@@ -177,7 +178,7 @@ function resolveNotFoundComponent(cwd, rootLayout, isDev) {
|
|
|
177
178
|
* @param isDev Bust require-cache in development
|
|
178
179
|
*/
|
|
179
180
|
function resolveLayoutChain(cwd, pageDir, isDev) {
|
|
180
|
-
const appDir =
|
|
181
|
+
const appDir = (0, app_dir_1.resolveAppDir)(cwd);
|
|
181
182
|
const chain = [];
|
|
182
183
|
// Walk from app/ root down to the page's directory, collecting layouts
|
|
183
184
|
// Normalise both to forward-slash for reliable prefix comparison
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { Express } from 'express';
|
|
1
2
|
import { type RSCEngineOptions } from './rsc-engine';
|
|
2
|
-
export declare function
|
|
3
|
+
export declare function createRSCApp(options?: RSCEngineOptions): Express;
|
|
4
|
+
export declare function startFlashpackRSCServer(options?: RSCEngineOptions): Express;
|
|
3
5
|
export declare const startRSCServer: typeof startFlashpackRSCServer;
|
|
4
6
|
export { startFlashpackRSCServer as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startRSCServer = void 0;
|
|
4
|
+
exports.createRSCApp = createRSCApp;
|
|
4
5
|
exports.startFlashpackRSCServer = startFlashpackRSCServer;
|
|
5
6
|
exports.default = startFlashpackRSCServer;
|
|
6
7
|
const runtime_1 = require("../flashpack/runtime");
|
|
@@ -8,6 +9,9 @@ const rsc_engine_1 = require("./rsc-engine");
|
|
|
8
9
|
function resolveMode() {
|
|
9
10
|
return process.env.NODE_ENV === 'development' ? 'development' : 'production';
|
|
10
11
|
}
|
|
12
|
+
function createRSCApp(options = {}) {
|
|
13
|
+
return startFlashpackRSCServer({ ...options, listen: false });
|
|
14
|
+
}
|
|
11
15
|
function startFlashpackRSCServer(options = {}) {
|
|
12
16
|
const cwd = process.cwd();
|
|
13
17
|
const mode = resolveMode();
|
|
@@ -19,9 +23,16 @@ function startFlashpackRSCServer(options = {}) {
|
|
|
19
23
|
mode,
|
|
20
24
|
allowFallback: !strict,
|
|
21
25
|
});
|
|
26
|
+
if (!prepared.rustPipelineUsed) {
|
|
27
|
+
if (strict) {
|
|
28
|
+
throw new Error('[flashpack] Rust pipeline did not run. Refusing to start Flight SSR without Flashpack prep (set VISTA_FLASHPACK_STRICT=false for an explicit non-Rust fallback).');
|
|
29
|
+
}
|
|
30
|
+
console.warn('[flashpack] WARNING: Rust pipeline skipped — serving via webpack Flight SSR fallback (not a silent renderToString path).');
|
|
31
|
+
}
|
|
22
32
|
if (process.env.VISTA_DEBUG) {
|
|
23
33
|
console.log(`[flashpack] server runtime prepared (rust=${prepared.rustPipelineUsed ? 'on' : 'fallback'}) at ${prepared.flashDir}`);
|
|
24
34
|
}
|
|
25
|
-
|
|
35
|
+
// Same Flight SSR contract as webpack: inline Flight, React.use streaming, fail-closed.
|
|
36
|
+
return (0, rsc_engine_1.startRSCServer)(options);
|
|
26
37
|
}
|
|
27
38
|
exports.startRSCServer = startFlashpackRSCServer;
|
|
@@ -7,12 +7,17 @@
|
|
|
7
7
|
* SSR renders Flight streams into HTML using renderToPipeableStream,
|
|
8
8
|
* with a shim __webpack_require__ to resolve client modules during SSR.
|
|
9
9
|
*/
|
|
10
|
+
import express from 'express';
|
|
10
11
|
import webpack from 'webpack';
|
|
11
12
|
export interface RSCEngineOptions {
|
|
12
13
|
port?: number;
|
|
13
14
|
compiler?: webpack.Compiler | null;
|
|
14
15
|
projectRoot?: string;
|
|
15
16
|
runtimeRoot?: string;
|
|
17
|
+
/** When false, return the Express app without binding a port (serverless). */
|
|
18
|
+
listen?: boolean;
|
|
16
19
|
}
|
|
17
|
-
export declare function
|
|
20
|
+
export declare function createRSCApp(options?: RSCEngineOptions): express.Express;
|
|
21
|
+
export declare function getRSCRequestListener(options?: RSCEngineOptions): express.Express;
|
|
22
|
+
export declare function startRSCServer(options?: RSCEngineOptions): express.Express;
|
|
18
23
|
export { startRSCServer as default };
|