@lando/php 1.3.0 → 1.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.
Files changed (86) hide show
  1. package/.lando.yml +19 -9
  2. package/.nyc_output/processinfo/f05431a6-4424-40ba-9a42-3a54b790a1bc.json +1 -0
  3. package/.nyc_output/processinfo/fc61a4ce-cfd4-410a-a9a6-4942c26f55a2.json +1 -0
  4. package/.nyc_output/processinfo/index.json +1 -1
  5. package/CHANGELOG.md +33 -14
  6. package/README.md +5 -0
  7. package/builders/php.js +5 -7
  8. package/coverage/index.html +1 -1
  9. package/images/5.6-apache/Dockerfile +7 -2
  10. package/images/5.6-fpm/Dockerfile +7 -2
  11. package/images/7.0-apache/Dockerfile +7 -2
  12. package/images/7.0-fpm/Dockerfile +7 -2
  13. package/images/7.1-apache/Dockerfile +8 -8
  14. package/images/7.1-fpm/Dockerfile +8 -8
  15. package/images/7.2-apache/Dockerfile +9 -9
  16. package/images/7.2-fpm/Dockerfile +9 -9
  17. package/images/7.3-apache/Dockerfile +2 -6
  18. package/images/7.3-fpm/Dockerfile +2 -6
  19. package/images/7.4-apache/Dockerfile +2 -6
  20. package/images/7.4-fpm/Dockerfile +2 -6
  21. package/images/8.0-apache/Dockerfile +2 -6
  22. package/images/8.0-fpm/Dockerfile +2 -6
  23. package/images/8.1-apache/Dockerfile +2 -6
  24. package/images/8.1-fpm/Dockerfile +2 -6
  25. package/images/8.2-apache/Dockerfile +2 -6
  26. package/images/8.2-fpm/Dockerfile +2 -6
  27. package/images/8.3-apache/Dockerfile +2 -6
  28. package/images/8.3-fpm/Dockerfile +2 -6
  29. package/netlify.toml +15 -8
  30. package/node_modules/@lando/nginx/.eslintignore +3 -2
  31. package/node_modules/@lando/nginx/.lando.yml +20 -10
  32. package/node_modules/@lando/nginx/.node-version +1 -1
  33. package/node_modules/@lando/nginx/CHANGELOG.md +40 -19
  34. package/node_modules/@lando/nginx/README.md +6 -0
  35. package/node_modules/@lando/nginx/builders/nginx.js +17 -18
  36. package/node_modules/@lando/nginx/config/launch.sh +8 -2
  37. package/node_modules/@lando/nginx/netlify.toml +28 -6
  38. package/node_modules/@lando/nginx/package.json +21 -14
  39. package/node_modules/@lando/nginx/scripts/install-render-template.sh +47 -0
  40. package/node_modules/@lando/nginx/tmpfile +0 -0
  41. package/node_modules/@lando/nginx/utils/add-build-step.js +14 -0
  42. package/node_modules/semver/README.md +49 -32
  43. package/node_modules/semver/bin/semver.js +5 -14
  44. package/node_modules/semver/classes/range.js +28 -13
  45. package/node_modules/semver/classes/semver.js +1 -1
  46. package/node_modules/semver/functions/coerce.js +13 -5
  47. package/node_modules/semver/internal/lrucache.js +40 -0
  48. package/node_modules/semver/internal/re.js +7 -2
  49. package/node_modules/semver/package.json +8 -18
  50. package/package.json +11 -10
  51. package/.nyc_output/processinfo/82ec8255-1dc4-4066-ab80-acce72694169.json +0 -1
  52. package/.nyc_output/processinfo/8d0211c6-0d44-418c-8bdb-310f5379ce84.json +0 -1
  53. package/images/5.3-apache/Dockerfile +0 -83
  54. package/images/5.3-apache/apache2.conf +0 -64
  55. package/images/5.3-fpm/Dockerfile +0 -80
  56. package/images/5.3-fpm/docker-php-ext-enable +0 -83
  57. package/images/5.3-fpm/php-fpm.conf +0 -65
  58. package/images/5.4-apache/Dockerfile +0 -79
  59. package/images/5.4-apache/apache2-foreground +0 -17
  60. package/images/5.4-fpm/Dockerfile +0 -75
  61. package/images/5.5-apache/Dockerfile +0 -77
  62. package/images/5.5-fpm/Dockerfile +0 -76
  63. package/node_modules/@lando/nginx/.nyc_output/68963536-315a-41b5-9dda-1c3f30fb9c99.json +0 -1
  64. package/node_modules/@lando/nginx/.nyc_output/e965c931-7444-4e4e-8bc1-c51f696e4cfe.json +0 -1
  65. package/node_modules/@lando/nginx/.nyc_output/processinfo/68963536-315a-41b5-9dda-1c3f30fb9c99.json +0 -1
  66. package/node_modules/@lando/nginx/.nyc_output/processinfo/e965c931-7444-4e4e-8bc1-c51f696e4cfe.json +0 -1
  67. package/node_modules/@lando/nginx/.nyc_output/processinfo/index.json +0 -1
  68. package/node_modules/@lando/nginx/coverage/base.css +0 -224
  69. package/node_modules/@lando/nginx/coverage/block-navigation.js +0 -87
  70. package/node_modules/@lando/nginx/coverage/favicon.png +0 -0
  71. package/node_modules/@lando/nginx/coverage/index.html +0 -101
  72. package/node_modules/@lando/nginx/coverage/prettify.css +0 -1
  73. package/node_modules/@lando/nginx/coverage/prettify.js +0 -2
  74. package/node_modules/@lando/nginx/coverage/sort-arrow-sprite.png +0 -0
  75. package/node_modules/@lando/nginx/coverage/sorter.js +0 -196
  76. package/node_modules/semver/node_modules/lru-cache/LICENSE +0 -15
  77. package/node_modules/semver/node_modules/lru-cache/README.md +0 -166
  78. package/node_modules/semver/node_modules/lru-cache/index.js +0 -334
  79. package/node_modules/semver/node_modules/lru-cache/package.json +0 -34
  80. package/node_modules/semver/node_modules/yallist/LICENSE +0 -15
  81. package/node_modules/semver/node_modules/yallist/README.md +0 -204
  82. package/node_modules/semver/node_modules/yallist/iterator.js +0 -8
  83. package/node_modules/semver/node_modules/yallist/package.json +0 -29
  84. package/node_modules/semver/node_modules/yallist/yallist.js +0 -426
  85. /package/.nyc_output/{82ec8255-1dc4-4066-ab80-acce72694169.json → f05431a6-4424-40ba-9a42-3a54b790a1bc.json} +0 -0
  86. /package/.nyc_output/{8d0211c6-0d44-418c-8bdb-310f5379ce84.json → fc61a4ce-cfd4-410a-a9a6-4942c26f55a2.json} +0 -0
@@ -25,7 +25,7 @@ semver.valid(semver.coerce('v2')) // '2.0.0'
25
25
  semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
26
26
  ```
27
27
 
28
- You can also just load the module for the function that you care about, if
28
+ You can also just load the module for the function that you care about if
29
29
  you'd like to minimize your footprint.
30
30
 
31
31
  ```js
@@ -78,8 +78,8 @@ const semverOutside = require('semver/ranges/outside')
78
78
  const semverGtr = require('semver/ranges/gtr')
79
79
  const semverLtr = require('semver/ranges/ltr')
80
80
  const semverIntersects = require('semver/ranges/intersects')
81
- const simplifyRange = require('semver/ranges/simplify')
82
- const rangeSubset = require('semver/ranges/subset')
81
+ const semverSimplifyRange = require('semver/ranges/simplify')
82
+ const semverRangeSubset = require('semver/ranges/subset')
83
83
  ```
84
84
 
85
85
  As a command-line utility:
@@ -144,7 +144,7 @@ A leading `"="` or `"v"` character is stripped off and ignored.
144
144
 
145
145
  ## Ranges
146
146
 
147
- A `version range` is a set of `comparators` which specify versions
147
+ A `version range` is a set of `comparators` that specify versions
148
148
  that satisfy the range.
149
149
 
150
150
  A `comparator` is composed of an `operator` and a `version`. The set
@@ -155,7 +155,7 @@ of primitive `operators` is:
155
155
  * `>` Greater than
156
156
  * `>=` Greater than or equal to
157
157
  * `=` Equal. If no operator is specified, then equality is assumed,
158
- so this operator is optional, but MAY be included.
158
+ so this operator is optional but MAY be included.
159
159
 
160
160
  For example, the comparator `>=1.2.7` would match the versions
161
161
  `1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
@@ -189,26 +189,26 @@ For example, the range `>1.2.3-alpha.3` would be allowed to match the
189
189
  version `1.2.3-alpha.7`, but it would *not* be satisfied by
190
190
  `3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
191
191
  than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
192
- range only accepts prerelease tags on the `1.2.3` version. The
193
- version `3.4.5` *would* satisfy the range, because it does not have a
192
+ range only accepts prerelease tags on the `1.2.3` version.
193
+ Version `3.4.5` *would* satisfy the range because it does not have a
194
194
  prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
195
195
 
196
- The purpose for this behavior is twofold. First, prerelease versions
196
+ The purpose of this behavior is twofold. First, prerelease versions
197
197
  frequently are updated very quickly, and contain many breaking changes
198
198
  that are (by the author's design) not yet fit for public consumption.
199
- Therefore, by default, they are excluded from range matching
199
+ Therefore, by default, they are excluded from range-matching
200
200
  semantics.
201
201
 
202
202
  Second, a user who has opted into using a prerelease version has
203
- clearly indicated the intent to use *that specific* set of
203
+ indicated the intent to use *that specific* set of
204
204
  alpha/beta/rc versions. By including a prerelease tag in the range,
205
205
  the user is indicating that they are aware of the risk. However, it
206
206
  is still not appropriate to assume that they have opted into taking a
207
207
  similar risk on the *next* set of prerelease versions.
208
208
 
209
209
  Note that this behavior can be suppressed (treating all prerelease
210
- versions as if they were normal versions, for the purpose of range
211
- matching) by setting the `includePrerelease` flag on the options
210
+ versions as if they were normal versions, for range-matching)
211
+ by setting the `includePrerelease` flag on the options
212
212
  object to any
213
213
  [functions](https://github.com/npm/node-semver#functions) that do
214
214
  range matching.
@@ -401,12 +401,12 @@ All methods and classes take a final `options` object argument. All
401
401
  options in this object are `false` by default. The options supported
402
402
  are:
403
403
 
404
- - `loose` Be more forgiving about not-quite-valid semver strings.
404
+ - `loose`: Be more forgiving about not-quite-valid semver strings.
405
405
  (Any resulting output will always be 100% strict compliant, of
406
406
  course.) For backwards compatibility reasons, if the `options`
407
407
  argument is a boolean value instead of an object, it is interpreted
408
408
  to be the `loose` param.
409
- - `includePrerelease` Set to suppress the [default
409
+ - `includePrerelease`: Set to suppress the [default
410
410
  behavior](https://github.com/npm/node-semver#prerelease-tags) of
411
411
  excluding prerelease tagged versions from ranges unless they are
412
412
  explicitly opted into.
@@ -415,16 +415,20 @@ Strict-mode Comparators and Ranges will be strict about the SemVer
415
415
  strings that they parse.
416
416
 
417
417
  * `valid(v)`: Return the parsed version, or null if it's not valid.
418
- * `inc(v, release)`: Return the version incremented by the release
419
- type (`major`, `premajor`, `minor`, `preminor`, `patch`,
418
+ * `inc(v, release, options, identifier, identifierBase)`:
419
+ Return the version incremented by the release
420
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
420
421
  `prepatch`, or `prerelease`), or null if it's not valid
421
422
  * `premajor` in one call will bump the version up to the next major
422
423
  version and down to a prerelease of that major version.
423
424
  `preminor`, and `prepatch` work the same way.
424
- * If called from a non-prerelease version, the `prerelease` will work the
425
- same as `prepatch`. It increments the patch version, then makes a
425
+ * If called from a non-prerelease version, `prerelease` will work the
426
+ same as `prepatch`. It increments the patch version and then makes a
426
427
  prerelease. If the input version is already a prerelease it simply
427
428
  increments it.
429
+ * `identifier` can be used to prefix `premajor`, `preminor`,
430
+ `prepatch`, or `prerelease` version increments. `identifierBase`
431
+ is the base to be used for the `prerelease` identifier.
428
432
  * `prerelease(v)`: Returns an array of prerelease components, or null
429
433
  if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
430
434
  * `major(v)`: Return the major version number.
@@ -442,7 +446,7 @@ strings that they parse.
442
446
  * `lt(v1, v2)`: `v1 < v2`
443
447
  * `lte(v1, v2)`: `v1 <= v2`
444
448
  * `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
445
- even if they're not the exact same string. You already know how to
449
+ even if they're not the same string. You already know how to
446
450
  compare strings.
447
451
  * `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
448
452
  * `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
@@ -451,15 +455,22 @@ strings that they parse.
451
455
  invalid comparison string is provided.
452
456
  * `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
453
457
  `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
454
- * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
458
+ * `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions
455
459
  in descending order when passed to `Array.sort()`.
456
460
  * `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
457
461
  are equal. Sorts in ascending order if passed to `Array.sort()`.
458
- `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
459
- * `diff(v1, v2)`: Returns difference between two versions by the release type
462
+ * `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
463
+ * `diff(v1, v2)`: Returns the difference between two versions by the release type
460
464
  (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
461
465
  or null if the versions are the same.
462
466
 
467
+ ### Sorting
468
+
469
+ * `sort(versions)`: Returns a sorted array of versions based on the `compareBuild`
470
+ function.
471
+ * `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
472
+ the `compareBuild` function in descending order.
473
+
463
474
  ### Comparators
464
475
 
465
476
  * `intersects(comparator)`: Return true if the comparators intersect
@@ -473,19 +484,19 @@ strings that they parse.
473
484
  that satisfies the range, or `null` if none of them do.
474
485
  * `minSatisfying(versions, range)`: Return the lowest version in the list
475
486
  that satisfies the range, or `null` if none of them do.
476
- * `minVersion(range)`: Return the lowest version that can possibly match
487
+ * `minVersion(range)`: Return the lowest version that can match
477
488
  the given range.
478
- * `gtr(version, range)`: Return `true` if version is greater than all the
489
+ * `gtr(version, range)`: Return `true` if the version is greater than all the
479
490
  versions possible in the range.
480
- * `ltr(version, range)`: Return `true` if version is less than all the
491
+ * `ltr(version, range)`: Return `true` if the version is less than all the
481
492
  versions possible in the range.
482
493
  * `outside(version, range, hilo)`: Return true if the version is outside
483
494
  the bounds of the range in either the high or low direction. The
484
495
  `hilo` argument must be either the string `'>'` or `'<'`. (This is
485
496
  the function called by `gtr` and `ltr`.)
486
- * `intersects(range)`: Return true if any of the ranges comparators intersect
497
+ * `intersects(range)`: Return true if any of the range comparators intersect.
487
498
  * `simplifyRange(versions, range)`: Return a "simplified" range that
488
- matches the same items in `versions` list as the range specified. Note
499
+ matches the same items in the `versions` list as the range specified. Note
489
500
  that it does *not* guarantee that it would match the same versions in all
490
501
  cases, only for the set of versions provided. This is useful when
491
502
  generating ranges by joining together multiple versions with `||`
@@ -498,7 +509,7 @@ strings that they parse.
498
509
  Note that, since ranges may be non-contiguous, a version might not be
499
510
  greater than a range, less than a range, *or* satisfy a range! For
500
511
  example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
501
- until `2.0.0`, so the version `1.2.10` would not be greater than the
512
+ until `2.0.0`, so version `1.2.10` would not be greater than the
502
513
  range (because `2.0.1` satisfies, which is higher), nor less than the
503
514
  range (since `1.2.8` satisfies, which is lower), and it also does not
504
515
  satisfy the range.
@@ -511,13 +522,13 @@ range, use the `satisfies(version, range)` function.
511
522
  * `coerce(version, options)`: Coerces a string to semver if possible
512
523
 
513
524
  This aims to provide a very forgiving translation of a non-semver string to
514
- semver. It looks for the first digit in a string, and consumes all
525
+ semver. It looks for the first digit in a string and consumes all
515
526
  remaining characters which satisfy at least a partial semver (e.g., `1`,
516
527
  `1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
517
528
  versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
518
529
  surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
519
530
  `3.4.0`). Only text which lacks digits will fail coercion (`version one`
520
- is not valid). The maximum length for any semver component considered for
531
+ is not valid). The maximum length for any semver component considered for
521
532
  coercion is 16 characters; longer components will be ignored
522
533
  (`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
523
534
  semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
@@ -529,6 +540,10 @@ tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
529
540
  `4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
530
541
  any other overlapping SemVer tuple.
531
542
 
543
+ If the `options.includePrerelease` flag is set, then the `coerce` result will contain
544
+ prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2`
545
+ will preserve prerelease `rc.1` and build `rev.2` in the result.
546
+
532
547
  ### Clean
533
548
 
534
549
  * `clean(version)`: Clean a string to be a valid semver if possible
@@ -543,7 +558,7 @@ ex.
543
558
  * `s.clean(' = v 2.1.5-foo')`: `null`
544
559
  * `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
545
560
  * `s.clean('=v2.1.5')`: `'2.1.5'`
546
- * `s.clean(' =v2.1.5')`: `2.1.5`
561
+ * `s.clean(' =v2.1.5')`: `'2.1.5'`
547
562
  * `s.clean(' 2.1.5 ')`: `'2.1.5'`
548
563
  * `s.clean('~1.0.0')`: `null`
549
564
 
@@ -589,7 +604,7 @@ eg), and then pull the module name into the documentation for that specific
589
604
  thing.
590
605
  -->
591
606
 
592
- You may pull in just the part of this semver utility that you need, if you
607
+ You may pull in just the part of this semver utility that you need if you
593
608
  are sensitive to packing and tree-shaking concerns. The main
594
609
  `require('semver')` export uses getter functions to lazily load the parts
595
610
  of the API that are used.
@@ -632,6 +647,8 @@ The following modules are available:
632
647
  * `require('semver/ranges/min-satisfying')`
633
648
  * `require('semver/ranges/min-version')`
634
649
  * `require('semver/ranges/outside')`
650
+ * `require('semver/ranges/simplify')`
651
+ * `require('semver/ranges/subset')`
635
652
  * `require('semver/ranges/to-comparators')`
636
653
  * `require('semver/ranges/valid')`
637
654
 
@@ -119,7 +119,11 @@ const main = () => {
119
119
  return fail()
120
120
  }
121
121
  }
122
- return success(versions)
122
+ versions
123
+ .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
124
+ .map(v => semver.clean(v, options))
125
+ .map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v)
126
+ .forEach(v => console.log(v))
123
127
  }
124
128
 
125
129
  const failInc = () => {
@@ -129,19 +133,6 @@ const failInc = () => {
129
133
 
130
134
  const fail = () => process.exit(1)
131
135
 
132
- const success = () => {
133
- const compare = reverse ? 'rcompare' : 'compare'
134
- versions.sort((a, b) => {
135
- return semver[compare](a, b, options)
136
- }).map((v) => {
137
- return semver.clean(v, options)
138
- }).map((v) => {
139
- return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v
140
- }).forEach((v, i, _) => {
141
- console.log(v)
142
- })
143
- }
144
-
145
136
  const help = () => console.log(
146
137
  `SemVer ${version}
147
138
 
@@ -1,3 +1,5 @@
1
+ const SPACE_CHARACTERS = /\s+/g
2
+
1
3
  // hoisted class for cyclic dependency
2
4
  class Range {
3
5
  constructor (range, options) {
@@ -18,7 +20,7 @@ class Range {
18
20
  // just put it in the set and return
19
21
  this.raw = range.value
20
22
  this.set = [[range]]
21
- this.format()
23
+ this.formatted = undefined
22
24
  return this
23
25
  }
24
26
 
@@ -29,10 +31,7 @@ class Range {
29
31
  // First reduce all whitespace as much as possible so we do not have to rely
30
32
  // on potentially slow regexes like \s*. This is then stored and used for
31
33
  // future error messages as well.
32
- this.raw = range
33
- .trim()
34
- .split(/\s+/)
35
- .join(' ')
34
+ this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
36
35
 
37
36
  // First, split on ||
38
37
  this.set = this.raw
@@ -66,14 +65,29 @@ class Range {
66
65
  }
67
66
  }
68
67
 
69
- this.format()
68
+ this.formatted = undefined
69
+ }
70
+
71
+ get range () {
72
+ if (this.formatted === undefined) {
73
+ this.formatted = ''
74
+ for (let i = 0; i < this.set.length; i++) {
75
+ if (i > 0) {
76
+ this.formatted += '||'
77
+ }
78
+ const comps = this.set[i]
79
+ for (let k = 0; k < comps.length; k++) {
80
+ if (k > 0) {
81
+ this.formatted += ' '
82
+ }
83
+ this.formatted += comps[k].toString().trim()
84
+ }
85
+ }
86
+ }
87
+ return this.formatted
70
88
  }
71
89
 
72
90
  format () {
73
- this.range = this.set
74
- .map((comps) => comps.join(' ').trim())
75
- .join('||')
76
- .trim()
77
91
  return this.range
78
92
  }
79
93
 
@@ -198,8 +212,8 @@ class Range {
198
212
 
199
213
  module.exports = Range
200
214
 
201
- const LRU = require('lru-cache')
202
- const cache = new LRU({ max: 1000 })
215
+ const LRU = require('../internal/lrucache')
216
+ const cache = new LRU()
203
217
 
204
218
  const parseOptions = require('../internal/parse-options')
205
219
  const Comparator = require('./comparator')
@@ -470,9 +484,10 @@ const replaceGTE0 = (comp, options) => {
470
484
  // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
471
485
  // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
472
486
  // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
487
+ // TODO build?
473
488
  const hyphenReplace = incPr => ($0,
474
489
  from, fM, fm, fp, fpr, fb,
475
- to, tM, tm, tp, tpr, tb) => {
490
+ to, tM, tm, tp, tpr) => {
476
491
  if (isX(fM)) {
477
492
  from = ''
478
493
  } else if (isX(fm)) {
@@ -158,7 +158,7 @@ class SemVer {
158
158
  do {
159
159
  const a = this.build[i]
160
160
  const b = other.build[i]
161
- debug('prerelease compare', i, a, b)
161
+ debug('build compare', i, a, b)
162
162
  if (a === undefined && b === undefined) {
163
163
  return 0
164
164
  } else if (b === undefined) {
@@ -19,34 +19,42 @@ const coerce = (version, options) => {
19
19
 
20
20
  let match = null
21
21
  if (!options.rtl) {
22
- match = version.match(re[t.COERCE])
22
+ match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
23
23
  } else {
24
24
  // Find the right-most coercible string that does not share
25
25
  // a terminus with a more left-ward coercible string.
26
26
  // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
27
+ // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
27
28
  //
28
29
  // Walk through the string checking with a /g regexp
29
30
  // Manually set the index so as to pick up overlapping matches.
30
31
  // Stop when we get a match that ends at the string end, since no
31
32
  // coercible string can be more right-ward without the same terminus.
33
+ const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
32
34
  let next
33
- while ((next = re[t.COERCERTL].exec(version)) &&
35
+ while ((next = coerceRtlRegex.exec(version)) &&
34
36
  (!match || match.index + match[0].length !== version.length)
35
37
  ) {
36
38
  if (!match ||
37
39
  next.index + next[0].length !== match.index + match[0].length) {
38
40
  match = next
39
41
  }
40
- re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
42
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
41
43
  }
42
44
  // leave it in a clean state
43
- re[t.COERCERTL].lastIndex = -1
45
+ coerceRtlRegex.lastIndex = -1
44
46
  }
45
47
 
46
48
  if (match === null) {
47
49
  return null
48
50
  }
49
51
 
50
- return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
52
+ const major = match[2]
53
+ const minor = match[3] || '0'
54
+ const patch = match[4] || '0'
55
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
56
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
57
+
58
+ return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
51
59
  }
52
60
  module.exports = coerce
@@ -0,0 +1,40 @@
1
+ class LRUCache {
2
+ constructor () {
3
+ this.max = 1000
4
+ this.map = new Map()
5
+ }
6
+
7
+ get (key) {
8
+ const value = this.map.get(key)
9
+ if (value === undefined) {
10
+ return undefined
11
+ } else {
12
+ // Remove the key from the map and add it to the end
13
+ this.map.delete(key)
14
+ this.map.set(key, value)
15
+ return value
16
+ }
17
+ }
18
+
19
+ delete (key) {
20
+ return this.map.delete(key)
21
+ }
22
+
23
+ set (key, value) {
24
+ const deleted = this.delete(key)
25
+
26
+ if (!deleted && value !== undefined) {
27
+ // If cache is full, delete the least recently used item
28
+ if (this.map.size >= this.max) {
29
+ const firstKey = this.map.keys().next().value
30
+ this.delete(firstKey)
31
+ }
32
+
33
+ this.map.set(key, value)
34
+ }
35
+
36
+ return this
37
+ }
38
+ }
39
+
40
+ module.exports = LRUCache
@@ -154,12 +154,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
154
154
 
155
155
  // Coercion.
156
156
  // Extract anything that could conceivably be a part of a valid semver
157
- createToken('COERCE', `${'(^|[^\\d])' +
157
+ createToken('COERCEPLAIN', `${'(^|[^\\d])' +
158
158
  '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
159
159
  `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
160
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
160
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
161
+ createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
162
+ createToken('COERCEFULL', src[t.COERCEPLAIN] +
163
+ `(?:${src[t.PRERELEASE]})?` +
164
+ `(?:${src[t.BUILD]})?` +
161
165
  `(?:$|[^\\d])`)
162
166
  createToken('COERCERTL', src[t.COERCE], true)
167
+ createToken('COERCERTLFULL', src[t.COERCEFULL], true)
163
168
 
164
169
  // Tilde ranges.
165
170
  // Meaning is "reasonably at or greater than"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.5.4",
3
+ "version": "7.6.3",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "tap",
8
8
  "snap": "tap",
9
- "lint": "eslint \"**/*.js\"",
9
+ "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
10
10
  "postlint": "template-oss-check",
11
11
  "lintfix": "npm run lint -- --fix",
12
12
  "posttest": "npm run lint",
@@ -14,13 +14,14 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@npmcli/eslint-config": "^4.0.0",
17
- "@npmcli/template-oss": "4.17.0",
17
+ "@npmcli/template-oss": "4.22.0",
18
+ "benchmark": "^2.1.4",
18
19
  "tap": "^16.0.0"
19
20
  },
20
21
  "license": "ISC",
21
22
  "repository": {
22
23
  "type": "git",
23
- "url": "https://github.com/npm/node-semver.git"
24
+ "url": "git+https://github.com/npm/node-semver.git"
24
25
  },
25
26
  "bin": {
26
27
  "semver": "bin/semver.js"
@@ -47,23 +48,11 @@
47
48
  "engines": {
48
49
  "node": ">=10"
49
50
  },
50
- "dependencies": {
51
- "lru-cache": "^6.0.0"
52
- },
53
51
  "author": "GitHub Inc.",
54
52
  "templateOSS": {
55
53
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
56
- "version": "4.17.0",
54
+ "version": "4.22.0",
57
55
  "engines": ">=10",
58
- "ciVersions": [
59
- "10.0.0",
60
- "10.x",
61
- "12.x",
62
- "14.x",
63
- "16.x",
64
- "18.x"
65
- ],
66
- "npmSpec": "8",
67
56
  "distPaths": [
68
57
  "classes/",
69
58
  "functions/",
@@ -80,7 +69,8 @@
80
69
  "/ranges/",
81
70
  "/index.js",
82
71
  "/preload.js",
83
- "/range.bnf"
72
+ "/range.bnf",
73
+ "/benchmarks"
84
74
  ],
85
75
  "publish": "true"
86
76
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lando/php",
3
3
  "description": "A Lando plugin that provides a tight integration with PHP.",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "author": "Mike Pirog @pirog",
6
6
  "license": "GPL-3.0",
7
7
  "repository": "lando/php",
@@ -33,8 +33,9 @@
33
33
  },
34
34
  "scripts": {
35
35
  "coverage": "nyc report --reporter=text-lcov | coveralls",
36
- "docs:dev": "vitepress dev docs",
37
- "docs:build": "vitepress build docs",
36
+ "docs:build": "LANDO_MVB_VERSION=$(git describe --tags --always --abbrev=1 --match=\"v[0-9].*\") vitepress build docs",
37
+ "docs:dev": "LANDO_MVB_VERSION=$(git describe --tags --always --abbrev=1 --match=\"v[0-9].*\") vitepress dev docs",
38
+ "docs:mvb": "npx mvb docs",
38
39
  "docs:preview": "vitepress preview docs",
39
40
  "lint": "eslint . --ext .js --ext .mjs ",
40
41
  "test:unit": "nyc --reporter=html --reporter=text mocha --timeout 5000 test/**/*.spec.js",
@@ -42,14 +43,14 @@
42
43
  "test": "npm run lint && npm run test:unit"
43
44
  },
44
45
  "dependencies": {
45
- "@lando/nginx": "0.11.0",
46
+ "@lando/nginx": "^1.3.0",
46
47
  "lodash": "^4.17.21",
47
48
  "semver": "^7.3.7"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@babel/eslint-parser": "^7.16.0",
51
52
  "@lando/leia": "0.6.5",
52
- "@lando/vitepress-theme-default-plus": "^1.0.0-beta.40",
53
+ "@lando/vitepress-theme-default-plus": "^1.1.0-beta.14",
53
54
  "chai": "^4.3.4",
54
55
  "command-line-test": "^1.0.10",
55
56
  "eslint": "^7.32.0",
@@ -57,7 +58,7 @@
57
58
  "eslint-plugin-vue": "^8.0.3",
58
59
  "mocha": "^9.1.2",
59
60
  "nyc": "^15.1.0",
60
- "vitepress": "^1.0.0-rc.42"
61
+ "vitepress": "^1.3.4"
61
62
  },
62
63
  "bundledDependencies": [
63
64
  "@lando/nginx",
@@ -65,9 +66,9 @@
65
66
  "semver"
66
67
  ],
67
68
  "dist": {
68
- "integrity": "sha512-FJEYOtGzfSqNVjxScAAb10R5d1GS9rXqPBMHyPfkKVNIphq0fsNRLMbd1AIBU5qfRK3AbgLhg+Lj/ZdyGKn9CQ==",
69
- "shasum": "97d58bacee603508470c4fd4a1d29bdd49162bd8",
70
- "filename": "lando-php-1.3.0.tgz",
71
- "unpackedSize": 3238743
69
+ "integrity": "sha512-Rt543sjef998XIX6eqZfccai27x8atbyO2fQwdXzxFlhaLiKGpwLygEwqrL9rBzI6wgXegwAD9HIInsXjnRKkQ==",
70
+ "shasum": "b78816b6c75fbb3f6ba56be871599f8ad1298e27",
71
+ "filename": "lando-php-1.4.0.tgz",
72
+ "unpackedSize": 3156753
72
73
  }
73
74
  }
@@ -1 +0,0 @@
1
- {"parent":null,"pid":1904,"argv":["/opt/hostedtoolcache/node/18.19.1/x64/bin/node","/home/runner/work/php/php/node_modules/.bin/mocha","--timeout","5000","test/**/*.spec.js"],"execArgv":[],"cwd":"/home/runner/work/php/php","time":1710179825467,"ppid":1893,"coverageFilename":"/home/runner/work/php/php/.nyc_output/82ec8255-1dc4-4066-ab80-acce72694169.json","externalId":"","uuid":"82ec8255-1dc4-4066-ab80-acce72694169","files":[]}
@@ -1 +0,0 @@
1
- {"parent":null,"pid":1893,"argv":["/opt/hostedtoolcache/node/18.19.1/x64/bin/node","/home/runner/work/php/php/node_modules/.bin/nyc","--reporter=html","--reporter=text","mocha","--timeout","5000","test/**/*.spec.js"],"execArgv":[],"cwd":"/home/runner/work/php/php","time":1710179825256,"ppid":1892,"coverageFilename":"/home/runner/work/php/php/.nyc_output/8d0211c6-0d44-418c-8bdb-310f5379ce84.json","externalId":"","uuid":"8d0211c6-0d44-418c-8bdb-310f5379ce84","files":[]}