mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-25 16:16:20 +08:00
Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3f04f6b01f | ||
![]() |
31dd0d5b40 | ||
![]() |
8ffc853b86 | ||
![]() |
a9a14fd81a | ||
![]() |
d41bd31fcd | ||
![]() |
5f4d3f2bce | ||
![]() |
a27b1c40e5 | ||
![]() |
1d38fb647e | ||
![]() |
861f39b519 | ||
![]() |
a629262c9d | ||
![]() |
08391ad53e | ||
![]() |
d9ba9917ff | ||
![]() |
279a3a4c21 | ||
![]() |
891fd803f7 | ||
![]() |
4bd4f7490b | ||
![]() |
84c8fb0ecc | ||
![]() |
e27be2d47a | ||
![]() |
9dce5b44ec | ||
![]() |
feda1484ab | ||
![]() |
f26b3eddb2 | ||
![]() |
72ed2d35b9 | ||
![]() |
93c619ea47 | ||
![]() |
0c18912f4e | ||
![]() |
6c002bb9c8 | ||
![]() |
4f5783d00b | ||
![]() |
e5ec8e6b51 | ||
![]() |
36e33ea48a | ||
![]() |
0d46a5471f | ||
![]() |
773b36aa17 | ||
![]() |
e29352d0f1 | ||
![]() |
7994d664fd | ||
![]() |
ccaa32125a | ||
![]() |
0619faf61e | ||
![]() |
b6415fad2d | ||
![]() |
d3ed6757ac | ||
![]() |
27ffc9e71b | ||
![]() |
bf8a5ffb5d | ||
![]() |
8ed2adb916 | ||
![]() |
43224a4643 | ||
![]() |
f13fda408b | ||
![]() |
530159140c | ||
![]() |
e544119aa3 | ||
![]() |
8313be8e08 | ||
![]() |
d5f355120a |
15
.github/CODEOWNERS
vendored
15
.github/CODEOWNERS
vendored
@@ -1,7 +1,14 @@
|
||||
# default onwer
|
||||
* anncwb@126.com
|
||||
* anncwb@126.com vince292007@gmail.com
|
||||
|
||||
# vben core onwer
|
||||
/packages/@core/ anncwb@126.com
|
||||
/internal/ anncwb@126.com
|
||||
/scripts/ anncwb@126.com
|
||||
/.github/ anncwb@126.com vince292007@gmail.com
|
||||
/.vscode/ anncwb@126.com vince292007@gmail.com
|
||||
/packages/ anncwb@126.com vince292007@gmail.com
|
||||
/packages/@core/ anncwb@126.com vince292007@gmail.com
|
||||
/internal/ anncwb@126.com vince292007@gmail.com
|
||||
/scripts/ anncwb@126.com vince292007@gmail.com
|
||||
|
||||
# vben team onwer
|
||||
apps/ anncwb@126.com vince292007@gmail.com @vbenjs/team-v5
|
||||
docs/ anncwb@126.com vince292007@gmail.com @vbenjs/team-v5
|
||||
|
4
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -14,8 +14,8 @@ body:
|
||||
label: Version
|
||||
description: What version of our software are you running?
|
||||
options:
|
||||
- Vben Admin Pro
|
||||
- Vben Admin
|
||||
- Vben Admin V5
|
||||
- Vben Admin V2
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
|
4
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
@@ -13,8 +13,8 @@ body:
|
||||
label: Version
|
||||
description: What version of our software are you running?
|
||||
options:
|
||||
- Vben Admin Pro
|
||||
- Vben Admin
|
||||
- Vben Admin V5
|
||||
- Vben Admin V2
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
|
40
.github/actions/setup-node/action.yml
vendored
Normal file
40
.github/actions/setup-node/action.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: "Setup Node"
|
||||
|
||||
description: "Setup node and pnpm"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Get pnpm store directory
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/cache@v4
|
||||
name: Setup pnpm cache
|
||||
if: ${{ github.ref_name == 'main' }}
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- uses: actions/cache/restore@v4
|
||||
if: ${{ github.ref_name != 'main' }}
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
@@ -1,4 +1,5 @@
|
||||
name: Dependabot post-update
|
||||
# name: Dependabot post-update
|
||||
name: Build detection
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened]
|
||||
@@ -12,13 +13,14 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
post-update:
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
# if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -27,23 +29,13 @@ jobs:
|
||||
|
||||
- name: Checkout out pull request
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr checkout ${{ github.event.pull_request.number }}
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Test and Build
|
||||
- name: Build
|
||||
run: |
|
||||
pnpm run test:unit
|
||||
pnpm run build
|
19
.github/workflows/changeset-version.yml
vendored
19
.github/workflows/changeset-version.yml
vendored
@@ -23,27 +23,14 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Create Release Pull Request
|
||||
uses: changesets/action@v1
|
||||
@@ -52,4 +39,4 @@ jobs:
|
||||
commit: "chore: bump versions"
|
||||
title: "chore: bump versions"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
68
.github/workflows/ci.yml
vendored
68
.github/workflows/ci.yml
vendored
@@ -5,7 +5,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- "releases/*"
|
||||
|
||||
permissions:
|
||||
@@ -22,11 +21,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
# - macos-latest
|
||||
# - windows-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -39,27 +37,8 @@ jobs:
|
||||
with:
|
||||
run_install: false
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Find pnpm store path
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup pnpm cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
# - name: Check Git version
|
||||
# run: git --version
|
||||
@@ -81,11 +60,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
# - macos-latest
|
||||
# - windows-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -93,51 +71,37 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Lint
|
||||
run: pnpm run lint
|
||||
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Typecheck
|
||||
run: pnpm check:type
|
||||
|
||||
# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
|
||||
- name: Check workflow files
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
||||
./actionlint -color -shellcheck=""
|
||||
|
26
.github/workflows/deploy.yml
vendored
26
.github/workflows/deploy.yml
vendored
@@ -8,12 +8,8 @@ on:
|
||||
jobs:
|
||||
deploy-push-ftp:
|
||||
name: Deploy Push Ftp
|
||||
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && contains(github.event.head_commit.message, '[deploy]')
|
||||
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]')
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -24,19 +20,17 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-antd/.env.production
|
||||
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-antd/.env.production
|
||||
cat ./apps/web-antd/.env.production
|
||||
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-ele/.env.production
|
||||
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-ele/.env.production
|
||||
cat ./apps/web-ele/.env.production
|
||||
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-naive/.env.production
|
||||
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-naive/.env.production
|
||||
cat ./apps/web-naive/.env.production
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build
|
||||
|
11
.github/workflows/draft.yml
vendored
11
.github/workflows/draft.yml
vendored
@@ -7,11 +7,18 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
permissions:
|
||||
# write permission is required to create a github release
|
||||
contents: write
|
||||
# write permission is required for autolabeler
|
||||
# otherwise, read permission is required at least
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@master
|
||||
- uses: release-drafter/release-drafter@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
6
.github/workflows/issue-close-require.yml
vendored
6
.github/workflows/issue-close-require.yml
vendored
@@ -6,6 +6,10 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -16,6 +20,6 @@ jobs:
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "close-issues" # 执行动作:关闭 Issues
|
||||
token: ${{ secrets.ACCESS_TOKEN }} # GitHub Token,用于认证
|
||||
token: ${{ secrets.GITHUB_TOKEN }} # GitHub Token,用于认证
|
||||
labels: "need reproduction" # 目标标签
|
||||
inactive-day: 3 # 未活动天数阈值
|
||||
|
11
.github/workflows/issue-labeled.yml
vendored
11
.github/workflows/issue-labeled.yml
vendored
@@ -6,6 +6,11 @@ on:
|
||||
# pull_request:
|
||||
# types: [labeled]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
reply-labeled:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -15,7 +20,7 @@ jobs:
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "remove-labels"
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
labels: "enhancement: pending triage"
|
||||
|
||||
@@ -24,7 +29,7 @@ jobs:
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "remove-labels"
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
labels: "bug: pending triage"
|
||||
|
||||
@@ -33,7 +38,7 @@ jobs:
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "create-comment, remove-labels"
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}. Please provide the complete reproduction steps and code. Issues labeled by `needs reproduction` will be closed if no activities in 3 days.
|
||||
|
2
.github/workflows/lock.yml
vendored
2
.github/workflows/lock.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v5
|
||||
with:
|
||||
github-token: ${{ secrets.ACCESS_TOKEN }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-inactive-days: "30"
|
||||
issue-lock-reason: ""
|
||||
pr-inactive-days: "30"
|
||||
|
10
.github/workflows/release-tag.yml
vendored
10
.github/workflows/release-tag.yml
vendored
@@ -8,6 +8,10 @@ on:
|
||||
env:
|
||||
HUSKY: "0"
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
@@ -53,12 +57,12 @@ jobs:
|
||||
echo "version=${version}" >> $GITHUB_OUTPUT
|
||||
echo "major=${major}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: release-drafter/release-drafter@master
|
||||
- uses: release-drafter/release-drafter@v6
|
||||
with:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
publish: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# - name: force update major tag
|
||||
# run: |
|
||||
@@ -69,7 +73,7 @@ jobs:
|
||||
# id: release_tag
|
||||
# uses: ncipollo/release-action@v1
|
||||
# with:
|
||||
# token: ${{ secrets.ACCESS_TOKEN }}
|
||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# generateReleaseNotes: "true"
|
||||
# body: |
|
||||
# > Please refer to [CHANGELOG.md](https://github.com/vbenjs/vue-vben-admin/blob/main/CHANGELOG.md) for details.
|
||||
|
19
.github/workflows/semantic-pull-request.yml
vendored
19
.github/workflows/semantic-pull-request.yml
vendored
@@ -9,17 +9,32 @@ on:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
if: github.repository == 'vitejs/vite'
|
||||
runs-on: ubuntu-latest
|
||||
name: Semantic Pull Request
|
||||
steps:
|
||||
- name: Validate PR title
|
||||
uses: amannn/action-semantic-pull-request@v5
|
||||
with:
|
||||
wip: true
|
||||
subjectPattern: ^(?![A-Z]).+$
|
||||
subjectPatternError: |
|
||||
The subject "{subject}" found in the pull request title "{title}"
|
||||
didn't match the configured pattern. Please ensure that the subject
|
||||
doesn't start with an uppercase character.
|
||||
requireScope: false
|
||||
types: |
|
||||
fix
|
||||
feat
|
||||
docs
|
||||
style
|
||||
refactor
|
||||
perf
|
||||
test
|
||||
build
|
||||
ci
|
||||
chore
|
||||
revert
|
||||
types
|
||||
release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.ACCESS_TOKEN }}
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: "This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days"
|
||||
stale-pr-message: "This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days"
|
||||
exempt-issue-labels: "bug,enhancement"
|
||||
|
@@ -1 +1,20 @@
|
||||
export { default } from '@vben/lint-staged-config';
|
||||
export default {
|
||||
'*.{js,jsx,ts,tsx}': [
|
||||
'prettier --cache --ignore-unknown --write',
|
||||
'eslint --cache --fix',
|
||||
],
|
||||
'*.{scss,less,styl,html,vue,css}': [
|
||||
'prettier --cache --ignore-unknown --write',
|
||||
'stylelint --fix --allow-empty-input',
|
||||
],
|
||||
'*.md': ['prettier --cache --ignore-unknown --write'],
|
||||
'*.vue': [
|
||||
'prettier --write',
|
||||
'eslint --cache --fix',
|
||||
'stylelint --fix --allow-empty-input',
|
||||
],
|
||||
'{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': [
|
||||
'prettier --cache --write--parser json',
|
||||
],
|
||||
'package.json': ['prettier --cache --write'],
|
||||
};
|
||||
|
@@ -1 +1 @@
|
||||
20
|
||||
20.14.0
|
||||
|
1
.npmrc
1
.npmrc
@@ -3,7 +3,6 @@ public-hoist-pattern[]=husky
|
||||
public-hoist-pattern[]=eslint
|
||||
public-hoist-pattern[]=prettier
|
||||
public-hoist-pattern[]=prettier-plugin-tailwindcss
|
||||
public-hoist-pattern[]=lint-staged
|
||||
public-hoist-pattern[]=stylelint
|
||||
public-hoist-pattern[]=*postcss*
|
||||
public-hoist-pattern[]=@commitlint/*
|
||||
|
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
@@ -2,8 +2,6 @@
|
||||
"recommendations": [
|
||||
// Vue 3 的语言支持
|
||||
"Vue.volar",
|
||||
// 用于 TypeScript 服务器的 Vue 插件
|
||||
"Vue.vscode-typescript-vue-plugin",
|
||||
// 将 ESLint JavaScript 集成到 VS Code 中。
|
||||
"dbaeumer.vscode-eslint",
|
||||
// Visual Studio Code 的官方 Stylelint 扩展
|
||||
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@@ -3,13 +3,31 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome", // chrome、edge
|
||||
"name": "vben admin dev", // 调试的名称,可以自定义
|
||||
"type": "chrome",
|
||||
"name": "vben admin antd dev",
|
||||
"request": "launch",
|
||||
"url": "http://localhost:5173",
|
||||
"url": "http://localhost:5555",
|
||||
"env": { "NODE_ENV": "development" },
|
||||
"sourceMaps": true,
|
||||
"webRoot": "${workspaceFolder}/apps/web-antd/src"
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"name": "vben admin ele dev",
|
||||
"request": "launch",
|
||||
"url": "http://localhost:5666",
|
||||
"env": { "NODE_ENV": "development" },
|
||||
"sourceMaps": true,
|
||||
"webRoot": "${workspaceFolder}/apps/web-ele/src"
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"name": "vben admin naive dev",
|
||||
"request": "launch",
|
||||
"url": "http://localhost:5777",
|
||||
"env": { "NODE_ENV": "development" },
|
||||
"sourceMaps": true,
|
||||
"webRoot": "${workspaceFolder}/apps/web-naive/src"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@@ -139,8 +139,6 @@
|
||||
"typescript.preferences.preferTypeOnlyAutoImports": true,
|
||||
"typescript.preferences.includePackageJsonAutoImports": "on",
|
||||
|
||||
// Enable the ESlint flat config support
|
||||
"eslint.experimental.useFlatConfig": true,
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"typescript",
|
||||
@@ -165,9 +163,7 @@
|
||||
"yaml": false
|
||||
},
|
||||
|
||||
"cssVariables.lookupFiles": [
|
||||
"packages/@vben-core/shared/design/src/**/*.css"
|
||||
],
|
||||
"cssVariables.lookupFiles": ["packages/core/base/design/src/**/*.css"],
|
||||
|
||||
"i18n-ally.localesPaths": [
|
||||
"packages/locales/src/langs",
|
||||
@@ -193,5 +189,7 @@
|
||||
},
|
||||
"commentTranslate.hover.enabled": false,
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"commentTranslate.multiLineMerge": true
|
||||
"commentTranslate.multiLineMerge": true,
|
||||
"vue.server.hybridMode": true,
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ RUN echo "Builder Success 🎉"
|
||||
FROM nginx:stable-alpine as production
|
||||
|
||||
RUN echo "types { application/javascript js mjs; }" > /etc/nginx/conf.d/mjs.conf
|
||||
COPY --from=builder /app/apps/antd-view/dist /usr/share/nginx/html
|
||||
COPY --from=builder /app/apps/web-antd/dist /usr/share/nginx/html
|
||||
|
||||
COPY ./deploy/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
|
146
README.ja-JP.md
Normal file
146
README.ja-JP.md
Normal file
@@ -0,0 +1,146 @@
|
||||
<div align="center"> <a href="https://github.com/anncwb/vue-vben-admin"> <img alt="VbenAdmin Logo" width="215" src="https://unpkg.com/@vbenjs/static-source@0.1.5/source/logo-v1.webp"> </a> <br> <br>
|
||||
|
||||
[](LICENSE)
|
||||
|
||||
<h1>Vue Vben Admin</h1>
|
||||
</div>
|
||||
|
||||
**日本語** | [English](./README.md) | [中文](./README.zh-CN.md)
|
||||
|
||||
## 紹介
|
||||
|
||||
Vue Vben Adminは、最新の`vue3`、`vite`、`TypeScript`などの主流技術を使用して開発された、無料でオープンソースの中・後端テンプレートです。すぐに使える中・後端のフロントエンドソリューションとして、学習の参考にもなります。
|
||||
|
||||
## アップグレード通知
|
||||
|
||||
これは最新バージョン5.0であり、以前のバージョンとは互換性がありません。新しいプロジェクトを開始する場合は、最新バージョンを使用することをお勧めします。古いバージョンを表示したい場合は、[v2ブランチ](https://github.com/vbenjs/vue-vben-admin/tree/v2)を使用してください。
|
||||
|
||||
## 特徴
|
||||
|
||||
- **最新技術スタック**: Vue 3やViteなどの最先端フロントエンド技術で開発
|
||||
- **TypeScript**: アプリケーション規模のJavaScriptのための言語
|
||||
- **テーマ**: 複数のテーマカラーが利用可能で、カスタマイズオプションも豊富
|
||||
- **国際化**: 完全な内蔵国際化サポート
|
||||
- **権限管理**: 動的ルートベースの権限生成ソリューションを内蔵
|
||||
|
||||
## プレビュー
|
||||
|
||||
- [Vben Admin](https://vben.pro/) - フルバージョンの中国語サイト
|
||||
|
||||
テストアカウント: vben/123456
|
||||
|
||||
<p align="center">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview1.png">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview2.png">
|
||||
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview3.png">
|
||||
</p>
|
||||
|
||||
### Gitpodを使用
|
||||
|
||||
Gitpod(GitHub用の無料オンライン開発環境)でプロジェクトを開き、すぐにコーディングを開始します。
|
||||
|
||||
[](https://gitpod.io/#https://github.com/vbenjs/vue-vben-admin)
|
||||
|
||||
## ドキュメント
|
||||
|
||||
[ドキュメント](https://doc.vben.pro/)
|
||||
|
||||
## インストールと使用
|
||||
|
||||
- プロジェクトコードを取得
|
||||
|
||||
```bash
|
||||
git clone https://github.com/vbenjs/vue-vben-admin.git
|
||||
```
|
||||
|
||||
- 依存関係のインストール
|
||||
|
||||
```bash
|
||||
cd vue-vben-admin
|
||||
|
||||
corepack enable
|
||||
|
||||
pnpm install
|
||||
|
||||
```
|
||||
|
||||
- 実行
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
- ビルド
|
||||
|
||||
```bash
|
||||
pnpm build
|
||||
```
|
||||
|
||||
## 変更ログ
|
||||
|
||||
[CHANGELOG](./CHANGELOG.zh_CN.md)
|
||||
|
||||
## 貢献方法
|
||||
|
||||
ご参加をお待ちしておりますするか、Pull Requestを送信してください。
|
||||
|
||||
**Pull Request:**
|
||||
|
||||
1. コードをフォーク!
|
||||
2. 自分のブランチを作成: `git checkout -b feat/xxxx`
|
||||
3. 変更をコミット: `git commit -am 'feat(function): add xxxxx'`
|
||||
4. ブランチをプッシュ: `git push origin feat/xxxx`
|
||||
5. `pull request`を送信
|
||||
|
||||
## Git貢献提出規則
|
||||
|
||||
- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 規則 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular))
|
||||
|
||||
- `feat` 新機能の追加
|
||||
- `fix` 問題/バグの修正
|
||||
- `style` コードスタイルに関連し、実行結果に影響しない
|
||||
- `perf` 最適化/パフォーマンス向上
|
||||
- `refactor` リファクタリング
|
||||
- `revert` 変更の取り消し
|
||||
- `test` テスト関連
|
||||
- `docs` ドキュメント/注釈
|
||||
- `chore` 依存関係の更新/スキャフォールディング設定の変更など
|
||||
- `ci` 継続的インテグレーション
|
||||
- `types` 型定義ファイルの変更
|
||||
- `wip` 開発中
|
||||
|
||||
## ブラウザサポート
|
||||
|
||||
ローカル開発には`Chrome 80+`ブラウザを推奨します
|
||||
|
||||
モダンブラウザをサポートし、IEはサポートしません
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
|
||||
| :-: | :-: | :-: | :-: | :-: |
|
||||
| サポートしない | 最新2バージョン | 最新2バージョン | 最新2バージョン | 最新2バージョン |
|
||||
|
||||
## メンテナー
|
||||
|
||||
[@Vben](https://github.com/anncwb)
|
||||
|
||||
## 寄付
|
||||
|
||||
このプロジェクトが役に立つと思われた場合、作者にコーヒーを一杯おごってサポートを示すことができます!
|
||||
|
||||

|
||||
|
||||
<a style="display: block;width: 100px;height: 50px;line-height: 50px; color: #fff;text-align: center; background: #408aed;border-radius: 4px;" href="https://www.paypal.com/paypalme/cvvben">Paypal Me</a>
|
||||
|
||||
## 貢献者
|
||||
|
||||
<a href="https://github.com/vbenjs/vue-vben-admin/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=vbenjs/vue-vben-admin" />
|
||||
</a>
|
||||
|
||||
## Discord
|
||||
|
||||
- [Github Discussions](https://github.com/anncwb/vue-vben-admin/discussions)
|
||||
|
||||
## ライセンス
|
||||
|
||||
[MIT © Vben-2020](./LICENSE)
|
@@ -1,11 +1,11 @@
|
||||
<div align="center"> <a href="https://github.com/anncwb/vue-vben-admin"> <img alt="VbenAdmin Logo" width="200" height="200" src="https://unpkg.com/@vbenjs/static-source@0.1.5/source/logo-v1.webp"> </a> <br> <br>
|
||||
<div align="center"> <a href="https://github.com/anncwb/vue-vben-admin"> <img alt="VbenAdmin Logo" width="215" src="https://unpkg.com/@vbenjs/static-source@0.1.5/source/logo-v1.webp"> </a> <br> <br>
|
||||
|
||||
[](LICENSE)
|
||||
|
||||
<h1>Vue Vben Admin</h1>
|
||||
</div>
|
||||
|
||||
**English** | [中文](./README.zh-CN.md)
|
||||
**English** | [中文](./README.zh-CN.md) | [日本語](./README.ja-JP.md)
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -61,7 +61,6 @@ cd vue-vben-admin
|
||||
corepack enable
|
||||
|
||||
pnpm install
|
||||
|
||||
```
|
||||
|
||||
- run
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<div align="center"> <a href="https://github.com/anncwb/vue-vben-admin"> <img alt="VbenAdmin Logo" width="200" height="200" src="https://unpkg.com/@vbenjs/static-source@0.1.5/source/logo-v1.webp"> </a> <br> <br>
|
||||
<div align="center"> <a href="https://github.com/anncwb/vue-vben-admin"> <img alt="VbenAdmin Logo" width="215" src="https://unpkg.com/@vbenjs/static-source@0.1.5/source/logo-v1.webp"> </a> <br> <br>
|
||||
|
||||
[](LICENSE)
|
||||
|
||||
<h1>Vue Vben Admin</h1>
|
||||
</div>
|
||||
|
||||
**中文** | [English](./README.md)
|
||||
**中文** | [English](./README.md) | [日本語](./README.ja-JP.md)
|
||||
|
||||
## 简介
|
||||
|
||||
@@ -61,7 +61,6 @@ cd vue-vben-admin
|
||||
corepack enable
|
||||
|
||||
pnpm install
|
||||
|
||||
```
|
||||
|
||||
- 运行
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/web-antd",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"homepage": "https://vben.pro",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
@@ -44,7 +44,7 @@
|
||||
"ant-design-vue": "^4.2.3",
|
||||
"dayjs": "^1.11.12",
|
||||
"pinia": "2.2.0",
|
||||
"vue": "^3.4.35",
|
||||
"vue-router": "^4.4.2"
|
||||
"vue": "^3.4.36",
|
||||
"vue-router": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
@@ -21,13 +21,13 @@ export namespace AuthApi {
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
export async function login(data: AuthApi.LoginParams) {
|
||||
export async function loginApi(data: AuthApi.LoginParams) {
|
||||
return requestClient.post<AuthApi.LoginResult>('/auth/login', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限码
|
||||
*/
|
||||
export async function getAccessCodes() {
|
||||
export async function getAccessCodesApi() {
|
||||
return requestClient.get<string[]>('/auth/codes');
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 获取用户所有菜单
|
||||
*/
|
||||
export async function getAllMenus() {
|
||||
export async function getAllMenusApi() {
|
||||
return requestClient.get<RouteRecordStringComponent[]>('/menu/all');
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
export async function getUserInfo() {
|
||||
export async function getUserInfoApi() {
|
||||
return requestClient.get<UserInfo>('/user/info');
|
||||
}
|
||||
|
@@ -3,8 +3,8 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 模拟任意状态码
|
||||
*/
|
||||
async function getMockStatus(status: string) {
|
||||
async function getMockStatusApi(status: string) {
|
||||
return requestClient.get('/status', { params: { status } });
|
||||
}
|
||||
|
||||
export { getMockStatus };
|
||||
export { getMockStatusApi };
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { NotificationItem } from '@vben/layouts';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
@@ -9,7 +11,6 @@ import {
|
||||
BasicLayout,
|
||||
LockScreen,
|
||||
Notification,
|
||||
NotificationItem,
|
||||
UserDropdown,
|
||||
} from '@vben/layouts';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
@@ -24,10 +24,10 @@ const localesMap = loadLocalesMap(modules);
|
||||
*/
|
||||
async function loadMessages(lang: SupportedLanguagesType) {
|
||||
const [appLocaleMessages] = await Promise.all([
|
||||
localesMap[lang](),
|
||||
localesMap[lang]?.(),
|
||||
loadThirdPartyMessage(lang),
|
||||
]);
|
||||
return appLocaleMessages.default;
|
||||
return appLocaleMessages?.default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -8,7 +8,7 @@ import { preferences } from '@vben/preferences';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { getAllMenus } from '#/api';
|
||||
import { getAllMenusApi } from '#/api';
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
@@ -29,7 +29,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
content: `${$t('common.loadingMenu')}...`,
|
||||
duration: 1.5,
|
||||
});
|
||||
return await getAllMenus();
|
||||
return await getAllMenusApi();
|
||||
},
|
||||
// 可以指定没有权限跳转403页面
|
||||
forbiddenComponent,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { Router } from 'vue-router';
|
||||
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
import { DEFAULT_HOME_PATH, LOGIN_PATH } from '@vben/constants';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { useAccessStore, useUserStore } from '@vben/stores';
|
||||
import { startProgress, stopProgress } from '@vben/utils';
|
||||
@@ -62,14 +62,20 @@ function setupAccessGuard(router: Router) {
|
||||
const userStore = useUserStore();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
// 基本路由,这些路由不需要进入权限拦截
|
||||
if (coreRouteNames.includes(to.name as string)) {
|
||||
if (to.path === LOGIN_PATH && accessStore.accessToken) {
|
||||
return decodeURIComponent(
|
||||
(to.query?.redirect as string) || DEFAULT_HOME_PATH,
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// accessToken 检查
|
||||
if (!accessStore.accessToken) {
|
||||
if (
|
||||
// 基本路由,这些路由不需要进入权限拦截
|
||||
coreRouteNames.includes(to.name as string) ||
|
||||
// 明确声明忽略权限访问权限,则可以访问
|
||||
to.meta.ignoreAccess
|
||||
) {
|
||||
// 明确声明忽略权限访问权限,则可以访问
|
||||
if (to.meta.ignoreAccess) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { getAccessCodes, getUserInfo, login } from '#/api';
|
||||
import { getAccessCodesApi, getUserInfoApi, loginApi } from '#/api';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
@@ -33,7 +33,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
let userInfo: null | UserInfo = null;
|
||||
try {
|
||||
loginLoading.value = true;
|
||||
const { accessToken, refreshToken } = await login(params);
|
||||
const { accessToken, refreshToken } = await loginApi(params);
|
||||
|
||||
// 如果成功获取到 accessToken
|
||||
if (accessToken) {
|
||||
@@ -44,7 +44,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// 获取用户信息并存储到 accessStore 中
|
||||
const [fetchUserInfoResult, accessCodes] = await Promise.all([
|
||||
fetchUserInfo(),
|
||||
getAccessCodes(),
|
||||
getAccessCodesApi(),
|
||||
]);
|
||||
|
||||
userInfo = fetchUserInfoResult;
|
||||
@@ -92,7 +92,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
async function fetchUserInfo() {
|
||||
let userInfo: null | UserInfo = null;
|
||||
userInfo = await getUserInfo();
|
||||
userInfo = await getUserInfoApi();
|
||||
userStore.setUserInfo(userInfo);
|
||||
return userInfo;
|
||||
}
|
||||
|
@@ -41,9 +41,11 @@ async function changeAccount(role: string) {
|
||||
|
||||
const account = accounts[role];
|
||||
resetAllStores();
|
||||
await authStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
if (account) {
|
||||
await authStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@@ -41,12 +41,17 @@ async function changeAccount(role: string) {
|
||||
|
||||
const account = accounts[role];
|
||||
resetAllStores();
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
if (account) {
|
||||
await accessStore.authLogin(account, async () => {
|
||||
router.go(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function handleToggleAccessMode() {
|
||||
if (!accounts.super) {
|
||||
return;
|
||||
}
|
||||
await toggleAccessMode();
|
||||
resetAllStores();
|
||||
|
||||
|
@@ -5,13 +5,13 @@ import { preferences, updatePreferences } from '@vben/preferences';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
|
||||
import { getMockStatus } from '#/api';
|
||||
import { getMockStatusApi } from '#/api';
|
||||
|
||||
async function handleClick(type: LoginExpiredModeType) {
|
||||
const loginExpiredMode = preferences.app.loginExpiredMode;
|
||||
|
||||
updatePreferences({ app: { loginExpiredMode: type } });
|
||||
await getMockStatus('401');
|
||||
await getMockStatusApi('401');
|
||||
updatePreferences({ app: { loginExpiredMode } });
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/web-ele",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"homepage": "https://vben.pro",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
@@ -44,8 +44,8 @@
|
||||
"dayjs": "^1.11.12",
|
||||
"element-plus": "^2.7.8",
|
||||
"pinia": "2.2.0",
|
||||
"vue": "^3.4.35",
|
||||
"vue-router": "^4.4.2"
|
||||
"vue": "^3.4.36",
|
||||
"vue-router": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"unplugin-element-plus": "^0.8.0"
|
||||
|
@@ -21,13 +21,13 @@ export namespace AuthApi {
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
export async function login(data: AuthApi.LoginParams) {
|
||||
export async function loginApi(data: AuthApi.LoginParams) {
|
||||
return requestClient.post<AuthApi.LoginResult>('/auth/login', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限码
|
||||
*/
|
||||
export async function getAccessCodes() {
|
||||
export async function getAccessCodesApi() {
|
||||
return requestClient.get<string[]>('/auth/codes');
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 获取用户所有菜单
|
||||
*/
|
||||
export async function getAllMenus() {
|
||||
export async function getAllMenusApi() {
|
||||
return requestClient.get<RouteRecordStringComponent[]>('/menu/all');
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
export async function getUserInfo() {
|
||||
export async function getUserInfoApi() {
|
||||
return requestClient.get<UserInfo>('/user/info');
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { NotificationItem } from '@vben/layouts';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
@@ -9,7 +11,6 @@ import {
|
||||
BasicLayout,
|
||||
LockScreen,
|
||||
Notification,
|
||||
NotificationItem,
|
||||
UserDropdown,
|
||||
} from '@vben/layouts';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import type { LocaleSetupOptions, SupportedLanguagesType } from '@vben/locales';
|
||||
import type { Language } from 'element-plus/es/locale';
|
||||
|
||||
import type { App } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
@@ -7,7 +8,6 @@ import { $t, setupI18n as coreSetup, loadLocalesMap } from '@vben/locales';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import { Language } from 'element-plus/es/locale';
|
||||
import enLocale from 'element-plus/es/locale/lang/en';
|
||||
import defaultLocale from 'element-plus/es/locale/lang/zh-cn';
|
||||
|
||||
@@ -24,10 +24,10 @@ const localesMap = loadLocalesMap(modules);
|
||||
*/
|
||||
async function loadMessages(lang: SupportedLanguagesType) {
|
||||
const [appLocaleMessages] = await Promise.all([
|
||||
localesMap[lang](),
|
||||
localesMap[lang]?.(),
|
||||
loadThirdPartyMessage(lang),
|
||||
]);
|
||||
return appLocaleMessages.default;
|
||||
return appLocaleMessages?.default;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -8,7 +8,7 @@ import { preferences } from '@vben/preferences';
|
||||
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
import { getAllMenus } from '#/api';
|
||||
import { getAllMenusApi } from '#/api';
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
@@ -29,7 +29,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
duration: 1500,
|
||||
message: `${$t('common.loadingMenu')}...`,
|
||||
});
|
||||
return await getAllMenus();
|
||||
return await getAllMenusApi();
|
||||
},
|
||||
// 可以指定没有权限跳转403页面
|
||||
forbiddenComponent,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { Router } from 'vue-router';
|
||||
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
import { DEFAULT_HOME_PATH, LOGIN_PATH } from '@vben/constants';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { useAccessStore, useUserStore } from '@vben/stores';
|
||||
import { startProgress, stopProgress } from '@vben/utils';
|
||||
@@ -62,14 +62,20 @@ function setupAccessGuard(router: Router) {
|
||||
const userStore = useUserStore();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
// 基本路由,这些路由不需要进入权限拦截
|
||||
if (coreRouteNames.includes(to.name as string)) {
|
||||
if (to.path === LOGIN_PATH && accessStore.accessToken) {
|
||||
return decodeURIComponent(
|
||||
(to.query?.redirect as string) || DEFAULT_HOME_PATH,
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// accessToken 检查
|
||||
if (!accessStore.accessToken) {
|
||||
if (
|
||||
// 基本路由,这些路由不需要进入权限拦截
|
||||
coreRouteNames.includes(to.name as string) ||
|
||||
// 明确声明忽略权限访问权限,则可以访问
|
||||
to.meta.ignoreAccess
|
||||
) {
|
||||
// 明确声明忽略权限访问权限,则可以访问
|
||||
if (to.meta.ignoreAccess) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@ import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
|
||||
import { ElNotification } from 'element-plus';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { getAccessCodes, getUserInfo, login } from '#/api';
|
||||
import { getAccessCodesApi, getUserInfoApi, loginApi } from '#/api';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
@@ -33,7 +33,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
let userInfo: null | UserInfo = null;
|
||||
try {
|
||||
loginLoading.value = true;
|
||||
const { accessToken, refreshToken } = await login(params);
|
||||
const { accessToken, refreshToken } = await loginApi(params);
|
||||
|
||||
// 如果成功获取到 accessToken
|
||||
if (accessToken) {
|
||||
@@ -44,7 +44,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// 获取用户信息并存储到 accessStore 中
|
||||
const [fetchUserInfoResult, accessCodes] = await Promise.all([
|
||||
fetchUserInfo(),
|
||||
getAccessCodes(),
|
||||
getAccessCodesApi(),
|
||||
]);
|
||||
|
||||
userInfo = fetchUserInfoResult;
|
||||
@@ -92,7 +92,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
async function fetchUserInfo() {
|
||||
let userInfo: null | UserInfo = null;
|
||||
userInfo = await getUserInfo();
|
||||
userInfo = await getUserInfoApi();
|
||||
userStore.setUserInfo(userInfo);
|
||||
return userInfo;
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ function warning() {
|
||||
}
|
||||
function success() {
|
||||
ElMessage.success(
|
||||
"'Cause you walked hand in hand With another man in my place",
|
||||
'Cause you walked hand in hand With another man in my place',
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/web-naive",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"homepage": "https://vben.pro",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
"repository": {
|
||||
@@ -43,7 +43,7 @@
|
||||
"@vueuse/core": "^10.11.0",
|
||||
"naive-ui": "^2.39.0",
|
||||
"pinia": "2.2.0",
|
||||
"vue": "^3.4.35",
|
||||
"vue-router": "^4.4.2"
|
||||
"vue": "^3.4.36",
|
||||
"vue-router": "^4.4.3"
|
||||
}
|
||||
}
|
||||
|
@@ -21,13 +21,13 @@ export namespace AuthApi {
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
export async function login(data: AuthApi.LoginParams) {
|
||||
export async function loginApi(data: AuthApi.LoginParams) {
|
||||
return requestClient.post<AuthApi.LoginResult>('/auth/login', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户权限码
|
||||
*/
|
||||
export async function getAccessCodes() {
|
||||
export async function getAccessCodesApi() {
|
||||
return requestClient.get<string[]>('/auth/codes');
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 获取用户所有菜单
|
||||
*/
|
||||
export async function getAllMenus() {
|
||||
export async function getAllMenusApi() {
|
||||
return requestClient.get<RouteRecordStringComponent[]>('/menu/all');
|
||||
}
|
||||
|
@@ -5,6 +5,6 @@ import { requestClient } from '#/api/request';
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
export async function getUserInfo() {
|
||||
export async function getUserInfoApi() {
|
||||
return requestClient.get<UserInfo>('/user/info');
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { GlobalThemeOverrides } from 'naive-ui';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useNaiveDesignTokens } from '@vben/hooks';
|
||||
@@ -9,7 +11,6 @@ import {
|
||||
dateEnUS,
|
||||
dateZhCN,
|
||||
enUS,
|
||||
GlobalThemeOverrides,
|
||||
lightTheme,
|
||||
NConfigProvider,
|
||||
NMessageProvider,
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { NotificationItem } from '@vben/layouts';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
@@ -9,7 +11,6 @@ import {
|
||||
BasicLayout,
|
||||
LockScreen,
|
||||
Notification,
|
||||
NotificationItem,
|
||||
UserDropdown,
|
||||
} from '@vben/layouts';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
@@ -15,8 +15,8 @@ const localesMap = loadLocalesMap(modules);
|
||||
* @param lang
|
||||
*/
|
||||
async function loadMessages(lang: SupportedLanguagesType) {
|
||||
const appLocaleMessages = await localesMap[lang]();
|
||||
return appLocaleMessages.default;
|
||||
const appLocaleMessages = await localesMap[lang]?.();
|
||||
return appLocaleMessages?.default;
|
||||
}
|
||||
|
||||
async function setupI18n(app: App, options: LocaleSetupOptions = {}) {
|
||||
|
@@ -2,7 +2,8 @@
|
||||
"page": {
|
||||
"demos": {
|
||||
"title": "Demos",
|
||||
"naive": "Naive UI"
|
||||
"naive": "Naive UI",
|
||||
"table": "Table"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,8 @@
|
||||
"page": {
|
||||
"demos": {
|
||||
"title": "演示",
|
||||
"naive": "Naive UI"
|
||||
"naive": "Naive UI",
|
||||
"table": "Table"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import type {
|
||||
import { generateAccessible } from '@vben/access';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
||||
import { getAllMenus } from '#/api';
|
||||
import { getAllMenusApi } from '#/api';
|
||||
import { BasicLayout, IFrameView } from '#/layouts';
|
||||
import { $t } from '#/locales';
|
||||
import { message } from '#/naive';
|
||||
@@ -27,7 +27,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||
message.loading(`${$t('common.loadingMenu')}...`, {
|
||||
duration: 1.5,
|
||||
});
|
||||
return await getAllMenus();
|
||||
return await getAllMenusApi();
|
||||
},
|
||||
// 可以指定没有权限跳转403页面
|
||||
forbiddenComponent,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { Router } from 'vue-router';
|
||||
|
||||
import { LOGIN_PATH } from '@vben/constants';
|
||||
import { DEFAULT_HOME_PATH, LOGIN_PATH } from '@vben/constants';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { useAccessStore, useUserStore } from '@vben/stores';
|
||||
import { startProgress, stopProgress } from '@vben/utils';
|
||||
@@ -62,14 +62,20 @@ function setupAccessGuard(router: Router) {
|
||||
const userStore = useUserStore();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
// 基本路由,这些路由不需要进入权限拦截
|
||||
if (coreRouteNames.includes(to.name as string)) {
|
||||
if (to.path === LOGIN_PATH && accessStore.accessToken) {
|
||||
return decodeURIComponent(
|
||||
(to.query?.redirect as string) || DEFAULT_HOME_PATH,
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// accessToken 检查
|
||||
if (!accessStore.accessToken) {
|
||||
if (
|
||||
// 基本路由,这些路由不需要进入权限拦截
|
||||
coreRouteNames.includes(to.name as string) ||
|
||||
// 明确声明忽略权限访问权限,则可以访问
|
||||
to.meta.ignoreAccess
|
||||
) {
|
||||
// 明确声明忽略权限访问权限,则可以访问
|
||||
if (to.meta.ignoreAccess) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,15 @@ const routes: RouteRecordRaw[] = [
|
||||
path: '/demos/naive',
|
||||
component: () => import('#/views/demos/naive/index.vue'),
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
icon: 'mdi:shield-key-outline',
|
||||
title: $t('page.demos.table'),
|
||||
},
|
||||
name: 'Table',
|
||||
path: '/demos/table',
|
||||
component: () => import('#/views/demos/table/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
@@ -9,7 +9,7 @@ import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
|
||||
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
import { getAccessCodes, getUserInfo, login } from '#/api';
|
||||
import { getAccessCodesApi, getUserInfoApi, loginApi } from '#/api';
|
||||
import { $t } from '#/locales';
|
||||
import { notification } from '#/naive';
|
||||
|
||||
@@ -33,7 +33,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
let userInfo: null | UserInfo = null;
|
||||
try {
|
||||
loginLoading.value = true;
|
||||
const { accessToken, refreshToken } = await login(params);
|
||||
const { accessToken, refreshToken } = await loginApi(params);
|
||||
|
||||
// 如果成功获取到 accessToken
|
||||
if (accessToken) {
|
||||
@@ -44,7 +44,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// 获取用户信息并存储到 accessStore 中
|
||||
const [fetchUserInfoResult, accessCodes] = await Promise.all([
|
||||
fetchUserInfo(),
|
||||
getAccessCodes(),
|
||||
getAccessCodesApi(),
|
||||
]);
|
||||
|
||||
userInfo = fetchUserInfoResult;
|
||||
@@ -92,7 +92,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
async function fetchUserInfo() {
|
||||
let userInfo: null | UserInfo = null;
|
||||
userInfo = await getUserInfo();
|
||||
userInfo = await getUserInfoApi();
|
||||
userStore.setUserInfo(userInfo);
|
||||
return userInfo;
|
||||
}
|
||||
|
@@ -14,9 +14,7 @@ function warning() {
|
||||
message.warning('How many roads must a man walk down');
|
||||
}
|
||||
function success() {
|
||||
message.success(
|
||||
"'Cause you walked hand in hand With another man in my place",
|
||||
);
|
||||
message.success('Cause you walked hand in hand With another man in my place');
|
||||
}
|
||||
function loading() {
|
||||
message.loading(
|
||||
|
31
apps/web-naive/src/views/demos/table/index.vue
Normal file
31
apps/web-naive/src/views/demos/table/index.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { NDataTable } from 'naive-ui';
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
key: 'no',
|
||||
title: 'No',
|
||||
},
|
||||
{
|
||||
key: 'title',
|
||||
title: 'Title',
|
||||
},
|
||||
{
|
||||
key: 'length',
|
||||
title: 'Length',
|
||||
},
|
||||
]);
|
||||
const data = [
|
||||
{ length: '4:18', no: 3, title: 'Wonderwall' },
|
||||
{ length: '4:48', no: 4, title: "Don't Look Back in Anger" },
|
||||
{ length: '7:27', no: 12, title: 'Champagne Supernova' },
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NDataTable :columns="columns" :data="data" />
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
@@ -3,7 +3,7 @@
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
LOG_FILE=${SCRIPT_DIR}/build-local-docker-image.log
|
||||
ERROR=""
|
||||
IMAGE_NAME="vben-admin-pro-local"
|
||||
IMAGE_NAME="vben-admin-local"
|
||||
|
||||
function stop_and_remove_container() {
|
||||
# Stop and remove the existing container
|
||||
|
@@ -40,6 +40,7 @@
|
||||
"nocheck",
|
||||
"prefixs",
|
||||
"vitepress",
|
||||
"antdv",
|
||||
"ependencies",
|
||||
"vite",
|
||||
"echarts",
|
||||
|
@@ -28,11 +28,8 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.medium-zoom-overlay {
|
||||
z-index: 2147483646;
|
||||
}
|
||||
|
||||
.medium-zoom-image {
|
||||
.medium-zoom-overlay,
|
||||
.medium-zoom-image--opened {
|
||||
z-index: 2147483647;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/docs",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "vitepress build",
|
||||
@@ -12,7 +12,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vite-pwa/vitepress": "^0.5.0",
|
||||
"vitepress": "^1.3.1",
|
||||
"vue": "^3.4.35"
|
||||
"vitepress": "^1.3.2",
|
||||
"vue": "^3.4.36"
|
||||
}
|
||||
}
|
||||
|
@@ -2,8 +2,8 @@
|
||||
|
||||
社区交流群主要是为了方便大家交流,提问,解答问题,分享经验等。偏自助方式,如果你有问题,可以通过以下方式加入社区交流群:
|
||||
|
||||
- [QQ频道](https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&appChannel=share&inviteCode=1Zp3KrdpaiB&jumpsource=shorturl#/pc):主要提供问题解答,分享经验等。
|
||||
- [QQ群](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=mjZmlhgVzzUxvdxllB6C1vHpX8O8QRL0&authKey=DBdFbBwERmfaKY95JvRWqLCJIRGJAmKyZbrpzZ41EKDMZ5SR6MfbjOBaaNRN73fr&noverify=0&group_code=4286109):主要使用者的交流群。
|
||||
- [QQ频道](https://pd.qq.com/s/16p8lvvob):推荐,主要提供问题解答,分享经验等。
|
||||
- QQ群:[1群(满)](https://qm.qq.com/q/YacMHPYAMu)、[2群(满)](https://qm.qq.com/q/ajVKZvFICk)、[3群](https://qm.qq.com/q/36zdwThP2E),主要使用者的交流群。
|
||||
- [Discord](https://discord.com/invite/VU62jTecad): 主要提供问题解答,分享经验等。
|
||||
|
||||
## 微信群
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
项目开发完成之后,执行以下命令进行构建:
|
||||
|
||||
**注意:** 请在项目跟目录下执行以下命令
|
||||
**注意:** 请在项目根目录下执行以下命令
|
||||
|
||||
```bash
|
||||
pnpm build
|
||||
@@ -24,7 +24,7 @@ pnpm build
|
||||
|
||||
- 使用项目自定的命令进行预览(推荐)
|
||||
|
||||
**注意:** 请在项目跟目录下执行以下命令
|
||||
**注意:** 请在项目根目录下执行以下命令
|
||||
|
||||
```bash
|
||||
pnpm preview
|
||||
@@ -38,19 +38,16 @@ pnpm preview
|
||||
|
||||
```bash
|
||||
npm i -g live-server
|
||||
|
||||
```
|
||||
|
||||
然后在 `dist` 目录下执行 `live-server` 命令,即可在本地查看效果。
|
||||
|
||||
```bash
|
||||
|
||||
cd apps/web-antd/dist
|
||||
# 本地预览,默认端口8080
|
||||
live-server
|
||||
# 指定端口
|
||||
live-server --port 9000
|
||||
|
||||
```
|
||||
|
||||
## 压缩
|
||||
@@ -61,7 +58,6 @@ live-server --port 9000
|
||||
|
||||
```bash
|
||||
VITE_COMPRESS=gzip
|
||||
|
||||
```
|
||||
|
||||
### 开启 `brotli` 压缩
|
||||
@@ -70,7 +66,6 @@ VITE_COMPRESS=gzip
|
||||
|
||||
```bash
|
||||
VITE_COMPRESS=brotli
|
||||
|
||||
```
|
||||
|
||||
### 同时开启 `gzip` 和 `brotli` 压缩
|
||||
@@ -79,7 +74,6 @@ VITE_COMPRESS=brotli
|
||||
|
||||
```bash
|
||||
VITE_COMPRESS=gzip,brotli
|
||||
|
||||
```
|
||||
|
||||
::: tip 提示
|
||||
@@ -173,7 +167,6 @@ VITE_BASE=/xxx/
|
||||
|
||||
```bash
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
```
|
||||
|
||||
### history 路由模式下服务端配置
|
||||
@@ -215,7 +208,6 @@ server {
|
||||
try_files $uri $uri/ /sub/index.html;
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## 跨域处理
|
||||
|
@@ -76,7 +76,7 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如
|
||||
"dev:antd": "pnpm -F @vben/web-antd run dev",
|
||||
// 启动文档
|
||||
"dev:docs": "pnpm -F @vben/docs run dev",
|
||||
// 启动 element plus应用
|
||||
// 启动web-ele应用
|
||||
"dev:ele": "pnpm -F @vben/web-ele run dev",
|
||||
// 启动web-naive应用
|
||||
"dev:naive": "pnpm -F @vben/web-naive run dev",
|
||||
@@ -120,7 +120,6 @@ pnpm dev
|
||||
|
||||
```bash
|
||||
pnpm dev:antd
|
||||
|
||||
```
|
||||
|
||||
运行 `web-naive` 应用:
|
||||
|
@@ -74,7 +74,5 @@ import { SvgTestIcon } from '@vben/icons';
|
||||
直接添加 Tailwind CSS 的图标类名即可使用,图标类名可查看 [iconify](https://github.com/iconify/iconify) :
|
||||
|
||||
```vue
|
||||
|
||||
<span class="<span class="icon-[mdi--ab-testing]"></span>"></span>
|
||||
|
||||
<span class="icon-[mdi--ab-testing]"></span>
|
||||
```
|
||||
|
@@ -117,7 +117,7 @@ VITE_GLOB_API_URL=https://mock-napi.vben.pro/api
|
||||
```ts
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export async function getUserInfo() {
|
||||
export async function getUserInfoApi() {
|
||||
return requestClient.get<UserInfo>('/user/info');
|
||||
}
|
||||
```
|
||||
@@ -127,15 +127,15 @@ export async function getUserInfo() {
|
||||
```ts
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export async function saveUser(user: UserInfo) {
|
||||
export async function saveUserApi(user: UserInfo) {
|
||||
return requestClient.post<UserInfo>('/user', user);
|
||||
}
|
||||
|
||||
export async function saveUser(user: UserInfo) {
|
||||
export async function saveUserApi(user: UserInfo) {
|
||||
return requestClient.put<UserInfo>('/user', user);
|
||||
}
|
||||
|
||||
export async function saveUser(user: UserInfo) {
|
||||
export async function saveUserApi(user: UserInfo) {
|
||||
const url = user.id ? `/user/${user.id}` : '/user/';
|
||||
return requestClient.request<UserInfo>(url, {
|
||||
data: user,
|
||||
@@ -150,7 +150,7 @@ export async function saveUser(user: UserInfo) {
|
||||
```ts
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export async function deleteUser(user: UserInfo) {
|
||||
export async function deleteUserApi(user: UserInfo) {
|
||||
return requestClient.delete<boolean>(`/user/${user.id}`, user);
|
||||
}
|
||||
```
|
||||
@@ -269,5 +269,4 @@ mock的本质是一个真实的后端服务,如果不需要 mock 服务,可
|
||||
```bash
|
||||
# .env.development
|
||||
VITE_NITRO_MOCK=false
|
||||
|
||||
```
|
||||
|
@@ -72,7 +72,7 @@ const { b, e, is } = useNamespace('menu');
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
// 如果你在应用内使用,这行代码可以省略,已经在所有的应用内全局引入了
|
||||
@import (reference) '@vben/styles/global';
|
||||
@import '@vben/styles/global';
|
||||
@include b('menu') {
|
||||
color: black;
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
## 原理
|
||||
|
||||
由 `vite-plugin-inject-app-loading` 插件实现,插件会在每个页面的注入一个全局的 loading html。
|
||||
由 `vite-plugin-inject-app-loading` 插件实现,插件会在每个应用的注入一个全局的 `loading html`。
|
||||
|
||||
## 关闭
|
||||
|
||||
@@ -24,10 +24,17 @@ VITE_INJECT_APP_LOADING=false
|
||||
|
||||
- 你可以使用跟`index.html`一样的语法,比如`VITE_APP_TITLE`变量,来获取应用的标题。
|
||||
- 必须保证有一个`id="__app-loading__"`的元素。
|
||||
- 给`id="__app-loading__"`的元素,加一个 `hidden` class。
|
||||
- 必须保证有一个`style[data-app-loading="inject-css"]`的元素。
|
||||
|
||||
```html{1,4}
|
||||
<style data-app-loading="inject-css">
|
||||
#__app-loading__.hidden {
|
||||
pointer-events: none;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: all 1s ease-out;
|
||||
}
|
||||
/* ... */
|
||||
</style>
|
||||
<div id="__app-loading__">
|
||||
|
@@ -14,3 +14,4 @@
|
||||
6. 自行适配组件库的主题,与 `Vben Admin` 契合。
|
||||
7. 调整 `.env` 内的应用名
|
||||
8. 在大仓根目录增加 `dev:xxx` 脚本
|
||||
9. 执行 `pnpm install` 安装依赖
|
||||
|
@@ -62,7 +62,6 @@ corepack enable
|
||||
|
||||
# 安装依赖
|
||||
pnpm install
|
||||
|
||||
```
|
||||
|
||||
::: tip 注意
|
||||
@@ -78,7 +77,6 @@ pnpm install
|
||||
```bash
|
||||
# 启动项目
|
||||
pnpm dev
|
||||
|
||||
```
|
||||
|
||||
现在,你可以在浏览器访问 `http://localhost:5555` 查看项目。
|
||||
|
@@ -20,7 +20,7 @@
|
||||
- **动态菜单**:支持动态菜单,可以根据权限配置显示菜单。
|
||||
- **Mock 数据**:基于 Nitro 的本地高性能 Mock 数据方案。
|
||||
- **组件丰富**:提供了丰富的组件,可以满足大部分的业务需求。
|
||||
- **规范**:代码规范,使用 `ESLint`、`Prettier`、`Stylelint`、`Publint`、`cspell` 等工具保证代码质量。
|
||||
- **规范**:代码规范,使用 `ESLint`、`Prettier`、`Stylelint`、`Publint`、`CSpell` 等工具保证代码质量。
|
||||
- **工程化**:使用 `Pnpm Monorepo`、`TurboRepo`、`Changeset` 等工具,提高开发效率。
|
||||
- **多UI库支持**:支持 `Ant Design Vue`、`Element Plus`、`Vuetify` 等主流 UI 库,不再限制于特定框架。
|
||||
|
||||
|
@@ -131,7 +131,6 @@ registry = https://registry.npmmirror.com/
|
||||
TypeError: str.matchAll is not a function
|
||||
at Object.extractor (vue-vben-admin-main\node_modules@purge-icons\core\dist\index.js:146:27)
|
||||
at Extract (vue-vben-admin-main\node_modules@purge-icons\core\dist\index.js:173:54)
|
||||
|
||||
```
|
||||
|
||||
## nginx 部署
|
||||
|
@@ -11,15 +11,11 @@ changeset 命令在项目中已经内置:
|
||||
### 交互式填写变更集
|
||||
|
||||
```bash
|
||||
|
||||
pnpm run changeset
|
||||
|
||||
```
|
||||
|
||||
### 统一提升版本号
|
||||
|
||||
```bash
|
||||
|
||||
pnpm run version
|
||||
|
||||
```
|
||||
|
@@ -14,7 +14,6 @@ outline: deep
|
||||
|
||||
```bash
|
||||
pnpm vsh [command] [options]
|
||||
|
||||
```
|
||||
|
||||
### vsh check-circular
|
||||
@@ -25,7 +24,6 @@ pnpm vsh [command] [options]
|
||||
|
||||
```bash
|
||||
pnpm vsh check-circular
|
||||
|
||||
```
|
||||
|
||||
#### 选项
|
||||
@@ -42,7 +40,6 @@ pnpm vsh check-circular
|
||||
|
||||
```bash
|
||||
pnpm vsh check-dep
|
||||
|
||||
```
|
||||
|
||||
### vsh clean
|
||||
@@ -53,7 +50,6 @@ pnpm vsh check-dep
|
||||
|
||||
```bash
|
||||
pnpm vsh clean
|
||||
|
||||
```
|
||||
|
||||
#### 选项
|
||||
@@ -71,7 +67,6 @@ pnpm vsh clean
|
||||
|
||||
```bash
|
||||
pnpm vsh lint
|
||||
|
||||
```
|
||||
|
||||
#### 选项
|
||||
@@ -88,7 +83,6 @@ pnpm vsh lint
|
||||
|
||||
```bash
|
||||
pnpm vsh publint
|
||||
|
||||
```
|
||||
|
||||
#### 选项
|
||||
@@ -105,7 +99,6 @@ pnpm vsh publint
|
||||
|
||||
```bash
|
||||
pnpm vsh code-workspace
|
||||
|
||||
```
|
||||
|
||||
#### 选项
|
||||
@@ -123,7 +116,6 @@ pnpm vsh code-workspace
|
||||
|
||||
```bash
|
||||
pnpm turbo-run [command]
|
||||
|
||||
```
|
||||
|
||||
### turbo-run dev
|
||||
|
@@ -162,4 +162,4 @@ git hook 一般结合各种 lint,在 git 提交代码的时候进行代码风
|
||||
|
||||
### lint-staged
|
||||
|
||||
用于自动修复提交文件风格问题,其配置文件为 `.lintstagedrc.mjs`,其核心配置放在`internal/lint-configs/lint-staged-config`目录下,可以根据项目需求进行修改。
|
||||
用于自动修复提交文件风格问题,其配置文件为 `.lintstagedrc.mjs`,可以根据项目需求进行修改。
|
||||
|
@@ -25,36 +25,52 @@ features:
|
||||
- icon: 🚀
|
||||
title: 最新技术栈
|
||||
details: 基于 Vue3、Pinia、Vue Router、TypeScript、等最新技术栈。
|
||||
link: /guide/introduction/quick-start
|
||||
linkText: 快速开始
|
||||
- icon: 🦄
|
||||
title: 丰富的配置
|
||||
details: 企业级中后台前端解决方案,提供丰富的组件和模板以及 N 种偏好设置组合方案。
|
||||
# link: /
|
||||
# linkText: x
|
||||
link: /guide/essentials/settings
|
||||
linkText: 配置文档
|
||||
- icon: 🎨
|
||||
title: 主题定制
|
||||
details: 通过简单的配置,即可实现各种主题切换,满足个性化需求。
|
||||
link: /guide/in-depth/theme
|
||||
linkText: 主题文档
|
||||
- icon: 🌐
|
||||
title: 国际化
|
||||
details: 内置国际化方案,支持多语言切换,满足国际化需求。
|
||||
link: /guide/in-depth/locale
|
||||
linkText: 国际化文档
|
||||
- icon: 🔐
|
||||
title: 权限管理
|
||||
details: 内置权限管理方案,支持多种权限控制方式,满足各种权限需求。
|
||||
link: /guide/in-depth/access
|
||||
linkText: 权限文档
|
||||
- title: Vite
|
||||
icon:
|
||||
src: /logos/vite.svg
|
||||
details: 现代化的前端构建工具,快速冷启动,瞬间热更新。
|
||||
link: https://vitejs.dev/
|
||||
linkText: 官方站点
|
||||
- title: Shadcn UI
|
||||
icon:
|
||||
src: /logos/shadcn-ui.svg
|
||||
details: 核心基于 Shadcn UI + Tailwindcss,业务可支持任意的 UI 框架。
|
||||
link: https://www.shadcn-vue.com/
|
||||
linkText: 官方站点
|
||||
- title: Turbo Repo
|
||||
icon:
|
||||
src: /logos/turborepo.svg
|
||||
details: 规范且标准的大仓架构,使用 pnpm + monorepo + turbo 工程管理模式,提供企业级开发规范。
|
||||
link: https://turbo.build/
|
||||
linkText: 官方站点
|
||||
- title: Nitro Mock Server
|
||||
icon:
|
||||
src: /logos/nitro.svg
|
||||
details: 内置 Nitro Mock 服务,让你的 mock 服务更加强大。
|
||||
link: https://nitro.unjs.io/
|
||||
linkText: 官方站点
|
||||
---
|
||||
|
||||
<!-- <script setup>
|
||||
|
@@ -1,7 +0,0 @@
|
||||
import { defineBuildConfig } from 'unbuild';
|
||||
|
||||
export default defineBuildConfig({
|
||||
clean: true,
|
||||
declaration: true,
|
||||
entries: ['src/index'],
|
||||
});
|
@@ -1,5 +1,3 @@
|
||||
import type { UserConfig } from 'cz-git';
|
||||
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
import { getPackagesSync } from '@vben/node-utils';
|
||||
@@ -27,7 +25,10 @@ const scopeComplete = execSync('git status --porcelain || true')
|
||||
?.match(/src%%((\w|-)*)/)?.[1]
|
||||
?.replace(/s$/, '');
|
||||
|
||||
const userConfig: UserConfig = {
|
||||
/**
|
||||
* @type {import('cz-git').UserConfig}
|
||||
*/
|
||||
const userConfig = {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
plugins: ['commitlint-plugin-function-rules'],
|
||||
prompt: {
|
||||
@@ -46,7 +47,6 @@ const userConfig: UserConfig = {
|
||||
defaultScope: scopeComplete,
|
||||
// English
|
||||
typesAppend: [
|
||||
{ name: 'wip: work in process', value: 'wip' },
|
||||
{ name: 'workflow: workflow improvements', value: 'workflow' },
|
||||
{ name: 'types: type definition file changes', value: 'types' },
|
||||
],
|
||||
@@ -106,7 +106,7 @@ const userConfig: UserConfig = {
|
||||
'function-rules/scope-enum': [
|
||||
2, // level: error
|
||||
'always',
|
||||
(parsed: { scope: string }) => {
|
||||
(parsed) => {
|
||||
if (!parsed.scope || allowedScopes.includes(parsed.scope)) {
|
||||
return [true];
|
||||
}
|
||||
@@ -145,7 +145,6 @@ const userConfig: UserConfig = {
|
||||
'revert',
|
||||
'types',
|
||||
'release',
|
||||
'improvement',
|
||||
],
|
||||
],
|
||||
},
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vben/commitlint-config",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.1",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||
@@ -11,24 +11,19 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"stub": "pnpm unbuild --stub"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"main": "./index.mjs",
|
||||
"module": "./index.mjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"default": "./dist/index.mjs"
|
||||
"import": "./index.mjs",
|
||||
"default": "./index.mjs"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@commitlint/cli": "^19.3.0",
|
||||
"@commitlint/cli": "^19.4.0",
|
||||
"@commitlint/config-conventional": "^19.2.2",
|
||||
"@vben/node-utils": "workspace:*",
|
||||
"commitlint-plugin-function-rules": "^4.0.0",
|
||||
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@vben/tsconfig/node.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
@@ -27,23 +27,23 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint-config-turbo": "^2.0.11",
|
||||
"eslint-config-turbo": "^2.0.12",
|
||||
"eslint-plugin-command": "^0.2.3",
|
||||
"eslint-plugin-import-x": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@types/eslint": "^9.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||
"@typescript-eslint/parser": "^8.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
||||
"@typescript-eslint/parser": "^8.0.1",
|
||||
"eslint": "^9.8.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-jsdoc": "^48.10.2",
|
||||
"eslint-plugin-jsdoc": "^50.0.0",
|
||||
"eslint-plugin-jsonc": "^2.16.0",
|
||||
"eslint-plugin-n": "^17.10.1",
|
||||
"eslint-plugin-n": "^17.10.2",
|
||||
"eslint-plugin-no-only-tests": "^3.1.0",
|
||||
"eslint-plugin-perfectionist": "^3.0.0",
|
||||
"eslint-plugin-perfectionist": "^3.1.2",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-regexp": "^2.6.0",
|
||||
"eslint-plugin-unicorn": "^55.0.0",
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function comments(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function comments(): Promise<Linter.Config[]> {
|
||||
const [pluginComments] = await Promise.all([
|
||||
// @ts-expect-error - no types
|
||||
import('eslint-plugin-eslint-comments'),
|
||||
interopDefault(import('eslint-plugin-eslint-comments')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function disableds(): Promise<Linter.FlatConfig[]> {
|
||||
export async function disableds(): Promise<Linter.Config[]> {
|
||||
return [
|
||||
{
|
||||
files: ['**/__tests__/**/*.?([cm])[jt]s?(x)'],
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function ignores(): Promise<Linter.FlatConfig[]> {
|
||||
export async function ignores(): Promise<Linter.Config[]> {
|
||||
return [
|
||||
{
|
||||
ignores: [
|
||||
|
@@ -6,7 +6,7 @@ import js from '@eslint/js';
|
||||
import pluginUnusedImports from 'eslint-plugin-unused-imports';
|
||||
import globals from 'globals';
|
||||
|
||||
export async function javascript(): Promise<Linter.FlatConfig[]> {
|
||||
export async function javascript(): Promise<Linter.Config[]> {
|
||||
return [
|
||||
{
|
||||
languageOptions: {
|
||||
|
@@ -1,14 +1,15 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function jsdoc(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function jsdoc(): Promise<Linter.Config[]> {
|
||||
const [pluginJsdoc] = await Promise.all([
|
||||
import('eslint-plugin-jsdoc'),
|
||||
interopDefault(import('eslint-plugin-jsdoc')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
{
|
||||
plugins: {
|
||||
// @ts-expect-error - no types
|
||||
jsdoc: pluginJsdoc,
|
||||
},
|
||||
rules: {
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function jsonc(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function jsonc(): Promise<Linter.Config[]> {
|
||||
const [pluginJsonc, parserJsonc] = await Promise.all([
|
||||
import('eslint-plugin-jsonc'),
|
||||
import('jsonc-eslint-parser'),
|
||||
interopDefault(import('eslint-plugin-jsonc')),
|
||||
interopDefault(import('jsonc-eslint-parser')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
@@ -49,7 +51,7 @@ export async function jsonc(): Promise<Linter.FlatConfig[]> {
|
||||
];
|
||||
}
|
||||
|
||||
function sortPackageJson(): Linter.FlatConfig {
|
||||
function sortPackageJson(): Linter.Config {
|
||||
return {
|
||||
files: ['**/package.json'],
|
||||
rules: {
|
||||
@@ -128,7 +130,7 @@ function sortPackageJson(): Linter.FlatConfig {
|
||||
};
|
||||
}
|
||||
|
||||
function sortTsconfig(): Linter.FlatConfig {
|
||||
function sortTsconfig(): Linter.Config {
|
||||
return {
|
||||
files: [
|
||||
'**/tsconfig.json',
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function node(): Promise<Linter.FlatConfig[]> {
|
||||
const [pluginNode] = await Promise.all([import('eslint-plugin-n')] as const);
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function node(): Promise<Linter.Config[]> {
|
||||
const pluginNode = await interopDefault(import('eslint-plugin-n'));
|
||||
|
||||
return [
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@ import type { Linter } from 'eslint';
|
||||
|
||||
import perfectionistPlugin from 'eslint-plugin-perfectionist';
|
||||
|
||||
export async function perfectionist(): Promise<Linter.FlatConfig[]> {
|
||||
export async function perfectionist(): Promise<Linter.Config[]> {
|
||||
return [
|
||||
perfectionistPlugin.configs['recommended-natural'],
|
||||
{
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function prettier(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function prettier(): Promise<Linter.Config[]> {
|
||||
const [pluginPrettier] = await Promise.all([
|
||||
import('eslint-plugin-prettier'),
|
||||
interopDefault(import('eslint-plugin-prettier')),
|
||||
] as const);
|
||||
return [
|
||||
{
|
||||
|
@@ -1,8 +1,10 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function regexp(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function regexp(): Promise<Linter.Config[]> {
|
||||
const [pluginRegexp] = await Promise.all([
|
||||
import('eslint-plugin-regexp'),
|
||||
interopDefault(import('eslint-plugin-regexp')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
|
@@ -1,10 +1,12 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function test(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function test(): Promise<Linter.Config[]> {
|
||||
const [pluginTest, pluginNoOnlyTests] = await Promise.all([
|
||||
import('eslint-plugin-vitest'),
|
||||
interopDefault(import('eslint-plugin-vitest')),
|
||||
// @ts-expect-error - no types
|
||||
import('eslint-plugin-no-only-tests'),
|
||||
interopDefault(import('eslint-plugin-no-only-tests')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
@@ -20,7 +22,6 @@ export async function test(): Promise<Linter.FlatConfig[]> {
|
||||
test: {
|
||||
...pluginTest,
|
||||
rules: {
|
||||
// @ts-expect-error - no types
|
||||
...pluginTest.rules,
|
||||
...pluginNoOnlyTests.rules,
|
||||
},
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function turbo(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function turbo(): Promise<Linter.Config[]> {
|
||||
const [pluginTurbo] = await Promise.all([
|
||||
// @ts-expect-error - no types
|
||||
import('eslint-config-turbo'),
|
||||
interopDefault(import('eslint-config-turbo')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
|
@@ -1,10 +1,12 @@
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function typescript(): Promise<Linter.FlatConfig[]> {
|
||||
import { interopDefault } from '../util';
|
||||
|
||||
export async function typescript(): Promise<Linter.Config[]> {
|
||||
const [pluginTs, parserTs] = await Promise.all([
|
||||
import('@typescript-eslint/eslint-plugin'),
|
||||
interopDefault(import('@typescript-eslint/eslint-plugin')),
|
||||
// @ts-expect-error missing types
|
||||
import('@typescript-eslint/parser'),
|
||||
interopDefault(import('@typescript-eslint/parser')),
|
||||
] as const);
|
||||
|
||||
return [
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user