Skip to content

Commit ee3fe49

Browse files
authored
Merge pull request #368 from nuxt-community/update-all-deps
Update all deps & update vue-apollo-cli-plugin version
2 parents 682c526 + 3581c88 commit ee3fe49

File tree

8 files changed

+6502
-3659
lines changed

8 files changed

+6502
-3659
lines changed

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Common
2+
node_modules
3+
dist
4+
.nuxt
5+
coverage
6+
7+
# Plugin
8+
lib/templates/plugin.js

.eslintrc.js

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
module.exports = {
22
root: true,
33
parserOptions: {
4+
parser: 'babel-eslint',
45
sourceType: 'module'
56
},
6-
env: {
7-
browser: true,
8-
node: true,
9-
jest: true
10-
},
11-
extends: 'standard',
12-
plugins: [
13-
'jest',
14-
'vue'
15-
],
16-
rules: {
17-
// Allow paren-less arrow functions
18-
'arrow-parens': 0,
19-
// Allow async-await
20-
'generator-star-spacing': 0,
21-
// Allow debugger during development
22-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
23-
// Do not allow console.logs etc...
24-
'no-console': 0
25-
},
26-
globals: {
27-
'jest/globals': true,
28-
jasmine: true
29-
}
7+
extends: [
8+
'@nuxtjs'
9+
]
3010
}

babel.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env', {
5+
useBuiltIns: 'usage',
6+
corejs: 3,
7+
targets: {
8+
esmodules: true
9+
}
10+
}
11+
]
12+
]
13+
}

jest.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
testEnvironment: 'node',
3+
collectCoverage: true,
4+
collectCoverageFrom: [
5+
'lib/**/*.js',
6+
'!lib/plugin.js'
7+
],
8+
moduleNameMapper: {
9+
'^~/(.*)$': '<rootDir>/lib/$1',
10+
'^~~$': '<rootDir>',
11+
'^@@$': '<rootDir>',
12+
'^@/(.*)$': '<rootDir>/lib/$1'
13+
},
14+
transform: {
15+
'^.+\\.js$': 'babel-jest'
16+
}
17+
}

lib/module.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function (moduleOptions) {
88
// Fetch `apollo` option from `nuxt.config.js`
99
const options = this.options.apollo || moduleOptions
1010
// Check network interfaces valid definition
11-
if (!options.clientConfigs) throw new Error('[Apollo module] No clientConfigs found in apollo configuration')
11+
if (!options.clientConfigs) { throw new Error('[Apollo module] No clientConfigs found in apollo configuration') }
1212

1313
const { clientConfigs } = options
1414
const clientConfigKeys = Object.keys(clientConfigs)
@@ -19,11 +19,11 @@ module.exports = function (moduleOptions) {
1919

2020
if (typeof clientConfig !== 'object') {
2121
if (typeof clientConfig !== 'string') {
22-
throw new Error(`[Apollo module] Client configuration "${key}" should be an object or a path to an exported Apollo Client config.`)
22+
throw new TypeError(`[Apollo module] Client configuration "${key}" should be an object or a path to an exported Apollo Client config.`)
2323
}
2424
} else if (typeof clientConfig.httpEndpoint !== 'string' && typeof clientConfig.wsEndpoint !== 'string') {
2525
if (typeof clientConfig.link !== 'object') {
26-
throw new Error(`[Apollo module] Client configuration "${key}" must define httpEndpoint or link option.`)
26+
throw new TypeError(`[Apollo module] Client configuration "${key}" must define httpEndpoint or link option.`)
2727
}
2828
}
2929
})
@@ -33,6 +33,7 @@ module.exports = function (moduleOptions) {
3333

3434
// Fallback for tokenExpires
3535
if (typeof options.tokenExpires === 'number') {
36+
// eslint-disable-next-line no-console
3637
console.warn('Deprecation warning: tokenExpires will no longer be supported in the next releases, use the cookieAttributes configuration instead.')
3738
Object.assign(options.cookieAttributes, { expires: options.tokenExpires })
3839
}

lib/templates/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Vue from 'vue'
22
import VueApollo from 'vue-apollo'
33
import 'cross-fetch/polyfill'
4-
import { createApolloClient, restartWebsockets } from 'vue-cli-plugin-apollo/graphql-client'
4+
import { createApolloClient, restartWebsockets } from 'vue-cli-plugin-apollo/graphql-client/src'
55
import Cookie from 'universal-cookie'
66
import { InMemoryCache } from 'apollo-cache-inmemory'
77

package.json

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"publishConfig": {
1010
"access": "public"
1111
},
12+
"files": [
13+
"lib",
14+
"types/*.d.ts"
15+
],
1216
"scripts": {
1317
"dev": "nuxt test/fixture",
1418
"dev2": "nuxt test/fixture-static-auth",
@@ -20,48 +24,28 @@
2024
"test:types": "tsc -p types/test",
2125
"release": "standard-version --prerelease rc && git push --follow-tags && npm publish"
2226
},
23-
"engines": {
24-
"node": ">=6.0.0"
25-
},
26-
"eslintIgnore": [
27-
"lib/templates/*.*"
28-
],
29-
"files": [
30-
"lib",
31-
"types/*.d.ts"
32-
],
33-
"jest": {
34-
"testEnvironment": "node",
35-
"collectCoverage": true
36-
},
3727
"dependencies": {
38-
"cross-fetch": "^3.0.4",
39-
"universal-cookie": "^4.0.3",
40-
"vue-apollo": "^3.0.4",
41-
"vue-cli-plugin-apollo": "^0.21.3",
42-
"webpack-node-externals": "^2.5.0"
28+
"cross-fetch": "^3.0.6",
29+
"universal-cookie": "^4.0.4",
30+
"vue-apollo": "^3.0.5",
31+
"vue-cli-plugin-apollo": "^0.22.1",
32+
"webpack-node-externals": "^2.5.2"
4333
},
4434
"peerDependencies": {
45-
"apollo-cache-inmemory": "^1.6.5"
35+
"apollo-cache-inmemory": "^1.6.6"
4636
},
4737
"devDependencies": {
4838
"@babel/core": "latest",
4939
"@babel/preset-env": "latest",
5040
"@nuxt/types": "latest",
41+
"@nuxtjs/eslint-config": "latest",
5142
"@types/graphql": "latest",
5243
"@types/universal-cookie": "latest",
44+
"babel-eslint": "latest",
45+
"babel-jest": "latest",
5346
"codecov": "latest",
54-
"core-js": "^2.6.11",
5547
"dotenv": "latest",
5648
"eslint": "latest",
57-
"eslint-config-standard": "latest",
58-
"eslint-loader": "latest",
59-
"eslint-plugin-import": "latest",
60-
"eslint-plugin-jest": "latest",
61-
"eslint-plugin-node": "latest",
62-
"eslint-plugin-promise": "latest",
63-
"eslint-plugin-standard": "latest",
64-
"eslint-plugin-vue": "latest",
6549
"graphql-tag": "latest",
6650
"jest": "latest",
6751
"jsdom": "latest",

0 commit comments

Comments
 (0)