rolldown 0.1.0-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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +152 -0
  4. data/ext/rolldown/extconf.rb +123 -0
  5. data/ext/rolldown/include/rolldown.h +54 -0
  6. data/ext/rolldown/rolldown.c +130 -0
  7. data/lib/rolldown/3.2/rolldown.so +0 -0
  8. data/lib/rolldown/3.3/rolldown.so +0 -0
  9. data/lib/rolldown/3.4/rolldown.so +0 -0
  10. data/lib/rolldown/4.0/rolldown.so +0 -0
  11. data/lib/rolldown/asset.rb +33 -0
  12. data/lib/rolldown/backend.rb +36 -0
  13. data/lib/rolldown/build_result.rb +106 -0
  14. data/lib/rolldown/chunk.rb +70 -0
  15. data/lib/rolldown/diagnostic.rb +56 -0
  16. data/lib/rolldown/errors.rb +11 -0
  17. data/lib/rolldown/options.rb +152 -0
  18. data/lib/rolldown/version.rb +5 -0
  19. data/lib/rolldown.rb +50 -0
  20. data/licenses/README.md +8 -0
  21. data/licenses/rolldown-MIT.txt +25 -0
  22. data/licenses/rolldown-THIRD-PARTY.txt +33 -0
  23. data/rolldown.gemspec +43 -0
  24. data/rust/Cargo.lock +3086 -0
  25. data/rust/Cargo.toml +37 -0
  26. data/rust/build.rs +55 -0
  27. data/rust/cbindgen.toml +24 -0
  28. data/rust/rustfmt.toml +3 -0
  29. data/rust/src/build.rs +39 -0
  30. data/rust/src/lib.rs +92 -0
  31. data/rust/src/modules.rs +89 -0
  32. data/rust/src/options.rs +251 -0
  33. data/rust/src/payload.rs +104 -0
  34. data/rust/src/result.rs +49 -0
  35. data/sig/rolldown/asset.rbs +23 -0
  36. data/sig/rolldown/backend.rbs +26 -0
  37. data/sig/rolldown/build_result.rbs +47 -0
  38. data/sig/rolldown/chunk.rbs +39 -0
  39. data/sig/rolldown/diagnostic.rbs +35 -0
  40. data/sig/rolldown/errors.rbs +24 -0
  41. data/sig/rolldown/options.rbs +61 -0
  42. data/sig/rolldown/version.rbs +5 -0
  43. data/sig/rolldown.rbs +12 -0
  44. metadata +92 -0
@@ -0,0 +1,49 @@
1
+ use std::ffi::CString;
2
+ use std::os::raw::c_char;
3
+
4
+ #[repr(C)]
5
+ pub enum RolldownErrorCode {
6
+ None = 0,
7
+ Option,
8
+ Encoding,
9
+ Build,
10
+ Io,
11
+ Internal,
12
+ Panic,
13
+ }
14
+
15
+ #[repr(C)]
16
+ pub struct RolldownResult {
17
+ pub value: *mut c_char,
18
+ pub value_len: usize,
19
+ pub error: *mut c_char,
20
+ pub code: RolldownErrorCode,
21
+ }
22
+
23
+ impl RolldownResult {
24
+ pub fn value(payload: String) -> Self {
25
+ let len = payload.len();
26
+
27
+ match CString::new(payload) {
28
+ Ok(value) => Self {
29
+ value: value.into_raw(),
30
+ value_len: len,
31
+ error: std::ptr::null_mut(),
32
+ code: RolldownErrorCode::None,
33
+ },
34
+ Err(_) => Self::error(RolldownErrorCode::Encoding, "the payload contained a null byte"),
35
+ }
36
+ }
37
+
38
+ pub fn error(code: RolldownErrorCode, message: impl Into<String>) -> Self {
39
+ let message = CString::new(message.into())
40
+ .unwrap_or_else(|_| CString::new("an error with no printable message").expect("no interior nul"));
41
+
42
+ Self {
43
+ value: std::ptr::null_mut(),
44
+ value_len: 0,
45
+ error: message.into_raw(),
46
+ code,
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,23 @@
1
+ # Generated from lib/rolldown/asset.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ class Asset
5
+ attr_reader filename: String
6
+
7
+ attr_reader names: Array[String]
8
+
9
+ attr_reader source: String?
10
+
11
+ # : (Hash[String, untyped]) -> Rolldown::Asset
12
+ def self.from_hash: (Hash[String, untyped]) -> Rolldown::Asset
13
+
14
+ # : (filename: String, names: Array[String], source: String?) -> void
15
+ def initialize: (filename: String, names: Array[String], source: String?) -> void
16
+
17
+ # : () -> String
18
+ def to_s: () -> String
19
+
20
+ # : () -> String
21
+ def inspect: () -> String
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ # Generated from lib/rolldown/backend.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ module Backend
5
+ module Unavailable
6
+ # : (String) -> String
7
+ def build: (String) -> String
8
+
9
+ # : () -> String
10
+ def panic_for_test: () -> String
11
+
12
+ # : () -> String
13
+ def version: () -> String
14
+
15
+ # : () -> String
16
+ def rolldown_version: () -> String
17
+
18
+ private
19
+
20
+ # : (Symbol?) -> bot
21
+ def unavailable: (Symbol?) -> bot
22
+ end
23
+
24
+ extend Unavailable
25
+ end
26
+ end
@@ -0,0 +1,47 @@
1
+ # Generated from lib/rolldown/build_result.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ class BuildResult
5
+ attr_reader chunks: Array[Rolldown::Chunk]
6
+
7
+ attr_reader assets: Array[Rolldown::Asset]
8
+
9
+ attr_reader warnings: Array[Rolldown::Diagnostic]
10
+
11
+ attr_reader errors: Array[Rolldown::Diagnostic]
12
+
13
+ attr_reader dir: String?
14
+
15
+ attr_reader cwd: String?
16
+
17
+ # : (String, ?String?, ?String?) -> Rolldown::BuildResult
18
+ def self.from_json: (String, ?String?, ?String?) -> Rolldown::BuildResult
19
+
20
+ # : (chunks: Array[Rolldown::Chunk], assets: Array[Rolldown::Asset], warnings: Array[Rolldown::Diagnostic], errors: Array[Rolldown::Diagnostic], failed: bool, ?dir: String?, ?cwd: String?) -> void
21
+ def initialize: (chunks: Array[Rolldown::Chunk], assets: Array[Rolldown::Asset], warnings: Array[Rolldown::Diagnostic], errors: Array[Rolldown::Diagnostic], failed: bool, ?dir: String?, ?cwd: String?) -> void
22
+
23
+ # : () -> bool
24
+ def failed?: () -> bool
25
+
26
+ # : () -> bool
27
+ def errors?: () -> bool
28
+
29
+ # : () -> bool
30
+ def warnings?: () -> bool
31
+
32
+ # : (?String?) -> Array[String]
33
+ def write: (?String?) -> Array[String]
34
+
35
+ # : () -> Rolldown::Chunk?
36
+ def entry: () -> Rolldown::Chunk?
37
+
38
+ # : (?strict: bool) -> Rolldown::BuildResult
39
+ def validate!: (?strict: bool) -> Rolldown::BuildResult
40
+
41
+ # : () -> String
42
+ def to_s: () -> String
43
+
44
+ # : () -> String
45
+ def inspect: () -> String
46
+ end
47
+ end
@@ -0,0 +1,39 @@
1
+ # Generated from lib/rolldown/chunk.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ class Chunk
5
+ attr_reader filename: String
6
+
7
+ attr_reader name: String
8
+
9
+ attr_reader code: String
10
+
11
+ attr_reader map: String?
12
+
13
+ attr_reader imports: Array[String]
14
+
15
+ attr_reader dynamic_imports: Array[String]
16
+
17
+ attr_reader exports: Array[String]
18
+
19
+ attr_reader module_ids: Array[String]
20
+
21
+ # : (Hash[String, untyped]) -> Rolldown::Chunk
22
+ def self.from_hash: (Hash[String, untyped]) -> Rolldown::Chunk
23
+
24
+ # : (filename: String, name: String, code: String, map: String?, entry: bool, dynamic_entry: bool, imports: Array[String], dynamic_imports: Array[String], exports: Array[String], module_ids: Array[String]) -> void
25
+ def initialize: (filename: String, name: String, code: String, map: String?, entry: bool, dynamic_entry: bool, imports: Array[String], dynamic_imports: Array[String], exports: Array[String], module_ids: Array[String]) -> void
26
+
27
+ # : () -> bool
28
+ def entry?: () -> bool
29
+
30
+ # : () -> bool
31
+ def dynamic_entry?: () -> bool
32
+
33
+ # : () -> String
34
+ def to_s: () -> String
35
+
36
+ # : () -> String
37
+ def inspect: () -> String
38
+ end
39
+ end
@@ -0,0 +1,35 @@
1
+ # Generated from lib/rolldown/diagnostic.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ class Diagnostic
5
+ attr_reader kind: String
6
+
7
+ attr_reader severity: String
8
+
9
+ attr_reader message: String
10
+
11
+ attr_reader file: String?
12
+
13
+ attr_reader line: Integer?
14
+
15
+ attr_reader column: Integer?
16
+
17
+ # : (Hash[String, untyped]) -> Rolldown::Diagnostic
18
+ def self.from_hash: (Hash[String, untyped]) -> Rolldown::Diagnostic
19
+
20
+ # : (kind: String, severity: String, message: String, file: String?, line: Integer?, column: Integer?) -> void
21
+ def initialize: (kind: String, severity: String, message: String, file: String?, line: Integer?, column: Integer?) -> void
22
+
23
+ # : () -> bool
24
+ def error?: () -> bool
25
+
26
+ # : () -> bool
27
+ def warning?: () -> bool
28
+
29
+ # : () -> String
30
+ def to_s: () -> String
31
+
32
+ # : () -> String
33
+ def inspect: () -> String
34
+ end
35
+ end
@@ -0,0 +1,24 @@
1
+ # Generated from lib/rolldown/errors.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ class Error < StandardError
5
+ end
6
+
7
+ class OptionError < Error
8
+ end
9
+
10
+ class EncodingError < Error
11
+ end
12
+
13
+ class BuildError < Error
14
+ end
15
+
16
+ class IOError < Error
17
+ end
18
+
19
+ class InternalError < Error
20
+ end
21
+
22
+ class PanicError < InternalError
23
+ end
24
+ end
@@ -0,0 +1,61 @@
1
+ # Generated from lib/rolldown/options.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ class Options
5
+ INPUT: Array[Symbol]
6
+
7
+ OUTPUT: Array[Symbol]
8
+
9
+ TRANSFORM: Array[Symbol]
10
+
11
+ KNOWN: Array[Symbol]
12
+
13
+ CALLABLE: Hash[Symbol, String]
14
+
15
+ # : (Hash[Symbol, untyped], ?String) -> String
16
+ def self.serialize: (Hash[Symbol, untyped], ?String) -> String
17
+
18
+ attr_reader options: Hash[Symbol, untyped]
19
+
20
+ # : (Hash[Symbol, untyped], ?String) -> void
21
+ def initialize: (Hash[Symbol, untyped], ?String) -> void
22
+
23
+ # : () -> Hash[Symbol, untyped]
24
+ def to_h: () -> Hash[Symbol, untyped]
25
+
26
+ # : (?untyped) -> String
27
+ def to_json: (?untyped) -> String
28
+
29
+ # : () -> String
30
+ def inspect: () -> String
31
+
32
+ private
33
+
34
+ # : (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
35
+ def normalize: (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
36
+
37
+ # : (untyped) -> Array[untyped]
38
+ def entries: (untyped) -> Array[untyped]
39
+
40
+ # : (untyped) -> Array[String]
41
+ def externals: (untyped) -> Array[String]
42
+
43
+ # : (Symbol, Array[Symbol], String) -> void
44
+ def refuse_nested: (Symbol, Array[Symbol], String) -> void
45
+
46
+ # : (Symbol) -> Array[Symbol]
47
+ def nested_keys: (Symbol) -> Array[Symbol]
48
+
49
+ # : () -> Array[Symbol]
50
+ def output_keys: () -> Array[Symbol]
51
+
52
+ # : (Hash[untyped, untyped]) -> Array[untyped]
53
+ def named: (Hash[untyped, untyped]) -> Array[untyped]
54
+
55
+ # : (String) -> void
56
+ def validate!: (String) -> void
57
+
58
+ # : () -> void
59
+ def refuse_callables: () -> void
60
+ end
61
+ end
@@ -0,0 +1,5 @@
1
+ # Generated from lib/rolldown/version.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ VERSION: ::String
5
+ end
data/sig/rolldown.rbs ADDED
@@ -0,0 +1,12 @@
1
+ # Generated from lib/rolldown.rb with RBS::Inline
2
+
3
+ module Rolldown
4
+ # : (**untyped) -> Rolldown::BuildResult
5
+ def self.build: (**untyped) -> Rolldown::BuildResult
6
+
7
+ # : () -> String
8
+ def self.rolldown_version: () -> String
9
+
10
+ # : (Hash[Symbol, untyped]) -> String?
11
+ private def self.destination: (Hash[Symbol, untyped]) -> String?
12
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rolldown
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: x86_64-linux-gnu
6
+ authors:
7
+ - Marco Roth
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-09-01 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby bindings for Rolldown, the Rust bundler behind Vite.
14
+ email:
15
+ - marco.roth@intergga.ch
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE.txt
21
+ - README.md
22
+ - ext/rolldown/extconf.rb
23
+ - ext/rolldown/include/rolldown.h
24
+ - ext/rolldown/rolldown.c
25
+ - lib/rolldown.rb
26
+ - lib/rolldown/3.2/rolldown.so
27
+ - lib/rolldown/3.3/rolldown.so
28
+ - lib/rolldown/3.4/rolldown.so
29
+ - lib/rolldown/4.0/rolldown.so
30
+ - lib/rolldown/asset.rb
31
+ - lib/rolldown/backend.rb
32
+ - lib/rolldown/build_result.rb
33
+ - lib/rolldown/chunk.rb
34
+ - lib/rolldown/diagnostic.rb
35
+ - lib/rolldown/errors.rb
36
+ - lib/rolldown/options.rb
37
+ - lib/rolldown/version.rb
38
+ - licenses/README.md
39
+ - licenses/rolldown-MIT.txt
40
+ - licenses/rolldown-THIRD-PARTY.txt
41
+ - rolldown.gemspec
42
+ - rust/Cargo.lock
43
+ - rust/Cargo.toml
44
+ - rust/build.rs
45
+ - rust/cbindgen.toml
46
+ - rust/rustfmt.toml
47
+ - rust/src/build.rs
48
+ - rust/src/lib.rs
49
+ - rust/src/modules.rs
50
+ - rust/src/options.rs
51
+ - rust/src/payload.rs
52
+ - rust/src/result.rs
53
+ - sig/rolldown.rbs
54
+ - sig/rolldown/asset.rbs
55
+ - sig/rolldown/backend.rbs
56
+ - sig/rolldown/build_result.rbs
57
+ - sig/rolldown/chunk.rbs
58
+ - sig/rolldown/diagnostic.rbs
59
+ - sig/rolldown/errors.rbs
60
+ - sig/rolldown/options.rbs
61
+ - sig/rolldown/version.rbs
62
+ homepage: https://github.com/marcoroth/rolldown-ruby
63
+ licenses:
64
+ - MIT
65
+ metadata:
66
+ homepage_uri: https://github.com/marcoroth/rolldown-ruby
67
+ source_code_uri: https://github.com/marcoroth/rolldown-ruby
68
+ changelog_uri: https://github.com/marcoroth/rolldown-ruby/releases
69
+ rubygems_mfa_required: 'true'
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '3.2'
79
+ - - "<"
80
+ - !ruby/object:Gem::Version
81
+ version: 4.1.dev
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 3.3.22
87
+ requirements: []
88
+ rubygems_version: 3.5.23
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Blazing Fast Rust-based bundler for JavaScript
92
+ test_files: []