From 6ae2dc4aa3b2cde6a9a51956686ce4dcd3db30a1 Mon Sep 17 00:00:00 2001 From: Sergey Solodyagin Date: Wed, 11 Oct 2023 15:24:41 +0300 Subject: [PATCH] chore: format --- .browserslistrc | 6 +- .editorconfig | 18 +- .eslintignore | 4 +- .eslintrc.js | 37 +- .gitattributes | 1 + .github/workflows/deploy.yml | 31 + .gitignore | 44 +- .npmrc | 2 + .prettierrc.js | 23 +- .vscode/extensions.json | 3 + .vscode/settings.json | 9 + README.md | 92 +- babel.config.js | 8 +- lib/components/GGanttBar.vue | 1237 +- lib/components/GGanttChart.vue | 858 +- lib/components/GGanttGrid.vue | 147 +- lib/components/GGanttRow.vue | 392 +- lib/components/GGanttTimeaxis.vue | 416 +- lib/index.js | 38 +- lib/scss/_variables.scss | 26 +- lib/scss/index.scss | 72 +- lib/scss/themes/creamy/_variables.scss | 14 +- lib/scss/themes/creamy/index.scss | 6 +- lib/scss/themes/crimson/_variables.scss | 14 +- lib/scss/themes/crimson/index.scss | 6 +- lib/scss/themes/dark/_variables.scss | 20 +- lib/scss/themes/dark/index.scss | 6 +- lib/scss/themes/flare/_variables.scss | 14 +- lib/scss/themes/flare/index.scss | 6 +- lib/scss/themes/fuchsia/_variables.scss | 18 +- lib/scss/themes/fuchsia/index.scss | 6 +- lib/scss/themes/grove/_variables.scss | 14 +- lib/scss/themes/grove/index.scss | 6 +- lib/scss/themes/material-blue/_variables.scss | 14 +- lib/scss/themes/material-blue/index.scss | 6 +- lib/scss/themes/sky/_variables.scss | 14 +- lib/scss/themes/sky/index.scss | 6 +- lib/scss/themes/slumber/_variables.scss | 20 +- lib/scss/themes/slumber/index.scss | 6 +- lib/scss/themes/vue/_variables.scss | 14 +- lib/scss/themes/vue/index.scss | 6 +- package-lock.json | 29709 +++++----------- package.json | 35 +- src/App.vue | 756 +- src/main.js | 24 +- vetur.config.js | 16 +- vue.config.js | 53 +- 47 files changed, 11776 insertions(+), 22497 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/deploy.yml create mode 100644 .npmrc create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.browserslistrc b/.browserslistrc index 256c3b8..214388f 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,3 +1,3 @@ -> 1% -last 2 versions -not dead +> 1% +last 2 versions +not dead diff --git a/.editorconfig b/.editorconfig index 9f73416..9d08a1a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,9 @@ -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.eslintignore b/.eslintignore index 3f2da39..5df41e2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ -demo -dist +demo +dist diff --git a/.eslintrc.js b/.eslintrc.js index 44b5ddd..4775e75 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,17 +1,20 @@ -module.exports = { - root: true, - env: { - node: true - }, - 'extends': [ - 'plugin:vue/essential', - 'eslint:recommended' - ], - parserOptions: { - parser: 'babel-eslint' - }, - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' - } -} +const isProduction = process.env.NODE_ENV === 'production' + +module.exports = { + root: true, + env: { + node: true + }, + extends: [ + 'plugin:vue/essential', + 'eslint:recommended', + 'plugin:prettier/recommended' + ], + parserOptions: { + parser: '@babel/eslint-parser' + }, + rules: { + 'no-console': isProduction ? 'warn' : 'off', + 'no-debugger': isProduction ? 'warn' : 'off' + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8d212ec --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Deploy to GH Pages + +on: + push: + branches: + - main + +jobs: + build-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout 🛎️ + uses: actions/checkout@master + with: + persist-credentials: false + + - name: Install 🔧 + run: npm install + + - name: Build 🏗️ + run: npm run demo:build + env: + NODE_ENV: production + + - name: Deploy to GH Pages 🚀 + if: ${{ github.event_name != 'pull_request' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: demo diff --git a/.gitignore b/.gitignore index aa5b09c..7dae120 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,17 @@ -.DS_Store - -# local env files -.env.local -.env.*.local - -# Log files -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# Editor directories and files -.idea -.vscode -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? - -# npm -node_modules - -# output directories -/demo -/dist +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +**/.history + +# npm +node_modules + +# Output directories +/demo +/dist diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9b9b7bb --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +registry=https://registry.npmjs.org/ +@tenrok:registry=https://registry.npmjs.org/ diff --git a/.prettierrc.js b/.prettierrc.js index 027b445..023e9e4 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,11 +1,12 @@ -module.exports = { - arrowParens: 'avoid', - bracketSpacing: true, - printWidth: 80, - semi: false, - singleQuote: true, - tabWidth: 2, - trailingComma: 'none', - useTabs: false, - vueIndentScriptAndStyle: true -} +// https://prettier.io/docs/en/options.html + +module.exports = { + arrowParens: 'avoid', + bracketSpacing: true, + printWidth: 120, + semi: false, + singleQuote: true, + tabWidth: 2, + trailingComma: 'none', + useTabs: false +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..1e4c0a7 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["editorconfig.editorconfig", "esbenp.prettier-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..46f91e5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace", + "editor.fontLigatures": true, + "editor.fontWeight": "400", + "editor.foldingStrategy": "indentation", + "editor.formatOnSave": true, + "editor.rulers": [120], + "editor.defaultFormatter": "esbenp.prettier-vscode" +} diff --git a/README.md b/README.md index cd4c884..287e6a2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ # Vue-Ganttastic -![screenshot](https://user-images.githubusercontent.com/4740535/143231164-88cd538f-f4ff-4fc6-8cb0-a25f4bab465c.png) +[![Version](https://img.shields.io/npm/v/@tenrok/vue-ganttastic.svg)](https://www.npmjs.com/package/@tenrok/vue-ganttastic) +[![License](https://img.shields.io/npm/l/@tenrok/vue-ganttastic.svg)](https://github.com/tenrok/vue-ganttastic/blob/main/LICENSE) +[![Vue.js](https://img.shields.io/badge/vue-2.7.14-brightgreen.svg?logo=vue.js)](https://github.com/vuejs/vue) +[![GitHub last commit](https://img.shields.io/github/last-commit/tenrok/vue-ganttastic.svg)](https://github.com/tenrok/vue-ganttastic) +[![Downloads](https://img.shields.io/npm/dm/@tenrok/vue-ganttastic.svg)](https://npmcharts.com/compare/@tenrok/vue-ganttastic?minimal=true) +[![Demo](https://img.shields.io/badge/demo-demo-blue.svg)](https://tenrok.github.io/vue-ganttastic/) A simple and easy-to-use Gantt chart component for Vue.js -[Demo](http://vue-ganttastic.vercel.app/) +![screenshot](https://user-images.githubusercontent.com/4740535/143231164-88cd538f-f4ff-4fc6-8cb0-a25f4bab465c.png) ## Installation @@ -31,6 +36,7 @@ For more detailed information, such as how to style the bars or additional confi The following code showcases a simple usage example in a .vue SFC (Single File Component) + ```html + + + + + diff --git a/src/main.js b/src/main.js index 4287ba8..7e9a906 100644 --- a/src/main.js +++ b/src/main.js @@ -1,12 +1,12 @@ -import Vue from 'vue' -import App from './App.vue' -import { GGanttChart, GGanttRow } from '../lib' - -Vue.component('GGanttChart', GGanttChart) -Vue.component('GGanttRow', GGanttRow) - -Vue.config.productionTip = false - -new Vue({ - render: h => h(App) -}).$mount('#app') +import Vue from 'vue' +import App from './App.vue' +import { GGanttChart, GGanttRow } from '../lib' + +Vue.component('GGanttChart', GGanttChart) +Vue.component('GGanttRow', GGanttRow) + +Vue.config.productionTip = false + +new Vue({ + render: h => h(App) +}).$mount('#app') diff --git a/vetur.config.js b/vetur.config.js index 2bd857d..e4e044d 100644 --- a/vetur.config.js +++ b/vetur.config.js @@ -1,8 +1,8 @@ -// vetur.config.js -/** @type {import('vls').VeturConfig} */ -module.exports = { - settings: { - 'vetur.ignoreProjectWarning': true, - }, - projects: ['./'], -} +// vetur.config.js +/** @type {import('vls').VeturConfig} */ +module.exports = { + settings: { + 'vetur.ignoreProjectWarning': true + }, + projects: ['./'] +} diff --git a/vue.config.js b/vue.config.js index c151d0a..7fc43a3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,24 +1,29 @@ -const isBuildLib = - (process.env.npm_lifecycle_script || '').indexOf('--target lib') > 0 - -module.exports = { - publicPath: '', - outputDir: isBuildLib ? 'dist' : 'demo', - css: { - loaderOptions: { - sass: { - implementation: require('sass') - } - }, - extract: true - }, - productionSourceMap: false, - chainWebpack: config => { - if (process.env.VUE_CLI_BUILD_TARGET === 'lib') { - config.externals({ - ...config.get('externals'), - moment: 'moment' - }) - } - } -} +const isProduction = process.env.NODE_ENV === 'production' +const isBuildLib = + (process.env.npm_lifecycle_script || '').indexOf('--target lib') > 0 + +module.exports = { + publicPath: isProduction ? '/vue-ganttastic/' : '', + + outputDir: isBuildLib ? 'dist' : 'demo', + + css: { + loaderOptions: { + sass: { + implementation: require('sass') + } + }, + extract: true + }, + + productionSourceMap: false, + + chainWebpack: config => { + if (isBuildLib) { + config.externals({ + ...config.get('externals'), + moment: 'moment' + }) + } + } +}