From 03ad00b2cdc39ecbe6cf2edb9aeb1bf5131d0d78 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 00:01:52 +0100 Subject: [PATCH] Update dependency compare-versions to v6 (#8964) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Laurent Cozic --- packages/app-desktop/checkForUpdates.ts | 2 +- packages/app-desktop/package.json | 2 +- packages/lib/package.json | 2 +- packages/lib/services/plugins/PluginService.ts | 2 +- packages/lib/services/plugins/RepositoryApi.ts | 2 +- packages/server/package.json | 2 +- .../server/src/middleware/apiVersionHandler.ts | 4 ++-- packages/tools/git-changelog.ts | 2 +- packages/tools/package.json | 2 +- packages/tools/postPreReleasesToForum.ts | 2 +- yarn.lock | 16 ++++++++-------- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/app-desktop/checkForUpdates.ts b/packages/app-desktop/checkForUpdates.ts index 46c290236..d31ebb674 100644 --- a/packages/app-desktop/checkForUpdates.ts +++ b/packages/app-desktop/checkForUpdates.ts @@ -6,7 +6,7 @@ import KvStore from '@joplin/lib/services/KvStore'; import * as ArrayUtils from '@joplin/lib/ArrayUtils'; import { CheckForUpdateOptions, extractVersionInfo, GitHubRelease } from './utils/checkForUpdatesUtils'; const packageInfo = require('./packageInfo.js'); -const compareVersions = require('compare-versions'); +import { compareVersions } from 'compare-versions'; const logger = Logger.create('checkForUpdates'); diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json index ec6ae89b3..a98578816 100644 --- a/packages/app-desktop/package.json +++ b/packages/app-desktop/package.json @@ -151,7 +151,7 @@ "async-mutex": "0.4.0", "codemirror": "5.65.9", "color": "3.2.1", - "compare-versions": "3.6.0", + "compare-versions": "6.0.0", "countable": "3.0.1", "debounce": "1.2.1", "electron-window-state": "5.0.3", diff --git a/packages/lib/package.json b/packages/lib/package.json index 9bb4bdd1a..a69c1f662 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -46,7 +46,7 @@ "builtin-modules": "3.3.0", "chokidar": "3.5.3", "color": "3.2.1", - "compare-versions": "3.6.0", + "compare-versions": "6.0.0", "css": "3.0.0", "diff-match-patch": "1.0.5", "es6-promise-pool": "2.5.0", diff --git a/packages/lib/services/plugins/PluginService.ts b/packages/lib/services/plugins/PluginService.ts index 7de8cb612..ebf474213 100644 --- a/packages/lib/services/plugins/PluginService.ts +++ b/packages/lib/services/plugins/PluginService.ts @@ -9,7 +9,7 @@ import Setting from '../../models/Setting'; import Logger from '@joplin/utils/Logger'; import RepositoryApi from './RepositoryApi'; import produce from 'immer'; -const compareVersions = require('compare-versions'); +import { compareVersions } from 'compare-versions'; const uslug = require('@joplin/fork-uslug'); const logger = Logger.create('PluginService'); diff --git a/packages/lib/services/plugins/RepositoryApi.ts b/packages/lib/services/plugins/RepositoryApi.ts index 4caf881cc..542a18d96 100644 --- a/packages/lib/services/plugins/RepositoryApi.ts +++ b/packages/lib/services/plugins/RepositoryApi.ts @@ -2,7 +2,7 @@ import Logger from '@joplin/utils/Logger'; import shim from '../../shim'; import { PluginManifest } from './utils/types'; const md5 = require('md5'); -const compareVersions = require('compare-versions'); +import { compareVersions } from 'compare-versions'; const logger = Logger.create('RepositoryApi'); diff --git a/packages/server/package.json b/packages/server/package.json index 89b7de6f0..ba982b9af 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -31,7 +31,7 @@ "bcryptjs": "2.4.3", "bulma": "0.9.4", "bulma-prefers-dark": "0.1.0-beta.1", - "compare-versions": "3.6.0", + "compare-versions": "6.0.0", "dayjs": "1.11.9", "formidable": "3.5.1", "fs-extra": "11.1.1", diff --git a/packages/server/src/middleware/apiVersionHandler.ts b/packages/server/src/middleware/apiVersionHandler.ts index 1bdd834d1..919ebd9d2 100644 --- a/packages/server/src/middleware/apiVersionHandler.ts +++ b/packages/server/src/middleware/apiVersionHandler.ts @@ -2,13 +2,13 @@ import { AppContext, KoaNext } from '../utils/types'; import { isApiRequest } from '../utils/requestUtils'; import config from '../config'; import { ErrorPreconditionFailed } from '../utils/errors'; -const compareVersions = require('compare-versions'); +import { compareVersions } from 'compare-versions'; export default async function(ctx: AppContext, next: KoaNext): Promise { if (!isApiRequest(ctx)) return next(); const joplinServerVersion = config().joplinServerVersion; - const minVersion = ctx.headers['x-api-min-version']; + const minVersion = ctx.headers['x-api-min-version'] as string; // For now we don't require this header to be set to keep compatibility with // older clients. diff --git a/packages/tools/git-changelog.ts b/packages/tools/git-changelog.ts index 6e794e815..7e666266a 100644 --- a/packages/tools/git-changelog.ts +++ b/packages/tools/git-changelog.ts @@ -3,7 +3,7 @@ // (Desktop|Mobile|Android|iOS[CLI): (New|Improved|Fixed): Some message..... (#ISSUE) import { execCommand, githubUsername } from './tool-utils'; -import * as compareVersions from 'compare-versions'; +import { compareVersions } from 'compare-versions'; interface LogEntry { message: string; diff --git a/packages/tools/package.json b/packages/tools/package.json index f2a28a196..1c7d2ad5b 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -23,7 +23,7 @@ "@joplin/lib": "~2.13", "@joplin/renderer": "~2.13", "@joplin/utils": "~2.13", - "compare-versions": "3.6.0", + "compare-versions": "6.0.0", "dayjs": "1.11.9", "execa": "4.1.0", "fs-extra": "11.1.1", diff --git a/packages/tools/postPreReleasesToForum.ts b/packages/tools/postPreReleasesToForum.ts index 6e0347e3b..3c7907c80 100644 --- a/packages/tools/postPreReleasesToForum.ts +++ b/packages/tools/postPreReleasesToForum.ts @@ -2,7 +2,7 @@ import { pathExists } from 'fs-extra'; import { readFile, writeFile } from 'fs/promises'; import { gitHubLatestReleases, gitHubLinkify } from './tool-utils'; import { config, createPost, createTopic, getForumTopPostByExternalId, getTopicByExternalId, updatePost } from './utils/discourse'; -import * as compareVersions from 'compare-versions'; +import { compareVersions } from 'compare-versions'; import dayjs = require('dayjs'); interface State { diff --git a/yarn.lock b/yarn.lock index 59f1a49d1..161410e22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4654,7 +4654,7 @@ __metadata: async-mutex: 0.4.0 codemirror: 5.65.9 color: 3.2.1 - compare-versions: 3.6.0 + compare-versions: 6.0.0 countable: 3.0.1 debounce: 1.2.1 electron: 25.8.1 @@ -4928,7 +4928,7 @@ __metadata: chokidar: 3.5.3 clean-html: 1.5.0 color: 3.2.1 - compare-versions: 3.6.0 + compare-versions: 6.0.0 css: 3.0.0 diff-match-patch: 1.0.5 es6-promise-pool: 2.5.0 @@ -5131,7 +5131,7 @@ __metadata: bcryptjs: 2.4.3 bulma: 0.9.4 bulma-prefers-dark: 0.1.0-beta.1 - compare-versions: 3.6.0 + compare-versions: 6.0.0 dayjs: 1.11.9 formidable: 3.5.1 fs-extra: 11.1.1 @@ -5182,7 +5182,7 @@ __metadata: "@types/node": 18.17.14 "@types/node-fetch": 2.6.4 "@types/yargs": 17.0.24 - compare-versions: 3.6.0 + compare-versions: 6.0.0 dayjs: 1.11.9 execa: 4.1.0 fs-extra: 11.1.1 @@ -12638,10 +12638,10 @@ __metadata: languageName: node linkType: hard -"compare-versions@npm:3.6.0": - version: 3.6.0 - resolution: "compare-versions@npm:3.6.0" - checksum: 7492a50cdaa2c27f5254eee7c4b38856e1c164991bab3d98d7fd067fe4b570d47123ecb92523b78338be86aa221668fd3868bfe8caa5587dc3ebbe1a03d52b5d +"compare-versions@npm:6.0.0": + version: 6.0.0 + resolution: "compare-versions@npm:6.0.0" + checksum: bf2fa355b2139cbdb0576f2f0328c112dd3c2eb808eff8b70b808b3ed05f8a40b8317c323ff4797a6a5a7ab32d508876749584c626ee5840dc0119361afffc4d languageName: node linkType: hard