-
Notifications
You must be signed in to change notification settings - Fork 657
chore: support up to Deno LTS and refine supported Deno versions logic #6670
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
Open
iuioiua
wants to merge
11
commits into
denoland:main
Choose a base branch
from
iuioiua:support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
26343b9
chore: support up to Deno LTS and refine supported Deno versions logic
iuioiua 3e93ca9
tweaks
iuioiua c503a58
fixes
iuioiua 590cd2b
tweak
iuioiua bf41771
tweaks and fixes
iuioiua aa2cf10
docs
iuioiua a1ad298
tweak
iuioiua 9c0f12f
Merge branch 'main' into support
iuioiua 89f33fd
fix
iuioiua 4c1ff4b
tweaks
iuioiua c36fc76
Merge branch 'main' into support
iuioiua File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
deno: | ||
- v1.x | ||
- v2.x | ||
- lts | ||
- vx.x.x | ||
- canary | ||
os: | ||
- ubuntu-latest | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea here is that when code or tests will automatically fail once the Deno LTS version is upgraded in CI. Then, we can go in and update the relevant code, dropping support for functionality that's outside of LTS. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2018-2025 the Deno authors. MIT license. | ||
import { greaterOrEqual } from "../semver/greater_or_equal.ts"; | ||
import { parse } from "../semver/parse.ts"; | ||
|
||
/** | ||
* Checks if the current Deno version is greater than or equal to the specified | ||
* minimum version. | ||
* | ||
* @param minVersion Minimum version to check against. | ||
* @returns `true` if the current Deno version is greater than or equal to the | ||
* specified minimum version, `false` otherwise. | ||
* | ||
* @example Basic usage | ||
* ```ts no-assert | ||
* import { isDenoVersionGreaterOrEqual } from "@std/internal/support"; | ||
* | ||
* if (isDenoVersionGreaterOrEqual("1.0.0")) { | ||
* console.log("Deno version is greater than or equal to 1.0.0"); | ||
* } else { | ||
* console.log("Deno version is less than 1.0.0"); | ||
* } | ||
* ``` | ||
*/ | ||
export function isDenoVersionGreaterOrEqual(minVersion: string): boolean { | ||
// deno-lint-ignore no-explicit-any | ||
return (Deno.version as any) && | ||
greaterOrEqual(parse(Deno.version.deno), parse(minVersion)); | ||
} | ||
|
||
/** | ||
* Whether the current Deno version supports the | ||
* {@link https://docs.deno.com/runtime/reference/lint_plugins/ | lint plugin API}. | ||
*/ | ||
export const IS_LINT_PLUGIN_SUPPORTED: boolean = isDenoVersionGreaterOrEqual( | ||
"2.2.0", | ||
); | ||
|
||
/** | ||
* Whether the current Deno version is 2.0.0 or greater. | ||
*/ | ||
export const IS_DENO_2: boolean = isDenoVersionGreaterOrEqual("2.0.0"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While mostly used internally, the public endpoint here is created for use by other public APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like recommending other libs to use this endpoint? I'm not in favor of that policy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't. Like the other endpoints in this package, it's for internal use only. Do you suggest another name?