Skip to content

Commit f547441

Browse files
examples: add new examples for Vite Vue integration
- Changed paths for GraphQL server and client types in examples/vite/tsconfig.json. - Added new dependencies and devDependencies in pnpm-lock.yaml for examples/vite-vue, including @pinia/colada, @tailwindcss/vite, graphql, nitro, and others. - Updated versions for existing packages and added new package resolutions for various dependencies.
1 parent 8bf2981 commit f547441

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2418
-8
lines changed

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const nitro = {
1818
'.docs/.vitepress/**/*',
1919
'**/*.graphql',
2020
'**/README.md',
21+
'examples/vite-vue/src/**/*.vue',
22+
'examples/vite-react/src/**/*.{tsx,jsx}',
2123
],
2224
}
2325
export default antfu(

examples/vite-react/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"moduleResolution": "Bundler",
99
"paths": {
1010
"#graphql/server": [
11-
"./.nitro/types/nitro-graphql-server.d.ts"
11+
"./.graphql/nitro-graphql-server.d.ts"
1212
],
1313
"#graphql/client": [
14-
"./.nitro/types/nitro-graphql-client.d.ts"
14+
"./.graphql/nitro-graphql-client.d.ts"
1515
],
1616
"#graphql/schema": [
1717
"./server/graphql/schema.ts"

examples/vite-vue/.dockerignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Dependencies
2+
node_modules
3+
.pnpm-store
4+
5+
# Build output
6+
dist
7+
.output
8+
.nuxt
9+
.nitro
10+
11+
# Environment files
12+
.env
13+
.env.local
14+
.env.*.local
15+
16+
# Version control
17+
.git
18+
.gitignore
19+
20+
# IDE
21+
.vscode
22+
.idea
23+
*.swp
24+
*.swo
25+
26+
# OS
27+
.DS_Store
28+
Thumbs.db
29+
30+
# Logs
31+
logs
32+
*.log
33+
npm-debug.log*
34+
pnpm-debug.log*
35+
yarn-debug.log*
36+
37+
# Testing
38+
coverage
39+
.nyc_output
40+
41+
# Temp files
42+
*.tmp
43+
.cache
44+
.temp
45+
46+
# Docker
47+
Dockerfile
48+
docker-compose.yml
49+
.dockerignore

examples/vite-vue/.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Environment Configuration Example
2+
# Copy this file to .env and update values as needed
3+
4+
# Application Environment
5+
NODE_ENV=development
6+
7+
# Server Configuration
8+
NITRO_PORT=3000
9+
NITRO_HOST=localhost
10+
11+
# GraphQL Configuration
12+
# GRAPHQL_ENDPOINT=/api/graphql
13+
# GRAPHQL_PLAYGROUND=true
14+
15+
# Database (if needed)
16+
# DATABASE_URL=postgresql://user:password@localhost:5432/dbname
17+
18+
# API Keys (if needed)
19+
# API_KEY=your-api-key-here

examples/vite-vue/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# TypeScript
16+
*.tsbuildinfo
17+
18+
# Editor directories and files
19+
.vscode/*
20+
!.vscode/extensions.json
21+
.idea
22+
.DS_Store
23+
*.suo
24+
*.ntvs*
25+
*.njsproj
26+
*.sln
27+
*.sw?
28+
*.output
29+
*.nitro

examples/vite-vue/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Build stage
2+
FROM node:24-alpine AS builder
3+
4+
# Build arguments
5+
ARG NITRO_PRESET=node-server
6+
7+
# Install pnpm
8+
RUN corepack enable && corepack prepare pnpm@latest --activate
9+
10+
WORKDIR /app
11+
12+
# Copy package files
13+
COPY package.json pnpm-lock.yaml* ./
14+
15+
# Install dependencies
16+
RUN pnpm install --frozen-lockfile
17+
18+
# Copy source code
19+
COPY . .
20+
21+
# Build the application with specified preset
22+
ENV NITRO_PRESET=$NITRO_PRESET
23+
RUN pnpm build
24+
25+
# Production stage
26+
FROM node:24-alpine
27+
28+
WORKDIR /app
29+
30+
# Copy built output from builder
31+
COPY --from=builder /app/.output /app/.output
32+
33+
# Expose the port Nitro uses
34+
EXPOSE 3000
35+
36+
# Set environment variables
37+
ENV NODE_ENV=production
38+
ENV NITRO_PORT=3000
39+
ENV NITRO_HOST=0.0.0.0
40+
41+
# Start the Nitro server
42+
CMD ["node", ".output/server/index.mjs"]

examples/vite-vue/Dockerfile.bun

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Build stage
2+
FROM oven/bun:1-alpine AS builder
3+
4+
# Build arguments
5+
ARG NITRO_PRESET=bun
6+
7+
WORKDIR /app
8+
9+
# Copy package files
10+
COPY package.json bun.lockb* ./
11+
12+
# Install dependencies
13+
RUN bun install --frozen-lockfile
14+
15+
# Copy source code
16+
COPY . .
17+
18+
# Build the application with specified preset
19+
ENV NITRO_PRESET=$NITRO_PRESET
20+
RUN bun run build
21+
22+
# Production stage
23+
FROM oven/bun:1-alpine
24+
25+
WORKDIR /app
26+
27+
# Copy built output from builder
28+
COPY --from=builder /app/.output /app/.output
29+
30+
# Expose the port Nitro uses
31+
EXPOSE 3000
32+
33+
# Set environment variables
34+
ENV NODE_ENV=production
35+
ENV NITRO_PORT=3000
36+
ENV NITRO_HOST=0.0.0.0
37+
38+
# Start the Nitro server
39+
CMD ["bun", "run", ".output/server/index.mjs"]

0 commit comments

Comments
 (0)