diff --git a/.eslintrc.js b/.eslintrc.js index bb1ce9d6..758c3d77 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,31 +1,31 @@ module.exports = { root: true, env: { - node: true + node: true, }, extends: [ - "plugin:vue/vue3-essential", - "eslint:recommended", - "@vue/typescript/recommended", - "@vue/prettier", - "@vue/prettier/@typescript-eslint" + 'plugin:vue/vue3-essential', + 'eslint:recommended', + '@vue/typescript/recommended', + '@vue/prettier', + '@vue/prettier/@typescript-eslint', ], parserOptions: { - ecmaVersion: 2020 + ecmaVersion: 2020, }, rules: { - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off" + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', }, overrides: [ { files: [ - "**/__tests__/*.{j,t}s?(x)", - "**/tests/unit/**/*.spec.{j,t}s?(x)" + '**/__tests__/*.{j,t}s?(x)', + '**/tests/unit/**/*.spec.{j,t}s?(x)', ], env: { - jest: true - } - } - ] -}; + jest: true, + }, + }, + ], +} diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..9e1d5a11 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,23 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +categories: + - title: 'Breaking change' + labels: + - 'Breaking Change' + - title: 'Features' + labels: + - 'feature' + - 'enhancement' + - title: 'Fixes' + labels: + - 'bug' + - title: 'Dependencies' + labels: + - 'dependencies' + - title: 'Refactor' + labels: + - 'refactor' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +template: | + ## Changes + $CHANGES diff --git a/.github/workflows/release_drafter_config.yml b/.github/workflows/release_drafter_config.yml new file mode 100644 index 00000000..17fdb961 --- /dev/null +++ b/.github/workflows/release_drafter_config.yml @@ -0,0 +1,14 @@ +name: Release Drafter + +on: + push: + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/LICENSE b/LICENSE index a8a68780..97387dd2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Takiya Osamu +Copyright (c) 2020 nikukyugamer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/babel.config.js b/babel.config.js index 397abca8..c1b783ea 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ["@vue/cli-plugin-babel/preset"] -}; + presets: ['@vue/cli-plugin-babel/preset'], +} diff --git a/jest.config.js b/jest.config.js index 461bdf18..02f8b699 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ module.exports = { - preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel", + preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel', transform: { - "^.+\\.vue$": "vue-jest" - } -}; + '^.+\\.vue$': 'vue-jest', + }, +} diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 00000000..2b2cd274 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,6 @@ +module.exports = { + tabWidth: 2, + singleQuote: true, + trailingComma: 'es5', + semi: false, +} diff --git a/src/main.ts b/src/main.ts index 0c99087f..041fa11d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,7 @@ -import { createApp } from "vue"; -import App from "./App.vue"; -import "./registerServiceWorker"; -import router from "./router"; -import store from "./store"; +import { createApp } from 'vue' +import App from './App.vue' +import './registerServiceWorker' +import router from './router' +import store from './store' -createApp(App) - .use(store) - .use(router) - .mount("#app"); +createApp(App).use(store).use(router).mount('#app') diff --git a/src/registerServiceWorker.ts b/src/registerServiceWorker.ts index 30b7895d..bb130a77 100644 --- a/src/registerServiceWorker.ts +++ b/src/registerServiceWorker.ts @@ -1,34 +1,34 @@ /* eslint-disable no-console */ -import { register } from "register-service-worker"; +import { register } from 'register-service-worker' -if (process.env.NODE_ENV === "production") { +if (process.env.NODE_ENV === 'production') { register(`${process.env.BASE_URL}service-worker.js`, { ready() { console.log( - "App is being served from cache by a service worker.\n" + - "For more details, visit https://goo.gl/AFskqB" - ); + 'App is being served from cache by a service worker.\n' + + 'For more details, visit https://goo.gl/AFskqB' + ) }, registered() { - console.log("Service worker has been registered."); + console.log('Service worker has been registered.') }, cached() { - console.log("Content has been cached for offline use."); + console.log('Content has been cached for offline use.') }, updatefound() { - console.log("New content is downloading."); + console.log('New content is downloading.') }, updated() { - console.log("New content is available; please refresh."); + console.log('New content is available; please refresh.') }, offline() { console.log( - "No internet connection found. App is running in offline mode." - ); + 'No internet connection found. App is running in offline mode.' + ) }, error(error) { - console.error("Error during service worker registration:", error); - } - }); + console.error('Error during service worker registration:', error) + }, + }) } diff --git a/src/router/index.ts b/src/router/index.ts index 2ac7a2b6..7e234ad4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,26 +1,26 @@ -import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"; -import Home from "../views/Home.vue"; +import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' +import Home from '../views/Home.vue' const routes: Array = [ { - path: "/", - name: "Home", - component: Home + path: '/', + name: 'Home', + component: Home, }, { - path: "/about", - name: "About", + path: '/about', + name: 'About', // route level code-splitting // this generates a separate chunk (about.[hash].js) for this route // which is lazy-loaded when the route is visited. component: () => - import(/* webpackChunkName: "about" */ "../views/About.vue") - } -]; + import(/* webpackChunkName: "about" */ '../views/About.vue'), + }, +] const router = createRouter({ history: createWebHistory(process.env.BASE_URL), - routes -}); + routes, +}) -export default router; +export default router diff --git a/src/shims-vue.d.ts b/src/shims-vue.d.ts index ffac6951..32a1b5cd 100644 --- a/src/shims-vue.d.ts +++ b/src/shims-vue.d.ts @@ -1,5 +1,5 @@ -declare module "*.vue" { - import { defineComponent } from "vue"; - const component: ReturnType; - export default component; +declare module '*.vue' { + import { defineComponent } from 'vue' + const component: ReturnType + export default component } diff --git a/src/store/index.ts b/src/store/index.ts index 187b4cb3..7d3d8eaf 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,8 +1,8 @@ -import { createStore } from "vuex"; +import { createStore } from 'vuex' export default createStore({ state: {}, mutations: {}, actions: {}, - modules: {} -}); + modules: {}, +}) diff --git a/tests/e2e/.eslintrc.js b/tests/e2e/.eslintrc.js index 053c39f0..a3e436bc 100644 --- a/tests/e2e/.eslintrc.js +++ b/tests/e2e/.eslintrc.js @@ -1,10 +1,10 @@ module.exports = { - plugins: ["cypress"], + plugins: ['cypress'], env: { mocha: true, - "cypress/globals": true + 'cypress/globals': true, }, rules: { - strict: "off" - } -}; + strict: 'off', + }, +} diff --git a/tests/e2e/plugins/index.js b/tests/e2e/plugins/index.js index 6bc65209..3cd3f22c 100644 --- a/tests/e2e/plugins/index.js +++ b/tests/e2e/plugins/index.js @@ -16,10 +16,10 @@ module.exports = (on, config) => { // })) return Object.assign({}, config, { - fixturesFolder: "tests/e2e/fixtures", - integrationFolder: "tests/e2e/specs", - screenshotsFolder: "tests/e2e/screenshots", - videosFolder: "tests/e2e/videos", - supportFile: "tests/e2e/support/index.js" - }); -}; + fixturesFolder: 'tests/e2e/fixtures', + integrationFolder: 'tests/e2e/specs', + screenshotsFolder: 'tests/e2e/screenshots', + videosFolder: 'tests/e2e/videos', + supportFile: 'tests/e2e/support/index.js', + }) +} diff --git a/tests/e2e/specs/test.js b/tests/e2e/specs/test.js index 70738968..479bea8d 100644 --- a/tests/e2e/specs/test.js +++ b/tests/e2e/specs/test.js @@ -1,8 +1,8 @@ // https://docs.cypress.io/api/introduction/api.html -describe("My First Test", () => { - it("Visits the app root url", () => { - cy.visit("/"); - cy.contains("h1", "Welcome to Your Vue.js + TypeScript App"); - }); -}); +describe('My First Test', () => { + it('Visits the app root url', () => { + cy.visit('/') + cy.contains('h1', 'Welcome to Your Vue.js + TypeScript App') + }) +}) diff --git a/tests/e2e/support/index.js b/tests/e2e/support/index.js index d076cec9..d68db96d 100644 --- a/tests/e2e/support/index.js +++ b/tests/e2e/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import "./commands"; +import './commands' // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/tests/unit/example.spec.ts b/tests/unit/example.spec.ts index 8bab2e66..6eac19b1 100644 --- a/tests/unit/example.spec.ts +++ b/tests/unit/example.spec.ts @@ -1,12 +1,12 @@ -import { shallowMount } from "@vue/test-utils"; -import HelloWorld from "@/components/HelloWorld.vue"; +import { shallowMount } from '@vue/test-utils' +import HelloWorld from '@/components/HelloWorld.vue' -describe("HelloWorld.vue", () => { - it("renders props.msg when passed", () => { - const msg = "new message"; +describe('HelloWorld.vue', () => { + it('renders props.msg when passed', () => { + const msg = 'new message' const wrapper = shallowMount(HelloWorld, { - props: { msg } - }); - expect(wrapper.text()).toMatch(msg); - }); -}); + props: { msg }, + }) + expect(wrapper.text()).toMatch(msg) + }) +})