├── .npmrc ├── pnpm-workspace.yaml ├── static ├── favicon.png └── robots.txt ├── src ├── lib │ └── images │ │ ├── svelte-welcome.png │ │ ├── svelte-welcome.webp │ │ ├── github.svg │ │ └── svelte-logo.svg ├── hooks.server.js ├── routes │ ├── +page.js │ ├── about │ │ ├── +page.js │ │ └── +page.svelte │ ├── sverdle │ │ ├── how-to-play │ │ │ ├── +page.js │ │ │ └── +page.svelte │ │ ├── +page.server.js │ │ └── +page.svelte │ ├── +layout.svelte │ ├── +page.svelte │ ├── styles.css │ ├── Counter.svelte │ └── Header.svelte ├── app.d.ts ├── app.html └── app.css ├── .gitignore ├── svelte.config.js ├── tests └── test.js ├── .prettierignore ├── playwright.config.js ├── .prettierrc ├── README.md ├── vite.config.js ├── cli.js ├── jsconfig.json ├── package.json └── pnpm-lock.yaml /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | overrides: 2 | '@sveltejs/kit': link:../kit/packages/kit 3 | -------------------------------------------------------------------------------- /static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sveltejs/kit-sandbox/main/static/favicon.png -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /src/lib/images/svelte-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sveltejs/kit-sandbox/main/src/lib/images/svelte-welcome.png -------------------------------------------------------------------------------- /src/lib/images/svelte-welcome.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sveltejs/kit-sandbox/main/src/lib/images/svelte-welcome.webp -------------------------------------------------------------------------------- /src/hooks.server.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@sveltejs/kit').Handle} */ 2 | export function handle({ event, resolve }) { 3 | return resolve(event); 4 | } 5 | -------------------------------------------------------------------------------- /src/routes/+page.js: -------------------------------------------------------------------------------- 1 | // since there's no dynamic data here, we can prerender 2 | // it so that it gets served as a static asset in production 3 | export const prerender = true; 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | .vercel 10 | .output 11 | vite.config.js.timestamp-* 12 | vite.config.ts.timestamp-* 13 | -------------------------------------------------------------------------------- /src/app.d.ts: -------------------------------------------------------------------------------- 1 | // See https://kit.svelte.dev/docs/types#app 2 | // for information about these interfaces 3 | // and what to do when importing types 4 | declare global { 5 | namespace App {} 6 | } 7 | 8 | export {}; 9 | -------------------------------------------------------------------------------- /svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-auto'; 2 | 3 | /** @type {import('@sveltejs/kit').Config} */ 4 | const config = { 5 | kit: { 6 | adapter: adapter() 7 | } 8 | }; 9 | 10 | export default config; 11 | -------------------------------------------------------------------------------- /tests/test.js: -------------------------------------------------------------------------------- 1 | import { expect, test } from '@playwright/test'; 2 | 3 | test('about page has expected h1', async ({ page }) => { 4 | await page.goto('/about'); 5 | expect(await page.textContent('h1')).toBe('About this app'); 6 | }); 7 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /playwright.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@playwright/test').PlaywrightTestConfig} */ 2 | const config = { 3 | webServer: { 4 | command: 'npm run build && npm run preview', 5 | port: 4173 6 | } 7 | }; 8 | 9 | export default config; 10 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "printWidth": 100, 6 | "plugins": ["prettier-plugin-svelte"], 7 | "pluginSearchDirs": ["."], 8 | "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kit-sandbox 2 | 3 | A way for maintainers to test out changes to Kit outside the repo. Place it next to the [kit](https://github.com/sveltejs/kit) repo, `pnpm install`, then link the packages you want to test: 4 | 5 | ``` 6 | pnpm link ../kit/packages/kit 7 | pnpm link ../kit/packages/adapter-auto 8 | # etc 9 | ``` 10 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { sveltekit } from '@sveltejs/kit/vite'; 3 | 4 | /** @type {import('vite').UserConfig} */ 5 | const config = { 6 | logLevel: 'info', 7 | 8 | plugins: [sveltekit()], 9 | 10 | server: { 11 | fs: { 12 | allow: [path.resolve('../kit')] 13 | } 14 | } 15 | }; 16 | 17 | export default config; 18 | -------------------------------------------------------------------------------- /src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |10 | This is a SvelteKit app. You can make your own by typing the 11 | following into your command line and following the prompts: 12 |
13 | 14 |npm create svelte@latest15 | 16 |
17 | The page you're looking at is purely static HTML, with no client-side interactivity needed. 18 | Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening 19 | the devtools network panel and reloading. 20 |
21 | 22 |23 | The Sverdle page illustrates SvelteKit's data loading and form handling. Try 24 | using it with JavaScript disabled! 25 |
26 |10 | Sverdle is a clone of Wordle, the 11 | word guessing game. To play, enter a five-letter English word. For example: 12 |
13 | 14 |23 | The y is in the right place. r and 24 | t 25 | are the right letters, but in the wrong place. The other letters are wrong, and can be discarded. 26 | Let's make another guess: 27 |
28 | 29 |This time we guessed right! You have six guesses to get the word.
38 | 39 |
40 | Unlike the original Wordle, Sverdle runs on the server instead of in the browser, making it
41 | impossible to cheat. It uses <form> and cookies to submit data, meaning you can
42 | even play with JavaScript disabled!
43 |