oxc 0.0.1 → 0.2.0
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 +4 -4
- data/LICENSE.txt +21 -0
- data/README.md +602 -0
- data/ext/oxc/extconf.rb +123 -0
- data/ext/oxc/include/oxc.h +40 -0
- data/ext/oxc/oxc.c +136 -0
- data/lib/oxc/backend.rb +41 -0
- data/lib/oxc/diagnosed.rb +33 -0
- data/lib/oxc/diagnostic.rb +86 -0
- data/lib/oxc/errors.rb +26 -0
- data/lib/oxc/minifier.rb +31 -0
- data/lib/oxc/minify_result.rb +25 -0
- data/lib/oxc/mutation_visitor.rb +128 -0
- data/lib/oxc/node.rb +186 -0
- data/lib/oxc/options.rb +113 -0
- data/lib/oxc/parse_result.rb +116 -0
- data/lib/oxc/result.rb +51 -0
- data/lib/oxc/transform_result.rb +47 -0
- data/lib/oxc/transformer.rb +31 -0
- data/lib/oxc/version.rb +1 -1
- data/lib/oxc/visitor.rb +25 -0
- data/lib/oxc.rb +49 -0
- data/licenses/README.md +12 -0
- data/licenses/oxc-MIT.txt +22 -0
- data/licenses/oxc-THIRD-PARTY.txt +763 -0
- data/oxc.gemspec +14 -2
- data/rust/Cargo.lock +1436 -0
- data/rust/Cargo.toml +32 -0
- data/rust/build.rs +52 -0
- data/rust/cbindgen.toml +24 -0
- data/rust/rustfmt.toml +3 -0
- data/rust/src/diagnostic.rs +75 -0
- data/rust/src/lib.rs +288 -0
- data/rust/src/module_record.rs +262 -0
- data/rust/src/options.rs +744 -0
- data/rust/src/parse.rs +93 -0
- data/rust/src/result.rs +55 -0
- data/rust/src/source_type.rs +26 -0
- data/rust/src/symbols.rs +101 -0
- data/rust/src/transform.rs +116 -0
- data/sig/oxc/backend.rbs +29 -0
- data/sig/oxc/diagnosed.rbs +23 -0
- data/sig/oxc/diagnostic.rbs +57 -0
- data/sig/oxc/errors.rbs +31 -0
- data/sig/oxc/minifier.rbs +21 -0
- data/sig/oxc/minify_result.rbs +11 -0
- data/sig/oxc/mutation_visitor.rbs +80 -0
- data/sig/oxc/node.rbs +94 -0
- data/sig/oxc/options.rbs +42 -0
- data/sig/oxc/parse_result.rbs +66 -0
- data/sig/oxc/result.rbs +32 -0
- data/sig/oxc/transform_result.rbs +22 -0
- data/sig/oxc/transformer.rbs +21 -0
- data/sig/oxc/types.rbs +96 -0
- data/sig/oxc/version.rbs +5 -0
- data/sig/oxc/visitor.rbs +11 -0
- data/sig/oxc.rbs +13 -2
- metadata +56 -2
data/sig/oxc/node.rbs
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Generated from lib/oxc/node.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class Node
|
|
5
|
+
include Enumerable[Oxc::Node]
|
|
6
|
+
|
|
7
|
+
ACRONYM: Regexp
|
|
8
|
+
|
|
9
|
+
BOUNDARY: Regexp
|
|
10
|
+
|
|
11
|
+
SPAN: Array[String]
|
|
12
|
+
|
|
13
|
+
attr_reader parent: Oxc::Node?
|
|
14
|
+
|
|
15
|
+
attr_reader attributes: Hash[String, untyped]
|
|
16
|
+
|
|
17
|
+
attr_reader text: String?
|
|
18
|
+
|
|
19
|
+
public
|
|
20
|
+
|
|
21
|
+
# : (Hash[String, untyped], ?Oxc::Node?, ?String?) -> void
|
|
22
|
+
def initialize: (Hash[String, untyped], ?Oxc::Node?, ?String?) -> void
|
|
23
|
+
|
|
24
|
+
# : () -> String
|
|
25
|
+
def type: () -> String
|
|
26
|
+
|
|
27
|
+
# : () -> Integer
|
|
28
|
+
def start: () -> Integer
|
|
29
|
+
|
|
30
|
+
# : () -> Integer
|
|
31
|
+
def finish: () -> Integer
|
|
32
|
+
|
|
33
|
+
# : () -> String
|
|
34
|
+
def underscored_type: () -> String
|
|
35
|
+
|
|
36
|
+
# : (String) -> untyped
|
|
37
|
+
def []: (String) -> untyped
|
|
38
|
+
|
|
39
|
+
# : (?String?) -> String?
|
|
40
|
+
def slice: (?String?) -> String?
|
|
41
|
+
|
|
42
|
+
# : () -> Array[String]
|
|
43
|
+
def keys: () -> Array[String]
|
|
44
|
+
|
|
45
|
+
# : () -> Hash[String, untyped]
|
|
46
|
+
def to_h: () -> Hash[String, untyped]
|
|
47
|
+
|
|
48
|
+
# : (?untyped) -> String
|
|
49
|
+
def to_json: (?untyped) -> String
|
|
50
|
+
|
|
51
|
+
# : (Array[Symbol]?) -> Hash[Symbol, untyped]
|
|
52
|
+
def deconstruct_keys: (Array[Symbol]?) -> Hash[Symbol, untyped]
|
|
53
|
+
|
|
54
|
+
# : () -> Array[Oxc::Node]
|
|
55
|
+
def child_nodes: () -> Array[Oxc::Node]
|
|
56
|
+
|
|
57
|
+
# : () { (Oxc::Node) -> void } -> void
|
|
58
|
+
# : () -> Enumerator[Oxc::Node, void]
|
|
59
|
+
def each: () { (Oxc::Node) -> void } -> void
|
|
60
|
+
| () -> Enumerator[Oxc::Node, void]
|
|
61
|
+
|
|
62
|
+
# : () -> Array[Oxc::Node]
|
|
63
|
+
def ancestors: () -> Array[Oxc::Node]
|
|
64
|
+
|
|
65
|
+
# : (Integer) -> Oxc::Node?
|
|
66
|
+
def at: (Integer) -> Oxc::Node?
|
|
67
|
+
|
|
68
|
+
# : (String) -> Array[Oxc::Node]
|
|
69
|
+
def every: (String) -> Array[Oxc::Node]
|
|
70
|
+
|
|
71
|
+
# : () -> Hash[String, untyped]
|
|
72
|
+
def fields: () -> Hash[String, untyped]
|
|
73
|
+
|
|
74
|
+
# : () -> String
|
|
75
|
+
def inspect: () -> String
|
|
76
|
+
|
|
77
|
+
# : (Symbol, *untyped) -> untyped
|
|
78
|
+
def method_missing: (Symbol, *untyped) -> untyped
|
|
79
|
+
|
|
80
|
+
# : (Symbol, ?bool) -> bool
|
|
81
|
+
def respond_to_missing?: (Symbol, ?bool) -> bool
|
|
82
|
+
|
|
83
|
+
private
|
|
84
|
+
|
|
85
|
+
# : (String, untyped) -> String
|
|
86
|
+
def described_field: (String, untyped) -> String
|
|
87
|
+
|
|
88
|
+
# : (String) -> String?
|
|
89
|
+
def field_for: (String) -> String?
|
|
90
|
+
|
|
91
|
+
# : (untyped) -> untyped
|
|
92
|
+
def wrap: (untyped) -> untyped
|
|
93
|
+
end
|
|
94
|
+
end
|
data/sig/oxc/options.rbs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated from lib/oxc/options.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class Options
|
|
5
|
+
MINIFY: Array[Symbol]
|
|
6
|
+
|
|
7
|
+
TRANSFORM: Array[Symbol]
|
|
8
|
+
|
|
9
|
+
PARSE: Array[Symbol]
|
|
10
|
+
|
|
11
|
+
KNOWN: Array[Symbol]
|
|
12
|
+
|
|
13
|
+
RUBY_ONLY: Array[Symbol]
|
|
14
|
+
|
|
15
|
+
# TODO: support mangle_props. It needs `lazy-regex` and `rustc-hash` as direct dependencies of the
|
|
16
|
+
# Rust crate, because `oxc_minifier::ManglePropertiesOptions` types `include` and `exclude` as
|
|
17
|
+
# `lazy_regex::Regex` and `reserved` as `FxHashSet<CompactStr>`.
|
|
18
|
+
UNSUPPORTED: Array[Symbol]
|
|
19
|
+
|
|
20
|
+
attr_reader to_h: Hash[Symbol, untyped]
|
|
21
|
+
|
|
22
|
+
# : (Hash[Symbol, untyped], ?Array[Symbol], ?String) -> String
|
|
23
|
+
def self.serialize: (Hash[Symbol, untyped], ?Array[Symbol], ?String) -> String
|
|
24
|
+
|
|
25
|
+
# : (Hash[Symbol, untyped], ?Array[Symbol], ?String) -> void
|
|
26
|
+
def initialize: (Hash[Symbol, untyped], ?Array[Symbol], ?String) -> void
|
|
27
|
+
|
|
28
|
+
# : (?JSON::options?) -> String
|
|
29
|
+
def to_json: (?JSON::options?) -> String
|
|
30
|
+
|
|
31
|
+
# : () -> String
|
|
32
|
+
def inspect: () -> String
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
# : (Array[Symbol], Array[Symbol], String) -> void
|
|
37
|
+
def validate!: (Array[Symbol], Array[Symbol], String) -> void
|
|
38
|
+
|
|
39
|
+
# : (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
|
|
40
|
+
def normalize: (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Generated from lib/oxc/parse_result.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class ParseResult
|
|
5
|
+
include Diagnosed
|
|
6
|
+
|
|
7
|
+
attr_reader source: String?
|
|
8
|
+
|
|
9
|
+
attr_reader program: Hash[String, untyped]?
|
|
10
|
+
|
|
11
|
+
attr_reader module_record: Hash[String, untyped]?
|
|
12
|
+
|
|
13
|
+
attr_reader symbols: Hash[String, untyped]?
|
|
14
|
+
|
|
15
|
+
attr_reader comments: Array[Oxc::Comment]
|
|
16
|
+
|
|
17
|
+
attr_reader diagnostics: Array[Oxc::Diagnostic]
|
|
18
|
+
|
|
19
|
+
# : (String, ?String?) -> Oxc::ParseResult
|
|
20
|
+
def self.from_json: (String, ?String?) -> Oxc::ParseResult
|
|
21
|
+
|
|
22
|
+
# : (comments: Array[Oxc::Comment], diagnostics: Array[Oxc::Diagnostic], ?source: String?, ?program: Hash[String, untyped]?, ?module_record: Hash[String, untyped]?, ?symbols: Hash[String, untyped]?, ?panicked: bool) -> void
|
|
23
|
+
def initialize: (comments: Array[Oxc::Comment], diagnostics: Array[Oxc::Diagnostic], ?source: String?, ?program: Hash[String, untyped]?, ?module_record: Hash[String, untyped]?, ?symbols: Hash[String, untyped]?, ?panicked: bool) -> void
|
|
24
|
+
|
|
25
|
+
# : () -> Oxc::Node?
|
|
26
|
+
def root: () -> Oxc::Node?
|
|
27
|
+
|
|
28
|
+
# : () -> Oxc::ParseResult
|
|
29
|
+
def validate!: () -> Oxc::ParseResult
|
|
30
|
+
|
|
31
|
+
# : () -> String
|
|
32
|
+
def inspect: () -> String
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class Comment
|
|
36
|
+
LINE: String
|
|
37
|
+
|
|
38
|
+
BLOCK: String
|
|
39
|
+
|
|
40
|
+
attr_reader type: String
|
|
41
|
+
|
|
42
|
+
attr_reader value: String
|
|
43
|
+
|
|
44
|
+
attr_reader start: Integer
|
|
45
|
+
|
|
46
|
+
attr_reader finish: Integer
|
|
47
|
+
|
|
48
|
+
# : (Hash[String, untyped]) -> Oxc::Comment
|
|
49
|
+
def self.from_hash: (Hash[String, untyped]) -> Oxc::Comment
|
|
50
|
+
|
|
51
|
+
# : (type: String, value: String, start: Integer, finish: Integer) -> void
|
|
52
|
+
def initialize: (type: String, value: String, start: Integer, finish: Integer) -> void
|
|
53
|
+
|
|
54
|
+
# : () -> bool
|
|
55
|
+
def line?: () -> bool
|
|
56
|
+
|
|
57
|
+
# : () -> bool
|
|
58
|
+
def block?: () -> bool
|
|
59
|
+
|
|
60
|
+
# : (String) -> String?
|
|
61
|
+
def slice: (String) -> String?
|
|
62
|
+
|
|
63
|
+
# : () -> String
|
|
64
|
+
def inspect: () -> String
|
|
65
|
+
end
|
|
66
|
+
end
|
data/sig/oxc/result.rbs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated from lib/oxc/result.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class Result
|
|
5
|
+
include Diagnosed
|
|
6
|
+
|
|
7
|
+
attr_reader code: String
|
|
8
|
+
|
|
9
|
+
attr_reader map: String?
|
|
10
|
+
|
|
11
|
+
attr_reader legal_comments: Array[String]
|
|
12
|
+
|
|
13
|
+
attr_reader diagnostics: Array[Oxc::Diagnostic]
|
|
14
|
+
|
|
15
|
+
# : (code: String, diagnostics: Array[Oxc::Diagnostic], ?map: String?, ?legal_comments: Array[String], ?panicked: bool) -> void
|
|
16
|
+
def initialize: (code: String, diagnostics: Array[Oxc::Diagnostic], ?map: String?, ?legal_comments: Array[String], ?panicked: bool) -> void
|
|
17
|
+
|
|
18
|
+
# : (?strict: bool?) -> self
|
|
19
|
+
def validate!: (?strict: bool?) -> self
|
|
20
|
+
|
|
21
|
+
# : () -> String
|
|
22
|
+
def to_s: () -> String
|
|
23
|
+
|
|
24
|
+
# : () -> String
|
|
25
|
+
def inspect: () -> String
|
|
26
|
+
|
|
27
|
+
private
|
|
28
|
+
|
|
29
|
+
# : () -> Array[String]
|
|
30
|
+
def parts: () -> Array[String]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Generated from lib/oxc/transform_result.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class TransformResult < Result
|
|
5
|
+
attr_reader declaration: String?
|
|
6
|
+
|
|
7
|
+
attr_reader declaration_map: String?
|
|
8
|
+
|
|
9
|
+
attr_reader helpers_used: Hash[String, String]
|
|
10
|
+
|
|
11
|
+
# : (String) -> Oxc::TransformResult
|
|
12
|
+
def self.from_json: (String) -> Oxc::TransformResult
|
|
13
|
+
|
|
14
|
+
# : (code: String, diagnostics: Array[Oxc::Diagnostic], ?map: String?, ?declaration: String?, ?declaration_map: String?, ?legal_comments: Array[String], ?helpers_used: Hash[String, String], ?panicked: bool) -> void
|
|
15
|
+
def initialize: (code: String, diagnostics: Array[Oxc::Diagnostic], ?map: String?, ?declaration: String?, ?declaration_map: String?, ?legal_comments: Array[String], ?helpers_used: Hash[String, String], ?panicked: bool) -> void
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
# : () -> Array[String]
|
|
20
|
+
def parts: () -> Array[String]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Generated from lib/oxc/transformer.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class Transformer
|
|
5
|
+
attr_reader options: Hash[Symbol, untyped]
|
|
6
|
+
|
|
7
|
+
# : (?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> void
|
|
8
|
+
def initialize: (?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> void
|
|
9
|
+
|
|
10
|
+
# : (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::TransformResult
|
|
11
|
+
def transform: (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::TransformResult
|
|
12
|
+
|
|
13
|
+
alias call transform
|
|
14
|
+
|
|
15
|
+
# : (?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::Transformer
|
|
16
|
+
def with: (?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::Transformer
|
|
17
|
+
|
|
18
|
+
# : () -> String
|
|
19
|
+
def inspect: () -> String
|
|
20
|
+
end
|
|
21
|
+
end
|
data/sig/oxc/types.rbs
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Note: This file is hand written, `rbs-inline` does not generate this file.
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
interface _Diagnosed
|
|
5
|
+
def diagnostics: () -> Array[Oxc::Diagnostic]
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
type targets = String | Symbol | Array[String | Symbol]
|
|
9
|
+
|
|
10
|
+
type keep_names = { ?function: bool, ?class: bool }
|
|
11
|
+
|
|
12
|
+
type compress = bool | {
|
|
13
|
+
?target: targets,
|
|
14
|
+
?drop_console: bool,
|
|
15
|
+
?drop_debugger: bool,
|
|
16
|
+
?unused: bool | String | Symbol,
|
|
17
|
+
?keep_names: keep_names,
|
|
18
|
+
?join_vars: bool,
|
|
19
|
+
?sequences: bool,
|
|
20
|
+
?drop_labels: Array[String],
|
|
21
|
+
?max_iterations: Integer,
|
|
22
|
+
?treeshake: treeshake
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type treeshake = {
|
|
26
|
+
?annotations: bool,
|
|
27
|
+
?manual_pure_functions: Array[String],
|
|
28
|
+
?property_read_side_effects: bool,
|
|
29
|
+
?property_write_side_effects: bool,
|
|
30
|
+
?unknown_global_side_effects: bool,
|
|
31
|
+
?invalid_import_side_effects: bool
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type mangle = bool | {
|
|
35
|
+
?top_level: bool,
|
|
36
|
+
?keep_names: bool | keep_names,
|
|
37
|
+
?reserved: Array[String],
|
|
38
|
+
?debug: bool
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type codegen = bool | {
|
|
42
|
+
?remove_whitespace: bool,
|
|
43
|
+
?legal_comments: String | Symbol | { linked: String }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type minify = bool | {
|
|
47
|
+
?filename: String,
|
|
48
|
+
?lang: String | Symbol,
|
|
49
|
+
?source_type: String | Symbol,
|
|
50
|
+
?compress: compress,
|
|
51
|
+
?mangle: mangle,
|
|
52
|
+
?codegen: codegen,
|
|
53
|
+
?sourcemap: bool
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type jsx = bool | {
|
|
57
|
+
?runtime: String | Symbol,
|
|
58
|
+
?development: bool,
|
|
59
|
+
?throw_if_namespace: bool,
|
|
60
|
+
?pure: bool,
|
|
61
|
+
?import_source: String,
|
|
62
|
+
?pragma: String,
|
|
63
|
+
?pragma_frag: String
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type typescript = {
|
|
67
|
+
?jsx_pragma: String,
|
|
68
|
+
?jsx_pragma_frag: String,
|
|
69
|
+
?only_remove_type_imports: bool,
|
|
70
|
+
?allow_namespaces: bool,
|
|
71
|
+
?allow_declare_fields: bool,
|
|
72
|
+
?optimize_const_enums: bool,
|
|
73
|
+
?optimize_enums: bool,
|
|
74
|
+
?remove_class_fields_without_initializer: bool,
|
|
75
|
+
?rewrite_import_extensions: String | Symbol,
|
|
76
|
+
?declaration: bool | { ?strip_internal: bool }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type assumptions = {
|
|
80
|
+
?ignore_function_length: bool,
|
|
81
|
+
?no_document_all: bool,
|
|
82
|
+
?object_rest_no_symbols: bool,
|
|
83
|
+
?pure_getters: bool,
|
|
84
|
+
?set_public_class_fields: bool
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type decorator = {
|
|
88
|
+
?legacy: bool,
|
|
89
|
+
?emit_decorator_metadata: bool,
|
|
90
|
+
?strict_null_checks: bool
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type helpers = { ?mode: String | Symbol }
|
|
94
|
+
|
|
95
|
+
type inject = Hash[String, String | Array[String]]
|
|
96
|
+
end
|
data/sig/oxc/version.rbs
ADDED
data/sig/oxc/visitor.rbs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Generated from lib/oxc/visitor.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Oxc
|
|
4
|
+
class Visitor
|
|
5
|
+
# : (Oxc::Node | Oxc::ParseResult) -> void
|
|
6
|
+
def visit: (Oxc::Node | Oxc::ParseResult) -> void
|
|
7
|
+
|
|
8
|
+
# : (Oxc::Node) -> void
|
|
9
|
+
def visit_children: (Oxc::Node) -> void
|
|
10
|
+
end
|
|
11
|
+
end
|
data/sig/oxc.rbs
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
# Generated from lib/oxc.rb with RBS::Inline
|
|
2
|
+
|
|
1
3
|
module Oxc
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
# : (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::MinifyResult
|
|
5
|
+
def self.minify: (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?compress: compress?, ?mangle: mangle?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::MinifyResult
|
|
6
|
+
|
|
7
|
+
# : (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::TransformResult
|
|
8
|
+
def self.transform: (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?cwd: String?, ?target: targets?, ?jsx: jsx?, ?typescript: typescript?, ?assumptions: assumptions?, ?decorator: decorator?, ?helpers: helpers?, ?define: Hash[String, String]?, ?inject: inject?, ?minify: minify?, ?codegen: codegen?, ?sourcemap: bool, ?strict: bool) -> Oxc::TransformResult
|
|
9
|
+
|
|
10
|
+
# : (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?ast_type: String?, ?ast: bool, ?ranges: bool, ?preserve_parens: bool, ?comments: bool, ?module_record: bool, ?symbols: bool, ?semantic_errors: bool) -> Oxc::ParseResult
|
|
11
|
+
def self.parse: (String, ?filename: String?, ?lang: String?, ?source_type: String?, ?ast_type: String?, ?ast: bool, ?ranges: bool, ?preserve_parens: bool, ?comments: bool, ?module_record: bool, ?symbols: bool, ?semantic_errors: bool) -> Oxc::ParseResult
|
|
12
|
+
|
|
13
|
+
# : () -> String
|
|
14
|
+
def self.oxc_version: () -> String
|
|
4
15
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oxc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marco Roth
|
|
@@ -14,16 +14,70 @@ description: Ruby bindings for Oxc, the JavaScript Oxidation Compiler. A collect
|
|
|
14
14
|
email:
|
|
15
15
|
- marco.roth@intergga.ch
|
|
16
16
|
executables: []
|
|
17
|
-
extensions:
|
|
17
|
+
extensions:
|
|
18
|
+
- ext/oxc/extconf.rb
|
|
18
19
|
extra_rdoc_files: []
|
|
19
20
|
files:
|
|
21
|
+
- LICENSE.txt
|
|
22
|
+
- README.md
|
|
23
|
+
- ext/oxc/extconf.rb
|
|
24
|
+
- ext/oxc/include/oxc.h
|
|
25
|
+
- ext/oxc/oxc.c
|
|
20
26
|
- lib/oxc.rb
|
|
27
|
+
- lib/oxc/backend.rb
|
|
28
|
+
- lib/oxc/diagnosed.rb
|
|
29
|
+
- lib/oxc/diagnostic.rb
|
|
30
|
+
- lib/oxc/errors.rb
|
|
31
|
+
- lib/oxc/minifier.rb
|
|
32
|
+
- lib/oxc/minify_result.rb
|
|
33
|
+
- lib/oxc/mutation_visitor.rb
|
|
34
|
+
- lib/oxc/node.rb
|
|
35
|
+
- lib/oxc/options.rb
|
|
36
|
+
- lib/oxc/parse_result.rb
|
|
37
|
+
- lib/oxc/result.rb
|
|
38
|
+
- lib/oxc/transform_result.rb
|
|
39
|
+
- lib/oxc/transformer.rb
|
|
21
40
|
- lib/oxc/version.rb
|
|
41
|
+
- lib/oxc/visitor.rb
|
|
42
|
+
- licenses/README.md
|
|
43
|
+
- licenses/oxc-MIT.txt
|
|
44
|
+
- licenses/oxc-THIRD-PARTY.txt
|
|
22
45
|
- oxc.gemspec
|
|
46
|
+
- rust/Cargo.lock
|
|
47
|
+
- rust/Cargo.toml
|
|
48
|
+
- rust/build.rs
|
|
49
|
+
- rust/cbindgen.toml
|
|
50
|
+
- rust/rustfmt.toml
|
|
51
|
+
- rust/src/diagnostic.rs
|
|
52
|
+
- rust/src/lib.rs
|
|
53
|
+
- rust/src/module_record.rs
|
|
54
|
+
- rust/src/options.rs
|
|
55
|
+
- rust/src/parse.rs
|
|
56
|
+
- rust/src/result.rs
|
|
57
|
+
- rust/src/source_type.rs
|
|
58
|
+
- rust/src/symbols.rs
|
|
59
|
+
- rust/src/transform.rs
|
|
23
60
|
- sig/oxc.rbs
|
|
61
|
+
- sig/oxc/backend.rbs
|
|
62
|
+
- sig/oxc/diagnosed.rbs
|
|
63
|
+
- sig/oxc/diagnostic.rbs
|
|
64
|
+
- sig/oxc/errors.rbs
|
|
65
|
+
- sig/oxc/minifier.rbs
|
|
66
|
+
- sig/oxc/minify_result.rbs
|
|
67
|
+
- sig/oxc/mutation_visitor.rbs
|
|
68
|
+
- sig/oxc/node.rbs
|
|
69
|
+
- sig/oxc/options.rbs
|
|
70
|
+
- sig/oxc/parse_result.rbs
|
|
71
|
+
- sig/oxc/result.rbs
|
|
72
|
+
- sig/oxc/transform_result.rbs
|
|
73
|
+
- sig/oxc/transformer.rbs
|
|
74
|
+
- sig/oxc/types.rbs
|
|
75
|
+
- sig/oxc/version.rbs
|
|
76
|
+
- sig/oxc/visitor.rbs
|
|
24
77
|
homepage: https://github.com/marcoroth/oxc-ruby
|
|
25
78
|
licenses:
|
|
26
79
|
- MIT
|
|
80
|
+
- Apache-2.0
|
|
27
81
|
metadata:
|
|
28
82
|
homepage_uri: https://github.com/marcoroth/oxc-ruby
|
|
29
83
|
source_code_uri: https://github.com/marcoroth/oxc-ruby
|