From 2cfd0dff2689cdd7e5c10c028175390eea704f80 Mon Sep 17 00:00:00 2001 From: eryue0220 Date: Thu, 27 Aug 2026 15:50:37 +0800 Subject: [PATCH] fix bugs --- astro.config.mjs | 15 ++ eslint.config.mjs | 18 +- package.json | 8 +- pnpm-lock.yaml | 357 +++++++---------------------- src/components/CssPlayground.astro | 27 ++- src/layouts/PlaygroundLayout.astro | 17 +- src/lib/browser-env.ts | 5 + src/lib/monaco-env.ts | 1 + src/lib/playground-app.ts | 76 ++++-- src/lib/playground-process.ts | 63 +++-- src/lib/playgrounds.ts | 293 ++++++++--------------- src/pages/examples/default.astro | 2 +- src/pages/index.astro | 2 +- src/pages/playground/[id].astro | 12 +- src/styles/global.css | 92 ++------ 15 files changed, 387 insertions(+), 601 deletions(-) create mode 100644 src/lib/browser-env.ts diff --git a/astro.config.mjs b/astro.config.mjs index 940ceb1..40d0463 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,17 +1,32 @@ +import { fileURLToPath } from 'node:url'; import { defineConfig } from 'astro/config'; import tailwindcss from '@tailwindcss/vite'; +const sourceMapJs = fileURLToPath( + new URL('./node_modules/source-map-js/source-map.js', import.meta.url), +); + export default defineConfig({ output: 'static', site: 'https://postcss-go.github.io', base: '/', vite: { plugins: [tailwindcss()], + resolve: { + alias: [ + { + find: /^source-map-js$/, + replacement: sourceMapJs, + }, + ], + }, worker: { format: 'es', }, assetsInclude: ['**/*.wasm'], optimizeDeps: { + include: ['source-map-js', 'postcss', 'autoprefixer', 'postcss-nested'], + needsInterop: ['source-map-js'], exclude: ['@postcss-go/core'], }, build: { diff --git a/eslint.config.mjs b/eslint.config.mjs index 83ab8fb..39c50f4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,12 +1,24 @@ import js from '@eslint/js'; import eslintConfigPrettier from 'eslint-config-prettier'; import astro from 'eslint-plugin-astro'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; -export default [ +export default tseslint.config( { ignores: ['dist/**', '.astro/**', 'node_modules/**'], }, - js.configs.recommended, ...astro.configs['flat/recommended'], + { + ...js.configs.recommended, + files: ['**/*.{js,mjs,cjs}'], + languageOptions: { + globals: globals.node, + }, + }, + ...tseslint.configs.recommended.map((config) => ({ + ...config, + files: ['**/*.{ts,tsx,mts,cts}'], + })), eslintConfigPrettier, -]; +); diff --git a/package.json b/package.json index b3a2982..a6b6f88 100644 --- a/package.json +++ b/package.json @@ -25,25 +25,27 @@ "*.{json,md,yml,yaml,css}": "prettier --write" }, "dependencies": { - "@postcss-go/core": "^0.0.1", + "@postcss-go/core": "^0.0.3", "@tailwindcss/vite": "^4.3.3", "astro": "^7.2.4", "autoprefixer": "^10.5.4", "monaco-editor": "^0.56.0", "postcss": "^8.5.26", - "postcss-nested": "^8.0.1" + "postcss-nested": "^8.0.1", + "source-map-js": "1.2.1" }, "devDependencies": { "@eslint/js": "^10.0.1", "eslint": "^10.9.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-astro": "^3.1.0", + "globals": "^17.11.0", "husky": "^9.1.7", "lint-staged": "^17.3.0", "prettier": "^3.8.4", "prettier-plugin-astro": "^0.14.1", "tailwindcss": "^4.3.3", - "typescript": "^7.0.2", + "typescript": "^6.0.3", "typescript-eslint": "^8.61.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eee2b29..0bda979 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@postcss-go/core': - specifier: ^0.0.1 - version: 0.0.1 + specifier: ^0.0.3 + version: 0.0.3 '@tailwindcss/vite': specifier: ^4.3.3 version: 4.3.3(vite@8.2.2(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.0)) @@ -29,6 +29,9 @@ importers: postcss-nested: specifier: ^8.0.1 version: 8.0.1(postcss@8.5.26) + source-map-js: + specifier: 1.2.1 + version: 1.2.1 devDependencies: '@eslint/js': specifier: ^10.0.1 @@ -41,7 +44,10 @@ importers: version: 10.1.8(eslint@10.9.0(jiti@2.7.0)) eslint-plugin-astro: specifier: ^3.1.0 - version: 3.1.0(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2))(eslint@10.9.0(jiti@2.7.0))(typescript-eslint@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2)) + version: 3.1.0(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.9.0(jiti@2.7.0))(typescript-eslint@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3)) + globals: + specifier: ^17.11.0 + version: 17.11.0 husky: specifier: ^9.1.7 version: 9.1.7 @@ -58,11 +64,11 @@ importers: specifier: ^4.3.3 version: 4.3.3 typescript: - specifier: ^7.0.2 - version: 7.0.2 + specifier: ^6.0.3 + version: 6.0.3 typescript-eslint: specifier: ^8.61.0 - version: 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) + version: 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) packages: @@ -681,38 +687,38 @@ packages: '@oxc-project/types@0.147.0': resolution: {integrity: sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==} - '@postcss-go/core@0.0.1': - resolution: {integrity: sha512-ruprOBNp8yo9DHaZmf1d7+qMKr6Ofp64JPliWawLGZGn0KQrSs8r5Ovb4NqWm5zc97UayAKsppGDWQ/C/RDp5g==} + '@postcss-go/core@0.0.3': + resolution: {integrity: sha512-7WqKAPdi5j7JYAPoPhySmlEZkyHNskKweOVnS2GDq+I3qpd0294QN54p2tBrZUu5c6kr9LopCED8LWiNYEGbhQ==} engines: {node: '>=18'} hasBin: true - '@postcss-go/native-darwin-arm64@0.0.1': - resolution: {integrity: sha512-OQALbux4tEr1n7dRPKumQ4QfBNmK/kEWUbRLRJaRZXy9x1ezBCJ0Yj8ZACzE5KG0pFgKKmNzsBPDUjC49lgKmw==} + '@postcss-go/native-darwin-arm64@0.0.3': + resolution: {integrity: sha512-k+BFg5qd+zQOqNiix2gn47L0WNwlnBVMmaeLbTd0W+uDn2bAyQZ2iXDChBP0hWTxE2BRcwrjE/rmKXaVNPzRmA==} cpu: [arm64] os: [darwin] - '@postcss-go/native-darwin-x64@0.0.1': - resolution: {integrity: sha512-QMp0FvJ48FFPLXaou8Ngp5h3HrINN+VRBHFR9quFOC+tKEreSR7vylsXRq1Sg1oDR040bZv7mA9+CWp3i3nhlQ==} + '@postcss-go/native-darwin-x64@0.0.3': + resolution: {integrity: sha512-PmMOebiU9/n0Uxv5xEedDpggR6yI6DX7vmxl9gbL4/xCSwOoU1EWeSom/x5DoAskw8PCrvtv+siSOB6LBhA5ow==} cpu: [x64] os: [darwin] - '@postcss-go/native-linux-arm64-gnu@0.0.1': - resolution: {integrity: sha512-QgaLCSVcBNe/Z/KA6X94vCsvApF+d9v8yNJFcINy1uqZ3jcN6XxKL9GbVhfYSeGjBzfx1rMTsv51l8VHqrxuvg==} + '@postcss-go/native-linux-arm64-gnu@0.0.3': + resolution: {integrity: sha512-AodLmgdyOBgOpuYIJRT0L5VafWdEHzBt0NylxDmNXSuNZ40IX1jG62Ut65DHLzSQpWnnVtpZ/YaIf70reyLchg==} cpu: [arm64] os: [linux] - '@postcss-go/native-linux-x64-gnu@0.0.1': - resolution: {integrity: sha512-aadqh6WjOgzyy+UA7g/H8NbImS168r/Xr11TAuzQcgMb3OO72UzN/HdkMt4HcsrbQKMOsgI8YKjlcORN3wdS0g==} + '@postcss-go/native-linux-x64-gnu@0.0.3': + resolution: {integrity: sha512-3o/lZtWKofM8mMifgOdAlIDHjaelSNsO7MxVpNWDIkpNdvbzx14ylCaJUynD5+gsPLiqqjjIn9ug6+XtEnWCzw==} cpu: [x64] os: [linux] - '@postcss-go/native-win32-arm64-msvc@0.0.1': - resolution: {integrity: sha512-BjGwIy8BgEKC6Lhp0/IVPOWa/r6ccnM6hTaD1dJeA6tLx7xm7W/gDkEOaKohFqCMXF/lNAW+B5uXPgg5W/dQkQ==} + '@postcss-go/native-win32-arm64-msvc@0.0.3': + resolution: {integrity: sha512-A2fgzcW+5y9va3bW0bGLBLvs+/dccs1X3TfIv+/qr+JXTmc4FpRwcPSvIiOMtdm+TpzhOjHhjxUdSQZPvkepaw==} cpu: [arm64] os: [win32] - '@postcss-go/native-win32-x64-msvc@0.0.1': - resolution: {integrity: sha512-sXTETqxi+6YRhaimZtPGvR3sDYLdAB9Mpj+SSzHrBPu8e15zExfWjZBHUAjzHr5j8YTLnw+UndgyP/fIB4Nclg==} + '@postcss-go/native-win32-x64-msvc@0.0.3': + resolution: {integrity: sha512-2BFlKTtQVqPqs5lQiwzbVpJ+AKapCnTxkofQ06tnwseOCS17e/j/JSjUJ9AU8UKQMyNY6rhfblTMvsLufROBGw==} cpu: [x64] os: [win32] @@ -1019,126 +1025,6 @@ packages: resolution: {integrity: sha512-fkv8dHRDqfGtTHuJeebdrQ7cX6Ad4WAS00rgHh9UGvMycF1mjBfsxry1XsLIFhWZ6Judlh6UdzK+TYlbpCXgnA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript/typescript-aix-ppc64@7.0.2': - resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} - engines: {node: '>=16.20.0'} - cpu: [ppc64] - os: [aix] - - '@typescript/typescript-darwin-arm64@7.0.2': - resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [darwin] - - '@typescript/typescript-darwin-x64@7.0.2': - resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [darwin] - - '@typescript/typescript-freebsd-arm64@7.0.2': - resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [freebsd] - - '@typescript/typescript-freebsd-x64@7.0.2': - resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [freebsd] - - '@typescript/typescript-linux-arm64@7.0.2': - resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [linux] - - '@typescript/typescript-linux-arm@7.0.2': - resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} - engines: {node: '>=16.20.0'} - cpu: [arm] - os: [linux] - - '@typescript/typescript-linux-loong64@7.0.2': - resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} - engines: {node: '>=16.20.0'} - cpu: [loong64] - os: [linux] - - '@typescript/typescript-linux-mips64el@7.0.2': - resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} - engines: {node: '>=16.20.0'} - cpu: [mips64el] - os: [linux] - - '@typescript/typescript-linux-ppc64@7.0.2': - resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} - engines: {node: '>=16.20.0'} - cpu: [ppc64] - os: [linux] - - '@typescript/typescript-linux-riscv64@7.0.2': - resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} - engines: {node: '>=16.20.0'} - cpu: [riscv64] - os: [linux] - - '@typescript/typescript-linux-s390x@7.0.2': - resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} - engines: {node: '>=16.20.0'} - cpu: [s390x] - os: [linux] - - '@typescript/typescript-linux-x64@7.0.2': - resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [linux] - - '@typescript/typescript-netbsd-arm64@7.0.2': - resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [netbsd] - - '@typescript/typescript-netbsd-x64@7.0.2': - resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [netbsd] - - '@typescript/typescript-openbsd-arm64@7.0.2': - resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [openbsd] - - '@typescript/typescript-openbsd-x64@7.0.2': - resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [openbsd] - - '@typescript/typescript-sunos-x64@7.0.2': - resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [sunos] - - '@typescript/typescript-win32-arm64@7.0.2': - resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [win32] - - '@typescript/typescript-win32-x64@7.0.2': - resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [win32] - '@ungap/structured-clone@1.3.4': resolution: {integrity: sha512-JL+CF0GeLHyPWI0rXu7UnxgiuOm9UQWzadi0OYOJNhNO2q6EZElpwlgXkNkfU1PzANDHq3YcwKVZprdvS+BrbQ==} @@ -2189,9 +2075,9 @@ packages: eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 typescript: '>=4.8.4 <6.1.0' - typescript@7.0.2: - resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} - engines: {node: '>=16.20.0'} + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + engines: {node: '>=14.17'} hasBin: true ufo@1.6.4: @@ -2881,7 +2767,7 @@ snapshots: '@oxc-project/types@0.147.0': {} - '@postcss-go/core@0.0.1': + '@postcss-go/core@0.0.3': dependencies: chokidar: 3.6.0 dependency-graph: 1.0.0 @@ -2892,29 +2778,29 @@ snapshots: source-map-js: 1.2.1 tinyglobby: 0.2.17 optionalDependencies: - '@postcss-go/native-darwin-arm64': 0.0.1 - '@postcss-go/native-darwin-x64': 0.0.1 - '@postcss-go/native-linux-arm64-gnu': 0.0.1 - '@postcss-go/native-linux-x64-gnu': 0.0.1 - '@postcss-go/native-win32-arm64-msvc': 0.0.1 - '@postcss-go/native-win32-x64-msvc': 0.0.1 + '@postcss-go/native-darwin-arm64': 0.0.3 + '@postcss-go/native-darwin-x64': 0.0.3 + '@postcss-go/native-linux-arm64-gnu': 0.0.3 + '@postcss-go/native-linux-x64-gnu': 0.0.3 + '@postcss-go/native-win32-arm64-msvc': 0.0.3 + '@postcss-go/native-win32-x64-msvc': 0.0.3 - '@postcss-go/native-darwin-arm64@0.0.1': + '@postcss-go/native-darwin-arm64@0.0.3': optional: true - '@postcss-go/native-darwin-x64@0.0.1': + '@postcss-go/native-darwin-x64@0.0.3': optional: true - '@postcss-go/native-linux-arm64-gnu@0.0.1': + '@postcss-go/native-linux-arm64-gnu@0.0.3': optional: true - '@postcss-go/native-linux-x64-gnu@0.0.1': + '@postcss-go/native-linux-x64-gnu@0.0.3': optional: true - '@postcss-go/native-win32-arm64-msvc@0.0.1': + '@postcss-go/native-win32-arm64-msvc@0.0.3': optional: true - '@postcss-go/native-win32-x64-msvc@0.0.1': + '@postcss-go/native-win32-x64-msvc@0.0.3': optional: true '@rolldown/binding-android-arm-eabi@1.2.6': @@ -3104,40 +2990,40 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2))(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2)': + '@typescript-eslint/eslint-plugin@8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) + '@typescript-eslint/parser': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) '@typescript-eslint/scope-manager': 8.67.0 - '@typescript-eslint/type-utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) - '@typescript-eslint/utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) + '@typescript-eslint/type-utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.67.0 eslint: 10.9.0(jiti@2.7.0) ignore: 7.0.6 natural-compare: 1.4.0 - ts-api-utils: 2.5.0(typescript@7.0.2) - typescript: 7.0.2 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2)': + '@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: '@typescript-eslint/scope-manager': 8.67.0 '@typescript-eslint/types': 8.67.0 - '@typescript-eslint/typescript-estree': 8.67.0(typescript@7.0.2) + '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.67.0 debug: 4.4.3 eslint: 10.9.0(jiti@2.7.0) - typescript: 7.0.2 + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.67.0(typescript@7.0.2)': + '@typescript-eslint/project-service@8.67.0(typescript@6.0.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.67.0(typescript@7.0.2) + '@typescript-eslint/tsconfig-utils': 8.67.0(typescript@6.0.3) '@typescript-eslint/types': 8.67.0 debug: 4.4.3 - typescript: 7.0.2 + typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -3146,47 +3032,47 @@ snapshots: '@typescript-eslint/types': 8.67.0 '@typescript-eslint/visitor-keys': 8.67.0 - '@typescript-eslint/tsconfig-utils@8.67.0(typescript@7.0.2)': + '@typescript-eslint/tsconfig-utils@8.67.0(typescript@6.0.3)': dependencies: - typescript: 7.0.2 + typescript: 6.0.3 - '@typescript-eslint/type-utils@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2)': + '@typescript-eslint/type-utils@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: '@typescript-eslint/types': 8.67.0 - '@typescript-eslint/typescript-estree': 8.67.0(typescript@7.0.2) - '@typescript-eslint/utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) + '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) + '@typescript-eslint/utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) debug: 4.4.3 eslint: 10.9.0(jiti@2.7.0) - ts-api-utils: 2.5.0(typescript@7.0.2) - typescript: 7.0.2 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 transitivePeerDependencies: - supports-color '@typescript-eslint/types@8.67.0': {} - '@typescript-eslint/typescript-estree@8.67.0(typescript@7.0.2)': + '@typescript-eslint/typescript-estree@8.67.0(typescript@6.0.3)': dependencies: - '@typescript-eslint/project-service': 8.67.0(typescript@7.0.2) - '@typescript-eslint/tsconfig-utils': 8.67.0(typescript@7.0.2) + '@typescript-eslint/project-service': 8.67.0(typescript@6.0.3) + '@typescript-eslint/tsconfig-utils': 8.67.0(typescript@6.0.3) '@typescript-eslint/types': 8.67.0 '@typescript-eslint/visitor-keys': 8.67.0 debug: 4.4.3 minimatch: 10.2.6 semver: 7.8.5 tinyglobby: 0.2.17 - ts-api-utils: 2.5.0(typescript@7.0.2) - typescript: 7.0.2 + ts-api-utils: 2.5.0(typescript@6.0.3) + typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2)': + '@typescript-eslint/utils@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3)': dependencies: '@eslint-community/eslint-utils': 4.10.1(eslint@10.9.0(jiti@2.7.0)) '@typescript-eslint/scope-manager': 8.67.0 '@typescript-eslint/types': 8.67.0 - '@typescript-eslint/typescript-estree': 8.67.0(typescript@7.0.2) + '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) eslint: 10.9.0(jiti@2.7.0) - typescript: 7.0.2 + typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -3195,66 +3081,6 @@ snapshots: '@typescript-eslint/types': 8.67.0 eslint-visitor-keys: 5.0.1 - '@typescript/typescript-aix-ppc64@7.0.2': - optional: true - - '@typescript/typescript-darwin-arm64@7.0.2': - optional: true - - '@typescript/typescript-darwin-x64@7.0.2': - optional: true - - '@typescript/typescript-freebsd-arm64@7.0.2': - optional: true - - '@typescript/typescript-freebsd-x64@7.0.2': - optional: true - - '@typescript/typescript-linux-arm64@7.0.2': - optional: true - - '@typescript/typescript-linux-arm@7.0.2': - optional: true - - '@typescript/typescript-linux-loong64@7.0.2': - optional: true - - '@typescript/typescript-linux-mips64el@7.0.2': - optional: true - - '@typescript/typescript-linux-ppc64@7.0.2': - optional: true - - '@typescript/typescript-linux-riscv64@7.0.2': - optional: true - - '@typescript/typescript-linux-s390x@7.0.2': - optional: true - - '@typescript/typescript-linux-x64@7.0.2': - optional: true - - '@typescript/typescript-netbsd-arm64@7.0.2': - optional: true - - '@typescript/typescript-netbsd-x64@7.0.2': - optional: true - - '@typescript/typescript-openbsd-arm64@7.0.2': - optional: true - - '@typescript/typescript-openbsd-x64@7.0.2': - optional: true - - '@typescript/typescript-sunos-x64@7.0.2': - optional: true - - '@typescript/typescript-win32-arm64@7.0.2': - optional: true - - '@typescript/typescript-win32-x64@7.0.2': - optional: true - '@ungap/structured-clone@1.3.4': {} acorn-jsx@5.3.2(acorn@8.18.0): @@ -3614,7 +3440,7 @@ snapshots: dependencies: eslint: 10.9.0(jiti@2.7.0) - eslint-plugin-astro@3.1.0(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2))(eslint@10.9.0(jiti@2.7.0))(typescript-eslint@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2)): + eslint-plugin-astro@3.1.0(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.9.0(jiti@2.7.0))(typescript-eslint@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3)): dependencies: '@eslint-community/eslint-utils': 4.10.1(eslint@10.9.0(jiti@2.7.0)) '@jridgewell/sourcemap-codec': 1.5.5 @@ -3626,8 +3452,8 @@ snapshots: postcss: 8.5.26 postcss-selector-parser: 7.1.5 optionalDependencies: - '@typescript-eslint/parser': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) - typescript-eslint: 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) + '@typescript-eslint/parser': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) + typescript-eslint: 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) transitivePeerDependencies: - '@emnapi/core' - '@emnapi/runtime' @@ -4353,9 +4179,9 @@ snapshots: trough@2.2.0: {} - ts-api-utils@2.5.0(typescript@7.0.2): + ts-api-utils@2.5.0(typescript@6.0.3): dependencies: - typescript: 7.0.2 + typescript: 6.0.3 tslib@2.8.1: optional: true @@ -4364,39 +4190,18 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2): + typescript-eslint@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2))(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) - '@typescript-eslint/parser': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) - '@typescript-eslint/typescript-estree': 8.67.0(typescript@7.0.2) - '@typescript-eslint/utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@7.0.2) + '@typescript-eslint/eslint-plugin': 8.67.0(@typescript-eslint/parser@8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3))(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/parser': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.67.0(typescript@6.0.3) + '@typescript-eslint/utils': 8.67.0(eslint@10.9.0(jiti@2.7.0))(typescript@6.0.3) eslint: 10.9.0(jiti@2.7.0) - typescript: 7.0.2 + typescript: 6.0.3 transitivePeerDependencies: - supports-color - typescript@7.0.2: - optionalDependencies: - '@typescript/typescript-aix-ppc64': 7.0.2 - '@typescript/typescript-darwin-arm64': 7.0.2 - '@typescript/typescript-darwin-x64': 7.0.2 - '@typescript/typescript-freebsd-arm64': 7.0.2 - '@typescript/typescript-freebsd-x64': 7.0.2 - '@typescript/typescript-linux-arm': 7.0.2 - '@typescript/typescript-linux-arm64': 7.0.2 - '@typescript/typescript-linux-loong64': 7.0.2 - '@typescript/typescript-linux-mips64el': 7.0.2 - '@typescript/typescript-linux-ppc64': 7.0.2 - '@typescript/typescript-linux-riscv64': 7.0.2 - '@typescript/typescript-linux-s390x': 7.0.2 - '@typescript/typescript-linux-x64': 7.0.2 - '@typescript/typescript-netbsd-arm64': 7.0.2 - '@typescript/typescript-netbsd-x64': 7.0.2 - '@typescript/typescript-openbsd-arm64': 7.0.2 - '@typescript/typescript-openbsd-x64': 7.0.2 - '@typescript/typescript-sunos-x64': 7.0.2 - '@typescript/typescript-win32-arm64': 7.0.2 - '@typescript/typescript-win32-x64': 7.0.2 + typescript@6.0.3: {} ufo@1.6.4: {} diff --git a/src/components/CssPlayground.astro b/src/components/CssPlayground.astro index c6ff51a..4c125e4 100644 --- a/src/components/CssPlayground.astro +++ b/src/components/CssPlayground.astro @@ -1,11 +1,15 @@ --- +import { playgroundPreset } from '../lib/playgrounds'; + interface Props { id: string; nested?: boolean; autoprefixer?: boolean; } -const { id, nested = true, autoprefixer = true } = Astro.props; +const { id, nested = true, autoprefixer = false } = Astro.props; +const { files } = playgroundPreset(id); +const inputFile = files.find((file) => file.input) ?? files[0]!; ---
@@ -28,7 +32,26 @@ const { id, nested = true, autoprefixer = true } = Astro.props;
-
Input
+
+
+ { + files.map((file) => ( + + )) + } +
+
diff --git a/src/layouts/PlaygroundLayout.astro b/src/layouts/PlaygroundLayout.astro index 25850af..a05b914 100644 --- a/src/layouts/PlaygroundLayout.astro +++ b/src/layouts/PlaygroundLayout.astro @@ -15,16 +15,21 @@ const base = import.meta.env.BASE_URL; const groups = playgroundGroups(base); --- - + - +
-
-