From c79780974e15228f802196021ebab13a5e2934cc Mon Sep 17 00:00:00 2001 From: callqh <528851597@qq.com> Date: Sat, 13 Apr 2024 19:25:19 +0800 Subject: [PATCH] feat: add tailwind --- .github/ISSUE_TEMPLATE/bug_report.yml | 51 + .github/ISSUE_TEMPLATE/config.yml | 5 + .github/ISSUE_TEMPLATE/feature_request.yml | 31 + .github/PULL_REQUEST_TEMPLATE.md | 13 + .github/dependabot.yml | 16 - .github/renovate.json5 | 23 + .github/workflows/lint-pr-title.yml | 34 + .husky/pre-commit | 2 +- .vscode/settings.json | 6 +- README.md | 22 +- biome.json | 3 + farm.config.ts | 32 +- index.html | 5 +- package.json | 55 +- pnpm-lock.yaml | 1652 ++++++++++++++++---- postcss.config.js | 7 + src/assets/login.svg | 1 + src/assets/register.svg | 1 + src/config/const.ts | 7 + src/config/menu.tsx | 24 + src/hooks/useRouterGuard.ts | 20 + src/index.css | 69 - src/index.tsx | 12 +- src/layout/header.tsx | 42 + src/layout/index.tsx | 73 + src/layout/menu.tsx | 67 + src/layout/style.less | 3 + src/pages/index.tsx | 38 +- src/pages/login/index.tsx | 73 + src/pages/login/loginForm.tsx | 45 + src/pages/login/registerForm.tsx | 45 + src/pages/login/style.less | 149 ++ src/pages/main.css | 42 - src/style/rest.less | 7 + src/style/tailwind.css | 3 + src/utils/cookie.ts | 46 + tailwind.config.js | 11 + tsconfig.json | 9 +- 38 files changed, 2244 insertions(+), 500 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/dependabot.yml create mode 100644 .github/renovate.json5 create mode 100644 .github/workflows/lint-pr-title.yml create mode 100644 postcss.config.js create mode 100644 src/assets/login.svg create mode 100644 src/assets/register.svg create mode 100644 src/config/const.ts create mode 100644 src/config/menu.tsx create mode 100644 src/hooks/useRouterGuard.ts delete mode 100644 src/index.css create mode 100644 src/layout/header.tsx create mode 100644 src/layout/index.tsx create mode 100644 src/layout/menu.tsx create mode 100644 src/layout/style.less create mode 100644 src/pages/login/index.tsx create mode 100644 src/pages/login/loginForm.tsx create mode 100644 src/pages/login/registerForm.tsx create mode 100644 src/pages/login/style.less delete mode 100644 src/pages/main.css create mode 100644 src/style/rest.less create mode 100644 src/style/tailwind.css create mode 100644 src/utils/cookie.ts create mode 100644 tailwind.config.js diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..215f248 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,51 @@ +name: "\U0001F41E Bug report" +description: Create a report to help us improve +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + This form is only for submitting bug reports. If you have a usage question + or are unsure if this is really a bug, make sure to: + + - Node version greater than or equal to 16.8 + + Also try to search for your issue - it may have already been answered or even fixed in the development branch. + However, if you find that an old, closed issue still persists in the latest version, + you should open a new issue using the form below instead of commenting on the old issue. + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps to reproduce + description: | + What do we need to do after opening your repro in order to make the bug happen? Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner. Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format lists and code. + placeholder: Steps to reproduce + validations: + required: true + - type: textarea + id: expected + attributes: + label: What is expected? + validations: + required: true + - type: textarea + id: actually-happening + attributes: + label: What is actually happening? + validations: + required: true + - type: textarea + id: system-info + attributes: + label: System Info + description: Output of `npx envinfo --system --npmPackages @farmfe/core --binaries --browsers` + render: Shell + placeholder: System, Binaries, Browsers + validations: + required: true + - type: textarea + id: additional-comments + attributes: + label: Any additional comments? + description: e.g. some background/context of how you ran into this bug. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e398147 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Discord server + url: https://discord.gg/ruUjarvEP9 + about: You can ask questions here if you prefer Discord. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..a436f56 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,31 @@ +name: "\U0001F680 New feature" +description: Suggest an idea for Farm +labels: [":sparkles: feature request"] +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + This form is only for submitting feature requests. If you have a usage question + or are unsure if this is really a bug, make sure to: + Also try to search for your issue - another user may have already requested something similar! + + - type: textarea + id: problem-description + attributes: + label: What problem does this feature solve? + description: | + Explain your use case, context, and rationale behind this feature request. More importantly, what is the **end user experience** you are trying to build that led to the need for this feature? + placeholder: Problem description + validations: + required: true + - type: textarea + id: proposed-API + attributes: + label: What does the proposed API look like? + description: | + Describe how you propose to solve the problem and provide code samples of how the API would work once implemented. Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format your code blocks. + placeholder: Steps to reproduce + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..415bcf0 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ + + +**Description:** + + + +**BREAKING CHANGE:** + + + +**Related issue (if exists):** diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 792bba6..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,16 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: - - package-ecosystem: "npm" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "daily" - reviewers: - - "callqh" - allow: - - dependency-name: "@farmfe/*" - - dependency-name: "@biomejs/*" diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..a67c6a6 --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,23 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:base"], + "labels": ["dependencies"], + "schedule": ["after 6pm every day",], + "rangeStrategy": "bump", + "packageRules": [ + { + "matchPackagePatterns": ["*"], + "enabled": false, + }, + { + "matchPackagePatterns": ["^@farmfe/*"], + "groupName": "farmfe-packages", + "schedule": ["after 6pm every day"], + "enabled": true, + }, + { + "depTypeList": ["peerDependencies"], + "enabled": false, + }, + ], +} diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 0000000..915bb08 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,34 @@ +name: Lint Pr Title + +on: [pull_request] + +jobs: + lint-pr-title: + name: Validating PR title + runs-on: ubuntu-latest + steps: + # https://github.com/amannn/action-semantic-pull-request + - uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f # v5.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed (newline-delimited). + # Derived from https://github.com/commitizen/conventional-commit-types + types: | + fix + feat + docs + style + refactor + perf + test + build + ci + chore + revert + release + # Configure that a scope must always be provided. + requireScope: false + # Configure additional validation for the subject based on a regex. + ignoreLabels: | + bot diff --git a/.husky/pre-commit b/.husky/pre-commit index b867ec2..2312dc5 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -pnpm check +npx lint-staged diff --git a/.vscode/settings.json b/.vscode/settings.json index a1ae355..899aec7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,9 @@ "editor.formatOnSave": true, "[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" - } + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "cSpell.words": ["Sider"] } diff --git a/README.md b/README.md index b3269c3..7ff3e9a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
@@ -21,19 +21,25 @@
---
-## 使用
-1. 将改仓库`Fork`到你的仓库中
-2. `npx degit