From bfc2a806161610712cbb17f5c01ed5f0e4ac07a6 Mon Sep 17 00:00:00 2001 From: zyy <532612154@qq.com> Date: Tue, 24 Oct 2023 09:51:07 +0800 Subject: [PATCH] Initial commit --- .editorconfig | 9 + .github/FUNDING.yml | 1 + .github/workflows/test.yml | 47 + .gitignore | 9 + .npmrc | 2 + .vscode/extensions.json | 11 + .vscode/settings.json | 48 + LICENSE | 21 + README.md | 88 + README.zh-CN.md | 87 + auto-imports.d.ts | 854 +++ components.d.ts | 16 + eslint.config.js | 7 + index.html | 25 + netlify.toml | 11 + package.json | 53 + pnpm-lock.yaml | 6224 +++++++++++++++++++++ public/favicon.svg | 9 + shims.d.ts | 6 + src/App.vue | 6 + src/components/README.md | 9 + src/components/TheCounter.vue | 19 + src/components/TheFooter.vue | 15 + src/components/TheInput.vue | 18 + src/composables/dark.ts | 2 + src/composables/index.ts | 1 + src/main.ts | 16 + src/pages/README.md | 20 + src/pages/[...all].vue | 5 + src/pages/hi/[name].vue | 22 + src/pages/index.vue | 46 + src/styles/main.css | 11 + test/__snapshots__/component.test.ts.snap | 3 + test/basic.test.ts | 7 + test/component.test.ts | 22 + tsconfig.json | 27 + uno.config.ts | 29 + vite.config.ts | 63 + 38 files changed, 7869 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/test.yml create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 LICENSE create mode 100644 README.md create mode 100644 README.zh-CN.md create mode 100644 auto-imports.d.ts create mode 100644 components.d.ts create mode 100644 eslint.config.js create mode 100644 index.html create mode 100755 netlify.toml create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 public/favicon.svg create mode 100644 shims.d.ts create mode 100644 src/App.vue create mode 100644 src/components/README.md create mode 100644 src/components/TheCounter.vue create mode 100644 src/components/TheFooter.vue create mode 100644 src/components/TheInput.vue create mode 100644 src/composables/dark.ts create mode 100644 src/composables/index.ts create mode 100644 src/main.ts create mode 100644 src/pages/README.md create mode 100755 src/pages/[...all].vue create mode 100644 src/pages/hi/[name].vue create mode 100644 src/pages/index.vue create mode 100755 src/styles/main.css create mode 100644 test/__snapshots__/component.test.ts.snap create mode 100644 test/basic.test.ts create mode 100644 test/component.test.ts create mode 100644 tsconfig.json create mode 100644 uno.config.ts create mode 100644 vite.config.ts diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9d08a1a --- /dev/null +++ b/.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/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..7246382 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: antfu diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d62684c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + build: + runs-on: ${{ matrix.os }} + + timeout-minutes: 10 + + strategy: + matrix: + node_version: [lts/*] + os: [ubuntu-latest, windows-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + + - name: Set node version to ${{ matrix.node_version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node_version }} + cache: pnpm + + - name: Install + run: pnpm i + + - name: Build + run: pnpm run build + + - name: Test + run: pnpm run test + + - name: Lint + run: pnpm run lint + + - name: TypeCheck + run: pnpm run typecheck diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..912c396 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +.vite-ssg-dist +.vite-ssg-temp +*.local +dist +dist-ssr +node_modules +.idea/ +*.log diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..cf04042 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +shamefully-hoist=true +strict-peer-dependencies=false diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..bbd882b --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + "recommendations": [ + "antfu.vite", + "antfu.iconify", + "antfu.unocss", + "antfu.goto-alias", + "vue.volar", + "dbaeumer.vscode-eslint", + "EditorConfig.EditorConfig" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..328a19d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,48 @@ +{ + "files.associations": { + "*.css": "postcss" + }, + + // 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": "explicit", + "source.organizeImports": "never" + }, + + // Silent the stylistic rules in you IDE, but still auto fix them + "eslint.rules.customizations": [ + { "rule": "style/*", "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/LICENSE b/LICENSE new file mode 100644 index 0000000..670b1b3 --- /dev/null +++ b/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/README.md b/README.md new file mode 100644 index 0000000..0bbdc55 --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +
+ +
+ ++English | 简体中文 + +
+ +## Features + +- ⚡️ [Vue 3](https://github.com/vuejs/core), [Vite 3](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) + +- 🎨 [UnoCSS](https://github.com/antfu/unocss) - The instant on-demand atomic CSS engine. + +- 😃 Use icons from any icon sets in [Pure CSS](https://github.com/antfu/unocss/tree/main/packages/preset-icons) + +- 🔥 Use the [new ` + +