diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist 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/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0fcce89 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: CI + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + - uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: pnpm + + - name: Install + run: pnpm install + + - name: Lint + run: pnpm run lint + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + - uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: pnpm + + - name: Install + run: pnpm install + + - name: Typecheck + run: pnpm run typecheck + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node-version: [18.x, 20.x] + os: [ubuntu-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: https://registry.npmjs.org/ + cache: pnpm + + - run: pnpm install + - run: pnpm run test:unit + + test-e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cache + key: cypress-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + + - uses: pnpm/action-setup@v2 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: lts/* + registry-url: https://registry.npmjs.org/ + cache: pnpm + + - run: pnpm install + + - name: Cypress PNPM Patch + run: cp pnpm-lock.yaml package-lock.json + + - name: Cypress + uses: cypress-io/github-action@v4 + with: + install-command: echo + build: pnpm run build + start: npx vite preview --port 3333 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cef0d8d --- /dev/null +++ b/.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/.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..d066795 --- /dev/null +++ b/.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/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8b36442 --- /dev/null +++ b/.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/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e3a684 --- /dev/null +++ b/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/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..371c6c3 --- /dev/null +++ b/README.md @@ -0,0 +1,218 @@ +
+ +
+ +
+Mocking up web app with Vitesse(speed)
+
+Live Demo +
+ ++English | 简体中文 + +
+ +