jspm 4.2.0 → 4.4.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/dist/cli.js +395 -47
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -294,10 +294,110 @@ var require_sver = __commonJS({
|
|
|
294
294
|
var MAJOR_RANGE = 1;
|
|
295
295
|
var STABLE_RANGE = 2;
|
|
296
296
|
var EXACT_RANGE = 3;
|
|
297
|
+
var LOWER_BOUND = 4;
|
|
298
|
+
var UPPER_BOUND = 5;
|
|
299
|
+
var INTERSECTION_RANGE = 6;
|
|
300
|
+
var UNION_RANGE = 7;
|
|
297
301
|
var TYPE = Symbol("type");
|
|
298
302
|
var VERSION = Symbol("version");
|
|
303
|
+
var RANGE_SET = Symbol("rangeSet");
|
|
304
|
+
var BOUND_INCLUSIVE = Symbol("boundInclusive");
|
|
305
|
+
var comparatorRegEx = /^(>=|<=|>|<|=)\s*(.+)$/;
|
|
306
|
+
var partialRegEx = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([\da-z-]+(?:\.[\da-z-]+)*))?(\+[\da-z-]+)?)?)?$/i;
|
|
307
|
+
function effectiveVersion(range) {
|
|
308
|
+
if (range[VERSION])
|
|
309
|
+
return range[VERSION];
|
|
310
|
+
if (range[RANGE_SET] && range[RANGE_SET].length > 0)
|
|
311
|
+
return effectiveVersion(range[RANGE_SET][0]);
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
function effectiveUpperBound(range) {
|
|
315
|
+
let type = range[TYPE];
|
|
316
|
+
if (type === WILDCARD_RANGE || type === LOWER_BOUND)
|
|
317
|
+
return null;
|
|
318
|
+
if (type === MAJOR_RANGE)
|
|
319
|
+
return new Semver(range[VERSION][MAJOR] + 1 + ".0.0");
|
|
320
|
+
if (type === STABLE_RANGE)
|
|
321
|
+
return new Semver(range[VERSION][MAJOR] + "." + (range[VERSION][MINOR] + 1) + ".0");
|
|
322
|
+
if (type === EXACT_RANGE || type === UPPER_BOUND)
|
|
323
|
+
return range[VERSION];
|
|
324
|
+
if (type === INTERSECTION_RANGE) {
|
|
325
|
+
let min = null;
|
|
326
|
+
for (let r of range[RANGE_SET]) {
|
|
327
|
+
let ub = effectiveUpperBound(r);
|
|
328
|
+
if (ub !== null && (min === null || Semver.compare(ub, min) < 0))
|
|
329
|
+
min = ub;
|
|
330
|
+
}
|
|
331
|
+
return min;
|
|
332
|
+
}
|
|
333
|
+
if (type === UNION_RANGE) {
|
|
334
|
+
let max = null;
|
|
335
|
+
for (let r of range[RANGE_SET]) {
|
|
336
|
+
let ub = effectiveUpperBound(r);
|
|
337
|
+
if (ub === null)
|
|
338
|
+
return null;
|
|
339
|
+
if (max === null || Semver.compare(ub, max) > 0)
|
|
340
|
+
max = ub;
|
|
341
|
+
}
|
|
342
|
+
return max;
|
|
343
|
+
}
|
|
344
|
+
return range[VERSION] || null;
|
|
345
|
+
}
|
|
346
|
+
function createUpperBoundFromHyphen(verStr) {
|
|
347
|
+
let fullVer = verStr.match(semverRegEx);
|
|
348
|
+
if (fullVer) {
|
|
349
|
+
return new SemverRange2("<=" + verStr);
|
|
350
|
+
}
|
|
351
|
+
let partialMatch = verStr.match(partialRegEx);
|
|
352
|
+
if (partialMatch) {
|
|
353
|
+
let major = parseInt(partialMatch[1], 10);
|
|
354
|
+
let hasMinor = partialMatch[2] !== void 0;
|
|
355
|
+
let minor = hasMinor ? parseInt(partialMatch[2], 10) : void 0;
|
|
356
|
+
if (hasMinor) {
|
|
357
|
+
return new SemverRange2("<" + major + "." + (minor + 1) + ".0");
|
|
358
|
+
} else {
|
|
359
|
+
return new SemverRange2("<" + (major + 1) + ".0.0");
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return new SemverRange2("<=" + verStr);
|
|
363
|
+
}
|
|
299
364
|
var SemverRange2 = class {
|
|
300
365
|
constructor(versionRange) {
|
|
366
|
+
versionRange = versionRange.trim();
|
|
367
|
+
versionRange = versionRange.replace(/(>=|<=|>|<|=)\s+/g, "$1");
|
|
368
|
+
if (versionRange.includes("||")) {
|
|
369
|
+
let parts = versionRange.split("||").map((p) => p.trim()).filter(Boolean);
|
|
370
|
+
if (parts.length >= 2) {
|
|
371
|
+
this[TYPE] = UNION_RANGE;
|
|
372
|
+
this[RANGE_SET] = parts.map((p) => new SemverRange2(p));
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (parts.length === 1)
|
|
376
|
+
versionRange = parts[0];
|
|
377
|
+
else {
|
|
378
|
+
this[TYPE] = WILDCARD_RANGE;
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
let hyphenMatch = versionRange.match(/^(\S+)\s+-\s+(\S+)$/);
|
|
383
|
+
if (hyphenMatch) {
|
|
384
|
+
this[TYPE] = INTERSECTION_RANGE;
|
|
385
|
+
this[RANGE_SET] = [
|
|
386
|
+
new SemverRange2(">=" + hyphenMatch[1]),
|
|
387
|
+
createUpperBoundFromHyphen(hyphenMatch[2])
|
|
388
|
+
];
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
let tokens = versionRange.split(/\s+/);
|
|
392
|
+
if (tokens.length > 1) {
|
|
393
|
+
this[TYPE] = INTERSECTION_RANGE;
|
|
394
|
+
this[RANGE_SET] = tokens.map((t) => new SemverRange2(t));
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
versionRange = versionRange.replace(/\.[xX*]/g, "");
|
|
398
|
+
if (/^[xX*]$/.test(versionRange) || versionRange === "") {
|
|
399
|
+
versionRange = "*";
|
|
400
|
+
}
|
|
301
401
|
if (versionRange === "*" || versionRange === "") {
|
|
302
402
|
this[TYPE] = WILDCARD_RANGE;
|
|
303
403
|
return;
|
|
@@ -317,7 +417,9 @@ var require_sver = __commonJS({
|
|
|
317
417
|
this[TYPE] = STABLE_RANGE;
|
|
318
418
|
}
|
|
319
419
|
this[VERSION][PRE] = this[VERSION][PRE] || [];
|
|
320
|
-
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
if (versionRange.startsWith("^^")) {
|
|
321
423
|
this[VERSION] = new Semver(versionRange.substr(2));
|
|
322
424
|
this[TYPE] = MAJOR_RANGE;
|
|
323
425
|
} else if (versionRange[0] === "^") {
|
|
@@ -333,13 +435,98 @@ var require_sver = __commonJS({
|
|
|
333
435
|
} else if (versionRange[0] === "~") {
|
|
334
436
|
this[VERSION] = new Semver(versionRange.substr(1));
|
|
335
437
|
this[TYPE] = STABLE_RANGE;
|
|
438
|
+
} else if (comparatorRegEx.test(versionRange)) {
|
|
439
|
+
let match2 = versionRange.match(comparatorRegEx);
|
|
440
|
+
this._parseComparator(match2[1], match2[2].trim());
|
|
441
|
+
return;
|
|
336
442
|
} else {
|
|
337
443
|
this[VERSION] = new Semver(versionRange);
|
|
338
444
|
this[TYPE] = EXACT_RANGE;
|
|
339
445
|
}
|
|
340
|
-
if (this[VERSION][TAG] && this[TYPE] !== EXACT_RANGE)
|
|
446
|
+
if (this[VERSION] && this[VERSION][TAG] && this[TYPE] !== EXACT_RANGE)
|
|
341
447
|
this[TYPE] = EXACT_RANGE;
|
|
342
448
|
}
|
|
449
|
+
_parseComparator(op, verStr) {
|
|
450
|
+
if (op === "=") {
|
|
451
|
+
let fullVer = verStr.match(semverRegEx);
|
|
452
|
+
if (fullVer) {
|
|
453
|
+
this[VERSION] = new Semver(verStr);
|
|
454
|
+
this[TYPE] = EXACT_RANGE;
|
|
455
|
+
} else {
|
|
456
|
+
let temp = new SemverRange2(verStr);
|
|
457
|
+
this[TYPE] = temp[TYPE];
|
|
458
|
+
this[VERSION] = temp[VERSION];
|
|
459
|
+
if (temp[RANGE_SET])
|
|
460
|
+
this[RANGE_SET] = temp[RANGE_SET];
|
|
461
|
+
if (temp[BOUND_INCLUSIVE] !== void 0)
|
|
462
|
+
this[BOUND_INCLUSIVE] = temp[BOUND_INCLUSIVE];
|
|
463
|
+
}
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
let isLower = op === ">=" || op === ">";
|
|
467
|
+
let isInclusive = op === ">=" || op === "<=";
|
|
468
|
+
let partialMatch = verStr.match(partialRegEx);
|
|
469
|
+
if (!partialMatch) {
|
|
470
|
+
this[VERSION] = new Semver(op + verStr);
|
|
471
|
+
this[TYPE] = EXACT_RANGE;
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
let major = parseInt(partialMatch[1], 10);
|
|
475
|
+
let hasMinor = partialMatch[2] !== void 0;
|
|
476
|
+
let minor = hasMinor ? parseInt(partialMatch[2], 10) : void 0;
|
|
477
|
+
let hasPatch = partialMatch[3] !== void 0;
|
|
478
|
+
if (hasPatch) {
|
|
479
|
+
this[VERSION] = new Semver(verStr);
|
|
480
|
+
this[TYPE] = isLower ? LOWER_BOUND : UPPER_BOUND;
|
|
481
|
+
this[BOUND_INCLUSIVE] = isInclusive;
|
|
482
|
+
} else if (hasMinor) {
|
|
483
|
+
if (isLower) {
|
|
484
|
+
if (isInclusive) {
|
|
485
|
+
this[VERSION] = new Semver(major + "." + minor + ".0");
|
|
486
|
+
} else {
|
|
487
|
+
this[VERSION] = new Semver(major + "." + (minor + 1) + ".0");
|
|
488
|
+
}
|
|
489
|
+
this[TYPE] = LOWER_BOUND;
|
|
490
|
+
this[BOUND_INCLUSIVE] = true;
|
|
491
|
+
} else {
|
|
492
|
+
if (isInclusive) {
|
|
493
|
+
this[VERSION] = new Semver(major + "." + (minor + 1) + ".0");
|
|
494
|
+
} else {
|
|
495
|
+
this[VERSION] = new Semver(major + "." + minor + ".0");
|
|
496
|
+
}
|
|
497
|
+
this[TYPE] = UPPER_BOUND;
|
|
498
|
+
this[BOUND_INCLUSIVE] = false;
|
|
499
|
+
}
|
|
500
|
+
} else {
|
|
501
|
+
if (isLower) {
|
|
502
|
+
if (isInclusive) {
|
|
503
|
+
this[VERSION] = new Semver(major + ".0.0");
|
|
504
|
+
} else {
|
|
505
|
+
this[VERSION] = new Semver(major + 1 + ".0.0");
|
|
506
|
+
}
|
|
507
|
+
this[TYPE] = LOWER_BOUND;
|
|
508
|
+
this[BOUND_INCLUSIVE] = true;
|
|
509
|
+
} else {
|
|
510
|
+
if (isInclusive) {
|
|
511
|
+
this[VERSION] = new Semver(major + 1 + ".0.0");
|
|
512
|
+
} else {
|
|
513
|
+
this[VERSION] = new Semver(major + ".0.0");
|
|
514
|
+
}
|
|
515
|
+
this[TYPE] = UPPER_BOUND;
|
|
516
|
+
this[BOUND_INCLUSIVE] = false;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
_testBound(version3) {
|
|
521
|
+
if (version3[TAG])
|
|
522
|
+
return false;
|
|
523
|
+
let cmp = Semver.compare(version3, this[VERSION]);
|
|
524
|
+
if (this[TYPE] === LOWER_BOUND)
|
|
525
|
+
return this[BOUND_INCLUSIVE] ? cmp >= 0 : cmp > 0;
|
|
526
|
+
if (this[TYPE] === UPPER_BOUND)
|
|
527
|
+
return this[BOUND_INCLUSIVE] ? cmp <= 0 : cmp < 0;
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
343
530
|
get isExact() {
|
|
344
531
|
return this[TYPE] === EXACT_RANGE;
|
|
345
532
|
}
|
|
@@ -358,6 +545,18 @@ var require_sver = __commonJS({
|
|
|
358
545
|
get isWildcard() {
|
|
359
546
|
return this[TYPE] === WILDCARD_RANGE;
|
|
360
547
|
}
|
|
548
|
+
get isLowerBound() {
|
|
549
|
+
return this[TYPE] === LOWER_BOUND;
|
|
550
|
+
}
|
|
551
|
+
get isUpperBound() {
|
|
552
|
+
return this[TYPE] === UPPER_BOUND;
|
|
553
|
+
}
|
|
554
|
+
get isIntersection() {
|
|
555
|
+
return this[TYPE] === INTERSECTION_RANGE;
|
|
556
|
+
}
|
|
557
|
+
get isUnion() {
|
|
558
|
+
return this[TYPE] === UNION_RANGE;
|
|
559
|
+
}
|
|
361
560
|
get type() {
|
|
362
561
|
switch (this[TYPE]) {
|
|
363
562
|
case WILDCARD_RANGE:
|
|
@@ -368,11 +567,25 @@ var require_sver = __commonJS({
|
|
|
368
567
|
return "stable";
|
|
369
568
|
case EXACT_RANGE:
|
|
370
569
|
return "exact";
|
|
570
|
+
case LOWER_BOUND:
|
|
571
|
+
return "lower_bound";
|
|
572
|
+
case UPPER_BOUND:
|
|
573
|
+
return "upper_bound";
|
|
574
|
+
case INTERSECTION_RANGE:
|
|
575
|
+
return "intersection";
|
|
576
|
+
case UNION_RANGE:
|
|
577
|
+
return "union";
|
|
371
578
|
}
|
|
372
579
|
}
|
|
373
580
|
get version() {
|
|
374
581
|
return this[VERSION];
|
|
375
582
|
}
|
|
583
|
+
get rangeSet() {
|
|
584
|
+
return this[RANGE_SET];
|
|
585
|
+
}
|
|
586
|
+
get boundInclusive() {
|
|
587
|
+
return this[BOUND_INCLUSIVE];
|
|
588
|
+
}
|
|
376
589
|
gt(range) {
|
|
377
590
|
return SemverRange2.compare(this, range) === 1;
|
|
378
591
|
}
|
|
@@ -389,21 +602,54 @@ var require_sver = __commonJS({
|
|
|
389
602
|
return unstable || !version3[PRE] && !version3[TAG];
|
|
390
603
|
if (this[TYPE] === EXACT_RANGE)
|
|
391
604
|
return this[VERSION].eq(version3);
|
|
392
|
-
if (
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
605
|
+
if (this[TYPE] === MAJOR_RANGE || this[TYPE] === STABLE_RANGE) {
|
|
606
|
+
if (version3[TAG])
|
|
607
|
+
return false;
|
|
608
|
+
if (this[VERSION][MAJOR] !== version3[MAJOR])
|
|
609
|
+
return false;
|
|
610
|
+
if (this[TYPE] === MAJOR_RANGE ? this[VERSION][MINOR] > version3[MINOR] : this[VERSION][MINOR] !== version3[MINOR])
|
|
611
|
+
return false;
|
|
612
|
+
if ((this[TYPE] === MAJOR_RANGE ? this[VERSION][MINOR] === version3[MINOR] : true) && this[VERSION][PATCH] > version3[PATCH])
|
|
613
|
+
return false;
|
|
614
|
+
if (version3[PRE] === void 0 || version3[PRE].length === 0)
|
|
615
|
+
return true;
|
|
616
|
+
if (this[VERSION][PRE] === void 0 || this[VERSION][PRE].length === 0)
|
|
617
|
+
return unstable;
|
|
618
|
+
if (unstable === false && (this[VERSION][MINOR] !== version3[MINOR] || this[VERSION][PATCH] !== version3[PATCH]))
|
|
619
|
+
return false;
|
|
620
|
+
return prereleaseCompare(this[VERSION][PRE], version3[PRE]) !== 1;
|
|
621
|
+
}
|
|
622
|
+
if (this[TYPE] === LOWER_BOUND || this[TYPE] === UPPER_BOUND) {
|
|
623
|
+
if (version3[TAG])
|
|
624
|
+
return false;
|
|
625
|
+
if (!unstable && version3[PRE] && version3[PRE].length) {
|
|
626
|
+
if (!this[VERSION][PRE] || !this[VERSION][PRE].length || this[VERSION][MAJOR] !== version3[MAJOR] || this[VERSION][MINOR] !== version3[MINOR] || this[VERSION][PATCH] !== version3[PATCH])
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
629
|
+
return this._testBound(version3);
|
|
630
|
+
}
|
|
631
|
+
if (this[TYPE] === INTERSECTION_RANGE) {
|
|
632
|
+
if (version3[TAG]) {
|
|
633
|
+
return this[RANGE_SET].every((r) => r.has(version3, unstable));
|
|
634
|
+
}
|
|
635
|
+
if (!unstable && version3[PRE] && version3[PRE].length) {
|
|
636
|
+
let hasTupleMatch = this[RANGE_SET].some((r) => {
|
|
637
|
+
let v = r[VERSION];
|
|
638
|
+
return v && v[PRE] && v[PRE].length && v[MAJOR] === version3[MAJOR] && v[MINOR] === version3[MINOR] && v[PATCH] === version3[PATCH];
|
|
639
|
+
});
|
|
640
|
+
if (!hasTupleMatch)
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
return this[RANGE_SET].every((r) => {
|
|
644
|
+
if (r[TYPE] === LOWER_BOUND || r[TYPE] === UPPER_BOUND)
|
|
645
|
+
return r._testBound(version3);
|
|
646
|
+
return r.has(version3, !unstable ? true : unstable);
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
if (this[TYPE] === UNION_RANGE) {
|
|
650
|
+
return this[RANGE_SET].some((r) => r.has(version3, unstable));
|
|
651
|
+
}
|
|
652
|
+
return false;
|
|
407
653
|
}
|
|
408
654
|
contains(range) {
|
|
409
655
|
if (!(range instanceof SemverRange2))
|
|
@@ -412,7 +658,19 @@ var require_sver = __commonJS({
|
|
|
412
658
|
return true;
|
|
413
659
|
if (range[TYPE] === WILDCARD_RANGE)
|
|
414
660
|
return false;
|
|
415
|
-
|
|
661
|
+
if (this[TYPE] === UNION_RANGE)
|
|
662
|
+
return this[RANGE_SET].some((r) => r.contains(range));
|
|
663
|
+
if (range[TYPE] === UNION_RANGE)
|
|
664
|
+
return range[RANGE_SET].every((r) => this.contains(r));
|
|
665
|
+
if (range[TYPE] === INTERSECTION_RANGE)
|
|
666
|
+
return range[RANGE_SET].some((r) => this.contains(r));
|
|
667
|
+
if (this[TYPE] === INTERSECTION_RANGE)
|
|
668
|
+
return this[RANGE_SET].every((r) => r.contains(range));
|
|
669
|
+
if (this[TYPE] <= EXACT_RANGE && range[TYPE] <= EXACT_RANGE)
|
|
670
|
+
return range[TYPE] >= this[TYPE] && this.has(range[VERSION], true);
|
|
671
|
+
if ((this[TYPE] === LOWER_BOUND || this[TYPE] === UPPER_BOUND) && range[TYPE] === EXACT_RANGE)
|
|
672
|
+
return this.has(range[VERSION], true);
|
|
673
|
+
return false;
|
|
416
674
|
}
|
|
417
675
|
intersect(range) {
|
|
418
676
|
if (!(range instanceof SemverRange2))
|
|
@@ -427,23 +685,56 @@ var require_sver = __commonJS({
|
|
|
427
685
|
return range.has(this[VERSION], true) ? this : void 0;
|
|
428
686
|
if (range[TYPE] === EXACT_RANGE)
|
|
429
687
|
return this.has(range[VERSION], true) ? range : void 0;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
688
|
+
if (this[TYPE] === UNION_RANGE) {
|
|
689
|
+
let results = this[RANGE_SET].map((r) => r.intersect(range)).filter(Boolean);
|
|
690
|
+
if (results.length === 0)
|
|
691
|
+
return void 0;
|
|
692
|
+
if (results.length === 1)
|
|
693
|
+
return results[0];
|
|
694
|
+
let union = Object.create(SemverRange2.prototype);
|
|
695
|
+
union[TYPE] = UNION_RANGE;
|
|
696
|
+
union[RANGE_SET] = results;
|
|
697
|
+
return union;
|
|
698
|
+
}
|
|
699
|
+
if (range[TYPE] === UNION_RANGE)
|
|
700
|
+
return range.intersect(this);
|
|
701
|
+
if (this[TYPE] === INTERSECTION_RANGE && range[TYPE] === INTERSECTION_RANGE) {
|
|
702
|
+
let result2 = Object.create(SemverRange2.prototype);
|
|
703
|
+
result2[TYPE] = INTERSECTION_RANGE;
|
|
704
|
+
result2[RANGE_SET] = [...this[RANGE_SET], ...range[RANGE_SET]];
|
|
705
|
+
return result2;
|
|
706
|
+
}
|
|
707
|
+
if (this[TYPE] === INTERSECTION_RANGE) {
|
|
708
|
+
let result2 = Object.create(SemverRange2.prototype);
|
|
709
|
+
result2[TYPE] = INTERSECTION_RANGE;
|
|
710
|
+
result2[RANGE_SET] = [...this[RANGE_SET], range];
|
|
711
|
+
return result2;
|
|
712
|
+
}
|
|
713
|
+
if (range[TYPE] === INTERSECTION_RANGE)
|
|
714
|
+
return range.intersect(this);
|
|
715
|
+
if (this[TYPE] <= EXACT_RANGE && range[TYPE] <= EXACT_RANGE) {
|
|
716
|
+
let higherRange, lowerRange, polarity;
|
|
717
|
+
if (range[VERSION].gt(this[VERSION])) {
|
|
718
|
+
higherRange = range;
|
|
719
|
+
lowerRange = this;
|
|
720
|
+
polarity = true;
|
|
721
|
+
} else {
|
|
722
|
+
higherRange = this;
|
|
723
|
+
lowerRange = range;
|
|
724
|
+
polarity = false;
|
|
725
|
+
}
|
|
726
|
+
if (!lowerRange.has(higherRange[VERSION], true))
|
|
727
|
+
return;
|
|
728
|
+
if (lowerRange[TYPE] === MAJOR_RANGE)
|
|
729
|
+
return polarity ? range : this;
|
|
730
|
+
let intersection = new SemverRange2(higherRange[VERSION].toString());
|
|
731
|
+
intersection[TYPE] = STABLE_RANGE;
|
|
732
|
+
return intersection;
|
|
733
|
+
}
|
|
734
|
+
let result = Object.create(SemverRange2.prototype);
|
|
735
|
+
result[TYPE] = INTERSECTION_RANGE;
|
|
736
|
+
result[RANGE_SET] = [this, range];
|
|
737
|
+
return result;
|
|
447
738
|
}
|
|
448
739
|
bestMatch(versions, unstable = false) {
|
|
449
740
|
let maxSemver;
|
|
@@ -476,6 +767,14 @@ var require_sver = __commonJS({
|
|
|
476
767
|
return "~" + version3.toString();
|
|
477
768
|
case EXACT_RANGE:
|
|
478
769
|
return version3.toString();
|
|
770
|
+
case LOWER_BOUND:
|
|
771
|
+
return (this[BOUND_INCLUSIVE] ? ">=" : ">") + version3.toString();
|
|
772
|
+
case UPPER_BOUND:
|
|
773
|
+
return (this[BOUND_INCLUSIVE] ? "<=" : "<") + version3.toString();
|
|
774
|
+
case INTERSECTION_RANGE:
|
|
775
|
+
return this[RANGE_SET].map((r) => r.toString()).join(" ");
|
|
776
|
+
case UNION_RANGE:
|
|
777
|
+
return this[RANGE_SET].map((r) => r.toString()).join(" || ");
|
|
479
778
|
}
|
|
480
779
|
}
|
|
481
780
|
toJSON() {
|
|
@@ -488,7 +787,9 @@ var require_sver = __commonJS({
|
|
|
488
787
|
}
|
|
489
788
|
static isValid(range) {
|
|
490
789
|
let semverRange = new SemverRange2(range);
|
|
491
|
-
|
|
790
|
+
if (semverRange[TYPE] === EXACT_RANGE)
|
|
791
|
+
return semverRange[VERSION][TAG] === void 0;
|
|
792
|
+
return true;
|
|
492
793
|
}
|
|
493
794
|
static compare(r1, r2) {
|
|
494
795
|
if (!(r1 instanceof SemverRange2))
|
|
@@ -501,9 +802,28 @@ var require_sver = __commonJS({
|
|
|
501
802
|
return 1;
|
|
502
803
|
if (r2[TYPE] === WILDCARD_RANGE)
|
|
503
804
|
return -1;
|
|
504
|
-
let
|
|
505
|
-
|
|
805
|
+
let u1 = effectiveUpperBound(r1);
|
|
806
|
+
let u2 = effectiveUpperBound(r2);
|
|
807
|
+
if (u1 === null && u2 === null) {
|
|
808
|
+
let v12 = effectiveVersion(r1);
|
|
809
|
+
let v22 = effectiveVersion(r2);
|
|
810
|
+
if (v12 && v22)
|
|
811
|
+
return Semver.compare(v12, v22);
|
|
812
|
+
return 0;
|
|
813
|
+
}
|
|
814
|
+
if (u1 === null)
|
|
815
|
+
return 1;
|
|
816
|
+
if (u2 === null)
|
|
817
|
+
return -1;
|
|
818
|
+
let cmp = Semver.compare(u1, u2);
|
|
819
|
+
if (cmp !== 0)
|
|
506
820
|
return cmp;
|
|
821
|
+
let v1 = effectiveVersion(r1);
|
|
822
|
+
let v2 = effectiveVersion(r2);
|
|
823
|
+
if (v1 && v2) {
|
|
824
|
+
cmp = Semver.compare(v1, v2);
|
|
825
|
+
if (cmp !== 0)
|
|
826
|
+
return cmp;
|
|
507
827
|
}
|
|
508
828
|
if (r1[TYPE] === r2[TYPE])
|
|
509
829
|
return 0;
|
|
@@ -2321,8 +2641,9 @@ async function writeHtmlOutput(mapFile, generator, pins, env2, flags, silent = f
|
|
|
2321
2641
|
} catch (e) {
|
|
2322
2642
|
throw new JspmError(`Failed to read HTML file ${c4.cyan(mapFile)} for injection.`);
|
|
2323
2643
|
}
|
|
2644
|
+
const entryPoints = pins.length ? pins : Object.keys(generator.getMap().imports || {});
|
|
2324
2645
|
const outputHtml = await generator.htmlInject(html, {
|
|
2325
|
-
pins:
|
|
2646
|
+
pins: entryPoints,
|
|
2326
2647
|
htmlUrl: generator.mapUrl,
|
|
2327
2648
|
// URL of the output map
|
|
2328
2649
|
rootUrl: generator.rootUrl,
|
|
@@ -2404,7 +2725,7 @@ async function getGenerator(flags, configOverride = null, inputMap) {
|
|
|
2404
2725
|
inputMap: inputMap || await getInputMap(flags),
|
|
2405
2726
|
env: await getEnv(flags),
|
|
2406
2727
|
flattenScopes: flags.flattenScopes === false ? false : Boolean(flags.release || flags.flattenScopes),
|
|
2407
|
-
combineSubpaths: flags.combineSubpaths === false ?
|
|
2728
|
+
combineSubpaths: flags.combineSubpaths === false ? "none" : "both",
|
|
2408
2729
|
defaultProvider,
|
|
2409
2730
|
resolutions: getResolutions(flags),
|
|
2410
2731
|
cache: getCacheMode(flags),
|
|
@@ -2834,7 +3155,7 @@ async function getLatestEsms(generator, provider2) {
|
|
|
2834
3155
|
{
|
|
2835
3156
|
name: "es-module-shims",
|
|
2836
3157
|
registry: "npm",
|
|
2837
|
-
|
|
3158
|
+
range: new import_sver.SemverRange("*")
|
|
2838
3159
|
},
|
|
2839
3160
|
generator.traceMap.installer.defaultProvider
|
|
2840
3161
|
);
|
|
@@ -28741,7 +29062,7 @@ init_utils();
|
|
|
28741
29062
|
init_init();
|
|
28742
29063
|
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
28743
29064
|
import c7 from "picocolors";
|
|
28744
|
-
async function install(flags, update) {
|
|
29065
|
+
async function install(flags, update = false) {
|
|
28745
29066
|
const log2 = withType("install/install");
|
|
28746
29067
|
log2(`Flags: ${JSON.stringify(flags)}`);
|
|
28747
29068
|
const env2 = await getEnv(flags);
|
|
@@ -29142,7 +29463,13 @@ async function build(flags) {
|
|
|
29142
29463
|
const { output } = await bundle.generate({
|
|
29143
29464
|
format: "esm",
|
|
29144
29465
|
assetFileNames: "[name][extname]",
|
|
29145
|
-
entryFileNames:
|
|
29466
|
+
entryFileNames: flags.hashEntries ? (chunkInfo) => {
|
|
29467
|
+
const name = chunkInfo.name;
|
|
29468
|
+
const dotIdx = name.lastIndexOf(".");
|
|
29469
|
+
if (dotIdx !== -1)
|
|
29470
|
+
return `${name.slice(0, dotIdx)}-[hash:8]${name.slice(dotIdx)}`;
|
|
29471
|
+
return "[name]-[hash:8]";
|
|
29472
|
+
} : "[name]",
|
|
29146
29473
|
chunkFileNames: "lib/[name]-[hash:8].js",
|
|
29147
29474
|
sourcemap: true,
|
|
29148
29475
|
compact: flags.minify
|
|
@@ -29173,9 +29500,15 @@ async function build(flags) {
|
|
|
29173
29500
|
const pjson = JSON.parse(
|
|
29174
29501
|
readFileSync2(join3(projectConfig.projectPath, "package.json"), "utf8")
|
|
29175
29502
|
);
|
|
29176
|
-
pjson.exports
|
|
29177
|
-
|
|
29178
|
-
|
|
29503
|
+
let exportsStr = JSON.stringify(pjson.exports).replace(/\.ts"/g, '.js"').replace(/\.mts"/g, '.mjs"');
|
|
29504
|
+
if (flags.hashEntries) {
|
|
29505
|
+
for (const chunk of output) {
|
|
29506
|
+
if (chunk.type === "chunk" && chunk.isEntry && chunk.fileName !== chunk.name) {
|
|
29507
|
+
exportsStr = exportsStr.split(chunk.name).join(chunk.fileName);
|
|
29508
|
+
}
|
|
29509
|
+
}
|
|
29510
|
+
}
|
|
29511
|
+
pjson.exports = JSON.parse(exportsStr);
|
|
29179
29512
|
const outPath = join3(flags.out, "package.json");
|
|
29180
29513
|
const outDir = dirname3(outPath);
|
|
29181
29514
|
await mkdir3(outDir, { recursive: true });
|
|
@@ -29798,6 +30131,11 @@ async function readJsonFile(filePath, defaultValue = {}) {
|
|
|
29798
30131
|
}
|
|
29799
30132
|
async function eject(flags) {
|
|
29800
30133
|
const log2 = withType("publish/eject");
|
|
30134
|
+
console.warn(
|
|
30135
|
+
`${c11.yellow(
|
|
30136
|
+
"Warning:"
|
|
30137
|
+
)} jspm publish is experimental and should only be used for prototyping. Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are not provided for publishing on https://jspm.io/. For reliable package delivery, use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.`
|
|
30138
|
+
);
|
|
29801
30139
|
const pkg = flags.eject;
|
|
29802
30140
|
if (!pkg.startsWith("app:")) {
|
|
29803
30141
|
throw new JspmError(`Only the app: JSPM registry is currently supported for ejection.`);
|
|
@@ -29827,6 +30165,11 @@ async function eject(flags) {
|
|
|
29827
30165
|
}
|
|
29828
30166
|
async function publish(flags = {}) {
|
|
29829
30167
|
const log2 = withType("publish/publish");
|
|
30168
|
+
console.warn(
|
|
30169
|
+
`${c11.yellow(
|
|
30170
|
+
"Warning:"
|
|
30171
|
+
)} jspm publish is experimental and should only be used for prototyping. Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are not provided for publishing on https://jspm.io/. For reliable package delivery, use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.`
|
|
30172
|
+
);
|
|
29830
30173
|
const { initProject: initProject2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
29831
30174
|
try {
|
|
29832
30175
|
const projectConfig = await initProject2({
|
|
@@ -33000,7 +33343,7 @@ generateOpts(
|
|
|
33000
33343
|
default: "dist"
|
|
33001
33344
|
}).option("--install", "Generate import map after build completes", {
|
|
33002
33345
|
default: true
|
|
33003
|
-
}),
|
|
33346
|
+
}).option("--hash-entries", "Hash entry point filenames in the output"),
|
|
33004
33347
|
true
|
|
33005
33348
|
)
|
|
33006
33349
|
).example(
|
|
@@ -33106,6 +33449,11 @@ Download the application package foo@bar into the folder foo, merging its import
|
|
|
33106
33449
|
|
|
33107
33450
|
Manages publishes to the JSPM providers, currently in experimental preview.
|
|
33108
33451
|
|
|
33452
|
+
WARNING: jspm publish is experimental and should only be used for prototyping.
|
|
33453
|
+
Unlike the https://ga.jspm.io/ CDN which is stable, reliability guarantees are
|
|
33454
|
+
not provided for publishing on https://jspm.io/. For reliable package delivery,
|
|
33455
|
+
use npm publish \u2014 all npm packages are available on the https://ga.jspm.io/ CDN.
|
|
33456
|
+
|
|
33109
33457
|
For publishing (default):
|
|
33110
33458
|
|
|
33111
33459
|
jspm publish
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jspm",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.4.0",
|
|
5
5
|
"description": "Import Map Package Manager",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/core": "^7.24.7",
|
|
20
|
-
"@jspm/generator": "^2.
|
|
20
|
+
"@jspm/generator": "^2.11.0",
|
|
21
21
|
"@jspm/plugin-rollup": "^1.2.4",
|
|
22
22
|
"ora": "^8.2.0",
|
|
23
23
|
"picocolors": "^1.1.1"
|