From 9f4419da7450d8eab003989e243baaf1ef011ff7 Mon Sep 17 00:00:00 2001
From: John Campion Jr
Date: Mon, 4 Dec 2023 23:10:54 -0500
Subject: [PATCH] examples: added vitesse for easier testing
---
examples/spa/src/pages/index.vue | 5 +
examples/spa/src/pages/second/index.vue | 13 +
examples/vitesse/.dockerignore | 2 +
examples/vitesse/.editorconfig | 9 +
examples/vitesse/.gitignore | 10 +
examples/vitesse/.npmrc | 2 +
examples/vitesse/.vscode/extensions.json | 13 +
examples/vitesse/.vscode/settings.json | 51 +
examples/vitesse/Dockerfile | 18 +
examples/vitesse/LICENSE | 21 +
examples/vitesse/README.md | 218 +
examples/vitesse/README.zh-CN.md | 185 +
examples/vitesse/cypress.config.ts | 14 +
examples/vitesse/cypress/e2e/basic.spec.ts | 36 +
examples/vitesse/cypress/tsconfig.json | 12 +
examples/vitesse/eslint.config.js | 8 +
examples/vitesse/index.html | 28 +
examples/vitesse/locales/README.md | 7 +
examples/vitesse/locales/ar.yml | 14 +
examples/vitesse/locales/de.yml | 14 +
examples/vitesse/locales/en.yml | 14 +
examples/vitesse/locales/es.yml | 14 +
examples/vitesse/locales/fr.yml | 14 +
examples/vitesse/locales/id.yml | 14 +
examples/vitesse/locales/it.yml | 13 +
examples/vitesse/locales/ja.yml | 13 +
examples/vitesse/locales/ka.yml | 14 +
examples/vitesse/locales/ko.yml | 13 +
examples/vitesse/locales/pl.yml | 14 +
examples/vitesse/locales/pt-BR.yml | 14 +
examples/vitesse/locales/ru.yml | 13 +
examples/vitesse/locales/tr.yml | 14 +
examples/vitesse/locales/uk.yml | 13 +
examples/vitesse/locales/uz.yml | 14 +
examples/vitesse/locales/vi.yml | 13 +
examples/vitesse/locales/zh-CN.yml | 14 +
examples/vitesse/netlify.toml | 16 +
examples/vitesse/package.json | 82 +
examples/vitesse/pnpm-lock.yaml | 11510 ++++++++++++++++
examples/vitesse/public/_headers | 3 +
examples/vitesse/public/favicon-dark.svg | 3 +
examples/vitesse/public/favicon.svg | 3 +
examples/vitesse/public/pwa-192x192.png | Bin 0 -> 3914 bytes
examples/vitesse/public/pwa-512x512.png | Bin 0 -> 10261 bytes
examples/vitesse/public/safari-pinned-tab.svg | 41 +
examples/vitesse/src/App.vue | 29 +
examples/vitesse/src/auto-imports.d.ts | 885 ++
examples/vitesse/src/components.d.ts | 17 +
examples/vitesse/src/components/README.md | 9 +
.../vitesse/src/components/TheCounter.vue | 19 +
examples/vitesse/src/components/TheFooter.vue | 37 +
examples/vitesse/src/components/TheInput.vue | 20 +
examples/vitesse/src/composables/dark.ts | 4 +
examples/vitesse/src/layouts/404.vue | 18 +
examples/vitesse/src/layouts/README.md | 14 +
examples/vitesse/src/layouts/default.vue | 18 +
examples/vitesse/src/layouts/home.vue | 12 +
examples/vitesse/src/layouts/testlayout.vue | 12 +
examples/vitesse/src/main.ts | 26 +
examples/vitesse/src/modules/README.md | 11 +
examples/vitesse/src/modules/i18n.ts | 50 +
examples/vitesse/src/modules/nprogress.ts | 14 +
examples/vitesse/src/modules/pinia.ts | 17 +
examples/vitesse/src/modules/pwa.ts | 14 +
examples/vitesse/src/pages/README.md | 20 +
examples/vitesse/src/pages/[...all].vue | 14 +
examples/vitesse/src/pages/about.md | 21 +
examples/vitesse/src/pages/hi/[name].vue | 47 +
examples/vitesse/src/pages/index.vue | 56 +
examples/vitesse/src/pages/test/index.vue | 8 +
examples/vitesse/src/shims.d.ts | 18 +
examples/vitesse/src/stores/user.ts | 34 +
examples/vitesse/src/styles/main.css | 29 +
examples/vitesse/src/styles/markdown.css | 25 +
examples/vitesse/src/typed-router.d.ts | 146 +
examples/vitesse/src/types.ts | 3 +
.../test/__snapshots__/component.test.ts.snap | 3 +
examples/vitesse/test/basic.test.ts | 7 +
examples/vitesse/test/component.test.ts | 28 +
examples/vitesse/tsconfig.json | 37 +
examples/vitesse/uno.config.ts | 37 +
examples/vitesse/vite.config.ts | 168 +
82 files changed, 14483 insertions(+)
create mode 100644 examples/spa/src/pages/second/index.vue
create mode 100644 examples/vitesse/.dockerignore
create mode 100644 examples/vitesse/.editorconfig
create mode 100644 examples/vitesse/.gitignore
create mode 100644 examples/vitesse/.npmrc
create mode 100644 examples/vitesse/.vscode/extensions.json
create mode 100644 examples/vitesse/.vscode/settings.json
create mode 100644 examples/vitesse/Dockerfile
create mode 100644 examples/vitesse/LICENSE
create mode 100644 examples/vitesse/README.md
create mode 100644 examples/vitesse/README.zh-CN.md
create mode 100644 examples/vitesse/cypress.config.ts
create mode 100644 examples/vitesse/cypress/e2e/basic.spec.ts
create mode 100644 examples/vitesse/cypress/tsconfig.json
create mode 100644 examples/vitesse/eslint.config.js
create mode 100644 examples/vitesse/index.html
create mode 100644 examples/vitesse/locales/README.md
create mode 100644 examples/vitesse/locales/ar.yml
create mode 100644 examples/vitesse/locales/de.yml
create mode 100644 examples/vitesse/locales/en.yml
create mode 100644 examples/vitesse/locales/es.yml
create mode 100644 examples/vitesse/locales/fr.yml
create mode 100644 examples/vitesse/locales/id.yml
create mode 100644 examples/vitesse/locales/it.yml
create mode 100644 examples/vitesse/locales/ja.yml
create mode 100644 examples/vitesse/locales/ka.yml
create mode 100644 examples/vitesse/locales/ko.yml
create mode 100644 examples/vitesse/locales/pl.yml
create mode 100644 examples/vitesse/locales/pt-BR.yml
create mode 100644 examples/vitesse/locales/ru.yml
create mode 100644 examples/vitesse/locales/tr.yml
create mode 100644 examples/vitesse/locales/uk.yml
create mode 100644 examples/vitesse/locales/uz.yml
create mode 100644 examples/vitesse/locales/vi.yml
create mode 100644 examples/vitesse/locales/zh-CN.yml
create mode 100755 examples/vitesse/netlify.toml
create mode 100644 examples/vitesse/package.json
create mode 100644 examples/vitesse/pnpm-lock.yaml
create mode 100644 examples/vitesse/public/_headers
create mode 100644 examples/vitesse/public/favicon-dark.svg
create mode 100644 examples/vitesse/public/favicon.svg
create mode 100644 examples/vitesse/public/pwa-192x192.png
create mode 100644 examples/vitesse/public/pwa-512x512.png
create mode 100644 examples/vitesse/public/safari-pinned-tab.svg
create mode 100644 examples/vitesse/src/App.vue
create mode 100644 examples/vitesse/src/auto-imports.d.ts
create mode 100644 examples/vitesse/src/components.d.ts
create mode 100644 examples/vitesse/src/components/README.md
create mode 100644 examples/vitesse/src/components/TheCounter.vue
create mode 100644 examples/vitesse/src/components/TheFooter.vue
create mode 100644 examples/vitesse/src/components/TheInput.vue
create mode 100644 examples/vitesse/src/composables/dark.ts
create mode 100644 examples/vitesse/src/layouts/404.vue
create mode 100644 examples/vitesse/src/layouts/README.md
create mode 100644 examples/vitesse/src/layouts/default.vue
create mode 100644 examples/vitesse/src/layouts/home.vue
create mode 100644 examples/vitesse/src/layouts/testlayout.vue
create mode 100644 examples/vitesse/src/main.ts
create mode 100644 examples/vitesse/src/modules/README.md
create mode 100644 examples/vitesse/src/modules/i18n.ts
create mode 100644 examples/vitesse/src/modules/nprogress.ts
create mode 100644 examples/vitesse/src/modules/pinia.ts
create mode 100644 examples/vitesse/src/modules/pwa.ts
create mode 100644 examples/vitesse/src/pages/README.md
create mode 100755 examples/vitesse/src/pages/[...all].vue
create mode 100644 examples/vitesse/src/pages/about.md
create mode 100644 examples/vitesse/src/pages/hi/[name].vue
create mode 100644 examples/vitesse/src/pages/index.vue
create mode 100644 examples/vitesse/src/pages/test/index.vue
create mode 100644 examples/vitesse/src/shims.d.ts
create mode 100644 examples/vitesse/src/stores/user.ts
create mode 100755 examples/vitesse/src/styles/main.css
create mode 100644 examples/vitesse/src/styles/markdown.css
create mode 100644 examples/vitesse/src/typed-router.d.ts
create mode 100644 examples/vitesse/src/types.ts
create mode 100644 examples/vitesse/test/__snapshots__/component.test.ts.snap
create mode 100644 examples/vitesse/test/basic.test.ts
create mode 100644 examples/vitesse/test/component.test.ts
create mode 100644 examples/vitesse/tsconfig.json
create mode 100644 examples/vitesse/uno.config.ts
create mode 100644 examples/vitesse/vite.config.ts
diff --git a/examples/spa/src/pages/index.vue b/examples/spa/src/pages/index.vue
index 091aa85..792c721 100644
--- a/examples/spa/src/pages/index.vue
+++ b/examples/spa/src/pages/index.vue
@@ -32,6 +32,11 @@
module 2 layout
+
+
+ second level layout
+
+
diff --git a/examples/spa/src/pages/second/index.vue b/examples/spa/src/pages/second/index.vue
new file mode 100644
index 0000000..ea0a077
--- /dev/null
+++ b/examples/spa/src/pages/second/index.vue
@@ -0,0 +1,13 @@
+
+
+ Second level layout.
+
+
+
+
+{
+ meta: {
+ layout: "second"
+ }
+}
+
diff --git a/examples/vitesse/.dockerignore b/examples/vitesse/.dockerignore
new file mode 100644
index 0000000..f06235c
--- /dev/null
+++ b/examples/vitesse/.dockerignore
@@ -0,0 +1,2 @@
+node_modules
+dist
diff --git a/examples/vitesse/.editorconfig b/examples/vitesse/.editorconfig
new file mode 100644
index 0000000..9d08a1a
--- /dev/null
+++ b/examples/vitesse/.editorconfig
@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
diff --git a/examples/vitesse/.gitignore b/examples/vitesse/.gitignore
new file mode 100644
index 0000000..cef0d8d
--- /dev/null
+++ b/examples/vitesse/.gitignore
@@ -0,0 +1,10 @@
+.DS_Store
+.vite-ssg-dist
+.vite-ssg-temp
+*.local
+dist
+dist-ssr
+node_modules
+.idea/
+*.log
+cypress/downloads
diff --git a/examples/vitesse/.npmrc b/examples/vitesse/.npmrc
new file mode 100644
index 0000000..cf04042
--- /dev/null
+++ b/examples/vitesse/.npmrc
@@ -0,0 +1,2 @@
+shamefully-hoist=true
+strict-peer-dependencies=false
diff --git a/examples/vitesse/.vscode/extensions.json b/examples/vitesse/.vscode/extensions.json
new file mode 100644
index 0000000..d066795
--- /dev/null
+++ b/examples/vitesse/.vscode/extensions.json
@@ -0,0 +1,13 @@
+{
+ "recommendations": [
+ "antfu.iconify",
+ "antfu.unocss",
+ "antfu.vite",
+ "antfu.goto-alias",
+ "csstools.postcss",
+ "dbaeumer.vscode-eslint",
+ "vue.volar",
+ "lokalise.i18n-ally",
+ "streetsidesoftware.code-spell-checker"
+ ]
+}
diff --git a/examples/vitesse/.vscode/settings.json b/examples/vitesse/.vscode/settings.json
new file mode 100644
index 0000000..8b36442
--- /dev/null
+++ b/examples/vitesse/.vscode/settings.json
@@ -0,0 +1,51 @@
+{
+ "cSpell.words": ["Vitesse", "Vite", "unocss", "vitest", "vueuse", "pinia", "demi", "antfu", "iconify", "intlify", "vitejs", "unplugin", "pnpm"],
+ "i18n-ally.sourceLanguage": "en",
+ "i18n-ally.keystyle": "nested",
+ "i18n-ally.localesPaths": "locales",
+ "i18n-ally.sortKeys": true,
+
+ // Enable the ESlint flat config support
+ "eslint.experimental.useFlatConfig": true,
+
+ // Disable the default formatter
+ "prettier.enable": false,
+ "editor.formatOnSave": false,
+
+ // Auto fix
+ "editor.codeActionsOnSave": {
+ "source.fixAll.eslint": "explicit",
+ "source.organizeImports": "never"
+ },
+
+ // Silent the stylistic rules in you IDE, but still auto fix them
+ "eslint.rules.customizations": [
+ { "rule": "style/*", "severity": "off" },
+ { "rule": "format/*", "severity": "off" },
+ { "rule": "*-indent", "severity": "off" },
+ { "rule": "*-spacing", "severity": "off" },
+ { "rule": "*-spaces", "severity": "off" },
+ { "rule": "*-order", "severity": "off" },
+ { "rule": "*-dangle", "severity": "off" },
+ { "rule": "*-newline", "severity": "off" },
+ { "rule": "*quotes", "severity": "off" },
+ { "rule": "*semi", "severity": "off" }
+ ],
+
+ // The following is optional.
+ // It's better to put under project setting `.vscode/settings.json`
+ // to avoid conflicts with working with different eslint configs
+ // that does not support all formats.
+ "eslint.validate": [
+ "javascript",
+ "javascriptreact",
+ "typescript",
+ "typescriptreact",
+ "vue",
+ "html",
+ "markdown",
+ "json",
+ "jsonc",
+ "yaml"
+ ]
+}
diff --git a/examples/vitesse/Dockerfile b/examples/vitesse/Dockerfile
new file mode 100644
index 0000000..3e3a684
--- /dev/null
+++ b/examples/vitesse/Dockerfile
@@ -0,0 +1,18 @@
+FROM node:20-alpine as build-stage
+
+WORKDIR /app
+RUN corepack enable
+
+COPY .npmrc package.json pnpm-lock.yaml ./
+RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
+ pnpm install --frozen-lockfile
+
+COPY . .
+RUN pnpm build
+
+FROM nginx:stable-alpine as production-stage
+
+COPY --from=build-stage /app/dist /usr/share/nginx/html
+EXPOSE 80
+
+CMD ["nginx", "-g", "daemon off;"]
diff --git a/examples/vitesse/LICENSE b/examples/vitesse/LICENSE
new file mode 100644
index 0000000..670b1b3
--- /dev/null
+++ b/examples/vitesse/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020-PRESENT Anthony Fu
+
+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/examples/vitesse/README.md b/examples/vitesse/README.md
new file mode 100644
index 0000000..371c6c3
--- /dev/null
+++ b/examples/vitesse/README.md
@@ -0,0 +1,218 @@
+
+
+
+
+
+Mocking up web app with Vitesse (speed)
+
+
+
+
+
+Live Demo
+
+
+
+
+> **Note**: This template is created during the early transition of Vue 3 and Vite. At this moment, if you are seeking for better Vue developer experience and more consistent maintenance, we recommend using [Nuxt 3](https://nuxt.com) instead (it also works perfectly with SPA or SSG as needed). This template still serves as a reference, but expect slower updates.
+
+
+
+
+English | 简体中文
+
+
+
+
+
+## Features
+
+- ⚡️ [Vue 3](https://github.com/vuejs/core), [Vite](https://github.com/vitejs/vite), [pnpm](https://pnpm.io/), [esbuild](https://github.com/evanw/esbuild) - born with fastness
+
+- 🗂 [File based routing](./src/pages)
+
+- 📦 [Components auto importing](./src/components)
+
+- 🍍 [State Management via Pinia](https://pinia.vuejs.org/)
+
+- 📑 [Layout system](./src/layouts)
+
+- 📲 [PWA](https://github.com/antfu/vite-plugin-pwa)
+
+- 🎨 [UnoCSS](https://github.com/antfu/unocss) - the instant on-demand atomic CSS engine
+
+- 😃 [Use icons from any icon sets with classes](https://github.com/antfu/unocss/tree/main/packages/preset-icons)
+
+- 🌍 [I18n ready](./locales)
+
+- 🔎 [Component Preview](https://github.com/johnsoncodehk/vite-plugin-vue-component-preview)
+
+- 🗒 [Markdown Support](https://github.com/unplugin/unplugin-vue-markdown)
+
+- 🔥 Use the [new `
+
+
+
+
+
+ This website requires JavaScript to function properly. Please enable
+ JavaScript to continue.
+
+
+