@firestartr/cli 2.9.0-snapshot-02 → 2.9.0-snapshot-org-variables-section-1

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/build/index.js CHANGED
@@ -233775,2770 +233775,6 @@ if (!safer.constants) {
233775
233775
  module.exports = safer
233776
233776
 
233777
233777
 
233778
- /***/ }),
233779
-
233780
- /***/ 71790:
233781
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
233782
-
233783
-
233784
-
233785
- const ANY = Symbol('SemVer ANY')
233786
- // hoisted class for cyclic dependency
233787
- class Comparator {
233788
- static get ANY () {
233789
- return ANY
233790
- }
233791
-
233792
- constructor (comp, options) {
233793
- options = parseOptions(options)
233794
-
233795
- if (comp instanceof Comparator) {
233796
- if (comp.loose === !!options.loose) {
233797
- return comp
233798
- } else {
233799
- comp = comp.value
233800
- }
233801
- }
233802
-
233803
- comp = comp.trim().split(/\s+/).join(' ')
233804
- debug('comparator', comp, options)
233805
- this.options = options
233806
- this.loose = !!options.loose
233807
- this.parse(comp)
233808
-
233809
- if (this.semver === ANY) {
233810
- this.value = ''
233811
- } else {
233812
- this.value = this.operator + this.semver.version
233813
- }
233814
-
233815
- debug('comp', this)
233816
- }
233817
-
233818
- parse (comp) {
233819
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
233820
- const m = comp.match(r)
233821
-
233822
- if (!m) {
233823
- throw new TypeError(`Invalid comparator: ${comp}`)
233824
- }
233825
-
233826
- this.operator = m[1] !== undefined ? m[1] : ''
233827
- if (this.operator === '=') {
233828
- this.operator = ''
233829
- }
233830
-
233831
- // if it literally is just '>' or '' then allow anything.
233832
- if (!m[2]) {
233833
- this.semver = ANY
233834
- } else {
233835
- this.semver = new SemVer(m[2], this.options.loose)
233836
- }
233837
- }
233838
-
233839
- toString () {
233840
- return this.value
233841
- }
233842
-
233843
- test (version) {
233844
- debug('Comparator.test', version, this.options.loose)
233845
-
233846
- if (this.semver === ANY || version === ANY) {
233847
- return true
233848
- }
233849
-
233850
- if (typeof version === 'string') {
233851
- try {
233852
- version = new SemVer(version, this.options)
233853
- } catch (er) {
233854
- return false
233855
- }
233856
- }
233857
-
233858
- return cmp(version, this.operator, this.semver, this.options)
233859
- }
233860
-
233861
- intersects (comp, options) {
233862
- if (!(comp instanceof Comparator)) {
233863
- throw new TypeError('a Comparator is required')
233864
- }
233865
-
233866
- if (this.operator === '') {
233867
- if (this.value === '') {
233868
- return true
233869
- }
233870
- return new Range(comp.value, options).test(this.value)
233871
- } else if (comp.operator === '') {
233872
- if (comp.value === '') {
233873
- return true
233874
- }
233875
- return new Range(this.value, options).test(comp.semver)
233876
- }
233877
-
233878
- options = parseOptions(options)
233879
-
233880
- // Special cases where nothing can possibly be lower
233881
- if (options.includePrerelease &&
233882
- (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
233883
- return false
233884
- }
233885
- if (!options.includePrerelease &&
233886
- (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
233887
- return false
233888
- }
233889
-
233890
- // Same direction increasing (> or >=)
233891
- if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
233892
- return true
233893
- }
233894
- // Same direction decreasing (< or <=)
233895
- if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
233896
- return true
233897
- }
233898
- // same SemVer and both sides are inclusive (<= or >=)
233899
- if (
233900
- (this.semver.version === comp.semver.version) &&
233901
- this.operator.includes('=') && comp.operator.includes('=')) {
233902
- return true
233903
- }
233904
- // opposite directions less than
233905
- if (cmp(this.semver, '<', comp.semver, options) &&
233906
- this.operator.startsWith('>') && comp.operator.startsWith('<')) {
233907
- return true
233908
- }
233909
- // opposite directions greater than
233910
- if (cmp(this.semver, '>', comp.semver, options) &&
233911
- this.operator.startsWith('<') && comp.operator.startsWith('>')) {
233912
- return true
233913
- }
233914
- return false
233915
- }
233916
- }
233917
-
233918
- module.exports = Comparator
233919
-
233920
- const parseOptions = __nccwpck_require__(36772)
233921
- const { safeRe: re, t } = __nccwpck_require__(84063)
233922
- const cmp = __nccwpck_require__(48801)
233923
- const debug = __nccwpck_require__(53619)
233924
- const SemVer = __nccwpck_require__(71490)
233925
- const Range = __nccwpck_require__(25287)
233926
-
233927
-
233928
- /***/ }),
233929
-
233930
- /***/ 25287:
233931
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
233932
-
233933
-
233934
-
233935
- const SPACE_CHARACTERS = /\s+/g
233936
-
233937
- // hoisted class for cyclic dependency
233938
- class Range {
233939
- constructor (range, options) {
233940
- options = parseOptions(options)
233941
-
233942
- if (range instanceof Range) {
233943
- if (
233944
- range.loose === !!options.loose &&
233945
- range.includePrerelease === !!options.includePrerelease
233946
- ) {
233947
- return range
233948
- } else {
233949
- return new Range(range.raw, options)
233950
- }
233951
- }
233952
-
233953
- if (range instanceof Comparator) {
233954
- // just put it in the set and return
233955
- this.raw = range.value
233956
- this.set = [[range]]
233957
- this.formatted = undefined
233958
- return this
233959
- }
233960
-
233961
- this.options = options
233962
- this.loose = !!options.loose
233963
- this.includePrerelease = !!options.includePrerelease
233964
-
233965
- // First reduce all whitespace as much as possible so we do not have to rely
233966
- // on potentially slow regexes like \s*. This is then stored and used for
233967
- // future error messages as well.
233968
- this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
233969
-
233970
- // First, split on ||
233971
- this.set = this.raw
233972
- .split('||')
233973
- // map the range to a 2d array of comparators
233974
- .map(r => this.parseRange(r.trim()))
233975
- // throw out any comparator lists that are empty
233976
- // this generally means that it was not a valid range, which is allowed
233977
- // in loose mode, but will still throw if the WHOLE range is invalid.
233978
- .filter(c => c.length)
233979
-
233980
- if (!this.set.length) {
233981
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
233982
- }
233983
-
233984
- // if we have any that are not the null set, throw out null sets.
233985
- if (this.set.length > 1) {
233986
- // keep the first one, in case they're all null sets
233987
- const first = this.set[0]
233988
- this.set = this.set.filter(c => !isNullSet(c[0]))
233989
- if (this.set.length === 0) {
233990
- this.set = [first]
233991
- } else if (this.set.length > 1) {
233992
- // if we have any that are *, then the range is just *
233993
- for (const c of this.set) {
233994
- if (c.length === 1 && isAny(c[0])) {
233995
- this.set = [c]
233996
- break
233997
- }
233998
- }
233999
- }
234000
- }
234001
-
234002
- this.formatted = undefined
234003
- }
234004
-
234005
- get range () {
234006
- if (this.formatted === undefined) {
234007
- this.formatted = ''
234008
- for (let i = 0; i < this.set.length; i++) {
234009
- if (i > 0) {
234010
- this.formatted += '||'
234011
- }
234012
- const comps = this.set[i]
234013
- for (let k = 0; k < comps.length; k++) {
234014
- if (k > 0) {
234015
- this.formatted += ' '
234016
- }
234017
- this.formatted += comps[k].toString().trim()
234018
- }
234019
- }
234020
- }
234021
- return this.formatted
234022
- }
234023
-
234024
- format () {
234025
- return this.range
234026
- }
234027
-
234028
- toString () {
234029
- return this.range
234030
- }
234031
-
234032
- parseRange (range) {
234033
- // strip build metadata so it can't bleed into the version
234034
- range = range.replace(BUILDSTRIPRE, '')
234035
-
234036
- // memoize range parsing for performance.
234037
- // this is a very hot path, and fully deterministic.
234038
- const memoOpts =
234039
- (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
234040
- (this.options.loose && FLAG_LOOSE)
234041
- const memoKey = memoOpts + ':' + range
234042
- const cached = cache.get(memoKey)
234043
- if (cached) {
234044
- return cached
234045
- }
234046
-
234047
- const loose = this.options.loose
234048
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
234049
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
234050
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
234051
- debug('hyphen replace', range)
234052
-
234053
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
234054
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
234055
- debug('comparator trim', range)
234056
-
234057
- // `~ 1.2.3` => `~1.2.3`
234058
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
234059
- debug('tilde trim', range)
234060
-
234061
- // `^ 1.2.3` => `^1.2.3`
234062
- range = range.replace(re[t.CARETTRIM], caretTrimReplace)
234063
- debug('caret trim', range)
234064
-
234065
- // At this point, the range is completely trimmed and
234066
- // ready to be split into comparators.
234067
-
234068
- let rangeList = range
234069
- .split(' ')
234070
- .map(comp => parseComparator(comp, this.options))
234071
- .join(' ')
234072
- .split(/\s+/)
234073
- // >=0.0.0 is equivalent to *
234074
- .map(comp => replaceGTE0(comp, this.options))
234075
-
234076
- if (loose) {
234077
- // in loose mode, throw out any that are not valid comparators
234078
- rangeList = rangeList.filter(comp => {
234079
- debug('loose invalid filter', comp, this.options)
234080
- return !!comp.match(re[t.COMPARATORLOOSE])
234081
- })
234082
- }
234083
- debug('range list', rangeList)
234084
-
234085
- // if any comparators are the null set, then replace with JUST null set
234086
- // if more than one comparator, remove any * comparators
234087
- // also, don't include the same comparator more than once
234088
- const rangeMap = new Map()
234089
- const comparators = rangeList.map(comp => new Comparator(comp, this.options))
234090
- for (const comp of comparators) {
234091
- if (isNullSet(comp)) {
234092
- return [comp]
234093
- }
234094
- rangeMap.set(comp.value, comp)
234095
- }
234096
- if (rangeMap.size > 1 && rangeMap.has('')) {
234097
- rangeMap.delete('')
234098
- }
234099
-
234100
- const result = [...rangeMap.values()]
234101
- cache.set(memoKey, result)
234102
- return result
234103
- }
234104
-
234105
- intersects (range, options) {
234106
- if (!(range instanceof Range)) {
234107
- throw new TypeError('a Range is required')
234108
- }
234109
-
234110
- return this.set.some((thisComparators) => {
234111
- return (
234112
- isSatisfiable(thisComparators, options) &&
234113
- range.set.some((rangeComparators) => {
234114
- return (
234115
- isSatisfiable(rangeComparators, options) &&
234116
- thisComparators.every((thisComparator) => {
234117
- return rangeComparators.every((rangeComparator) => {
234118
- return thisComparator.intersects(rangeComparator, options)
234119
- })
234120
- })
234121
- )
234122
- })
234123
- )
234124
- })
234125
- }
234126
-
234127
- // if ANY of the sets match ALL of its comparators, then pass
234128
- test (version) {
234129
- if (!version) {
234130
- return false
234131
- }
234132
-
234133
- if (typeof version === 'string') {
234134
- try {
234135
- version = new SemVer(version, this.options)
234136
- } catch (er) {
234137
- return false
234138
- }
234139
- }
234140
-
234141
- for (let i = 0; i < this.set.length; i++) {
234142
- if (testSet(this.set[i], version, this.options)) {
234143
- return true
234144
- }
234145
- }
234146
- return false
234147
- }
234148
- }
234149
-
234150
- module.exports = Range
234151
-
234152
- const LRU = __nccwpck_require__(91191)
234153
- const cache = new LRU()
234154
-
234155
- const parseOptions = __nccwpck_require__(36772)
234156
- const Comparator = __nccwpck_require__(71790)
234157
- const debug = __nccwpck_require__(53619)
234158
- const SemVer = __nccwpck_require__(71490)
234159
- const {
234160
- safeRe: re,
234161
- src,
234162
- t,
234163
- comparatorTrimReplace,
234164
- tildeTrimReplace,
234165
- caretTrimReplace,
234166
- } = __nccwpck_require__(84063)
234167
- const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(9073)
234168
-
234169
- // unbounded global build-metadata stripper used by parseRange
234170
- const BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')
234171
-
234172
- const isNullSet = c => c.value === '<0.0.0-0'
234173
- const isAny = c => c.value === ''
234174
-
234175
- // take a set of comparators and determine whether there
234176
- // exists a version which can satisfy it
234177
- const isSatisfiable = (comparators, options) => {
234178
- let result = true
234179
- const remainingComparators = comparators.slice()
234180
- let testComparator = remainingComparators.pop()
234181
-
234182
- while (result && remainingComparators.length) {
234183
- result = remainingComparators.every((otherComparator) => {
234184
- return testComparator.intersects(otherComparator, options)
234185
- })
234186
-
234187
- testComparator = remainingComparators.pop()
234188
- }
234189
-
234190
- return result
234191
- }
234192
-
234193
- // comprised of xranges, tildes, stars, and gtlt's at this point.
234194
- // already replaced the hyphen ranges
234195
- // turn into a set of JUST comparators.
234196
- const parseComparator = (comp, options) => {
234197
- comp = comp.replace(re[t.BUILD], '')
234198
- debug('comp', comp, options)
234199
- comp = replaceCarets(comp, options)
234200
- debug('caret', comp)
234201
- comp = replaceTildes(comp, options)
234202
- debug('tildes', comp)
234203
- comp = replaceXRanges(comp, options)
234204
- debug('xrange', comp)
234205
- comp = replaceStars(comp, options)
234206
- debug('stars', comp)
234207
- return comp
234208
- }
234209
-
234210
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
234211
-
234212
- const invalidXRangeOrder = (M, m, p) => (
234213
- (isX(M) && !isX(m)) ||
234214
- (isX(m) && p && !isX(p))
234215
- )
234216
-
234217
- // ~, ~> --> * (any, kinda silly)
234218
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
234219
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
234220
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
234221
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
234222
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
234223
- // ~0.0.1 --> >=0.0.1 <0.1.0-0
234224
- const replaceTildes = (comp, options) => {
234225
- return comp
234226
- .trim()
234227
- .split(/\s+/)
234228
- .map((c) => replaceTilde(c, options))
234229
- .join(' ')
234230
- }
234231
-
234232
- const replaceTilde = (comp, options) => {
234233
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
234234
- // if we're including prereleases in the match, then the lower bound is
234235
- // -0, the lowest possible prerelease value, just like x-ranges and carets.
234236
- // this keeps `~1.2` equivalent to the `1.2.x` x-range it's documented as.
234237
- const z = options.includePrerelease ? '-0' : ''
234238
- return comp.replace(r, (_, M, m, p, pr) => {
234239
- debug('tilde', comp, _, M, m, p, pr)
234240
- let ret
234241
-
234242
- if (isX(M)) {
234243
- ret = ''
234244
- } else if (isX(m)) {
234245
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
234246
- } else if (isX(p)) {
234247
- // ~1.2 == >=1.2.0 <1.3.0-0
234248
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
234249
- } else if (pr) {
234250
- debug('replaceTilde pr', pr)
234251
- ret = `>=${M}.${m}.${p}-${pr
234252
- } <${M}.${+m + 1}.0-0`
234253
- } else {
234254
- // ~1.2.3 == >=1.2.3 <1.3.0-0
234255
- ret = `>=${M}.${m}.${p
234256
- } <${M}.${+m + 1}.0-0`
234257
- }
234258
-
234259
- debug('tilde return', ret)
234260
- return ret
234261
- })
234262
- }
234263
-
234264
- // ^ --> * (any, kinda silly)
234265
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
234266
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
234267
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
234268
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
234269
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
234270
- // ^0.0.1 --> >=0.0.1 <0.0.2-0
234271
- // ^0.1.0 --> >=0.1.0 <0.2.0-0
234272
- const replaceCarets = (comp, options) => {
234273
- return comp
234274
- .trim()
234275
- .split(/\s+/)
234276
- .map((c) => replaceCaret(c, options))
234277
- .join(' ')
234278
- }
234279
-
234280
- const replaceCaret = (comp, options) => {
234281
- debug('caret', comp, options)
234282
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
234283
- const z = options.includePrerelease ? '-0' : ''
234284
- return comp.replace(r, (_, M, m, p, pr) => {
234285
- debug('caret', comp, _, M, m, p, pr)
234286
- let ret
234287
-
234288
- if (isX(M)) {
234289
- ret = ''
234290
- } else if (isX(m)) {
234291
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
234292
- } else if (isX(p)) {
234293
- if (M === '0') {
234294
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
234295
- } else {
234296
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
234297
- }
234298
- } else if (pr) {
234299
- debug('replaceCaret pr', pr)
234300
- if (M === '0') {
234301
- if (m === '0') {
234302
- ret = `>=${M}.${m}.${p}-${pr
234303
- } <${M}.${m}.${+p + 1}-0`
234304
- } else {
234305
- ret = `>=${M}.${m}.${p}-${pr
234306
- } <${M}.${+m + 1}.0-0`
234307
- }
234308
- } else {
234309
- ret = `>=${M}.${m}.${p}-${pr
234310
- } <${+M + 1}.0.0-0`
234311
- }
234312
- } else {
234313
- debug('no pr')
234314
- if (M === '0') {
234315
- if (m === '0') {
234316
- ret = `>=${M}.${m}.${p
234317
- } <${M}.${m}.${+p + 1}-0`
234318
- } else {
234319
- ret = `>=${M}.${m}.${p
234320
- } <${M}.${+m + 1}.0-0`
234321
- }
234322
- } else {
234323
- ret = `>=${M}.${m}.${p
234324
- } <${+M + 1}.0.0-0`
234325
- }
234326
- }
234327
-
234328
- debug('caret return', ret)
234329
- return ret
234330
- })
234331
- }
234332
-
234333
- const replaceXRanges = (comp, options) => {
234334
- debug('replaceXRanges', comp, options)
234335
- return comp
234336
- .split(/\s+/)
234337
- .map((c) => replaceXRange(c, options))
234338
- .join(' ')
234339
- }
234340
-
234341
- const replaceXRange = (comp, options) => {
234342
- comp = comp.trim()
234343
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
234344
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
234345
- debug('xRange', comp, ret, gtlt, M, m, p, pr)
234346
- if (invalidXRangeOrder(M, m, p)) {
234347
- return comp
234348
- }
234349
-
234350
- const xM = isX(M)
234351
- const xm = xM || isX(m)
234352
- const xp = xm || isX(p)
234353
- const anyX = xp
234354
-
234355
- if (gtlt === '=' && anyX) {
234356
- gtlt = ''
234357
- }
234358
-
234359
- // if we're including prereleases in the match, then we need
234360
- // to fix this to -0, the lowest possible prerelease value
234361
- pr = options.includePrerelease ? '-0' : ''
234362
-
234363
- if (xM) {
234364
- if (gtlt === '>' || gtlt === '<') {
234365
- // nothing is allowed
234366
- ret = '<0.0.0-0'
234367
- } else {
234368
- // nothing is forbidden
234369
- ret = '*'
234370
- }
234371
- } else if (gtlt && anyX) {
234372
- // we know patch is an x, because we have any x at all.
234373
- // replace X with 0
234374
- if (xm) {
234375
- m = 0
234376
- }
234377
- p = 0
234378
-
234379
- if (gtlt === '>') {
234380
- // >1 => >=2.0.0
234381
- // >1.2 => >=1.3.0
234382
- gtlt = '>='
234383
- if (xm) {
234384
- M = +M + 1
234385
- m = 0
234386
- p = 0
234387
- } else {
234388
- m = +m + 1
234389
- p = 0
234390
- }
234391
- } else if (gtlt === '<=') {
234392
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
234393
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
234394
- gtlt = '<'
234395
- if (xm) {
234396
- M = +M + 1
234397
- } else {
234398
- m = +m + 1
234399
- }
234400
- }
234401
-
234402
- if (gtlt === '<') {
234403
- pr = '-0'
234404
- }
234405
-
234406
- ret = `${gtlt + M}.${m}.${p}${pr}`
234407
- } else if (xm) {
234408
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
234409
- } else if (xp) {
234410
- ret = `>=${M}.${m}.0${pr
234411
- } <${M}.${+m + 1}.0-0`
234412
- }
234413
-
234414
- debug('xRange return', ret)
234415
-
234416
- return ret
234417
- })
234418
- }
234419
-
234420
- // Because * is AND-ed with everything else in the comparator,
234421
- // and '' means "any version", just remove the *s entirely.
234422
- const replaceStars = (comp, options) => {
234423
- debug('replaceStars', comp, options)
234424
- // Looseness is ignored here. star is always as loose as it gets!
234425
- return comp
234426
- .trim()
234427
- .replace(re[t.STAR], '')
234428
- }
234429
-
234430
- const replaceGTE0 = (comp, options) => {
234431
- debug('replaceGTE0', comp, options)
234432
- return comp
234433
- .trim()
234434
- .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
234435
- }
234436
-
234437
- // This function is passed to string.replace(re[t.HYPHENRANGE])
234438
- // M, m, patch, prerelease, build
234439
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
234440
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
234441
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
234442
- // TODO build?
234443
- const hyphenReplace = incPr => ($0,
234444
- from, fM, fm, fp, fpr, fb,
234445
- to, tM, tm, tp, tpr) => {
234446
- if (isX(fM)) {
234447
- from = ''
234448
- } else if (isX(fm)) {
234449
- from = `>=${fM}.0.0${incPr ? '-0' : ''}`
234450
- } else if (isX(fp)) {
234451
- from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
234452
- } else if (fpr) {
234453
- from = `>=${from}`
234454
- } else {
234455
- from = `>=${from}${incPr ? '-0' : ''}`
234456
- }
234457
-
234458
- if (isX(tM)) {
234459
- to = ''
234460
- } else if (isX(tm)) {
234461
- to = `<${+tM + 1}.0.0-0`
234462
- } else if (isX(tp)) {
234463
- to = `<${tM}.${+tm + 1}.0-0`
234464
- } else if (tpr) {
234465
- to = `<=${tM}.${tm}.${tp}-${tpr}`
234466
- } else if (incPr) {
234467
- to = `<${tM}.${tm}.${+tp + 1}-0`
234468
- } else {
234469
- to = `<=${to}`
234470
- }
234471
-
234472
- return `${from} ${to}`.trim()
234473
- }
234474
-
234475
- const testSet = (set, version, options) => {
234476
- for (let i = 0; i < set.length; i++) {
234477
- if (!set[i].test(version)) {
234478
- return false
234479
- }
234480
- }
234481
-
234482
- if (version.prerelease.length && !options.includePrerelease) {
234483
- // Find the set of versions that are allowed to have prereleases
234484
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
234485
- // That should allow `1.2.3-pr.2` to pass.
234486
- // However, `1.2.4-alpha.notready` should NOT be allowed,
234487
- // even though it's within the range set by the comparators.
234488
- for (let i = 0; i < set.length; i++) {
234489
- debug(set[i].semver)
234490
- if (set[i].semver === Comparator.ANY) {
234491
- continue
234492
- }
234493
-
234494
- if (set[i].semver.prerelease.length > 0) {
234495
- const allowed = set[i].semver
234496
- if (allowed.major === version.major &&
234497
- allowed.minor === version.minor &&
234498
- allowed.patch === version.patch) {
234499
- return true
234500
- }
234501
- }
234502
- }
234503
-
234504
- // Version has a -pre, but it's not one of the ones we like.
234505
- return false
234506
- }
234507
-
234508
- return true
234509
- }
234510
-
234511
-
234512
- /***/ }),
234513
-
234514
- /***/ 71490:
234515
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
234516
-
234517
-
234518
-
234519
- const debug = __nccwpck_require__(53619)
234520
- const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(9073)
234521
- const { safeRe: re, t } = __nccwpck_require__(84063)
234522
-
234523
- const parseOptions = __nccwpck_require__(36772)
234524
- const { compareIdentifiers } = __nccwpck_require__(48587)
234525
-
234526
- const isPrereleaseIdentifier = (prerelease, identifier) => {
234527
- const identifiers = identifier.split('.')
234528
- if (identifiers.length > prerelease.length) {
234529
- return false
234530
- }
234531
-
234532
- for (let i = 0; i < identifiers.length; i++) {
234533
- if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
234534
- return false
234535
- }
234536
- }
234537
-
234538
- return true
234539
- }
234540
-
234541
- class SemVer {
234542
- constructor (version, options) {
234543
- options = parseOptions(options)
234544
-
234545
- if (version instanceof SemVer) {
234546
- if (version.loose === !!options.loose &&
234547
- version.includePrerelease === !!options.includePrerelease) {
234548
- return version
234549
- } else {
234550
- version = version.version
234551
- }
234552
- } else if (typeof version !== 'string') {
234553
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
234554
- }
234555
-
234556
- if (version.length > MAX_LENGTH) {
234557
- throw new TypeError(
234558
- `version is longer than ${MAX_LENGTH} characters`
234559
- )
234560
- }
234561
-
234562
- debug('SemVer', version, options)
234563
- this.options = options
234564
- this.loose = !!options.loose
234565
- // this isn't actually relevant for versions, but keep it so that we
234566
- // don't run into trouble passing this.options around.
234567
- this.includePrerelease = !!options.includePrerelease
234568
-
234569
- const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
234570
-
234571
- if (!m) {
234572
- throw new TypeError(`Invalid Version: ${version}`)
234573
- }
234574
-
234575
- this.raw = version
234576
-
234577
- // these are actually numbers
234578
- this.major = +m[1]
234579
- this.minor = +m[2]
234580
- this.patch = +m[3]
234581
-
234582
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
234583
- throw new TypeError('Invalid major version')
234584
- }
234585
-
234586
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
234587
- throw new TypeError('Invalid minor version')
234588
- }
234589
-
234590
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
234591
- throw new TypeError('Invalid patch version')
234592
- }
234593
-
234594
- // numberify any prerelease numeric ids
234595
- if (!m[4]) {
234596
- this.prerelease = []
234597
- } else {
234598
- this.prerelease = m[4].split('.').map((id) => {
234599
- if (/^[0-9]+$/.test(id)) {
234600
- const num = +id
234601
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
234602
- return num
234603
- }
234604
- }
234605
- return id
234606
- })
234607
- }
234608
-
234609
- this.build = m[5] ? m[5].split('.') : []
234610
- this.format()
234611
- }
234612
-
234613
- format () {
234614
- this.version = `${this.major}.${this.minor}.${this.patch}`
234615
- if (this.prerelease.length) {
234616
- this.version += `-${this.prerelease.join('.')}`
234617
- }
234618
- return this.version
234619
- }
234620
-
234621
- toString () {
234622
- return this.version
234623
- }
234624
-
234625
- compare (other) {
234626
- debug('SemVer.compare', this.version, this.options, other)
234627
- if (!(other instanceof SemVer)) {
234628
- if (typeof other === 'string' && other === this.version) {
234629
- return 0
234630
- }
234631
- other = new SemVer(other, this.options)
234632
- }
234633
-
234634
- if (other.version === this.version) {
234635
- return 0
234636
- }
234637
-
234638
- return this.compareMain(other) || this.comparePre(other)
234639
- }
234640
-
234641
- compareMain (other) {
234642
- if (!(other instanceof SemVer)) {
234643
- other = new SemVer(other, this.options)
234644
- }
234645
-
234646
- if (this.major < other.major) {
234647
- return -1
234648
- }
234649
- if (this.major > other.major) {
234650
- return 1
234651
- }
234652
- if (this.minor < other.minor) {
234653
- return -1
234654
- }
234655
- if (this.minor > other.minor) {
234656
- return 1
234657
- }
234658
- if (this.patch < other.patch) {
234659
- return -1
234660
- }
234661
- if (this.patch > other.patch) {
234662
- return 1
234663
- }
234664
- return 0
234665
- }
234666
-
234667
- comparePre (other) {
234668
- if (!(other instanceof SemVer)) {
234669
- other = new SemVer(other, this.options)
234670
- }
234671
-
234672
- // NOT having a prerelease is > having one
234673
- if (this.prerelease.length && !other.prerelease.length) {
234674
- return -1
234675
- } else if (!this.prerelease.length && other.prerelease.length) {
234676
- return 1
234677
- } else if (!this.prerelease.length && !other.prerelease.length) {
234678
- return 0
234679
- }
234680
-
234681
- let i = 0
234682
- do {
234683
- const a = this.prerelease[i]
234684
- const b = other.prerelease[i]
234685
- debug('prerelease compare', i, a, b)
234686
- if (a === undefined && b === undefined) {
234687
- return 0
234688
- } else if (b === undefined) {
234689
- return 1
234690
- } else if (a === undefined) {
234691
- return -1
234692
- } else if (a === b) {
234693
- continue
234694
- } else {
234695
- return compareIdentifiers(a, b)
234696
- }
234697
- } while (++i)
234698
- }
234699
-
234700
- compareBuild (other) {
234701
- if (!(other instanceof SemVer)) {
234702
- other = new SemVer(other, this.options)
234703
- }
234704
-
234705
- let i = 0
234706
- do {
234707
- const a = this.build[i]
234708
- const b = other.build[i]
234709
- debug('build compare', i, a, b)
234710
- if (a === undefined && b === undefined) {
234711
- return 0
234712
- } else if (b === undefined) {
234713
- return 1
234714
- } else if (a === undefined) {
234715
- return -1
234716
- } else if (a === b) {
234717
- continue
234718
- } else {
234719
- return compareIdentifiers(a, b)
234720
- }
234721
- } while (++i)
234722
- }
234723
-
234724
- // preminor will bump the version up to the next minor release, and immediately
234725
- // down to pre-release. premajor and prepatch work the same way.
234726
- inc (release, identifier, identifierBase) {
234727
- if (release.startsWith('pre')) {
234728
- if (!identifier && identifierBase === false) {
234729
- throw new Error('invalid increment argument: identifier is empty')
234730
- }
234731
- // Avoid an invalid semver results
234732
- if (identifier) {
234733
- const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
234734
- if (!match || match[1] !== identifier) {
234735
- throw new Error(`invalid identifier: ${identifier}`)
234736
- }
234737
- }
234738
- }
234739
-
234740
- switch (release) {
234741
- case 'premajor':
234742
- this.prerelease.length = 0
234743
- this.patch = 0
234744
- this.minor = 0
234745
- this.major++
234746
- this.inc('pre', identifier, identifierBase)
234747
- break
234748
- case 'preminor':
234749
- this.prerelease.length = 0
234750
- this.patch = 0
234751
- this.minor++
234752
- this.inc('pre', identifier, identifierBase)
234753
- break
234754
- case 'prepatch':
234755
- // If this is already a prerelease, it will bump to the next version
234756
- // drop any prereleases that might already exist, since they are not
234757
- // relevant at this point.
234758
- this.prerelease.length = 0
234759
- this.inc('patch', identifier, identifierBase)
234760
- this.inc('pre', identifier, identifierBase)
234761
- break
234762
- // If the input is a non-prerelease version, this acts the same as
234763
- // prepatch.
234764
- case 'prerelease':
234765
- if (this.prerelease.length === 0) {
234766
- this.inc('patch', identifier, identifierBase)
234767
- }
234768
- this.inc('pre', identifier, identifierBase)
234769
- break
234770
- case 'release':
234771
- if (this.prerelease.length === 0) {
234772
- throw new Error(`version ${this.raw} is not a prerelease`)
234773
- }
234774
- this.prerelease.length = 0
234775
- break
234776
-
234777
- case 'major':
234778
- // If this is a pre-major version, bump up to the same major version.
234779
- // Otherwise increment major.
234780
- // 1.0.0-5 bumps to 1.0.0
234781
- // 1.1.0 bumps to 2.0.0
234782
- if (
234783
- this.minor !== 0 ||
234784
- this.patch !== 0 ||
234785
- this.prerelease.length === 0
234786
- ) {
234787
- this.major++
234788
- }
234789
- this.minor = 0
234790
- this.patch = 0
234791
- this.prerelease = []
234792
- break
234793
- case 'minor':
234794
- // If this is a pre-minor version, bump up to the same minor version.
234795
- // Otherwise increment minor.
234796
- // 1.2.0-5 bumps to 1.2.0
234797
- // 1.2.1 bumps to 1.3.0
234798
- if (this.patch !== 0 || this.prerelease.length === 0) {
234799
- this.minor++
234800
- }
234801
- this.patch = 0
234802
- this.prerelease = []
234803
- break
234804
- case 'patch':
234805
- // If this is not a pre-release version, it will increment the patch.
234806
- // If it is a pre-release it will bump up to the same patch version.
234807
- // 1.2.0-5 patches to 1.2.0
234808
- // 1.2.0 patches to 1.2.1
234809
- if (this.prerelease.length === 0) {
234810
- this.patch++
234811
- }
234812
- this.prerelease = []
234813
- break
234814
- // This probably shouldn't be used publicly.
234815
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
234816
- case 'pre': {
234817
- const base = Number(identifierBase) ? 1 : 0
234818
-
234819
- if (this.prerelease.length === 0) {
234820
- this.prerelease = [base]
234821
- } else {
234822
- let i = this.prerelease.length
234823
- while (--i >= 0) {
234824
- if (typeof this.prerelease[i] === 'number') {
234825
- this.prerelease[i]++
234826
- i = -2
234827
- }
234828
- }
234829
- if (i === -1) {
234830
- // didn't increment anything
234831
- if (identifier === this.prerelease.join('.') && identifierBase === false) {
234832
- throw new Error('invalid increment argument: identifier already exists')
234833
- }
234834
- this.prerelease.push(base)
234835
- }
234836
- }
234837
- if (identifier) {
234838
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
234839
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
234840
- let prerelease = [identifier, base]
234841
- if (identifierBase === false) {
234842
- prerelease = [identifier]
234843
- }
234844
- if (isPrereleaseIdentifier(this.prerelease, identifier)) {
234845
- const prereleaseBase = this.prerelease[identifier.split('.').length]
234846
- if (isNaN(prereleaseBase)) {
234847
- this.prerelease = prerelease
234848
- }
234849
- } else {
234850
- this.prerelease = prerelease
234851
- }
234852
- }
234853
- break
234854
- }
234855
- default:
234856
- throw new Error(`invalid increment argument: ${release}`)
234857
- }
234858
- this.raw = this.format()
234859
- if (this.build.length) {
234860
- this.raw += `+${this.build.join('.')}`
234861
- }
234862
- return this
234863
- }
234864
- }
234865
-
234866
- module.exports = SemVer
234867
-
234868
-
234869
- /***/ }),
234870
-
234871
- /***/ 57876:
234872
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
234873
-
234874
-
234875
-
234876
- const parse = __nccwpck_require__(58257)
234877
- const clean = (version, options) => {
234878
- const s = parse(version.trim().replace(/^[=v]+/, ''), options)
234879
- return s ? s.version : null
234880
- }
234881
- module.exports = clean
234882
-
234883
-
234884
- /***/ }),
234885
-
234886
- /***/ 48801:
234887
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
234888
-
234889
-
234890
-
234891
- const eq = __nccwpck_require__(41561)
234892
- const neq = __nccwpck_require__(18671)
234893
- const gt = __nccwpck_require__(93473)
234894
- const gte = __nccwpck_require__(42967)
234895
- const lt = __nccwpck_require__(86762)
234896
- const lte = __nccwpck_require__(80973)
234897
-
234898
- const cmp = (a, op, b, loose) => {
234899
- switch (op) {
234900
- case '===':
234901
- if (typeof a === 'object') {
234902
- a = a.version
234903
- }
234904
- if (typeof b === 'object') {
234905
- b = b.version
234906
- }
234907
- return a === b
234908
-
234909
- case '!==':
234910
- if (typeof a === 'object') {
234911
- a = a.version
234912
- }
234913
- if (typeof b === 'object') {
234914
- b = b.version
234915
- }
234916
- return a !== b
234917
-
234918
- case '':
234919
- case '=':
234920
- case '==':
234921
- return eq(a, b, loose)
234922
-
234923
- case '!=':
234924
- return neq(a, b, loose)
234925
-
234926
- case '>':
234927
- return gt(a, b, loose)
234928
-
234929
- case '>=':
234930
- return gte(a, b, loose)
234931
-
234932
- case '<':
234933
- return lt(a, b, loose)
234934
-
234935
- case '<=':
234936
- return lte(a, b, loose)
234937
-
234938
- default:
234939
- throw new TypeError(`Invalid operator: ${op}`)
234940
- }
234941
- }
234942
- module.exports = cmp
234943
-
234944
-
234945
- /***/ }),
234946
-
234947
- /***/ 96899:
234948
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
234949
-
234950
-
234951
-
234952
- const SemVer = __nccwpck_require__(71490)
234953
- const parse = __nccwpck_require__(58257)
234954
- const { safeRe: re, t } = __nccwpck_require__(84063)
234955
-
234956
- const coerce = (version, options) => {
234957
- if (version instanceof SemVer) {
234958
- return version
234959
- }
234960
-
234961
- if (typeof version === 'number') {
234962
- version = String(version)
234963
- }
234964
-
234965
- if (typeof version !== 'string') {
234966
- return null
234967
- }
234968
-
234969
- options = options || {}
234970
-
234971
- let match = null
234972
- if (!options.rtl) {
234973
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
234974
- } else {
234975
- // Find the right-most coercible string that does not share
234976
- // a terminus with a more left-ward coercible string.
234977
- // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
234978
- // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
234979
- //
234980
- // Walk through the string checking with a /g regexp
234981
- // Manually set the index so as to pick up overlapping matches.
234982
- // Stop when we get a match that ends at the string end, since no
234983
- // coercible string can be more right-ward without the same terminus.
234984
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
234985
- let next
234986
- while ((next = coerceRtlRegex.exec(version)) &&
234987
- (!match || match.index + match[0].length !== version.length)
234988
- ) {
234989
- if (!match ||
234990
- next.index + next[0].length !== match.index + match[0].length) {
234991
- match = next
234992
- }
234993
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
234994
- }
234995
- // leave it in a clean state
234996
- coerceRtlRegex.lastIndex = -1
234997
- }
234998
-
234999
- if (match === null) {
235000
- return null
235001
- }
235002
-
235003
- const major = match[2]
235004
- const minor = match[3] || '0'
235005
- const patch = match[4] || '0'
235006
- const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
235007
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
235008
-
235009
- return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
235010
- }
235011
- module.exports = coerce
235012
-
235013
-
235014
- /***/ }),
235015
-
235016
- /***/ 77375:
235017
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235018
-
235019
-
235020
-
235021
- const SemVer = __nccwpck_require__(71490)
235022
- const compareBuild = (a, b, loose) => {
235023
- const versionA = new SemVer(a, loose)
235024
- const versionB = new SemVer(b, loose)
235025
- return versionA.compare(versionB) || versionA.compareBuild(versionB)
235026
- }
235027
- module.exports = compareBuild
235028
-
235029
-
235030
- /***/ }),
235031
-
235032
- /***/ 68186:
235033
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235034
-
235035
-
235036
-
235037
- const compare = __nccwpck_require__(84905)
235038
- const compareLoose = (a, b) => compare(a, b, true)
235039
- module.exports = compareLoose
235040
-
235041
-
235042
- /***/ }),
235043
-
235044
- /***/ 84905:
235045
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235046
-
235047
-
235048
-
235049
- const SemVer = __nccwpck_require__(71490)
235050
- const compare = (a, b, loose) =>
235051
- new SemVer(a, loose).compare(new SemVer(b, loose))
235052
-
235053
- module.exports = compare
235054
-
235055
-
235056
- /***/ }),
235057
-
235058
- /***/ 83272:
235059
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235060
-
235061
-
235062
-
235063
- const parse = __nccwpck_require__(58257)
235064
-
235065
- const diff = (version1, version2) => {
235066
- const v1 = parse(version1, null, true)
235067
- const v2 = parse(version2, null, true)
235068
- const comparison = v1.compare(v2)
235069
-
235070
- if (comparison === 0) {
235071
- return null
235072
- }
235073
-
235074
- const v1Higher = comparison > 0
235075
- const highVersion = v1Higher ? v1 : v2
235076
- const lowVersion = v1Higher ? v2 : v1
235077
- const highHasPre = !!highVersion.prerelease.length
235078
- const lowHasPre = !!lowVersion.prerelease.length
235079
-
235080
- if (lowHasPre && !highHasPre) {
235081
- // Going from prerelease -> no prerelease requires some special casing
235082
-
235083
- // If the low version has only a major, then it will always be a major
235084
- // Some examples:
235085
- // 1.0.0-1 -> 1.0.0
235086
- // 1.0.0-1 -> 1.1.1
235087
- // 1.0.0-1 -> 2.0.0
235088
- if (!lowVersion.patch && !lowVersion.minor) {
235089
- return 'major'
235090
- }
235091
-
235092
- // If the main part has no difference
235093
- if (lowVersion.compareMain(highVersion) === 0) {
235094
- if (lowVersion.minor && !lowVersion.patch) {
235095
- return 'minor'
235096
- }
235097
- return 'patch'
235098
- }
235099
- }
235100
-
235101
- // add the `pre` prefix if we are going to a prerelease version
235102
- const prefix = highHasPre ? 'pre' : ''
235103
-
235104
- if (v1.major !== v2.major) {
235105
- return prefix + 'major'
235106
- }
235107
-
235108
- if (v1.minor !== v2.minor) {
235109
- return prefix + 'minor'
235110
- }
235111
-
235112
- if (v1.patch !== v2.patch) {
235113
- return prefix + 'patch'
235114
- }
235115
-
235116
- // high and low are prereleases
235117
- return 'prerelease'
235118
- }
235119
-
235120
- module.exports = diff
235121
-
235122
-
235123
- /***/ }),
235124
-
235125
- /***/ 41561:
235126
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235127
-
235128
-
235129
-
235130
- const compare = __nccwpck_require__(84905)
235131
- const eq = (a, b, loose) => compare(a, b, loose) === 0
235132
- module.exports = eq
235133
-
235134
-
235135
- /***/ }),
235136
-
235137
- /***/ 93473:
235138
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235139
-
235140
-
235141
-
235142
- const compare = __nccwpck_require__(84905)
235143
- const gt = (a, b, loose) => compare(a, b, loose) > 0
235144
- module.exports = gt
235145
-
235146
-
235147
- /***/ }),
235148
-
235149
- /***/ 42967:
235150
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235151
-
235152
-
235153
-
235154
- const compare = __nccwpck_require__(84905)
235155
- const gte = (a, b, loose) => compare(a, b, loose) >= 0
235156
- module.exports = gte
235157
-
235158
-
235159
- /***/ }),
235160
-
235161
- /***/ 25009:
235162
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235163
-
235164
-
235165
-
235166
- const SemVer = __nccwpck_require__(71490)
235167
-
235168
- const inc = (version, release, options, identifier, identifierBase) => {
235169
- if (typeof (options) === 'string') {
235170
- identifierBase = identifier
235171
- identifier = options
235172
- options = undefined
235173
- }
235174
-
235175
- try {
235176
- return new SemVer(
235177
- version instanceof SemVer ? version.version : version,
235178
- options
235179
- ).inc(release, identifier, identifierBase).version
235180
- } catch (er) {
235181
- return null
235182
- }
235183
- }
235184
- module.exports = inc
235185
-
235186
-
235187
- /***/ }),
235188
-
235189
- /***/ 86762:
235190
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235191
-
235192
-
235193
-
235194
- const compare = __nccwpck_require__(84905)
235195
- const lt = (a, b, loose) => compare(a, b, loose) < 0
235196
- module.exports = lt
235197
-
235198
-
235199
- /***/ }),
235200
-
235201
- /***/ 80973:
235202
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235203
-
235204
-
235205
-
235206
- const compare = __nccwpck_require__(84905)
235207
- const lte = (a, b, loose) => compare(a, b, loose) <= 0
235208
- module.exports = lte
235209
-
235210
-
235211
- /***/ }),
235212
-
235213
- /***/ 39799:
235214
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235215
-
235216
-
235217
-
235218
- const SemVer = __nccwpck_require__(71490)
235219
- const major = (a, loose) => new SemVer(a, loose).major
235220
- module.exports = major
235221
-
235222
-
235223
- /***/ }),
235224
-
235225
- /***/ 27600:
235226
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235227
-
235228
-
235229
-
235230
- const SemVer = __nccwpck_require__(71490)
235231
- const minor = (a, loose) => new SemVer(a, loose).minor
235232
- module.exports = minor
235233
-
235234
-
235235
- /***/ }),
235236
-
235237
- /***/ 18671:
235238
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235239
-
235240
-
235241
-
235242
- const compare = __nccwpck_require__(84905)
235243
- const neq = (a, b, loose) => compare(a, b, loose) !== 0
235244
- module.exports = neq
235245
-
235246
-
235247
- /***/ }),
235248
-
235249
- /***/ 58257:
235250
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235251
-
235252
-
235253
-
235254
- const SemVer = __nccwpck_require__(71490)
235255
- const parse = (version, options, throwErrors = false) => {
235256
- if (version instanceof SemVer) {
235257
- return version
235258
- }
235259
- try {
235260
- return new SemVer(version, options)
235261
- } catch (er) {
235262
- if (!throwErrors) {
235263
- return null
235264
- }
235265
- throw er
235266
- }
235267
- }
235268
-
235269
- module.exports = parse
235270
-
235271
-
235272
- /***/ }),
235273
-
235274
- /***/ 2112:
235275
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235276
-
235277
-
235278
-
235279
- const SemVer = __nccwpck_require__(71490)
235280
- const patch = (a, loose) => new SemVer(a, loose).patch
235281
- module.exports = patch
235282
-
235283
-
235284
- /***/ }),
235285
-
235286
- /***/ 45094:
235287
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235288
-
235289
-
235290
-
235291
- const parse = __nccwpck_require__(58257)
235292
- const prerelease = (version, options) => {
235293
- const parsed = parse(version, options)
235294
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
235295
- }
235296
- module.exports = prerelease
235297
-
235298
-
235299
- /***/ }),
235300
-
235301
- /***/ 76110:
235302
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235303
-
235304
-
235305
-
235306
- const compare = __nccwpck_require__(84905)
235307
- const rcompare = (a, b, loose) => compare(b, a, loose)
235308
- module.exports = rcompare
235309
-
235310
-
235311
- /***/ }),
235312
-
235313
- /***/ 24550:
235314
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235315
-
235316
-
235317
-
235318
- const compareBuild = __nccwpck_require__(77375)
235319
- const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
235320
- module.exports = rsort
235321
-
235322
-
235323
- /***/ }),
235324
-
235325
- /***/ 81495:
235326
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235327
-
235328
-
235329
-
235330
- const Range = __nccwpck_require__(25287)
235331
- const satisfies = (version, range, options) => {
235332
- try {
235333
- range = new Range(range, options)
235334
- } catch (er) {
235335
- return false
235336
- }
235337
- return range.test(version)
235338
- }
235339
- module.exports = satisfies
235340
-
235341
-
235342
- /***/ }),
235343
-
235344
- /***/ 56034:
235345
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235346
-
235347
-
235348
-
235349
- const compareBuild = __nccwpck_require__(77375)
235350
- const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
235351
- module.exports = sort
235352
-
235353
-
235354
- /***/ }),
235355
-
235356
- /***/ 40818:
235357
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235358
-
235359
-
235360
-
235361
- const parse = __nccwpck_require__(58257)
235362
- const constants = __nccwpck_require__(9073)
235363
- const SemVer = __nccwpck_require__(71490)
235364
-
235365
- const truncate = (version, truncation, options) => {
235366
- if (!constants.RELEASE_TYPES.includes(truncation)) {
235367
- return null
235368
- }
235369
-
235370
- const clonedVersion = cloneInputVersion(version, options)
235371
- return clonedVersion && doTruncation(clonedVersion, truncation)
235372
- }
235373
-
235374
- const cloneInputVersion = (version, options) => {
235375
- const versionStringToParse = (
235376
- version instanceof SemVer ? version.version : version
235377
- )
235378
-
235379
- return parse(versionStringToParse, options)
235380
- }
235381
-
235382
- const doTruncation = (version, truncation) => {
235383
- if (isPrerelease(truncation)) {
235384
- return version.version
235385
- }
235386
-
235387
- version.prerelease = []
235388
-
235389
- switch (truncation) {
235390
- case 'major':
235391
- version.minor = 0
235392
- version.patch = 0
235393
- break
235394
- case 'minor':
235395
- version.patch = 0
235396
- break
235397
- }
235398
-
235399
- return version.format()
235400
- }
235401
-
235402
- const isPrerelease = (type) => {
235403
- return type.startsWith('pre')
235404
- }
235405
-
235406
- module.exports = truncate
235407
-
235408
-
235409
- /***/ }),
235410
-
235411
- /***/ 3863:
235412
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235413
-
235414
-
235415
-
235416
- const parse = __nccwpck_require__(58257)
235417
- const valid = (version, options) => {
235418
- const v = parse(version, options)
235419
- return v ? v.version : null
235420
- }
235421
- module.exports = valid
235422
-
235423
-
235424
- /***/ }),
235425
-
235426
- /***/ 77546:
235427
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235428
-
235429
-
235430
-
235431
- // just pre-load all the stuff that index.js lazily exports
235432
- const internalRe = __nccwpck_require__(84063)
235433
- const constants = __nccwpck_require__(9073)
235434
- const SemVer = __nccwpck_require__(71490)
235435
- const identifiers = __nccwpck_require__(48587)
235436
- const parse = __nccwpck_require__(58257)
235437
- const valid = __nccwpck_require__(3863)
235438
- const clean = __nccwpck_require__(57876)
235439
- const inc = __nccwpck_require__(25009)
235440
- const diff = __nccwpck_require__(83272)
235441
- const major = __nccwpck_require__(39799)
235442
- const minor = __nccwpck_require__(27600)
235443
- const patch = __nccwpck_require__(2112)
235444
- const prerelease = __nccwpck_require__(45094)
235445
- const compare = __nccwpck_require__(84905)
235446
- const rcompare = __nccwpck_require__(76110)
235447
- const compareLoose = __nccwpck_require__(68186)
235448
- const compareBuild = __nccwpck_require__(77375)
235449
- const sort = __nccwpck_require__(56034)
235450
- const rsort = __nccwpck_require__(24550)
235451
- const gt = __nccwpck_require__(93473)
235452
- const lt = __nccwpck_require__(86762)
235453
- const eq = __nccwpck_require__(41561)
235454
- const neq = __nccwpck_require__(18671)
235455
- const gte = __nccwpck_require__(42967)
235456
- const lte = __nccwpck_require__(80973)
235457
- const cmp = __nccwpck_require__(48801)
235458
- const coerce = __nccwpck_require__(96899)
235459
- const truncate = __nccwpck_require__(40818)
235460
- const Comparator = __nccwpck_require__(71790)
235461
- const Range = __nccwpck_require__(25287)
235462
- const satisfies = __nccwpck_require__(81495)
235463
- const toComparators = __nccwpck_require__(382)
235464
- const maxSatisfying = __nccwpck_require__(81706)
235465
- const minSatisfying = __nccwpck_require__(97095)
235466
- const minVersion = __nccwpck_require__(80507)
235467
- const validRange = __nccwpck_require__(38029)
235468
- const outside = __nccwpck_require__(47714)
235469
- const gtr = __nccwpck_require__(9104)
235470
- const ltr = __nccwpck_require__(15072)
235471
- const intersects = __nccwpck_require__(79057)
235472
- const simplifyRange = __nccwpck_require__(69550)
235473
- const subset = __nccwpck_require__(48693)
235474
- module.exports = {
235475
- parse,
235476
- valid,
235477
- clean,
235478
- inc,
235479
- diff,
235480
- major,
235481
- minor,
235482
- patch,
235483
- prerelease,
235484
- compare,
235485
- rcompare,
235486
- compareLoose,
235487
- compareBuild,
235488
- sort,
235489
- rsort,
235490
- gt,
235491
- lt,
235492
- eq,
235493
- neq,
235494
- gte,
235495
- lte,
235496
- cmp,
235497
- coerce,
235498
- truncate,
235499
- Comparator,
235500
- Range,
235501
- satisfies,
235502
- toComparators,
235503
- maxSatisfying,
235504
- minSatisfying,
235505
- minVersion,
235506
- validRange,
235507
- outside,
235508
- gtr,
235509
- ltr,
235510
- intersects,
235511
- simplifyRange,
235512
- subset,
235513
- SemVer,
235514
- re: internalRe.re,
235515
- src: internalRe.src,
235516
- tokens: internalRe.t,
235517
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
235518
- RELEASE_TYPES: constants.RELEASE_TYPES,
235519
- compareIdentifiers: identifiers.compareIdentifiers,
235520
- rcompareIdentifiers: identifiers.rcompareIdentifiers,
235521
- }
235522
-
235523
-
235524
- /***/ }),
235525
-
235526
- /***/ 9073:
235527
- /***/ ((module) => {
235528
-
235529
-
235530
-
235531
- // Note: this is the semver.org version of the spec that it implements
235532
- // Not necessarily the package version of this code.
235533
- const SEMVER_SPEC_VERSION = '2.0.0'
235534
-
235535
- const MAX_LENGTH = 256
235536
- const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
235537
- /* istanbul ignore next */ 9007199254740991
235538
-
235539
- // Max safe segment length for coercion.
235540
- const MAX_SAFE_COMPONENT_LENGTH = 16
235541
-
235542
- // Max safe length for a build identifier. The max length minus 6 characters for
235543
- // the shortest version with a build 0.0.0+BUILD.
235544
- const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
235545
-
235546
- const RELEASE_TYPES = [
235547
- 'major',
235548
- 'premajor',
235549
- 'minor',
235550
- 'preminor',
235551
- 'patch',
235552
- 'prepatch',
235553
- 'prerelease',
235554
- ]
235555
-
235556
- module.exports = {
235557
- MAX_LENGTH,
235558
- MAX_SAFE_COMPONENT_LENGTH,
235559
- MAX_SAFE_BUILD_LENGTH,
235560
- MAX_SAFE_INTEGER,
235561
- RELEASE_TYPES,
235562
- SEMVER_SPEC_VERSION,
235563
- FLAG_INCLUDE_PRERELEASE: 0b001,
235564
- FLAG_LOOSE: 0b010,
235565
- }
235566
-
235567
-
235568
- /***/ }),
235569
-
235570
- /***/ 53619:
235571
- /***/ ((module) => {
235572
-
235573
-
235574
-
235575
- const debug = (
235576
- typeof process === 'object' &&
235577
- process.env &&
235578
- process.env.NODE_DEBUG &&
235579
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
235580
- ) ? (...args) => console.error('SEMVER', ...args)
235581
- : () => {}
235582
-
235583
- module.exports = debug
235584
-
235585
-
235586
- /***/ }),
235587
-
235588
- /***/ 48587:
235589
- /***/ ((module) => {
235590
-
235591
-
235592
-
235593
- const numeric = /^[0-9]+$/
235594
- const compareIdentifiers = (a, b) => {
235595
- if (typeof a === 'number' && typeof b === 'number') {
235596
- return a === b ? 0 : a < b ? -1 : 1
235597
- }
235598
-
235599
- const anum = numeric.test(a)
235600
- const bnum = numeric.test(b)
235601
-
235602
- if (anum && bnum) {
235603
- a = +a
235604
- b = +b
235605
- }
235606
-
235607
- return a === b ? 0
235608
- : (anum && !bnum) ? -1
235609
- : (bnum && !anum) ? 1
235610
- : a < b ? -1
235611
- : 1
235612
- }
235613
-
235614
- const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
235615
-
235616
- module.exports = {
235617
- compareIdentifiers,
235618
- rcompareIdentifiers,
235619
- }
235620
-
235621
-
235622
- /***/ }),
235623
-
235624
- /***/ 91191:
235625
- /***/ ((module) => {
235626
-
235627
-
235628
-
235629
- class LRUCache {
235630
- constructor () {
235631
- this.max = 1000
235632
- this.map = new Map()
235633
- }
235634
-
235635
- get (key) {
235636
- const value = this.map.get(key)
235637
- if (value === undefined) {
235638
- return undefined
235639
- } else {
235640
- // Remove the key from the map and add it to the end
235641
- this.map.delete(key)
235642
- this.map.set(key, value)
235643
- return value
235644
- }
235645
- }
235646
-
235647
- delete (key) {
235648
- return this.map.delete(key)
235649
- }
235650
-
235651
- set (key, value) {
235652
- const deleted = this.delete(key)
235653
-
235654
- if (!deleted && value !== undefined) {
235655
- // If cache is full, delete the least recently used item
235656
- if (this.map.size >= this.max) {
235657
- const firstKey = this.map.keys().next().value
235658
- this.delete(firstKey)
235659
- }
235660
-
235661
- this.map.set(key, value)
235662
- }
235663
-
235664
- return this
235665
- }
235666
- }
235667
-
235668
- module.exports = LRUCache
235669
-
235670
-
235671
- /***/ }),
235672
-
235673
- /***/ 36772:
235674
- /***/ ((module) => {
235675
-
235676
-
235677
-
235678
- // parse out just the options we care about
235679
- const looseOption = Object.freeze({ loose: true })
235680
- const emptyOpts = Object.freeze({ })
235681
- const parseOptions = options => {
235682
- if (!options) {
235683
- return emptyOpts
235684
- }
235685
-
235686
- if (typeof options !== 'object') {
235687
- return looseOption
235688
- }
235689
-
235690
- return options
235691
- }
235692
- module.exports = parseOptions
235693
-
235694
-
235695
- /***/ }),
235696
-
235697
- /***/ 84063:
235698
- /***/ ((module, exports, __nccwpck_require__) => {
235699
-
235700
-
235701
-
235702
- const {
235703
- MAX_SAFE_COMPONENT_LENGTH,
235704
- MAX_SAFE_BUILD_LENGTH,
235705
- MAX_LENGTH,
235706
- } = __nccwpck_require__(9073)
235707
- const debug = __nccwpck_require__(53619)
235708
- exports = module.exports = {}
235709
-
235710
- // The actual regexps go on exports.re
235711
- const re = exports.re = []
235712
- const safeRe = exports.safeRe = []
235713
- const src = exports.src = []
235714
- const safeSrc = exports.safeSrc = []
235715
- const t = exports.t = {}
235716
- let R = 0
235717
-
235718
- const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
235719
-
235720
- // Replace some greedy regex tokens to prevent regex dos issues. These regex are
235721
- // used internally via the safeRe object since all inputs in this library get
235722
- // normalized first to trim and collapse all extra whitespace. The original
235723
- // regexes are exported for userland consumption and lower level usage. A
235724
- // future breaking change could export the safer regex only with a note that
235725
- // all input should have extra whitespace removed.
235726
- const safeRegexReplacements = [
235727
- ['\\s', 1],
235728
- ['\\d', MAX_LENGTH],
235729
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
235730
- ]
235731
-
235732
- const makeSafeRegex = (value) => {
235733
- for (const [token, max] of safeRegexReplacements) {
235734
- value = value
235735
- .split(`${token}*`).join(`${token}{0,${max}}`)
235736
- .split(`${token}+`).join(`${token}{1,${max}}`)
235737
- }
235738
- return value
235739
- }
235740
-
235741
- const createToken = (name, value, isGlobal) => {
235742
- const safe = makeSafeRegex(value)
235743
- const index = R++
235744
- debug(name, index, value)
235745
- t[name] = index
235746
- src[index] = value
235747
- safeSrc[index] = safe
235748
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
235749
- safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
235750
- }
235751
-
235752
- // The following Regular Expressions can be used for tokenizing,
235753
- // validating, and parsing SemVer version strings.
235754
-
235755
- // ## Numeric Identifier
235756
- // A single `0`, or a non-zero digit followed by zero or more digits.
235757
-
235758
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
235759
- createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
235760
-
235761
- // ## Non-numeric Identifier
235762
- // Zero or more digits, followed by a letter or hyphen, and then zero or
235763
- // more letters, digits, or hyphens.
235764
-
235765
- createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
235766
-
235767
- // ## Main Version
235768
- // Three dot-separated numeric identifiers.
235769
-
235770
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
235771
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
235772
- `(${src[t.NUMERICIDENTIFIER]})`)
235773
-
235774
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
235775
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
235776
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`)
235777
-
235778
- // ## Pre-release Version Identifier
235779
- // A numeric identifier, or a non-numeric identifier.
235780
- // Non-numeric identifiers include numeric identifiers but can be longer.
235781
- // Therefore non-numeric identifiers must go first.
235782
-
235783
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
235784
- }|${src[t.NUMERICIDENTIFIER]})`)
235785
-
235786
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
235787
- }|${src[t.NUMERICIDENTIFIERLOOSE]})`)
235788
-
235789
- // ## Pre-release Version
235790
- // Hyphen, followed by one or more dot-separated pre-release version
235791
- // identifiers.
235792
-
235793
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
235794
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
235795
-
235796
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
235797
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
235798
-
235799
- // ## Build Metadata Identifier
235800
- // Any combination of digits, letters, or hyphens.
235801
-
235802
- createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
235803
-
235804
- // ## Build Metadata
235805
- // Plus sign, followed by one or more period-separated build metadata
235806
- // identifiers.
235807
-
235808
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
235809
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
235810
-
235811
- // ## Full Version String
235812
- // A main version, followed optionally by a pre-release version and
235813
- // build metadata.
235814
-
235815
- // Note that the only major, minor, patch, and pre-release sections of
235816
- // the version string are capturing groups. The build metadata is not a
235817
- // capturing group, because it should not ever be used in version
235818
- // comparison.
235819
-
235820
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
235821
- }${src[t.PRERELEASE]}?${
235822
- src[t.BUILD]}?`)
235823
-
235824
- createToken('FULL', `^${src[t.FULLPLAIN]}$`)
235825
-
235826
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
235827
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
235828
- // common in the npm registry.
235829
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
235830
- }${src[t.PRERELEASELOOSE]}?${
235831
- src[t.BUILD]}?`)
235832
-
235833
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
235834
-
235835
- createToken('GTLT', '((?:<|>)?=?)')
235836
-
235837
- // Something like "2.*" or "1.2.x".
235838
- // Note that "x.x" is a valid xRange identifier, meaning "any version"
235839
- // Only the first item is strictly required.
235840
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
235841
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
235842
-
235843
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
235844
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
235845
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
235846
- `(?:${src[t.PRERELEASE]})?${
235847
- src[t.BUILD]}?` +
235848
- `)?)?`)
235849
-
235850
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
235851
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
235852
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
235853
- `(?:${src[t.PRERELEASELOOSE]})?${
235854
- src[t.BUILD]}?` +
235855
- `)?)?`)
235856
-
235857
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
235858
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
235859
-
235860
- // Coercion.
235861
- // Extract anything that could conceivably be a part of a valid semver
235862
- createToken('COERCEPLAIN', `${'(^|[^\\d])' +
235863
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
235864
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
235865
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
235866
- createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
235867
- createToken('COERCEFULL', src[t.COERCEPLAIN] +
235868
- `(?:${src[t.PRERELEASE]})?` +
235869
- `(?:${src[t.BUILD]})?` +
235870
- `(?:$|[^\\d])`)
235871
- createToken('COERCERTL', src[t.COERCE], true)
235872
- createToken('COERCERTLFULL', src[t.COERCEFULL], true)
235873
-
235874
- // Tilde ranges.
235875
- // Meaning is "reasonably at or greater than"
235876
- createToken('LONETILDE', '(?:~>?)')
235877
-
235878
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
235879
- exports.tildeTrimReplace = '$1~'
235880
-
235881
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
235882
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
235883
-
235884
- // Caret ranges.
235885
- // Meaning is "at least and backwards compatible with"
235886
- createToken('LONECARET', '(?:\\^)')
235887
-
235888
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
235889
- exports.caretTrimReplace = '$1^'
235890
-
235891
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
235892
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
235893
-
235894
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
235895
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
235896
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
235897
-
235898
- // An expression to strip any whitespace between the gtlt and the thing
235899
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
235900
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
235901
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
235902
- exports.comparatorTrimReplace = '$1$2$3'
235903
-
235904
- // Something like `1.2.3 - 1.2.4`
235905
- // Note that these all use the loose form, because they'll be
235906
- // checked against either the strict or loose comparator form
235907
- // later.
235908
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
235909
- `\\s+-\\s+` +
235910
- `(${src[t.XRANGEPLAIN]})` +
235911
- `\\s*$`)
235912
-
235913
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
235914
- `\\s+-\\s+` +
235915
- `(${src[t.XRANGEPLAINLOOSE]})` +
235916
- `\\s*$`)
235917
-
235918
- // Star ranges basically just allow anything at all.
235919
- createToken('STAR', '(<|>)?=?\\s*\\*')
235920
- // >=0.0.0 is like a star
235921
- createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
235922
- createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
235923
-
235924
-
235925
- /***/ }),
235926
-
235927
- /***/ 9104:
235928
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235929
-
235930
-
235931
-
235932
- // Determine if version is greater than all the versions possible in the range.
235933
- const outside = __nccwpck_require__(47714)
235934
- const gtr = (version, range, options) => outside(version, range, '>', options)
235935
- module.exports = gtr
235936
-
235937
-
235938
- /***/ }),
235939
-
235940
- /***/ 79057:
235941
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235942
-
235943
-
235944
-
235945
- const Range = __nccwpck_require__(25287)
235946
- const intersects = (r1, r2, options) => {
235947
- r1 = new Range(r1, options)
235948
- r2 = new Range(r2, options)
235949
- return r1.intersects(r2, options)
235950
- }
235951
- module.exports = intersects
235952
-
235953
-
235954
- /***/ }),
235955
-
235956
- /***/ 15072:
235957
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235958
-
235959
-
235960
-
235961
- const outside = __nccwpck_require__(47714)
235962
- // Determine if version is less than all the versions possible in the range
235963
- const ltr = (version, range, options) => outside(version, range, '<', options)
235964
- module.exports = ltr
235965
-
235966
-
235967
- /***/ }),
235968
-
235969
- /***/ 81706:
235970
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
235971
-
235972
-
235973
-
235974
- const SemVer = __nccwpck_require__(71490)
235975
- const Range = __nccwpck_require__(25287)
235976
-
235977
- const maxSatisfying = (versions, range, options) => {
235978
- let max = null
235979
- let maxSV = null
235980
- let rangeObj = null
235981
- try {
235982
- rangeObj = new Range(range, options)
235983
- } catch (er) {
235984
- return null
235985
- }
235986
- versions.forEach((v) => {
235987
- if (rangeObj.test(v)) {
235988
- // satisfies(v, range, options)
235989
- if (!max || maxSV.compare(v) === -1) {
235990
- // compare(max, v, true)
235991
- max = v
235992
- maxSV = new SemVer(max, options)
235993
- }
235994
- }
235995
- })
235996
- return max
235997
- }
235998
- module.exports = maxSatisfying
235999
-
236000
-
236001
- /***/ }),
236002
-
236003
- /***/ 97095:
236004
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236005
-
236006
-
236007
-
236008
- const SemVer = __nccwpck_require__(71490)
236009
- const Range = __nccwpck_require__(25287)
236010
- const minSatisfying = (versions, range, options) => {
236011
- let min = null
236012
- let minSV = null
236013
- let rangeObj = null
236014
- try {
236015
- rangeObj = new Range(range, options)
236016
- } catch (er) {
236017
- return null
236018
- }
236019
- versions.forEach((v) => {
236020
- if (rangeObj.test(v)) {
236021
- // satisfies(v, range, options)
236022
- if (!min || minSV.compare(v) === 1) {
236023
- // compare(min, v, true)
236024
- min = v
236025
- minSV = new SemVer(min, options)
236026
- }
236027
- }
236028
- })
236029
- return min
236030
- }
236031
- module.exports = minSatisfying
236032
-
236033
-
236034
- /***/ }),
236035
-
236036
- /***/ 80507:
236037
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236038
-
236039
-
236040
-
236041
- const SemVer = __nccwpck_require__(71490)
236042
- const Range = __nccwpck_require__(25287)
236043
- const gt = __nccwpck_require__(93473)
236044
-
236045
- const minVersion = (range, loose) => {
236046
- range = new Range(range, loose)
236047
-
236048
- let minver = new SemVer('0.0.0')
236049
- if (range.test(minver)) {
236050
- return minver
236051
- }
236052
-
236053
- minver = new SemVer('0.0.0-0')
236054
- if (range.test(minver)) {
236055
- return minver
236056
- }
236057
-
236058
- minver = null
236059
- for (let i = 0; i < range.set.length; ++i) {
236060
- const comparators = range.set[i]
236061
-
236062
- let setMin = null
236063
- comparators.forEach((comparator) => {
236064
- // Clone to avoid manipulating the comparator's semver object.
236065
- const compver = new SemVer(comparator.semver.version)
236066
- switch (comparator.operator) {
236067
- case '>':
236068
- if (compver.prerelease.length === 0) {
236069
- compver.patch++
236070
- } else {
236071
- compver.prerelease.push(0)
236072
- }
236073
- compver.raw = compver.format()
236074
- /* fallthrough */
236075
- case '':
236076
- case '>=':
236077
- if (!setMin || gt(compver, setMin)) {
236078
- setMin = compver
236079
- }
236080
- break
236081
- case '<':
236082
- case '<=':
236083
- /* Ignore maximum versions */
236084
- break
236085
- /* istanbul ignore next */
236086
- default:
236087
- throw new Error(`Unexpected operation: ${comparator.operator}`)
236088
- }
236089
- })
236090
- if (setMin && (!minver || gt(minver, setMin))) {
236091
- minver = setMin
236092
- }
236093
- }
236094
-
236095
- if (minver && range.test(minver)) {
236096
- return minver
236097
- }
236098
-
236099
- return null
236100
- }
236101
- module.exports = minVersion
236102
-
236103
-
236104
- /***/ }),
236105
-
236106
- /***/ 47714:
236107
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236108
-
236109
-
236110
-
236111
- const SemVer = __nccwpck_require__(71490)
236112
- const Comparator = __nccwpck_require__(71790)
236113
- const { ANY } = Comparator
236114
- const Range = __nccwpck_require__(25287)
236115
- const satisfies = __nccwpck_require__(81495)
236116
- const gt = __nccwpck_require__(93473)
236117
- const lt = __nccwpck_require__(86762)
236118
- const lte = __nccwpck_require__(80973)
236119
- const gte = __nccwpck_require__(42967)
236120
-
236121
- const outside = (version, range, hilo, options) => {
236122
- version = new SemVer(version, options)
236123
- range = new Range(range, options)
236124
-
236125
- let gtfn, ltefn, ltfn, comp, ecomp
236126
- switch (hilo) {
236127
- case '>':
236128
- gtfn = gt
236129
- ltefn = lte
236130
- ltfn = lt
236131
- comp = '>'
236132
- ecomp = '>='
236133
- break
236134
- case '<':
236135
- gtfn = lt
236136
- ltefn = gte
236137
- ltfn = gt
236138
- comp = '<'
236139
- ecomp = '<='
236140
- break
236141
- default:
236142
- throw new TypeError('Must provide a hilo val of "<" or ">"')
236143
- }
236144
-
236145
- // If it satisfies the range it is not outside
236146
- if (satisfies(version, range, options)) {
236147
- return false
236148
- }
236149
-
236150
- // From now on, variable terms are as if we're in "gtr" mode.
236151
- // but note that everything is flipped for the "ltr" function.
236152
-
236153
- for (let i = 0; i < range.set.length; ++i) {
236154
- const comparators = range.set[i]
236155
-
236156
- let high = null
236157
- let low = null
236158
-
236159
- comparators.forEach((comparator) => {
236160
- if (comparator.semver === ANY) {
236161
- comparator = new Comparator('>=0.0.0')
236162
- }
236163
- high = high || comparator
236164
- low = low || comparator
236165
- if (gtfn(comparator.semver, high.semver, options)) {
236166
- high = comparator
236167
- } else if (ltfn(comparator.semver, low.semver, options)) {
236168
- low = comparator
236169
- }
236170
- })
236171
-
236172
- // If the edge version comparator has a operator then our version
236173
- // isn't outside it
236174
- if (high.operator === comp || high.operator === ecomp) {
236175
- return false
236176
- }
236177
-
236178
- // If the lowest version comparator has an operator and our version
236179
- // is less than it then it isn't higher than the range
236180
- if ((!low.operator || low.operator === comp) &&
236181
- ltefn(version, low.semver)) {
236182
- return false
236183
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
236184
- return false
236185
- }
236186
- }
236187
- return true
236188
- }
236189
-
236190
- module.exports = outside
236191
-
236192
-
236193
- /***/ }),
236194
-
236195
- /***/ 69550:
236196
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236197
-
236198
-
236199
-
236200
- // given a set of versions and a range, create a "simplified" range
236201
- // that includes the same versions that the original range does
236202
- // If the original range is shorter than the simplified one, return that.
236203
- const satisfies = __nccwpck_require__(81495)
236204
- const compare = __nccwpck_require__(84905)
236205
- module.exports = (versions, range, options) => {
236206
- const set = []
236207
- let first = null
236208
- let prev = null
236209
- const v = versions.sort((a, b) => compare(a, b, options))
236210
- for (const version of v) {
236211
- const included = satisfies(version, range, options)
236212
- if (included) {
236213
- prev = version
236214
- if (!first) {
236215
- first = version
236216
- }
236217
- } else {
236218
- if (prev) {
236219
- set.push([first, prev])
236220
- }
236221
- prev = null
236222
- first = null
236223
- }
236224
- }
236225
- if (first) {
236226
- set.push([first, null])
236227
- }
236228
-
236229
- const ranges = []
236230
- for (const [min, max] of set) {
236231
- if (min === max) {
236232
- ranges.push(min)
236233
- } else if (!max && min === v[0]) {
236234
- ranges.push('*')
236235
- } else if (!max) {
236236
- ranges.push(`>=${min}`)
236237
- } else if (min === v[0]) {
236238
- ranges.push(`<=${max}`)
236239
- } else {
236240
- ranges.push(`${min} - ${max}`)
236241
- }
236242
- }
236243
- const simplified = ranges.join(' || ')
236244
- const original = typeof range.raw === 'string' ? range.raw : String(range)
236245
- return simplified.length < original.length ? simplified : range
236246
- }
236247
-
236248
-
236249
- /***/ }),
236250
-
236251
- /***/ 48693:
236252
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236253
-
236254
-
236255
-
236256
- const Range = __nccwpck_require__(25287)
236257
- const Comparator = __nccwpck_require__(71790)
236258
- const { ANY } = Comparator
236259
- const satisfies = __nccwpck_require__(81495)
236260
- const compare = __nccwpck_require__(84905)
236261
-
236262
- // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
236263
- // - Every simple range `r1, r2, ...` is a null set, OR
236264
- // - Every simple range `r1, r2, ...` which is not a null set is a subset of
236265
- // some `R1, R2, ...`
236266
- //
236267
- // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
236268
- // - If c is only the ANY comparator
236269
- // - If C is only the ANY comparator, return true
236270
- // - Else if in prerelease mode, return false
236271
- // - else replace c with `[>=0.0.0]`
236272
- // - If C is only the ANY comparator
236273
- // - if in prerelease mode, return true
236274
- // - else replace C with `[>=0.0.0]`
236275
- // - Let EQ be the set of = comparators in c
236276
- // - If EQ is more than one, return true (null set)
236277
- // - Let GT be the highest > or >= comparator in c
236278
- // - Let LT be the lowest < or <= comparator in c
236279
- // - If GT and LT, and GT.semver > LT.semver, return true (null set)
236280
- // - If any C is a = range, and GT or LT are set, return false
236281
- // - If EQ
236282
- // - If GT, and EQ does not satisfy GT, return true (null set)
236283
- // - If LT, and EQ does not satisfy LT, return true (null set)
236284
- // - If EQ satisfies every C, return true
236285
- // - Else return false
236286
- // - If GT
236287
- // - If GT.semver is lower than any > or >= comp in C, return false
236288
- // - If GT is >=, and GT.semver does not satisfy every C, return false
236289
- // - If GT.semver has a prerelease, and not in prerelease mode
236290
- // - If no C has a prerelease and the GT.semver tuple, return false
236291
- // - If LT
236292
- // - If LT.semver is greater than any < or <= comp in C, return false
236293
- // - If LT is <=, and LT.semver does not satisfy every C, return false
236294
- // - If LT.semver has a prerelease, and not in prerelease mode
236295
- // - If no C has a prerelease and the LT.semver tuple, return false
236296
- // - Else return true
236297
-
236298
- const subset = (sub, dom, options = {}) => {
236299
- if (sub === dom) {
236300
- return true
236301
- }
236302
-
236303
- sub = new Range(sub, options)
236304
- dom = new Range(dom, options)
236305
- let sawNonNull = false
236306
-
236307
- OUTER: for (const simpleSub of sub.set) {
236308
- for (const simpleDom of dom.set) {
236309
- const isSub = simpleSubset(simpleSub, simpleDom, options)
236310
- sawNonNull = sawNonNull || isSub !== null
236311
- if (isSub) {
236312
- continue OUTER
236313
- }
236314
- }
236315
- // the null set is a subset of everything, but null simple ranges in
236316
- // a complex range should be ignored. so if we saw a non-null range,
236317
- // then we know this isn't a subset, but if EVERY simple range was null,
236318
- // then it is a subset.
236319
- if (sawNonNull) {
236320
- return false
236321
- }
236322
- }
236323
- return true
236324
- }
236325
-
236326
- const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
236327
- const minimumVersion = [new Comparator('>=0.0.0')]
236328
-
236329
- const simpleSubset = (sub, dom, options) => {
236330
- if (sub === dom) {
236331
- return true
236332
- }
236333
-
236334
- if (sub.length === 1 && sub[0].semver === ANY) {
236335
- if (dom.length === 1 && dom[0].semver === ANY) {
236336
- return true
236337
- } else if (options.includePrerelease) {
236338
- sub = minimumVersionWithPreRelease
236339
- } else {
236340
- sub = minimumVersion
236341
- }
236342
- }
236343
-
236344
- if (dom.length === 1 && dom[0].semver === ANY) {
236345
- if (options.includePrerelease) {
236346
- return true
236347
- } else {
236348
- dom = minimumVersion
236349
- }
236350
- }
236351
-
236352
- const eqSet = new Set()
236353
- let gt, lt
236354
- for (const c of sub) {
236355
- if (c.operator === '>' || c.operator === '>=') {
236356
- gt = higherGT(gt, c, options)
236357
- } else if (c.operator === '<' || c.operator === '<=') {
236358
- lt = lowerLT(lt, c, options)
236359
- } else {
236360
- eqSet.add(c.semver)
236361
- }
236362
- }
236363
-
236364
- if (eqSet.size > 1) {
236365
- return null
236366
- }
236367
-
236368
- let gtltComp
236369
- if (gt && lt) {
236370
- gtltComp = compare(gt.semver, lt.semver, options)
236371
- if (gtltComp > 0) {
236372
- return null
236373
- } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
236374
- return null
236375
- }
236376
- }
236377
-
236378
- // will iterate one or zero times
236379
- for (const eq of eqSet) {
236380
- if (gt && !satisfies(eq, String(gt), options)) {
236381
- return null
236382
- }
236383
-
236384
- if (lt && !satisfies(eq, String(lt), options)) {
236385
- return null
236386
- }
236387
-
236388
- for (const c of dom) {
236389
- if (!satisfies(eq, String(c), options)) {
236390
- return false
236391
- }
236392
- }
236393
-
236394
- return true
236395
- }
236396
-
236397
- let higher, lower
236398
- let hasDomLT, hasDomGT
236399
- // if the subset has a prerelease, we need a comparator in the superset
236400
- // with the same tuple and a prerelease, or it's not a subset
236401
- let needDomLTPre = lt &&
236402
- !options.includePrerelease &&
236403
- lt.semver.prerelease.length ? lt.semver : false
236404
- let needDomGTPre = gt &&
236405
- !options.includePrerelease &&
236406
- gt.semver.prerelease.length ? gt.semver : false
236407
- // exception: <1.2.3-0 is the same as <1.2.3
236408
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
236409
- lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
236410
- needDomLTPre = false
236411
- }
236412
-
236413
- for (const c of dom) {
236414
- hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
236415
- hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
236416
- if (gt) {
236417
- if (needDomGTPre) {
236418
- if (c.semver.prerelease && c.semver.prerelease.length &&
236419
- c.semver.major === needDomGTPre.major &&
236420
- c.semver.minor === needDomGTPre.minor &&
236421
- c.semver.patch === needDomGTPre.patch) {
236422
- needDomGTPre = false
236423
- }
236424
- }
236425
- if (c.operator === '>' || c.operator === '>=') {
236426
- higher = higherGT(gt, c, options)
236427
- if (higher === c && higher !== gt) {
236428
- return false
236429
- }
236430
- } else if (gt.operator === '>=' && !c.test(gt.semver)) {
236431
- return false
236432
- }
236433
- }
236434
- if (lt) {
236435
- if (needDomLTPre) {
236436
- if (c.semver.prerelease && c.semver.prerelease.length &&
236437
- c.semver.major === needDomLTPre.major &&
236438
- c.semver.minor === needDomLTPre.minor &&
236439
- c.semver.patch === needDomLTPre.patch) {
236440
- needDomLTPre = false
236441
- }
236442
- }
236443
- if (c.operator === '<' || c.operator === '<=') {
236444
- lower = lowerLT(lt, c, options)
236445
- if (lower === c && lower !== lt) {
236446
- return false
236447
- }
236448
- } else if (lt.operator === '<=' && !c.test(lt.semver)) {
236449
- return false
236450
- }
236451
- }
236452
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
236453
- return false
236454
- }
236455
- }
236456
-
236457
- // if there was a < or >, and nothing in the dom, then must be false
236458
- // UNLESS it was limited by another range in the other direction.
236459
- // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
236460
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
236461
- return false
236462
- }
236463
-
236464
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
236465
- return false
236466
- }
236467
-
236468
- // we needed a prerelease range in a specific tuple, but didn't get one
236469
- // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
236470
- // because it includes prereleases in the 1.2.3 tuple
236471
- if (needDomGTPre || needDomLTPre) {
236472
- return false
236473
- }
236474
-
236475
- return true
236476
- }
236477
-
236478
- // >=1.2.3 is lower than >1.2.3
236479
- const higherGT = (a, b, options) => {
236480
- if (!a) {
236481
- return b
236482
- }
236483
- const comp = compare(a.semver, b.semver, options)
236484
- return comp > 0 ? a
236485
- : comp < 0 ? b
236486
- : b.operator === '>' && a.operator === '>=' ? b
236487
- : a
236488
- }
236489
-
236490
- // <=1.2.3 is higher than <1.2.3
236491
- const lowerLT = (a, b, options) => {
236492
- if (!a) {
236493
- return b
236494
- }
236495
- const comp = compare(a.semver, b.semver, options)
236496
- return comp < 0 ? a
236497
- : comp > 0 ? b
236498
- : b.operator === '<' && a.operator === '<=' ? b
236499
- : a
236500
- }
236501
-
236502
- module.exports = subset
236503
-
236504
-
236505
- /***/ }),
236506
-
236507
- /***/ 382:
236508
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236509
-
236510
-
236511
-
236512
- const Range = __nccwpck_require__(25287)
236513
-
236514
- // Mostly just for testing and legacy API reasons
236515
- const toComparators = (range, options) =>
236516
- new Range(range, options).set
236517
- .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))
236518
-
236519
- module.exports = toComparators
236520
-
236521
-
236522
- /***/ }),
236523
-
236524
- /***/ 38029:
236525
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
236526
-
236527
-
236528
-
236529
- const Range = __nccwpck_require__(25287)
236530
- const validRange = (range, options) => {
236531
- try {
236532
- // Return '*' instead of '' so that truthiness works.
236533
- // This will throw if it's invalid anyway
236534
- return new Range(range, options).range || '*'
236535
- } catch (er) {
236536
- return null
236537
- }
236538
- }
236539
- module.exports = validRange
236540
-
236541
-
236542
233778
  /***/ }),
236543
233779
 
236544
233780
  /***/ 27134:
@@ -284843,8 +282079,34 @@ async function getRepoIssuesLabels(owner, repo) {
284843
282079
  description: label.description || '',
284844
282080
  color: label.color,
284845
282081
  }));
282082
+ logger.info(`Got ${metadataLabels.length} labels for ${owner}/${repo}`);
284846
282083
  return metadataLabels;
284847
282084
  }
282085
+ async function createRepoLabel(owner, repo, name, color, description) {
282086
+ logger.info(`Creating label '${name}' in ${owner}/${repo}`);
282087
+ const octokit = await getOctokitForOrg(owner);
282088
+ const res = await octokit.issues.createLabel({
282089
+ owner,
282090
+ repo,
282091
+ name,
282092
+ color,
282093
+ description,
282094
+ });
282095
+ return res.data;
282096
+ }
282097
+ async function updateRepoLabel(owner, repo, name, color, description) {
282098
+ logger.info(`Updating label '${name}' in ${owner}/${repo} color=${color} description=${description}`);
282099
+ const octokit = await getOctokitForOrg(owner);
282100
+ const res = await octokit.issues.updateLabel({
282101
+ owner,
282102
+ repo,
282103
+ name,
282104
+ color,
282105
+ description,
282106
+ });
282107
+ logger.info(`Updated label '${name}' in ${owner}/${repo} — GitHub response: color=${res.data.color} description=${res.data.description}`);
282108
+ return res.data;
282109
+ }
284848
282110
  async function isEmptyRepo(owner, name) {
284849
282111
  logger.info(`Checking if repo is empty: ${owner}/${name}`);
284850
282112
  const octokit = await getOctokitForOrg(owner);
@@ -284873,6 +282135,8 @@ async function isEmptyRepo(owner, name) {
284873
282135
  addStatusCheck,
284874
282136
  addCommitStatus,
284875
282137
  getRepoIssuesLabels,
282138
+ createRepoLabel,
282139
+ updateRepoLabel,
284876
282140
  isEmptyRepo,
284877
282141
  });
284878
282142
 
@@ -319494,9 +316758,12 @@ class UUIDInitializer extends InitializerPatches {
319494
316758
  },
319495
316759
  apply(cr) {
319496
316760
  const ctx = helperCTX(this);
319497
- const uuid = previousCR?.spec?.firestartr?.tfStateKey ||
319498
- claim.providers?.[ctx.provider]?.tfStateKey ||
319499
- (0,wrapper.v4)();
316761
+ const reusePrevious = previousCR && previousCR.kind === ctx.kind;
316762
+ const uuid = reusePrevious
316763
+ ? previousCR?.spec?.firestartr?.tfStateKey ||
316764
+ claim.providers?.[ctx.provider]?.tfStateKey ||
316765
+ (0,wrapper.v4)()
316766
+ : claim.providers?.[ctx.provider]?.tfStateKey || (0,wrapper.v4)();
319500
316767
  if (!cr.spec)
319501
316768
  cr.spec = {};
319502
316769
  if (!cr.spec.firestartr)
@@ -323159,6 +320426,49 @@ const organizationSettingsProperties = {
323159
320426
  secret_scanning_push_protection_enabled_for_new_repositories: {
323160
320427
  type: 'boolean',
323161
320428
  },
320429
+ actions_variables: {
320430
+ type: 'array',
320431
+ items: {
320432
+ type: 'object',
320433
+ properties: {
320434
+ name: {
320435
+ type: 'string',
320436
+ pattern: '^[A-Za-z0-9_]+$',
320437
+ },
320438
+ value: {
320439
+ type: 'string',
320440
+ },
320441
+ visibility: {
320442
+ type: 'string',
320443
+ enum: ['all', 'private', 'selected'],
320444
+ },
320445
+ selected_repositories: {
320446
+ type: 'array',
320447
+ items: {
320448
+ $ref: 'firestartr.dev://common/FirestartrComponentRef',
320449
+ },
320450
+ },
320451
+ },
320452
+ required: ['name', 'value', 'visibility'],
320453
+ additionalProperties: false,
320454
+ allOf: [
320455
+ {
320456
+ if: {
320457
+ properties: {
320458
+ visibility: { const: 'selected' },
320459
+ },
320460
+ required: ['visibility'],
320461
+ },
320462
+ then: {},
320463
+ else: {
320464
+ properties: {
320465
+ selected_repositories: { type: 'array', maxItems: 0 },
320466
+ },
320467
+ },
320468
+ },
320469
+ ],
320470
+ },
320471
+ },
323162
320472
  };
323163
320473
  /* harmony default export */ const github_orgsettings_schema = ({
323164
320474
  $schema: SCHEMA,
@@ -326510,7 +323820,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
326510
323820
  function isVariantCR(cr) {
326511
323821
  return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
326512
323822
  }
326513
- function getPreviousCRfromClaim(claim, previousCRs) {
323823
+ function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
326514
323824
  const previousCRsKeys = Object.keys(previousCRs);
326515
323825
  const isVariantClaim = !!claim._parentClaimName;
326516
323826
  for (const previousCRKey of previousCRsKeys) {
@@ -326519,6 +323829,8 @@ function getPreviousCRfromClaim(claim, previousCRs) {
326519
323829
  continue;
326520
323830
  if (isExcludedFromPreviousCR(previousCR.kind))
326521
323831
  continue;
323832
+ if (expectedKind && previousCR.kind !== expectedKind)
323833
+ continue;
326522
323834
  const crVariant = isVariantCR(previousCR);
326523
323835
  if (isVariantClaim && !crVariant)
326524
323836
  continue;
@@ -327533,6 +324845,254 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
327533
324845
  /** FirestartrProviderConfig */
327534
324846
  FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
327535
324847
  })(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
324848
+ /**
324849
+ * A resource to handle GitHub Organization Actions Variables.
324850
+ *
324851
+ * @schema FirestartrGithubOrganizationVariableSection
324852
+ */
324853
+ class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
324854
+ /**
324855
+ * Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
324856
+ *
324857
+ * This can be used to inline resource manifests inside other objects (e.g. as templates).
324858
+ *
324859
+ * @param props initialization props
324860
+ */
324861
+ static manifest(props) {
324862
+ return {
324863
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324864
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
324865
+ };
324866
+ }
324867
+ /**
324868
+ * Defines a "FirestartrGithubOrganizationVariableSection" API object
324869
+ * @param scope the scope in which to define this object
324870
+ * @param id a scope-local name for the object
324871
+ * @param props initialization props
324872
+ */
324873
+ constructor(scope, id, props) {
324874
+ super(scope, id, {
324875
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324876
+ ...props,
324877
+ });
324878
+ }
324879
+ /**
324880
+ * Renders the object to Kubernetes JSON.
324881
+ */
324882
+ toJson() {
324883
+ const resolved = super.toJson();
324884
+ return {
324885
+ ...FirestartrGithubOrganizationVariableSection.GVK,
324886
+ ...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
324887
+ };
324888
+ }
324889
+ }
324890
+ /**
324891
+ * Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
324892
+ */
324893
+ FirestartrGithubOrganizationVariableSection.GVK = {
324894
+ apiVersion: 'firestartr.dev/v1',
324895
+ kind: 'FirestartrGithubOrganizationVariableSection',
324896
+ };
324897
+
324898
+ /**
324899
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
324900
+ */
324901
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324902
+ function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
324903
+ if (obj === undefined) {
324904
+ return undefined;
324905
+ }
324906
+ const result = {
324907
+ 'metadata': obj.metadata,
324908
+ 'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
324909
+ };
324910
+ // filter undefined values
324911
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324912
+ }
324913
+ /**
324914
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
324915
+ */
324916
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324917
+ function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
324918
+ if (obj === undefined) {
324919
+ return undefined;
324920
+ }
324921
+ const result = {
324922
+ 'org': obj.org,
324923
+ 'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
324924
+ 'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
324925
+ 'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
324926
+ 'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
324927
+ };
324928
+ // filter undefined values
324929
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324930
+ }
324931
+ /**
324932
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
324933
+ */
324934
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324935
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
324936
+ if (obj === undefined) {
324937
+ return undefined;
324938
+ }
324939
+ const result = {
324940
+ 'name': obj.name,
324941
+ 'value': obj.value,
324942
+ 'visibility': obj.visibility,
324943
+ 'selectedRepositories': obj.selectedRepositories?.map(y => y),
324944
+ };
324945
+ // filter undefined values
324946
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324947
+ }
324948
+ /**
324949
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
324950
+ */
324951
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324952
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
324953
+ if (obj === undefined) {
324954
+ return undefined;
324955
+ }
324956
+ const result = {
324957
+ 'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
324958
+ 'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
324959
+ };
324960
+ // filter undefined values
324961
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324962
+ }
324963
+ /**
324964
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
324965
+ */
324966
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324967
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
324968
+ if (obj === undefined) {
324969
+ return undefined;
324970
+ }
324971
+ const result = {
324972
+ 'tfStateKey': obj.tfStateKey,
324973
+ };
324974
+ // filter undefined values
324975
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324976
+ }
324977
+ /**
324978
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
324979
+ */
324980
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324981
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
324982
+ if (obj === undefined) {
324983
+ return undefined;
324984
+ }
324985
+ const result = {
324986
+ 'name': obj.name,
324987
+ 'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
324988
+ };
324989
+ // filter undefined values
324990
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
324991
+ }
324992
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
324993
+ /**
324994
+ * Visibility of the variable
324995
+ *
324996
+ * @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
324997
+ */
324998
+ var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
324999
+ (function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
325000
+ /** all */
325001
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
325002
+ /** private */
325003
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
325004
+ /** selected */
325005
+ FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
325006
+ })(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
325007
+ /**
325008
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
325009
+ */
325010
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325011
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
325012
+ if (obj === undefined) {
325013
+ return undefined;
325014
+ }
325015
+ const result = {
325016
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
325017
+ };
325018
+ // filter undefined values
325019
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325020
+ }
325021
+ /**
325022
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
325023
+ */
325024
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325025
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
325026
+ if (obj === undefined) {
325027
+ return undefined;
325028
+ }
325029
+ const result = {
325030
+ 'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
325031
+ };
325032
+ // filter undefined values
325033
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325034
+ }
325035
+ /**
325036
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
325037
+ */
325038
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325039
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
325040
+ if (obj === undefined) {
325041
+ return undefined;
325042
+ }
325043
+ const result = {
325044
+ 'key': obj.key,
325045
+ };
325046
+ // filter undefined values
325047
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325048
+ }
325049
+ /**
325050
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
325051
+ */
325052
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325053
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
325054
+ if (obj === undefined) {
325055
+ return undefined;
325056
+ }
325057
+ const result = {
325058
+ 'kind': obj.kind,
325059
+ 'name': obj.name,
325060
+ };
325061
+ // filter undefined values
325062
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325063
+ }
325064
+ /**
325065
+ * Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
325066
+ */
325067
+ /* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325068
+ function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
325069
+ if (obj === undefined) {
325070
+ return undefined;
325071
+ }
325072
+ const result = {
325073
+ 'kind': obj.kind,
325074
+ 'name': obj.name,
325075
+ };
325076
+ // filter undefined values
325077
+ return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
325078
+ }
325079
+ /* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
325080
+ /**
325081
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
325082
+ */
325083
+ var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
325084
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
325085
+ /** FirestartrProviderConfig */
325086
+ FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
325087
+ })(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
325088
+ /**
325089
+ * @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
325090
+ */
325091
+ var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
325092
+ (function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
325093
+ /** FirestartrProviderConfig */
325094
+ FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
325095
+ })(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
327536
325096
  /**
327537
325097
  * A resource to handle GitHub Organization Webhooks
327538
325098
  *
@@ -330382,6 +327942,65 @@ class GithubOrgSettingsChart extends BaseGithubChart {
330382
327942
  }
330383
327943
  }
330384
327944
 
327945
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
327946
+
327947
+
327948
+
327949
+ class GithubOrgVariableSectionChart extends BaseGithubChart {
327950
+ template() {
327951
+ const claim = this.get('claim');
327952
+ const firestartrId = this.get('firestartrId');
327953
+ const githubProvider = claim.providers.github;
327954
+ const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
327955
+ const entry = {
327956
+ name: v.name,
327957
+ value: v.value,
327958
+ visibility: v.visibility,
327959
+ };
327960
+ if (v.selected_repositories && v.selected_repositories.length > 0) {
327961
+ entry.selectedRepositories = v.selected_repositories.map((ref) => {
327962
+ const match = ref.match(/^component:(.+)$/);
327963
+ if (!match) {
327964
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
327965
+ }
327966
+ const componentName = match[1];
327967
+ const resolvedCr = this.refResolver('ComponentClaim', componentName);
327968
+ const org = resolvedCr?.spec?.org;
327969
+ const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
327970
+ if (!org || !repoName) {
327971
+ throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
327972
+ }
327973
+ return `${org}/${repoName}`;
327974
+ });
327975
+ }
327976
+ return entry;
327977
+ });
327978
+ const template = {
327979
+ metadata: {
327980
+ name: githubProvider.name,
327981
+ },
327982
+ spec: {
327983
+ org: githubProvider.org,
327984
+ actionsVariables,
327985
+ firestartr: {
327986
+ tfStateKey: firestartrId,
327987
+ },
327988
+ writeConnectionSecretToRef: {
327989
+ name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
327990
+ outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
327991
+ },
327992
+ },
327993
+ };
327994
+ return JSON.parse(JSON.stringify(template));
327995
+ }
327996
+ gvk() {
327997
+ return FirestartrGithubOrganizationVariableSection.GVK;
327998
+ }
327999
+ instanceApiObject(template) {
328000
+ return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
328001
+ }
328002
+ }
328003
+
330385
328004
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
330386
328005
 
330387
328006
 
@@ -330389,6 +328008,7 @@ class GithubOrgSettingsChart extends BaseGithubChart {
330389
328008
 
330390
328009
 
330391
328010
 
328011
+
330392
328012
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
330393
328013
 
330394
328014
  class BaseCatalogChart extends BaseChart {
@@ -331136,6 +328756,7 @@ class SecretsChart extends BaseSecretsChart {
331136
328756
  SecretsChart: SecretsChart,
331137
328757
  GithubOrgWebhookChart: GithubOrgWebhookChart,
331138
328758
  GithubOrgSettingsChart: GithubOrgSettingsChart,
328759
+ GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
331139
328760
  });
331140
328761
 
331141
328762
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
@@ -331180,7 +328801,10 @@ async function renderClaims(catalogScope, firestartrScope, data) {
331180
328801
  if (configuredProvider !== AllowedProviders.all.toString()) {
331181
328802
  providers = providers.filter((provider) => provider === configuredProvider);
331182
328803
  }
331183
- const previousCR = getPreviousCRfromClaim(claim, crs);
328804
+ const expectedKind = claim.kind === 'OrgSettingsClaim'
328805
+ ? 'FirestartrGithubOrganizationSettings'
328806
+ : undefined;
328807
+ const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
331184
328808
  const patches = await extractPatches(renderClaims[claimKey], previousCR);
331185
328809
  if (!previousCR) {
331186
328810
  logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
@@ -331363,6 +328987,19 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
331363
328987
  case 'OrgSettingsClaim':
331364
328988
  if (loadGithub) {
331365
328989
  firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
328990
+ const variableSectionFirestartrId = firestartrId
328991
+ ? `${firestartrId}-variables`
328992
+ : null;
328993
+ const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, renderPatches);
328994
+ await variableSectionChart.render();
328995
+ const variableSectionObject = await variableSectionChart.postRenderer(postPatches);
328996
+ extraCharts.push({
328997
+ claim: {
328998
+ kind: claim.kind,
328999
+ name: `${claim.name}-variable-section`,
329000
+ },
329001
+ chart: variableSectionObject,
329002
+ });
331366
329003
  }
331367
329004
  break;
331368
329005
  default:
@@ -331527,6 +329164,58 @@ function validateGithubOrgSettingsSingleton(crs) {
331527
329164
  }
331528
329165
  }
331529
329166
 
329167
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
329168
+ const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
329169
+ const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
329170
+ const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
329171
+ function githubOrgVariableSection_formatResourceRef(name, claimRef) {
329172
+ return claimRef ? `${name} (claim: ${claimRef})` : name;
329173
+ }
329174
+ function validateGithubOrgVariableSectionSingleton(crs) {
329175
+ const refsByOrg = new Map();
329176
+ for (const crKey of Object.keys(crs)) {
329177
+ const cr = crs[crKey];
329178
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
329179
+ continue;
329180
+ const org = cr.spec?.org;
329181
+ if (typeof org !== 'string' || !org)
329182
+ continue;
329183
+ const name = cr.metadata?.name || crKey;
329184
+ const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
329185
+ cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
329186
+ const normalizedOrg = org.toLowerCase();
329187
+ const refs = refsByOrg.get(normalizedOrg) || [];
329188
+ refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
329189
+ refsByOrg.set(normalizedOrg, refs);
329190
+ }
329191
+ for (const [org, refs] of refsByOrg.entries()) {
329192
+ if (refs.length < 2)
329193
+ continue;
329194
+ throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
329195
+ }
329196
+ }
329197
+ function validateActionsVariablesUniqueness(crs) {
329198
+ for (const crKey of Object.keys(crs)) {
329199
+ const cr = crs[crKey];
329200
+ if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
329201
+ continue;
329202
+ const actionsVariables = cr.spec?.actionsVariables;
329203
+ if (!Array.isArray(actionsVariables))
329204
+ continue;
329205
+ const names = new Set();
329206
+ for (const variable of actionsVariables) {
329207
+ const varName = variable?.name;
329208
+ if (!varName)
329209
+ continue;
329210
+ if (names.has(varName)) {
329211
+ const org = cr.spec?.org || 'unknown';
329212
+ throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
329213
+ }
329214
+ names.add(varName);
329215
+ }
329216
+ }
329217
+ }
329218
+
331530
329219
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
331531
329220
 
331532
329221
 
@@ -331537,6 +329226,7 @@ function validateGithubOrgSettingsSingleton(crs) {
331537
329226
 
331538
329227
 
331539
329228
 
329229
+
331540
329230
  /*
331541
329231
  * Function called when rendering but not importing
331542
329232
  *
@@ -331560,6 +329250,8 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
331560
329250
  validateComponentPagesPath(data.renderClaims);
331561
329251
  validateTfStateKeyUniqueness(result);
331562
329252
  validateGithubOrgSettingsSingleton(fullCrSet);
329253
+ validateGithubOrgVariableSectionSingleton(result);
329254
+ validateActionsVariablesUniqueness(result);
331563
329255
  validateCrSizes(result);
331564
329256
  validatePermissionsUniqueness(result);
331565
329257
  }
@@ -342386,8 +340078,8 @@ const MODULES = {
342386
340078
  },
342387
340079
  FirestartrGithubRepository: {
342388
340080
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-repo',
342389
- // github-repo-v0.8.0
342390
- ref: 'c51e2fe8c4f99aa34577b6a5f721a382ff217771',
340081
+ // github-repo-v0.9.0
340082
+ ref: '76074c2817032b199962c380481617d99f78d9d7',
342391
340083
  },
342392
340084
  FirestartrGithubRepositoryFeature: {
342393
340085
  module: 'git::https://github.com/prefapp/tfm.git//modules/github-files-set',
@@ -343053,11 +340745,6 @@ function provisionPermissions(fsGithubRepository) {
343053
340745
  }
343054
340746
 
343055
340747
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/helpers/labels.ts
343056
- // if we are to provision labels using tofu and the label already
343057
- // exists, we should not attempt to re-create it. This function checks
343058
- // if the label exists and if so, imports it into Terraform state. This is needed because
343059
- // tofu does not have an "upsert" operation for labels, so we need to check
343060
- // if the label exists before trying to create it, otherwise we will get an error.
343061
340748
 
343062
340749
 
343063
340750
 
@@ -343069,7 +340756,7 @@ async function provisionLabels(fsGithubRepository, repoAlreadyExists) {
343069
340756
  return;
343070
340757
  }
343071
340758
  if (repoAlreadyExists) {
343072
- await importLabelsIfNeeded(fsGithubRepository);
340759
+ await importLabelsIfNeeded(fsGithubRepository, labels);
343073
340760
  }
343074
340761
  for (const label of labels) {
343075
340762
  gh_provisioner_src_logger.debug(`[gh-provisioner] ${fsGithubRepository.k8sId} provisioning label ${label.name}`);
@@ -343089,20 +340776,27 @@ async function provisionLabels(fsGithubRepository, repoAlreadyExists) {
343089
340776
  throw new Error(`Error on provisionLabels: ${err}`);
343090
340777
  }
343091
340778
  }
343092
- async function importLabelsIfNeeded(fsGithubRepository) {
340779
+ async function importLabelsIfNeeded(fsGithubRepository, declaredLabels) {
343093
340780
  const cr = fsGithubRepository.cr;
343094
340781
  try {
343095
- const labels = cr.spec.repo.labels;
343096
- gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} checking if labels need to be imported`);
340782
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} checking if labels need to be imported (${declaredLabels.length} declared)`);
343097
340783
  const repoIssuesList = await fsGithubRepository.runWithGithubProvider(async () => {
343098
340784
  return await github["default"].repo.getRepoIssuesLabels(cr.spec.org, cr.name);
343099
340785
  });
343100
- // labels that already exist in GitHub must be imported into Terraform state
343101
- // so that Terraform manages them rather than trying to create them (which would fail)
343102
- for (const label of labels) {
343103
- if (!checkIfLabelExists(label.name, repoIssuesList)) {
340786
+ for (const label of declaredLabels) {
340787
+ const existing = findExistingLabel(label.name, repoIssuesList);
340788
+ if (!existing) {
340789
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} label '${label.name}' not found on GitHub — will be created by TFM`);
343104
340790
  continue;
343105
340791
  }
340792
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} label '${label.name}' on GitHub: color="${existing.color}" desc="${existing.description}" | CR declares: color="${label.color}" desc="${label.description}"`);
340793
+ if (existing.color !== label.color ||
340794
+ (label.description && existing.description !== label.description)) {
340795
+ gh_provisioner_src_logger.info(`[gh-provisioner] ${fsGithubRepository.k8sId} updating pre-existing label '${label.name}' via GitHub API to match CR values`);
340796
+ await fsGithubRepository.runWithGithubProvider(async () => {
340797
+ await github["default"].repo.updateRepoLabel(cr.spec.org, cr.name, label.name, label.color, label.description);
340798
+ });
340799
+ }
343106
340800
  fsGithubRepository.patchImportData({
343107
340801
  op: PatchOperations.add,
343108
340802
  path: '/imports/-',
@@ -343118,8 +340812,8 @@ async function importLabelsIfNeeded(fsGithubRepository) {
343118
340812
  throw new Error(`Error on importLabelsIfNeeded: ${err}`);
343119
340813
  }
343120
340814
  }
343121
- function checkIfLabelExists(labelName, repoIssuesList) {
343122
- return repoIssuesList.some((label) => label.name === labelName);
340815
+ function findExistingLabel(labelName, repoIssuesList) {
340816
+ return repoIssuesList.find((label) => label.name === labelName);
343123
340817
  }
343124
340818
 
343125
340819
  ;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghrepo/helpers/branch_protections.ts
@@ -343764,6 +341458,19 @@ async function runOnTerraform(entity, command, customArgs, opts = {}) {
343764
341458
  const importCommands = ['import-with-reimport', 'custom-import', 'import'];
343765
341459
  const isImportLike = importCommands.includes(command);
343766
341460
  // Always force importMode=true for all import-like commands.
341461
+ // Apply-time adoption: when an apply runs and the entity has pending import
341462
+ // entries (e.g. labels that already exist on GitHub), the bridge runs the
341463
+ // regular apply with importMode=true. Import blocks are evaluated and
341464
+ // consumed by the same single apply, importing pre-existing resources into
341465
+ // state and reconciling them in one step.
341466
+ //
341467
+ // See ADR 0006: Apply-time adoption of existing GitHub resources via import blocks.
341468
+ const importDoc = entity.importDocument;
341469
+ if (command === 'apply' && importDoc.imports.length > 0) {
341470
+ const importResult = await runTerraformProvisioner(tp_bridge_buildContext(entity, reuseExistingProject, true), 'apply', streaming, importDoc, opts.ctl);
341471
+ entity.__ghProvisionerSessionWorkspaceInitialized = true;
341472
+ return importResult;
341473
+ }
343767
341474
  const result = await runTerraformProvisioner(tp_bridge_buildContext(entity, reuseExistingProject, isImportLike ? true : false), command, streaming, customArgs, opts.ctl);
343768
341475
  if (!entity.__ghProvisionerSessionWorkspaceInitialized &&
343769
341476
  isWorkspaceInitializingCommand) {
@@ -524854,34 +522561,9 @@ const crsStatusSubcommand = {
524854
522561
  };
524855
522562
 
524856
522563
  ;// CONCATENATED MODULE: ./package.json
524857
- const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-02"}');
522564
+ const package_namespaceObject = JSON.parse('{"i8":"2.9.0-snapshot-org-variables-section-1"}');
524858
522565
  ;// CONCATENATED MODULE: ../../package.json
524859
522566
  const package_namespaceObject_1 = {"i8":"2.8.0"};
524860
- // EXTERNAL MODULE: ../../node_modules/semver/index.js
524861
- var semver = __nccwpck_require__(77546);
524862
- var semver_default = /*#__PURE__*/__nccwpck_require__.n(semver);
524863
- ;// CONCATENATED MODULE: ./src/version.ts
524864
-
524865
-
524866
- function isSnapshot(version) {
524867
- return version.includes('-snapshot');
524868
- }
524869
- function validateVersionConstraint(constraint, version, options) {
524870
- if (!semver_default().validRange(constraint)) {
524871
- throw new Error(`Invalid version constraint: "${constraint}"`);
524872
- }
524873
- const targetVersion = version || package_namespaceObject.i8;
524874
- if (isSnapshot(targetVersion)) {
524875
- if (options?.ignoreSnapshots)
524876
- return true;
524877
- throw new Error(`Snapshot version "${targetVersion}" is not a valid semver release; use --ignore-snapshots to allow snapshots`);
524878
- }
524879
- if (!semver_default().valid(targetVersion)) {
524880
- throw new Error(`Invalid version: "${targetVersion}"`);
524881
- }
524882
- return semver_default().satisfies(targetVersion, constraint);
524883
- }
524884
-
524885
522567
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
524886
522568
 
524887
522569
 
@@ -524892,34 +522574,6 @@ function validateVersionConstraint(constraint, version, options) {
524892
522574
 
524893
522575
 
524894
522576
 
524895
-
524896
-
524897
- const versionSubcommand = {
524898
- description: 'Show CLI version or validate a version constraint',
524899
- requiredEnv: [],
524900
- subparameters: [
524901
- { name: 'validate', type: String },
524902
- { name: 'cli-version', type: String },
524903
- { name: 'ignore-snapshots', type: Boolean },
524904
- ],
524905
- run: async (options) => {
524906
- if (options['validate']) {
524907
- const constraint = options['validate'];
524908
- const targetVersion = options['cli-version'] || package_namespaceObject.i8;
524909
- const ignoreSnapshots = options['ignore-snapshots'];
524910
- if (validateVersionConstraint(constraint, targetVersion, {
524911
- ignoreSnapshots,
524912
- })) {
524913
- console.log(`CLI version ${targetVersion} satisfies constraint "${constraint}"`);
524914
- }
524915
- else {
524916
- throw new Error(`Version constraint "${constraint}" not met by CLI version ${targetVersion}`);
524917
- }
524918
- return;
524919
- }
524920
- showCliVersion();
524921
- },
524922
- };
524923
522577
  const SUBCOMMANDS = {
524924
522578
  import: importSubcommand,
524925
522579
  importer: importSubcommand,
@@ -524928,7 +522582,6 @@ const SUBCOMMANDS = {
524928
522582
  cdk8s: cdk8s_rendererSubcommands,
524929
522583
  analyzer: crs_analyzerSubcommand,
524930
522584
  'crs-status': crsStatusSubcommand,
524931
- version: versionSubcommand,
524932
522585
  };
524933
522586
  // Check that the subcommand exists and it's env is defined
524934
522587
  function validateAndGetSubcommand(name) {
@@ -524981,6 +522634,9 @@ class CommandLine {
524981
522634
  case 'help':
524982
522635
  showSubcommandsHelp();
524983
522636
  break;
522637
+ case 'version':
522638
+ showCliVersion();
522639
+ break;
524984
522640
  default: {
524985
522641
  // Get the subcommand data
524986
522642
  const subcommandData = validateAndGetSubcommand(subcommand);