Skip to content

Commit

Permalink
Merge pull request #7 from kabaluyot/feature/update-nuxt
Browse files Browse the repository at this point in the history
build: update packages to latest
  • Loading branch information
kabaluyot authored Nov 29, 2020
2 parents 181a05b + 275b684 commit 007a311
Show file tree
Hide file tree
Showing 18 changed files with 6,540 additions and 5,766 deletions.
32 changes: 19 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ module.exports = {
root: true,
env: {
browser: true,
node: true
node: true,
},
extends: [
'@nuxtjs/eslint-config-typescript',
'prettier',
'prettier/vue',
'plugin:prettier/recommended',
'plugin:nuxt/recommended'
'plugin:nuxt/recommended',
],
plugins: ['prettier'],
// add your custom rules here
Expand All @@ -23,23 +23,29 @@ module.exports = {
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false
}
ignoreRestSiblings: false,
},
],
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/ban-ts-ignore': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/explicit-function-return-type': 'off', // disable default
'@typescript-eslint/no-explicit-any': 'error',
camelcase: 'off',
'@typescript-eslint/camelcase': ['warn']
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'variable',
format: ['camelCase'],
},
],
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx', '*.vue'],
rules: {
'@typescript-eslint/explicit-function-return-type': ['error']
}
'@typescript-eslint/explicit-function-return-type': ['error'],
},
},
{
// allow explicit any in these files and missing return type
Expand All @@ -48,12 +54,12 @@ module.exports = {
'getters.ts',
'repository.ts',
'*.repository.ts',
'test/**/*'
'test/**/*',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': ['off']
}
}
]
'@typescript-eslint/explicit-function-return-type': ['off'],
},
},
],
}
2 changes: 1 addition & 1 deletion api/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ export default ($axios: AxiosInstance) => (resource: string): any => ({

delete(id: string): any {
return $axios.delete(`${resource}/${id}`)
}
},
})
2 changes: 1 addition & 1 deletion api/social/social.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export default ($axios: AxiosInstance) => ({
.catch((error: AxiosError) => {
throw error
})
}
},
})
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ module.exports = {
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'^~/(.*)$': '<rootDir>/$1',
'^vue$': 'vue/dist/vue.common.js'
'^vue$': 'vue/dist/vue.common.js',
},
moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
transform: {
'^.+\\.ts$': 'ts-jest',
'^.+\\.js$': 'babel-jest',
'.*\\.(vue)$': 'vue-jest'
'.*\\.(vue)$': 'vue-jest',
},
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/components/**/*.vue',
'<rootDir>/pages/**/*.vue'
'<rootDir>/pages/**/*.vue',
],
setupFilesAfterEnv: ['./test/jest.setup.ts']
setupFilesAfterEnv: ['./test/jest.setup.ts'],
}
14 changes: 6 additions & 8 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,16 @@
<v-icon>mdi-menu</v-icon>
</v-btn>
</v-app-bar>
<v-content>
<v-main>
<v-container>
<nuxt />
</v-container>
</v-content>
</v-main>
<v-navigation-drawer v-model="rightDrawer" :right="right" temporary fixed>
<v-list>
<v-list-item @click.native="right = !right">
<v-list-item-action>
<v-icon light>
mdi-repeat
</v-icon>
<v-icon light> mdi-repeat </v-icon>
</v-list-item-action>
<v-list-item-title>Switch drawer (click me)</v-list-item-title>
</v-list-item>
Expand Down Expand Up @@ -83,13 +81,13 @@ export default class Default extends Vue {
{
icon: 'mdi-apps',
title: 'Welcome',
to: '/'
to: '/',
},
{
icon: 'mdi-chart-bubble',
title: 'Inspire',
to: '/inspire'
}
to: '/inspire',
},
]
miniVariant: boolean = false
Expand Down
9 changes: 4 additions & 5 deletions layouts/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<h1 v-else>
{{ otherError }}
</h1>
<NuxtLink to="/">
Home page
</NuxtLink>
<NuxtLink to="/"> Home page </NuxtLink>
</v-app>
</template>

Expand All @@ -23,9 +21,10 @@ interface ErrorResponse {
layout: 'empty',
head(this: Error): {} {
return {
title: this.error.statusCode === 404 ? this.pageNotFound : this.otherError
title:
this.error.statusCode === 404 ? this.pageNotFound : this.otherError,
}
}
},
})
export default class Error extends Vue {
// props
Expand Down
42 changes: 21 additions & 21 deletions nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require('dotenv').config()

export default {
mode: 'universal',
ssr: true,
server: {
port: process.env.APP_PORT,
host: process.env.APP_HOST
host: process.env.APP_HOST,
},
/*
** Headers of the page
Expand All @@ -18,42 +18,42 @@ export default {
{
hid: 'description',
name: 'description',
content: process.env.APP_DESCRIPTION || ''
content: process.env.APP_DESCRIPTION || '',
},
// OG Tag setup
// https://vue-meta.nuxtjs.org/api/#meta
{
property: 'og:type',
content: 'website',
vmid: 'og:type'
vmid: 'og:type',
},
{
property: 'og:title',
content: process.env.APP_NAME,
vmid: 'og:title'
vmid: 'og:title',
},
{
property: 'og:description',
content: process.env.APP_DESCRIPTION,
vmid: 'og:description'
vmid: 'og:description',
},
{
property: 'og:site_name',
content: process.env.APP_URL,
vmid: 'og:site_name'
vmid: 'og:site_name',
},
{
property: 'og:url',
content: process.env.APP_URL,
vmid: 'og:url'
vmid: 'og:url',
},
{
property: 'og:image',
content: process.env.APP_URL + '/icon.png',
vmid: 'og:image'
}
vmid: 'og:image',
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
/*
** Customize the progress-bar color
Expand All @@ -74,7 +74,7 @@ export default {
'@nuxt/typescript-build',
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module',
'@nuxtjs/vuetify'
'@nuxtjs/vuetify',
],
/*
** Nuxt.js modules
Expand All @@ -84,7 +84,7 @@ export default {
'@nuxtjs/axios',
'@nuxtjs/pwa',
// Doc: https://github.com/nuxt-community/dotenv-module
'@nuxtjs/dotenv'
'@nuxtjs/dotenv',
],
/*
** Axios module configuration
Expand All @@ -94,32 +94,32 @@ export default {
debug: process.env.NODE_ENV !== 'production',
headers: {
common: {
Accept: 'application/json, text/plain, */*'
}
}
Accept: 'application/json, text/plain, */*',
},
},
},
/**
* PWA module configuration
* https://pwa.nuxtjs.org/setup.html
*/
pwa: {
meta: {
title: process.env.APP_NAME
title: process.env.APP_NAME,
},
manifest: {
name: process.env.APP_NAME,
short_name: process.env.APP_NAME,
description: process.env.APP_DESCRIPTION,
start_url: process.env.APP_URL,
lang: 'en'
}
lang: 'en',
},
},
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
vuetify: {
customVariables: ['~/assets/variables.scss'],
optionsPath: './vuetify.options.js'
}
optionsPath: './vuetify.options.js',
},
}
Loading

0 comments on commit 007a311

Please sign in to comment.