@lando/drupal 1.12.0 → 1.13.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 (120) hide show
  1. package/.lando.yml +1 -2
  2. package/CHANGELOG.md +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +20 -27
  5. package/builders/_drupaly.js +26 -19
  6. package/builders/drupal-mariadb.js +1 -1
  7. package/builders/drupal-mssql.js +1 -1
  8. package/builders/drupal-mysql.js +7 -1
  9. package/builders/drupal-nginx.js +1 -1
  10. package/builders/drupal-php.js +1 -3
  11. package/builders/drupal-postgres.js +1 -1
  12. package/config/drupal11/mysql8.cnf +44 -92
  13. package/inits/drupal10.js +5 -0
  14. package/inits/drupal11.js +7 -0
  15. package/inits/drupal6.js +4 -0
  16. package/inits/drupal7.js +3 -0
  17. package/inits/drupal8.js +3 -0
  18. package/inits/drupal9.js +5 -0
  19. package/node_modules/@lando/mariadb/.lando.yml +1 -1
  20. package/node_modules/@lando/mariadb/.node-version +1 -1
  21. package/node_modules/@lando/mariadb/CHANGELOG.md +8 -1
  22. package/node_modules/@lando/mariadb/LICENSE +21 -0
  23. package/node_modules/@lando/mariadb/README.md +5 -2
  24. package/node_modules/@lando/mariadb/builders/mariadb.js +25 -22
  25. package/node_modules/@lando/mariadb/netlify.toml +9 -2
  26. package/node_modules/@lando/mariadb/package.json +8 -8
  27. package/node_modules/@lando/mysql/.lando.yml +1 -1
  28. package/node_modules/@lando/mysql/CHANGELOG.md +5 -0
  29. package/node_modules/@lando/mysql/LICENSE +21 -0
  30. package/node_modules/@lando/mysql/README.md +5 -2
  31. package/node_modules/@lando/mysql/builders/mysql.js +9 -5
  32. package/node_modules/@lando/mysql/netlify.toml +9 -0
  33. package/node_modules/@lando/mysql/package.json +8 -8
  34. package/node_modules/@lando/php/.lando.yml +1 -1
  35. package/node_modules/@lando/php/CHANGELOG.md +6 -0
  36. package/node_modules/@lando/php/LICENSE +21 -0
  37. package/node_modules/@lando/php/README.md +5 -2
  38. package/node_modules/@lando/php/builders/php.js +0 -7
  39. package/node_modules/@lando/php/netlify.toml +9 -0
  40. package/node_modules/@lando/php/node_modules/@lando/nginx/.lando.yml +1 -1
  41. package/node_modules/@lando/php/node_modules/@lando/nginx/.node-version +1 -1
  42. package/node_modules/@lando/php/node_modules/@lando/nginx/CHANGELOG.md +9 -1
  43. package/node_modules/@lando/php/node_modules/@lando/nginx/LICENSE +21 -0
  44. package/node_modules/@lando/php/node_modules/@lando/nginx/README.md +5 -2
  45. package/node_modules/@lando/php/node_modules/@lando/nginx/builders/nginx.js +34 -15
  46. package/node_modules/@lando/php/node_modules/@lando/nginx/netlify.toml +9 -4
  47. package/node_modules/@lando/php/node_modules/@lando/nginx/package.json +8 -8
  48. package/node_modules/@lando/php/package.json +10 -10
  49. package/node_modules/@lando/postgres/.lando.yml +1 -1
  50. package/node_modules/@lando/postgres/CHANGELOG.md +11 -0
  51. package/node_modules/@lando/postgres/LICENSE +21 -0
  52. package/node_modules/@lando/postgres/README.md +5 -2
  53. package/node_modules/@lando/postgres/builders/postgres.js +9 -9
  54. package/node_modules/@lando/postgres/netlify.toml +9 -4
  55. package/node_modules/@lando/postgres/package.json +8 -8
  56. package/node_modules/semver/README.md +14 -4
  57. package/node_modules/semver/bin/semver.js +4 -1
  58. package/node_modules/semver/classes/comparator.js +2 -0
  59. package/node_modules/semver/classes/index.js +2 -0
  60. package/node_modules/semver/classes/range.js +2 -0
  61. package/node_modules/semver/classes/semver.js +22 -5
  62. package/node_modules/semver/functions/clean.js +2 -0
  63. package/node_modules/semver/functions/cmp.js +2 -0
  64. package/node_modules/semver/functions/coerce.js +2 -0
  65. package/node_modules/semver/functions/compare-build.js +2 -0
  66. package/node_modules/semver/functions/compare-loose.js +2 -0
  67. package/node_modules/semver/functions/compare.js +2 -0
  68. package/node_modules/semver/functions/diff.js +7 -12
  69. package/node_modules/semver/functions/eq.js +2 -0
  70. package/node_modules/semver/functions/gt.js +2 -0
  71. package/node_modules/semver/functions/gte.js +2 -0
  72. package/node_modules/semver/functions/inc.js +2 -0
  73. package/node_modules/semver/functions/lt.js +2 -0
  74. package/node_modules/semver/functions/lte.js +2 -0
  75. package/node_modules/semver/functions/major.js +2 -0
  76. package/node_modules/semver/functions/minor.js +2 -0
  77. package/node_modules/semver/functions/neq.js +2 -0
  78. package/node_modules/semver/functions/parse.js +2 -0
  79. package/node_modules/semver/functions/patch.js +2 -0
  80. package/node_modules/semver/functions/prerelease.js +2 -0
  81. package/node_modules/semver/functions/rcompare.js +2 -0
  82. package/node_modules/semver/functions/rsort.js +2 -0
  83. package/node_modules/semver/functions/satisfies.js +2 -0
  84. package/node_modules/semver/functions/sort.js +2 -0
  85. package/node_modules/semver/functions/valid.js +2 -0
  86. package/node_modules/semver/index.js +2 -0
  87. package/node_modules/semver/internal/constants.js +2 -0
  88. package/node_modules/semver/internal/debug.js +2 -0
  89. package/node_modules/semver/internal/identifiers.js +2 -0
  90. package/node_modules/semver/internal/lrucache.js +2 -0
  91. package/node_modules/semver/internal/parse-options.js +2 -0
  92. package/node_modules/semver/internal/re.js +10 -4
  93. package/node_modules/semver/package.json +8 -7
  94. package/node_modules/semver/preload.js +2 -0
  95. package/node_modules/semver/ranges/gtr.js +2 -0
  96. package/node_modules/semver/ranges/intersects.js +2 -0
  97. package/node_modules/semver/ranges/ltr.js +2 -0
  98. package/node_modules/semver/ranges/max-satisfying.js +2 -0
  99. package/node_modules/semver/ranges/min-satisfying.js +2 -0
  100. package/node_modules/semver/ranges/min-version.js +2 -0
  101. package/node_modules/semver/ranges/outside.js +2 -0
  102. package/node_modules/semver/ranges/simplify.js +2 -0
  103. package/node_modules/semver/ranges/subset.js +2 -0
  104. package/node_modules/semver/ranges/to-comparators.js +2 -0
  105. package/node_modules/semver/ranges/valid.js +2 -0
  106. package/package.json +13 -13
  107. package/LICENSE.md +0 -674
  108. package/PRIVACY.md +0 -169
  109. package/node_modules/@lando/mariadb/LICENSE.md +0 -674
  110. package/node_modules/@lando/mariadb/PRIVACY.md +0 -169
  111. package/node_modules/@lando/mariadb/tmpfile +0 -0
  112. package/node_modules/@lando/mysql/.tool-versions +0 -1
  113. package/node_modules/@lando/mysql/LICENSE.md +0 -674
  114. package/node_modules/@lando/mysql/PRIVACY.md +0 -169
  115. package/node_modules/@lando/php/LICENSE.md +0 -674
  116. package/node_modules/@lando/php/PRIVACY.md +0 -169
  117. package/node_modules/@lando/php/node_modules/@lando/nginx/LICENSE.md +0 -674
  118. package/node_modules/@lando/php/node_modules/@lando/nginx/PRIVACY.md +0 -169
  119. package/node_modules/@lando/postgres/LICENSE.md +0 -674
  120. package/node_modules/@lando/postgres/PRIVACY.md +0 -169
@@ -5,7 +5,7 @@ proxy:
5
5
  services:
6
6
  cli:
7
7
  api: 4
8
- image: node:18
8
+ image: node:20
9
9
  command: sleep infinity
10
10
  ports:
11
11
  - 5173:5173/http
@@ -1,5 +1,16 @@
1
1
  ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
2
2
 
3
+ ## v1.5.0 - [September 1, 2025](https://github.com/lando/postgres/releases/tag/v1.5.0)
4
+
5
+ * Switched images to [bitnamilegacy](https://github.com/bitnami/containers/issues/83267) namespace
6
+ * Updated `postgres:16` to `16.6.0`
7
+ * Updated `postgres:15` to `15.10.0`
8
+ * Updated `postgres:14` to `14.18.0`
9
+ * Updated `postgres:13` to `13.18.0`
10
+ * Updated `postgres:12` to `12.20.0`
11
+ * Updated `postgres:11` to `11.22.0`
12
+ * Updated `postgres:10` to `10.23.0`
13
+
3
14
  ## v1.4.4 - [December 7, 2024](https://github.com/lando/postgres/releases/tag/v1.4.4)
4
15
 
5
16
  * Optimized for `midcore`
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lando Alliance
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -49,5 +49,8 @@ Made with [contributors-img](https://contrib.rocks).
49
49
 
50
50
  ## Other Selected Resources
51
51
 
52
- * [LICENSE](https://github.com/lando/postgres/blob/main/LICENSE.md)
53
- * [The best professional advice ever](https://www.youtube.com/watch?v=tkBVDh7my9Q)
52
+ * [LICENSE](/LICENSE)
53
+ * [TERMS OF USE](https://docs.lando.dev/terms)
54
+ * [PRIVACY POLICY](https://docs.lando.dev/privacy)
55
+ * [CODE OF CONDUCT](https://docs.lando.dev/coc)
56
+
@@ -13,14 +13,14 @@ module.exports = {
13
13
  version: '10',
14
14
  supported: ['16', '15', '14', '13', '12', '11', '11.1', '11.0', '10', '10.6.0', '9.6'],
15
15
  pinPairs: {
16
- '16': 'bitnami/postgresql:16.2.0-debian-12-r8',
17
- '15': 'bitnami/postgresql:15.2.0-debian-11-r26',
18
- '14': 'bitnami/postgresql:14.1.0-debian-10-r9',
19
- '13': 'bitnami/postgresql:13.5.0-debian-10-r9',
20
- '12': 'bitnami/postgresql:12.9.0-debian-10-r9',
21
- '11': 'bitnami/postgresql:11.14.0-debian-10-r9',
22
- '10': 'bitnami/postgresql:10.19.0-debian-10-r9',
23
- '9.6': 'bitnami/postgresql:9.6.24-debian-10-r9',
16
+ '16': 'bitnamilegacy/postgresql:16.6.0-debian-12-r2',
17
+ '15': 'bitnamilegacy/postgresql:15.10.0-debian-12-r2',
18
+ '14': 'bitnamilegacy/postgresql:14.18.0-debian-12-r0',
19
+ '13': 'bitnamilegacy/postgresql:13.18.0-debian-12-r2',
20
+ '12': 'bitnamilegacy/postgresql:12.20.0-debian-12-r26',
21
+ '11': 'bitnamilegacy/postgresql:11.22.0-debian-11-r4',
22
+ '10': 'bitnamilegacy/postgresql:10.23.0-debian-11-r3',
23
+ '9.6': 'bitnamilegacy/postgresql:9.6.24',
24
24
  },
25
25
  patchesSupported: true,
26
26
  confSrc: path.resolve(__dirname, '..', 'config'),
@@ -50,7 +50,7 @@ module.exports = {
50
50
  if (!options.healthcheck) options.healthcheck = require('../utils/get-default-healthcheck')(options);
51
51
 
52
52
  const postgres = {
53
- image: `bitnami/postgresql:${options.version}`,
53
+ image: `bitnamilegacy/postgresql:${options.version}`,
54
54
  command: '/launch.sh',
55
55
  environment: {
56
56
  ALLOW_EMPTY_PASSWORD: 'yes',
@@ -14,8 +14,6 @@
14
14
  skipPatterns = [ ".rss", ".gif", ".jpg" ]
15
15
  checkExternal = true
16
16
 
17
-
18
-
19
17
  # Sets our asset optimization
20
18
  [build.processing.css]
21
19
  bundle = true
@@ -41,9 +39,16 @@
41
39
  [plugins.inputs.audits]
42
40
  output_path = "reports/lighthouse.html"
43
41
 
44
-
45
-
46
42
  # We need this so preview environments and the base site look ok on their own
43
+ [[redirects]]
44
+ from = "https://lando-postgres.netlify.app"
45
+ to = "https://lando-postgres.netlify.app/plugins/postgres/index.html"
46
+ status = 301
47
+ force = true
48
+ [[redirects]]
49
+ from = "https://lando-postgres.netlify.app/*"
50
+ to = "https://docs.lando.dev/:splat"
51
+ status = 301
47
52
  [[redirects]]
48
53
  from = "/"
49
54
  to = "/plugins/postgres"
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@lando/postgres",
3
3
  "description": "A Lando plugin that provides a tight integration with Postgres.",
4
- "version": "1.4.4",
4
+ "version": "1.5.0",
5
5
  "author": "Mike Pirog @pirog",
6
- "license": "GPL-3.0",
6
+ "license": "MIT",
7
7
  "repository": "lando/postgres",
8
8
  "bugs": "https://github.com/lando/postgres/issues/new/choose",
9
9
  "homepage": "https://github.com/lando/postgres",
@@ -48,13 +48,13 @@
48
48
  "devDependencies": {
49
49
  "@babel/eslint-parser": "^7.16.0",
50
50
  "@lando/leia": "^0.6.5",
51
- "@lando/vitepress-theme-default-plus": "^1.1.0-beta.24",
51
+ "@lando/vitepress-theme-default-plus": "^1.1.1",
52
52
  "chai": "^4.3.4",
53
53
  "command-line-test": "^1.0.10",
54
54
  "eslint": "^7.32.0",
55
55
  "eslint-config-google": "^0.9.1",
56
56
  "eslint-plugin-vue": "^8.0.3",
57
- "mocha": "^9.1.2",
57
+ "mocha": "^11.1.0",
58
58
  "nyc": "^15.1.0",
59
59
  "vitepress": "^1.3.4"
60
60
  },
@@ -62,9 +62,9 @@
62
62
  "lodash"
63
63
  ],
64
64
  "dist": {
65
- "integrity": "sha512-5hV1Up+aCCMklMcUr24uKSocuqQ91/GOOywt2Qj9mfq81F85xwa7xFxWSV+OSlrmwBIkcpNeZVZNz+vk7Rjo4g==",
66
- "shasum": "d23920ab8696c91ff271c9abb823b4e23852dd80",
67
- "filename": "lando-postgres-1.4.4.tgz",
68
- "unpackedSize": 1471063
65
+ "integrity": "sha512-BRnUHp7zZgFoqw0SbtsGH1+KAtrrI+iJVjNdAQcEOpqOGykXwk/g4e+35fcc0mMiqZ41n63EEM6zmMqROPApsw==",
66
+ "shasum": "9a76c9e135ac5359d7d4c4aac8f867198738adcc",
67
+ "filename": "lando-postgres-1.5.0.tgz",
68
+ "unpackedSize": 1428384
69
69
  }
70
70
  }
@@ -100,7 +100,7 @@ Options:
100
100
  -i --increment [<level>]
101
101
  Increment a version by the specified level. Level can
102
102
  be one of: major, minor, patch, premajor, preminor,
103
- prepatch, or prerelease. Default level is 'patch'.
103
+ prepatch, prerelease, or release. Default level is 'patch'.
104
104
  Only one version may be specified.
105
105
 
106
106
  --preid <identifier>
@@ -141,6 +141,8 @@ A "version" is described by the `v2.0.0` specification found at
141
141
  <https://semver.org/>.
142
142
 
143
143
  A leading `"="` or `"v"` character is stripped off and ignored.
144
+ Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer
145
+ specification but should not be used anymore.
144
146
 
145
147
  ## Ranges
146
148
 
@@ -237,6 +239,13 @@ $ semver 1.2.4-beta.0 -i prerelease
237
239
  1.2.4-beta.1
238
240
  ```
239
241
 
242
+ To get out of the prerelease phase, use the `release` option:
243
+
244
+ ```bash
245
+ $ semver 1.2.4-beta.1 -i release
246
+ 1.2.4
247
+ ```
248
+
240
249
  #### Prerelease Identifier Base
241
250
 
242
251
  The method `.inc` takes an optional parameter 'identifierBase' string
@@ -415,10 +424,10 @@ Strict-mode Comparators and Ranges will be strict about the SemVer
415
424
  strings that they parse.
416
425
 
417
426
  * `valid(v)`: Return the parsed version, or null if it's not valid.
418
- * `inc(v, release, options, identifier, identifierBase)`:
427
+ * `inc(v, releaseType, options, identifier, identifierBase)`:
419
428
  Return the version incremented by the release
420
429
  type (`major`, `premajor`, `minor`, `preminor`, `patch`,
421
- `prepatch`, or `prerelease`), or null if it's not valid
430
+ `prepatch`, `prerelease`, or `release`), or null if it's not valid
422
431
  * `premajor` in one call will bump the version up to the next major
423
432
  version and down to a prerelease of that major version.
424
433
  `preminor`, and `prepatch` work the same way.
@@ -426,6 +435,7 @@ strings that they parse.
426
435
  same as `prepatch`. It increments the patch version and then makes a
427
436
  prerelease. If the input version is already a prerelease it simply
428
437
  increments it.
438
+ * `release` will remove any prerelease part of the version.
429
439
  * `identifier` can be used to prefix `premajor`, `preminor`,
430
440
  `prepatch`, or `prerelease` version increments. `identifierBase`
431
441
  is the base to be used for the `prerelease` identifier.
@@ -477,7 +487,7 @@ strings that they parse.
477
487
 
478
488
  ### Ranges
479
489
 
480
- * `validRange(range)`: Return the valid range or null if it's not valid
490
+ * `validRange(range)`: Return the valid range or null if it's not valid.
481
491
  * `satisfies(version, range)`: Return true if the version satisfies the
482
492
  range.
483
493
  * `maxSatisfying(versions, range)`: Return the highest version in the list
@@ -3,6 +3,8 @@
3
3
  // Exits successfully and prints matching version(s) if
4
4
  // any supplied version is valid and passes all tests.
5
5
 
6
+ 'use strict'
7
+
6
8
  const argv = process.argv.slice(2)
7
9
 
8
10
  let versions = []
@@ -61,6 +63,7 @@ const main = () => {
61
63
  switch (argv[0]) {
62
64
  case 'major': case 'minor': case 'patch': case 'prerelease':
63
65
  case 'premajor': case 'preminor': case 'prepatch':
66
+ case 'release':
64
67
  inc = argv.shift()
65
68
  break
66
69
  default:
@@ -149,7 +152,7 @@ Options:
149
152
  -i --increment [<level>]
150
153
  Increment a version by the specified level. Level can
151
154
  be one of: major, minor, patch, premajor, preminor,
152
- prepatch, or prerelease. Default level is 'patch'.
155
+ prepatch, prerelease, or release. Default level is 'patch'.
153
156
  Only one version may be specified.
154
157
 
155
158
  --preid <identifier>
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const ANY = Symbol('SemVer ANY')
2
4
  // hoisted class for cyclic dependency
3
5
  class Comparator {
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  module.exports = {
2
4
  SemVer: require('./semver.js'),
3
5
  Range: require('./range.js'),
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SPACE_CHARACTERS = /\s+/g
2
4
 
3
5
  // hoisted class for cyclic dependency
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const debug = require('../internal/debug')
2
4
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
3
5
  const { safeRe: re, t } = require('../internal/re')
@@ -10,7 +12,7 @@ class SemVer {
10
12
 
11
13
  if (version instanceof SemVer) {
12
14
  if (version.loose === !!options.loose &&
13
- version.includePrerelease === !!options.includePrerelease) {
15
+ version.includePrerelease === !!options.includePrerelease) {
14
16
  return version
15
17
  } else {
16
18
  version = version.version
@@ -176,6 +178,19 @@ class SemVer {
176
178
  // preminor will bump the version up to the next minor release, and immediately
177
179
  // down to pre-release. premajor and prepatch work the same way.
178
180
  inc (release, identifier, identifierBase) {
181
+ if (release.startsWith('pre')) {
182
+ if (!identifier && identifierBase === false) {
183
+ throw new Error('invalid increment argument: identifier is empty')
184
+ }
185
+ // Avoid an invalid semver results
186
+ if (identifier) {
187
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
188
+ if (!match || match[1] !== identifier) {
189
+ throw new Error(`invalid identifier: ${identifier}`)
190
+ }
191
+ }
192
+ }
193
+
179
194
  switch (release) {
180
195
  case 'premajor':
181
196
  this.prerelease.length = 0
@@ -206,6 +221,12 @@ class SemVer {
206
221
  }
207
222
  this.inc('pre', identifier, identifierBase)
208
223
  break
224
+ case 'release':
225
+ if (this.prerelease.length === 0) {
226
+ throw new Error(`version ${this.raw} is not a prerelease`)
227
+ }
228
+ this.prerelease.length = 0
229
+ break
209
230
 
210
231
  case 'major':
211
232
  // If this is a pre-major version, bump up to the same major version.
@@ -249,10 +270,6 @@ class SemVer {
249
270
  case 'pre': {
250
271
  const base = Number(identifierBase) ? 1 : 0
251
272
 
252
- if (!identifier && identifierBase === false) {
253
- throw new Error('invalid increment argument: identifier is empty')
254
- }
255
-
256
273
  if (this.prerelease.length === 0) {
257
274
  this.prerelease = [base]
258
275
  } else {
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const parse = require('./parse')
2
4
  const clean = (version, options) => {
3
5
  const s = parse(version.trim().replace(/^[=v]+/, ''), options)
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const eq = require('./eq')
2
4
  const neq = require('./neq')
3
5
  const gt = require('./gt')
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const parse = require('./parse')
3
5
  const { safeRe: re, t } = require('../internal/re')
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const compareBuild = (a, b, loose) => {
3
5
  const versionA = new SemVer(a, loose)
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const compareLoose = (a, b) => compare(a, b, true)
3
5
  module.exports = compareLoose
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const compare = (a, b, loose) =>
3
5
  new SemVer(a, loose).compare(new SemVer(b, loose))
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const parse = require('./parse.js')
2
4
 
3
5
  const diff = (version1, version2) => {
@@ -27,20 +29,13 @@ const diff = (version1, version2) => {
27
29
  return 'major'
28
30
  }
29
31
 
30
- // Otherwise it can be determined by checking the high version
31
-
32
- if (highVersion.patch) {
33
- // anything higher than a patch bump would result in the wrong version
32
+ // If the main part has no difference
33
+ if (lowVersion.compareMain(highVersion) === 0) {
34
+ if (lowVersion.minor && !lowVersion.patch) {
35
+ return 'minor'
36
+ }
34
37
  return 'patch'
35
38
  }
36
-
37
- if (highVersion.minor) {
38
- // anything higher than a minor bump would result in the wrong version
39
- return 'minor'
40
- }
41
-
42
- // bumping major/minor/patch all have same result
43
- return 'major'
44
39
  }
45
40
 
46
41
  // add the `pre` prefix if we are going to a prerelease version
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const eq = (a, b, loose) => compare(a, b, loose) === 0
3
5
  module.exports = eq
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const gt = (a, b, loose) => compare(a, b, loose) > 0
3
5
  module.exports = gt
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const gte = (a, b, loose) => compare(a, b, loose) >= 0
3
5
  module.exports = gte
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
 
3
5
  const inc = (version, release, options, identifier, identifierBase) => {
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const lt = (a, b, loose) => compare(a, b, loose) < 0
3
5
  module.exports = lt
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const lte = (a, b, loose) => compare(a, b, loose) <= 0
3
5
  module.exports = lte
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const major = (a, loose) => new SemVer(a, loose).major
3
5
  module.exports = major
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const minor = (a, loose) => new SemVer(a, loose).minor
3
5
  module.exports = minor
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const neq = (a, b, loose) => compare(a, b, loose) !== 0
3
5
  module.exports = neq
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const parse = (version, options, throwErrors = false) => {
3
5
  if (version instanceof SemVer) {
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const SemVer = require('../classes/semver')
2
4
  const patch = (a, loose) => new SemVer(a, loose).patch
3
5
  module.exports = patch
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const parse = require('./parse')
2
4
  const prerelease = (version, options) => {
3
5
  const parsed = parse(version, options)
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compare = require('./compare')
2
4
  const rcompare = (a, b, loose) => compare(b, a, loose)
3
5
  module.exports = rcompare
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compareBuild = require('./compare-build')
2
4
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
3
5
  module.exports = rsort
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const Range = require('../classes/range')
2
4
  const satisfies = (version, range, options) => {
3
5
  try {
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const compareBuild = require('./compare-build')
2
4
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
3
5
  module.exports = sort
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const parse = require('./parse')
2
4
  const valid = (version, options) => {
3
5
  const v = parse(version, options)
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  // just pre-load all the stuff that index.js lazily exports
2
4
  const internalRe = require('./internal/re')
3
5
  const constants = require('./internal/constants')
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  // Note: this is the semver.org version of the spec that it implements
2
4
  // Not necessarily the package version of this code.
3
5
  const SEMVER_SPEC_VERSION = '2.0.0'
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const debug = (
2
4
  typeof process === 'object' &&
3
5
  process.env &&
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const numeric = /^[0-9]+$/
2
4
  const compareIdentifiers = (a, b) => {
3
5
  const anum = numeric.test(a)
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  class LRUCache {
2
4
  constructor () {
3
5
  this.max = 1000
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  // parse out just the options we care about
2
4
  const looseOption = Object.freeze({ loose: true })
3
5
  const emptyOpts = Object.freeze({ })
@@ -1,3 +1,5 @@
1
+ 'use strict'
2
+
1
3
  const {
2
4
  MAX_SAFE_COMPONENT_LENGTH,
3
5
  MAX_SAFE_BUILD_LENGTH,
@@ -10,6 +12,7 @@ exports = module.exports = {}
10
12
  const re = exports.re = []
11
13
  const safeRe = exports.safeRe = []
12
14
  const src = exports.src = []
15
+ const safeSrc = exports.safeSrc = []
13
16
  const t = exports.t = {}
14
17
  let R = 0
15
18
 
@@ -42,6 +45,7 @@ const createToken = (name, value, isGlobal) => {
42
45
  debug(name, index, value)
43
46
  t[name] = index
44
47
  src[index] = value
48
+ safeSrc[index] = safe
45
49
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
46
50
  safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
47
51
  }
@@ -74,12 +78,14 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
74
78
 
75
79
  // ## Pre-release Version Identifier
76
80
  // A numeric identifier, or a non-numeric identifier.
81
+ // Non-numberic identifiers include numberic identifiers but can be longer.
82
+ // Therefore non-numberic identifiers must go first.
77
83
 
78
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
79
- }|${src[t.NONNUMERICIDENTIFIER]})`)
84
+ createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
85
+ }|${src[t.NUMERICIDENTIFIER]})`)
80
86
 
81
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
82
- }|${src[t.NONNUMERICIDENTIFIER]})`)
87
+ createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
88
+ }|${src[t.NUMERICIDENTIFIERLOOSE]})`)
83
89
 
84
90
  // ## Pre-release Version
85
91
  // Hyphen, followed by one or more dot-separated pre-release version