Skip to content

Commit

Permalink
Update dependencies (#47)
Browse files Browse the repository at this point in the history
* yarn install

* Update node version

* Update dependencies

* Update uuid import

* Dependency update

* Prettier enforces trailling comma

* Fix import

* Use locked dependency version

* Update eslintrc to not conflict with prettier

* Fixes
  • Loading branch information
kristinfritsch authored Jun 19, 2020
1 parent d762e19 commit e55814e
Show file tree
Hide file tree
Showing 68 changed files with 4,662 additions and 4,422 deletions.
11 changes: 6 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ module.exports = {
root: true,
env: {
browser: true,
node: true
node: true,
},
extends: [
'prettier/vue',
'plugin:vue/recommended',
'plugin:prettier/recommended',
'@nuxtjs/eslint-config-typescript'
'@nuxtjs/eslint-config-typescript',
],
parserOptions: {
parser: '@typescript-eslint/parser'
parser: '@typescript-eslint/parser',
},
plugins: ['vue'],
// add your custom rules here
Expand All @@ -22,6 +22,7 @@ module.exports = {
'vue/html-self-closing': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/max-attributes-per-line': 'off',
'space-before-function-paren': ['error', 'never']
}
'space-before-function-paren': 'off',
'comma-dangle': 'off',
},
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.13.0
12.13.0
4 changes: 2 additions & 2 deletions components/AmountInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export default class AmountInput extends Vue {
},
isRequired: (v: string) => {
return v.trim() !== '' || 'Please enter an amount'
}
},
}
get rules() {
return [
this.ruleFunctions.isRequired,
this.ruleFunctions.isNumber,
this.ruleFunctions.isCurrency,
this.ruleFunctions.positive
this.ruleFunctions.positive,
]
}
Expand Down
4 changes: 2 additions & 2 deletions components/CVVInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { EventBus } from '@/lib/eventBus.js'
@Component({
directives: {
mask
}
mask,
},
})
export default class CVVInput extends Vue {
@Prop({ type: String }) value!: string
Expand Down
6 changes: 3 additions & 3 deletions components/CardInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Vue.component('font-awesome-icon', FontAwesomeIcon)
@Component({
directives: {
mask
}
mask,
},
})
export default class CardInput extends Vue {
@Prop({ type: String }) value!: string
Expand All @@ -75,7 +75,7 @@ export default class CardInput extends Vue {
},
isRequired: (v: string) => {
return v.trim() !== '' || 'Please enter a credit card number'
}
},
}
updateIcon(value: string) {
Expand Down
29 changes: 16 additions & 13 deletions components/CreateCardForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<script lang="ts">
import { Component, Vue, Prop, Watch } from 'nuxt-property-decorator'
import { mapGetters } from 'vuex'
import uuidv4 from 'uuid/v4'
import { v4 as uuidv4 } from 'uuid'
import openPGP from '@/lib/openpgp'
import { exampleCards } from '@/lib/cardTestData'
import { CreateCardPayload } from '@/lib/cardsApi'
Expand All @@ -122,15 +122,15 @@ import { getLive } from '@/lib/apiTarget'
CardInput,
CVVInput,
ExpiryInput,
CountrySelect
CountrySelect,
},
computed: {
...mapGetters({
payload: 'getRequestPayload',
response: 'getRequestResponse',
requestUrl: 'getRequestUrl'
})
}
requestUrl: 'getRequestUrl',
}),
},
})
export default class CreateCardFormClass extends Vue {
@Prop({ type: Boolean, default: false })
Expand All @@ -145,7 +145,7 @@ export default class CreateCardFormClass extends Vue {
cvv: '',
expiry: {
month: '',
year: ''
year: '',
},
name: '',
country: '',
Expand All @@ -155,21 +155,24 @@ export default class CreateCardFormClass extends Vue {
city: '',
postalCode: '',
phoneNumber: '',
email: ''
email: '',
}
rules = {
isNumber: (v: string) =>
v === '' || !isNaN(parseInt(v)) || 'Please enter valid number',
required: (v: string) => !!v || 'Field is required'
required: (v: string) => !!v || 'Field is required',
}
prefillItems = exampleCards
error = {}
loading = false
showError = false
expiryLabels = {
month: 'Expiry Month',
year: 'Expiry Year'
year: 'Expiry Year',
}
isSandbox: Boolean = !getLive()
prefillForm(index: number) {
Expand Down Expand Up @@ -207,7 +210,7 @@ export default class CreateCardFormClass extends Vue {
const { email, phoneNumber, cardNumber, cvv, ...data } = this.formData
const cardDetails = {
number: cardNumber.trim().replace(/\D/g, ''),
cvv
cvv,
}
const { expiry, ...billingDetails } = data
Expand All @@ -222,8 +225,8 @@ export default class CreateCardFormClass extends Vue {
email,
phoneNumber,
sessionId: 'xxx',
ipAddress: '172.33.222.1'
}
ipAddress: '172.33.222.1',
},
}
try {
Expand All @@ -237,7 +240,7 @@ export default class CreateCardFormClass extends Vue {
const card = await this.$cardsApi.createCard(payload)
if (card) {
this.$store.dispatch('setCard', {
id: card.id
id: card.id,
})
}
this.$emit('success', card)
Expand Down
2 changes: 1 addition & 1 deletion components/Environment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class Environment extends Vue {
return {
colorClass: isLive ? 'red--text' : 'green--text',
env: isLive ? 'LIVE' : 'SANDBOX'
env: isLive ? 'LIVE' : 'SANDBOX',
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions components/ExpiryInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,26 @@ import { mask } from 'vue-the-mask'
@Component({
directives: {
mask
}
mask,
},
})
export default class ExpiryInput extends Vue {
@Prop({ type: Object, default: { month: '', year: '' } }) labels!: {
month: string
year: string
}
@Prop({ type: Object, default: { month: '', year: '' } }) value!: {
month: string
year: string
}
@Prop({ type: Boolean, default: false }) disabled!: boolean
@Prop({ type: Boolean, default: false }) required!: boolean
expiry = {
month: '',
year: ''
year: '',
}
vModel = ''
Expand Down Expand Up @@ -81,7 +83,7 @@ export default class ExpiryInput extends Vue {
return 'Date has expired'
}
return true
}
},
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions components/MarketplaceInfoFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class MarketplaceInfoFieldsClass extends Vue {
marketplaceInfo: MarketplaceInfo = {
walletId: '',
merchantId: '',
merchantWalletId: ''
merchantWalletId: '',
}
async mounted() {
Expand Down Expand Up @@ -118,7 +118,7 @@ export default class MarketplaceInfoFieldsClass extends Vue {
this.$emit('input', {
merchantId: this.marketplaceInfo.merchantId,
merchantWalletId: this.marketplaceInfo.merchantWalletId,
walletId: this.marketplaceInfo.walletId
walletId: this.marketplaceInfo.walletId,
})
}
Expand Down
10 changes: 6 additions & 4 deletions components/PaymentStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ import { mapGetters } from 'vuex'
@Component({
computed: {
...mapGetters({
isMarketplace: 'isMarketplace'
})
}
isMarketplace: 'isMarketplace',
}),
},
})
export default class PaymentStatus extends Vue {
@Prop({ type: String, default: '' })
paymentId!: string
paymentResponse = {
id: '',
status: ''
status: '',
}
polling: boolean = false
pollingId: number = 0
isMarketplace!: boolean
Expand Down
4 changes: 2 additions & 2 deletions components/RequestInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import VueJsonPretty from 'vue-json-pretty'
@Component({
components: {
VueJsonPretty
}
VueJsonPretty,
},
})
export default class RequestInfo extends Vue {
@Prop({ type: String, default: '' })
Expand Down
1 change: 1 addition & 0 deletions devtools/node/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"ecmaVersion": 2018
},
"rules": {
"comma-dangle": "off"
}
}
2 changes: 1 addition & 1 deletion devtools/node/httpserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const server = http.createServer((request, response) => {
console.log(`Body: ${body}`)

response.writeHead(200, {
'Content-Type': 'text/html'
'Content-Type': 'text/html',
})
response.end(`POST request for ${request.url}`)
handleBody(body)
Expand Down
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ module.exports = {
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
'^~/(.*)$': '<rootDir>/$1',
'^vue$': 'vue/dist/vue.common.js'
'^vue$': 'vue/dist/vue.common.js',
},
moduleFileExtensions: ['js', 'ts', 'vue', 'json'],
transform: {
'^.+\\.js$': 'babel-jest',
'.*\\.(vue)$': 'vue-jest',
'^.+\\.tsx?$': 'ts-jest'
'^.+\\.tsx?$': 'ts-jest',
},
coverageDirectory: '<rootDir>/test/unit/coverage',
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/lib/**/*.{js,ts,vue}',
'<rootDir>/store/**/*.{js,ts}',
'!**/node_modules/**'
]
'!**/node_modules/**',
],
}
Loading

0 comments on commit e55814e

Please sign in to comment.