Skip to content
Permalink
Browse files

refactor: Nuxt のバージョンを 2.x へ上げる (#364)

* wip

* yarn add nuxt@^2.0.0

* [optional] Delete all directories .nuxt, node_modules, yarn.lock and package.lock.json にしたがって yarn.lock を一旦削除した

* Ensure you are using the latest node version (Node 10.x and NPM >= 5 are recommended) にしたがって Node のバージョンを最新にした(10.15.1)

* Upgrade nuxt.config.js, modules and serverMiddleware to use import/export instead of require

* Ensure webpack and vue dependencies are not explicitly set inside your package.json, if so please upgrade them to match Nuxt used versions にしたがって vue のバージョン指定を削除した

* Do npm install or yarn install

* nuxt-sass-resources-loader のサポートが終了したので @nuxtjs/style-resources に乗り換えた

* TypeError: Cannot read property 'eslint' of undefined 修正のために ESLint に関するパッケージのバージョンを上げた

yarn add --dev \
eslint@latest \
eslint-config-standard@latest \
eslint-friendly-formatter@latest \
eslint-loader@latest \
eslint-plugin-import@latest \
eslint-plugin-node@latest \
eslint-plugin-promise@latest \
eslint-plugin-standard@latest \
eslint-plugin-vue@latest \
babel-eslint@latest \
babel-plugin-transform-object-rest-spread@latest

* fix: eslint-error: The "TheFooter" component has been registered but not used  vue/no-unused-components

* yarn add --dev node-sass@latest sass-loader@latest

* karma に関するパッケージのバージョンを latest に上げた

yarn add --dev \
karma@latest \
karma-chrome-launcher@latest \
karma-mocha@latest \
karma-sinon-chai@latest \
karma-webpack@latest \
mocha@latest \
sinon@latest \
sinon-chai@latest

* karma.conf.js の webpack の設定を更新してテストが通るようにした

* CircleCI でも Node LTS の最新バージョンを使う

* babel-plugin-transform-object-rest-spread が不要になったので削除

* styleResources の中で ~ エイリアスを使うことができる

* fix: The vendor array isn't used anymore because of Webpack 4

* mode プロパティのデフォルト値は universal だけど明示しておいたほうが分かりやすい

* + process.traceDeprecation = true

ERROR  (node:79384) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead の詳細を確認するため

* fix: ERROR (node:79384) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead

webpack/webpack#6568 (comment)

* 公式ドキュメントに合わせて、ディレクトリ末尾のスラッシュを入れた

* fix: new の書き漏れ

* nuxt.config.js でも export default 使える
  • Loading branch information...
inouetakuya committed Feb 27, 2019
1 parent 5a34309 commit 431345a769dcb55ce58365ef86c3543c1da06cbb
Showing with 4,328 additions and 4,116 deletions.
  1. +2 −2 .circleci/config.yml
  2. +1 −1 .node-version
  3. +15 −14 nuxt.config.js
  4. +21 −23 package.json
  5. +0 −2 src/pages/privacy.vue
  6. +2 −0 src/pages/speakers/_id.vue
  7. +33 −27 test/unit/karma.conf.js
  8. +4,254 −4,047 yarn.lock
@@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:8.9.4-browsers
- image: circleci/node:10.15.1-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
@@ -33,5 +33,5 @@ jobs:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run: yarn run lint
- run: yarn lint
- run: yarn test
@@ -1 +1 @@
8.9.4
10.15.1
@@ -1,8 +1,10 @@
// SyntaxError: Unexpected token import
// import * as speakers from 'src/store/speakers'

const fs = require('fs')
const path = require('path')
import fs from 'fs'

// ERROR (node:79384) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead の詳細を確認するため
process.traceDeprecation = true

try {
fs.statSync('.env')
@@ -20,7 +22,10 @@ const defaultTitle = 'Vue Fes Japan 2018 | 2018年11月3日(土)'
const defaultDescription = '日本で初めて開催する大規模 Vue.js カンファレンス。国内外の著名スピーカーによるセッションの他、ユーザー同士が気軽に話し合える場も設ける予定です。ぜひ、一緒に Vue.js を楽しみ、盛り上げていきましょう!'
const defaultOgImageUrl = 'https://vuefes.jp/opengraph.jpg'

module.exports = {
export default {
mode: 'universal',
srcDir: 'src/',

/*
** Headers of the page
*/
@@ -60,11 +65,6 @@ module.exports = {
** Build configuration
*/
build: {
vendor: [
'intersection-observer',
'vue-lazyload',
],

/*
** Run ESLint on save
*/
@@ -87,7 +87,6 @@ module.exports = {
})
},
},
srcDir: 'src/',
css: [
{ src: '~/assets/stylesheets/main.scss', lang: 'scss' },
],
@@ -115,7 +114,7 @@ module.exports = {
},
modules: [
'@nuxtjs/google-analytics',
'nuxt-sass-resources-loader',
'@nuxtjs/style-resources',
[
'@nuxtjs/pwa',
{
@@ -136,8 +135,10 @@ module.exports = {
'google-analytics': {
id: process.env.GA_TRACKING_ID || 'UA-XXXXXXX-X',
},
sassResources: [
path.resolve(__dirname, 'src/assets/stylesheets/foundation/variables.scss'),
path.resolve(__dirname, 'src/assets/stylesheets/foundation/colors.scss'),
],
styleResources: {
scss: [
'~/assets/stylesheets/foundation/variables.scss',
'~/assets/stylesheets/foundation/colors.scss',
],
},
}
@@ -18,47 +18,45 @@
"dependencies": {
"@nuxtjs/axios": "^5.1.1",
"@nuxtjs/google-analytics": "^2.0.2",
"@nuxtjs/pwa": "^2.3.2",
"@nuxtjs/pwa": "^3.0.0-beta.8",
"@nuxtjs/style-resources": "^0.1.2",
"dotenv": "^6.2.0",
"intersection-observer": "^0.5.0",
"lodash.shuffle": "^4.2.0",
"normalize.css": "^8.0.0",
"nuxt": "^1.0.0",
"nuxt-sass-resources-loader": "^1.1.1",
"vue": "^2.5.13",
"nuxt": "^2.0.0",
"vue-lazyload": "^1.2.6"
},
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.25",
"ajv": "^6.1.1",
"babel-eslint": "^8.2.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-eslint": "^10.0.1",
"chai": "^4.1.2",
"eslint": "^4.15.0",
"eslint-config-standard": "^11.0.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"eslint": "^5.14.1",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^5.2.2",
"husky": "^0.14.3",
"imagemin-cli": "^3.0.0",
"imagemin-gifsicle": "^5.2.0",
"imagemin-mozjpeg": "^7.0.0",
"imagemin-optipng": "^5.2.1",
"imagemin-pngquant": "^6.0.0",
"imagemin-svgo": "^7.0.0",
"karma": "^2.0.0",
"karma": "^4.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-sinon-chai": "^1.3.3",
"karma-webpack": "^2.0.9",
"mocha": "^5.0.1",
"node-sass": "^4.7.2",
"sass-loader": "^6.0.6",
"sinon": "^4.3.0",
"sinon-chai": "^2.14.0"
"karma-sinon-chai": "^2.0.2",
"karma-webpack": "^3.0.5",
"mocha": "^6.0.2",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"sinon": "^7.2.4",
"sinon-chai": "^3.3.0"
}
}
@@ -203,14 +203,12 @@

<script>
import LinkButton from '~/components/LinkButton'
import TheFooter from '~/components/TheFooter'
import TheMain from '~/components/TheMain'
export default {
name: 'PrivacyPage',
components: {
LinkButton,
TheFooter,
TheMain,
},
head () {
@@ -157,6 +157,8 @@ export default {
return 'blue'
} else if (this.speaker.venue === '会場B') {
return 'red'
} else {
throw new Error('speaker.venue is invalid')
}
},
...mapGetters('speakers', ['keynoteSpeakerById', 'sessionSpeakerById']),
@@ -1,4 +1,5 @@
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')

// Karma configuration
// Generated on Mon Feb 19 2018 00:24:28 GMT+0900 (JST)
@@ -28,6 +29,9 @@ module.exports = (config) => {
},

webpack: {
plugins: [
new VueLoaderPlugin(),
],
resolve: {
extensions: ['.js', '.vue'],
alias: {
@@ -39,38 +43,40 @@ module.exports = (config) => {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
js: [
{
loader: 'babel-loader',
options: {
plugins: ['transform-object-rest-spread'],
},
},
],
scss: [
'vue-style-loader',
'css-loader',
'sass-loader',
{
loader: 'sass-resources-loader',
options: {
resources: [
'./src/assets/stylesheets/foundation/variables.scss',
'./src/assets/stylesheets/foundation/colors.scss',
],
},
},
],
use: 'vue-loader',
},
{
test: /\.css$/,
use: [
{ loader: 'vue-style-loader' },
{ loader: 'css-loader', options: { sourceMap: true } },
],
},
{
test: /\.scss$/,
use: [
{ loader: 'vue-style-loader' },
{ loader: 'css-loader', options: { sourceMap: true } },
{ loader: 'sass-loader', options: { sourceMap: true } },
{
loader: 'sass-resources-loader',
options: {
sourceMap: true,
resources: [
'./src/assets/stylesheets/foundation/variables.scss',
'./src/assets/stylesheets/foundation/colors.scss',
],
},
},
},
],
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
exclude: file => (
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
),
},
{
test: /\.(png|jpe?g|gif|svg|webp)$/,
Oops, something went wrong.

0 comments on commit 431345a

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.