diff options
author | Sandeep Somavarapu <sasomava@microsoft.com> | 2019-07-18 16:29:41 +0300 |
---|---|---|
committer | Sandeep Somavarapu <sasomava@microsoft.com> | 2019-07-18 16:33:53 +0300 |
commit | d685337db2e58c97c52387f080d698c5fa22753d (patch) | |
tree | 3a1753a74c1102cf905f2eb7daaa7eb0e310badb | |
parent | bd57ca7066c3c7a70a85cbb7893b1ec16b361c85 (diff) |
Use semver-umd everywhere
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | remote/package.json | 3 | ||||
-rw-r--r-- | remote/web/package.json | 2 | ||||
-rw-r--r-- | remote/web/yarn.lock | 8 | ||||
-rw-r--r-- | remote/yarn.lock | 10 | ||||
-rw-r--r-- | src/typings/semver-umd.d.ts | 206 | ||||
-rw-r--r-- | src/vs/code/browser/workbench/workbench.js | 2 | ||||
-rw-r--r-- | src/vs/code/node/cliProcessMain.ts | 2 | ||||
-rw-r--r-- | src/vs/platform/extensionManagement/node/extensionManagementService.ts | 2 | ||||
-rw-r--r-- | src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts | 2 | ||||
-rw-r--r-- | src/vs/workbench/contrib/tasks/electron-browser/taskService.ts | 2 | ||||
-rw-r--r-- | src/vs/workbench/contrib/update/electron-browser/update.ts | 2 | ||||
-rw-r--r-- | src/vs/workbench/services/extensions/node/extensionPoints.ts | 2 | ||||
-rw-r--r-- | yarn.lock | 8 |
14 files changed, 229 insertions, 25 deletions
diff --git a/package.json b/package.json index e067a40bcfe..10673638030 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,7 @@ "node-pty": "0.9.0-beta19", "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", - "semver": "^5.5.0", - "semver-umd": "^5.5.0", + "semver-umd": "^5.5.3", "spdlog": "^0.9.0", "sudo-prompt": "9.0.0", "v8-inspect-profiler": "^0.0.20", diff --git a/remote/package.json b/remote/package.json index 16edc649482..57b51c1b82d 100644 --- a/remote/package.json +++ b/remote/package.json @@ -14,8 +14,7 @@ "node-pty": "0.9.0-beta19", "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", - "semver": "^5.5.0", - "semver-umd": "^5.5.0", + "semver-umd": "^5.5.3", "spdlog": "^0.9.0", "vscode-chokidar": "2.1.7", "vscode-proxy-agent": "0.4.0", diff --git a/remote/web/package.json b/remote/web/package.json index 6c18cb53937..c7a487b6c2d 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -7,6 +7,6 @@ "xterm": "3.15.0-beta67", "xterm-addon-search": "0.2.0-beta2", "xterm-addon-web-links": "0.1.0-beta10", - "semver-umd": "^5.5.0" + "semver-umd": "^5.5.3" } }
\ No newline at end of file diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index 6839b2e5af6..b624eb37290 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -19,10 +19,10 @@ oniguruma@^7.2.0: dependencies: nan "^2.14.0" -semver-umd@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" - integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== +semver-umd@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e" + integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw== vscode-textmate@^4.1.1: version "4.2.2" diff --git a/remote/yarn.lock b/remote/yarn.lock index 2e8118c8bc3..78b7393ad6d 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -876,17 +876,17 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver-umd@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" - integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== +semver-umd@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e" + integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw== semver@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== -semver@^5.5.0, semver@^5.6.0: +semver@^5.6.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== diff --git a/src/typings/semver-umd.d.ts b/src/typings/semver-umd.d.ts new file mode 100644 index 00000000000..f79d658a1fd --- /dev/null +++ b/src/typings/semver-umd.d.ts @@ -0,0 +1,206 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'semver-umd' { + + // Type definitions for semver 5.5 + // Project: https://github.com/npm/node-semver + // Definitions by: Bart van der Schoor <https://github.com/Bartvds> + // BendingBender <https://github.com/BendingBender> + // Lucian Buzzo <https://github.com/LucianBuzzo> + // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver + + export const SEMVER_SPEC_VERSION: "2.0.0"; + + export type ReleaseType = "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease"; + + /** + * Return the parsed version as a SemVer object, or null if it's not valid. + */ + export function parse(v: string | SemVer, loose?: boolean): SemVer | null; + /** + * Return the parsed version, or null if it's not valid. + */ + export function valid(v: string | SemVer, loose?: boolean): string | null; + /** + * Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) and parsed version, or null if version is invalid. + */ + export function clean(version: string, loose?: boolean): string | null; + /** + * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + */ + export function inc(v: string | SemVer, release: ReleaseType, loose?: boolean, identifier?: string): string | null; + /** + * Return the major version number. + */ + export function major(v: string | SemVer, loose?: boolean): number; + /** + * Return the minor version number. + */ + export function minor(v: string | SemVer, loose?: boolean): number; + /** + * Return the patch version number. + */ + export function patch(v: string | SemVer, loose?: boolean): number; + /** + * Returns an array of prerelease components, or null if none exist. + */ + export function prerelease(v: string | SemVer, loose?: boolean): string[] | null; + + // Comparison + /** + * v1 > v2 + */ + export function gt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 >= v2 + */ + export function gte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 < v2 + */ + export function lt(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 <= v2 + */ + export function lte(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. + */ + export function eq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + /** + * v1 != v2 The opposite of eq. + */ + export function neq(v1: string | SemVer, v2: string | SemVer, loose?: boolean): boolean; + + /** + * Pass in a comparison string, and it'll call the corresponding semver comparison function. + * "===" and "!==" do simple string comparison, but are included for completeness. + * Throws if an invalid comparison string is provided. + */ + export function cmp(v1: string | SemVer, operator: Operator, v2: string | SemVer, loose?: boolean): boolean; + export type Operator = '===' | '!==' | '' | '=' | '==' | '!=' | '>' | '>=' | '<' | '<='; + + /** + * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). + */ + export function compare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; + /** + * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). + */ + export function rcompare(v1: string | SemVer, v2: string | SemVer, loose?: boolean): 1 | 0 | -1; + + /** + * Compares two identifiers, must be numeric strings or truthy/falsy values. Sorts in ascending order if passed to Array.sort(). + */ + export function compareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; + /** + * The reverse of compareIdentifiers. Sorts in descending order when passed to Array.sort(). + */ + export function rcompareIdentifiers(a: string | null, b: string | null): 1 | 0 | -1; + + /** + * Sorts an array of semver entries in ascending order. + */ + export function sort(list: Array<string | SemVer>, loose?: boolean): Array<string | SemVer>; + /** + * Sorts an array of semver entries in descending order. + */ + export function rsort(list: Array<string | SemVer>, loose?: boolean): Array<string | SemVer>; + + /** + * Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same. + */ + export function diff(v1: string, v2: string, loose?: boolean): ReleaseType | null; + + // Ranges + /** + * Return the valid range or null if it's not valid + */ + export function validRange(range: string | Range, loose?: boolean): string; + /** + * Return true if the version satisfies the range. + */ + export function satisfies(version: string | SemVer, range: string | Range, loose?: boolean): boolean; + /** + * Return the highest version in the list that satisfies the range, or null if none of them do. + */ + export function maxSatisfying(versions: Array<string | SemVer>, range: string | Range, loose?: boolean): string; + /** + * Return the lowest version in the list that satisfies the range, or null if none of them do. + */ + export function minSatisfying(versions: Array<string | SemVer>, range: string, loose?: boolean): string; + /** + * Return true if version is greater than all the versions possible in the range. + */ + export function gtr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; + /** + * Return true if version is less than all the versions possible in the range. + */ + export function ltr(version: string | SemVer, range: string | Range, loose?: boolean): boolean; + /** + * Return true if the version is outside the bounds of the range in either the high or low direction. + * The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + */ + export function outside(version: string | SemVer, range: string | Range, hilo: '>' | '<', loose?: boolean): boolean; + /** + * Return true if any of the ranges comparators intersect + */ + export function intersects(range1: string | Range, range2: string | Range, loose?: boolean): boolean; + + // Coercion + /** + * Coerces a string to semver if possible + */ + export function coerce(version: string | SemVer): SemVer | null; + + export class SemVer { + constructor(version: string | SemVer, loose?: boolean); + + raw: string; + loose: boolean; + format(): string; + inspect(): string; + + major: number; + minor: number; + patch: number; + version: string; + build: string[]; + prerelease: string[]; + + compare(other: string | SemVer): 1 | 0 | -1; + compareMain(other: string | SemVer): 1 | 0 | -1; + comparePre(other: string | SemVer): 1 | 0 | -1; + inc(release: ReleaseType, identifier?: string): SemVer; + } + + export class Comparator { + constructor(comp: string | Comparator, loose?: boolean); + + semver: SemVer; + operator: string; + value: boolean; + parse(comp: string): void; + test(version: string | SemVer): boolean; + intersects(comp: Comparator, loose?: boolean): boolean; + } + + export class Range { + constructor(range: string | Range, loose?: boolean); + + range: string; + raw: string; + loose: boolean; + format(): string; + inspect(): string; + + set: Comparator[][]; + parseRange(range: string): Comparator[]; + test(version: string | SemVer): boolean; + intersects(range: Range, loose?: boolean): boolean; + } + +}
\ No newline at end of file diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js index 2f62dceb9ed..65fae7c82df 100644 --- a/src/vs/code/browser/workbench/workbench.js +++ b/src/vs/code/browser/workbench/workbench.js @@ -15,7 +15,7 @@ 'xterm': `${window.location.origin}/node_modules/xterm/lib/xterm.js`, 'xterm-addon-search': `${window.location.origin}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`, 'xterm-addon-web-links': `${window.location.origin}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`, - 'semver': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`, + 'semver-umd': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`, } }); diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index 68978614625..1f3aeb31063 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import product from 'vs/platform/product/node/product'; import pkg from 'vs/platform/product/node/package'; import * as path from 'vs/base/common/path'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 725e477449a..564b0981fba 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -26,7 +26,7 @@ import { localizeManifest } from '../common/extensionNls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { Limiter, createCancelablePromise, CancelablePromise, Queue } from 'vs/base/common/async'; import { Event, Emitter } from 'vs/base/common/event'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { URI } from 'vs/base/common/uri'; import pkg from 'vs/platform/product/node/package'; import { isMacintosh, isWindows } from 'vs/base/common/platform'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 46d215b018a..fbefd13d378 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { Event, Emitter } from 'vs/base/common/event'; import { index, distinct } from 'vs/base/common/arrays'; import { ThrottledDelayer } from 'vs/base/common/async'; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts b/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts index 631275db0d0..decffe55e63 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/taskService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as Objects from 'vs/base/common/objects'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { IStringDictionary } from 'vs/base/common/collections'; import { WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { ITaskSystem } from 'vs/workbench/contrib/tasks/common/taskSystem'; diff --git a/src/vs/workbench/contrib/update/electron-browser/update.ts b/src/vs/workbench/contrib/update/electron-browser/update.ts index e56a8a3e64e..f21b80c1f21 100644 --- a/src/vs/workbench/contrib/update/electron-browser/update.ts +++ b/src/vs/workbench/contrib/update/electron-browser/update.ts @@ -17,7 +17,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IUpdateService, State as UpdateState, StateType, IUpdate } from 'vs/platform/update/common/update'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { INotificationService, INotificationHandle, Severity } from 'vs/platform/notification/common/notification'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; diff --git a/src/vs/workbench/services/extensions/node/extensionPoints.ts b/src/vs/workbench/services/extensions/node/extensionPoints.ts index f6e5afbc6aa..5a7efd1462b 100644 --- a/src/vs/workbench/services/extensions/node/extensionPoints.ts +++ b/src/vs/workbench/services/extensions/node/extensionPoints.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import * as path from 'vs/base/common/path'; -import * as semver from 'semver'; +import * as semver from 'semver-umd'; import * as json from 'vs/base/common/json'; import * as arrays from 'vs/base/common/arrays'; import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; diff --git a/yarn.lock b/yarn.lock index 01fcf201ba0..57cbaeb0fac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7970,10 +7970,10 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -semver-umd@^5.5.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.1.tgz#ad0211c4addc9d93b22c807ef5166a3d0581c79b" - integrity sha512-BogOfRyzUCjHU3dENRlf3HxliVcQRjQRy+mx+1/ILZSV6WCOGniAxcg45Rol3CGFfKaCiodeTgfaGAswWBOU+g== +semver-umd@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e" + integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw== "semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0: version "5.4.1" |