mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 12:28:50 +00:00
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
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:
parent
b8cf259924
commit
dee94473c4
@ -164,8 +164,19 @@ fn get_validated_scheme(
|
||||
) -> Result<String, AnyError> {
|
||||
let scheme = specifier.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!(
|
||||
"Unsupported scheme \"{scheme}\" for module \"{specifier}\". Supported schemes: {SUPPORTED_SCHEMES:#?}"
|
||||
"Unsupported scheme \"{scheme}\" for module \"{specifier}\". Supported schemes:\n{}",
|
||||
scheme_list
|
||||
)))
|
||||
} else {
|
||||
Ok(scheme.to_string())
|
||||
|
5
tests/specs/npm/typo_in_npm/__test__.jsonc
Normal file
5
tests/specs/npm/typo_in_npm/__test__.jsonc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"args": "run np:cowsay",
|
||||
"output": "main.out",
|
||||
"exitCode": 1
|
||||
}
|
8
tests/specs/npm/typo_in_npm/main.out
Normal file
8
tests/specs/npm/typo_in_npm/main.out
Normal file
@ -0,0 +1,8 @@
|
||||
error: Unsupported scheme "np" for module "np:cowsay". Supported schemes:
|
||||
- "blob"
|
||||
- "data"
|
||||
- "file"
|
||||
- "http"
|
||||
- "https"
|
||||
- "jsr"
|
||||
- "npm"
|
@ -1,7 +1,8 @@
|
||||
error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes: [
|
||||
"data",
|
||||
"blob",
|
||||
"file",
|
||||
"http",
|
||||
"https",
|
||||
]
|
||||
error: Uncaught (in promise) TypeError: Unsupported scheme "xxx" for module "xxx:". Supported schemes:
|
||||
- "blob"
|
||||
- "data"
|
||||
- "file"
|
||||
- "http"
|
||||
- "https"
|
||||
- "jsr"
|
||||
- "npm"
|
||||
|
15
tests/testdata/run/extension_import.ts.out
vendored
15
tests/testdata/run/extension_import.ts.out
vendored
@ -1,8 +1,9 @@
|
||||
error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes: [
|
||||
"data",
|
||||
"blob",
|
||||
"file",
|
||||
"http",
|
||||
"https",
|
||||
]
|
||||
error: Unsupported scheme "ext" for module "ext:runtime/01_errors.js". Supported schemes:
|
||||
- "blob"
|
||||
- "data"
|
||||
- "file"
|
||||
- "http"
|
||||
- "https"
|
||||
- "jsr"
|
||||
- "npm"
|
||||
at [WILDCARD]/extension_import.ts:1:8
|
||||
|
Loading…
Reference in New Issue
Block a user