Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98132da0fc | ||
|
|
7ffa934358 | ||
|
|
c8eb1dde81 | ||
|
|
89aa0e0d5e | ||
|
|
c49581ed7e | ||
|
|
7804f34e4e | ||
|
|
1db61b73b7 | ||
|
|
31fa436e1b | ||
|
|
05812acac1 | ||
|
|
d92ea1ce50 | ||
|
|
8ad69a40de | ||
|
|
0b8c883861 | ||
|
|
7aca53e7aa | ||
|
|
1bbb581925 | ||
|
|
e3eb8ec361 | ||
|
|
8d925269a4 | ||
|
|
84e0c70520 | ||
|
|
a200f3ba3f | ||
|
|
fd9f084892 | ||
|
|
42839e8c28 | ||
|
|
ca45e22652 | ||
|
|
7d51ab74df |
+319
@@ -1,3 +1,322 @@
|
||||
# v17.8.0 (Mon Jun 29 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Include ancestor build details on a fully TurboSnapped build [#1406](https://github.com/chromaui/chromatic-cli/pull/1406) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.7.2 (Fri Jun 26 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Only upload metadata files with a valid S3 path [#1408](https://github.com/chromaui/chromatic-cli/pull/1408) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.7.1 (Thu Jun 25 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- React Native: Parse build command from config file [#1405](https://github.com/chromaui/chromatic-cli/pull/1405) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.7.0 (Thu Jun 25 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Skip upload, verify, and snapshot tasks when detecting no changes from TurboSnap [#1394](https://github.com/chromaui/chromatic-cli/pull/1394) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.6.0 (Wed Jun 24 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Automatically upload metadata files on TurboSnap bails [#1400](https://github.com/chromaui/chromatic-cli/pull/1400) ([@codykaup](https://github.com/codykaup))
|
||||
- Log untraced files and its matching glob [#1403](https://github.com/chromaui/chromatic-cli/pull/1403) ([@codykaup](https://github.com/codykaup))
|
||||
- Show full trace path to bail file reason [#1401](https://github.com/chromaui/chromatic-cli/pull/1401) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.5.0 (Wed Jun 17 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add context around file adds/moves in `BaselineCheckoutFailedError` bails [#1391](https://github.com/chromaui/chromatic-cli/pull/1391) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.4.1 (Thu Jun 11 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- fix: e2e build command ignores arguments when used with npm [#1385](https://github.com/chromaui/chromatic-cli/pull/1385) ([@sentience](https://github.com/sentience) [@AriPerkkio](https://github.com/AriPerkkio) [@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
#### Authors: 3
|
||||
|
||||
- Ari Perkkiö ([@AriPerkkio](https://github.com/AriPerkkio))
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Kevin Yank ([@sentience](https://github.com/sentience))
|
||||
|
||||
---
|
||||
|
||||
# v17.4.0 (Tue Jun 09 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add additional bail details to `invalidChangedFiles` [#1355](https://github.com/chromaui/chromatic-cli/pull/1355) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Update Codecov to fix GPG issue [#1387](https://github.com/chromaui/chromatic-cli/pull/1387) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.3.0 (Fri Jun 05 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- :wrench: Add a configuration parameter that controls git timeout. [#1371](https://github.com/chromaui/chromatic-cli/pull/1371) ([@jwir3](https://github.com/jwir3))
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Remove unused `subdir` directory [#1381](https://github.com/chromaui/chromatic-cli/pull/1381) ([@codykaup](https://github.com/codykaup))
|
||||
- Increase Sentry message length [#1380](https://github.com/chromaui/chromatic-cli/pull/1380) ([@codykaup](https://github.com/codykaup))
|
||||
- Bump `typescript-eslint` to fix TypeScript warning [#1373](https://github.com/chromaui/chromatic-cli/pull/1373) ([@codykaup](https://github.com/codykaup))
|
||||
- Drop `slash` dependency for internal helper [#1374](https://github.com/chromaui/chromatic-cli/pull/1374) ([@codykaup](https://github.com/codykaup))
|
||||
- `react-native-build`: Don't overwrite artifacts without permission. [#1364](https://github.com/chromaui/chromatic-cli/pull/1364) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Set `patch` label for Dependabot PRs [#1370](https://github.com/chromaui/chromatic-cli/pull/1370) ([@codykaup](https://github.com/codykaup))
|
||||
- Update Dependabot to skip test fixture dependencies [#1363](https://github.com/chromaui/chromatic-cli/pull/1363) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 3
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Scott Johnson ([@jwir3](https://github.com/jwir3))
|
||||
|
||||
---
|
||||
|
||||
# v17.2.0 (Mon Jun 01 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Join individual bail subreasons into a single field [#1357](https://github.com/chromaui/chromatic-cli/pull/1357) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.1.0 (Wed May 27 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add additional bail details to `changedPackageFiles` [#1344](https://github.com/chromaui/chromatic-cli/pull/1344) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v17.0.1 (Tue May 26 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Delay check of `build-storybook` script validation [#1327](https://github.com/chromaui/chromatic-cli/pull/1327) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Force `es-toolkit` version to avoid bundle error in Yarn classic smoke test [#1347](https://github.com/chromaui/chromatic-cli/pull/1347) ([@codykaup](https://github.com/codykaup))
|
||||
- Fix TurboSnap mis-categorizing static assets as Storybook config changes [#1340](https://github.com/chromaui/chromatic-cli/pull/1340) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
---
|
||||
|
||||
# v17.0.0 (Tue May 19 2026)
|
||||
|
||||
#### 💥 Breaking Change
|
||||
|
||||
- Drop support for Node 20 and define supported Node engines [#1334](https://github.com/chromaui/chromatic-cli/pull/1334) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Promotes `prepare`, `build`, and `verify` tasks to modules [#1331](https://github.com/chromaui/chromatic-cli/pull/1331) ([@justin-thurman](https://github.com/justin-thurman))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
- Justin Thurman ([@justin-thurman](https://github.com/justin-thurman))
|
||||
|
||||
---
|
||||
|
||||
# v16.10.1 (Fri May 15 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Fix `getUncommittedHash` in Windows environments [#1332](https://github.com/chromaui/chromatic-cli/pull/1332) ([@codykaup](https://github.com/codykaup))
|
||||
- Increase flaky test timeout [#1326](https://github.com/chromaui/chromatic-cli/pull/1326) ([@codykaup](https://github.com/codykaup))
|
||||
- Refactor `initialize` task to use typed inputs and outputs [#1323](https://github.com/chromaui/chromatic-cli/pull/1323) ([@justin-thurman](https://github.com/justin-thurman))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
- Justin Thurman ([@justin-thurman](https://github.com/justin-thurman))
|
||||
|
||||
---
|
||||
|
||||
# v16.10.0 (Mon May 11 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add `share()` to Node API [#1284](https://github.com/chromaui/chromatic-cli/pull/1284) ([@codykaup](https://github.com/codykaup) [@katiebayes](https://github.com/katiebayes))
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Migrate `gitInfo` task to typed inputs and outputs [#1314](https://github.com/chromaui/chromatic-cli/pull/1314) ([@justin-thurman](https://github.com/justin-thurman))
|
||||
- Add config option for building multiple Android architectures [#1321](https://github.com/chromaui/chromatic-cli/pull/1321) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
#### Authors: 4
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Justin Thurman ([@justin-thurman](https://github.com/justin-thurman))
|
||||
- Katie Bayes ([@katiebayes](https://github.com/katiebayes))
|
||||
|
||||
---
|
||||
|
||||
# v16.9.1 (Thu May 07 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Add additional environment variables to RN build [#1319](https://github.com/chromaui/chromatic-cli/pull/1319) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
---
|
||||
|
||||
# v16.9.0 (Wed May 06 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Allow skip without a project token [#1310](https://github.com/chromaui/chromatic-cli/pull/1310) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v16.8.0 (Tue May 05 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add test for external storybook config changes and TS [#1316](https://github.com/chromaui/chromatic-cli/pull/1316) ([@tmeasday](https://github.com/tmeasday))
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Move `xcodebuild` to shared executor [#1318](https://github.com/chromaui/chromatic-cli/pull/1318) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Only build Android ABI for x86_64 [#1308](https://github.com/chromaui/chromatic-cli/pull/1308) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Add output environment variable to RN builds [#1307](https://github.com/chromaui/chromatic-cli/pull/1307) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Tom Coleman ([@tmeasday](https://github.com/tmeasday))
|
||||
|
||||
---
|
||||
|
||||
# v16.7.0 (Mon May 04 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
- Add React Native build stage [#1297](https://github.com/chromaui/chromatic-cli/pull/1297) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Make Storybook metadata output generic [#1311](https://github.com/chromaui/chromatic-cli/pull/1311) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Migrate `setStorybookInfo` task to typed inputs and outputs [#1306](https://github.com/chromaui/chromatic-cli/pull/1306) ([@justin-thurman](https://github.com/justin-thurman))
|
||||
- Scaffolding for removing `Context` from CLI task bodies [#1302](https://github.com/chromaui/chromatic-cli/pull/1302) ([@justin-thurman](https://github.com/justin-thurman))
|
||||
|
||||
#### Authors: 3
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
- Justin Thurman ([@justin-thurman](https://github.com/justin-thurman))
|
||||
|
||||
---
|
||||
|
||||
# v16.6.3 (Wed Apr 29 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Retry file upload if file deduplication fails [#1296](https://github.com/chromaui/chromatic-cli/pull/1296) ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v16.6.2 (Wed Apr 29 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- Fix crash when checking for CLI updates [#1305](https://github.com/chromaui/chromatic-cli/pull/1305) ([@annaet](https://github.com/annaet) [@codykaup](https://github.com/codykaup))
|
||||
|
||||
#### Authors: 2
|
||||
|
||||
- Anna Thomas ([@annaet](https://github.com/annaet))
|
||||
- Cody Kaup ([@codykaup](https://github.com/codykaup))
|
||||
|
||||
---
|
||||
|
||||
# v16.6.1 (Tue Apr 28 2026)
|
||||
|
||||
#### 🐛 Bug Fix
|
||||
|
||||
- On React Native builds check for ABI compatibility before upload [#1295](https://github.com/chromaui/chromatic-cli/pull/1295) ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
#### Authors: 1
|
||||
|
||||
- John Hobbs ([@jmhobbs](https://github.com/jmhobbs))
|
||||
|
||||
---
|
||||
|
||||
# v16.6.0 (Thu Apr 23 2026)
|
||||
|
||||
#### 🚀 Enhancement
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ inputs:
|
||||
description: 'Disregard these files and their dependencies when tracing dependent stories for TurboSnap'
|
||||
required: false
|
||||
uploadMetadata:
|
||||
description: 'Upload Chromatic metadata files as part of the published Storybook'
|
||||
description: 'Upload Chromatic metadata files as part of the published Storybook. Defaults to enabled when TurboSnap is requested.'
|
||||
required: false
|
||||
vitest:
|
||||
description: 'Run build against `@chromatic-com/vitest` test archives'
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1896
-1289
File diff suppressed because one or more lines are too long
+17
-6
@@ -100,7 +100,7 @@ Options:
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
prepatch, prerelease, or release. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
@@ -110,8 +110,9 @@ Options:
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-n <0|1>
|
||||
This is the base to be used for the prerelease identifier.
|
||||
-n <0|1|false>
|
||||
Base number for prerelease identifier (default: 0).
|
||||
Use false to omit the number altogether.
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
@@ -141,6 +142,8 @@ A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer
|
||||
specification but should not be used anymore.
|
||||
|
||||
## Ranges
|
||||
|
||||
@@ -237,6 +240,13 @@ $ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
To get out of the prerelease phase, use the `release` option:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.1 -i release
|
||||
1.2.4
|
||||
```
|
||||
|
||||
#### Prerelease Identifier Base
|
||||
|
||||
The method `.inc` takes an optional parameter 'identifierBase' string
|
||||
@@ -415,10 +425,10 @@ Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release, options, identifier, identifierBase)`:
|
||||
* `inc(v, releaseType, options, identifier, identifierBase)`:
|
||||
Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
`prepatch`, `prerelease`, or `release`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
@@ -426,6 +436,7 @@ strings that they parse.
|
||||
same as `prepatch`. It increments the patch version and then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `release` will remove any prerelease part of the version.
|
||||
* `identifier` can be used to prefix `premajor`, `preminor`,
|
||||
`prepatch`, or `prerelease` version increments. `identifierBase`
|
||||
is the base to be used for the `prerelease` identifier.
|
||||
@@ -477,7 +488,7 @@ strings that they parse.
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid.
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
|
||||
+5
-2
@@ -3,6 +3,8 @@
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
'use strict'
|
||||
|
||||
const argv = process.argv.slice(2)
|
||||
|
||||
let versions = []
|
||||
@@ -61,6 +63,7 @@ const main = () => {
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
case 'release':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
@@ -102,7 +105,7 @@ const main = () => {
|
||||
versions = versions.map((v) => {
|
||||
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||
}).filter((v) => {
|
||||
return semver.valid(v)
|
||||
return semver.valid(v, options)
|
||||
})
|
||||
if (!versions.length) {
|
||||
return fail()
|
||||
@@ -149,7 +152,7 @@ Options:
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
prepatch, prerelease, or release. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const ANY = Symbol('SemVer ANY')
|
||||
// hoisted class for cyclic dependency
|
||||
class Comparator {
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
SemVer: require('./semver.js'),
|
||||
Range: require('./range.js'),
|
||||
|
||||
+3
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SPACE_CHARACTERS = /\s+/g
|
||||
|
||||
// hoisted class for cyclic dependency
|
||||
@@ -253,6 +255,7 @@ const isSatisfiable = (comparators, options) => {
|
||||
// already replaced the hyphen ranges
|
||||
// turn into a set of JUST comparators.
|
||||
const parseComparator = (comp, options) => {
|
||||
comp = comp.replace(re[t.BUILD], '')
|
||||
debug('comp', comp, options)
|
||||
comp = replaceCarets(comp, options)
|
||||
debug('caret', comp)
|
||||
|
||||
+41
-10
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const debug = require('../internal/debug')
|
||||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
@@ -10,7 +12,7 @@ class SemVer {
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
if (version.loose === !!options.loose &&
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
return version
|
||||
} else {
|
||||
version = version.version
|
||||
@@ -109,11 +111,25 @@ class SemVer {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
return (
|
||||
compareIdentifiers(this.major, other.major) ||
|
||||
compareIdentifiers(this.minor, other.minor) ||
|
||||
compareIdentifiers(this.patch, other.patch)
|
||||
)
|
||||
if (this.major < other.major) {
|
||||
return -1
|
||||
}
|
||||
if (this.major > other.major) {
|
||||
return 1
|
||||
}
|
||||
if (this.minor < other.minor) {
|
||||
return -1
|
||||
}
|
||||
if (this.minor > other.minor) {
|
||||
return 1
|
||||
}
|
||||
if (this.patch < other.patch) {
|
||||
return -1
|
||||
}
|
||||
if (this.patch > other.patch) {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
comparePre (other) {
|
||||
@@ -176,6 +192,19 @@ class SemVer {
|
||||
// preminor will bump the version up to the next minor release, and immediately
|
||||
// down to pre-release. premajor and prepatch work the same way.
|
||||
inc (release, identifier, identifierBase) {
|
||||
if (release.startsWith('pre')) {
|
||||
if (!identifier && identifierBase === false) {
|
||||
throw new Error('invalid increment argument: identifier is empty')
|
||||
}
|
||||
// Avoid an invalid semver results
|
||||
if (identifier) {
|
||||
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
|
||||
if (!match || match[1] !== identifier) {
|
||||
throw new Error(`invalid identifier: ${identifier}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (release) {
|
||||
case 'premajor':
|
||||
this.prerelease.length = 0
|
||||
@@ -206,6 +235,12 @@ class SemVer {
|
||||
}
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
case 'release':
|
||||
if (this.prerelease.length === 0) {
|
||||
throw new Error(`version ${this.raw} is not a prerelease`)
|
||||
}
|
||||
this.prerelease.length = 0
|
||||
break
|
||||
|
||||
case 'major':
|
||||
// If this is a pre-major version, bump up to the same major version.
|
||||
@@ -249,10 +284,6 @@ class SemVer {
|
||||
case 'pre': {
|
||||
const base = Number(identifierBase) ? 1 : 0
|
||||
|
||||
if (!identifier && identifierBase === false) {
|
||||
throw new Error('invalid increment argument: identifier is empty')
|
||||
}
|
||||
|
||||
if (this.prerelease.length === 0) {
|
||||
this.prerelease = [base]
|
||||
} else {
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse')
|
||||
const clean = (version, options) => {
|
||||
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const eq = require('./eq')
|
||||
const neq = require('./neq')
|
||||
const gt = require('./gt')
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = require('./parse')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const compareBuild = (a, b, loose) => {
|
||||
const versionA = new SemVer(a, loose)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const compareLoose = (a, b) => compare(a, b, true)
|
||||
module.exports = compareLoose
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const compare = (a, b, loose) =>
|
||||
new SemVer(a, loose).compare(new SemVer(b, loose))
|
||||
|
||||
+8
-13
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse.js')
|
||||
|
||||
const diff = (version1, version2) => {
|
||||
@@ -27,20 +29,13 @@ const diff = (version1, version2) => {
|
||||
return 'major'
|
||||
}
|
||||
|
||||
// Otherwise it can be determined by checking the high version
|
||||
|
||||
if (highVersion.patch) {
|
||||
// anything higher than a patch bump would result in the wrong version
|
||||
// If the main part has no difference
|
||||
if (lowVersion.compareMain(highVersion) === 0) {
|
||||
if (lowVersion.minor && !lowVersion.patch) {
|
||||
return 'minor'
|
||||
}
|
||||
return 'patch'
|
||||
}
|
||||
|
||||
if (highVersion.minor) {
|
||||
// anything higher than a minor bump would result in the wrong version
|
||||
return 'minor'
|
||||
}
|
||||
|
||||
// bumping major/minor/patch all have same result
|
||||
return 'major'
|
||||
}
|
||||
|
||||
// add the `pre` prefix if we are going to a prerelease version
|
||||
@@ -58,7 +53,7 @@ const diff = (version1, version2) => {
|
||||
return prefix + 'patch'
|
||||
}
|
||||
|
||||
// high and low are preleases
|
||||
// high and low are prereleases
|
||||
return 'prerelease'
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||
module.exports = eq
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||
module.exports = gt
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const gte = (a, b, loose) => compare(a, b, loose) >= 0
|
||||
module.exports = gte
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const inc = (version, release, options, identifier, identifierBase) => {
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const lt = (a, b, loose) => compare(a, b, loose) < 0
|
||||
module.exports = lt
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const lte = (a, b, loose) => compare(a, b, loose) <= 0
|
||||
module.exports = lte
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const major = (a, loose) => new SemVer(a, loose).major
|
||||
module.exports = major
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const minor = (a, loose) => new SemVer(a, loose).minor
|
||||
module.exports = minor
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const neq = (a, b, loose) => compare(a, b, loose) !== 0
|
||||
module.exports = neq
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = (version, options, throwErrors = false) => {
|
||||
if (version instanceof SemVer) {
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const patch = (a, loose) => new SemVer(a, loose).patch
|
||||
module.exports = patch
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse')
|
||||
const prerelease = (version, options) => {
|
||||
const parsed = parse(version, options)
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const rcompare = (a, b, loose) => compare(b, a, loose)
|
||||
module.exports = rcompare
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user