create-vista-app 0.2.16 → 0.3.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.
@@ -1,71 +1,71 @@
1
- import Image from 'vista/image';
2
- import { ThemeToggle } from '../utils/theme-toggle';
3
-
4
- export default function Index() {
5
- return (
6
- <main className="flex min-h-[100dvh] items-center justify-center bg-background px-6 py-8 text-foreground selection:bg-primary/15 selection:text-primary md:px-10">
7
- <section className="relative w-full max-w-5xl rounded-[2rem] border border-border bg-panel-elevated/90 p-7 shadow-[0_24px_80px_rgba(27,18,7,0.08)] backdrop-blur-sm md:p-10">
8
- <div className="absolute right-5 top-5">
9
- <ThemeToggle compact />
10
- </div>
11
-
12
- <div className="grid items-center gap-10 lg:grid-cols-[minmax(0,1.05fr)_minmax(300px,0.95fr)]">
13
- <div className="max-w-xl">
14
- <div className="inline-flex items-center gap-2 rounded-full border border-border bg-background/70 px-4 py-2 text-[11px] font-medium uppercase tracking-[0.28em] text-primary">
15
- Vista starter
16
- </div>
17
- <h1 className="mt-6 max-w-xl text-balance text-[clamp(2.6rem,5vw,4.6rem)] font-semibold tracking-tight text-foreground">
18
- Start by editing <code className="font-mono text-[0.82em]">app/index.tsx</code>.
19
- </h1>
20
- <p className="mt-5 max-w-lg text-pretty text-base leading-8 text-muted-foreground md:text-lg">
21
- The default starter keeps the first screen calm: one route, a clean app shell, and the core Vista flow
22
- already wired so you can start building instead of cleaning up scaffolding.
23
- </p>
24
-
25
- <div className="mt-7 flex flex-wrap items-center gap-3">
26
- <a
27
- href="https://vista.xyz/docs/env"
28
- className="inline-flex items-center justify-center rounded-full bg-foreground px-5 py-3 text-sm font-medium text-background transition-colors hover:opacity-90"
29
- >
30
- Open env guide
31
- </a>
32
- <span className="rounded-full border border-border bg-background/70 px-4 py-3 text-sm text-muted-foreground">
33
- Engine lives in <code>vista.config.ts</code>
34
- </span>
35
- </div>
36
- </div>
37
-
38
- <aside className="rounded-[1.7rem] border border-border bg-background/70 p-6">
39
- <div className="flex items-center justify-between text-[11px] uppercase tracking-[0.24em] text-muted-foreground">
40
- <span>Default engine</span>
41
- <span>Vista</span>
42
- </div>
43
-
44
- <div className="mt-6 flex justify-center">
45
- <Image
46
- src="/vista.svg"
47
- alt="Vista Logo"
48
- width={600}
49
- height={600}
50
- priority
51
- unoptimized
52
- className="h-auto w-[220px] opacity-95 sm:w-[250px]"
53
- />
54
- </div>
55
-
56
- <div className="mt-7 space-y-3 text-sm text-muted-foreground">
57
- <div className="rounded-2xl border border-border bg-panel p-4">
58
- <p className="font-medium text-foreground">Stable default path</p>
59
- <p className="mt-2 leading-7">Use the familiar <code>vista dev</code>, <code>vista build</code>, and <code>vista start</code> flow from day one.</p>
60
- </div>
61
- <div className="rounded-2xl border border-border bg-panel p-4">
62
- <p className="font-medium text-foreground">Config-first workflow</p>
63
- <p className="mt-2 leading-7">Adjust engine and framework behavior in <code>vista.config.ts</code> instead of rewriting scripts.</p>
64
- </div>
65
- </div>
66
- </aside>
67
- </div>
68
- </section>
69
- </main>
70
- );
71
- }
1
+ import Image from 'vista/image';
2
+ import { ThemeToggle } from '../components/theme-toggle';
3
+
4
+ export default function Index() {
5
+ return (
6
+ <main className="flex min-h-[100dvh] items-center justify-center bg-background px-6 py-8 text-foreground selection:bg-primary/15 selection:text-primary md:px-10">
7
+ <section className="relative w-full max-w-5xl rounded-[2rem] border border-border bg-panel-elevated/90 p-7 shadow-[0_24px_80px_rgba(27,18,7,0.08)] backdrop-blur-sm md:p-10">
8
+ <div className="absolute right-5 top-5">
9
+ <ThemeToggle compact />
10
+ </div>
11
+
12
+ <div className="grid items-center gap-10 lg:grid-cols-[minmax(0,1.05fr)_minmax(300px,0.95fr)]">
13
+ <div className="max-w-xl">
14
+ <div className="inline-flex items-center gap-2 rounded-full border border-border bg-background/70 px-4 py-2 text-[11px] font-medium uppercase tracking-[0.28em] text-primary">
15
+ Vista starter
16
+ </div>
17
+ <h1 className="mt-6 max-w-xl text-balance text-[clamp(2.6rem,5vw,4.6rem)] font-semibold tracking-tight text-foreground">
18
+ Start by editing <code className="font-mono text-[0.82em]">app/index.tsx</code>.
19
+ </h1>
20
+ <p className="mt-5 max-w-lg text-pretty text-base leading-8 text-muted-foreground md:text-lg">
21
+ The default starter keeps the first screen calm: one route, a clean app shell, and the core Vista flow
22
+ already wired so you can start building instead of cleaning up scaffolding.
23
+ </p>
24
+
25
+ <div className="mt-7 flex flex-wrap items-center gap-3">
26
+ <a
27
+ href="https://vista.xyz/docs/env"
28
+ className="inline-flex items-center justify-center rounded-full bg-foreground px-5 py-3 text-sm font-medium text-background transition-colors hover:opacity-90"
29
+ >
30
+ Open env guide
31
+ </a>
32
+ <span className="rounded-full border border-border bg-background/70 px-4 py-3 text-sm text-muted-foreground">
33
+ Engine lives in <code>vista.config.ts</code>
34
+ </span>
35
+ </div>
36
+ </div>
37
+
38
+ <aside className="rounded-[1.7rem] border border-border bg-background/70 p-6">
39
+ <div className="flex items-center justify-between text-[11px] uppercase tracking-[0.24em] text-muted-foreground">
40
+ <span>Default engine</span>
41
+ <span>Vista</span>
42
+ </div>
43
+
44
+ <div className="mt-6 flex justify-center">
45
+ <Image
46
+ src="/vista.svg"
47
+ alt="Vista Logo"
48
+ width={600}
49
+ height={600}
50
+ priority
51
+ unoptimized
52
+ className="h-auto w-[220px] opacity-95 sm:w-[250px]"
53
+ />
54
+ </div>
55
+
56
+ <div className="mt-7 space-y-3 text-sm text-muted-foreground">
57
+ <div className="rounded-2xl border border-border bg-panel p-4">
58
+ <p className="font-medium text-foreground">Stable default path</p>
59
+ <p className="mt-2 leading-7">Use the familiar <code>vista dev</code>, <code>vista build</code>, and <code>vista start</code> flow from day one.</p>
60
+ </div>
61
+ <div className="rounded-2xl border border-border bg-panel p-4">
62
+ <p className="font-medium text-foreground">Config-first workflow</p>
63
+ <p className="mt-2 leading-7">Adjust engine and framework behavior in <code>vista.config.ts</code> instead of rewriting scripts.</p>
64
+ </div>
65
+ </div>
66
+ </aside>
67
+ </div>
68
+ </section>
69
+ </main>
70
+ );
71
+ }
@@ -1,35 +1,35 @@
1
- import type { Metadata } from 'vista';
2
- import { Geist, Geist_Mono } from 'vista/font/google';
3
- import { ThemeProvider, ThemeScript } from 'vista/theme';
4
- import './globals.css';
5
-
6
- const geistSans = Geist({
7
- variable: '--font-geist-sans',
8
- subsets: ['latin'],
9
- });
10
-
11
- const geistMono = Geist_Mono({
12
- variable: '--font-geist-mono',
13
- subsets: ['latin'],
14
- });
15
-
16
- export const metadata: Metadata = {
17
- title: 'My Vista App',
18
- description: 'Built with Vista Framework',
19
- };
20
-
21
- export default function RootLayout({ children }: { children: React.ReactNode }) {
22
- return (
23
- <html lang="en" suppressHydrationWarning>
24
- <head>
25
- <ThemeScript defaultTheme="system" />
26
- </head>
27
- <body
28
- className={`${geistSans.variable} ${geistMono.variable} min-h-screen overflow-x-hidden antialiased bg-background text-foreground`}
29
- suppressHydrationWarning
30
- >
31
- <ThemeProvider defaultTheme="system">{children}</ThemeProvider>
32
- </body>
33
- </html>
34
- );
35
- }
1
+ import type { Metadata } from 'vista';
2
+ import { Geist, Geist_Mono } from 'vista/font/google';
3
+ import { ThemeProvider, ThemeScript } from 'vista/theme';
4
+ import './globals.css';
5
+
6
+ const geistSans = Geist({
7
+ variable: '--font-geist-sans',
8
+ subsets: ['latin'],
9
+ });
10
+
11
+ const geistMono = Geist_Mono({
12
+ variable: '--font-geist-mono',
13
+ subsets: ['latin'],
14
+ });
15
+
16
+ export const metadata: Metadata = {
17
+ title: 'My Vista App',
18
+ description: 'Built with Vista Framework',
19
+ };
20
+
21
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
22
+ return (
23
+ <html lang="en" suppressHydrationWarning>
24
+ <head>
25
+ <ThemeScript defaultTheme="system" />
26
+ </head>
27
+ <body
28
+ className={`${geistSans.variable} ${geistMono.variable} min-h-screen overflow-x-hidden antialiased bg-background text-foreground`}
29
+ suppressHydrationWarning
30
+ >
31
+ <ThemeProvider defaultTheme="system">{children}</ThemeProvider>
32
+ </body>
33
+ </html>
34
+ );
35
+ }
@@ -1,49 +1,49 @@
1
- 'use client';
2
-
3
- import { Laptop2, MoonStar, SunMedium } from 'lucide-react';
4
- import { useTheme, type ThemeMode } from 'vista/theme';
5
-
6
- const OPTIONS: Array<{
7
- value: ThemeMode;
8
- label: string;
9
- icon: typeof Laptop2;
10
- }> = [
11
- { value: 'system', label: 'System', icon: Laptop2 },
12
- { value: 'light', label: 'Light', icon: SunMedium },
13
- { value: 'dark', label: 'Dark', icon: MoonStar },
14
- ];
15
-
16
- interface ThemeToggleProps {
17
- compact?: boolean;
18
- }
19
-
20
- export function ThemeToggle({ compact = false }: ThemeToggleProps) {
21
- const { mounted, theme, setTheme } = useTheme();
22
-
23
- return (
24
- <div className="inline-flex items-center gap-1 rounded-full border border-border/80 bg-panel-elevated/90 p-1 shadow-[0_10px_30px_rgba(15,23,42,0.08)] backdrop-blur">
25
- {OPTIONS.map((option) => {
26
- const Icon = option.icon;
27
- const isActive = theme === option.value;
28
-
29
- return (
30
- <button
31
- key={option.value}
32
- type="button"
33
- onClick={() => setTheme(option.value)}
34
- className={`inline-flex items-center justify-center gap-2 rounded-full px-3 py-2 text-xs font-medium transition-colors ${
35
- isActive
36
- ? 'bg-foreground text-background'
37
- : 'text-muted-foreground hover:bg-background/80 hover:text-foreground'
38
- } ${compact ? 'px-2.5' : ''}`}
39
- aria-pressed={isActive}
40
- title={mounted ? option.label : undefined}
41
- >
42
- <Icon className="h-3.5 w-3.5" />
43
- {!compact ? <span>{option.label}</span> : null}
44
- </button>
45
- );
46
- })}
47
- </div>
48
- );
49
- }
1
+ 'use client';
2
+
3
+ import { Laptop2, MoonStar, SunMedium } from 'lucide-react';
4
+ import { useTheme, type ThemeMode } from 'vista/theme';
5
+
6
+ const OPTIONS: Array<{
7
+ value: ThemeMode;
8
+ label: string;
9
+ icon: typeof Laptop2;
10
+ }> = [
11
+ { value: 'system', label: 'System', icon: Laptop2 },
12
+ { value: 'light', label: 'Light', icon: SunMedium },
13
+ { value: 'dark', label: 'Dark', icon: MoonStar },
14
+ ];
15
+
16
+ interface ThemeToggleProps {
17
+ compact?: boolean;
18
+ }
19
+
20
+ export function ThemeToggle({ compact = false }: ThemeToggleProps) {
21
+ const { mounted, theme, setTheme } = useTheme();
22
+
23
+ return (
24
+ <div className="inline-flex items-center gap-1 rounded-full border border-border/80 bg-panel-elevated/90 p-1 shadow-[0_10px_30px_rgba(15,23,42,0.08)] backdrop-blur">
25
+ {OPTIONS.map((option) => {
26
+ const Icon = option.icon;
27
+ const isActive = theme === option.value;
28
+
29
+ return (
30
+ <button
31
+ key={option.value}
32
+ type="button"
33
+ onClick={() => setTheme(option.value)}
34
+ className={`inline-flex items-center justify-center gap-2 rounded-full px-3 py-2 text-xs font-medium transition-colors ${
35
+ isActive
36
+ ? 'bg-foreground text-background'
37
+ : 'text-muted-foreground hover:bg-background/80 hover:text-foreground'
38
+ } ${compact ? 'px-2.5' : ''}`}
39
+ aria-pressed={isActive}
40
+ title={mounted ? option.label : undefined}
41
+ >
42
+ <Icon className="h-3.5 w-3.5" />
43
+ {!compact ? <span>{option.label}</span> : null}
44
+ </button>
45
+ );
46
+ })}
47
+ </div>
48
+ );
49
+ }
@@ -0,0 +1,10 @@
1
+ node_modules
2
+ .git
3
+ .vista/cache
4
+ .flash
5
+ .next
6
+ .vercel
7
+ dist
8
+ coverage
9
+ *.log
10
+ .env*
@@ -0,0 +1,17 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM node:20-alpine AS builder
4
+ WORKDIR /app
5
+ COPY package.json package-lock.json* pnpm-lock.yaml* yarn.lock* ./
6
+ RUN npm install --no-audit --no-fund
7
+ COPY . .
8
+ RUN npm run build
9
+
10
+ FROM node:20-alpine AS runner
11
+ WORKDIR /app
12
+ ENV NODE_ENV=production
13
+ ENV PORT=3003
14
+ COPY --from=builder /app/.vista ./.vista
15
+ COPY --from=builder /app/package.json ./package.json
16
+ EXPOSE 3003
17
+ CMD ["node", ".vista/standalone/server.js"]
@@ -0,0 +1,7 @@
1
+ [build]
2
+ command = "npm run build"
3
+ publish = ".vista/deploy/netlify"
4
+
5
+ [dev]
6
+ command = "npm run dev"
7
+ port = 3003
@@ -0,0 +1,16 @@
1
+ services:
2
+ - type: web
3
+ name: my-vista-app
4
+ runtime: node
5
+ region: oregon
6
+ plan: free
7
+ buildCommand: |
8
+ npm install --no-audit --no-fund
9
+ npm run build
10
+ startCommand: npm run start
11
+ envVars:
12
+ - key: NODE_ENV
13
+ value: production
14
+ - key: PORT
15
+ value: "3003"
16
+ healthCheckPath: /
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": 2,
3
+ "buildCommand": "npm run build",
4
+ "outputDirectory": ".vista",
5
+ "framework": null,
6
+ "installCommand": "npm install --legacy-peer-deps --no-audit --no-fund",
7
+ "devCommand": "npm run dev",
8
+ "routes": [
9
+ { "handle": "filesystem" },
10
+ { "src": "^/_vista/(.*)$", "dest": "/$1" },
11
+ { "src": "^/(?:rsc|_rsc)/?$", "dest": "/static/pages/index.rsc" },
12
+ { "src": "^/(?:rsc|_rsc)/(.+)$", "dest": "/static/pages/$1.rsc" },
13
+ { "src": "^/$", "dest": "/static/pages/index.html" },
14
+ { "src": "^/(.+)$", "dest": "/static/pages/$1.html" }
15
+ ]
16
+ }
@@ -0,0 +1,3 @@
1
+ name = "my-vista-app"
2
+ compatibility_date = "2024-09-01"
3
+ pages_build_output_dir = ".vista/deploy/cloudflare"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2022",
3
+ "target": "es2022",
4
4
  "lib": ["dom", "dom.iterable", "esnext"],
5
5
  "allowJs": true,
6
6
  "skipLibCheck": true,
@@ -22,6 +22,6 @@
22
22
  "@/*": ["./*"]
23
23
  }
24
24
  },
25
- "include": ["**/*.ts", "**/*.tsx", "**/*.d.ts", ".next/types/**/*.ts"],
26
- "exclude": ["node_modules"]
27
- }
25
+ "include": ["**/*.ts", "**/*.tsx", "**/*.d.ts", ".next/types/**/*.ts"],
26
+ "exclude": ["node_modules"]
27
+ }
@@ -1,12 +1,12 @@
1
- /// <reference types="vista" />
2
- /// <reference types="vista/image/image-types/global" />
3
-
4
- // NOTE: This file should not be edited
5
- // see https://vista.xyz/docs/env for more information.
6
-
7
- declare module '*.module.css' {
8
- const classes: { readonly [key: string]: string };
9
- export default classes;
10
- }
11
-
12
- declare module '*.css';
1
+ /// <reference types="vista" />
2
+ /// <reference types="vista/image/image-types/global" />
3
+
4
+ // NOTE: This file should not be edited
5
+ // see https://vista.xyz/docs/env for more information.
6
+
7
+ declare module '*.module.css' {
8
+ const classes: { readonly [key: string]: string };
9
+ export default classes;
10
+ }
11
+
12
+ declare module '*.css';
@@ -1,17 +1,21 @@
1
- const config = {
2
- engine: {
3
- // Engine options: 'default' or 'flashpack'
4
- variant: 'default',
5
- },
6
- images: {
7
- domains: ['example.com'],
8
- // For static hosts where the /_vista/image endpoint is not available:
9
- // unoptimized: true,
10
- },
11
- // Optional: override server port
12
- // server: {
13
- // port: 3003
14
- // }
15
- };
16
-
17
- export default config;
1
+ const config = {
2
+ engine: {
3
+ // Engine options: 'default' or 'flashpack'
4
+ variant: 'default',
5
+ },
6
+ images: {
7
+ domains: ['example.com'],
8
+ // For static hosts where the /_vista/image endpoint is not available:
9
+ // unoptimized: true,
10
+ },
11
+ // Optional: override server port
12
+ // server: {
13
+ // port: 3003
14
+ // }
15
+ deploy: {
16
+ // Platform target: 'auto' | 'render' | 'vercel' | 'cloudflare' | 'netlify' | 'docker'
17
+ target: 'auto',
18
+ },
19
+ };
20
+
21
+ export default config;
@@ -1,7 +1,7 @@
1
- import type { VStackInstance } from 'vista/stack';
2
-
3
- export function helloProcedure(v: VStackInstance<any, any>) {
4
- return v.procedure.query(() => ({
5
- message: 'Hello from Vista Typed API',
6
- }));
7
- }
1
+ import type { VStackInstance } from 'vista/stack';
2
+
3
+ export function helloProcedure(v: VStackInstance<any, any>) {
4
+ return v.procedure.query(() => ({
5
+ message: 'Hello from Vista Typed API',
6
+ }));
7
+ }
@@ -1,8 +1,8 @@
1
- import type { VStackInstance } from 'vista/stack';
2
- import { helloProcedure } from '../procedures/hello';
3
-
4
- export function createRootRouter(v: VStackInstance<any, any>) {
5
- return v.router({
6
- hello: helloProcedure(v),
7
- });
8
- }
1
+ import type { VStackInstance } from 'vista/stack';
2
+ import { helloProcedure } from '../procedures/hello';
3
+
4
+ export function createRootRouter(v: VStackInstance<any, any>) {
5
+ return v.router({
6
+ hello: helloProcedure(v),
7
+ });
8
+ }
@@ -1,6 +1,6 @@
1
- import { vstack } from 'vista/stack';
2
- import { createRootRouter } from './routers';
3
-
4
- const v = vstack.init();
5
-
6
- export const router = createRootRouter(v);
1
+ import { vstack } from 'vista/stack';
2
+ import { createRootRouter } from './routers';
3
+
4
+ const v = vstack.init();
5
+
6
+ export const router = createRootRouter(v);
@@ -1,21 +1,21 @@
1
- const config = {
2
- engine: {
3
- // Engine options: 'default' or 'flashpack'
4
- variant: 'default',
5
- },
6
- images: {
7
- domains: ['example.com'],
8
- },
9
- experimental: {
10
- typedApi: {
11
- enabled: true,
12
- serialization: 'json',
13
- },
14
- },
15
- // Optional: override server port
16
- // server: {
17
- // port: 3000
18
- // }
19
- };
20
-
21
- export default config;
1
+ const config = {
2
+ engine: {
3
+ // Engine options: 'default' or 'flashpack'
4
+ variant: 'default',
5
+ },
6
+ images: {
7
+ domains: ['example.com'],
8
+ },
9
+ experimental: {
10
+ typedApi: {
11
+ enabled: true,
12
+ serialization: 'json',
13
+ },
14
+ },
15
+ // Optional: override server port
16
+ // server: {
17
+ // port: 3000
18
+ // }
19
+ };
20
+
21
+ export default config;
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2026 Vista.js contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.