Skip to content

Commit

Permalink
copy sveltekit-1 example from vercel/vercel (#1037)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikareads authored Jan 13, 2025
1 parent 114132f commit 8fb5a40
Show file tree
Hide file tree
Showing 38 changed files with 17,683 additions and 0 deletions.
22 changes: 22 additions & 0 deletions framework-boilerplates/sveltekit-1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test-results
node_modules

# Output
.output
.vercel
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions framework-boilerplates/sveltekit-1/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
13 changes: 13 additions & 0 deletions framework-boilerplates/sveltekit-1/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
17 changes: 17 additions & 0 deletions framework-boilerplates/sveltekit-1/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": [
"prettier-plugin-svelte"
],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
36 changes: 36 additions & 0 deletions framework-boilerplates/sveltekit-1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SvelteKit Demo app

The official demo app for SvelteKit, hosted on Vercel.

## Deploy Your Own

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fvercel%2Ftree%2Fmain%2Fexamples%2Fsveltekit-1&project-name=sveltekit-vercel&repository-name=sveltekit-vercel&demo-title=SvelteKit%20%2B%20Vercel&demo-url=https%3A%2F%2Fsveltekit-template.vercel.app%2F)

_Live Example: https://sveltekit-1-template.vercel.app_

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

## Speed Insights

Once deployed on Vercel, you can benefit from [Speed Insights](https://vercel.com/docs/concepts/speed-insights) simply by navigating to Vercel's dashboard, clicking on the 'Speed Insights' tab, and enabling the product.

You will get data once your application will be re-deployed and will receive visitors.
6 changes: 6 additions & 0 deletions framework-boilerplates/sveltekit-1/e2e/demo.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test';

test('home page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.locator('h1')).toBeVisible();
});
34 changes: 34 additions & 0 deletions framework-boilerplates/sveltekit-1/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import prettier from "eslint-config-prettier";
import js from '@eslint/js';
import { includeIgnoreFile } from '@eslint/compat';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import { fileURLToPath } from 'node:url';
import ts from 'typescript-eslint';
const gitignorePath = fileURLToPath(new URL("./.gitignore", import.meta.url));

export default ts.config(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs["flat/recommended"],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ["**/*.svelte"],

languageOptions: {
parserOptions: {
parser: ts.parser
}
}
}
);
39 changes: 39 additions & 0 deletions framework-boilerplates/sveltekit-1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "sveltekit-2",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"test:unit": "vitest",
"test": "npm run test:unit -- --run && npm run test:e2e",
"test:e2e": "playwright test"
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
"@fontsource/fira-mono": "^5.0.0",
"@neoconfetti/svelte": "^2.0.0",
"@playwright/test": "^1.45.3",
"@sveltejs/adapter-vercel": "^5.5.0",
"@sveltejs/kit": "^2.9.0",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"eslint": "^9.7.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^6.0.0",
"vitest": "^2.0.4",
"web-vitals": "^3.5.0"
}
}
10 changes: 10 additions & 0 deletions framework-boilerplates/sveltekit-1/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},

testDir: 'e2e'
});
Loading

0 comments on commit 8fb5a40

Please sign in to comment.