Skip to content

Commit e366c49

Browse files
authored
chore: unify sandbox (#13012)
1 parent bc1624f commit e366c49

19 files changed

+65
-152
lines changed

.vscode/launch.json

-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4-
{
5-
"type": "chrome",
6-
"request": "launch",
7-
"name": "Playground: Browser",
8-
"url": "http://localhost:10001"
9-
},
10-
{
11-
"type": "node",
12-
"request": "launch",
13-
"runtimeArgs": ["--watch"],
14-
"name": "Playground: Server",
15-
"outputCapture": "std",
16-
"program": "start.js",
17-
"cwd": "${workspaceFolder}/playgrounds/demo",
18-
"cascadeTerminateToConfigurations": ["Playground: Browser"]
19-
},
204
{
215
"type": "node",
226
"request": "launch",
@@ -26,11 +10,5 @@
2610
"NODE_OPTIONS": "--stack-trace-limit=10000"
2711
}
2812
}
29-
],
30-
"compounds": [
31-
{
32-
"name": "Playground: Full",
33-
"configurations": ["Playground: Server", "Playground: Browser"]
34-
}
3513
]
3614
}

playgrounds/demo/.gitignore

-5
This file was deleted.

playgrounds/demo/package.json

-22
This file was deleted.

playgrounds/demo/tsconfig.json

-17
This file was deleted.

playgrounds/sandbox/.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
input/*
2-
output/*
3-
!.gitkeep
1+
/dist/client/*
2+
/dist/server/*
3+
/output
4+
/src/*

playgrounds/sandbox/.prettierignore

-2
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

playgrounds/sandbox/input/.gitkeep

Whitespace-only changes.

playgrounds/sandbox/package.json

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
{
2-
"name": "svelte-playgrounds-sandbox",
2+
"name": "svelte-playgrounds-demo",
33
"private": true,
4-
"type": "module",
5-
"license": "MIT",
64
"version": "0.0.1",
5+
"type": "module",
76
"scripts": {
8-
"format": "prettier --check --write .",
9-
"lint": "prettier --check . && eslint"
7+
"prepare": "node scripts/create-app-svelte.js",
8+
"dev": "vite --host",
9+
"ssr": "node ./ssr-dev.js",
10+
"build": "vite build --outDir dist/client && vite build --outDir dist/server --ssr ssr-prod.js",
11+
"prod": "npm run build && node dist/server/ssr-prod",
12+
"preview": "vite preview"
1013
},
11-
"dependencies": {
12-
"svelte": "workspace:^",
13-
"tiny-glob": "^0.2.9"
14+
"devDependencies": {
15+
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.3",
16+
"nodemon": "^3.0.3",
17+
"polka": "^1.0.0-next.25",
18+
"svelte": "workspace:*",
19+
"tiny-glob": "^0.2.9",
20+
"vite": "^5.0.13",
21+
"vite-plugin-inspect": "^0.8.4"
1422
}
1523
}

playgrounds/sandbox/run.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ function mkdirp(dir) {
2626
} catch {}
2727
}
2828

29-
const svelte_modules = glob('**/*.svelte', { cwd: `${cwd}/input` });
30-
const js_modules = glob('**/*.js', { cwd: `${cwd}/input` });
29+
const svelte_modules = glob('**/*.svelte', { cwd: `${cwd}/src` });
30+
const js_modules = glob('**/*.js', { cwd: `${cwd}/src` });
3131

3232
for (const generate of /** @type {const} */ (['client', 'server'])) {
3333
console.error(`\n--- generating ${generate} ---\n`);
3434
for (const file of svelte_modules) {
35-
const input = `${cwd}/input/${file}`;
35+
const input = `${cwd}/src/${file}`;
3636
const source = fs.readFileSync(input, 'utf-8');
3737

3838
const output_js = `${cwd}/output/${generate}/${file}.js`;
@@ -81,7 +81,7 @@ for (const generate of /** @type {const} */ (['client', 'server'])) {
8181
}
8282

8383
for (const file of js_modules) {
84-
const input = `${cwd}/input/${file}`;
84+
const input = `${cwd}/src/${file}`;
8585
const source = fs.readFileSync(input, 'utf-8');
8686

8787
const compiled = compileModule(source, {
File renamed without changes.
File renamed without changes.

playgrounds/sandbox/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"allowJs": true,
1414
"checkJs": true
1515
},
16-
"include": ["./run.js", "./input"]
16+
"include": ["./src", "ssr-dev.js", "ssr-prod.js"]
1717
}
File renamed without changes.

0 commit comments

Comments
 (0)