diff --git a/.github/workflows/release-components.yaml b/.github/workflows/release-components.yaml index cb9829a2be3..3fe6aca47c2 100644 --- a/.github/workflows/release-components.yaml +++ b/.github/workflows/release-components.yaml @@ -57,6 +57,14 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - if: steps.checkConfigVersion.outputs.changed == 'true' run: cd config && pnpm publish --no-git-checks --access public + - id: checkConfigHelperNextjsVersion + uses: EndBug/version-check@v2.1.1 + with: + diff-search: true + file-name: ./config-helpers/nextjs/package.json + token: ${{ secrets.GITHUB_TOKEN }} + - if: steps.checkConfigHelperNextjsVersion.outputs.changed == 'true' + run: cd config-helpers/nextjs && pnpm publish --no-git-checks --access public - id: checkCoreVersion uses: EndBug/version-check@v2.1.1 with: diff --git a/.github/workflows/test-app-e2e.yaml b/.github/workflows/test-app-e2e.yaml index 97942430699..58022453fd9 100644 --- a/.github/workflows/test-app-e2e.yaml +++ b/.github/workflows/test-app-e2e.yaml @@ -68,9 +68,11 @@ jobs: - uses: pnpm/action-setup@v2.2.4 with: run_install: true - - run: pnpm turbo run build --scope="@previewjs/e2e-test-runner" --include-dependencies + - run: pnpm turbo run build + env: + SKIP_PREFLIGHT_CHECK: "true" - run: pnpm install # necessary to link e2e-test-runner - - run: pnpm turbo run e2e-test --scope="@previewjs/app" --include-dependencies + - run: pnpm turbo run e2e-test env: GROUP_INDEX: ${{ matrix.group }} GROUP_COUNT: 3 diff --git a/.gitignore b/.gitignore index 16ac766a759..acfeebc1c31 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ pro *.vsix .idea .DS_Store +.svelte-kit .turbo .pnpm-debug.log yarn-debug.log diff --git a/app/tests/__screenshots__/linux/nextjs-11.png b/app/tests/__screenshots__/linux/nextjs-11.png index 23a29bc6604..4686f710ab3 100644 Binary files a/app/tests/__screenshots__/linux/nextjs-11.png and b/app/tests/__screenshots__/linux/nextjs-11.png differ diff --git a/app/tests/__screenshots__/linux/nextjs-12.png b/app/tests/__screenshots__/linux/nextjs-12.png index 23a29bc6604..4686f710ab3 100644 Binary files a/app/tests/__screenshots__/linux/nextjs-12.png and b/app/tests/__screenshots__/linux/nextjs-12.png differ diff --git a/app/tests/smoke-tests.spec.ts b/app/tests/smoke-tests.spec.ts index a8d3e0b83f8..52d3d2d895f 100644 --- a/app/tests/smoke-tests.spec.ts +++ b/app/tests/smoke-tests.spec.ts @@ -76,7 +76,7 @@ export const smokeTests = fs await controller.props.editor.isReady(); } await controller.takeScreenshot( - "#ready", + iframe, path.join( __dirname, "..", @@ -86,6 +86,7 @@ export const smokeTests = fs `${appName}.png` ) ); + console.error("E"); } ); }, diff --git a/config-helpers/nextjs/LICENSE b/config-helpers/nextjs/LICENSE new file mode 100644 index 00000000000..091d863c2a4 --- /dev/null +++ b/config-helpers/nextjs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Zenc Labs Pty Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/config-helpers/nextjs/build.config.ts b/config-helpers/nextjs/build.config.ts new file mode 100644 index 00000000000..ca8ae49332d --- /dev/null +++ b/config-helpers/nextjs/build.config.ts @@ -0,0 +1,8 @@ +export default { + entries: ["./src/index"], + rollup: { + emitCJS: true, + }, + declaration: true, + clean: true, +}; diff --git a/config-helpers/nextjs/package.json b/config-helpers/nextjs/package.json new file mode 100644 index 00000000000..41afb863533 --- /dev/null +++ b/config-helpers/nextjs/package.json @@ -0,0 +1,41 @@ +{ + "name": "@previewjs/config-helper-nextjs", + "version": "0.0.1", + "license": "MIT", + "author": { + "name": "François Wouts", + "email": "f@zenc.io" + }, + "repository": { + "type": "git", + "url": "https://github.com/fwouts/previewjs" + }, + "bugs": { + "url": "https://github.com/fwouts/previewjs/issues" + }, + "homepage": "https://previewjs.com", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.cjs", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } + }, + "scripts": { + "prepublish": "cd .. && pnpm turbo run build --scope=@previewjs/config-helper-nextjs --no-deps --include-dependencies", + "build": "tsc && unbuild" + }, + "devDependencies": { + "@types/react": "18.0.24", + "next": "13.0.0", + "react": "18.2.0", + "unbuild": "0.9.1" + }, + "peerDependencies": { + "next": "*", + "react": "*" + } +} diff --git a/config-helpers/nextjs/src/index.tsx b/config-helpers/nextjs/src/index.tsx new file mode 100644 index 00000000000..43c68c9511e --- /dev/null +++ b/config-helpers/nextjs/src/index.tsx @@ -0,0 +1,55 @@ +import * as NextImage from "next/image"; +import * as NextRouter from "next/router"; +import React from "react"; + +const OriginalNextImage = NextImage.default; + +// Patch Image to disable optimisations within Preview.js. +Object.defineProperty(NextImage, "default", { + configurable: true, + value: (props: NextImage.ImageProps) => ( + + ), +}); + +// Patch useRouter() to fake the router within Preview.js. +Object.defineProperty(NextRouter, "useRouter", { + configurable: true, + value: () => ({ + locale: "en-US", + route: "/", + pathname: "/", + query: {}, + asPath: "/", + push() { + return Promise.resolve(true); + }, + replace() { + return Promise.resolve(true); + }, + reload() { + // Do nothing. + }, + back() { + // Do nothing. + }, + prefetch() { + return Promise.resolve(); + }, + beforePopState() { + // Do nothing. + }, + events: { + on() { + // Do nothing. + }, + off() { + // Do nothing. + }, + emit() { + // Do nothing. + }, + }, + isFallback: false, + }), +}); diff --git a/config-helpers/nextjs/tsconfig.json b/config-helpers/nextjs/tsconfig.json new file mode 100644 index 00000000000..58959bc25c8 --- /dev/null +++ b/config-helpers/nextjs/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "ES2020", + "moduleResolution": "node", + "rootDir": "src", + "outDir": "dist", + "esModuleInterop": true, + "jsx": "react" + }, + "include": ["src"] +} diff --git a/e2e-test-runner/src/helpers/app-controller.ts b/e2e-test-runner/src/helpers/app-controller.ts index 6e68be07823..4fb20052f8d 100644 --- a/e2e-test-runner/src/helpers/app-controller.ts +++ b/e2e-test-runner/src/helpers/app-controller.ts @@ -127,9 +127,7 @@ export class AppController { } } - async takeScreenshot(waitForSelector: string, destinationPath: string) { - const preview = await this.previewIframe(); - await preview.waitForSelector(waitForSelector); + async takeScreenshot(preview: playwright.Frame, destinationPath: string) { preview.addStyleTag({ content: ` *, @@ -154,10 +152,18 @@ export class AppController { if (img.complete) { return; } - return new Promise((resolve) => { - img.addEventListener("load", resolve); - // If an image fails to load, ignore it. - img.addEventListener("error", resolve); + return new Promise((resolve) => { + const observer = new IntersectionObserver((entries) => { + if (entries[0]?.isIntersecting) { + img.addEventListener("load", resolve); + // If an image fails to load, ignore it. + img.addEventListener("error", resolve); + } else { + resolve(null); + } + observer.unobserve(img); + }); + observer.observe(img); }); }) ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 03050611368..23d60f57822 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -187,6 +187,18 @@ importers: unbuild: 0.9.1 vite: 3.2.1 + config-helpers/nextjs: + specifiers: + '@types/react': 18.0.24 + next: 13.0.0 + react: 18.2.0 + unbuild: 0.9.1 + devDependencies: + '@types/react': 18.0.24 + next: 13.0.0_qtpcxnaaarbm4ws7ughq6oxfve + react: 18.2.0 + unbuild: 0.9.1 + core: specifiers: '@previewjs/api': ^4.0.1 @@ -1283,6 +1295,7 @@ importers: smoke-test-apps/nextjs-11: specifiers: '@babel/core': ^7 + '@previewjs/config-helper-nextjs': workspace:* '@types/react': ^17 next: ^11 react: ^17 @@ -1294,12 +1307,14 @@ importers: react-dom: 17.0.2_react@17.0.2 devDependencies: '@babel/core': 7.18.10 + '@previewjs/config-helper-nextjs': link:../../config-helpers/nextjs '@types/react': 17.0.48 typescript: 4.7.4 smoke-test-apps/nextjs-12: specifiers: '@babel/core': ^7 + '@previewjs/config-helper-nextjs': workspace:* '@types/react': ^17 next: ^12 react: ^17 @@ -1311,6 +1326,7 @@ importers: react-dom: 17.0.2_react@17.0.2 devDependencies: '@babel/core': 7.18.10 + '@previewjs/config-helper-nextjs': link:../../config-helpers/nextjs '@types/react': 17.0.48 typescript: 4.7.4 @@ -7181,6 +7197,10 @@ packages: resolution: {integrity: sha512-vLPLV3cpPGjUPT3PjgRj7e3nio9t6USkuew3JE/jMeon/9Mvp1WyR18v3iwnCuX7eUAm1HmAbJHHLAbcu/EJcw==} dev: false + /@next/env/13.0.0: + resolution: {integrity: sha512-65v9BVuah2Mplohm4+efsKEnoEuhmlGm8B2w6vD1geeEP2wXtlSJCvR/cCRJ3fD8wzCQBV41VcMBQeYET6MRkg==} + dev: true + /@next/polyfill-module/11.1.4: resolution: {integrity: sha512-CY3bOSQf9Dy3+34dFjFbOdg3DRXIGfujb54D/AVO83ajyQczRZ3xdU0i5VV0eSR6B56ktVy3/aelOffpTUq6LA==} dev: false @@ -7227,6 +7247,15 @@ packages: dev: false optional: true + /@next/swc-android-arm-eabi/13.0.0: + resolution: {integrity: sha512-+DUQkYF93gxFjWY+CYWE1QDX6gTgnUiWf+W4UqZjM1Jcef8U97fS6xYh+i+8rH4MM0AXHm7OSakvfOMzmjU6VA==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@next/swc-android-arm64/12.2.5: resolution: {integrity: sha512-vMj0efliXmC5b7p+wfcQCX0AfU8IypjkzT64GiKJD9PgiA3IILNiGJr1fw2lyUDHkjeWx/5HMlMEpLnTsQslwg==} engines: {node: '>= 10'} @@ -7236,6 +7265,15 @@ packages: dev: false optional: true + /@next/swc-android-arm64/13.0.0: + resolution: {integrity: sha512-RW9Uy3bMSc0zVGCa11klFuwfP/jdcdkhdruqnrJ7v+7XHm6OFKkSRzX6ee7yGR1rdDZvTnP4GZSRSpzjLv/N0g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@next/swc-darwin-arm64/11.1.4: resolution: {integrity: sha512-jt8dMtIRWnJjRYLid6NWCxXzXdpr9VFT/vhDp8ioh+TtOR0UKPHMxei6R4GA3RqoyPEfFcSNmkG7OtyqCSxNIw==} engines: {node: '>= 10'} @@ -7254,6 +7292,15 @@ packages: dev: false optional: true + /@next/swc-darwin-arm64/13.0.0: + resolution: {integrity: sha512-APA26nps1j4qyhOIzkclW/OmgotVHj1jBxebSpMCPw2rXfiNvKNY9FA0TcuwPmUCNqaTnm703h6oW4dvp73A4Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@next/swc-darwin-x64/11.1.4: resolution: {integrity: sha512-5i9tOQNO8kawwggHvQUVR3a5KzIGaE2dw1g1kL//z/N840djvGseHrJSFEGdP1c35gM+dSGPpAKHmeBKrwHM8g==} engines: {node: '>= 10'} @@ -7272,6 +7319,15 @@ packages: dev: false optional: true + /@next/swc-darwin-x64/13.0.0: + resolution: {integrity: sha512-qsUhUdoFuRJiaJ7LnvTQ6GZv1QnMDcRXCIjxaN0FNVXwrjkq++U7KjBUaxXkRzLV4C7u0NHLNOp0iZwNNE7ypw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@next/swc-freebsd-x64/12.2.5: resolution: {integrity: sha512-yYUbyup1JnznMtEBRkK4LT56N0lfK5qNTzr6/DEyDw5TbFVwnuy2hhLBzwCBkScFVjpFdfiC6SQAX3FrAZzuuw==} engines: {node: '>= 10'} @@ -7281,6 +7337,15 @@ packages: dev: false optional: true + /@next/swc-freebsd-x64/13.0.0: + resolution: {integrity: sha512-sCdyCbboS7CwdnevKH9J6hkJI76LUw1jVWt4eV7kISuLiPba3JmehZSWm80oa4ADChRVAwzhLAo2zJaYRrInbg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-arm-gnueabihf/12.2.5: resolution: {integrity: sha512-2ZE2/G921Acks7UopJZVMgKLdm4vN4U0yuzvAMJ6KBavPzqESA2yHJlm85TV/K9gIjKhSk5BVtauIUntFRP8cg==} engines: {node: '>= 10'} @@ -7290,6 +7355,15 @@ packages: dev: false optional: true + /@next/swc-linux-arm-gnueabihf/13.0.0: + resolution: {integrity: sha512-/X/VxfFA41C9jrEv+sUsPLQ5vbDPVIgG0CJrzKvrcc+b+4zIgPgtfsaWq9ockjHFQi3ycvlZK4TALOXO8ovQ6Q==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-arm64-gnu/12.2.5: resolution: {integrity: sha512-/I6+PWVlz2wkTdWqhlSYYJ1pWWgUVva6SgX353oqTh8njNQp1SdFQuWDqk8LnM6ulheVfSsgkDzxrDaAQZnzjQ==} engines: {node: '>= 10'} @@ -7299,6 +7373,15 @@ packages: dev: false optional: true + /@next/swc-linux-arm64-gnu/13.0.0: + resolution: {integrity: sha512-x6Oxr1GIi0ZtNiT6jbw+JVcbEi3UQgF7mMmkrgfL4mfchOwXtWSHKTSSPnwoJWJfXYa0Vy1n8NElWNTGAqoWFw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-arm64-musl/12.2.5: resolution: {integrity: sha512-LPQRelfX6asXyVr59p5sTpx5l+0yh2Vjp/R8Wi4X9pnqcayqT4CUJLiHqCvZuLin3IsFdisJL0rKHMoaZLRfmg==} engines: {node: '>= 10'} @@ -7308,6 +7391,15 @@ packages: dev: false optional: true + /@next/swc-linux-arm64-musl/13.0.0: + resolution: {integrity: sha512-SnMH9ngI+ipGh3kqQ8+mDtWunirwmhQnQeZkEq9e/9Xsgjf04OetqrqRHKM1HmJtG2qMUJbyXFJ0F81TPuT+3g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-x64-gnu/11.1.4: resolution: {integrity: sha512-QfVuXugxBkCUHN9yD/VZ1xqszcMlBDj6vrbRiQvmWuyNo39ON6HqGn3jDwVrTHc9oKo2a0XInm+0zEnQeDmjSw==} engines: {node: '>= 10'} @@ -7326,6 +7418,15 @@ packages: dev: false optional: true + /@next/swc-linux-x64-gnu/13.0.0: + resolution: {integrity: sha512-VSQwTX9EmdbotArtA1J67X8964oQfe0xHb32x4tu+JqTR+wOHyG6wGzPMdXH2oKAp6rdd7BzqxUXXf0J+ypHlw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-linux-x64-musl/12.2.5: resolution: {integrity: sha512-zg/Y6oBar1yVnW6Il1I/08/2ukWtOG6s3acdJdEyIdsCzyQi4RLxbbhkD/EGQyhqBvd3QrC6ZXQEXighQUAZ0g==} engines: {node: '>= 10'} @@ -7335,6 +7436,15 @@ packages: dev: false optional: true + /@next/swc-linux-x64-musl/13.0.0: + resolution: {integrity: sha512-xBCP0nnpO0q4tsytXkvIwWFINtbFRyVY5gxa1zB0vlFtqYR9lNhrOwH3CBrks3kkeaePOXd611+8sjdUtrLnXA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@next/swc-win32-arm64-msvc/12.2.5: resolution: {integrity: sha512-3/90DRNSqeeSRMMEhj4gHHQlLhhKg5SCCoYfE3kBjGpE63EfnblYUqsszGGZ9ekpKL/R4/SGB40iCQr8tR5Jiw==} engines: {node: '>= 10'} @@ -7344,6 +7454,15 @@ packages: dev: false optional: true + /@next/swc-win32-arm64-msvc/13.0.0: + resolution: {integrity: sha512-NutwDafqhGxqPj/eiUixJq9ImS/0sgx6gqlD7jRndCvQ2Q8AvDdu1+xKcGWGNnhcDsNM/n1avf1e62OG1GaqJg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@next/swc-win32-ia32-msvc/12.2.5: resolution: {integrity: sha512-hGLc0ZRAwnaPL4ulwpp4D2RxmkHQLuI8CFOEEHdzZpS63/hMVzv81g8jzYA0UXbb9pus/iTc3VRbVbAM03SRrw==} engines: {node: '>= 10'} @@ -7353,6 +7472,15 @@ packages: dev: false optional: true + /@next/swc-win32-ia32-msvc/13.0.0: + resolution: {integrity: sha512-zNaxaO+Kl/xNz02E9QlcVz0pT4MjkXGDLb25qxtAzyJL15aU0+VjjbIZAYWctG59dvggNIUNDWgoBeVTKB9xLg==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@next/swc-win32-x64-msvc/11.1.4: resolution: {integrity: sha512-7MPXYWsCo5qGZXyyJwBLvQkYi0hKARtpjGxjt/mdxn7A7O+jKJgAuxgOo/lnZIiXfbJzxRnSD8k6WkUwN0IVmg==} engines: {node: '>= 10'} @@ -7371,6 +7499,15 @@ packages: dev: false optional: true + /@next/swc-win32-x64-msvc/13.0.0: + resolution: {integrity: sha512-FFOGGWwTCRMu9W7MF496Urefxtuo2lttxF1vwS+1rIRsKvuLrWhVaVTj3T8sf2EBL6gtJbmh4TYlizS+obnGKA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@node-ipc/js-queue/2.0.3: resolution: {integrity: sha512-fL1wpr8hhD5gT2dA1qifeVaoDFlQR5es8tFuKqjHX+kdOtdNHnxkVZbtIrR2rxnMFvehkjaZRNV2H/gPXlb0hw==} engines: {node: '>=1.0.0'} @@ -10509,6 +10646,12 @@ packages: transitivePeerDependencies: - supports-color + /@swc/helpers/0.4.11: + resolution: {integrity: sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==} + dependencies: + tslib: 2.4.0 + dev: true + /@swc/helpers/0.4.3: resolution: {integrity: sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA==} dependencies: @@ -15393,6 +15536,10 @@ packages: engines: {node: '>= 12'} dev: true + /client-only/0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + dev: true + /clipboardy/2.3.0: resolution: {integrity: sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ==} engines: {node: '>=8'} @@ -24629,6 +24776,51 @@ packages: - babel-plugin-macros dev: false + /next/13.0.0_qtpcxnaaarbm4ws7ughq6oxfve: + resolution: {integrity: sha512-puH1WGM6rGeFOoFdXXYfUxN9Sgi4LMytCV5HkQJvVUOhHfC1DoVqOfvzaEteyp6P04IW+gbtK2Q9pInVSrltPA==} + engines: {node: '>=14.6.0'} + hasBin: true + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^6.0.0 || ^7.0.0 + react: ^18.0.0-0 || 18 + react-dom: ^18.0.0-0 || 18 + sass: ^1.3.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + dependencies: + '@next/env': 13.0.0 + '@swc/helpers': 0.4.11 + caniuse-lite: 1.0.30001426 + postcss: 8.4.14 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + styled-jsx: 5.1.0_otspjrsspon4ofp37rshhlhp2y + use-sync-external-store: 1.2.0_react@18.2.0 + optionalDependencies: + '@next/swc-android-arm-eabi': 13.0.0 + '@next/swc-android-arm64': 13.0.0 + '@next/swc-darwin-arm64': 13.0.0 + '@next/swc-darwin-x64': 13.0.0 + '@next/swc-freebsd-x64': 13.0.0 + '@next/swc-linux-arm-gnueabihf': 13.0.0 + '@next/swc-linux-arm64-gnu': 13.0.0 + '@next/swc-linux-arm64-musl': 13.0.0 + '@next/swc-linux-x64-gnu': 13.0.0 + '@next/swc-linux-x64-musl': 13.0.0 + '@next/swc-win32-arm64-msvc': 13.0.0 + '@next/swc-win32-ia32-msvc': 13.0.0 + '@next/swc-win32-x64-msvc': 13.0.0 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: true + /nice-try/1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} @@ -27420,7 +27612,6 @@ packages: nanoid: 3.3.4 picocolors: 1.0.0 source-map-js: 1.0.2 - dev: false /postcss/8.4.16: resolution: {integrity: sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==} @@ -30838,6 +31029,24 @@ packages: react: 17.0.2 dev: false + /styled-jsx/5.1.0_otspjrsspon4ofp37rshhlhp2y: + resolution: {integrity: sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0 || 18' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.19.6 + client-only: 0.0.1 + react: 18.2.0 + dev: true + /stylehacks/4.0.3: resolution: {integrity: sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==} engines: {node: '>=6.9.0'} @@ -32677,6 +32886,14 @@ packages: react: 17.0.2 dev: false + /use-sync-external-store/1.2.0_react@18.2.0: + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || 18 + dependencies: + react: 18.2.0 + dev: true + /use/3.1.1: resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} engines: {node: '>=0.10.0'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 499a7ef6a1f..58091a965b4 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,6 +4,7 @@ packages: - "app-foundations" - "config" - "core" + - "config-helpers/*" - "csf3" - "dev-workspace" - "e2e-test-runner" diff --git a/scripts/release-components.ts b/scripts/release-components.ts index 9c3a27c4928..4031baf307a 100644 --- a/scripts/release-components.ts +++ b/scripts/release-components.ts @@ -42,6 +42,11 @@ const packages: Package[] = [ dirPath: "config", tagName: "config", }, + { + name: "config-helper-nextjs", + dirPath: "config-helpers/nextjs", + tagName: "config-helpers/nextjs", + }, { name: "csf3", dirPath: "csf3", diff --git a/smoke-test-apps/nextjs-11/__previewjs__/Wrapper.tsx b/smoke-test-apps/nextjs-11/__previewjs__/Wrapper.tsx new file mode 100644 index 00000000000..933d8c730a8 --- /dev/null +++ b/smoke-test-apps/nextjs-11/__previewjs__/Wrapper.tsx @@ -0,0 +1 @@ +import "@previewjs/config-helper-nextjs"; diff --git a/smoke-test-apps/nextjs-11/package.json b/smoke-test-apps/nextjs-11/package.json index 7fdc9ddaf9a..37083377d15 100644 --- a/smoke-test-apps/nextjs-11/package.json +++ b/smoke-test-apps/nextjs-11/package.json @@ -13,6 +13,7 @@ }, "devDependencies": { "@babel/core": "^7", + "@previewjs/config-helper-nextjs": "workspace:*", "@types/react": "^17", "typescript": "^4" } diff --git a/smoke-test-apps/nextjs-11/pages/index.tsx b/smoke-test-apps/nextjs-11/pages/index.tsx index aa2b234bd47..76061a48c3e 100644 --- a/smoke-test-apps/nextjs-11/pages/index.tsx +++ b/smoke-test-apps/nextjs-11/pages/index.tsx @@ -2,9 +2,14 @@ import type { NextPage } from "next"; import Head from "next/head"; import Image from "next/image"; import Link from "next/link"; +import { useRouter } from "next/router"; import styles from "../styles/Home.module.css"; const App: NextPage = () => { + const router = useRouter(); + + console.log("Current path is", router.pathname); + return (
diff --git a/smoke-test-apps/nextjs-12/__previewjs__/Wrapper.tsx b/smoke-test-apps/nextjs-12/__previewjs__/Wrapper.tsx new file mode 100644 index 00000000000..933d8c730a8 --- /dev/null +++ b/smoke-test-apps/nextjs-12/__previewjs__/Wrapper.tsx @@ -0,0 +1 @@ +import "@previewjs/config-helper-nextjs"; diff --git a/smoke-test-apps/nextjs-12/package.json b/smoke-test-apps/nextjs-12/package.json index f7885fb6965..64d6eaa0c83 100644 --- a/smoke-test-apps/nextjs-12/package.json +++ b/smoke-test-apps/nextjs-12/package.json @@ -13,6 +13,7 @@ }, "devDependencies": { "@babel/core": "^7", + "@previewjs/config-helper-nextjs": "workspace:*", "@types/react": "^17", "typescript": "^4" } diff --git a/smoke-test-apps/nextjs-12/pages/index.tsx b/smoke-test-apps/nextjs-12/pages/index.tsx index aa2b234bd47..76061a48c3e 100644 --- a/smoke-test-apps/nextjs-12/pages/index.tsx +++ b/smoke-test-apps/nextjs-12/pages/index.tsx @@ -2,9 +2,14 @@ import type { NextPage } from "next"; import Head from "next/head"; import Image from "next/image"; import Link from "next/link"; +import { useRouter } from "next/router"; import styles from "../styles/Home.module.css"; const App: NextPage = () => { + const router = useRouter(); + + console.log("Current path is", router.pathname); + return (
diff --git a/smoke-test-apps/nuxt2-app/package.json b/smoke-test-apps/nuxt2-app/package.json index a3d5587bb42..bef0055b641 100644 --- a/smoke-test-apps/nuxt2-app/package.json +++ b/smoke-test-apps/nuxt2-app/package.json @@ -4,7 +4,6 @@ "private": true, "scripts": { "dev": "nuxt", - "build": "nuxt build", "start": "nuxt start", "generate": "nuxt generate" }, diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/ambient.d.ts b/smoke-test-apps/sveltekit-app/.svelte-kit/ambient.d.ts deleted file mode 100644 index de72a6698fc..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/ambient.d.ts +++ /dev/null @@ -1,250 +0,0 @@ - -// this file is generated — do not edit it - - -/// - -/** - * Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), this module cannot be imported into public-facing code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env). - * - * _Unlike_ [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination. - * - * ```ts - * import { API_KEY } from '$env/static/private'; - * ``` - * - * Note that all environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: - * - * ``` - * MY_FEATURE_FLAG="" - * ``` - * - * You can override `.env` values from the command line like so: - * - * ```bash - * MY_FEATURE_FLAG="enabled" npm run dev - * ``` - */ -declare module '$env/static/private' { - export const NVM_INC: string; - export const LC_FIG_SET_PARENT: string; - export const FIG_PID: string; - export const MANPATH: string; - export const TERM_PROGRAM: string; - export const NODE: string; - export const NVM_CD_FLAGS: string; - export const INIT_CWD: string; - export const npm_package_devDependencies_typescript: string; - export const TERM: string; - export const SHELL: string; - export const npm_package_devDependencies_vite: string; - export const FIGTERM_SESSION_ID: string; - export const TMPDIR: string; - export const HOMEBREW_REPOSITORY: string; - export const TERM_PROGRAM_VERSION: string; - export const npm_package_scripts_dev: string; - export const npm_config_public_hoist_pattern: string; - export const TERM_SESSION_ID: string; - export const npm_package_private: string; - export const npm_package_devDependencies__sveltejs_kit: string; - export const npm_package_devDependencies_svelte_preprocess: string; - export const npm_config_registry: string; - export const ZSH: string; - export const PNPM_HOME: string; - export const USER: string; - export const NVM_DIR: string; - export const HOMEBREW_SHELLENV_PREFIX: string; - export const npm_package_scripts_check_watch: string; - export const COMMAND_MODE: string; - export const FIG_TERM_TMUX: string; - export const PNPM_SCRIPT_SRC_DIR: string; - export const npm_config_recursive_install: string; - export const npm_config_strict_peer_dependencies: string; - export const SSH_AUTH_SOCK: string; - export const __CF_USER_TEXT_ENCODING: string; - export const npm_package_devDependencies_tslib: string; - export const npm_execpath: string; - export const PAGER: string; - export const npm_package_devDependencies_svelte: string; - export const TMUX: string; - export const LSCOLORS: string; - export const PATH: string; - export const npm_package_scripts_postinstall: string; - export const npm_config_engine_strict: string; - export const __CFBundleIdentifier: string; - export const npm_config_auto_install_peers: string; - export const TTY: string; - export const PWD: string; - export const npm_package_scripts_preview: string; - export const npm_lifecycle_event: string; - export const LANG: string; - export const npm_package_name: string; - export const ITERM_PROFILE: string; - export const NODE_PATH: string; - export const npm_package_scripts_build: string; - export const XPC_FLAGS: string; - export const TMUX_PANE: string; - export const npm_config_node_gyp: string; - export const XPC_SERVICE_NAME: string; - export const npm_package_version: string; - export const npm_package_devDependencies__sveltejs_adapter_auto: string; - export const npm_package_devDependencies_svelte_check: string; - export const SHLVL: string; - export const HOME: string; - export const FIG_PARENT: string; - export const COLORFGBG: string; - export const npm_package_type: string; - export const LC_TERMINAL_VERSION: string; - export const HOMEBREW_PREFIX: string; - export const ITERM_SESSION_ID: string; - export const FIG_SET_PARENT: string; - export const LOGNAME: string; - export const LESS: string; - export const npm_lifecycle_script: string; - export const NVM_BIN: string; - export const BUN_INSTALL: string; - export const npm_config_user_agent: string; - export const INFOPATH: string; - export const HOMEBREW_CELLAR: string; - export const LC_TERMINAL: string; - export const FIG_INTEGRATION_VERSION: string; - export const FIG_TERM_VERSION: string; - export const npm_package_scripts_check: string; - export const FIG_TERM: string; - export const COLORTERM: string; - export const npm_node_execpath: string; -} - -/** - * Similar to [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. - * - * Values are replaced statically at build time. - * - * ```ts - * import { PUBLIC_BASE_URL } from '$env/static/public'; - * ``` - */ -declare module '$env/static/public' { - -} - -/** - * This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/master/packages/adapter-node) (or running [`vite preview`](https://kit.svelte.dev/docs/cli)), this is equivalent to `process.env`. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env). - * - * This module cannot be imported into public-facing code. - * - * ```ts - * import { env } from '$env/dynamic/private'; - * console.log(env.DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` - * - * > In `dev`, `$env/dynamic` always includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. - */ -declare module '$env/dynamic/private' { - export const env: { - NVM_INC: string; - LC_FIG_SET_PARENT: string; - FIG_PID: string; - MANPATH: string; - TERM_PROGRAM: string; - NODE: string; - NVM_CD_FLAGS: string; - INIT_CWD: string; - npm_package_devDependencies_typescript: string; - TERM: string; - SHELL: string; - npm_package_devDependencies_vite: string; - FIGTERM_SESSION_ID: string; - TMPDIR: string; - HOMEBREW_REPOSITORY: string; - TERM_PROGRAM_VERSION: string; - npm_package_scripts_dev: string; - npm_config_public_hoist_pattern: string; - TERM_SESSION_ID: string; - npm_package_private: string; - npm_package_devDependencies__sveltejs_kit: string; - npm_package_devDependencies_svelte_preprocess: string; - npm_config_registry: string; - ZSH: string; - PNPM_HOME: string; - USER: string; - NVM_DIR: string; - HOMEBREW_SHELLENV_PREFIX: string; - npm_package_scripts_check_watch: string; - COMMAND_MODE: string; - FIG_TERM_TMUX: string; - PNPM_SCRIPT_SRC_DIR: string; - npm_config_recursive_install: string; - npm_config_strict_peer_dependencies: string; - SSH_AUTH_SOCK: string; - __CF_USER_TEXT_ENCODING: string; - npm_package_devDependencies_tslib: string; - npm_execpath: string; - PAGER: string; - npm_package_devDependencies_svelte: string; - TMUX: string; - LSCOLORS: string; - PATH: string; - npm_package_scripts_postinstall: string; - npm_config_engine_strict: string; - __CFBundleIdentifier: string; - npm_config_auto_install_peers: string; - TTY: string; - PWD: string; - npm_package_scripts_preview: string; - npm_lifecycle_event: string; - LANG: string; - npm_package_name: string; - ITERM_PROFILE: string; - NODE_PATH: string; - npm_package_scripts_build: string; - XPC_FLAGS: string; - TMUX_PANE: string; - npm_config_node_gyp: string; - XPC_SERVICE_NAME: string; - npm_package_version: string; - npm_package_devDependencies__sveltejs_adapter_auto: string; - npm_package_devDependencies_svelte_check: string; - SHLVL: string; - HOME: string; - FIG_PARENT: string; - COLORFGBG: string; - npm_package_type: string; - LC_TERMINAL_VERSION: string; - HOMEBREW_PREFIX: string; - ITERM_SESSION_ID: string; - FIG_SET_PARENT: string; - LOGNAME: string; - LESS: string; - npm_lifecycle_script: string; - NVM_BIN: string; - BUN_INSTALL: string; - npm_config_user_agent: string; - INFOPATH: string; - HOMEBREW_CELLAR: string; - LC_TERMINAL: string; - FIG_INTEGRATION_VERSION: string; - FIG_TERM_VERSION: string; - npm_package_scripts_check: string; - FIG_TERM: string; - COLORTERM: string; - npm_node_execpath: string; - [key: string]: string | undefined; - } -} - -/** - * Similar to [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. - * - * Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead. - * - * ```ts - * import { env } from '$env/dynamic/public'; - * console.log(env.PUBLIC_DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` - */ -declare module '$env/dynamic/public' { - export const env: { - [key: string]: string | undefined; - } -} diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/client-manifest.js b/smoke-test-apps/sveltekit-app/.svelte-kit/generated/client-manifest.js deleted file mode 100644 index 7caf2a7a973..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/client-manifest.js +++ /dev/null @@ -1,15 +0,0 @@ -export { matchers } from './client-matchers.js'; - - export const nodes = [() => import('./nodes/0'), - () => import('./nodes/1'), - () => import('./nodes/2')]; - - export const server_loads = []; - - export const dictionary = { - "": [2] -}; - - export const hooks = { - handleError: (({ error }) => { console.error(error) }), - }; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/client-matchers.js b/smoke-test-apps/sveltekit-app/.svelte-kit/generated/client-matchers.js deleted file mode 100644 index f6bd30a4eb6..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/client-matchers.js +++ /dev/null @@ -1 +0,0 @@ -export const matchers = {}; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/0.js b/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/0.js deleted file mode 100644 index 70d18fa43b6..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/0.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.520_svelte@3.52.0+vite@3.1.8/node_modules/@sveltejs/kit/src/runtime/components/layout.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/1.js b/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/1.js deleted file mode 100644 index 44dbfc481b0..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/1.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.520_svelte@3.52.0+vite@3.1.8/node_modules/@sveltejs/kit/src/runtime/components/error.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/2.js b/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/2.js deleted file mode 100644 index efaa62f11dc..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/nodes/2.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/root.svelte b/smoke-test-apps/sveltekit-app/.svelte-kit/generated/root.svelte deleted file mode 100644 index 789457f2689..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/generated/root.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - - -{#if components[1]} - - - -{:else} - -{/if} - -{#if mounted} -
- {#if navigated} - {title} - {/if} -
-{/if} \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/types/route_meta_data.json b/smoke-test-apps/sveltekit-app/.svelte-kit/types/route_meta_data.json deleted file mode 100644 index 9c0a27d673f..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/types/route_meta_data.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "": [] -} \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/.svelte-kit/types/src/routes/$types.d.ts b/smoke-test-apps/sveltekit-app/.svelte-kit/types/src/routes/$types.d.ts deleted file mode 100644 index 2f70213cbaa..00000000000 --- a/smoke-test-apps/sveltekit-app/.svelte-kit/types/src/routes/$types.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type * as Kit from '@sveltejs/kit'; - -type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never; -type RouteParams = { } -type MaybeWithVoid = {} extends T ? T | void : T; -export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T]; -type OutputDataShape = MaybeWithVoid> & Partial> & Record> -type EnsureDefined = T extends null | undefined ? {} : T; -type PageParentData = EnsureDefined; -type LayoutParams = RouteParams & { } -type LayoutParentData = EnsureDefined<{}>; - -export type PageServerData = null; -export type PageData = Expand; -export type LayoutServerData = null; -export type LayoutData = Expand; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-app/package.json b/smoke-test-apps/sveltekit-app/package.json index 63406a50e7d..d8e42674bcd 100644 --- a/smoke-test-apps/sveltekit-app/package.json +++ b/smoke-test-apps/sveltekit-app/package.json @@ -4,8 +4,6 @@ "private": true, "scripts": { "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" }, diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/ambient.d.ts b/smoke-test-apps/sveltekit-demo/.svelte-kit/ambient.d.ts deleted file mode 100644 index f3c3a18f1d6..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/ambient.d.ts +++ /dev/null @@ -1,252 +0,0 @@ - -// this file is generated — do not edit it - - -/// - -/** - * Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), this module cannot be imported into public-facing code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env). - * - * _Unlike_ [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination. - * - * ```ts - * import { API_KEY } from '$env/static/private'; - * ``` - * - * Note that all environment variables referenced in your code should be declared (for example in an `.env` file), even if they don't have a value until the app is deployed: - * - * ``` - * MY_FEATURE_FLAG="" - * ``` - * - * You can override `.env` values from the command line like so: - * - * ```bash - * MY_FEATURE_FLAG="enabled" npm run dev - * ``` - */ -declare module '$env/static/private' { - export const NVM_INC: string; - export const LC_FIG_SET_PARENT: string; - export const FIG_PID: string; - export const npm_package_devDependencies__fontsource_fira_mono: string; - export const MANPATH: string; - export const TERM_PROGRAM: string; - export const NODE: string; - export const NVM_CD_FLAGS: string; - export const npm_package_devDependencies_typescript: string; - export const INIT_CWD: string; - export const TERM: string; - export const SHELL: string; - export const npm_package_devDependencies_vite: string; - export const FIGTERM_SESSION_ID: string; - export const npm_package_devDependencies__types_cookie: string; - export const TMPDIR: string; - export const HOMEBREW_REPOSITORY: string; - export const TERM_PROGRAM_VERSION: string; - export const npm_package_scripts_dev: string; - export const npm_config_public_hoist_pattern: string; - export const TERM_SESSION_ID: string; - export const npm_package_devDependencies__sveltejs_kit: string; - export const npm_package_devDependencies_svelte_preprocess: string; - export const npm_config_registry: string; - export const ZSH: string; - export const PNPM_HOME: string; - export const USER: string; - export const NVM_DIR: string; - export const HOMEBREW_SHELLENV_PREFIX: string; - export const npm_package_scripts_check_watch: string; - export const COMMAND_MODE: string; - export const FIG_TERM_TMUX: string; - export const PNPM_SCRIPT_SRC_DIR: string; - export const npm_config_recursive_install: string; - export const npm_config_strict_peer_dependencies: string; - export const SSH_AUTH_SOCK: string; - export const __CF_USER_TEXT_ENCODING: string; - export const npm_package_devDependencies_tslib: string; - export const npm_execpath: string; - export const PAGER: string; - export const npm_package_devDependencies_svelte: string; - export const TMUX: string; - export const LSCOLORS: string; - export const PATH: string; - export const npm_package_devDependencies__neoconfetti_svelte: string; - export const npm_config_engine_strict: string; - export const __CFBundleIdentifier: string; - export const npm_config_auto_install_peers: string; - export const TTY: string; - export const PWD: string; - export const npm_package_scripts_preview: string; - export const npm_lifecycle_event: string; - export const LANG: string; - export const npm_package_name: string; - export const ITERM_PROFILE: string; - export const NODE_PATH: string; - export const npm_package_scripts_build: string; - export const XPC_FLAGS: string; - export const TMUX_PANE: string; - export const npm_config_node_gyp: string; - export const XPC_SERVICE_NAME: string; - export const npm_package_version: string; - export const npm_package_devDependencies__sveltejs_adapter_auto: string; - export const npm_package_devDependencies_svelte_check: string; - export const SHLVL: string; - export const HOME: string; - export const FIG_PARENT: string; - export const COLORFGBG: string; - export const npm_package_type: string; - export const LC_TERMINAL_VERSION: string; - export const HOMEBREW_PREFIX: string; - export const ITERM_SESSION_ID: string; - export const FIG_SET_PARENT: string; - export const LOGNAME: string; - export const LESS: string; - export const npm_lifecycle_script: string; - export const NVM_BIN: string; - export const BUN_INSTALL: string; - export const npm_config_user_agent: string; - export const INFOPATH: string; - export const HOMEBREW_CELLAR: string; - export const LC_TERMINAL: string; - export const FIG_INTEGRATION_VERSION: string; - export const FIG_TERM_VERSION: string; - export const npm_package_scripts_check: string; - export const FIG_TERM: string; - export const COLORTERM: string; - export const npm_node_execpath: string; -} - -/** - * Similar to [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. - * - * Values are replaced statically at build time. - * - * ```ts - * import { PUBLIC_BASE_URL } from '$env/static/public'; - * ``` - */ -declare module '$env/static/public' { - -} - -/** - * This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/master/packages/adapter-node) (or running [`vite preview`](https://kit.svelte.dev/docs/cli)), this is equivalent to `process.env`. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env). - * - * This module cannot be imported into public-facing code. - * - * ```ts - * import { env } from '$env/dynamic/private'; - * console.log(env.DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` - * - * > In `dev`, `$env/dynamic` always includes environment variables from `.env`. In `prod`, this behavior will depend on your adapter. - */ -declare module '$env/dynamic/private' { - export const env: { - NVM_INC: string; - LC_FIG_SET_PARENT: string; - FIG_PID: string; - npm_package_devDependencies__fontsource_fira_mono: string; - MANPATH: string; - TERM_PROGRAM: string; - NODE: string; - NVM_CD_FLAGS: string; - npm_package_devDependencies_typescript: string; - INIT_CWD: string; - TERM: string; - SHELL: string; - npm_package_devDependencies_vite: string; - FIGTERM_SESSION_ID: string; - npm_package_devDependencies__types_cookie: string; - TMPDIR: string; - HOMEBREW_REPOSITORY: string; - TERM_PROGRAM_VERSION: string; - npm_package_scripts_dev: string; - npm_config_public_hoist_pattern: string; - TERM_SESSION_ID: string; - npm_package_devDependencies__sveltejs_kit: string; - npm_package_devDependencies_svelte_preprocess: string; - npm_config_registry: string; - ZSH: string; - PNPM_HOME: string; - USER: string; - NVM_DIR: string; - HOMEBREW_SHELLENV_PREFIX: string; - npm_package_scripts_check_watch: string; - COMMAND_MODE: string; - FIG_TERM_TMUX: string; - PNPM_SCRIPT_SRC_DIR: string; - npm_config_recursive_install: string; - npm_config_strict_peer_dependencies: string; - SSH_AUTH_SOCK: string; - __CF_USER_TEXT_ENCODING: string; - npm_package_devDependencies_tslib: string; - npm_execpath: string; - PAGER: string; - npm_package_devDependencies_svelte: string; - TMUX: string; - LSCOLORS: string; - PATH: string; - npm_package_devDependencies__neoconfetti_svelte: string; - npm_config_engine_strict: string; - __CFBundleIdentifier: string; - npm_config_auto_install_peers: string; - TTY: string; - PWD: string; - npm_package_scripts_preview: string; - npm_lifecycle_event: string; - LANG: string; - npm_package_name: string; - ITERM_PROFILE: string; - NODE_PATH: string; - npm_package_scripts_build: string; - XPC_FLAGS: string; - TMUX_PANE: string; - npm_config_node_gyp: string; - XPC_SERVICE_NAME: string; - npm_package_version: string; - npm_package_devDependencies__sveltejs_adapter_auto: string; - npm_package_devDependencies_svelte_check: string; - SHLVL: string; - HOME: string; - FIG_PARENT: string; - COLORFGBG: string; - npm_package_type: string; - LC_TERMINAL_VERSION: string; - HOMEBREW_PREFIX: string; - ITERM_SESSION_ID: string; - FIG_SET_PARENT: string; - LOGNAME: string; - LESS: string; - npm_lifecycle_script: string; - NVM_BIN: string; - BUN_INSTALL: string; - npm_config_user_agent: string; - INFOPATH: string; - HOMEBREW_CELLAR: string; - LC_TERMINAL: string; - FIG_INTEGRATION_VERSION: string; - FIG_TERM_VERSION: string; - npm_package_scripts_check: string; - FIG_TERM: string; - COLORTERM: string; - npm_node_execpath: string; - [key: string]: string | undefined; - } -} - -/** - * Similar to [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://kit.svelte.dev/docs/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code. - * - * Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead. - * - * ```ts - * import { env } from '$env/dynamic/public'; - * console.log(env.PUBLIC_DEPLOYMENT_SPECIFIC_VARIABLE); - * ``` - */ -declare module '$env/dynamic/public' { - export const env: { - [key: string]: string | undefined; - } -} diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/client-manifest.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/client-manifest.js deleted file mode 100644 index 7a16c81c44b..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/client-manifest.js +++ /dev/null @@ -1,21 +0,0 @@ -export { matchers } from './client-matchers.js'; - - export const nodes = [() => import('./nodes/0'), - () => import('./nodes/1'), - () => import('./nodes/2'), - () => import('./nodes/3'), - () => import('./nodes/4'), - () => import('./nodes/5')]; - - export const server_loads = []; - - export const dictionary = { - "/": [2], - "/about": [3], - "/sverdle": [~4], - "/sverdle/how-to-play": [5] -}; - - export const hooks = { - handleError: (({ error }) => { console.error(error) }), - }; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/client-matchers.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/client-matchers.js deleted file mode 100644 index f6bd30a4eb6..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/client-matchers.js +++ /dev/null @@ -1 +0,0 @@ -export const matchers = {}; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/0.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/0.js deleted file mode 100644 index 851a03de9ee..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/0.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../src/routes/+layout.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/1.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/1.js deleted file mode 100644 index 3ce14f5434b..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/1.js +++ /dev/null @@ -1 +0,0 @@ -export { default as component } from "../../../../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.522_svelte@3.52.0+vite@3.1.8/node_modules/@sveltejs/kit/src/runtime/components/error.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/2.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/2.js deleted file mode 100644 index 0381d97983c..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/2.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as shared from "../../../src/routes/+page.ts"; -export { shared }; -export { default as component } from "../../../src/routes/+page.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/3.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/3.js deleted file mode 100644 index 643df33adb7..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/3.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as shared from "../../../src/routes/about/+page.ts"; -export { shared }; -export { default as component } from "../../../src/routes/about/+page.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/4.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/4.js deleted file mode 100644 index fe2561474ed..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/4.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as component } from "../../../src/routes/sverdle/+page.svelte"; -export const server = true; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/5.js b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/5.js deleted file mode 100644 index d5595004695..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/nodes/5.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as shared from "../../../src/routes/sverdle/how-to-play/+page.ts"; -export { shared }; -export { default as component } from "../../../src/routes/sverdle/how-to-play/+page.svelte"; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/root.svelte b/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/root.svelte deleted file mode 100644 index 789457f2689..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/generated/root.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - - -{#if components[1]} - - - -{:else} - -{/if} - -{#if mounted} -
- {#if navigated} - {title} - {/if} -
-{/if} \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/route_meta_data.json b/smoke-test-apps/sveltekit-demo/.svelte-kit/types/route_meta_data.json deleted file mode 100644 index fad3f798a4e..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/route_meta_data.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "/": [ - "src/routes/+page.ts" - ], - "/about": [ - "src/routes/about/+page.ts" - ], - "/sverdle": [ - "src/routes/sverdle/+page.server.ts" - ], - "/sverdle/how-to-play": [ - "src/routes/sverdle/how-to-play/+page.ts" - ] -} \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/$types.d.ts b/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/$types.d.ts deleted file mode 100644 index 74ead0d2a72..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/$types.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type * as Kit from '@sveltejs/kit'; - -type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never; -type RouteParams = { } -type MaybeWithVoid = {} extends T ? T | void : T; -export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T]; -type OutputDataShape = MaybeWithVoid> & Partial> & Record> -type EnsureDefined = T extends null | undefined ? {} : T; -type PageParentData = EnsureDefined; -type LayoutParams = RouteParams & { } -type LayoutParentData = EnsureDefined<{}>; - -export type PageServerData = null; -export type PageLoad = OutputDataShape> = Kit.Load; -export type PageLoadEvent = Parameters[0]; -export type PageData = Expand> & EnsureDefined>>; -export type LayoutServerData = null; -export type LayoutData = Expand; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/about/$types.d.ts b/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/about/$types.d.ts deleted file mode 100644 index 6921e140741..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/about/$types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type * as Kit from '@sveltejs/kit'; - -type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never; -type RouteParams = { } -type MaybeWithVoid = {} extends T ? T | void : T; -export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T]; -type OutputDataShape = MaybeWithVoid> & Partial> & Record> -type EnsureDefined = T extends null | undefined ? {} : T; -type PageParentData = EnsureDefined; - -export type PageServerData = null; -export type PageLoad = OutputDataShape> = Kit.Load; -export type PageLoadEvent = Parameters[0]; -export type PageData = Expand> & EnsureDefined>>; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/$types.d.ts b/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/$types.d.ts deleted file mode 100644 index 006650db5a5..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/$types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type * as Kit from '@sveltejs/kit'; - -type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never; -type RouteParams = { } -type MaybeWithVoid = {} extends T ? T | void : T; -export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T]; -type OutputDataShape = MaybeWithVoid> & Partial> & Record> -type EnsureDefined = T extends null | undefined ? {} : T; -type PageServerParentData = EnsureDefined; -type PageParentData = EnsureDefined; - -export type PageServerLoad = OutputDataShape> = Kit.ServerLoad; -export type PageServerLoadEvent = Parameters[0]; -export type ActionData = Expand> | undefined; -export type PageServerData = Expand>>>; -export type PageData = Expand & EnsureDefined>; -export type Action = Kit.Action -export type Actions = Kit.Actions -export type RequestEvent = Kit.RequestEvent; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/how-to-play/$types.d.ts b/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/how-to-play/$types.d.ts deleted file mode 100644 index f4d678a9c62..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/how-to-play/$types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type * as Kit from '@sveltejs/kit'; - -type Expand = T extends infer O ? { [K in keyof O]: O[K] } : never; -type RouteParams = { } -type MaybeWithVoid = {} extends T ? T | void : T; -export type RequiredKeys = { [K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K; }[keyof T]; -type OutputDataShape = MaybeWithVoid> & Partial> & Record> -type EnsureDefined = T extends null | undefined ? {} : T; -type PageParentData = EnsureDefined; - -export type PageServerData = null; -export type PageLoad = OutputDataShape> = Kit.Load; -export type PageLoadEvent = Parameters[0]; -export type PageData = Expand> & EnsureDefined>>; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/proxy+page.server.ts b/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/proxy+page.server.ts deleted file mode 100644 index 83d5cc37612..00000000000 --- a/smoke-test-apps/sveltekit-demo/.svelte-kit/types/src/routes/sverdle/proxy+page.server.ts +++ /dev/null @@ -1,145 +0,0 @@ -// @ts-nocheck -import { invalid } from '@sveltejs/kit'; -import { words, allowed } from './words.server'; -import type { PageServerLoad, Actions } from './$types'; - -export const load = ({ cookies }: Parameters[0]) => { - const game = new Game(cookies.get('sverdle')); - - return { - /** - * The player's guessed words so far - */ - guesses: game.guesses, - - /** - * An array of strings like '__x_c' corresponding to the guesses, where 'x' means - * an exact match, and 'c' means a close match (right letter, wrong place) - */ - answers: game.answers, - - /** - * The correct answer, revealed if the game is over - */ - answer: game.answers.length >= 6 ? game.answer : null - }; -}; - -export const actions = { - /** - * Modify game state in reaction to a keypress. If client-side JavaScript - * is available, this will happen in the browser instead of here - */ - update: async ({ request, cookies }: import('./$types').RequestEvent) => { - const game = new Game(cookies.get('sverdle')); - - const data = await request.formData(); - const key = data.get('key'); - - const i = game.answers.length; - - if (key === 'backspace') { - game.guesses[i] = game.guesses[i].slice(0, -1); - } else { - game.guesses[i] += key; - } - - cookies.set('sverdle', game.toString()); - }, - - /** - * Modify game state in reaction to a guessed word. This logic always runs on - * the server, so that people can't cheat by peeking at the JavaScript - */ - enter: async ({ request, cookies }: import('./$types').RequestEvent) => { - const game = new Game(cookies.get('sverdle')); - - const data = await request.formData(); - const guess = data.getAll('guess') as string[]; - - if (!game.enter(guess)) { - return invalid(400, { badGuess: true }); - } - - cookies.set('sverdle', game.toString()); - }, - - restart: async ({ cookies }: import('./$types').RequestEvent) => { - cookies.delete('sverdle'); - } -}; - -class Game { - index: number; - guesses: string[]; - answers: string[]; - answer: string; - - /** - * Create a game object from the player's cookie, or initialise a new game - */ - constructor(serialized: string | undefined) { - if (serialized) { - const [index, guesses, answers] = serialized.split('-'); - - this.index = +index; - this.guesses = guesses ? guesses.split(' ') : []; - this.answers = answers ? answers.split(' ') : []; - } else { - this.index = Math.floor(Math.random() * words.length); - this.guesses = ['', '', '', '', '', '']; - this.answers = [] ; - } - - this.answer = words[this.index]; - } - - /** - * Update game state based on a guess of a five-letter word. Returns - * true if the guess was valid, false otherwise - */ - enter(letters: string[]) { - const word = letters.join(''); - const valid = allowed.has(word); - - if (!valid) return false; - - this.guesses[this.answers.length] = word; - - const available = Array.from(this.answer); - const answer = Array(5).fill('_'); - - // first, find exact matches - for (let i = 0; i < 5; i += 1) { - if (letters[i] === available[i]) { - answer[i] = 'x'; - available[i] = ' '; - } - } - - // then find close matches (this has to happen - // in a second step, otherwise an early close - // match can prevent a later exact match) - for (let i = 0; i < 5; i += 1) { - if (answer[i] === '_') { - const index = available.indexOf(letters[i]); - if (index !== -1) { - answer[i] = 'c'; - available[index] = ' '; - } - } - } - - this.answers.push(answer.join('')); - - return true; - } - - /** - * Serialize game state so it can be set as a cookie - */ - toString() { - return `${this.index}-${this.guesses.join(' ')}-${this.answers.join(' ')}`; - } -} -;null as any as Actions; \ No newline at end of file diff --git a/smoke-test-apps/sveltekit-demo/package.json b/smoke-test-apps/sveltekit-demo/package.json index f1d22456746..50993c99b12 100644 --- a/smoke-test-apps/sveltekit-demo/package.json +++ b/smoke-test-apps/sveltekit-demo/package.json @@ -1,25 +1,23 @@ { - "name": "sveltekit-demo", - "version": "0.0.1", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" - }, - "devDependencies": { - "@fontsource/fira-mono": "^4.5.0", - "@neoconfetti/svelte": "^1.0.0", - "@sveltejs/adapter-auto": "next", - "@sveltejs/kit": "next", - "@types/cookie": "^0.5.1", - "svelte": "^3.46.0", - "svelte-check": "^2.7.1", - "svelte-preprocess": "^4.10.6", - "tslib": "^2.3.1", - "typescript": "^4.7.4", - "vite": "^3.1.0" - }, - "type": "module" + "name": "sveltekit-demo", + "version": "0.0.1", + "scripts": { + "dev": "vite dev", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" + }, + "devDependencies": { + "@fontsource/fira-mono": "^4.5.0", + "@neoconfetti/svelte": "^1.0.0", + "@sveltejs/adapter-auto": "next", + "@sveltejs/kit": "next", + "@types/cookie": "^0.5.1", + "svelte": "^3.46.0", + "svelte-check": "^2.7.1", + "svelte-preprocess": "^4.10.6", + "tslib": "^2.3.1", + "typescript": "^4.7.4", + "vite": "^3.1.0" + }, + "type": "module" } diff --git a/smoke-test-apps/vue2-app/package.json b/smoke-test-apps/vue2-app/package.json index 2820b86f1a9..430a30341e2 100644 --- a/smoke-test-apps/vue2-app/package.json +++ b/smoke-test-apps/vue2-app/package.json @@ -1,9 +1,5 @@ { "name": "vue2-app", - "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build" - }, "dependencies": { "core-js": "^3", "vue": "^2" diff --git a/smoke-test-apps/vue3-app/package.json b/smoke-test-apps/vue3-app/package.json index e5d04e690a0..6ca41cc6991 100644 --- a/smoke-test-apps/vue3-app/package.json +++ b/smoke-test-apps/vue3-app/package.json @@ -1,9 +1,5 @@ { "name": "vue3-app", - "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build" - }, "dependencies": { "core-js": "^3", "vue": "^3" diff --git a/test-apps/vue2/package.json b/test-apps/vue2/package.json index b72fbeea2fd..4c7ac6eb939 100644 --- a/test-apps/vue2/package.json +++ b/test-apps/vue2/package.json @@ -1,9 +1,5 @@ { "private": true, - "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build" - }, "dependencies": { "vue": "^2.6.11" },