fix: update message for unsupported schemes with npm and jsr (#26884)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (aarch64, test, linux, debug, ubicloud-standard-16-arm) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (aarch64, test, linux, release, ubicloud-standard-16-arm, true) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (aarch64, test, macos, debug, ${{ github.repository == 'denoland/deno' && startsWith(github.ref, 'refs/tags/') && 'self-hosted' || 'macos-14' }}) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (aarch64, test, macos, release, ${{ (!contains(github.event.pull_request.labels.*.name, 'ci-full') && (github.event_name == 'pull_request')) && 'ubuntu-24.04' || github.reposit… (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, bench, linux, release, ${{ (!contains(github.event.pull_request.labels.*.name, 'ci-full') && (github.event_name == 'pull_request' && !contains(github.event.pull_reques… (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, lint, linux, debug, ubuntu-24.04) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, lint, macos, debug, macos-13) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, lint, windows, debug, windows-2022) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, test, linux, debug, ubuntu-24.04, true) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, test, linux, release, ${{ github.repository == 'denoland/deno' && 'ubuntu-24.04-xl' || 'ubuntu-24.04' }}, true, ${{ !startsWith(github.ref, 'refs/tags/') }}) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, test, macos, debug, macos-13) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, test, macos, release, ${{ (!contains(github.event.pull_request.labels.*.name, 'ci-full') && (github.event_name == 'pull_request')) && 'ubuntu-24.04' || 'macos-13' }}, … (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, test, windows, debug, windows-2022) (push) Blocked by required conditions
ci / ${{ matrix.job }} ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }} (x86_64, test, windows, release, ${{ (!contains(github.event.pull_request.labels.*.name, 'ci-full') && (github.event_name == 'pull_request')) && 'ubuntu-24.04' || github.reposi… (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions

Closes https://github.com/denoland/deno/issues/26596
This commit is contained in:
Bartek Iwańczuk 2024-11-15 17:09:19 +00:00 committed by GitHub
parent b8cf259924
commit dee94473c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 41 additions and 15 deletions

View File

@ -164,8 +164,19 @@ fn get_validated_scheme(
) -> Result<String, AnyError> { ) -> Result<String, AnyError> {
let scheme = specifier.scheme(); let scheme = specifier.scheme();
if !SUPPORTED_SCHEMES.contains(&scheme) { if !SUPPORTED_SCHEMES.contains(&scheme) {
// NOTE(bartlomieju): this message list additional `npm` and `jsr` schemes, but they should actually be handled
// before `file_fetcher.rs` APIs are even hit.
let mut all_supported_schemes = SUPPORTED_SCHEMES.to_vec();
all_supported_schemes.extend_from_slice(&["npm", "jsr"]);
all_supported_schemes.sort();
let scheme_list = all_supported_schemes
.iter()
.map(|scheme| format!(" - \"{}\"", scheme))
.collect::<Vec<_>>()
.join("\n");
Err(generic_error(format!( Err(generic_error(format!(
"Unsupported scheme \"{scheme}\" for module \"{specifier}\". Supported schemes: {SUPPORTED_SCHEMES:#?}" "Unsupported scheme \"{scheme}\" for module \"{specifier}\". Supported schemes:\n{}",
scheme_list
))) )))
} else { } else {
Ok(scheme.to_string()) Ok(scheme.to_string())

View File

@ -0,0 +1,5 @@
{
"args": "run np:cowsay",
"output": "main.out",
"exitCode": 1
}

View File

@ -0,0 +1,8 @@
error: Unsupported scheme "np" for module "np:cowsay". Supported schemes:
- "blob"
- "data"
- "file"
- "http"
- "https"
- "jsr"
- "npm"

View File

@ -1,7 +1,8 @@
error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes: [ error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes:
"data", - "blob"
"blob", - "data"
"file", - "file"
"http", - "http"
"https", - "https"
] - "jsr"
- "npm"

View File

@ -1,8 +1,9 @@
error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes: [ error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes:
"data", - "blob"
"blob", - "data"
"file", - "file"
"http", - "http"
"https", - "https"
] - "jsr"
- "npm"
at [WILDCARD]/extension_import.ts:1:8 at [WILDCARD]/extension_import.ts:1:8