@vistagenic/vista 0.2.16 → 0.3.2
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 +184 -177
- package/dist/ai/agent.d.ts +37 -0
- package/dist/ai/agent.js +385 -0
- package/dist/ai/embeddings.d.ts +11 -0
- package/dist/ai/embeddings.js +71 -0
- package/dist/ai/index.d.ts +10 -0
- package/dist/ai/index.js +26 -0
- package/dist/ai/memory.d.ts +16 -0
- package/dist/ai/memory.js +39 -0
- package/dist/ai/observability.d.ts +21 -0
- package/dist/ai/observability.js +69 -0
- package/dist/ai/providers/anthropic.d.ts +2 -0
- package/dist/ai/providers/anthropic.js +190 -0
- package/dist/ai/providers/base.d.ts +7 -0
- package/dist/ai/providers/base.js +85 -0
- package/dist/ai/providers/gemini.d.ts +2 -0
- package/dist/ai/providers/gemini.js +194 -0
- package/dist/ai/providers/index.d.ts +5 -0
- package/dist/ai/providers/index.js +21 -0
- package/dist/ai/providers/mock.d.ts +8 -0
- package/dist/ai/providers/mock.js +77 -0
- package/dist/ai/providers/openai.d.ts +2 -0
- package/dist/ai/providers/openai.js +211 -0
- package/dist/ai/rag.d.ts +35 -0
- package/dist/ai/rag.js +110 -0
- package/dist/ai/react/index.d.ts +1 -0
- package/dist/ai/react/index.js +17 -0
- package/dist/ai/react/react-server.d.ts +1 -0
- package/dist/ai/react/react-server.js +17 -0
- package/dist/ai/react/use-agent.d.ts +23 -0
- package/dist/ai/react/use-agent.js +138 -0
- package/dist/ai/stream.d.ts +24 -0
- package/dist/ai/stream.js +109 -0
- package/dist/ai/tool.d.ts +11 -0
- package/dist/ai/tool.js +47 -0
- package/dist/ai/types.d.ts +117 -0
- package/dist/ai/types.js +5 -0
- package/dist/auth/core.d.ts +140 -0
- package/dist/auth/core.js +165 -0
- package/dist/auth/index.d.ts +20 -8
- package/dist/auth/index.js +369 -16
- package/dist/auth/react-server.d.ts +1 -0
- package/dist/auth/react-server.js +10 -0
- package/dist/auth/react.d.ts +18 -0
- package/dist/auth/react.js +71 -0
- package/dist/bin/build-rsc.js +602 -604
- package/dist/bin/build.js +389 -388
- package/dist/bin/deploy-output.d.ts +2 -7
- package/dist/bin/deploy-output.js +3 -76
- package/dist/bin/deploy.d.ts +7 -0
- package/dist/bin/deploy.js +102 -0
- package/dist/bin/dev-error-overlay-snippet.js +778 -552
- package/dist/bin/devtools-indicator-snippet.js +387 -387
- package/dist/bin/generate.js +510 -248
- package/dist/build/manifest.d.ts +169 -139
- package/dist/build/manifest.js +423 -367
- package/dist/build/rsc/client-manifest.d.ts +62 -52
- package/dist/build/rsc/client-manifest.js +295 -193
- package/dist/build/rsc/client-reference-plugin.d.ts +37 -37
- package/dist/build/rsc/client-reference-plugin.js +160 -160
- package/dist/build/rsc/native-scanner.d.ts +135 -123
- package/dist/build/rsc/native-scanner.js +203 -170
- package/dist/build/rsc/react-client-reference-manifest.d.ts +28 -22
- package/dist/build/rsc/react-client-reference-manifest.js +240 -219
- package/dist/build/rsc/rsc-renderer.d.ts +99 -99
- package/dist/build/rsc/rsc-renderer.js +263 -263
- package/dist/build/rsc/server-component-loader.d.ts +19 -19
- package/dist/build/rsc/server-component-loader.js +91 -91
- package/dist/build/rsc/server-manifest.d.ts +17 -0
- package/dist/build/rsc/server-manifest.js +20 -0
- package/dist/build/standalone.js +337 -334
- package/dist/build/webpack/plugins/vista-flight-plugin.js +5 -5
- package/dist/client/dynamic.react-server.d.ts +2 -0
- package/dist/client/dynamic.react-server.js +23 -0
- package/dist/client/link.react-server.d.ts +2 -0
- package/dist/client/link.react-server.js +11 -0
- package/dist/client/navigation.react-server.d.ts +1 -0
- package/dist/client/navigation.react-server.js +17 -0
- package/dist/client/router.react-server.d.ts +1 -0
- package/dist/client/router.react-server.js +17 -0
- package/dist/client/rsc-router.react-server.d.ts +1 -0
- package/dist/client/rsc-router.react-server.js +17 -0
- package/dist/client/script.react-server.d.ts +2 -0
- package/dist/client/script.react-server.js +23 -0
- package/dist/components/client-island.d.ts +34 -34
- package/dist/components/client-island.js +75 -75
- package/dist/config.d.ts +17 -0
- package/dist/config.js +60 -1
- package/dist/deploy/adapters/cloudflare.d.ts +2 -0
- package/dist/deploy/adapters/cloudflare.js +124 -0
- package/dist/deploy/adapters/docker.d.ts +2 -0
- package/dist/deploy/adapters/docker.js +112 -0
- package/dist/deploy/adapters/index.d.ts +15 -0
- package/dist/deploy/adapters/index.js +24 -0
- package/dist/deploy/adapters/netlify.d.ts +2 -0
- package/dist/deploy/adapters/netlify.js +115 -0
- package/dist/deploy/adapters/render.d.ts +2 -0
- package/dist/deploy/adapters/render.js +95 -0
- package/dist/deploy/adapters/vercel.d.ts +7 -0
- package/dist/deploy/adapters/vercel.js +164 -0
- package/dist/deploy/cli-runner.d.ts +8 -0
- package/dist/deploy/cli-runner.js +58 -0
- package/dist/deploy/detect.d.ts +6 -0
- package/dist/deploy/detect.js +77 -0
- package/dist/deploy/index.d.ts +24 -0
- package/dist/deploy/index.js +112 -0
- package/dist/deploy/preflight.d.ts +8 -0
- package/dist/deploy/preflight.js +80 -0
- package/dist/deploy/types.d.ts +48 -0
- package/dist/deploy/types.js +2 -0
- package/dist/deploy/utils.d.ts +18 -0
- package/dist/deploy/utils.js +70 -0
- package/dist/dev-error.d.ts +14 -0
- package/dist/dev-error.js +1763 -705
- package/dist/index.d.ts +23 -21
- package/dist/index.js +61 -57
- package/dist/server/cookie-parse.d.ts +4 -0
- package/dist/server/cookie-parse.js +14 -0
- package/dist/server/engine.js +7 -26
- package/dist/server/index.d.ts +109 -102
- package/dist/server/index.js +315 -286
- package/dist/server/middleware-runner.d.ts +125 -57
- package/dist/server/middleware-runner.js +615 -218
- package/dist/server/middleware-security.d.ts +36 -0
- package/dist/server/middleware-security.js +183 -0
- package/dist/server/module-compile-hook.js +695 -662
- package/dist/server/route-handler-registry.d.ts +65 -0
- package/dist/server/route-handler-registry.js +195 -0
- package/dist/server/route-patterns.d.ts +67 -0
- package/dist/server/route-patterns.js +186 -0
- package/dist/server/rsc-engine.js +75 -92
- package/dist/server/rsc-module-system.d.ts +33 -33
- package/dist/server/rsc-module-system.js +87 -87
- package/dist/server/rsc-upstream.js +892 -888
- package/dist/server/static-generator.js +10 -10
- package/dist/server/typed-api-runtime.d.ts +18 -0
- package/dist/server/typed-api-runtime.js +635 -507
- package/dist/server/vista-import-map.js +134 -123
- package/dist/stack/index.d.ts +34 -32
- package/dist/stack/index.js +49 -45
- package/dist/stack/server/caller.d.ts +13 -0
- package/dist/stack/server/caller.js +42 -0
- package/dist/stack/server/executor.d.ts +40 -36
- package/dist/stack/server/executor.js +222 -174
- package/dist/stack/server/index.d.ts +11 -10
- package/dist/stack/server/index.js +24 -23
- package/dist/stack/server/procedure.d.ts +20 -18
- package/dist/stack/server/procedure.js +66 -58
- package/dist/stack/server/types.d.ts +113 -100
- package/dist/theme/react-server.d.ts +10 -0
- package/dist/theme/react-server.js +16 -0
- package/package.json +28 -3
- package/LICENSE +0 -21
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
vistaDir: string;
|
|
4
|
-
debug?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function generateDeploymentOutputs(options: DeployOutputOptions): void;
|
|
7
|
-
export {};
|
|
1
|
+
export { generateDeploymentOutputs } from '../deploy';
|
|
2
|
+
export type { BuildHookOptions } from '../deploy/types';
|
|
@@ -1,78 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateDeploymentOutputs =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function isVercelBuildEnvironment() {
|
|
10
|
-
return process.env.VERCEL === '1' || process.env.NOW_REGION !== undefined;
|
|
11
|
-
}
|
|
12
|
-
function hasUserVercelConfig(cwd) {
|
|
13
|
-
return fs_1.default.existsSync(path_1.default.join(cwd, 'vercel.json'));
|
|
14
|
-
}
|
|
15
|
-
function copyDirectoryRecursive(sourceDir, targetDir) {
|
|
16
|
-
if (!fs_1.default.existsSync(sourceDir))
|
|
17
|
-
return;
|
|
18
|
-
fs_1.default.mkdirSync(targetDir, { recursive: true });
|
|
19
|
-
const entries = fs_1.default.readdirSync(sourceDir, { withFileTypes: true });
|
|
20
|
-
for (const entry of entries) {
|
|
21
|
-
const from = path_1.default.join(sourceDir, entry.name);
|
|
22
|
-
const to = path_1.default.join(targetDir, entry.name);
|
|
23
|
-
if (entry.isDirectory()) {
|
|
24
|
-
copyDirectoryRecursive(from, to);
|
|
25
|
-
}
|
|
26
|
-
else if (entry.isFile()) {
|
|
27
|
-
fs_1.default.copyFileSync(from, to);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function copyFileIfPresent(sourceFile, targetFile) {
|
|
32
|
-
if (!fs_1.default.existsSync(sourceFile))
|
|
33
|
-
return;
|
|
34
|
-
fs_1.default.mkdirSync(path_1.default.dirname(targetFile), { recursive: true });
|
|
35
|
-
fs_1.default.copyFileSync(sourceFile, targetFile);
|
|
36
|
-
}
|
|
37
|
-
function writeVercelBuildOutput(options) {
|
|
38
|
-
const { cwd, vistaDir, debug } = options;
|
|
39
|
-
if (!isVercelBuildEnvironment()) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (hasUserVercelConfig(cwd)) {
|
|
43
|
-
if (debug) {
|
|
44
|
-
console.log('[vista:deploy] Found custom vercel.json, skipping internal Vercel output.');
|
|
45
|
-
}
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const vercelOutputDir = path_1.default.join(cwd, '.vercel', 'output');
|
|
49
|
-
const vercelStaticDir = path_1.default.join(vercelOutputDir, 'static');
|
|
50
|
-
fs_1.default.rmSync(vercelOutputDir, { recursive: true, force: true });
|
|
51
|
-
fs_1.default.mkdirSync(vercelStaticDir, { recursive: true });
|
|
52
|
-
// Public assets: /favicon.ico, /vista.svg, etc.
|
|
53
|
-
copyDirectoryRecursive(path_1.default.join(cwd, 'public'), vercelStaticDir);
|
|
54
|
-
// Vista static artifacts: /static/pages, /static/chunks, etc.
|
|
55
|
-
copyDirectoryRecursive(path_1.default.join(vistaDir, 'static'), path_1.default.join(vercelStaticDir, 'static'));
|
|
56
|
-
// Global CSS alias support (/styles.css and /client.css)
|
|
57
|
-
const clientCssPath = path_1.default.join(vistaDir, 'client.css');
|
|
58
|
-
copyFileIfPresent(clientCssPath, path_1.default.join(vercelStaticDir, 'client.css'));
|
|
59
|
-
copyFileIfPresent(clientCssPath, path_1.default.join(vercelStaticDir, 'styles.css'));
|
|
60
|
-
const config = {
|
|
61
|
-
version: 3,
|
|
62
|
-
routes: [
|
|
63
|
-
{ handle: 'filesystem' },
|
|
64
|
-
{ src: '^/_vista/(.*)$', dest: '/$1' },
|
|
65
|
-
{ src: '^/(?:rsc|_rsc)/?$', dest: '/static/pages/index.rsc' },
|
|
66
|
-
{ src: '^/(?:rsc|_rsc)/(.+)$', dest: '/static/pages/$1.rsc' },
|
|
67
|
-
{ src: '^/$', dest: '/static/pages/index.html' },
|
|
68
|
-
{ src: '^/(.+)$', dest: '/static/pages/$1.html' },
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
fs_1.default.writeFileSync(path_1.default.join(vercelOutputDir, 'config.json'), JSON.stringify(config, null, 2));
|
|
72
|
-
if (debug) {
|
|
73
|
-
console.log('[vista:deploy] Generated internal Vercel Build Output at .vercel/output/');
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function generateDeploymentOutputs(options) {
|
|
77
|
-
writeVercelBuildOutput(options);
|
|
78
|
-
}
|
|
3
|
+
exports.generateDeploymentOutputs = void 0;
|
|
4
|
+
var deploy_1 = require("../deploy");
|
|
5
|
+
Object.defineProperty(exports, "generateDeploymentOutputs", { enumerable: true, get: function () { return deploy_1.generateDeploymentOutputs; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface RunDeployCommandOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
log?: (message: string) => void;
|
|
4
|
+
warn?: (message: string) => void;
|
|
5
|
+
error?: (message: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function runDeployCommand(flags: string[], options?: RunDeployCommandOptions): Promise<number>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runDeployCommand = runDeployCommand;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
10
|
+
const deploy_1 = require("../deploy");
|
|
11
|
+
function getFlagValue(flags, flag) {
|
|
12
|
+
const index = flags.indexOf(flag);
|
|
13
|
+
if (index !== -1) {
|
|
14
|
+
const next = flags[index + 1];
|
|
15
|
+
if (next && !next.startsWith('-'))
|
|
16
|
+
return next;
|
|
17
|
+
}
|
|
18
|
+
const inline = flags.find((value) => value.startsWith(`${flag}=`));
|
|
19
|
+
if (inline)
|
|
20
|
+
return inline.slice(flag.length + 1);
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function printHelp() {
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log('Usage: vista deploy [options]');
|
|
26
|
+
console.log('');
|
|
27
|
+
console.log('Options:');
|
|
28
|
+
console.log(' --target <auto|render|vercel|cloudflare|netlify|docker>');
|
|
29
|
+
console.log(' --prod Production deploy (default)');
|
|
30
|
+
console.log(' --preview Preview/staging deploy');
|
|
31
|
+
console.log(' --dry-run Build + emit + validate only');
|
|
32
|
+
console.log(' --skip-build Use existing .vista artifacts');
|
|
33
|
+
console.log(' --force Overwrite generated platform configs');
|
|
34
|
+
console.log(' --help Show this help message');
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log('Examples:');
|
|
37
|
+
console.log(' vista deploy');
|
|
38
|
+
console.log(' vista deploy --target vercel --prod');
|
|
39
|
+
console.log(' vista deploy --target render --dry-run');
|
|
40
|
+
console.log('');
|
|
41
|
+
}
|
|
42
|
+
async function runProductionBuild(cwd) {
|
|
43
|
+
const vistaBin = path_1.default.join(__dirname, '..', '..', 'bin', 'vista.js');
|
|
44
|
+
const result = (0, child_process_1.spawnSync)(process.execPath, [vistaBin, 'build'], {
|
|
45
|
+
cwd,
|
|
46
|
+
env: process.env,
|
|
47
|
+
stdio: 'inherit',
|
|
48
|
+
});
|
|
49
|
+
if (result.status !== 0) {
|
|
50
|
+
throw new Error('[vista:deploy] Production build failed.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function runDeployCommand(flags, options = {}) {
|
|
54
|
+
if (flags.includes('--help') || flags.includes('-h')) {
|
|
55
|
+
printHelp();
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
const target = getFlagValue(flags, '--target');
|
|
59
|
+
if (target === 'auto') {
|
|
60
|
+
(options.error ?? console.error)('[vista:deploy] --target auto cannot be passed explicitly. Omit --target to auto-detect.');
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
if (target && !(0, deploy_1.listKnownTargets)().includes(target)) {
|
|
64
|
+
(options.error ?? console.error)(`[vista:deploy] Unsupported target "${target}". Use one of: ${(0, deploy_1.listKnownTargets)().join(', ')}`);
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
const cwd = options.cwd ?? process.cwd();
|
|
68
|
+
const dryRun = flags.includes('--dry-run');
|
|
69
|
+
const skipBuild = flags.includes('--skip-build');
|
|
70
|
+
const force = flags.includes('--force');
|
|
71
|
+
const preview = flags.includes('--preview');
|
|
72
|
+
const prod = !preview;
|
|
73
|
+
if (!skipBuild && !fs_1.default.existsSync(path_1.default.join(cwd, 'package.json'))) {
|
|
74
|
+
(options.error ?? console.error)('[vista:deploy] No package.json found in project root.');
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const result = await (0, deploy_1.runDeploy)({
|
|
79
|
+
cwd,
|
|
80
|
+
target,
|
|
81
|
+
dryRun,
|
|
82
|
+
skipBuild,
|
|
83
|
+
prod,
|
|
84
|
+
preview,
|
|
85
|
+
force,
|
|
86
|
+
debug: Boolean(process.env.VISTA_DEBUG),
|
|
87
|
+
log: options.log,
|
|
88
|
+
warn: options.warn,
|
|
89
|
+
error: options.error,
|
|
90
|
+
build: runProductionBuild,
|
|
91
|
+
});
|
|
92
|
+
if (result.status === 'failed') {
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
99
|
+
(options.error ?? console.error)(message);
|
|
100
|
+
return 1;
|
|
101
|
+
}
|
|
102
|
+
}
|