Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved Issue #1 #11

Merged
merged 6 commits into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ sw.*
*.swp

### Misc
apis/$*.ts
site/apis/$*.ts

types/*
!.gitkeep
29 changes: 29 additions & 0 deletions site/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
root: true,
env: {
browser: true,
node: true
},
extends: [
'@nuxtjs/eslint-config-typescript',
'plugin:nuxt/recommended',
'plugin:prettier/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier/standard',
'prettier/unicorn',
'prettier/vue'
],
globals: { $nuxt: 'readonly' },
rules: {
'max-lines': ['error', 200],
'no-console': +(process.env.NODE_ENV === 'production'),
'prefer-template': 'error'
},
overrides: [
{
files: ['apis/**/*.ts'],
rules: { camelcase: ['off'] }
}
]
}
10 changes: 8 additions & 2 deletions site/apis/users/_id.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import { MockMethods } from 'axios-mock-server'
import { users, Users } from './index'
import { users } from './index'

export interface User {
id: number
firstname: string
lastname: string
}

const methods: MockMethods = {
get: ({ values }) => [200, users.find((user) => user.id === values.id)]
}

export interface Methods {
get: {
response: Users
response: User
}
}

Expand Down
4 changes: 2 additions & 2 deletions site/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<v-app>
<nuxt />
</div>
</v-app>
</template>
23 changes: 21 additions & 2 deletions site/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ const config: Configuration = {
content: process.env.npm_package_description || ''
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css?family=Noto+Sans+JP:300,400,500,700|Material+Icons'
}
],
...(SUPPORT_IE === 'true'
? {
script: [
Expand Down Expand Up @@ -54,7 +61,9 @@ const config: Configuration = {
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module',
// Doc: https://typescript.nuxtjs.org/
['@nuxt/typescript-build', { typeCheck: { eslint: true } }]
['@nuxt/typescript-build', { typeCheck: { eslint: true } }],
// Doc: https://github.com/nuxt-community/vuetify-module
'@nuxtjs/vuetify'
],
/*
** Nuxt.js modules
Expand All @@ -70,6 +79,16 @@ const config: Configuration = {
** See https://axios.nuxtjs.org/options
*/
axios: { baseURL: 'https://example.com/v1' },
/*
** Vuetify module configuration
** See https://github.com/nuxt-community/vuetify-module#options
*/
vuetify: {
defaultAssets: {
font: { family: 'Noto Sans JP' }
},
treeShake: true
},
/*
** Build configuration
*/
Expand Down
Loading