diff --git a/.vscode/launch.json b/.vscode/launch.json index fc593c0d06..142965ada2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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"] - } ] } diff --git a/playgrounds/demo/.gitignore b/playgrounds/demo/.gitignore deleted file mode 100644 index 3653d28870..0000000000 --- a/playgrounds/demo/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -src/* -dist/client/* -dist/server/* -!src/entry-client.ts -!src/entry-server.ts diff --git a/playgrounds/demo/package.json b/playgrounds/demo/package.json deleted file mode 100644 index 6d2414b515..0000000000 --- a/playgrounds/demo/package.json +++ /dev/null @@ -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" - } -} diff --git a/playgrounds/demo/tsconfig.json b/playgrounds/demo/tsconfig.json deleted file mode 100644 index a1566560bf..0000000000 --- a/playgrounds/demo/tsconfig.json +++ /dev/null @@ -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"] -} diff --git a/playgrounds/sandbox/.gitignore b/playgrounds/sandbox/.gitignore index f19dc155fd..5f15d95116 100644 --- a/playgrounds/sandbox/.gitignore +++ b/playgrounds/sandbox/.gitignore @@ -1,3 +1,4 @@ -input/* -output/* -!.gitkeep \ No newline at end of file +/dist/client/* +/dist/server/* +/output +/src/* diff --git a/playgrounds/sandbox/.prettierignore b/playgrounds/sandbox/.prettierignore deleted file mode 100644 index d26c5ef7f9..0000000000 --- a/playgrounds/sandbox/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -input/**.svelte -output diff --git a/playgrounds/demo/demo.css b/playgrounds/sandbox/demo.css similarity index 100% rename from playgrounds/demo/demo.css rename to playgrounds/sandbox/demo.css diff --git a/playgrounds/demo/favicon.png b/playgrounds/sandbox/favicon.png similarity index 100% rename from playgrounds/demo/favicon.png rename to playgrounds/sandbox/favicon.png diff --git a/playgrounds/demo/index.html b/playgrounds/sandbox/index.html similarity index 100% rename from playgrounds/demo/index.html rename to playgrounds/sandbox/index.html diff --git a/playgrounds/sandbox/input/.gitkeep b/playgrounds/sandbox/input/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/playgrounds/sandbox/package.json b/playgrounds/sandbox/package.json index df9c58e530..590ca1e85b 100644 --- a/playgrounds/sandbox/package.json +++ b/playgrounds/sandbox/package.json @@ -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" } } diff --git a/playgrounds/sandbox/run.js b/playgrounds/sandbox/run.js index 9c48a6c97b..4531e7182d 100644 --- a/playgrounds/sandbox/run.js +++ b/playgrounds/sandbox/run.js @@ -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, { diff --git a/playgrounds/demo/scripts/create-app-svelte.js b/playgrounds/sandbox/scripts/create-app-svelte.js similarity index 100% rename from playgrounds/demo/scripts/create-app-svelte.js rename to playgrounds/sandbox/scripts/create-app-svelte.js diff --git a/playgrounds/demo/scripts/main.template.svelte b/playgrounds/sandbox/scripts/main.template.svelte similarity index 100% rename from playgrounds/demo/scripts/main.template.svelte rename to playgrounds/sandbox/scripts/main.template.svelte diff --git a/playgrounds/demo/ssr-dev.js b/playgrounds/sandbox/ssr-dev.js similarity index 100% rename from playgrounds/demo/ssr-dev.js rename to playgrounds/sandbox/ssr-dev.js diff --git a/playgrounds/demo/ssr-prod.js b/playgrounds/sandbox/ssr-prod.js similarity index 100% rename from playgrounds/demo/ssr-prod.js rename to playgrounds/sandbox/ssr-prod.js diff --git a/playgrounds/sandbox/tsconfig.json b/playgrounds/sandbox/tsconfig.json index 8aa4b6f1e9..a1566560bf 100644 --- a/playgrounds/sandbox/tsconfig.json +++ b/playgrounds/sandbox/tsconfig.json @@ -13,5 +13,5 @@ "allowJs": true, "checkJs": true }, - "include": ["./run.js", "./input"] + "include": ["./src", "ssr-dev.js", "ssr-prod.js"] } diff --git a/playgrounds/demo/vite.config.js b/playgrounds/sandbox/vite.config.js similarity index 100% rename from playgrounds/demo/vite.config.js rename to playgrounds/sandbox/vite.config.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c9ed8ad2f8..5020a2a9b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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