Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[unstable] BREAKING(semver): remove comparator.semver field #4533

Merged
merged 5 commits into from Mar 28, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Mar 28, 2024

We decided to migrate Comparator type from:

type Comparator = {
  operator?: Operator,
  semver: SemVer,
}

To:

type Comparator = {
  operator?: Operator,
  major: number,
  minor: number,
  patch: number,
  prerelease?: (number | string)[],
  build?: string[]
}

as part of #4161. This reduces the nesting structure of Range type one level.

Currently we have the below comparator type for supporting both types in transition period:

type Comparator = {
  operator?: Operator,
  major: number,
  minor: number,
  patch: number,
  prerelease?: (number | string)[],
  build?: string[],
  semver?: SemVer,
}

This PR removes semver? field from the existing Comparator type to end the support of the old Comparator type.

Copy link
Collaborator

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! One nit.

Comment on lines 55 to 57
const major = comparator.major;
const minor = comparator.minor;
const patch = comparator.patch;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe destructure with const { prerelease } = comparator; above?

@iuioiua
Copy link
Collaborator

iuioiua commented Mar 28, 2024

Also, can you please include context and background in the initial comment so users can trace?

@kt3k kt3k merged commit b8c110d into denoland:main Mar 28, 2024
13 checks passed
@kt3k kt3k deleted the remove-comparator-semver branch March 28, 2024 04:18
eryue0220 added a commit to eryue0220/deno_std that referenced this pull request Mar 30, 2024
…220/deno_std into feat/expect-addSnapshotSerializer

* 'feat/expect-addSnapshotSerializer' of github.com:eryue0220/deno_std:
  deprecation(crypto): rename an export to match style guide, deprecating original and two other obsolete imports (denoland#4525)
  chore: add `--allow-dirty` flag to publish dry run (denoland#4535)
  [unstable] BREAKING(semver): remove comparator.semver field (denoland#4533)
  chore(crypto): upgrade dependencies (denoland#4530)
  0.221.0 (denoland#4531)
  docs(fs): polish documentation (denoland#4526)
  fix(fs): `SubdirectoryMoveError` extends `Error` correctly (denoland#4528)
  chore(fs): remove `test.ts` (denoland#4527)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants