@aws-cdk/cloud-assembly-schema 2.18.0 → 2.21.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 (53) hide show
  1. package/.jsii +1536 -49
  2. package/.jsii.tabl.json +658 -1
  3. package/.warnings.jsii.js +266 -98
  4. package/NOTICE +0 -17
  5. package/lib/index.d.ts +1 -0
  6. package/lib/index.js +2 -1
  7. package/lib/integ-tests/commands/common.d.ts +178 -0
  8. package/lib/integ-tests/commands/common.js +22 -0
  9. package/lib/integ-tests/commands/deploy.d.ts +86 -0
  10. package/lib/integ-tests/commands/deploy.js +3 -0
  11. package/lib/integ-tests/commands/destroy.d.ts +18 -0
  12. package/lib/integ-tests/commands/destroy.js +3 -0
  13. package/lib/integ-tests/commands/index.d.ts +3 -0
  14. package/lib/integ-tests/commands/index.js +16 -0
  15. package/lib/integ-tests/index.d.ts +3 -0
  16. package/lib/integ-tests/index.js +16 -0
  17. package/lib/integ-tests/schema.d.ts +25 -0
  18. package/lib/integ-tests/schema.js +3 -0
  19. package/lib/integ-tests/test-case.d.ts +173 -0
  20. package/lib/integ-tests/test-case.js +3 -0
  21. package/lib/manifest.d.ts +14 -0
  22. package/lib/manifest.js +75 -7
  23. package/node_modules/lru-cache/LICENSE +1 -1
  24. package/node_modules/lru-cache/README.md +632 -99
  25. package/node_modules/lru-cache/index.js +732 -251
  26. package/node_modules/lru-cache/package.json +17 -7
  27. package/node_modules/semver/README.md +3 -1
  28. package/node_modules/semver/bin/semver.js +17 -8
  29. package/node_modules/semver/classes/comparator.js +3 -2
  30. package/node_modules/semver/classes/index.js +1 -1
  31. package/node_modules/semver/classes/range.js +31 -22
  32. package/node_modules/semver/functions/cmp.js +8 -4
  33. package/node_modules/semver/functions/coerce.js +3 -2
  34. package/node_modules/semver/functions/parse.js +1 -1
  35. package/node_modules/semver/internal/constants.js +2 -2
  36. package/node_modules/semver/internal/identifiers.js +1 -1
  37. package/node_modules/semver/internal/parse-options.js +3 -3
  38. package/node_modules/semver/internal/re.js +3 -3
  39. package/node_modules/semver/package.json +46 -13
  40. package/node_modules/semver/ranges/min-version.js +2 -1
  41. package/node_modules/semver/ranges/outside.js +1 -1
  42. package/node_modules/semver/ranges/simplify.js +15 -12
  43. package/node_modules/semver/ranges/subset.js +53 -31
  44. package/package.json +5 -5
  45. package/schema/cloud-assembly.version.json +1 -1
  46. package/schema/integ.schema.json +474 -0
  47. package/scripts/update-schema.js +2 -1
  48. package/node_modules/semver/CHANGELOG.md +0 -111
  49. package/node_modules/yallist/LICENSE +0 -15
  50. package/node_modules/yallist/README.md +0 -204
  51. package/node_modules/yallist/iterator.js +0 -8
  52. package/node_modules/yallist/package.json +0 -29
  53. package/node_modules/yallist/yallist.js +0 -426
@@ -41,8 +41,9 @@ const compare = require('../functions/compare.js')
41
41
  // - Else return true
42
42
 
43
43
  const subset = (sub, dom, options = {}) => {
44
- if (sub === dom)
44
+ if (sub === dom) {
45
45
  return true
46
+ }
46
47
 
47
48
  sub = new Range(sub, options)
48
49
  dom = new Range(dom, options)
@@ -52,73 +53,84 @@ const subset = (sub, dom, options = {}) => {
52
53
  for (const simpleDom of dom.set) {
53
54
  const isSub = simpleSubset(simpleSub, simpleDom, options)
54
55
  sawNonNull = sawNonNull || isSub !== null
55
- if (isSub)
56
+ if (isSub) {
56
57
  continue OUTER
58
+ }
57
59
  }
58
60
  // the null set is a subset of everything, but null simple ranges in
59
61
  // a complex range should be ignored. so if we saw a non-null range,
60
62
  // then we know this isn't a subset, but if EVERY simple range was null,
61
63
  // then it is a subset.
62
- if (sawNonNull)
64
+ if (sawNonNull) {
63
65
  return false
66
+ }
64
67
  }
65
68
  return true
66
69
  }
67
70
 
68
71
  const simpleSubset = (sub, dom, options) => {
69
- if (sub === dom)
72
+ if (sub === dom) {
70
73
  return true
74
+ }
71
75
 
72
76
  if (sub.length === 1 && sub[0].semver === ANY) {
73
- if (dom.length === 1 && dom[0].semver === ANY)
77
+ if (dom.length === 1 && dom[0].semver === ANY) {
74
78
  return true
75
- else if (options.includePrerelease)
76
- sub = [ new Comparator('>=0.0.0-0') ]
77
- else
78
- sub = [ new Comparator('>=0.0.0') ]
79
+ } else if (options.includePrerelease) {
80
+ sub = [new Comparator('>=0.0.0-0')]
81
+ } else {
82
+ sub = [new Comparator('>=0.0.0')]
83
+ }
79
84
  }
80
85
 
81
86
  if (dom.length === 1 && dom[0].semver === ANY) {
82
- if (options.includePrerelease)
87
+ if (options.includePrerelease) {
83
88
  return true
84
- else
85
- dom = [ new Comparator('>=0.0.0') ]
89
+ } else {
90
+ dom = [new Comparator('>=0.0.0')]
91
+ }
86
92
  }
87
93
 
88
94
  const eqSet = new Set()
89
95
  let gt, lt
90
96
  for (const c of sub) {
91
- if (c.operator === '>' || c.operator === '>=')
97
+ if (c.operator === '>' || c.operator === '>=') {
92
98
  gt = higherGT(gt, c, options)
93
- else if (c.operator === '<' || c.operator === '<=')
99
+ } else if (c.operator === '<' || c.operator === '<=') {
94
100
  lt = lowerLT(lt, c, options)
95
- else
101
+ } else {
96
102
  eqSet.add(c.semver)
103
+ }
97
104
  }
98
105
 
99
- if (eqSet.size > 1)
106
+ if (eqSet.size > 1) {
100
107
  return null
108
+ }
101
109
 
102
110
  let gtltComp
103
111
  if (gt && lt) {
104
112
  gtltComp = compare(gt.semver, lt.semver, options)
105
- if (gtltComp > 0)
113
+ if (gtltComp > 0) {
106
114
  return null
107
- else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))
115
+ } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
108
116
  return null
117
+ }
109
118
  }
110
119
 
111
120
  // will iterate one or zero times
112
121
  for (const eq of eqSet) {
113
- if (gt && !satisfies(eq, String(gt), options))
122
+ if (gt && !satisfies(eq, String(gt), options)) {
114
123
  return null
124
+ }
115
125
 
116
- if (lt && !satisfies(eq, String(lt), options))
126
+ if (lt && !satisfies(eq, String(lt), options)) {
117
127
  return null
128
+ }
118
129
 
119
130
  for (const c of dom) {
120
- if (!satisfies(eq, String(c), options))
131
+ if (!satisfies(eq, String(c), options)) {
121
132
  return false
133
+ }
122
134
  }
123
135
 
124
136
  return true
@@ -154,10 +166,12 @@ const simpleSubset = (sub, dom, options) => {
154
166
  }
155
167
  if (c.operator === '>' || c.operator === '>=') {
156
168
  higher = higherGT(gt, c, options)
157
- if (higher === c && higher !== gt)
169
+ if (higher === c && higher !== gt) {
158
170
  return false
159
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))
171
+ }
172
+ } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
160
173
  return false
174
+ }
161
175
  }
162
176
  if (lt) {
163
177
  if (needDomLTPre) {
@@ -170,37 +184,44 @@ const simpleSubset = (sub, dom, options) => {
170
184
  }
171
185
  if (c.operator === '<' || c.operator === '<=') {
172
186
  lower = lowerLT(lt, c, options)
173
- if (lower === c && lower !== lt)
187
+ if (lower === c && lower !== lt) {
174
188
  return false
175
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))
189
+ }
190
+ } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
176
191
  return false
192
+ }
177
193
  }
178
- if (!c.operator && (lt || gt) && gtltComp !== 0)
194
+ if (!c.operator && (lt || gt) && gtltComp !== 0) {
179
195
  return false
196
+ }
180
197
  }
181
198
 
182
199
  // if there was a < or >, and nothing in the dom, then must be false
183
200
  // UNLESS it was limited by another range in the other direction.
184
201
  // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
185
- if (gt && hasDomLT && !lt && gtltComp !== 0)
202
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
186
203
  return false
204
+ }
187
205
 
188
- if (lt && hasDomGT && !gt && gtltComp !== 0)
206
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
189
207
  return false
208
+ }
190
209
 
191
210
  // we needed a prerelease range in a specific tuple, but didn't get one
192
211
  // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
193
212
  // because it includes prereleases in the 1.2.3 tuple
194
- if (needDomGTPre || needDomLTPre)
213
+ if (needDomGTPre || needDomLTPre) {
195
214
  return false
215
+ }
196
216
 
197
217
  return true
198
218
  }
199
219
 
200
220
  // >=1.2.3 is lower than >1.2.3
201
221
  const higherGT = (a, b, options) => {
202
- if (!a)
222
+ if (!a) {
203
223
  return b
224
+ }
204
225
  const comp = compare(a.semver, b.semver, options)
205
226
  return comp > 0 ? a
206
227
  : comp < 0 ? b
@@ -210,8 +231,9 @@ const higherGT = (a, b, options) => {
210
231
 
211
232
  // <=1.2.3 is higher than <1.2.3
212
233
  const lowerLT = (a, b, options) => {
213
- if (!a)
234
+ if (!a) {
214
235
  return b
236
+ }
215
237
  const comp = compare(a.semver, b.semver, options)
216
238
  return comp < 0 ? a
217
239
  : comp > 0 ? b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-cdk/cloud-assembly-schema",
3
- "version": "2.18.0",
3
+ "version": "2.21.0",
4
4
  "description": "Cloud Assembly Schema",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "module": "aws_cdk.cloud_assembly_schema",
25
25
  "classifiers": [
26
26
  "Framework :: AWS CDK",
27
- "Framework :: AWS CDK :: 1"
27
+ "Framework :: AWS CDK :: 2"
28
28
  ]
29
29
  }
30
30
  },
@@ -60,8 +60,8 @@
60
60
  },
61
61
  "license": "Apache-2.0",
62
62
  "devDependencies": {
63
- "@aws-cdk/cdk-build-tools": "2.18.0",
64
- "@aws-cdk/pkglint": "2.18.0",
63
+ "@aws-cdk/cdk-build-tools": "2.21.0",
64
+ "@aws-cdk/pkglint": "2.21.0",
65
65
  "@types/jest": "^27.4.1",
66
66
  "@types/mock-fs": "^4.13.1",
67
67
  "@types/semver": "^7.3.9",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  "dependencies": {
94
94
  "jsonschema": "^1.4.0",
95
- "semver": "^7.3.5"
95
+ "semver": "^7.3.6"
96
96
  },
97
97
  "awscdkio": {
98
98
  "announce": false
@@ -1 +1 @@
1
- {"version":"16.0.0"}
1
+ {"version":"17.0.0"}