@codingame/monaco-vscode-user-data-sync-service-override 3.2.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/semver.js +3 -0
- package/external/vscode-semver/semver.js +982 -0
- package/override/vs/platform/dialogs/common/dialogs.js +2 -0
- package/override/vs/platform/userDataSync/common/extensionsSync.js +2 -0
- package/override/vs/platform/userDataSync/common/globalStateSync.js +2 -0
- package/package.json +2 -2
- package/vscode/src/vs/base/browser/ui/icons/iconSelectBox.js +2 -2
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfileStorageService.js +5 -0
- package/vscode/src/vs/platform/userDataSync/common/extensionsSync.js +8 -1
- package/vscode/src/vs/platform/userDataSync/common/globalStateSync.js +7 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataProfilesManifestSync.js +5 -7
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSync.js +1 -1
- package/vscode/src/vs/workbench/contrib/userDataSync/browser/userDataSyncViews.js +10 -10
- package/vscode/src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.js +9 -9
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.js +1 -0
- package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js +4 -3
- package/vscode/src/vs/workbench/services/userDataSync/browser/webUserDataSyncEnablementService.js +1 -0
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
import { __module as semver } from '../../_virtual/semver.js';
|
|
2
|
+
|
|
3
|
+
(function (module, exports) {
|
|
4
|
+
exports = module.exports = SemVer;
|
|
5
|
+
var debug;
|
|
6
|
+
if (typeof process === 'object' &&
|
|
7
|
+
process.env &&
|
|
8
|
+
process.env.NODE_DEBUG &&
|
|
9
|
+
/\bsemver\b/i.test(process.env.NODE_DEBUG))
|
|
10
|
+
debug = function() {
|
|
11
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
|
12
|
+
args.unshift('SEMVER');
|
|
13
|
+
console.log.apply(console, args);
|
|
14
|
+
};
|
|
15
|
+
else
|
|
16
|
+
debug = function() {};
|
|
17
|
+
exports.SEMVER_SPEC_VERSION = '2.0.0';
|
|
18
|
+
var MAX_LENGTH = 256;
|
|
19
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
20
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
21
|
+
var re = exports.re = [];
|
|
22
|
+
var src = exports.src = [];
|
|
23
|
+
var R = 0;
|
|
24
|
+
var NUMERICIDENTIFIER = R++;
|
|
25
|
+
src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
|
|
26
|
+
var NUMERICIDENTIFIERLOOSE = R++;
|
|
27
|
+
src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
|
|
28
|
+
var NONNUMERICIDENTIFIER = R++;
|
|
29
|
+
src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
|
|
30
|
+
var MAINVERSION = R++;
|
|
31
|
+
src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
|
|
32
|
+
'(' + src[NUMERICIDENTIFIER] + ')\\.' +
|
|
33
|
+
'(' + src[NUMERICIDENTIFIER] + ')';
|
|
34
|
+
var MAINVERSIONLOOSE = R++;
|
|
35
|
+
src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
|
|
36
|
+
'(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
|
|
37
|
+
'(' + src[NUMERICIDENTIFIERLOOSE] + ')';
|
|
38
|
+
var PRERELEASEIDENTIFIER = R++;
|
|
39
|
+
src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
|
|
40
|
+
'|' + src[NONNUMERICIDENTIFIER] + ')';
|
|
41
|
+
var PRERELEASEIDENTIFIERLOOSE = R++;
|
|
42
|
+
src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
|
|
43
|
+
'|' + src[NONNUMERICIDENTIFIER] + ')';
|
|
44
|
+
var PRERELEASE = R++;
|
|
45
|
+
src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
|
|
46
|
+
'(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
|
|
47
|
+
var PRERELEASELOOSE = R++;
|
|
48
|
+
src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
|
|
49
|
+
'(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
|
|
50
|
+
var BUILDIDENTIFIER = R++;
|
|
51
|
+
src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
|
|
52
|
+
var BUILD = R++;
|
|
53
|
+
src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
|
|
54
|
+
'(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
|
|
55
|
+
var FULL = R++;
|
|
56
|
+
var FULLPLAIN = 'v?' + src[MAINVERSION] +
|
|
57
|
+
src[PRERELEASE] + '?' +
|
|
58
|
+
src[BUILD] + '?';
|
|
59
|
+
src[FULL] = '^' + FULLPLAIN + '$';
|
|
60
|
+
var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
|
|
61
|
+
src[PRERELEASELOOSE] + '?' +
|
|
62
|
+
src[BUILD] + '?';
|
|
63
|
+
var LOOSE = R++;
|
|
64
|
+
src[LOOSE] = '^' + LOOSEPLAIN + '$';
|
|
65
|
+
var GTLT = R++;
|
|
66
|
+
src[GTLT] = '((?:<|>)?=?)';
|
|
67
|
+
var XRANGEIDENTIFIERLOOSE = R++;
|
|
68
|
+
src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
|
|
69
|
+
var XRANGEIDENTIFIER = R++;
|
|
70
|
+
src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
|
|
71
|
+
var XRANGEPLAIN = R++;
|
|
72
|
+
src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
|
|
73
|
+
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
|
|
74
|
+
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
|
|
75
|
+
'(?:' + src[PRERELEASE] + ')?' +
|
|
76
|
+
src[BUILD] + '?' +
|
|
77
|
+
')?)?';
|
|
78
|
+
var XRANGEPLAINLOOSE = R++;
|
|
79
|
+
src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
|
|
80
|
+
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
|
|
81
|
+
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
|
|
82
|
+
'(?:' + src[PRERELEASELOOSE] + ')?' +
|
|
83
|
+
src[BUILD] + '?' +
|
|
84
|
+
')?)?';
|
|
85
|
+
var XRANGE = R++;
|
|
86
|
+
src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
|
|
87
|
+
var XRANGELOOSE = R++;
|
|
88
|
+
src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
|
|
89
|
+
var COERCE = R++;
|
|
90
|
+
src[COERCE] = '(?:^|[^\\d])' +
|
|
91
|
+
'(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
|
|
92
|
+
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
|
|
93
|
+
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
|
|
94
|
+
'(?:$|[^\\d])';
|
|
95
|
+
var LONETILDE = R++;
|
|
96
|
+
src[LONETILDE] = '(?:~>?)';
|
|
97
|
+
var TILDETRIM = R++;
|
|
98
|
+
src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
|
|
99
|
+
re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
|
|
100
|
+
var tildeTrimReplace = '$1~';
|
|
101
|
+
var TILDE = R++;
|
|
102
|
+
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
|
|
103
|
+
var TILDELOOSE = R++;
|
|
104
|
+
src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
|
|
105
|
+
var LONECARET = R++;
|
|
106
|
+
src[LONECARET] = '(?:\\^)';
|
|
107
|
+
var CARETTRIM = R++;
|
|
108
|
+
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
|
|
109
|
+
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
|
|
110
|
+
var caretTrimReplace = '$1^';
|
|
111
|
+
var CARET = R++;
|
|
112
|
+
src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
|
|
113
|
+
var CARETLOOSE = R++;
|
|
114
|
+
src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
|
|
115
|
+
var COMPARATORLOOSE = R++;
|
|
116
|
+
src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
|
|
117
|
+
var COMPARATOR = R++;
|
|
118
|
+
src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
|
|
119
|
+
var COMPARATORTRIM = R++;
|
|
120
|
+
src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
|
|
121
|
+
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
|
|
122
|
+
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
|
|
123
|
+
var comparatorTrimReplace = '$1$2$3';
|
|
124
|
+
var HYPHENRANGE = R++;
|
|
125
|
+
src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
|
|
126
|
+
'\\s+-\\s+' +
|
|
127
|
+
'(' + src[XRANGEPLAIN] + ')' +
|
|
128
|
+
'\\s*$';
|
|
129
|
+
var HYPHENRANGELOOSE = R++;
|
|
130
|
+
src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
|
|
131
|
+
'\\s+-\\s+' +
|
|
132
|
+
'(' + src[XRANGEPLAINLOOSE] + ')' +
|
|
133
|
+
'\\s*$';
|
|
134
|
+
var STAR = R++;
|
|
135
|
+
src[STAR] = '(<|>)?=?\\s*\\*';
|
|
136
|
+
for (var i = 0; i < R; i++) {
|
|
137
|
+
debug(i, src[i]);
|
|
138
|
+
if (!re[i])
|
|
139
|
+
re[i] = new RegExp(src[i]);
|
|
140
|
+
}
|
|
141
|
+
exports.parse = parse;
|
|
142
|
+
function parse(version, loose) {
|
|
143
|
+
if (version instanceof SemVer)
|
|
144
|
+
return version;
|
|
145
|
+
if (typeof version !== 'string')
|
|
146
|
+
return null;
|
|
147
|
+
if (version.length > MAX_LENGTH)
|
|
148
|
+
return null;
|
|
149
|
+
var r = loose ? re[LOOSE] : re[FULL];
|
|
150
|
+
if (!r.test(version))
|
|
151
|
+
return null;
|
|
152
|
+
try {
|
|
153
|
+
return new SemVer(version, loose);
|
|
154
|
+
} catch (er) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.valid = valid;
|
|
159
|
+
function valid(version, loose) {
|
|
160
|
+
var v = parse(version, loose);
|
|
161
|
+
return v ? v.version : null;
|
|
162
|
+
}
|
|
163
|
+
exports.clean = clean;
|
|
164
|
+
function clean(version, loose) {
|
|
165
|
+
var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
|
|
166
|
+
return s ? s.version : null;
|
|
167
|
+
}
|
|
168
|
+
exports.SemVer = SemVer;
|
|
169
|
+
function SemVer(version, loose) {
|
|
170
|
+
if (version instanceof SemVer) {
|
|
171
|
+
if (version.loose === loose)
|
|
172
|
+
return version;
|
|
173
|
+
else
|
|
174
|
+
version = version.version;
|
|
175
|
+
} else if (typeof version !== 'string') {
|
|
176
|
+
throw new TypeError('Invalid Version: ' + version);
|
|
177
|
+
}
|
|
178
|
+
if (version.length > MAX_LENGTH)
|
|
179
|
+
throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
|
|
180
|
+
if (!(this instanceof SemVer))
|
|
181
|
+
return new SemVer(version, loose);
|
|
182
|
+
debug('SemVer', version, loose);
|
|
183
|
+
this.loose = loose;
|
|
184
|
+
var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
|
|
185
|
+
if (!m)
|
|
186
|
+
throw new TypeError('Invalid Version: ' + version);
|
|
187
|
+
this.raw = version;
|
|
188
|
+
this.major = +m[1];
|
|
189
|
+
this.minor = +m[2];
|
|
190
|
+
this.patch = +m[3];
|
|
191
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0)
|
|
192
|
+
throw new TypeError('Invalid major version')
|
|
193
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
|
|
194
|
+
throw new TypeError('Invalid minor version')
|
|
195
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
|
|
196
|
+
throw new TypeError('Invalid patch version')
|
|
197
|
+
if (!m[4])
|
|
198
|
+
this.prerelease = [];
|
|
199
|
+
else
|
|
200
|
+
this.prerelease = m[4].split('.').map(function(id) {
|
|
201
|
+
if (/^[0-9]+$/.test(id)) {
|
|
202
|
+
var num = +id;
|
|
203
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER)
|
|
204
|
+
return num;
|
|
205
|
+
}
|
|
206
|
+
return id;
|
|
207
|
+
});
|
|
208
|
+
this.build = m[5] ? m[5].split('.') : [];
|
|
209
|
+
this.format();
|
|
210
|
+
}
|
|
211
|
+
SemVer.prototype.format = function() {
|
|
212
|
+
this.version = this.major + '.' + this.minor + '.' + this.patch;
|
|
213
|
+
if (this.prerelease.length)
|
|
214
|
+
this.version += '-' + this.prerelease.join('.');
|
|
215
|
+
return this.version;
|
|
216
|
+
};
|
|
217
|
+
SemVer.prototype.toString = function() {
|
|
218
|
+
return this.version;
|
|
219
|
+
};
|
|
220
|
+
SemVer.prototype.compare = function(other) {
|
|
221
|
+
debug('SemVer.compare', this.version, this.loose, other);
|
|
222
|
+
if (!(other instanceof SemVer))
|
|
223
|
+
other = new SemVer(other, this.loose);
|
|
224
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
225
|
+
};
|
|
226
|
+
SemVer.prototype.compareMain = function(other) {
|
|
227
|
+
if (!(other instanceof SemVer))
|
|
228
|
+
other = new SemVer(other, this.loose);
|
|
229
|
+
return compareIdentifiers(this.major, other.major) ||
|
|
230
|
+
compareIdentifiers(this.minor, other.minor) ||
|
|
231
|
+
compareIdentifiers(this.patch, other.patch);
|
|
232
|
+
};
|
|
233
|
+
SemVer.prototype.comparePre = function(other) {
|
|
234
|
+
if (!(other instanceof SemVer))
|
|
235
|
+
other = new SemVer(other, this.loose);
|
|
236
|
+
if (this.prerelease.length && !other.prerelease.length)
|
|
237
|
+
return -1;
|
|
238
|
+
else if (!this.prerelease.length && other.prerelease.length)
|
|
239
|
+
return 1;
|
|
240
|
+
else if (!this.prerelease.length && !other.prerelease.length)
|
|
241
|
+
return 0;
|
|
242
|
+
var i = 0;
|
|
243
|
+
do {
|
|
244
|
+
var a = this.prerelease[i];
|
|
245
|
+
var b = other.prerelease[i];
|
|
246
|
+
debug('prerelease compare', i, a, b);
|
|
247
|
+
if (a === undefined && b === undefined)
|
|
248
|
+
return 0;
|
|
249
|
+
else if (b === undefined)
|
|
250
|
+
return 1;
|
|
251
|
+
else if (a === undefined)
|
|
252
|
+
return -1;
|
|
253
|
+
else if (a === b)
|
|
254
|
+
continue;
|
|
255
|
+
else
|
|
256
|
+
return compareIdentifiers(a, b);
|
|
257
|
+
} while (++i);
|
|
258
|
+
};
|
|
259
|
+
SemVer.prototype.inc = function(release, identifier) {
|
|
260
|
+
switch (release) {
|
|
261
|
+
case 'premajor':
|
|
262
|
+
this.prerelease.length = 0;
|
|
263
|
+
this.patch = 0;
|
|
264
|
+
this.minor = 0;
|
|
265
|
+
this.major++;
|
|
266
|
+
this.inc('pre', identifier);
|
|
267
|
+
break;
|
|
268
|
+
case 'preminor':
|
|
269
|
+
this.prerelease.length = 0;
|
|
270
|
+
this.patch = 0;
|
|
271
|
+
this.minor++;
|
|
272
|
+
this.inc('pre', identifier);
|
|
273
|
+
break;
|
|
274
|
+
case 'prepatch':
|
|
275
|
+
this.prerelease.length = 0;
|
|
276
|
+
this.inc('patch', identifier);
|
|
277
|
+
this.inc('pre', identifier);
|
|
278
|
+
break;
|
|
279
|
+
case 'prerelease':
|
|
280
|
+
if (this.prerelease.length === 0)
|
|
281
|
+
this.inc('patch', identifier);
|
|
282
|
+
this.inc('pre', identifier);
|
|
283
|
+
break;
|
|
284
|
+
case 'major':
|
|
285
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)
|
|
286
|
+
this.major++;
|
|
287
|
+
this.minor = 0;
|
|
288
|
+
this.patch = 0;
|
|
289
|
+
this.prerelease = [];
|
|
290
|
+
break;
|
|
291
|
+
case 'minor':
|
|
292
|
+
if (this.patch !== 0 || this.prerelease.length === 0)
|
|
293
|
+
this.minor++;
|
|
294
|
+
this.patch = 0;
|
|
295
|
+
this.prerelease = [];
|
|
296
|
+
break;
|
|
297
|
+
case 'patch':
|
|
298
|
+
if (this.prerelease.length === 0)
|
|
299
|
+
this.patch++;
|
|
300
|
+
this.prerelease = [];
|
|
301
|
+
break;
|
|
302
|
+
case 'pre':
|
|
303
|
+
if (this.prerelease.length === 0)
|
|
304
|
+
this.prerelease = [0];
|
|
305
|
+
else {
|
|
306
|
+
var i = this.prerelease.length;
|
|
307
|
+
while (--i >= 0) {
|
|
308
|
+
if (typeof this.prerelease[i] === 'number') {
|
|
309
|
+
this.prerelease[i]++;
|
|
310
|
+
i = -2;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (i === -1)
|
|
314
|
+
this.prerelease.push(0);
|
|
315
|
+
}
|
|
316
|
+
if (identifier) {
|
|
317
|
+
if (this.prerelease[0] === identifier) {
|
|
318
|
+
if (isNaN(this.prerelease[1]))
|
|
319
|
+
this.prerelease = [identifier, 0];
|
|
320
|
+
} else
|
|
321
|
+
this.prerelease = [identifier, 0];
|
|
322
|
+
}
|
|
323
|
+
break;
|
|
324
|
+
default:
|
|
325
|
+
throw new Error('invalid increment argument: ' + release);
|
|
326
|
+
}
|
|
327
|
+
this.format();
|
|
328
|
+
this.raw = this.version;
|
|
329
|
+
return this;
|
|
330
|
+
};
|
|
331
|
+
exports.inc = inc;
|
|
332
|
+
function inc(version, release, loose, identifier) {
|
|
333
|
+
if (typeof(loose) === 'string') {
|
|
334
|
+
identifier = loose;
|
|
335
|
+
loose = undefined;
|
|
336
|
+
}
|
|
337
|
+
try {
|
|
338
|
+
return new SemVer(version, loose).inc(release, identifier).version;
|
|
339
|
+
} catch (er) {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
exports.diff = diff;
|
|
344
|
+
function diff(version1, version2) {
|
|
345
|
+
if (eq(version1, version2)) {
|
|
346
|
+
return null;
|
|
347
|
+
} else {
|
|
348
|
+
var v1 = parse(version1);
|
|
349
|
+
var v2 = parse(version2);
|
|
350
|
+
if (v1.prerelease.length || v2.prerelease.length) {
|
|
351
|
+
for (var key in v1) {
|
|
352
|
+
if (key === 'major' || key === 'minor' || key === 'patch') {
|
|
353
|
+
if (v1[key] !== v2[key]) {
|
|
354
|
+
return 'pre'+key;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return 'prerelease';
|
|
359
|
+
}
|
|
360
|
+
for (var key in v1) {
|
|
361
|
+
if (key === 'major' || key === 'minor' || key === 'patch') {
|
|
362
|
+
if (v1[key] !== v2[key]) {
|
|
363
|
+
return key;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
exports.compareIdentifiers = compareIdentifiers;
|
|
370
|
+
var numeric = /^[0-9]+$/;
|
|
371
|
+
function compareIdentifiers(a, b) {
|
|
372
|
+
var anum = numeric.test(a);
|
|
373
|
+
var bnum = numeric.test(b);
|
|
374
|
+
if (anum && bnum) {
|
|
375
|
+
a = +a;
|
|
376
|
+
b = +b;
|
|
377
|
+
}
|
|
378
|
+
return (anum && !bnum) ? -1 :
|
|
379
|
+
(bnum && !anum) ? 1 :
|
|
380
|
+
a < b ? -1 :
|
|
381
|
+
a > b ? 1 :
|
|
382
|
+
0;
|
|
383
|
+
}
|
|
384
|
+
exports.rcompareIdentifiers = rcompareIdentifiers;
|
|
385
|
+
function rcompareIdentifiers(a, b) {
|
|
386
|
+
return compareIdentifiers(b, a);
|
|
387
|
+
}
|
|
388
|
+
exports.major = major;
|
|
389
|
+
function major(a, loose) {
|
|
390
|
+
return new SemVer(a, loose).major;
|
|
391
|
+
}
|
|
392
|
+
exports.minor = minor;
|
|
393
|
+
function minor(a, loose) {
|
|
394
|
+
return new SemVer(a, loose).minor;
|
|
395
|
+
}
|
|
396
|
+
exports.patch = patch;
|
|
397
|
+
function patch(a, loose) {
|
|
398
|
+
return new SemVer(a, loose).patch;
|
|
399
|
+
}
|
|
400
|
+
exports.compare = compare;
|
|
401
|
+
function compare(a, b, loose) {
|
|
402
|
+
return new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
403
|
+
}
|
|
404
|
+
exports.compareLoose = compareLoose;
|
|
405
|
+
function compareLoose(a, b) {
|
|
406
|
+
return compare(a, b, true);
|
|
407
|
+
}
|
|
408
|
+
exports.rcompare = rcompare;
|
|
409
|
+
function rcompare(a, b, loose) {
|
|
410
|
+
return compare(b, a, loose);
|
|
411
|
+
}
|
|
412
|
+
exports.sort = sort;
|
|
413
|
+
function sort(list, loose) {
|
|
414
|
+
return list.sort(function(a, b) {
|
|
415
|
+
return exports.compare(a, b, loose);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
exports.rsort = rsort;
|
|
419
|
+
function rsort(list, loose) {
|
|
420
|
+
return list.sort(function(a, b) {
|
|
421
|
+
return exports.rcompare(a, b, loose);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
exports.gt = gt;
|
|
425
|
+
function gt(a, b, loose) {
|
|
426
|
+
return compare(a, b, loose) > 0;
|
|
427
|
+
}
|
|
428
|
+
exports.lt = lt;
|
|
429
|
+
function lt(a, b, loose) {
|
|
430
|
+
return compare(a, b, loose) < 0;
|
|
431
|
+
}
|
|
432
|
+
exports.eq = eq;
|
|
433
|
+
function eq(a, b, loose) {
|
|
434
|
+
return compare(a, b, loose) === 0;
|
|
435
|
+
}
|
|
436
|
+
exports.neq = neq;
|
|
437
|
+
function neq(a, b, loose) {
|
|
438
|
+
return compare(a, b, loose) !== 0;
|
|
439
|
+
}
|
|
440
|
+
exports.gte = gte;
|
|
441
|
+
function gte(a, b, loose) {
|
|
442
|
+
return compare(a, b, loose) >= 0;
|
|
443
|
+
}
|
|
444
|
+
exports.lte = lte;
|
|
445
|
+
function lte(a, b, loose) {
|
|
446
|
+
return compare(a, b, loose) <= 0;
|
|
447
|
+
}
|
|
448
|
+
exports.cmp = cmp;
|
|
449
|
+
function cmp(a, op, b, loose) {
|
|
450
|
+
var ret;
|
|
451
|
+
switch (op) {
|
|
452
|
+
case '===':
|
|
453
|
+
if (typeof a === 'object') a = a.version;
|
|
454
|
+
if (typeof b === 'object') b = b.version;
|
|
455
|
+
ret = a === b;
|
|
456
|
+
break;
|
|
457
|
+
case '!==':
|
|
458
|
+
if (typeof a === 'object') a = a.version;
|
|
459
|
+
if (typeof b === 'object') b = b.version;
|
|
460
|
+
ret = a !== b;
|
|
461
|
+
break;
|
|
462
|
+
case '': case '=': case '==': ret = eq(a, b, loose); break;
|
|
463
|
+
case '!=': ret = neq(a, b, loose); break;
|
|
464
|
+
case '>': ret = gt(a, b, loose); break;
|
|
465
|
+
case '>=': ret = gte(a, b, loose); break;
|
|
466
|
+
case '<': ret = lt(a, b, loose); break;
|
|
467
|
+
case '<=': ret = lte(a, b, loose); break;
|
|
468
|
+
default: throw new TypeError('Invalid operator: ' + op);
|
|
469
|
+
}
|
|
470
|
+
return ret;
|
|
471
|
+
}
|
|
472
|
+
exports.Comparator = Comparator;
|
|
473
|
+
function Comparator(comp, loose) {
|
|
474
|
+
if (comp instanceof Comparator) {
|
|
475
|
+
if (comp.loose === loose)
|
|
476
|
+
return comp;
|
|
477
|
+
else
|
|
478
|
+
comp = comp.value;
|
|
479
|
+
}
|
|
480
|
+
if (!(this instanceof Comparator))
|
|
481
|
+
return new Comparator(comp, loose);
|
|
482
|
+
debug('comparator', comp, loose);
|
|
483
|
+
this.loose = loose;
|
|
484
|
+
this.parse(comp);
|
|
485
|
+
if (this.semver === ANY)
|
|
486
|
+
this.value = '';
|
|
487
|
+
else
|
|
488
|
+
this.value = this.operator + this.semver.version;
|
|
489
|
+
debug('comp', this);
|
|
490
|
+
}
|
|
491
|
+
var ANY = {};
|
|
492
|
+
Comparator.prototype.parse = function(comp) {
|
|
493
|
+
var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
|
|
494
|
+
var m = comp.match(r);
|
|
495
|
+
if (!m)
|
|
496
|
+
throw new TypeError('Invalid comparator: ' + comp);
|
|
497
|
+
this.operator = m[1];
|
|
498
|
+
if (this.operator === '=')
|
|
499
|
+
this.operator = '';
|
|
500
|
+
if (!m[2])
|
|
501
|
+
this.semver = ANY;
|
|
502
|
+
else
|
|
503
|
+
this.semver = new SemVer(m[2], this.loose);
|
|
504
|
+
};
|
|
505
|
+
Comparator.prototype.toString = function() {
|
|
506
|
+
return this.value;
|
|
507
|
+
};
|
|
508
|
+
Comparator.prototype.test = function(version) {
|
|
509
|
+
debug('Comparator.test', version, this.loose);
|
|
510
|
+
if (this.semver === ANY)
|
|
511
|
+
return true;
|
|
512
|
+
if (typeof version === 'string')
|
|
513
|
+
version = new SemVer(version, this.loose);
|
|
514
|
+
return cmp(version, this.operator, this.semver, this.loose);
|
|
515
|
+
};
|
|
516
|
+
Comparator.prototype.intersects = function(comp, loose) {
|
|
517
|
+
if (!(comp instanceof Comparator)) {
|
|
518
|
+
throw new TypeError('a Comparator is required');
|
|
519
|
+
}
|
|
520
|
+
var rangeTmp;
|
|
521
|
+
if (this.operator === '') {
|
|
522
|
+
rangeTmp = new Range(comp.value, loose);
|
|
523
|
+
return satisfies(this.value, rangeTmp, loose);
|
|
524
|
+
} else if (comp.operator === '') {
|
|
525
|
+
rangeTmp = new Range(this.value, loose);
|
|
526
|
+
return satisfies(comp.semver, rangeTmp, loose);
|
|
527
|
+
}
|
|
528
|
+
var sameDirectionIncreasing =
|
|
529
|
+
(this.operator === '>=' || this.operator === '>') &&
|
|
530
|
+
(comp.operator === '>=' || comp.operator === '>');
|
|
531
|
+
var sameDirectionDecreasing =
|
|
532
|
+
(this.operator === '<=' || this.operator === '<') &&
|
|
533
|
+
(comp.operator === '<=' || comp.operator === '<');
|
|
534
|
+
var sameSemVer = this.semver.version === comp.semver.version;
|
|
535
|
+
var differentDirectionsInclusive =
|
|
536
|
+
(this.operator === '>=' || this.operator === '<=') &&
|
|
537
|
+
(comp.operator === '>=' || comp.operator === '<=');
|
|
538
|
+
var oppositeDirectionsLessThan =
|
|
539
|
+
cmp(this.semver, '<', comp.semver, loose) &&
|
|
540
|
+
((this.operator === '>=' || this.operator === '>') &&
|
|
541
|
+
(comp.operator === '<=' || comp.operator === '<'));
|
|
542
|
+
var oppositeDirectionsGreaterThan =
|
|
543
|
+
cmp(this.semver, '>', comp.semver, loose) &&
|
|
544
|
+
((this.operator === '<=' || this.operator === '<') &&
|
|
545
|
+
(comp.operator === '>=' || comp.operator === '>'));
|
|
546
|
+
return sameDirectionIncreasing || sameDirectionDecreasing ||
|
|
547
|
+
(sameSemVer && differentDirectionsInclusive) ||
|
|
548
|
+
oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
|
|
549
|
+
};
|
|
550
|
+
exports.Range = Range;
|
|
551
|
+
function Range(range, loose) {
|
|
552
|
+
if (range instanceof Range) {
|
|
553
|
+
if (range.loose === loose) {
|
|
554
|
+
return range;
|
|
555
|
+
} else {
|
|
556
|
+
return new Range(range.raw, loose);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
if (range instanceof Comparator) {
|
|
560
|
+
return new Range(range.value, loose);
|
|
561
|
+
}
|
|
562
|
+
if (!(this instanceof Range))
|
|
563
|
+
return new Range(range, loose);
|
|
564
|
+
this.loose = loose;
|
|
565
|
+
this.raw = range;
|
|
566
|
+
this.set = range.split(/\s*\|\|\s*/).map(function(range) {
|
|
567
|
+
return this.parseRange(range.trim());
|
|
568
|
+
}, this).filter(function(c) {
|
|
569
|
+
return c.length;
|
|
570
|
+
});
|
|
571
|
+
if (!this.set.length) {
|
|
572
|
+
throw new TypeError('Invalid SemVer Range: ' + range);
|
|
573
|
+
}
|
|
574
|
+
this.format();
|
|
575
|
+
}
|
|
576
|
+
Range.prototype.format = function() {
|
|
577
|
+
this.range = this.set.map(function(comps) {
|
|
578
|
+
return comps.join(' ').trim();
|
|
579
|
+
}).join('||').trim();
|
|
580
|
+
return this.range;
|
|
581
|
+
};
|
|
582
|
+
Range.prototype.toString = function() {
|
|
583
|
+
return this.range;
|
|
584
|
+
};
|
|
585
|
+
Range.prototype.parseRange = function(range) {
|
|
586
|
+
var loose = this.loose;
|
|
587
|
+
range = range.trim();
|
|
588
|
+
debug('range', range, loose);
|
|
589
|
+
var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
|
|
590
|
+
range = range.replace(hr, hyphenReplace);
|
|
591
|
+
debug('hyphen replace', range);
|
|
592
|
+
range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
|
|
593
|
+
debug('comparator trim', range, re[COMPARATORTRIM]);
|
|
594
|
+
range = range.replace(re[TILDETRIM], tildeTrimReplace);
|
|
595
|
+
range = range.replace(re[CARETTRIM], caretTrimReplace);
|
|
596
|
+
range = range.split(/\s+/).join(' ');
|
|
597
|
+
var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
|
|
598
|
+
var set = range.split(' ').map(function(comp) {
|
|
599
|
+
return parseComparator(comp, loose);
|
|
600
|
+
}).join(' ').split(/\s+/);
|
|
601
|
+
if (this.loose) {
|
|
602
|
+
set = set.filter(function(comp) {
|
|
603
|
+
return !!comp.match(compRe);
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
set = set.map(function(comp) {
|
|
607
|
+
return new Comparator(comp, loose);
|
|
608
|
+
});
|
|
609
|
+
return set;
|
|
610
|
+
};
|
|
611
|
+
Range.prototype.intersects = function(range, loose) {
|
|
612
|
+
if (!(range instanceof Range)) {
|
|
613
|
+
throw new TypeError('a Range is required');
|
|
614
|
+
}
|
|
615
|
+
return this.set.some(function(thisComparators) {
|
|
616
|
+
return thisComparators.every(function(thisComparator) {
|
|
617
|
+
return range.set.some(function(rangeComparators) {
|
|
618
|
+
return rangeComparators.every(function(rangeComparator) {
|
|
619
|
+
return thisComparator.intersects(rangeComparator, loose);
|
|
620
|
+
});
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
exports.toComparators = toComparators;
|
|
626
|
+
function toComparators(range, loose) {
|
|
627
|
+
return new Range(range, loose).set.map(function(comp) {
|
|
628
|
+
return comp.map(function(c) {
|
|
629
|
+
return c.value;
|
|
630
|
+
}).join(' ').trim().split(' ');
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
function parseComparator(comp, loose) {
|
|
634
|
+
debug('comp', comp);
|
|
635
|
+
comp = replaceCarets(comp, loose);
|
|
636
|
+
debug('caret', comp);
|
|
637
|
+
comp = replaceTildes(comp, loose);
|
|
638
|
+
debug('tildes', comp);
|
|
639
|
+
comp = replaceXRanges(comp, loose);
|
|
640
|
+
debug('xrange', comp);
|
|
641
|
+
comp = replaceStars(comp, loose);
|
|
642
|
+
debug('stars', comp);
|
|
643
|
+
return comp;
|
|
644
|
+
}
|
|
645
|
+
function isX(id) {
|
|
646
|
+
return !id || id.toLowerCase() === 'x' || id === '*';
|
|
647
|
+
}
|
|
648
|
+
function replaceTildes(comp, loose) {
|
|
649
|
+
return comp.trim().split(/\s+/).map(function(comp) {
|
|
650
|
+
return replaceTilde(comp, loose);
|
|
651
|
+
}).join(' ');
|
|
652
|
+
}
|
|
653
|
+
function replaceTilde(comp, loose) {
|
|
654
|
+
var r = loose ? re[TILDELOOSE] : re[TILDE];
|
|
655
|
+
return comp.replace(r, function(_, M, m, p, pr) {
|
|
656
|
+
debug('tilde', comp, _, M, m, p, pr);
|
|
657
|
+
var ret;
|
|
658
|
+
if (isX(M))
|
|
659
|
+
ret = '';
|
|
660
|
+
else if (isX(m))
|
|
661
|
+
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
|
|
662
|
+
else if (isX(p))
|
|
663
|
+
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
|
|
664
|
+
else if (pr) {
|
|
665
|
+
debug('replaceTilde pr', pr);
|
|
666
|
+
if (pr.charAt(0) !== '-')
|
|
667
|
+
pr = '-' + pr;
|
|
668
|
+
ret = '>=' + M + '.' + m + '.' + p + pr +
|
|
669
|
+
' <' + M + '.' + (+m + 1) + '.0';
|
|
670
|
+
} else
|
|
671
|
+
ret = '>=' + M + '.' + m + '.' + p +
|
|
672
|
+
' <' + M + '.' + (+m + 1) + '.0';
|
|
673
|
+
debug('tilde return', ret);
|
|
674
|
+
return ret;
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
function replaceCarets(comp, loose) {
|
|
678
|
+
return comp.trim().split(/\s+/).map(function(comp) {
|
|
679
|
+
return replaceCaret(comp, loose);
|
|
680
|
+
}).join(' ');
|
|
681
|
+
}
|
|
682
|
+
function replaceCaret(comp, loose) {
|
|
683
|
+
debug('caret', comp, loose);
|
|
684
|
+
var r = loose ? re[CARETLOOSE] : re[CARET];
|
|
685
|
+
return comp.replace(r, function(_, M, m, p, pr) {
|
|
686
|
+
debug('caret', comp, _, M, m, p, pr);
|
|
687
|
+
var ret;
|
|
688
|
+
if (isX(M))
|
|
689
|
+
ret = '';
|
|
690
|
+
else if (isX(m))
|
|
691
|
+
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
|
|
692
|
+
else if (isX(p)) {
|
|
693
|
+
if (M === '0')
|
|
694
|
+
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
|
|
695
|
+
else
|
|
696
|
+
ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
|
|
697
|
+
} else if (pr) {
|
|
698
|
+
debug('replaceCaret pr', pr);
|
|
699
|
+
if (pr.charAt(0) !== '-')
|
|
700
|
+
pr = '-' + pr;
|
|
701
|
+
if (M === '0') {
|
|
702
|
+
if (m === '0')
|
|
703
|
+
ret = '>=' + M + '.' + m + '.' + p + pr +
|
|
704
|
+
' <' + M + '.' + m + '.' + (+p + 1);
|
|
705
|
+
else
|
|
706
|
+
ret = '>=' + M + '.' + m + '.' + p + pr +
|
|
707
|
+
' <' + M + '.' + (+m + 1) + '.0';
|
|
708
|
+
} else
|
|
709
|
+
ret = '>=' + M + '.' + m + '.' + p + pr +
|
|
710
|
+
' <' + (+M + 1) + '.0.0';
|
|
711
|
+
} else {
|
|
712
|
+
debug('no pr');
|
|
713
|
+
if (M === '0') {
|
|
714
|
+
if (m === '0')
|
|
715
|
+
ret = '>=' + M + '.' + m + '.' + p +
|
|
716
|
+
' <' + M + '.' + m + '.' + (+p + 1);
|
|
717
|
+
else
|
|
718
|
+
ret = '>=' + M + '.' + m + '.' + p +
|
|
719
|
+
' <' + M + '.' + (+m + 1) + '.0';
|
|
720
|
+
} else
|
|
721
|
+
ret = '>=' + M + '.' + m + '.' + p +
|
|
722
|
+
' <' + (+M + 1) + '.0.0';
|
|
723
|
+
}
|
|
724
|
+
debug('caret return', ret);
|
|
725
|
+
return ret;
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
function replaceXRanges(comp, loose) {
|
|
729
|
+
debug('replaceXRanges', comp, loose);
|
|
730
|
+
return comp.split(/\s+/).map(function(comp) {
|
|
731
|
+
return replaceXRange(comp, loose);
|
|
732
|
+
}).join(' ');
|
|
733
|
+
}
|
|
734
|
+
function replaceXRange(comp, loose) {
|
|
735
|
+
comp = comp.trim();
|
|
736
|
+
var r = loose ? re[XRANGELOOSE] : re[XRANGE];
|
|
737
|
+
return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
|
|
738
|
+
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
|
739
|
+
var xM = isX(M);
|
|
740
|
+
var xm = xM || isX(m);
|
|
741
|
+
var xp = xm || isX(p);
|
|
742
|
+
var anyX = xp;
|
|
743
|
+
if (gtlt === '=' && anyX)
|
|
744
|
+
gtlt = '';
|
|
745
|
+
if (xM) {
|
|
746
|
+
if (gtlt === '>' || gtlt === '<') {
|
|
747
|
+
ret = '<0.0.0';
|
|
748
|
+
} else {
|
|
749
|
+
ret = '*';
|
|
750
|
+
}
|
|
751
|
+
} else if (gtlt && anyX) {
|
|
752
|
+
if (xm)
|
|
753
|
+
m = 0;
|
|
754
|
+
if (xp)
|
|
755
|
+
p = 0;
|
|
756
|
+
if (gtlt === '>') {
|
|
757
|
+
gtlt = '>=';
|
|
758
|
+
if (xm) {
|
|
759
|
+
M = +M + 1;
|
|
760
|
+
m = 0;
|
|
761
|
+
p = 0;
|
|
762
|
+
} else if (xp) {
|
|
763
|
+
m = +m + 1;
|
|
764
|
+
p = 0;
|
|
765
|
+
}
|
|
766
|
+
} else if (gtlt === '<=') {
|
|
767
|
+
gtlt = '<';
|
|
768
|
+
if (xm)
|
|
769
|
+
M = +M + 1;
|
|
770
|
+
else
|
|
771
|
+
m = +m + 1;
|
|
772
|
+
}
|
|
773
|
+
ret = gtlt + M + '.' + m + '.' + p;
|
|
774
|
+
} else if (xm) {
|
|
775
|
+
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
|
|
776
|
+
} else if (xp) {
|
|
777
|
+
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
|
|
778
|
+
}
|
|
779
|
+
debug('xRange return', ret);
|
|
780
|
+
return ret;
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
function replaceStars(comp, loose) {
|
|
784
|
+
debug('replaceStars', comp, loose);
|
|
785
|
+
return comp.trim().replace(re[STAR], '');
|
|
786
|
+
}
|
|
787
|
+
function hyphenReplace($0,
|
|
788
|
+
from, fM, fm, fp, fpr, fb,
|
|
789
|
+
to, tM, tm, tp, tpr, tb) {
|
|
790
|
+
if (isX(fM))
|
|
791
|
+
from = '';
|
|
792
|
+
else if (isX(fm))
|
|
793
|
+
from = '>=' + fM + '.0.0';
|
|
794
|
+
else if (isX(fp))
|
|
795
|
+
from = '>=' + fM + '.' + fm + '.0';
|
|
796
|
+
else
|
|
797
|
+
from = '>=' + from;
|
|
798
|
+
if (isX(tM))
|
|
799
|
+
to = '';
|
|
800
|
+
else if (isX(tm))
|
|
801
|
+
to = '<' + (+tM + 1) + '.0.0';
|
|
802
|
+
else if (isX(tp))
|
|
803
|
+
to = '<' + tM + '.' + (+tm + 1) + '.0';
|
|
804
|
+
else if (tpr)
|
|
805
|
+
to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
|
|
806
|
+
else
|
|
807
|
+
to = '<=' + to;
|
|
808
|
+
return (from + ' ' + to).trim();
|
|
809
|
+
}
|
|
810
|
+
Range.prototype.test = function(version) {
|
|
811
|
+
if (!version)
|
|
812
|
+
return false;
|
|
813
|
+
if (typeof version === 'string')
|
|
814
|
+
version = new SemVer(version, this.loose);
|
|
815
|
+
for (var i = 0; i < this.set.length; i++) {
|
|
816
|
+
if (testSet(this.set[i], version))
|
|
817
|
+
return true;
|
|
818
|
+
}
|
|
819
|
+
return false;
|
|
820
|
+
};
|
|
821
|
+
function testSet(set, version) {
|
|
822
|
+
for (var i = 0; i < set.length; i++) {
|
|
823
|
+
if (!set[i].test(version))
|
|
824
|
+
return false;
|
|
825
|
+
}
|
|
826
|
+
if (version.prerelease.length) {
|
|
827
|
+
for (var i = 0; i < set.length; i++) {
|
|
828
|
+
debug(set[i].semver);
|
|
829
|
+
if (set[i].semver === ANY)
|
|
830
|
+
continue;
|
|
831
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
832
|
+
var allowed = set[i].semver;
|
|
833
|
+
if (allowed.major === version.major &&
|
|
834
|
+
allowed.minor === version.minor &&
|
|
835
|
+
allowed.patch === version.patch)
|
|
836
|
+
return true;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
841
|
+
return true;
|
|
842
|
+
}
|
|
843
|
+
exports.satisfies = satisfies;
|
|
844
|
+
function satisfies(version, range, loose) {
|
|
845
|
+
try {
|
|
846
|
+
range = new Range(range, loose);
|
|
847
|
+
} catch (er) {
|
|
848
|
+
return false;
|
|
849
|
+
}
|
|
850
|
+
return range.test(version);
|
|
851
|
+
}
|
|
852
|
+
exports.maxSatisfying = maxSatisfying;
|
|
853
|
+
function maxSatisfying(versions, range, loose) {
|
|
854
|
+
var max = null;
|
|
855
|
+
var maxSV = null;
|
|
856
|
+
try {
|
|
857
|
+
var rangeObj = new Range(range, loose);
|
|
858
|
+
} catch (er) {
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
versions.forEach(function (v) {
|
|
862
|
+
if (rangeObj.test(v)) {
|
|
863
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
864
|
+
max = v;
|
|
865
|
+
maxSV = new SemVer(max, loose);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
return max;
|
|
870
|
+
}
|
|
871
|
+
exports.minSatisfying = minSatisfying;
|
|
872
|
+
function minSatisfying(versions, range, loose) {
|
|
873
|
+
var min = null;
|
|
874
|
+
var minSV = null;
|
|
875
|
+
try {
|
|
876
|
+
var rangeObj = new Range(range, loose);
|
|
877
|
+
} catch (er) {
|
|
878
|
+
return null;
|
|
879
|
+
}
|
|
880
|
+
versions.forEach(function (v) {
|
|
881
|
+
if (rangeObj.test(v)) {
|
|
882
|
+
if (!min || minSV.compare(v) === 1) {
|
|
883
|
+
min = v;
|
|
884
|
+
minSV = new SemVer(min, loose);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
return min;
|
|
889
|
+
}
|
|
890
|
+
exports.validRange = validRange;
|
|
891
|
+
function validRange(range, loose) {
|
|
892
|
+
try {
|
|
893
|
+
return new Range(range, loose).range || '*';
|
|
894
|
+
} catch (er) {
|
|
895
|
+
return null;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
exports.ltr = ltr;
|
|
899
|
+
function ltr(version, range, loose) {
|
|
900
|
+
return outside(version, range, '<', loose);
|
|
901
|
+
}
|
|
902
|
+
exports.gtr = gtr;
|
|
903
|
+
function gtr(version, range, loose) {
|
|
904
|
+
return outside(version, range, '>', loose);
|
|
905
|
+
}
|
|
906
|
+
exports.outside = outside;
|
|
907
|
+
function outside(version, range, hilo, loose) {
|
|
908
|
+
version = new SemVer(version, loose);
|
|
909
|
+
range = new Range(range, loose);
|
|
910
|
+
var gtfn, ltefn, ltfn, comp, ecomp;
|
|
911
|
+
switch (hilo) {
|
|
912
|
+
case '>':
|
|
913
|
+
gtfn = gt;
|
|
914
|
+
ltefn = lte;
|
|
915
|
+
ltfn = lt;
|
|
916
|
+
comp = '>';
|
|
917
|
+
ecomp = '>=';
|
|
918
|
+
break;
|
|
919
|
+
case '<':
|
|
920
|
+
gtfn = lt;
|
|
921
|
+
ltefn = gte;
|
|
922
|
+
ltfn = gt;
|
|
923
|
+
comp = '<';
|
|
924
|
+
ecomp = '<=';
|
|
925
|
+
break;
|
|
926
|
+
default:
|
|
927
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
928
|
+
}
|
|
929
|
+
if (satisfies(version, range, loose)) {
|
|
930
|
+
return false;
|
|
931
|
+
}
|
|
932
|
+
for (var i = 0; i < range.set.length; ++i) {
|
|
933
|
+
var comparators = range.set[i];
|
|
934
|
+
var high = null;
|
|
935
|
+
var low = null;
|
|
936
|
+
comparators.forEach(function(comparator) {
|
|
937
|
+
if (comparator.semver === ANY) {
|
|
938
|
+
comparator = new Comparator('>=0.0.0');
|
|
939
|
+
}
|
|
940
|
+
high = high || comparator;
|
|
941
|
+
low = low || comparator;
|
|
942
|
+
if (gtfn(comparator.semver, high.semver, loose)) {
|
|
943
|
+
high = comparator;
|
|
944
|
+
} else if (ltfn(comparator.semver, low.semver, loose)) {
|
|
945
|
+
low = comparator;
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
949
|
+
return false;
|
|
950
|
+
}
|
|
951
|
+
if ((!low.operator || low.operator === comp) &&
|
|
952
|
+
ltefn(version, low.semver)) {
|
|
953
|
+
return false;
|
|
954
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
955
|
+
return false;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
return true;
|
|
959
|
+
}
|
|
960
|
+
exports.prerelease = prerelease;
|
|
961
|
+
function prerelease(version, loose) {
|
|
962
|
+
var parsed = parse(version, loose);
|
|
963
|
+
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
|
|
964
|
+
}
|
|
965
|
+
exports.intersects = intersects;
|
|
966
|
+
function intersects(r1, r2, loose) {
|
|
967
|
+
r1 = new Range(r1, loose);
|
|
968
|
+
r2 = new Range(r2, loose);
|
|
969
|
+
return r1.intersects(r2)
|
|
970
|
+
}
|
|
971
|
+
exports.coerce = coerce;
|
|
972
|
+
function coerce(version) {
|
|
973
|
+
if (version instanceof SemVer)
|
|
974
|
+
return version;
|
|
975
|
+
if (typeof version !== 'string')
|
|
976
|
+
return null;
|
|
977
|
+
var match = version.match(re[COERCE]);
|
|
978
|
+
if (match == null)
|
|
979
|
+
return null;
|
|
980
|
+
return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0'));
|
|
981
|
+
}
|
|
982
|
+
} (semver, semver.exports));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-user-data-sync-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -48,9 +48,9 @@ class IconSelectBox extends Disposable {
|
|
|
48
48
|
})));
|
|
49
49
|
append(iconSelectBoxContainer, this.scrollableElement.getDomNode());
|
|
50
50
|
if (this.options.showIconInfo) {
|
|
51
|
-
this.iconIdElement = ( new HighlightedLabel(
|
|
51
|
+
this.iconIdElement = this._register(( new HighlightedLabel(
|
|
52
52
|
append(append(iconSelectBoxContainer, $('.icon-select-id-container')), $('.icon-select-id-label'))
|
|
53
|
-
));
|
|
53
|
+
)));
|
|
54
54
|
}
|
|
55
55
|
const iconsDisposables = disposables.add(( new MutableDisposable()));
|
|
56
56
|
iconsDisposables.value = this.renderIcons(this.options.icons, [], iconsContainer);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
+
import 'vscode/vscode/vs/base/parts/storage/common/storage';
|
|
1
3
|
import { createDecorator } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
|
+
import 'vscode/vscode/vs/platform/storage/common/storage';
|
|
5
|
+
import 'vscode/vscode/vs/base/common/event';
|
|
6
|
+
import 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
2
7
|
|
|
3
8
|
const IUserDataProfileStorageService = ( createDecorator('IUserDataProfileStorageService'));
|
|
4
9
|
|
|
@@ -2,18 +2,25 @@ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.
|
|
|
2
2
|
import { Promises } from 'vscode/vscode/vs/base/common/async';
|
|
3
3
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
4
4
|
import { getErrorMessage } from 'vscode/vscode/vs/base/common/errors';
|
|
5
|
+
import 'vscode/vscode/vs/base/common/event';
|
|
5
6
|
import { toFormattedString } from 'vscode/vscode/vs/base/common/jsonFormatter';
|
|
6
7
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
8
|
import { compare } from 'vscode/vscode/vs/base/common/strings';
|
|
9
|
+
import 'vscode/vscode/vs/base/common/path';
|
|
10
|
+
import 'vscode/vscode/vs/base/common/platform';
|
|
11
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
12
|
import { GlobalExtensionEnablementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionEnablementService';
|
|
9
13
|
import { EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT, EXTENSION_INSTALL_SYNC_CONTEXT, ExtensionManagementError, ExtensionManagementErrorCode, IExtensionManagementService, IExtensionGalleryService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
10
14
|
import { areSameExtensions } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagementUtil';
|
|
11
15
|
import { ExtensionStorageService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionStorage';
|
|
12
16
|
import { isApplicationScopedExtension } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
13
|
-
import
|
|
17
|
+
import 'vscode/vscode/vs/platform/files/common/files';
|
|
14
18
|
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
19
|
+
import 'vscode/vscode/vs/platform/log/common/log';
|
|
15
20
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
21
|
+
import 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
16
22
|
import { getSyncResourceLogLabel } from 'vscode/vscode/vs/platform/userDataSync/common/abstractSynchronizer';
|
|
23
|
+
import '../../../../../../external/vscode-semver/semver.js';
|
|
17
24
|
import { IIgnoredExtensionsManagementService } from 'vscode/vscode/vs/platform/userDataSync/common/ignoredExtensions';
|
|
18
25
|
import { IUserDataSyncLogService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
19
26
|
import { IUserDataProfileStorageService } from '../../userDataProfile/common/userDataProfileStorageService.js';
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
3
|
import { getErrorMessage } from 'vscode/vscode/vs/base/common/errors';
|
|
4
|
+
import 'vscode/vscode/vs/base/common/event';
|
|
4
5
|
import { parse } from 'vscode/vscode/vs/base/common/json';
|
|
5
6
|
import { toFormattedString } from 'vscode/vscode/vs/base/common/jsonFormatter';
|
|
7
|
+
import 'vscode/vscode/vs/base/common/platform';
|
|
8
|
+
import 'vscode/vscode/vs/base/common/path';
|
|
9
|
+
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
10
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment';
|
|
7
11
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
12
|
+
import 'vscode/vscode/vs/platform/log/common/log';
|
|
13
|
+
import 'vscode/vscode/vs/platform/storage/common/storage';
|
|
8
14
|
import { getSyncResourceLogLabel } from 'vscode/vscode/vs/platform/userDataSync/common/abstractSynchronizer';
|
|
9
15
|
import { edit } from 'vscode/vscode/vs/platform/userDataSync/common/content';
|
|
10
16
|
import { IUserDataSyncLogService } from 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
17
|
+
import 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
11
18
|
import { IUserDataProfileStorageService } from '../../userDataProfile/common/userDataProfileStorageService.js';
|
|
12
19
|
|
|
13
20
|
const argvStoragePrefx = 'globalState.argv.';
|
|
@@ -138,6 +138,11 @@ let UserDataProfilesManifestSynchroniser = class UserDataProfilesManifestSynchro
|
|
|
138
138
|
}
|
|
139
139
|
if (localChange !== 0 ) {
|
|
140
140
|
await this.backupLocal(stringifyLocalProfiles(this.getLocalUserDataProfiles(), false));
|
|
141
|
+
await Promise.all(( local.removed.map(async (profile) => {
|
|
142
|
+
this.logService.trace(`${this.syncResourceLogLabel}: Removing '${profile.name}' profile...`);
|
|
143
|
+
await this.userDataProfilesService.removeProfile(profile);
|
|
144
|
+
this.logService.info(`${this.syncResourceLogLabel}: Removed profile '${profile.name}'.`);
|
|
145
|
+
})));
|
|
141
146
|
const promises = [];
|
|
142
147
|
for (const profile of local.added) {
|
|
143
148
|
promises.push((async () => {
|
|
@@ -146,13 +151,6 @@ let UserDataProfilesManifestSynchroniser = class UserDataProfilesManifestSynchro
|
|
|
146
151
|
this.logService.info(`${this.syncResourceLogLabel}: Created profile '${profile.name}'.`);
|
|
147
152
|
})());
|
|
148
153
|
}
|
|
149
|
-
for (const profile of local.removed) {
|
|
150
|
-
promises.push((async () => {
|
|
151
|
-
this.logService.trace(`${this.syncResourceLogLabel}: Removing '${profile.name}' profile...`);
|
|
152
|
-
await this.userDataProfilesService.removeProfile(profile);
|
|
153
|
-
this.logService.info(`${this.syncResourceLogLabel}: Removed profile '${profile.name}'.`);
|
|
154
|
-
})());
|
|
155
|
-
}
|
|
156
154
|
for (const profile of local.updated) {
|
|
157
155
|
const localProfile = this.userDataProfilesService.profiles.find(p => p.id === profile.id);
|
|
158
156
|
if (localProfile) {
|
|
@@ -1135,7 +1135,7 @@ let UserDataSyncWorkbenchContribution = class UserDataSyncWorkbenchContribution
|
|
|
1135
1135
|
items.push({ id: syncNowCommand.id, label: `${SYNC_TITLE.value}: ${syncNowCommand.title.original}`, description: syncNowCommand.description(that.userDataSyncService) });
|
|
1136
1136
|
if (that.userDataSyncEnablementService.canToggleEnablement()) {
|
|
1137
1137
|
const account = that.userDataSyncWorkbenchService.current;
|
|
1138
|
-
items.push({ id: turnOffSyncCommand.id, label: `${SYNC_TITLE.value}: ${turnOffSyncCommand.title.original}`, description: account ? `${account.accountName} (${that.authenticationService.
|
|
1138
|
+
items.push({ id: turnOffSyncCommand.id, label: `${SYNC_TITLE.value}: ${turnOffSyncCommand.title.original}`, description: account ? `${account.accountName} (${that.authenticationService.getProvider(account.authenticationProviderId).label})` : undefined });
|
|
1139
1139
|
}
|
|
1140
1140
|
quickPick.items = items;
|
|
1141
1141
|
disposables.add(quickPick.onDidAccept(() => {
|
|
@@ -92,7 +92,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
92
92
|
collapsed: false,
|
|
93
93
|
order: 300,
|
|
94
94
|
}], container);
|
|
95
|
-
registerAction2(class extends Action2 {
|
|
95
|
+
this._register(registerAction2(class extends Action2 {
|
|
96
96
|
constructor() {
|
|
97
97
|
super({
|
|
98
98
|
id: `workbench.actions.sync.editMachineName`,
|
|
@@ -115,8 +115,8 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
115
115
|
await treeView.refresh();
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
});
|
|
119
|
-
registerAction2(class extends Action2 {
|
|
118
|
+
}));
|
|
119
|
+
this._register(registerAction2(class extends Action2 {
|
|
120
120
|
constructor() {
|
|
121
121
|
super({
|
|
122
122
|
id: `workbench.actions.sync.turnOffSyncOnMachine`,
|
|
@@ -136,7 +136,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
136
136
|
await treeView.refresh();
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
});
|
|
139
|
+
}));
|
|
140
140
|
}
|
|
141
141
|
registerActivityView(container, remote) {
|
|
142
142
|
const id = `workbench.views.sync.${remote ? 'remote' : 'local'}Activity`;
|
|
@@ -232,7 +232,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
232
232
|
}));
|
|
233
233
|
}
|
|
234
234
|
registerDataViewActions(viewId) {
|
|
235
|
-
registerAction2(class extends Action2 {
|
|
235
|
+
this._register(registerAction2(class extends Action2 {
|
|
236
236
|
constructor() {
|
|
237
237
|
super({
|
|
238
238
|
id: `workbench.actions.sync.${viewId}.resolveResource`,
|
|
@@ -252,8 +252,8 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
252
252
|
const editorService = accessor.get(IEditorService);
|
|
253
253
|
await editorService.openEditor({ resource: ( URI.parse(resource)), options: { pinned: true } });
|
|
254
254
|
}
|
|
255
|
-
});
|
|
256
|
-
registerAction2(class extends Action2 {
|
|
255
|
+
}));
|
|
256
|
+
this._register(registerAction2(class extends Action2 {
|
|
257
257
|
constructor() {
|
|
258
258
|
super({
|
|
259
259
|
id: `workbench.actions.sync.${viewId}.compareWithLocal`,
|
|
@@ -291,8 +291,8 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
291
291
|
))
|
|
292
292
|
)), undefined);
|
|
293
293
|
}
|
|
294
|
-
});
|
|
295
|
-
registerAction2(class extends Action2 {
|
|
294
|
+
}));
|
|
295
|
+
this._register(registerAction2(class extends Action2 {
|
|
296
296
|
constructor() {
|
|
297
297
|
super({
|
|
298
298
|
id: `workbench.actions.sync.${viewId}.replaceCurrent`,
|
|
@@ -327,7 +327,7 @@ let UserDataSyncDataViews = class UserDataSyncDataViews extends Disposable {
|
|
|
327
327
|
return userDataSyncService.replace({ created: syncResourceHandle.created, uri: URI.revive(syncResourceHandle.uri) });
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
});
|
|
330
|
+
}));
|
|
331
331
|
}
|
|
332
332
|
registerTroubleShootView(container) {
|
|
333
333
|
const id = `workbench.views.sync.troubleshoot`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import './media/userDataProfileView.css.js';
|
|
3
3
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
5
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
6
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
6
7
|
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -17,7 +18,6 @@ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/
|
|
|
17
18
|
import { isUserDataProfile, toUserDataProfile, IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile';
|
|
18
19
|
import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
19
20
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
20
|
-
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
21
21
|
import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
22
22
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
23
23
|
import { TreeView, TreeViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/treeView';
|
|
@@ -47,7 +47,7 @@ import { joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
|
47
47
|
import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
|
|
48
48
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
49
49
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
50
|
-
import Severity from 'vscode/vscode/vs/base/common/severity';
|
|
50
|
+
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
51
51
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
52
52
|
import { IURLService } from 'vscode/vscode/vs/platform/url/common/url';
|
|
53
53
|
import { asText, IRequestService } from 'vscode/vscode/vs/platform/request/common/request';
|
|
@@ -308,7 +308,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
308
308
|
"Profile with name {0} already exists.",
|
|
309
309
|
quickPick.value
|
|
310
310
|
));
|
|
311
|
-
quickPick.severity = Severity.Warning;
|
|
311
|
+
quickPick.severity = Severity$1.Warning;
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
314
|
if (resources.every(resource => !resource.picked)) {
|
|
@@ -317,10 +317,10 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
317
317
|
'invalid configurations',
|
|
318
318
|
"The profile should contain at least one configuration."
|
|
319
319
|
));
|
|
320
|
-
quickPick.severity = Severity.Warning;
|
|
320
|
+
quickPick.severity = Severity$1.Warning;
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
quickPick.severity = Severity.Ignore;
|
|
323
|
+
quickPick.severity = Severity$1.Ignore;
|
|
324
324
|
quickPick.validationMessage = undefined;
|
|
325
325
|
};
|
|
326
326
|
disposables.add(quickPick.onDidChangeSelection(items => {
|
|
@@ -362,14 +362,14 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
362
362
|
'name required',
|
|
363
363
|
"Profile name is required and must be a non-empty value."
|
|
364
364
|
));
|
|
365
|
-
quickPick.severity = Severity.Error;
|
|
365
|
+
quickPick.severity = Severity$1.Error;
|
|
366
366
|
}
|
|
367
367
|
if (quickPick.validationMessage) {
|
|
368
368
|
return;
|
|
369
369
|
}
|
|
370
370
|
result = { name, items: quickPick.selectedItems, icon: icon.id === DEFAULT_ICON.id ? null : icon.id };
|
|
371
371
|
quickPick.hide();
|
|
372
|
-
quickPick.severity = Severity.Ignore;
|
|
372
|
+
quickPick.severity = Severity$1.Ignore;
|
|
373
373
|
quickPick.validationMessage = undefined;
|
|
374
374
|
}));
|
|
375
375
|
const domNode = $('.profile-edit-widget');
|
|
@@ -767,7 +767,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
await this.dialogService.prompt({
|
|
770
|
-
type: Severity.Info,
|
|
770
|
+
type: Severity$1.Info,
|
|
771
771
|
message,
|
|
772
772
|
buttons,
|
|
773
773
|
cancelButton: ( localizeWithPath(
|
|
@@ -1083,7 +1083,7 @@ let UserDataProfileImportExportService = class UserDataProfileImportExportServic
|
|
|
1083
1083
|
ImportProfileChoice[ImportProfileChoice["Cancel"] = 2] = "Cancel";
|
|
1084
1084
|
})(ImportProfileChoice || (ImportProfileChoice = {})));
|
|
1085
1085
|
const { result } = await this.dialogService.prompt({
|
|
1086
|
-
type: Severity.Info,
|
|
1086
|
+
type: Severity$1.Info,
|
|
1087
1087
|
message: ( localizeWithPath(
|
|
1088
1088
|
'vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService',
|
|
1089
1089
|
'profile already exists',
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncEnablementService.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'vscode/vscode/vs/platform/userDataSync/common/userDataSync';
|
|
1
2
|
import { UserDataSyncEnablementService as UserDataSyncEnablementService$1 } from '../../../../platform/userDataSync/common/userDataSyncEnablementService.js';
|
|
2
3
|
|
|
3
4
|
class UserDataSyncEnablementService extends UserDataSyncEnablementService$1 {
|
package/vscode/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.js
CHANGED
|
@@ -634,7 +634,7 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
634
634
|
)) });
|
|
635
635
|
for (const authenticationProvider of authenticationProviders) {
|
|
636
636
|
const accounts = (allAccounts.get(authenticationProvider.id) || []).sort(({ sessionId }) => sessionId === this.currentSessionId ? -1 : 1);
|
|
637
|
-
const providerName = this.authenticationService.
|
|
637
|
+
const providerName = this.authenticationService.getProvider(authenticationProvider.id).label;
|
|
638
638
|
for (const account of accounts) {
|
|
639
639
|
quickPickItems.push({
|
|
640
640
|
label: `${account.accountName} (${providerName})`,
|
|
@@ -655,8 +655,9 @@ let UserDataSyncWorkbenchService = class UserDataSyncWorkbenchService extends Di
|
|
|
655
655
|
)) });
|
|
656
656
|
}
|
|
657
657
|
for (const authenticationProvider of authenticationProviders) {
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
const provider = this.authenticationService.getProvider(authenticationProvider.id);
|
|
659
|
+
if (!( allAccounts.has(authenticationProvider.id)) || provider.supportsMultipleAccounts) {
|
|
660
|
+
const providerName = provider.label;
|
|
660
661
|
quickPickItems.push({ label: ( localizeWithPath(
|
|
661
662
|
'vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService',
|
|
662
663
|
'sign in using account',
|