Skip to content

Commit

Permalink
Merge pull request #72 from nikukyugamer/development
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
nikukyugamer authored Sep 8, 2020
2 parents b8ba992 + f09dd94 commit fc0cc88
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 95 deletions.
32 changes: 16 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -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,
},
},
],
}
23 changes: 23 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions .github/workflows/release_drafter_config.yml
Original file line number Diff line number Diff line change
@@ -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 }}
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) 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
Expand Down
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};
presets: ['@vue/cli-plugin-babel/preset'],
}
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -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',
},
}
6 changes: 6 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
tabWidth: 2,
singleQuote: true,
trailingComma: 'es5',
semi: false,
}
15 changes: 6 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -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')
28 changes: 14 additions & 14 deletions src/registerServiceWorker.ts
Original file line number Diff line number Diff line change
@@ -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)
},
})
}
26 changes: 13 additions & 13 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -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<RouteRecordRaw> = [
{
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
8 changes: 4 additions & 4 deletions src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module "*.vue" {
import { defineComponent } from "vue";
const component: ReturnType<typeof defineComponent>;
export default component;
declare module '*.vue' {
import { defineComponent } from 'vue'
const component: ReturnType<typeof defineComponent>
export default component
}
6 changes: 3 additions & 3 deletions src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createStore } from "vuex";
import { createStore } from 'vuex'

export default createStore({
state: {},
mutations: {},
actions: {},
modules: {}
});
modules: {},
})
10 changes: 5 additions & 5 deletions tests/e2e/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
plugins: ["cypress"],
plugins: ['cypress'],
env: {
mocha: true,
"cypress/globals": true
'cypress/globals': true,
},
rules: {
strict: "off"
}
};
strict: 'off',
},
}
14 changes: 7 additions & 7 deletions tests/e2e/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
}
12 changes: 6 additions & 6 deletions tests/e2e/specs/test.js
Original file line number Diff line number Diff line change
@@ -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')
})
})
2 changes: 1 addition & 1 deletion tests/e2e/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
20 changes: 10 additions & 10 deletions tests/unit/example.spec.ts
Original file line number Diff line number Diff line change
@@ -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)
})
})

0 comments on commit fc0cc88

Please sign in to comment.