Skip to content

Commit

Permalink
chore: update fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 6, 2022
1 parent f3f4191 commit e9f0988
Show file tree
Hide file tree
Showing 42 changed files with 1,487 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fixture/a.ts

This file was deleted.

9 changes: 9 additions & 0 deletions fixtures/vitesse/.editorconfig
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions fixtures/vitesse/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
.vite-ssg-dist
.vite-ssg-temp
*.local
dist
dist-ssr
node_modules
.idea/
*.log
21 changes: 21 additions & 0 deletions fixtures/vitesse/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-2021 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.
1 change: 1 addition & 0 deletions fixtures/vitesse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a fixture cloned from https://github.com/antfu/vitesse. It's only for lint checking and does not run.
10 changes: 10 additions & 0 deletions fixtures/vitesse/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3333',
chromeWebSecurity: false,
specPattern: 'cypress/e2e/**/*.spec.*',
supportFile: false,
},
})
36 changes: 36 additions & 0 deletions fixtures/vitesse/cypress/e2e/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
context('Basic', () => {
beforeEach(() => {
cy.visit('/')
})

it('basic nav', () => {
cy.url()
.should('eq', 'http://localhost:3333/')

cy.contains('[Home Layout]')
.should('exist')

cy.get('#input')
.type('Vitesse{Enter}')
.url()
.should('eq', 'http://localhost:3333/hi/Vitesse')

cy.contains('[Default Layout]')
.should('exist')

cy.get('[btn]')
.click()
.url()
.should('eq', 'http://localhost:3333/')
})

it('markdown', () => {
cy.get('[title="About"]')
.click()
.url()
.should('eq', 'http://localhost:3333/about')

cy.get('.shiki')
.should('exist')
})
})
22 changes: 22 additions & 0 deletions fixtures/vitesse/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon" href="/pwa-192x192.png">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9">
<meta name="msapplication-TileColor" content="#00aba9">
<script>
(function () {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
const setting = localStorage.getItem('vueuse-color-scheme') || 'auto'
if (setting === 'dark' || (prefersDark && setting !== 'light'))
document.documentElement.classList.toggle('dark', true)
})()
</script>
</head>
<body class="font-sans">
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
62 changes: 62 additions & 0 deletions fixtures/vitesse/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"type": "module",
"private": true,
"packageManager": "pnpm@7.8.0",
"scripts": {
"build": "vite-ssg build",
"dev": "vite --port 3333 --open",
"lint": "eslint .",
"preview": "vite preview",
"preview-https": "serve dist",
"test": "vitest",
"test:e2e": "cypress open",
"test:unit": "vitest",
"typecheck": "vue-tsc --noEmit",
"up": "taze major -I"
},
"dependencies": {
"@unocss/reset": "^0.45.8",
"@vueuse/core": "^9.1.0",
"@vueuse/head": "^0.7.9",
"nprogress": "^0.2.0",
"pinia": "^2.0.17",
"vue": "^3.2.37",
"vue-demi": "^0.13.6",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.3"
},
"devDependencies": {
"@antfu/eslint-config": "^0.25.2",
"@iconify-json/carbon": "^1.1.7",
"@intlify/vite-plugin-vue-i18n": "^6.0.0",
"@types/markdown-it-link-attributes": "^3.0.1",
"@types/nprogress": "^0.2.0",
"@vitejs/plugin-vue": "^3.0.1",
"@vue/test-utils": "^2.0.2",
"critters": "^0.0.16",
"cross-env": "^7.0.3",
"cypress": "^10.4.0",
"eslint": "^8.21.0",
"eslint-plugin-cypress": "^2.12.1",
"https-localhost": "^4.7.1",
"markdown-it-link-attributes": "^4.0.0",
"markdown-it-shiki": "^0.5.1",
"pnpm": "^7.8.0",
"shiki": "^0.10.1",
"taze": "^0.7.6",
"typescript": "^4.7.4",
"unocss": "^0.45.5",
"unplugin-auto-import": "^0.11.0",
"unplugin-vue-components": "^0.22.0",
"vite": "^3.0.4",
"vite-plugin-inspect": "^0.6.0",
"vite-plugin-pages": "^0.25.0",
"vite-plugin-pwa": "^0.12.3",
"vite-plugin-vue-layouts": "^0.7.0",
"vite-plugin-vue-markdown": "^0.21.1",
"vite-ssg": "^0.20.2",
"vite-ssg-sitemap": "^0.3.1",
"vitest": "^0.21.0",
"vue-tsc": "^0.39.5"
}
}
26 changes: 26 additions & 0 deletions fixtures/vitesse/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
// https://github.com/vueuse/head
// you can use this to manipulate the document head in any components,
// they will be rendered correctly in the html results with vite-ssg
useHead({
title: 'Vitesse',
meta: [
{ name: 'description', content: 'Opinionated Vite Starter Template' },
{
name: 'theme-color',
content: computed(() => isDark.value ? '#00aba9' : '#ffffff'),
},
],
link: [
{
rel: 'icon',
type: 'image/svg+xml',
href: computed(() => preferredDark.value ? '/favicon-dark.svg' : '/favicon.svg'),
},
],
})
</script>

<template>
<RouterView />
</template>

0 comments on commit e9f0988

Please sign in to comment.