rolldown 1.3.0-x86_64-linux-gnu → 1.3.0.1-x86_64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2dd620cffde325ef8ae1bfb20626838f3a955e1562c54b879512a6f4e8771fb
4
- data.tar.gz: 572e59f4196a03d044c6f8722d41c8b9856f2e17788fd68eca794f7bed5ba614
3
+ metadata.gz: def295d67c62baa9081a834257a38634efb707fbb97ad1693e5a39c7566a5f55
4
+ data.tar.gz: 56fe835af8b224be12ef256bab022eeab331d7ce2472dc4122a2474eee2c66a8
5
5
  SHA512:
6
- metadata.gz: 5fb5b79582700f937ef920fc848b4938d8ed387cdde82964b59a400f0fd70aec6ecfec186d350a682e6e7b2eedf842fa5a7537c7790b25549ba8064273df2abf
7
- data.tar.gz: 6fb03bc00d563ae0fdcaa2118ec5168d495ec7ffe5366ed7e01bbad8c6e51d811f87ef1c6ad60c5223ea514a84b92f6548d2188667529c02483c5ec2efff7a95
6
+ metadata.gz: ff5e99771d7470ded2bfc4988fbc16f16e1b821ef071b8e7c94971fa9d608333265bbf8679124f1f7fe48282cdf62d43555f3ecf58fccfde614afb89f312b3f9
7
+ data.tar.gz: 1fa580b41b7bb674b9269e4267bb43efb12249202b9133a325489e299b446efb360ed8ffd1d2904ef90aac06004d43b296529e4ebefddb705917f5d9a291da1b
data/README.md CHANGED
@@ -95,7 +95,7 @@ Rolldown.build(
95
95
  )
96
96
  ```
97
97
 
98
- They mix freely with what is on disk. A module in memory can import an npm package or a relative file, and a file on disk can import a module in memory. A relative import out of a module in memory resolves against that module's own name, so give it a path-shaped one when it needs to reach real files next to it.
98
+ They mix freely with what is on disk. A module in memory can import an npm package or a relative file, and a file on disk can import a module in memory. A relative import out of a module in memory resolves against that module's own name, so give it a path-shaped one when it needs to reach real files next to it. From there it resolves the way an import from disk does, against `cwd`, so an import with no extension and a directory with an `index` file are both found.
99
99
 
100
100
  This exists so a generator can transform sources in Ruby first and bundle the result without writing anything out. There are no plugins, and no Ruby runs while the bundle does.
101
101
 
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rolldown
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.0.1"
5
5
  end
data/rust/src/modules.rs CHANGED
@@ -5,7 +5,7 @@ use std::path::{Component, Path, PathBuf};
5
5
  use arcstr::ArcStr;
6
6
  use rolldown_plugin::{
7
7
  HookLoadArgs, HookLoadOutput, HookLoadReturn, HookResolveIdArgs, HookResolveIdOutput, HookResolveIdReturn, HookUsage,
8
- Plugin, PluginContext, SharedLoadPluginContext,
8
+ Plugin, PluginContext, PluginContextResolveOptions, SharedLoadPluginContext,
9
9
  };
10
10
 
11
11
  #[derive(Debug)]
@@ -30,7 +30,7 @@ impl Plugin for VirtualModules {
30
30
  HookUsage::ResolveId | HookUsage::Load
31
31
  }
32
32
 
33
- async fn resolve_id(&self, _ctx: &PluginContext, args: &HookResolveIdArgs<'_>) -> HookResolveIdReturn {
33
+ async fn resolve_id(&self, ctx: &PluginContext, args: &HookResolveIdArgs<'_>) -> HookResolveIdReturn {
34
34
  if self.sources.contains_key(args.specifier) {
35
35
  return Ok(Some(HookResolveIdOutput {
36
36
  id: ArcStr::from(args.specifier),
@@ -50,12 +50,39 @@ impl Plugin for VirtualModules {
50
50
  return Ok(None);
51
51
  };
52
52
 
53
- let Some(resolved) = normalize(&directory.join(args.specifier)) else {
53
+ let joined = directory.join(args.specifier);
54
+
55
+ let Some(resolved) = normalize(&joined) else {
56
+ return Ok(None);
57
+ };
58
+
59
+ if self.sources.contains_key(&resolved) {
60
+ return Ok(Some(HookResolveIdOutput::from_id(resolved)));
61
+ }
62
+
63
+ let Some(absolute) = normalize(&ctx.cwd().join(joined)) else {
64
+ return Ok(None);
65
+ };
66
+
67
+ let options = PluginContextResolveOptions {
68
+ import_kind: args.kind,
69
+ skip_self: true,
70
+ custom: args.custom.clone(),
71
+ ..Default::default()
72
+ };
73
+
74
+ let Ok(on_disk) = ctx.resolve(&absolute, None, Some(options)).await? else {
54
75
  return Ok(None);
55
76
  };
56
77
 
57
78
  Ok(Some(HookResolveIdOutput {
58
- id: ArcStr::from(resolved),
79
+ id: on_disk.id.as_arc_str().clone(),
80
+ external: Some(on_disk.external),
81
+ normalize_external_id: on_disk.normalize_external_id,
82
+ side_effects: on_disk.side_effects,
83
+ package_json_path: on_disk
84
+ .package_json
85
+ .map(|package| package.realpath().to_string_lossy().into_owned()),
59
86
  ..Default::default()
60
87
  }))
61
88
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rolldown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.0.1
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Marco Roth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-05 00:00:00.000000000 Z
11
+ date: 2026-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby bindings for Rolldown, the Rust bundler behind Vite.
14
14
  email: