From b3da5f99f89185977f562d5d31a1dbfca0b3da16 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Mon, 8 Apr 2024 18:57:42 +0200 Subject: [PATCH] remove /examples/ssr-spa/ --- examples/ssr-spa/.gitignore | 2 - examples/ssr-spa/assets/logo.svg | 36 ------------- examples/ssr-spa/components/Link.vue | 25 --------- examples/ssr-spa/layouts/HeadDefault.vue | 9 ---- examples/ssr-spa/layouts/LayoutDefault.vue | 61 ---------------------- examples/ssr-spa/package.json | 20 ------- examples/ssr-spa/pages/+config.ts | 14 ----- examples/ssr-spa/pages/_error/+Page.vue | 25 --------- examples/ssr-spa/pages/index/+Page.vue | 4 -- examples/ssr-spa/pages/spa/+Page.vue | 4 -- examples/ssr-spa/pages/spa/+config.ts | 5 -- examples/ssr-spa/readme.md | 10 ---- examples/ssr-spa/tsconfig.json | 12 ----- examples/ssr-spa/vite.config.ts | 14 ----- examples/ssr-spa/vue-shim.d.ts | 11 ---- pnpm-lock.yaml | 25 --------- 16 files changed, 277 deletions(-) delete mode 100644 examples/ssr-spa/.gitignore delete mode 100644 examples/ssr-spa/assets/logo.svg delete mode 100644 examples/ssr-spa/components/Link.vue delete mode 100644 examples/ssr-spa/layouts/HeadDefault.vue delete mode 100644 examples/ssr-spa/layouts/LayoutDefault.vue delete mode 100644 examples/ssr-spa/package.json delete mode 100644 examples/ssr-spa/pages/+config.ts delete mode 100644 examples/ssr-spa/pages/_error/+Page.vue delete mode 100644 examples/ssr-spa/pages/index/+Page.vue delete mode 100644 examples/ssr-spa/pages/spa/+Page.vue delete mode 100644 examples/ssr-spa/pages/spa/+config.ts delete mode 100644 examples/ssr-spa/readme.md delete mode 100644 examples/ssr-spa/tsconfig.json delete mode 100644 examples/ssr-spa/vite.config.ts delete mode 100644 examples/ssr-spa/vue-shim.d.ts diff --git a/examples/ssr-spa/.gitignore b/examples/ssr-spa/.gitignore deleted file mode 100644 index b0a5c349..00000000 --- a/examples/ssr-spa/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules/ -/dist/ diff --git a/examples/ssr-spa/assets/logo.svg b/examples/ssr-spa/assets/logo.svg deleted file mode 100644 index 94d3caa0..00000000 --- a/examples/ssr-spa/assets/logo.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/ssr-spa/components/Link.vue b/examples/ssr-spa/components/Link.vue deleted file mode 100644 index 689a50f9..00000000 --- a/examples/ssr-spa/components/Link.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/examples/ssr-spa/layouts/HeadDefault.vue b/examples/ssr-spa/layouts/HeadDefault.vue deleted file mode 100644 index 64319c81..00000000 --- a/examples/ssr-spa/layouts/HeadDefault.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/examples/ssr-spa/layouts/LayoutDefault.vue b/examples/ssr-spa/layouts/LayoutDefault.vue deleted file mode 100644 index 8a0bc0d8..00000000 --- a/examples/ssr-spa/layouts/LayoutDefault.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - diff --git a/examples/ssr-spa/package.json b/examples/ssr-spa/package.json deleted file mode 100644 index a39bdae2..00000000 --- a/examples/ssr-spa/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "test": "vue-tsc --noEmit" - }, - "dependencies": { - "@vitejs/plugin-vue": "^5.0.4", - "vike": "^0.4.165", - "vike-vue": "0.6.3", - "vite": "^5.1.1", - "vue": "^3.4.18" - }, - "type": "module", - "devDependencies": { - "typescript": "^5.3.3", - "vue-tsc": "^1.8.27" - } -} diff --git a/examples/ssr-spa/pages/+config.ts b/examples/ssr-spa/pages/+config.ts deleted file mode 100644 index 3d362333..00000000 --- a/examples/ssr-spa/pages/+config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Config } from 'vike/types' -import Layout from '../layouts/LayoutDefault.vue' -import Head from '../layouts/HeadDefault.vue' -import vikeVue from 'vike-vue/config' - -// Default configs (can be overridden by pages) -export default { - Layout, - Head, - // - title: 'My Vike + Vue App', - ssr: true, // can be removed since `true` is the default - extends: vikeVue -} satisfies Config diff --git a/examples/ssr-spa/pages/_error/+Page.vue b/examples/ssr-spa/pages/_error/+Page.vue deleted file mode 100644 index a662caf1..00000000 --- a/examples/ssr-spa/pages/_error/+Page.vue +++ /dev/null @@ -1,25 +0,0 @@ -<template> - <div class="center"> - <p>{{ abortReason }}</p> - </div> -</template> - -<script lang="ts" setup> -import { usePageContext } from 'vike-vue/usePageContext' - -const pageContext = usePageContext() -let { is404, abortReason } = pageContext -if (!abortReason) { - abortReason = is404 ? 'Page not found.' : 'Something went wrong.' -} -</script> - -<style> -.center { - height: calc(100vh - 100px); - display: flex; - font-size: 1.3em; - justify-content: center; - align-items: center; -} -</style> diff --git a/examples/ssr-spa/pages/index/+Page.vue b/examples/ssr-spa/pages/index/+Page.vue deleted file mode 100644 index 43d06035..00000000 --- a/examples/ssr-spa/pages/index/+Page.vue +++ /dev/null @@ -1,4 +0,0 @@ -<template> - <h1>My Vike + Vue app</h1> - This page is rendered to HTML (using SSR) and hydrated in the browser. -</template> diff --git a/examples/ssr-spa/pages/spa/+Page.vue b/examples/ssr-spa/pages/spa/+Page.vue deleted file mode 100644 index a8238efc..00000000 --- a/examples/ssr-spa/pages/spa/+Page.vue +++ /dev/null @@ -1,4 +0,0 @@ -<template> - <h1>My Vike + Vue app</h1> - This page is rendered only in the browser. -</template> diff --git a/examples/ssr-spa/pages/spa/+config.ts b/examples/ssr-spa/pages/spa/+config.ts deleted file mode 100644 index ca6cf72a..00000000 --- a/examples/ssr-spa/pages/spa/+config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Config } from 'vike/types' - -export default { - ssr: false // SPA -} satisfies Config diff --git a/examples/ssr-spa/readme.md b/examples/ssr-spa/readme.md deleted file mode 100644 index 1802fd71..00000000 --- a/examples/ssr-spa/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -Example of selecting SPA or SSR on a per-page basis. See -[SPA vs SSR (and more)](https://vike.dev/SPA-vs-SSR). - -```bash -git clone git@github.com:vikejs/vike-vue -cd vike-vue/ -pnpm install -cd examples/ssr-spa/ -pnpm run dev -``` diff --git a/examples/ssr-spa/tsconfig.json b/examples/ssr-spa/tsconfig.json deleted file mode 100644 index 542ade43..00000000 --- a/examples/ssr-spa/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "module": "ES2020", - "moduleResolution": "Node", - "target": "ES2020", - "lib": ["DOM", "DOM.Iterable", "ESNext"], - "types": ["vite/client"], - "skipLibCheck": true, - "esModuleInterop": true - } -} diff --git a/examples/ssr-spa/vite.config.ts b/examples/ssr-spa/vite.config.ts deleted file mode 100644 index e3afd1de..00000000 --- a/examples/ssr-spa/vite.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import vue from '@vitejs/plugin-vue' -import vike from 'vike/plugin' -import { UserConfig } from 'vite' - -const config: UserConfig = { - plugins: [ - vike({ prerender: true }), - vue({ - include: [/\.vue$/, /\.md$/] - }) - ] -} - -export default config diff --git a/examples/ssr-spa/vue-shim.d.ts b/examples/ssr-spa/vue-shim.d.ts deleted file mode 100644 index fce3d669..00000000 --- a/examples/ssr-spa/vue-shim.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Without this file, `tsc` will fail with such errors: -// pages/+config.ts:3:20 - error TS2307: Cannot find module '../layouts/LayoutDefault.vue' or its corresponding type declarations. -// import Layout from "../layouts/LayoutDefault.vue" -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -// See https://stackoverflow.com/questions/71477277/typescript-cannot-find-module-in-vue-project - -declare module '*.vue' { - import Vue from 'vue' - export default Vue -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f08c3d6d..50deb3cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,31 +64,6 @@ importers: specifier: ^1.8.27 version: 1.8.27(typescript@5.3.3) - examples/ssr-spa: - dependencies: - '@vitejs/plugin-vue': - specifier: ^5.0.4 - version: 5.0.4(vite@5.1.1)(vue@3.4.18) - vike: - specifier: ^0.4.165 - version: 0.4.165(vite@5.1.1) - vike-vue: - specifier: link:../../packages/vike-vue - version: link:../../packages/vike-vue - vite: - specifier: ^5.1.1 - version: 5.1.1(@types/node@20.11.17) - vue: - specifier: ^3.4.18 - version: 3.4.18(typescript@5.3.3) - devDependencies: - typescript: - specifier: ^5.3.3 - version: 5.3.3 - vue-tsc: - specifier: ^1.8.27 - version: 1.8.27(typescript@5.3.3) - examples/with-vike-pinia: dependencies: '@vitejs/plugin-vue':