Skip to content

Commit

Permalink
build(deps): bump all dependencies to their latest version (#322)
Browse files Browse the repository at this point in the history
* build(deps): bump all dependencies to their latest version
* chore: fix linter errors
  • Loading branch information
Tim Beyer committed Apr 3, 2020
1 parent 0bc4681 commit 08fcb38
Show file tree
Hide file tree
Showing 29 changed files with 4,872 additions and 3,253 deletions.
1 change: 0 additions & 1 deletion examples/08-move-field.js
Expand Up @@ -27,4 +27,3 @@ module.exports = function (migration) {
food.moveField('producer').beforeField('vegan');
food.moveField('gmo').afterField('vegan');
};

1 change: 0 additions & 1 deletion examples/16-change-field-control.js
@@ -1,4 +1,3 @@

// This migration might fail dur to some race condition
// if that happens please consider split this migration into 2 steps
// 1 create a content type
Expand Down
7,963 changes: 4,795 additions & 3,168 deletions package-lock.json

Large diffs are not rendered by default.

84 changes: 42 additions & 42 deletions package.json
Expand Up @@ -32,7 +32,7 @@
"test-integration": "NODE_ENV=test mocha --require test/integration/setup.js 'test/integration/**/*.spec.js'",
"test-e2e": "NODE_ENV=test mocha 'test/end-to-end/**/*.spec.js'",
"test-typescript-declaration": "tsc --strict --noEmit index.d.ts",
"lint": "eslint 'examples/**/*.js' 'test/**/*.js' 'src/**/*.js' && tslint --project tsconfig-dev.json --config tslint.json",
"lint": "eslint 'examples/**/*.js' 'test/**/*.js' 'src/**/*.js' && tslint --project tsconfig-dev.json --config tslint.json -e '**/*.js'",
"semantic-release": "semantic-release",
"travis-deploy-once": "travis-deploy-once"
},
Expand All @@ -45,59 +45,59 @@
"docs"
],
"dependencies": {
"axios": "^0.19.0",
"bluebird": "^3.5.0",
"callsites": "^2.0.0",
"cardinal": "^1.0.0",
"chalk": "^2.2.0",
"contentful-management": "^5.9.0",
"didyoumean2": "^1.3.0",
"hoek": "^4.2.1",
"https-proxy-agent": "^3.0.0",
"inquirer": "^7.0.0",
"axios": "^0.19.2",
"bluebird": "^3.7.2",
"callsites": "^3.1.0",
"cardinal": "^2.1.1",
"chalk": "^4.0.0",
"contentful-management": "^5.18.2",
"didyoumean2": "^4.0.0",
"hoek": "^6.1.3",
"https-proxy-agent": "^5.0.0",
"inquirer": "^7.1.0",
"joi": "^10.6.0",
"kind-of": "^6.0.3",
"listr": "^0.14.3",
"lodash": "^4.17.4",
"yargs": "^15.0.2"
"lodash": "^4.17.15",
"yargs": "^15.3.1"
},
"devDependencies": {
"@contentful/eslint-config-backend": "^5.0.0",
"@contentful/eslint-config-backend": "^7.0.0",
"@semantic-release/changelog": "^5.0.1",
"@types/bluebird": "^3.5.15",
"@types/chai": "^4.0.4",
"@types/chai-as-promised": "^7.1.0",
"@types/bluebird": "^3.5.30",
"@types/chai": "^4.2.11",
"@types/chai-as-promised": "^7.1.2",
"@types/hoek": "^4.1.3",
"@types/joi": "^10.6.5",
"@types/lodash": "^4.14.77",
"@types/mocha": "^2.2.43",
"@types/lodash": "^4.14.149",
"@types/mocha": "^7.0.2",
"@types/node": "^13.11.0",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"@types/sinon-chai": "^3.2.4",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"dirty-chai": "^2.0.1",
"eslint": "^4.6.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-mocha": "^4.11.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"mocha": "^5.2.0",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"mocha": "^7.1.1",
"nixt": "^0.5.1",
"nock": "^9.4.2",
"rewire": "^2.5.2",
"rimraf": "^2.6.2",
"semantic-release": "^15.13.31",
"sinon": "^2.4.1",
"sinon-chai": "^2.13.0",
"source-map-support": "^0.5.0",
"strip-ansi": "^4.0.0",
"travis-deploy-once": "^5.0.8",
"ts-node": "^3.3.0",
"tslint": "^5.7.0",
"tslint-config-standard": "^6.0.1",
"typescript": "^3.5.3",
"uuid": "^3.3.2",
"nock": "^12.0.3",
"rewire": "^5.0.0",
"rimraf": "^3.0.2",
"semantic-release": "^17.0.4",
"sinon": "^9.0.1",
"sinon-chai": "^3.5.0",
"source-map-support": "^0.5.16",
"strip-ansi": "^6.0.0",
"travis-deploy-once": "^5.0.11",
"ts-node": "^8.8.1",
"tslint": "^6.1.1",
"tslint-config-standard": "^9.0.0",
"typescript": "^3.8.3",
"uuid": "^7.0.3",
"zlib": "^1.0.5"
},
"bin": {
Expand Down
3 changes: 1 addition & 2 deletions src/bin/cli.ts
Expand Up @@ -8,12 +8,11 @@ const { version } = require('../../package.json')
const {
SpaceAccessError
} = require('../lib/errors')
import createMigrationParser from '../lib/migration-parser'
import createMigrationParser, { ParseResult } from '../lib/migration-parser'
import { renderPlan, renderValidationErrors, renderRuntimeErrors } from './lib/render-migration'
import renderStepsErrors from './lib/steps-errors'
import writeErrorsToLog from './lib/write-errors-to-log'
import { RequestBatch } from '../lib/offline-api/index'
import { ParseResult } from '../lib/migration-parser'
import { getConfig } from './lib/config'
import ValidationError from '../lib/interfaces/errors'

Expand Down
2 changes: 1 addition & 1 deletion src/bin/lib/config.ts
Expand Up @@ -31,7 +31,7 @@ function getEnvConfig (): ClientConfig {
{}
}

function getArgvConfig ({spaceId, environmentId = 'master', accessToken, proxy, rawProxy}): ClientConfig {
function getArgvConfig ({ spaceId, environmentId = 'master', accessToken, proxy, rawProxy }): ClientConfig {
const config = {
spaceId,
environmentId,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/lib/contentful-client/proxy.ts
@@ -1,4 +1,4 @@
import HttpsProxyAgent from 'https-proxy-agent'
import { HttpsProxyAgent } from 'https-proxy-agent'
import * as _ from 'lodash'
import * as url from 'url'
import { RequestOptions } from 'http'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/action/entry-derive.ts
Expand Up @@ -105,7 +105,7 @@ class EntryDeriveAction extends APIAction {
linkType: 'Entry',
id: newEntryId
}
const fieldValue = (field.type === 'Array') ? [{sys}] : {sys}
const fieldValue = (field.type === 'Array') ? [{ sys }] : { sys }
entry.setFieldForLocale(this.referenceField, locale, fieldValue)
}

Expand Down
8 changes: 4 additions & 4 deletions src/lib/action/entry-transform-to-type.ts
Expand Up @@ -10,7 +10,7 @@ class EntryTransformToTypeAction extends APIAction {
private targetContentTypeId: string
private transformEntryForLocale: (inputFields: any, locale: string) => Promise<any>
private identityKey: (fromFields: any) => Promise<string>
private shouldPublish: boolean|'preserve'
private shouldPublish: boolean | 'preserve'
private removeOldEntries: boolean
private updateReferences: boolean

Expand Down Expand Up @@ -91,7 +91,7 @@ class EntryTransformToTypeAction extends APIAction {

}
await api.saveEntry(targetEntry.id)
if (this.shouldPublish === true || (this.shouldPublish === 'preserve' && entry.isPublished) ) {
if (this.shouldPublish === true || (this.shouldPublish === 'preserve' && entry.isPublished)) {
await api.publishEntry(targetEntry.id)
}

Expand All @@ -100,13 +100,13 @@ class EntryTransformToTypeAction extends APIAction {
const links = await api.getLinks(entry.id, locales)
for (const link of links) {
if (!link.isInArray()) {
link.element.setFieldForLocale(link.field, link.locale,{ sys: { id: newEntryId, type: 'Link', linkType: 'Entry'}})
link.element.setFieldForLocale(link.field, link.locale,{ sys: { id: newEntryId, type: 'Link', linkType: 'Entry' } })
} else {
link.element.replaceArrayLinkForLocale(link.field, link.locale, link.index, newEntryId)
}

await api.saveEntry(link.element.id)
if (this.shouldPublish === true || (this.shouldPublish === 'preserve' && link.element.isPublished) ) {
if (this.shouldPublish === true || (this.shouldPublish === 'preserve' && link.element.isPublished)) {
await api.publishEntry(link.element.id)
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/action/entry-transform.ts
Expand Up @@ -7,9 +7,9 @@ class EntryTransformAction extends APIAction {
private contentTypeId: string
private fromFields: string[]
private transformEntryForLocale: Function
private shouldPublish: boolean|'preserve'
private shouldPublish: boolean | 'preserve'

constructor (contentTypeId: string, fromFields: string[], transformation: Function, shouldPublish: boolean|'preserve' = true) {
constructor (contentTypeId: string, fromFields: string[], transformation: Function, shouldPublish: boolean | 'preserve' = true) {
super()
this.contentTypeId = contentTypeId
this.fromFields = fromFields
Expand Down Expand Up @@ -50,7 +50,7 @@ class EntryTransformAction extends APIAction {
}
if (changesForThisEntry) {
await api.saveEntry(entry.id)
if (this.shouldPublish === true || (this.shouldPublish === 'preserve' && entry.isPublished) ) {
if (this.shouldPublish === true || (this.shouldPublish === 'preserve' && entry.isPublished)) {
await api.publishEntry(entry.id)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/entities/entry.ts
Expand Up @@ -44,7 +44,7 @@ class Entry {
}

replaceArrayLinkForLocale (id: string, locale: string, index: number, linkId: string) {
const link = { sys: { id: linkId, type: 'Link', linkType: 'Entry'}}
const link = { sys: { id: linkId, type: 'Link', linkType: 'Entry' } }
const field = this._fields[id] || {}
const fieldArray: any[] = field[locale]

Expand All @@ -71,7 +71,7 @@ class Entry {
return this._publishedVersion
}

set publishedVersion (version: number|null) {
set publishedVersion (version: number | null) {
this._publishedVersion = version
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/intent-validator/schema-validator.ts
Expand Up @@ -18,7 +18,7 @@ const validationErrors = {
return `"${actualType}" is not a valid type for the ${typeName} property "${propName}". Expected "${expectedType}".`
},
INVALID_VALUE_IN_ALTERNATIVES: (propName, typeName, value, schemaInnerMatches) => {
const expectedTypes = schemaInnerMatches.map( (match) => {
const expectedTypes = schemaInnerMatches.map((match) => {
const validsSet = match.schema._valids._set
return validsSet.length > 0 ? `${match.schema._type} value ${validsSet.map(validValue => `"${validValue}"`).join(' or ')}` : `type ${match.schema._type}`
})
Expand Down
2 changes: 1 addition & 1 deletion src/lib/intent/editorinterface-copy.ts
Expand Up @@ -36,7 +36,7 @@ export default class EditorInterfaceCopyIntent extends Intent {
]
}
toPlanMessage (): PlanMessage {
const {source, destination} = this.payload.editorInterfaceCopy
const { source, destination } = this.payload.editorInterfaceCopy
return {
heading: chalk`Copy field control for Content Type {bold.yellow ${this.getContentTypeId()}} from field {italic ${source}} to field {italic ${destination}}`,
details: [],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/interfaces/content-transform.ts
@@ -1,6 +1,6 @@
export default interface ContentTransform {
from: string[],
to: string[],
shouldPublish?: boolean|'preserve',
shouldPublish?: boolean | 'preserve',
transformEntryForLocale (inputFields: any, locale: string): any
}
2 changes: 1 addition & 1 deletion src/lib/interfaces/entry-transform-to-type.ts
Expand Up @@ -3,7 +3,7 @@ export default interface TransformEntryToType {
targetContentType: string,
from?: string[],
identityKey: (fromFields: any) => Promise<string>
shouldPublish?: boolean|'preserve',
shouldPublish?: boolean | 'preserve',
removeOldEntries?: boolean,
updateReferences?: boolean,
transformEntryForLocale (inputFields: any, locale: string): Promise<any>
Expand Down
3 changes: 1 addition & 2 deletions src/lib/migration-chunks/validation/index.ts
Expand Up @@ -4,8 +4,7 @@ import fieldValidations from './field'
import checkForDuplicatePropsErrors from './duplicate-props'
import { ContentType } from '../../entities/content-type'
import { Intent } from '../../interfaces/intent'
import { InvalidActionError } from '../../interfaces/errors'
import ValidationError from '../../interfaces/errors'
import ValidationError, { InvalidActionError } from '../../interfaces/errors'

function validateIntents (intentList: IntentList, contentTypes: ContentType[]): ValidationError[] | InvalidActionError[] {
const intents: Intent[] = intentList.getIntents()
Expand Down
2 changes: 1 addition & 1 deletion src/lib/migration-steps/index.ts
Expand Up @@ -332,7 +332,7 @@ export async function migration (migrationCreator: Function, makeRequest: Functi

// Create the migration
await Bluebird.try(function () {
return migrationCreator(migration, Object.assign({makeRequest}, config))
return migrationCreator(migration, Object.assign({ makeRequest }, config))
})

return actions
Expand Down
2 changes: 1 addition & 1 deletion src/lib/offline-api/index.ts
Expand Up @@ -428,7 +428,7 @@ class OfflineAPI {
links.push(new Link(entry, key, locale))
}
if (field instanceof Array) {
const fieldArray = field as any[]
const fieldArray = field
fieldArray.forEach((fieldEntry, index) => {
if (get(fieldEntry, 'sys.id') === childId) {
links.push(new Link(entry, key, locale, index))
Expand Down
8 changes: 4 additions & 4 deletions test/integration/bin/lib/contentful-client.spec.js
@@ -1,7 +1,7 @@
const fs = require('fs');
const path = require('path');
const { expect } = require('chai');
const HttpsProxyAgent = require('https-proxy-agent');
const { HttpsProxyAgent } = require('https-proxy-agent');

const rewire = require('rewire');
const { getConfig } = rewire('../../../../built/bin/lib/config');
Expand Down Expand Up @@ -37,9 +37,9 @@ describe('contentful-client', function () {

contentfulClient.__set__('createClient', (params) => {
expect(params.httpsAgent).to.be.instanceof(HttpsProxyAgent);
expect(params.httpsAgent.options.host).to.eql('myproxy.com');
expect(params.httpsAgent.options.port).to.eql(1337);
expect(params.httpsAgent.options.auth).to.eql('user:pass');
expect(params.httpsAgent.proxy.host).to.eql('myproxy.com');
expect(params.httpsAgent.proxy.port).to.eql(1337);
expect(params.httpsAgent.proxy.auth).to.eql('user:pass');
});

createManagementClient({ application: 'contentful.migration-cli.integration-test/0.0.0' });
Expand Down
2 changes: 1 addition & 1 deletion test/unit/bin/lib/config.spec.ts
Expand Up @@ -27,7 +27,7 @@ describe('Config', function () {
})

it('prefers handed in config over env config', async function () {
const config = getConfig({accessToken: 'fooMyBar'})
const config = getConfig({ accessToken: 'fooMyBar' })
expect(config.accessToken).to.eql('fooMyBar')
})

Expand Down
4 changes: 2 additions & 2 deletions test/unit/bin/lib/render-migrations.spec.ts
Expand Up @@ -19,7 +19,7 @@ describe('Rendering', async () => {
})

describe('when --quiet option is passed', () => {
it ('logs less verbose information of the execution', () => {
it('logs less verbose information of the execution', () => {
renderPlan(requestBatches,'env-unit', true)

expect(logSpy.called).to.eq(true)
Expand All @@ -30,7 +30,7 @@ describe('Rendering', async () => {
})

describe('when --quiet option is not passed', () => {
it ('logs verbose information of the execution', () => {
it('logs verbose information of the execution', () => {
renderPlan(requestBatches,'env-unit')

expect(logSpy.called).to.eq(true)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/bin/lib/render-setup.ts
Expand Up @@ -126,5 +126,5 @@ export default async function renderSetup () {
]

const api = await runIntent(intent, contentTypes, entries, locales)
return await api.getRequestBatches()
return api.getRequestBatches()
}
2 changes: 1 addition & 1 deletion test/unit/lib/intent/field-rename.spec.ts
Expand Up @@ -112,7 +112,7 @@ describe('FieldRenameIntent', function () {
widgetId: 'dropdown',
fieldId: 'bits',
widgetNamespace: 'extension',
settings: { setting: 'value'}
settings: { setting: 'value' }
}]
})
editorInterfacesByContentType.set('dog', ei)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/lib/intent/run-intent.ts
@@ -1,10 +1,10 @@
import APIEntry from '../../../../src/lib/interfaces/api-entry'
import APIContentType from '../../../../src/lib/interfaces/content-type'
import IntentList from '../../../../src/lib/intent-list'
import { ContentType } from '../../../../src/lib/entities/content-type'
import { ContentType, EditorInterfaces } from '../../../../src/lib/entities/content-type'
import { OfflineAPI } from '../../../../src/lib/offline-api/index'
import { Entry } from '../../../../src/lib/entities/entry'
import { EditorInterfaces } from '../../../../src/lib/entities/content-type'

const runIntent = async function (
intent,
contentTypes: APIContentType[],
Expand Down
4 changes: 2 additions & 2 deletions test/unit/lib/intent/sidebarwidgets.spec.ts
Expand Up @@ -54,7 +54,7 @@ describe('SidebarWidgetAddIntent', function () {
'widgetId',
'extension',
'test',
{setting: 'set-1'},
{ setting: 'set-1' },
false
)
)
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('SidebarWidgetUpdateIntent', function () {
ctId,
'widgetId',
'extension',
{setting: 'set-2'},
{ setting: 'set-2' },
undefined
)
)
Expand Down
Expand Up @@ -318,4 +318,3 @@ describe('field movement plan validation', function () {
}));
});
});

0 comments on commit 08fcb38

Please sign in to comment.