@aws-cdk/cloud-assembly-schema 2.77.0 → 2.78.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/.jsii +2 -2
- package/lib/manifest.js +1 -1
- package/node_modules/semver/README.md +67 -0
- package/node_modules/semver/bin/semver.js +16 -2
- package/node_modules/semver/classes/comparator.js +37 -33
- package/node_modules/semver/classes/range.js +6 -2
- package/node_modules/semver/classes/semver.js +27 -14
- package/node_modules/semver/functions/diff.js +48 -17
- package/node_modules/semver/functions/inc.js +3 -2
- package/node_modules/semver/functions/parse.js +5 -22
- package/node_modules/semver/index.js +1 -0
- package/node_modules/semver/internal/constants.js +15 -2
- package/node_modules/semver/internal/parse-options.js +14 -10
- package/node_modules/semver/package.json +7 -6
- package/node_modules/semver/ranges/intersects.js +1 -1
- package/node_modules/semver/ranges/subset.js +6 -3
- package/package.json +4 -4
package/.jsii
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"stability": "stable"
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/aws/aws-cdk",
|
|
19
|
-
"jsiiVersion": "5.0.
|
|
19
|
+
"jsiiVersion": "5.0.7 (build 5782cd5)",
|
|
20
20
|
"keywords": [
|
|
21
21
|
"aws",
|
|
22
22
|
"cdk"
|
|
@@ -5841,6 +5841,6 @@
|
|
|
5841
5841
|
"symbolId": "lib/cloud-assembly/context-queries:VpcContextQuery"
|
|
5842
5842
|
}
|
|
5843
5843
|
},
|
|
5844
|
-
"version": "2.
|
|
5844
|
+
"version": "2.78.0",
|
|
5845
5845
|
"fingerprint": "**********"
|
|
5846
5846
|
}
|
package/lib/manifest.js
CHANGED
|
@@ -261,7 +261,7 @@ class Manifest {
|
|
|
261
261
|
constructor() { }
|
|
262
262
|
}
|
|
263
263
|
_a = JSII_RTTI_SYMBOL_1;
|
|
264
|
-
Manifest[_a] = { fqn: "@aws-cdk/cloud-assembly-schema.Manifest", version: "2.
|
|
264
|
+
Manifest[_a] = { fqn: "@aws-cdk/cloud-assembly-schema.Manifest", version: "2.78.0" };
|
|
265
265
|
exports.Manifest = Manifest;
|
|
266
266
|
function mapValues(xs, fn) {
|
|
267
267
|
if (!xs) {
|
|
@@ -110,6 +110,9 @@ Options:
|
|
|
110
110
|
-l --loose
|
|
111
111
|
Interpret versions and ranges loosely
|
|
112
112
|
|
|
113
|
+
-n <0|1>
|
|
114
|
+
This is the base to be used for the prerelease identifier.
|
|
115
|
+
|
|
113
116
|
-p --include-prerelease
|
|
114
117
|
Always include prerelease versions in range matching
|
|
115
118
|
|
|
@@ -232,6 +235,35 @@ $ semver 1.2.4-beta.0 -i prerelease
|
|
|
232
235
|
1.2.4-beta.1
|
|
233
236
|
```
|
|
234
237
|
|
|
238
|
+
#### Prerelease Identifier Base
|
|
239
|
+
|
|
240
|
+
The method `.inc` takes an optional parameter 'identifierBase' string
|
|
241
|
+
that will let you let your prerelease number as zero-based or one-based.
|
|
242
|
+
Set to `false` to omit the prerelease number altogether.
|
|
243
|
+
If you do not specify this parameter, it will default to zero-based.
|
|
244
|
+
|
|
245
|
+
```javascript
|
|
246
|
+
semver.inc('1.2.3', 'prerelease', 'beta', '1')
|
|
247
|
+
// '1.2.4-beta.1'
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
```javascript
|
|
251
|
+
semver.inc('1.2.3', 'prerelease', 'beta', false)
|
|
252
|
+
// '1.2.4-beta'
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
command-line example:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
$ semver 1.2.3 -i prerelease --preid beta -n 1
|
|
259
|
+
1.2.4-beta.1
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
$ semver 1.2.3 -i prerelease --preid beta -n false
|
|
264
|
+
1.2.4-beta
|
|
265
|
+
```
|
|
266
|
+
|
|
235
267
|
### Advanced Range Syntax
|
|
236
268
|
|
|
237
269
|
Advanced range syntax desugars to primitive comparators in
|
|
@@ -513,6 +545,40 @@ ex.
|
|
|
513
545
|
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
|
514
546
|
* `s.clean('~1.0.0')`: `null`
|
|
515
547
|
|
|
548
|
+
## Constants
|
|
549
|
+
|
|
550
|
+
As a convenience, helper constants are exported to provide information about what `node-semver` supports:
|
|
551
|
+
|
|
552
|
+
### `RELEASE_TYPES`
|
|
553
|
+
|
|
554
|
+
- major
|
|
555
|
+
- premajor
|
|
556
|
+
- minor
|
|
557
|
+
- preminor
|
|
558
|
+
- patch
|
|
559
|
+
- prepatch
|
|
560
|
+
- prerelease
|
|
561
|
+
|
|
562
|
+
```
|
|
563
|
+
const semver = require('semver');
|
|
564
|
+
|
|
565
|
+
if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
|
|
566
|
+
console.log('This is a valid release type!');
|
|
567
|
+
} else {
|
|
568
|
+
console.warn('This is NOT a valid release type!');
|
|
569
|
+
}
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### `SEMVER_SPEC_VERSION`
|
|
573
|
+
|
|
574
|
+
2.0.0
|
|
575
|
+
|
|
576
|
+
```
|
|
577
|
+
const semver = require('semver');
|
|
578
|
+
|
|
579
|
+
console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
|
|
580
|
+
```
|
|
581
|
+
|
|
516
582
|
## Exported Modules
|
|
517
583
|
|
|
518
584
|
<!--
|
|
@@ -566,3 +632,4 @@ The following modules are available:
|
|
|
566
632
|
* `require('semver/ranges/outside')`
|
|
567
633
|
* `require('semver/ranges/to-comparators')`
|
|
568
634
|
* `require('semver/ranges/valid')`
|
|
635
|
+
|
|
@@ -23,7 +23,10 @@ let rtl = false
|
|
|
23
23
|
|
|
24
24
|
let identifier
|
|
25
25
|
|
|
26
|
+
let identifierBase
|
|
27
|
+
|
|
26
28
|
const semver = require('../')
|
|
29
|
+
const parseOptions = require('../internal/parse-options')
|
|
27
30
|
|
|
28
31
|
let reverse = false
|
|
29
32
|
|
|
@@ -71,6 +74,12 @@ const main = () => {
|
|
|
71
74
|
case '-r': case '--range':
|
|
72
75
|
range.push(argv.shift())
|
|
73
76
|
break
|
|
77
|
+
case '-n':
|
|
78
|
+
identifierBase = argv.shift()
|
|
79
|
+
if (identifierBase === 'false') {
|
|
80
|
+
identifierBase = false
|
|
81
|
+
}
|
|
82
|
+
break
|
|
74
83
|
case '-c': case '--coerce':
|
|
75
84
|
coerce = true
|
|
76
85
|
break
|
|
@@ -88,7 +97,7 @@ const main = () => {
|
|
|
88
97
|
}
|
|
89
98
|
}
|
|
90
99
|
|
|
91
|
-
options = { loose
|
|
100
|
+
options = parseOptions({ loose, includePrerelease, rtl })
|
|
92
101
|
|
|
93
102
|
versions = versions.map((v) => {
|
|
94
103
|
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
|
@@ -127,7 +136,7 @@ const success = () => {
|
|
|
127
136
|
}).map((v) => {
|
|
128
137
|
return semver.clean(v, options)
|
|
129
138
|
}).map((v) => {
|
|
130
|
-
return inc ? semver.inc(v, inc, options, identifier) : v
|
|
139
|
+
return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v
|
|
131
140
|
}).forEach((v, i, _) => {
|
|
132
141
|
console.log(v)
|
|
133
142
|
})
|
|
@@ -172,6 +181,11 @@ Options:
|
|
|
172
181
|
--ltr
|
|
173
182
|
Coerce version strings left to right (default)
|
|
174
183
|
|
|
184
|
+
-n <base>
|
|
185
|
+
Base number to be used for the prerelease identifier.
|
|
186
|
+
Can be either 0 or 1, or false to omit the number altogether.
|
|
187
|
+
Defaults to 0.
|
|
188
|
+
|
|
175
189
|
Program exits successfully if any valid version satisfies
|
|
176
190
|
all supplied ranges, and prints all satisfying versions.
|
|
177
191
|
|
|
@@ -78,13 +78,6 @@ class Comparator {
|
|
|
78
78
|
throw new TypeError('a Comparator is required')
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
if (!options || typeof options !== 'object') {
|
|
82
|
-
options = {
|
|
83
|
-
loose: !!options,
|
|
84
|
-
includePrerelease: false,
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
81
|
if (this.operator === '') {
|
|
89
82
|
if (this.value === '') {
|
|
90
83
|
return true
|
|
@@ -97,32 +90,43 @@ class Comparator {
|
|
|
97
90
|
return new Range(this.value, options).test(comp.semver)
|
|
98
91
|
}
|
|
99
92
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
(this.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
(this.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
93
|
+
options = parseOptions(options)
|
|
94
|
+
|
|
95
|
+
// Special cases where nothing can possibly be lower
|
|
96
|
+
if (options.includePrerelease &&
|
|
97
|
+
(this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
|
|
98
|
+
return false
|
|
99
|
+
}
|
|
100
|
+
if (!options.includePrerelease &&
|
|
101
|
+
(this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
|
|
102
|
+
return false
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Same direction increasing (> or >=)
|
|
106
|
+
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
|
|
107
|
+
return true
|
|
108
|
+
}
|
|
109
|
+
// Same direction decreasing (< or <=)
|
|
110
|
+
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
|
|
111
|
+
return true
|
|
112
|
+
}
|
|
113
|
+
// same SemVer and both sides are inclusive (<= or >=)
|
|
114
|
+
if (
|
|
115
|
+
(this.semver.version === comp.semver.version) &&
|
|
116
|
+
this.operator.includes('=') && comp.operator.includes('=')) {
|
|
117
|
+
return true
|
|
118
|
+
}
|
|
119
|
+
// opposite directions less than
|
|
120
|
+
if (cmp(this.semver, '<', comp.semver, options) &&
|
|
121
|
+
this.operator.startsWith('>') && comp.operator.startsWith('<')) {
|
|
122
|
+
return true
|
|
123
|
+
}
|
|
124
|
+
// opposite directions greater than
|
|
125
|
+
if (cmp(this.semver, '>', comp.semver, options) &&
|
|
126
|
+
this.operator.startsWith('<') && comp.operator.startsWith('>')) {
|
|
127
|
+
return true
|
|
128
|
+
}
|
|
129
|
+
return false
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
|
|
@@ -81,8 +81,10 @@ class Range {
|
|
|
81
81
|
|
|
82
82
|
// memoize range parsing for performance.
|
|
83
83
|
// this is a very hot path, and fully deterministic.
|
|
84
|
-
const memoOpts =
|
|
85
|
-
|
|
84
|
+
const memoOpts =
|
|
85
|
+
(this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
|
|
86
|
+
(this.options.loose && FLAG_LOOSE)
|
|
87
|
+
const memoKey = memoOpts + ':' + range
|
|
86
88
|
const cached = cache.get(memoKey)
|
|
87
89
|
if (cached) {
|
|
88
90
|
return cached
|
|
@@ -190,6 +192,7 @@ class Range {
|
|
|
190
192
|
return false
|
|
191
193
|
}
|
|
192
194
|
}
|
|
195
|
+
|
|
193
196
|
module.exports = Range
|
|
194
197
|
|
|
195
198
|
const LRU = require('lru-cache')
|
|
@@ -206,6 +209,7 @@ const {
|
|
|
206
209
|
tildeTrimReplace,
|
|
207
210
|
caretTrimReplace,
|
|
208
211
|
} = require('../internal/re')
|
|
212
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
|
|
209
213
|
|
|
210
214
|
const isNullSet = c => c.value === '<0.0.0-0'
|
|
211
215
|
const isAny = c => c.value === ''
|
|
@@ -16,7 +16,7 @@ class SemVer {
|
|
|
16
16
|
version = version.version
|
|
17
17
|
}
|
|
18
18
|
} else if (typeof version !== 'string') {
|
|
19
|
-
throw new TypeError(`Invalid Version: ${version}`)
|
|
19
|
+
throw new TypeError(`Invalid Version: ${require('util').inspect(version)}`)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if (version.length > MAX_LENGTH) {
|
|
@@ -175,36 +175,36 @@ class SemVer {
|
|
|
175
175
|
|
|
176
176
|
// preminor will bump the version up to the next minor release, and immediately
|
|
177
177
|
// down to pre-release. premajor and prepatch work the same way.
|
|
178
|
-
inc (release, identifier) {
|
|
178
|
+
inc (release, identifier, identifierBase) {
|
|
179
179
|
switch (release) {
|
|
180
180
|
case 'premajor':
|
|
181
181
|
this.prerelease.length = 0
|
|
182
182
|
this.patch = 0
|
|
183
183
|
this.minor = 0
|
|
184
184
|
this.major++
|
|
185
|
-
this.inc('pre', identifier)
|
|
185
|
+
this.inc('pre', identifier, identifierBase)
|
|
186
186
|
break
|
|
187
187
|
case 'preminor':
|
|
188
188
|
this.prerelease.length = 0
|
|
189
189
|
this.patch = 0
|
|
190
190
|
this.minor++
|
|
191
|
-
this.inc('pre', identifier)
|
|
191
|
+
this.inc('pre', identifier, identifierBase)
|
|
192
192
|
break
|
|
193
193
|
case 'prepatch':
|
|
194
194
|
// If this is already a prerelease, it will bump to the next version
|
|
195
195
|
// drop any prereleases that might already exist, since they are not
|
|
196
196
|
// relevant at this point.
|
|
197
197
|
this.prerelease.length = 0
|
|
198
|
-
this.inc('patch', identifier)
|
|
199
|
-
this.inc('pre', identifier)
|
|
198
|
+
this.inc('patch', identifier, identifierBase)
|
|
199
|
+
this.inc('pre', identifier, identifierBase)
|
|
200
200
|
break
|
|
201
201
|
// If the input is a non-prerelease version, this acts the same as
|
|
202
202
|
// prepatch.
|
|
203
203
|
case 'prerelease':
|
|
204
204
|
if (this.prerelease.length === 0) {
|
|
205
|
-
this.inc('patch', identifier)
|
|
205
|
+
this.inc('patch', identifier, identifierBase)
|
|
206
206
|
}
|
|
207
|
-
this.inc('pre', identifier)
|
|
207
|
+
this.inc('pre', identifier, identifierBase)
|
|
208
208
|
break
|
|
209
209
|
|
|
210
210
|
case 'major':
|
|
@@ -246,9 +246,15 @@ class SemVer {
|
|
|
246
246
|
break
|
|
247
247
|
// This probably shouldn't be used publicly.
|
|
248
248
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
249
|
-
case 'pre':
|
|
249
|
+
case 'pre': {
|
|
250
|
+
const base = Number(identifierBase) ? 1 : 0
|
|
251
|
+
|
|
252
|
+
if (!identifier && identifierBase === false) {
|
|
253
|
+
throw new Error('invalid increment argument: identifier is empty')
|
|
254
|
+
}
|
|
255
|
+
|
|
250
256
|
if (this.prerelease.length === 0) {
|
|
251
|
-
this.prerelease = [
|
|
257
|
+
this.prerelease = [base]
|
|
252
258
|
} else {
|
|
253
259
|
let i = this.prerelease.length
|
|
254
260
|
while (--i >= 0) {
|
|
@@ -259,22 +265,29 @@ class SemVer {
|
|
|
259
265
|
}
|
|
260
266
|
if (i === -1) {
|
|
261
267
|
// didn't increment anything
|
|
262
|
-
this.prerelease.
|
|
268
|
+
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
|
269
|
+
throw new Error('invalid increment argument: identifier already exists')
|
|
270
|
+
}
|
|
271
|
+
this.prerelease.push(base)
|
|
263
272
|
}
|
|
264
273
|
}
|
|
265
274
|
if (identifier) {
|
|
266
275
|
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
|
267
276
|
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
|
277
|
+
let prerelease = [identifier, base]
|
|
278
|
+
if (identifierBase === false) {
|
|
279
|
+
prerelease = [identifier]
|
|
280
|
+
}
|
|
268
281
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
269
282
|
if (isNaN(this.prerelease[1])) {
|
|
270
|
-
this.prerelease =
|
|
283
|
+
this.prerelease = prerelease
|
|
271
284
|
}
|
|
272
285
|
} else {
|
|
273
|
-
this.prerelease =
|
|
286
|
+
this.prerelease = prerelease
|
|
274
287
|
}
|
|
275
288
|
}
|
|
276
289
|
break
|
|
277
|
-
|
|
290
|
+
}
|
|
278
291
|
default:
|
|
279
292
|
throw new Error(`invalid increment argument: ${release}`)
|
|
280
293
|
}
|
|
@@ -1,23 +1,54 @@
|
|
|
1
|
-
const parse = require('./parse')
|
|
2
|
-
const eq = require('./eq')
|
|
1
|
+
const parse = require('./parse.js')
|
|
3
2
|
|
|
4
3
|
const diff = (version1, version2) => {
|
|
5
|
-
|
|
4
|
+
const v1 = parse(version1, null, true)
|
|
5
|
+
const v2 = parse(version2, null, true)
|
|
6
|
+
const comparison = v1.compare(v2)
|
|
7
|
+
|
|
8
|
+
if (comparison === 0) {
|
|
6
9
|
return null
|
|
7
|
-
} else {
|
|
8
|
-
const v1 = parse(version1)
|
|
9
|
-
const v2 = parse(version2)
|
|
10
|
-
const hasPre = v1.prerelease.length || v2.prerelease.length
|
|
11
|
-
const prefix = hasPre ? 'pre' : ''
|
|
12
|
-
const defaultResult = hasPre ? 'prerelease' : ''
|
|
13
|
-
for (const key in v1) {
|
|
14
|
-
if (key === 'major' || key === 'minor' || key === 'patch') {
|
|
15
|
-
if (v1[key] !== v2[key]) {
|
|
16
|
-
return prefix + key
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return defaultResult // may be undefined
|
|
21
10
|
}
|
|
11
|
+
|
|
12
|
+
const v1Higher = comparison > 0
|
|
13
|
+
const highVersion = v1Higher ? v1 : v2
|
|
14
|
+
const lowVersion = v1Higher ? v2 : v1
|
|
15
|
+
const highHasPre = !!highVersion.prerelease.length
|
|
16
|
+
|
|
17
|
+
// add the `pre` prefix if we are going to a prerelease version
|
|
18
|
+
const prefix = highHasPre ? 'pre' : ''
|
|
19
|
+
|
|
20
|
+
if (v1.major !== v2.major) {
|
|
21
|
+
return prefix + 'major'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (v1.minor !== v2.minor) {
|
|
25
|
+
return prefix + 'minor'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (v1.patch !== v2.patch) {
|
|
29
|
+
return prefix + 'patch'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// at this point we know stable versions match but overall versions are not equal,
|
|
33
|
+
// so either they are both prereleases, or the lower version is a prerelease
|
|
34
|
+
|
|
35
|
+
if (highHasPre) {
|
|
36
|
+
// high and low are preleases
|
|
37
|
+
return 'prerelease'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (lowVersion.patch) {
|
|
41
|
+
// anything higher than a patch bump would result in the wrong version
|
|
42
|
+
return 'patch'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (lowVersion.minor) {
|
|
46
|
+
// anything higher than a minor bump would result in the wrong version
|
|
47
|
+
return 'minor'
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// bumping major/minor/patch all have same result
|
|
51
|
+
return 'major'
|
|
22
52
|
}
|
|
53
|
+
|
|
23
54
|
module.exports = diff
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const SemVer = require('../classes/semver')
|
|
2
2
|
|
|
3
|
-
const inc = (version, release, options, identifier) => {
|
|
3
|
+
const inc = (version, release, options, identifier, identifierBase) => {
|
|
4
4
|
if (typeof (options) === 'string') {
|
|
5
|
+
identifierBase = identifier
|
|
5
6
|
identifier = options
|
|
6
7
|
options = undefined
|
|
7
8
|
}
|
|
@@ -10,7 +11,7 @@ const inc = (version, release, options, identifier) => {
|
|
|
10
11
|
return new SemVer(
|
|
11
12
|
version instanceof SemVer ? version.version : version,
|
|
12
13
|
options
|
|
13
|
-
).inc(release, identifier).version
|
|
14
|
+
).inc(release, identifier, identifierBase).version
|
|
14
15
|
} catch (er) {
|
|
15
16
|
return null
|
|
16
17
|
}
|
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
const { MAX_LENGTH } = require('../internal/constants')
|
|
2
|
-
const { re, t } = require('../internal/re')
|
|
3
1
|
const SemVer = require('../classes/semver')
|
|
4
|
-
|
|
5
|
-
const parseOptions = require('../internal/parse-options')
|
|
6
|
-
const parse = (version, options) => {
|
|
7
|
-
options = parseOptions(options)
|
|
8
|
-
|
|
2
|
+
const parse = (version, options, throwErrors = false) => {
|
|
9
3
|
if (version instanceof SemVer) {
|
|
10
4
|
return version
|
|
11
5
|
}
|
|
12
|
-
|
|
13
|
-
if (typeof version !== 'string') {
|
|
14
|
-
return null
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (version.length > MAX_LENGTH) {
|
|
18
|
-
return null
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const r = options.loose ? re[t.LOOSE] : re[t.FULL]
|
|
22
|
-
if (!r.test(version)) {
|
|
23
|
-
return null
|
|
24
|
-
}
|
|
25
|
-
|
|
26
6
|
try {
|
|
27
7
|
return new SemVer(version, options)
|
|
28
8
|
} catch (er) {
|
|
29
|
-
|
|
9
|
+
if (!throwErrors) {
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
throw er
|
|
30
13
|
}
|
|
31
14
|
}
|
|
32
15
|
|
|
@@ -83,6 +83,7 @@ module.exports = {
|
|
|
83
83
|
src: internalRe.src,
|
|
84
84
|
tokens: internalRe.t,
|
|
85
85
|
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
86
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
86
87
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
87
88
|
rcompareIdentifiers: identifiers.rcompareIdentifiers,
|
|
88
89
|
}
|
|
@@ -9,9 +9,22 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
|
|
9
9
|
// Max safe segment length for coercion.
|
|
10
10
|
const MAX_SAFE_COMPONENT_LENGTH = 16
|
|
11
11
|
|
|
12
|
+
const RELEASE_TYPES = [
|
|
13
|
+
'major',
|
|
14
|
+
'premajor',
|
|
15
|
+
'minor',
|
|
16
|
+
'preminor',
|
|
17
|
+
'patch',
|
|
18
|
+
'prepatch',
|
|
19
|
+
'prerelease',
|
|
20
|
+
]
|
|
21
|
+
|
|
12
22
|
module.exports = {
|
|
13
|
-
SEMVER_SPEC_VERSION,
|
|
14
23
|
MAX_LENGTH,
|
|
15
|
-
MAX_SAFE_INTEGER,
|
|
16
24
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
25
|
+
MAX_SAFE_INTEGER,
|
|
26
|
+
RELEASE_TYPES,
|
|
27
|
+
SEMVER_SPEC_VERSION,
|
|
28
|
+
FLAG_INCLUDE_PRERELEASE: 0b001,
|
|
29
|
+
FLAG_LOOSE: 0b010,
|
|
17
30
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
// parse out just the options we care about
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const parseOptions = options =>
|
|
5
|
-
!options
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
// parse out just the options we care about
|
|
2
|
+
const looseOption = Object.freeze({ loose: true })
|
|
3
|
+
const emptyOpts = Object.freeze({ })
|
|
4
|
+
const parseOptions = options => {
|
|
5
|
+
if (!options) {
|
|
6
|
+
return emptyOpts
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (typeof options !== 'object') {
|
|
10
|
+
return looseOption
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return options
|
|
14
|
+
}
|
|
11
15
|
module.exports = parseOptions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semver",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "The semantic version parser used by npm.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"template-oss-apply": "template-oss-apply --force"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@npmcli/eslint-config": "^
|
|
17
|
-
"@npmcli/template-oss": "4.
|
|
16
|
+
"@npmcli/eslint-config": "^4.0.0",
|
|
17
|
+
"@npmcli/template-oss": "4.13.0",
|
|
18
18
|
"tap": "^16.0.0"
|
|
19
19
|
},
|
|
20
20
|
"license": "ISC",
|
|
@@ -53,9 +53,8 @@
|
|
|
53
53
|
"author": "GitHub Inc.",
|
|
54
54
|
"templateOSS": {
|
|
55
55
|
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
|
56
|
-
"version": "4.
|
|
56
|
+
"version": "4.13.0",
|
|
57
57
|
"engines": ">=10",
|
|
58
|
-
"content": "./scripts",
|
|
59
58
|
"ciVersions": [
|
|
60
59
|
"10.0.0",
|
|
61
60
|
"10.x",
|
|
@@ -64,6 +63,7 @@
|
|
|
64
63
|
"16.x",
|
|
65
64
|
"18.x"
|
|
66
65
|
],
|
|
66
|
+
"npmSpec": "8",
|
|
67
67
|
"distPaths": [
|
|
68
68
|
"classes/",
|
|
69
69
|
"functions/",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"/index.js",
|
|
82
82
|
"/preload.js",
|
|
83
83
|
"/range.bnf"
|
|
84
|
-
]
|
|
84
|
+
],
|
|
85
|
+
"publish": "true"
|
|
85
86
|
}
|
|
86
87
|
}
|
|
@@ -68,6 +68,9 @@ const subset = (sub, dom, options = {}) => {
|
|
|
68
68
|
return true
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
|
|
72
|
+
const minimumVersion = [new Comparator('>=0.0.0')]
|
|
73
|
+
|
|
71
74
|
const simpleSubset = (sub, dom, options) => {
|
|
72
75
|
if (sub === dom) {
|
|
73
76
|
return true
|
|
@@ -77,9 +80,9 @@ const simpleSubset = (sub, dom, options) => {
|
|
|
77
80
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
78
81
|
return true
|
|
79
82
|
} else if (options.includePrerelease) {
|
|
80
|
-
sub =
|
|
83
|
+
sub = minimumVersionWithPreRelease
|
|
81
84
|
} else {
|
|
82
|
-
sub =
|
|
85
|
+
sub = minimumVersion
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
|
|
@@ -87,7 +90,7 @@ const simpleSubset = (sub, dom, options) => {
|
|
|
87
90
|
if (options.includePrerelease) {
|
|
88
91
|
return true
|
|
89
92
|
} else {
|
|
90
|
-
dom =
|
|
93
|
+
dom = minimumVersion
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-cdk/cloud-assembly-schema",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.78.0",
|
|
4
4
|
"description": "Cloud Assembly Schema",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
},
|
|
78
78
|
"license": "Apache-2.0",
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@aws-cdk/cdk-build-tools": "2.
|
|
81
|
-
"@aws-cdk/pkglint": "2.
|
|
80
|
+
"@aws-cdk/cdk-build-tools": "2.78.0-alpha.0",
|
|
81
|
+
"@aws-cdk/pkglint": "2.78.0-alpha.0",
|
|
82
82
|
"@types/jest": "^29.5.0",
|
|
83
83
|
"@types/mock-fs": "^4.13.1",
|
|
84
84
|
"@types/semver": "^7.3.13",
|
|
85
|
-
"aws-cdk-lib": "2.
|
|
85
|
+
"aws-cdk-lib": "2.78.0",
|
|
86
86
|
"jest": "^29.5.0",
|
|
87
87
|
"mock-fs": "^4.14.0",
|
|
88
88
|
"typescript-json-schema": "^0.55.0"
|