Skip to content

Commit

Permalink
Merge branch 'main' into fetch-error-rework
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Kettmeir <[email protected]>
  • Loading branch information
crowlKats authored Oct 18, 2024
2 parents 84309a9 + 8ca8174 commit 80029fb
Show file tree
Hide file tree
Showing 173 changed files with 1,416 additions and 788 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ const Runners = {
macosArm: {
os: "macos",
arch: "aarch64",
runner: macosArmRunner,
runner:
`\${{ github.repository == 'denoland/deno' && 'self-hosted' || '${macosArmRunner}' }}`,
},
windowsX86: {
os: "windows",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ jobs:
skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}'
- os: macos
arch: aarch64
runner: macos-14
runner: '${{ github.repository == ''denoland/deno'' && ''self-hosted'' || ''macos-14'' }}'
job: test
profile: debug
- os: macos
arch: aarch64
runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-22.04'' || ''macos-14'' }}'
runner: '${{ (!contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'')) && ''ubuntu-22.04'' || github.repository == ''denoland/deno'' && ''self-hosted'' || ''macos-14'' }}'
job: test
profile: release
skip: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && (github.event_name == ''pull_request'') }}'
Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions cli/npm/managed/cache/registry_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ impl RegistryInfoDownloader {

fn get_package_url(&self, name: &str) -> Url {
let registry_url = self.npmrc.get_registry_url(name);
// The '/' character in scoped package names "@scope/name" must be
// encoded for older third party registries. Newer registries and
// npm itself support both ways
// - encoded: https://registry.npmjs.org/@rollup%2fplugin-json
// - non-ecoded: https://registry.npmjs.org/@rollup/plugin-json
// To support as many third party registries as possible we'll
// always encode the '/' character.

// list of all characters used in npm packages:
// !, ', (, ), *, -, ., /, [0-9], @, [A-Za-z], _, ~
const ASCII_SET: percent_encoding::AsciiSet =
Expand All @@ -253,11 +261,14 @@ impl RegistryInfoDownloader {
.remove(b'*')
.remove(b'-')
.remove(b'.')
.remove(b'/')
.remove(b'@')
.remove(b'_')
.remove(b'~');
let name = percent_encoding::utf8_percent_encode(name, &ASCII_SET);
registry_url.join(&name.to_string()).unwrap()
registry_url
// Ensure that scoped package name percent encoding is lower cased
// to match npm.
.join(&name.to_string().replace("%2F", "%2f"))
.unwrap()
}
}
23 changes: 13 additions & 10 deletions cli/tools/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use deno_core::anyhow::bail;
use deno_core::error::AnyError;
use deno_core::resolve_url_or_path;
use deno_core::serde_json;
use deno_core::url;
use deno_graph::Dependency;
use deno_graph::GraphKind;
use deno_graph::Module;
Expand Down Expand Up @@ -51,18 +52,20 @@ pub async fn info(
let npmrc = cli_options.npmrc();
let resolver = factory.workspace_resolver().await?;

let maybe_import_specifier =
if let Some(import_map) = resolver.maybe_import_map() {
if let Ok(imports_specifier) =
import_map.resolve(&specifier, import_map.base_url())
{
Some(imports_specifier)
} else {
None
}
let cwd_url =
url::Url::from_directory_path(cli_options.initial_cwd()).unwrap();

let maybe_import_specifier = if let Some(import_map) =
resolver.maybe_import_map()
{
if let Ok(imports_specifier) = import_map.resolve(&specifier, &cwd_url) {
Some(imports_specifier)
} else {
None
};
}
} else {
None
};

let specifier = match maybe_import_specifier {
Some(specifier) => specifier,
Expand Down
2 changes: 2 additions & 0 deletions ext/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ sha1.workspace = true
sha2.workspace = true
signature.workspace = true
spki.workspace = true
thiserror.workspace = true
tokio.workspace = true
uuid.workspace = true
x25519-dalek = "2.0.0"
Loading

0 comments on commit 80029fb

Please sign in to comment.