fix/githubaction/config (#14)

* fix: githubactions config

* fix: update build env

* fix: remove cache

Co-authored-by: ivringpeng <pengyue970725@gmail.com>
This commit is contained in:
PY 2021-12-06 22:53:37 +08:00 committed by GitHub
parent 4e0b787829
commit 86f73de893
12 changed files with 53 additions and 26 deletions

View File

@ -8,5 +8,10 @@ jobs:
MAIN_PULL_REQUEST: MAIN_PULL_REQUEST:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/install-dep@develop - uses: actions/checkout@v2
- run: npm run lint - uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
shell: bash
- run: npm run lint

View File

@ -1,19 +1,27 @@
name: All_ON_PUSH name: All_ON_PUSH
on: push on: push
jobs: jobs:
All_ON_PUSH: All_ON_PUSH:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/install-dep@develop - uses: actions/checkout@v2
- run: echo '${{ github.ref }} ... ${{ github.sha }}'' - uses: actions/setup-node@v2
- name: build with:
node-version: '14'
- run: npm install
shell: bash
- run: echo '${{ github.ref }} ... ${{ github.sha }}'
- name: build-site
run: npm run build run: npm run build
- name: upload surge service - name: upload surge service and generate preview URL
id: deploy id: deploy
run: | run: |
export DEPLOY_DOMAIN=https://preview-${{ github.ref }}-tdesign-vue.surge.sh export GITHUB_SHA=${{ github.sha }}
npx surge --project dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} export GITHUB_SHA_SUB=${GITHUB_SHA: 0: 7 }
- run: echo 'https://preview-${{ github.ref }}-tdesign-vue.surge.sh' export DEPLOY_DOMAIN=https://preview-$GITHUB_SHA_SUB-tdesign-vue-next-starter.surge.sh
npx surge --project ./dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
echo the preview URL is $DEPLOY_DOMAIN
if: ${{ success() }} if: ${{ success() }}
- run: echo "🍏 This job's status is ${{ job.status }}." - run: echo "🚀 This job's status is ${{ job.status }}."

3
globals.d.ts vendored
View File

@ -5,7 +5,8 @@ declare interface ImportMeta {
env: { env: {
MODE: 'mock' | 'development' | 'test' | 'release'; MODE: 'mock' | 'development' | 'test' | 'release';
}; };
glob: (url: string) => {}; // eslint-disable-next-line no-unused-vars
glob: (url: string) => { url };
} }
declare module '*.svg' { declare module '*.svg' {

View File

@ -5,7 +5,7 @@
"start:mock": "vite --open --mode mock", "start:mock": "vite --open --mode mock",
"start": "vite --open --mode development", "start": "vite --open --mode development",
"build:test": "vite build --mode test", "build:test": "vite build --mode test",
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build --mode release",
"preview": "vite preview", "preview": "vite preview",
"lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0", "lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0",
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix", "lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix",

View File

@ -19,5 +19,5 @@ export type SettingType = typeof STYLE_CONFIG;
export type ClassName = { [className: string]: any } | ClassName[] | string; export type ClassName = { [className: string]: any } | ClassName[] | string;
export type CommonObjType = { export type CommonObjType = {
[key: string]: string | number [key: string]: string | number;
} };

View File

@ -3,6 +3,7 @@ import * as echarts from 'echarts/core';
import { getBrandColor } from '@/config/color'; import { getBrandColor } from '@/config/color';
import store from '@/store'; import store from '@/store';
import { CommonObjType } from '@/interface'; import { CommonObjType } from '@/interface';
const { state } = store; const { state } = store;
/** /**
@ -177,9 +178,11 @@ export function constructInitDataset(dateTime: Array<string> = []) {
// console.log('dateAbsTime..', dateAbsTime, enhandTime); // console.log('dateAbsTime..', dateAbsTime, enhandTime);
timeArray.push(dayjs(enhandTime).format('YYYY-MM-DD')); timeArray.push(dayjs(enhandTime).format('YYYY-MM-DD'));
} else { } else {
timeArray.push(dayjs() timeArray.push(
.subtract(divideNum - i, 'day') dayjs()
.format('YYYY-MM-DD')); .subtract(divideNum - i, 'day')
.format('YYYY-MM-DD'),
);
} }
inArray.push(getRandomArray().toString()); inArray.push(getRandomArray().toString());

View File

@ -59,7 +59,12 @@ export default defineComponent({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
data: Object, data: {
type: Object,
default: () => {
return {};
},
},
}, },
setup(props, ctx) { setup(props, ctx) {
const formVisible = ref(false); const formVisible = ref(false);

View File

@ -6,7 +6,7 @@ export const passwordValidator = (val) => {
return { result: false, message: '需包含下划线_', type: 'warning' }; return { result: false, message: '需包含下划线_', type: 'warning' };
} }
return { result: true }; return { result: true };
} };
export const getEmails = (search) => [ export const getEmails = (search) => [
{ {
@ -37,5 +37,5 @@ export const getEmails = (search) => [
export default { export default {
passwordValidator, passwordValidator,
getEmails getEmails,
} };

View File

@ -1,5 +1,5 @@
// 定义的state初始值 // 定义的state初始值
import { NotificationItem } from '../interface' import { NotificationItem } from '../interface';
const state = { const state = {
msgData: [ msgData: [

View File

@ -1,6 +1,12 @@
// 获取常用时间 // 获取常用时间
import dayjs from 'dayjs'; import dayjs from 'dayjs';
export const LAST_7_DAYS = [dayjs().subtract(7, 'day').format('YYYY-MM-DD'), dayjs().subtract(1, 'day').format('YYYY-MM-DD')]; export const LAST_7_DAYS = [
dayjs().subtract(7, 'day').format('YYYY-MM-DD'),
dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
];
export const LAST_30_DAYS = [dayjs().subtract(30, 'day').format('YYYY-MM-DD'), dayjs().subtract(1, 'day').format('YYYY-MM-DD')]; export const LAST_30_DAYS = [
dayjs().subtract(30, 'day').format('YYYY-MM-DD'),
dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
];

View File

@ -38,7 +38,7 @@ export const useChart = (domId: string): Ref<echarts.ECharts> => {
* @returns * @returns
*/ */
export const useCounter = (duration = 60): [Ref<number>, () => void] => { export const useCounter = (duration = 60): [Ref<number>, () => void] => {
let intervalTimer: NodeJS.Timer; let intervalTimer;
onUnmounted(() => { onUnmounted(() => {
clearInterval(intervalTimer); clearInterval(intervalTimer);
}); });

View File

@ -14,7 +14,6 @@ export default defineConfig({
}, },
}, },
plugins: [ plugins: [
createVuePlugin(), createVuePlugin(),
vueJsx(), vueJsx(),