Skip to content

Commit

Permalink
v4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Oct 29, 2023
1 parent 8dd088d commit 807e3f9
Show file tree
Hide file tree
Showing 314 changed files with 35,687 additions and 5,275 deletions.
Empty file modified .editorconfig
100644 → 100755
Empty file.
Empty file modified .env.development
100644 → 100755
Empty file.
Empty file modified .env.example
100644 → 100755
Empty file.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/deploy-example-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@ jobs:

# 运行构建脚本
- name: Build
env:
NODE_OPTIONS: --max-old-space-size=8192
run: nr build:example

- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.PUSH_TO_ANOTHER_REPO_SSH_DEPLOY_KEY }}
with:
source-directory: 'dist-example'
destination-github-username: 'fantastic-admin'
destination-repository-name: 'basic-example'
source-directory: dist-example
destination-github-username: fantastic-admin
destination-repository-name: basic-example
user-email: 304327508@qq.com
target-branch: main
3 changes: 0 additions & 3 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ dist-ssr
*.local
.eslintcache
.stylelintcache
src/assets/sprites/*.*
!src/assets/sprites/.gitkeep
public/icons
2 changes: 1 addition & 1 deletion .lintstagedrc
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.{ts,tsx,vue}": "eslint --cache --fix --no-ignore --no-error-on-unmatched-pattern --ext .ts,.tsx,.vue src/",
"*.{ts,tsx,vue}": "eslint . --cache --fix",
"*.{css,scss,vue}": "stylelint src/**/*.{css,scss,vue} --cache --fix --allow-empty-input"
}
Empty file modified .npmrc
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .stylelintignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
src/assets/sprites
public/tinymce
19 changes: 19 additions & 0 deletions .stylelintrc
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@
"property-no-unknown": null,
"font-family-no-missing-generic-family-keyword": null,
"selector-class-pattern": null,
"function-no-unknown": [
true,
{
"ignoreFunctions": [
"v-bind",
"map-get",
"lighten",
"darken"
]
}
],
"selector-pseudo-element-no-unknown": [
true,
{
"ignorePseudoElements": [
"/^view-transition/"
]
}
],
"scss/double-slash-comment-empty-line-before": null,
"scss/no-global-function-names": null
}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"antfu.unocss"
]
}
24 changes: 22 additions & 2 deletions .vscode/settings.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
{
"eslint.experimental.useFlatConfig": true,
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
"source.fixAll.stylelint": true,
"source.organizeImports": false
},
"stylelint.validate": ["css", "scss", "vue"]
"stylelint.validate": [
"css",
"scss",
"vue"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 fantastic-template
Copyright (c) 2020 fantastic-admin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
ignores: [
'public',
'dist*',
],
},
{
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'curly': ['error', 'all'],
'antfu/consistent-list-newline': 'off',
},
},
{
files: [
'src/**/*.vue',
],
rules: {
'vue/component-tags-order': ['error', {
order: ['route', 'script', 'template', 'style'],
}],
},
},
)
Empty file modified index.html
100644 → 100755
Empty file.
48 changes: 38 additions & 10 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,44 +1,71 @@
{
"type": "module",
"scripts": {
"dev": "vite",
"build:example": "vue-tsc --noEmit && vite build --mode example",
"build:example": "vue-tsc && vite build --mode example",
"serve:example": "http-server ./dist-example -o",
"svgo": "svgo -f src/assets/icons",
"new": "plop",
"generate:icons": "esno ./scripts/generate.icons.ts",
"lint": "npm-run-all -s lint:tsc lint:eslint lint:stylelint",
"lint:tsc": "vue-tsc --noEmit",
"lint:eslint": "eslint --cache --fix --no-ignore --no-error-on-unmatched-pattern --ext .ts,.tsx,.vue src/",
"lint:tsc": "vue-tsc",
"lint:eslint": "eslint . --cache --fix",
"lint:stylelint": "stylelint src/**/*.{css,scss,vue} --cache --fix --allow-empty-input",
"postinstall": "simple-git-hooks && esno scripts/prepare.js",
"postinstall": "simple-git-hooks",
"preinstall": "npx only-allow pnpm"
},
"dependencies": {
"@antv/g2plot": "^2.4.31",
"@bytemd/plugin-gfm": "^1.21.0",
"@bytemd/vue-next": "^1.21.0",
"@headlessui/vue": "^1.7.16",
"@tinymce/tinymce-vue": "^5.1.1",
"@vueuse/core": "^10.5.0",
"@vueuse/integrations": "^10.5.0",
"animate.css": "^4.1.1",
"axios": "^1.5.1",
"bytemd": "^1.21.0",
"dayjs": "^1.11.10",
"defu": "^6.1.3",
"echarts": "^5.4.3",
"element-plus": "^2.4.1",
"eruda": "^3.0.1",
"floating-vue": "2.0.0-beta.24",
"hotkeys-js": "^3.12.0",
"lodash-es": "^4.17.21",
"mitt": "^3.0.1",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"overlayscrollbars-vue": "^0.5.6",
"path-browserify": "^1.0.1",
"path-to-regexp": "^6.2.1",
"pinia": "^2.1.7",
"print-js": "^1.6.0",
"qrcode": "^1.5.3",
"qs": "^6.11.2",
"scule": "^1.0.0",
"splitpanes": "^3.1.5",
"swiper": "^11.0.3",
"tinymce": "^6.7.2",
"vconsole": "^3.15.1",
"vue": "^3.3.7",
"vue-router": "^4.2.5"
"vue-esign": "^1.1.4",
"vue-m-message": "^4.0.2",
"vue-router": "^4.2.5",
"vue3-count-to": "^1.1.2",
"vxe-table": "^4.5.13",
"xe-utils": "^3.5.13"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.0",
"@iconify-json/ep": "^1.1.12",
"@antfu/eslint-config": "1.0.0-beta.29",
"@iconify/json": "^2.2.133",
"@iconify/vue": "^4.1.1",
"@types/lodash-es": "^4.17.10",
"@types/nprogress": "^0.2.2",
"@types/path-browserify": "^1.0.1",
"@types/qrcode": "^1.5.4",
"@types/qs": "^6.9.9",
"@types/splitpanes": "^2.2.4",
"@vitejs/plugin-legacy": "^4.1.1",
"@vitejs/plugin-vue": "^4.4.0",
"@vitejs/plugin-vue-jsx": "^3.0.2",
Expand All @@ -47,11 +74,12 @@
"esno": "^0.17.0",
"fs-extra": "^11.1.1",
"http-server": "^14.1.1",
"inquirer": "^9.2.11",
"lint-staged": "^15.0.2",
"npm-run-all": "^4.1.5",
"plop": "^4.0.0",
"postcss-html": "^1.5.0",
"sass": "^1.69.4",
"sass": "^1.69.5",
"simple-git-hooks": "^2.9.0",
"stylelint": "^15.11.0",
"stylelint-config-standard-scss": "^11.0.0",
Expand All @@ -61,14 +89,14 @@
"svgo": "^3.0.2",
"terser": "^5.22.0",
"typescript": "^5.2.2",
"unplugin-auto-import": "^0.16.6",
"unocss": "^0.57.1",
"unplugin-auto-import": "^0.16.7",
"unplugin-vue-components": "^0.25.2",
"vite": "^4.5.0",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-mock": "^2.9.8",
"vite-plugin-pages": "^0.31.0",
"vite-plugin-spritesmith": "^0.1.1",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-inspector": "^4.0.0",
"vite-plugin-vue-meta-layouts": "^0.3.1",
Expand Down
Empty file modified plop-templates/component/index.hbs
100644 → 100755
Empty file.
Empty file modified plop-templates/component/prompt.js
100644 → 100755
Empty file.
78 changes: 78 additions & 0 deletions plop-templates/mock/mock.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import Mock from 'mockjs'

const AllList: any[] = []
for (let i = 0; i < 50; i++) {
AllList.push(Mock.mock({
id: '@id',
title: '@ctitle(10, 20)',
}))
}

export default [
{
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/list',
method: 'get',
response: (option: any) => {
const { title, from, limit } = option.query
const list = AllList.filter((item) => {
return title ? item.title.includes(title) : true
})
const pageList = list.filter((item, index) => {
return index >= ~~from && index < (~~from + ~~limit)
})
return {
error: '',
status: 1,
data: {
list: pageList,
total: list.length,
},
}
},
},
{
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/detail',
method: 'get',
response: (option: any) => {
const info = AllList.filter(item => item.id === option.query.id)
return {
error: '',
status: 1,
data: info[0],
}
},
},
{
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/create',
method: 'post',
response: {
error: '',
status: 1,
data: {
isSuccess: true,
},
},
},
{
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/edit',
method: 'post',
response: {
error: '',
status: 1,
data: {
isSuccess: true,
},
},
},
{
url: '/mock/{{#if relativePath}}{{ relativePath }}/{{/if}}{{ moduleName }}/delete',
method: 'post',
response: {
error: '',
status: 1,
data: {
isSuccess: true,
},
},
},
]
43 changes: 43 additions & 0 deletions plop-templates/mock/prompt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const path = require('node:path')
const fs = require('node:fs')

function getFolder(path) {
const components = []
const files = fs.readdirSync(path)
files.forEach((item) => {
const stat = fs.lstatSync(`${path}/${item}`)
if (stat.isDirectory() === true && item !== 'components') {
components.push(`${path}/${item}`)
components.push(...getFolder(`${path}/${item}`))
}
})
return components
}

module.exports = {
description: '创建标准模块 Mock',
prompts: [
{
type: 'list',
name: 'path',
message: '请选择模块目录',
choices: getFolder('src/views'),
},
],
actions: (data) => {
const pathArr = path.relative('src/views', data.path).split('\\')
const moduleName = pathArr.pop()
const relativePath = pathArr.join('/')
const actions = []
actions.push({
type: 'add',
path: pathArr.length === 0 ? 'src/mock/{{moduleName}}.ts' : `src/mock/${pathArr.join('.')}.{{moduleName}}.ts`,
templateFile: 'plop-templates/mock/mock.hbs',
data: {
relativePath,
moduleName,
},
})
return actions
},
}
Empty file modified plop-templates/page/index.hbs
100644 → 100755
Empty file.
Empty file modified plop-templates/page/prompt.js
100644 → 100755
Empty file.
Loading

0 comments on commit 807e3f9

Please sign in to comment.