0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-21 11:28:58 +01:00

chore: unify sandbox (#13012)

This commit is contained in:
Rich Harris 2024-08-26 05:26:45 -04:00 committed by GitHub
parent bc1624ffc8
commit e366c49a86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 65 additions and 152 deletions

22
.vscode/launch.json vendored
View File

@ -1,22 +1,6 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Playground: Browser",
"url": "http://localhost:10001"
},
{
"type": "node",
"request": "launch",
"runtimeArgs": ["--watch"],
"name": "Playground: Server",
"outputCapture": "std",
"program": "start.js",
"cwd": "${workspaceFolder}/playgrounds/demo",
"cascadeTerminateToConfigurations": ["Playground: Browser"]
},
{
"type": "node",
"request": "launch",
@ -26,11 +10,5 @@
"NODE_OPTIONS": "--stack-trace-limit=10000"
}
}
],
"compounds": [
{
"name": "Playground: Full",
"configurations": ["Playground: Server", "Playground: Browser"]
}
]
}

View File

@ -1,5 +0,0 @@
src/*
dist/client/*
dist/server/*
!src/entry-client.ts
!src/entry-server.ts

View File

@ -1,22 +0,0 @@
{
"name": "svelte-playgrounds-demo",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"prepare": "node scripts/create-app-svelte.js",
"dev": "vite --host",
"ssr": "node ./ssr-dev.js",
"build": "vite build --outDir dist/client && vite build --outDir dist/server --ssr ssr-prod.js",
"prod": "npm run build && node dist/server/ssr-prod",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.3",
"nodemon": "^3.0.3",
"polka": "^1.0.0-next.25",
"svelte": "workspace:*",
"vite": "^5.0.13",
"vite-plugin-inspect": "^0.8.4"
}
}

View File

@ -1,17 +0,0 @@
{
"compilerOptions": {
"moduleResolution": "Bundler",
"target": "ESNext",
"module": "ESNext",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
"checkJs": true
},
"include": ["./src", "ssr-dev.js", "ssr-prod.js"]
}

View File

@ -1,3 +1,4 @@
input/*
output/*
!.gitkeep
/dist/client/*
/dist/server/*
/output
/src/*

View File

@ -1,2 +0,0 @@
input/**.svelte
output

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,15 +1,23 @@
{
"name": "svelte-playgrounds-sandbox",
"name": "svelte-playgrounds-demo",
"private": true,
"type": "module",
"license": "MIT",
"version": "0.0.1",
"type": "module",
"scripts": {
"format": "prettier --check --write .",
"lint": "prettier --check . && eslint"
"prepare": "node scripts/create-app-svelte.js",
"dev": "vite --host",
"ssr": "node ./ssr-dev.js",
"build": "vite build --outDir dist/client && vite build --outDir dist/server --ssr ssr-prod.js",
"prod": "npm run build && node dist/server/ssr-prod",
"preview": "vite preview"
},
"dependencies": {
"svelte": "workspace:^",
"tiny-glob": "^0.2.9"
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.3",
"nodemon": "^3.0.3",
"polka": "^1.0.0-next.25",
"svelte": "workspace:*",
"tiny-glob": "^0.2.9",
"vite": "^5.0.13",
"vite-plugin-inspect": "^0.8.4"
}
}

View File

@ -26,13 +26,13 @@ function mkdirp(dir) {
} catch {}
}
const svelte_modules = glob('**/*.svelte', { cwd: `${cwd}/input` });
const js_modules = glob('**/*.js', { cwd: `${cwd}/input` });
const svelte_modules = glob('**/*.svelte', { cwd: `${cwd}/src` });
const js_modules = glob('**/*.js', { cwd: `${cwd}/src` });
for (const generate of /** @type {const} */ (['client', 'server'])) {
console.error(`\n--- generating ${generate} ---\n`);
for (const file of svelte_modules) {
const input = `${cwd}/input/${file}`;
const input = `${cwd}/src/${file}`;
const source = fs.readFileSync(input, 'utf-8');
const output_js = `${cwd}/output/${generate}/${file}.js`;
@ -81,7 +81,7 @@ for (const generate of /** @type {const} */ (['client', 'server'])) {
}
for (const file of js_modules) {
const input = `${cwd}/input/${file}`;
const input = `${cwd}/src/${file}`;
const source = fs.readFileSync(input, 'utf-8');
const compiled = compileModule(source, {

View File

@ -13,5 +13,5 @@
"allowJs": true,
"checkJs": true
},
"include": ["./run.js", "./input"]
"include": ["./src", "ssr-dev.js", "ssr-prod.js"]
}

View File

@ -154,7 +154,7 @@ importers:
specifier: ^1.2.1
version: 1.6.0(@types/node@20.12.7)(jsdom@22.0.0)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
playgrounds/demo:
playgrounds/sandbox:
devDependencies:
'@sveltejs/vite-plugin-svelte':
specifier: ^4.0.0-next.3
@ -168,6 +168,9 @@ importers:
svelte:
specifier: workspace:*
version: link:../../packages/svelte
tiny-glob:
specifier: ^0.2.9
version: 0.2.9
vite:
specifier: ^5.0.13
version: 5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
@ -175,15 +178,6 @@ importers:
specifier: ^0.8.4
version: 0.8.4(rollup@4.9.5)(vite@5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))
playgrounds/sandbox:
dependencies:
svelte:
specifier: workspace:^
version: link:../../packages/svelte
tiny-glob:
specifier: ^0.2.9
version: 0.2.9
sites/svelte-5-preview:
dependencies:
'@codemirror/autocomplete':
@ -1151,9 +1145,6 @@ packages:
engines: {node: '>=16'}
hasBin: true
'@polka/url@1.0.0-next.24':
resolution: {integrity: sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==}
'@polka/url@1.0.0-next.25':
resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==}
@ -2896,10 +2887,6 @@ packages:
resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
engines: {node: '>=10'}
minimatch@9.0.4:
resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==}
engines: {node: '>=16 || 14 >=14.17'}
minimatch@9.0.5:
resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
engines: {node: '>=16 || 14 >=14.17'}
@ -3409,11 +3396,6 @@ packages:
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
hasBin: true
semver@7.5.4:
resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==}
engines: {node: '>=10'}
hasBin: true
semver@7.6.0:
resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==}
engines: {node: '>=10'}
@ -4496,7 +4478,7 @@ snapshots:
'@eslint/config-array@0.17.0':
dependencies:
'@eslint/object-schema': 2.1.4
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@ -4504,7 +4486,7 @@ snapshots:
'@eslint/eslintrc@3.1.0':
dependencies:
ajv: 6.12.6
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
espree: 10.1.0
globals: 14.0.0
ignore: 5.3.1
@ -4928,7 +4910,7 @@ snapshots:
nopt: 5.0.0
npmlog: 5.0.1
rimraf: 3.0.2
semver: 7.5.4
semver: 7.6.3
tar: 6.2.0
transitivePeerDependencies:
- encoding
@ -4962,8 +4944,6 @@ snapshots:
dependencies:
playwright: 1.41.1
'@polka/url@1.0.0-next.24': {}
'@polka/url@1.0.0-next.25': {}
'@replit/codemirror-lang-svelte@6.0.0(@codemirror/autocomplete@6.12.0(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.24.0)(@lezer/common@1.2.1))(@codemirror/lang-css@6.2.1(@codemirror/view@6.24.0))(@codemirror/lang-html@6.4.9)(@codemirror/lang-javascript@6.2.1)(@codemirror/language@6.10.1)(@codemirror/state@6.4.0)(@codemirror/view@6.24.0)(@lezer/common@1.2.1)(@lezer/highlight@1.2.0)(@lezer/javascript@1.4.15)(@lezer/lr@1.4.0)':
@ -5331,7 +5311,7 @@ snapshots:
'@sveltejs/vite-plugin-svelte-inspector@3.0.0-next.2(@sveltejs/vite-plugin-svelte@4.0.0-next.3(svelte@packages+svelte)(vite@5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)))(svelte@packages+svelte)(vite@5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))':
dependencies:
'@sveltejs/vite-plugin-svelte': 4.0.0-next.3(svelte@packages+svelte)(vite@5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0))
debug: 4.3.5
debug: 4.3.6(supports-color@5.5.0)
svelte: link:packages/svelte
vite: 5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
transitivePeerDependencies:
@ -5438,7 +5418,7 @@ snapshots:
'@typescript-eslint/types': 8.0.0-alpha.34
'@typescript-eslint/typescript-estree': 8.0.0-alpha.34(typescript@5.5.2)
'@typescript-eslint/visitor-keys': 8.0.0-alpha.34
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
eslint: 9.6.0
optionalDependencies:
typescript: 5.5.2
@ -5454,7 +5434,7 @@ snapshots:
dependencies:
'@typescript-eslint/typescript-estree': 8.0.0-alpha.34(typescript@5.5.2)
'@typescript-eslint/utils': 8.0.0-alpha.34(eslint@9.6.0)(typescript@5.5.2)
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
ts-api-utils: 1.3.0(typescript@5.5.2)
optionalDependencies:
typescript: 5.5.2
@ -5468,11 +5448,11 @@ snapshots:
dependencies:
'@typescript-eslint/types': 8.0.0-alpha.34
'@typescript-eslint/visitor-keys': 8.0.0-alpha.34
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.4
semver: 7.6.0
minimatch: 9.0.5
semver: 7.6.3
ts-api-utils: 1.3.0(typescript@5.5.2)
optionalDependencies:
typescript: 5.5.2
@ -5498,20 +5478,20 @@ snapshots:
'@typescript/twoslash@3.1.0':
dependencies:
'@typescript/vfs': 1.3.5
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
lz-string: 1.5.0
transitivePeerDependencies:
- supports-color
'@typescript/vfs@1.3.4':
dependencies:
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
transitivePeerDependencies:
- supports-color
'@typescript/vfs@1.3.5':
dependencies:
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
transitivePeerDependencies:
- supports-color
@ -5542,7 +5522,7 @@ snapshots:
dependencies:
'@ampproject/remapping': 2.2.1
'@bcoe/v8-coverage': 0.2.3
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.4
istanbul-lib-coverage: 3.2.2
istanbul-lib-report: 3.0.1
istanbul-lib-source-maps: 4.0.1
@ -5616,7 +5596,7 @@ snapshots:
agent-base@6.0.2:
dependencies:
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
transitivePeerDependencies:
- supports-color
@ -5892,19 +5872,19 @@ snapshots:
dataloader@1.4.0: {}
debug@4.3.4(supports-color@5.5.0):
debug@4.3.4:
dependencies:
ms: 2.1.2
optionalDependencies:
supports-color: 5.5.0
debug@4.3.5:
dependencies:
ms: 2.1.2
debug@4.3.6:
debug@4.3.6(supports-color@5.5.0):
dependencies:
ms: 2.1.2
optionalDependencies:
supports-color: 5.5.0
decimal.js@10.4.3: {}
@ -6062,7 +6042,7 @@ snapshots:
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@9.6.0)
'@jridgewell/sourcemap-codec': 1.5.0
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
eslint: 9.6.0
eslint-compat-utils: 0.5.1(eslint@9.6.0)
esutils: 2.0.3
@ -6106,7 +6086,7 @@ snapshots:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.4
escape-string-regexp: 4.0.0
eslint-scope: 8.0.1
eslint-visitor-keys: 4.0.0
@ -6395,14 +6375,14 @@ snapshots:
dependencies:
'@tootallnate/once': 2.0.0
agent-base: 6.0.2
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
transitivePeerDependencies:
- supports-color
https-proxy-agent@5.0.1:
dependencies:
agent-base: 6.0.2
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
transitivePeerDependencies:
- supports-color
@ -6539,7 +6519,7 @@ snapshots:
istanbul-lib-source-maps@4.0.1:
dependencies:
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
istanbul-lib-coverage: 3.2.2
source-map: 0.6.1
transitivePeerDependencies:
@ -6761,7 +6741,7 @@ snapshots:
make-dir@4.0.0:
dependencies:
semver: 7.5.4
semver: 7.6.3
marked@11.1.1: {}
@ -6804,10 +6784,6 @@ snapshots:
dependencies:
brace-expansion: 2.0.1
minimatch@9.0.4:
dependencies:
brace-expansion: 2.0.1
minimatch@9.0.5:
dependencies:
brace-expansion: 2.0.1
@ -6861,11 +6837,11 @@ snapshots:
nodemon@3.0.3:
dependencies:
chokidar: 3.5.3
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
ignore-by-default: 1.0.1
minimatch: 3.1.2
pstree.remy: 1.1.8
semver: 7.5.4
semver: 7.6.3
simple-update-notifier: 2.0.0
supports-color: 5.5.0
touch: 3.1.0
@ -7059,7 +7035,7 @@ snapshots:
polka@1.0.0-next.25:
dependencies:
'@polka/url': 1.0.0-next.24
'@polka/url': 1.0.0-next.25
trouter: 4.0.0
postcss-load-config@3.1.4(postcss@8.4.41):
@ -7281,10 +7257,6 @@ snapshots:
semver@6.3.1: {}
semver@7.5.4:
dependencies:
lru-cache: 6.0.0
semver@7.6.0:
dependencies:
lru-cache: 6.0.0
@ -7305,7 +7277,7 @@ snapshots:
dependencies:
color: 4.2.3
detect-libc: 2.0.2
semver: 7.5.4
semver: 7.6.3
optionalDependencies:
'@img/sharp-darwin-arm64': 0.33.2
'@img/sharp-darwin-x64': 0.33.2
@ -7380,7 +7352,7 @@ snapshots:
simple-update-notifier@2.0.0:
dependencies:
semver: 7.6.0
semver: 7.6.3
sirv@2.0.4:
dependencies:
@ -7728,7 +7700,7 @@ snapshots:
dependencies:
browserslist: 4.22.3
escalade: 3.1.1
picocolors: 1.0.0
picocolors: 1.0.1
uri-js@4.4.1:
dependencies:
@ -7763,7 +7735,7 @@ snapshots:
vite-node@1.6.0(@types/node@20.11.5)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0):
dependencies:
cac: 6.7.14
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
pathe: 1.1.2
picocolors: 1.0.1
vite: 5.0.13(@types/node@20.11.5)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
@ -7780,7 +7752,7 @@ snapshots:
vite-node@1.6.0(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0):
dependencies:
cac: 6.7.14
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
pathe: 1.1.2
picocolors: 1.0.1
vite: 5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
@ -7798,12 +7770,12 @@ snapshots:
dependencies:
'@antfu/utils': 0.7.8
'@rollup/pluginutils': 5.1.0(rollup@4.9.5)
debug: 4.3.4(supports-color@5.5.0)
debug: 4.3.6(supports-color@5.5.0)
error-stack-parser-es: 0.1.1
fs-extra: 11.2.0
open: 10.1.0
perfect-debounce: 1.0.0
picocolors: 1.0.0
picocolors: 1.0.1
sirv: 2.0.4
vite: 5.0.13(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)
transitivePeerDependencies:
@ -7851,7 +7823,7 @@ snapshots:
'@vitest/utils': 1.6.0
acorn-walk: 8.3.2
chai: 4.4.1
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
execa: 8.0.1
local-pkg: 0.5.0
magic-string: 0.30.11
@ -7885,7 +7857,7 @@ snapshots:
'@vitest/utils': 1.6.0
acorn-walk: 8.3.2
chai: 4.4.1
debug: 4.3.6
debug: 4.3.6(supports-color@5.5.0)
execa: 8.0.1
local-pkg: 0.5.0
magic-string: 0.30.11