)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/, lookbehind: !0, inside: { line: { pattern: e, lookbehind: !0, inside: { tag: a.languages.markup.tag, entity: a.languages.markup.entity, code: { pattern: /.+/, inside: a.languages.java, alias: "language-java" } } } } }], tag: a.languages.markup.tag, entity: a.languages.markup.entity }), a.languages.javadoclike.addSupport("java", a.languages.javadoc) }(Prism);
+Prism.languages.javastacktrace = { summary: { pattern: /^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m, lookbehind: !0, inside: { keyword: { pattern: /^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m, lookbehind: !0 }, string: { pattern: /^(\s*)"[^"]*"/, lookbehind: !0 }, exceptions: { pattern: /^(:?\s*)[\w$.]+(?=:|$)/, lookbehind: !0, inside: { "class-name": /[\w$]+$/, namespace: /\b[a-z]\w*\b/, punctuation: /\./ } }, message: { pattern: /(:\s*)\S.*/, lookbehind: !0, alias: "string" }, punctuation: /:/ } }, "stack-frame": { pattern: /^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m, lookbehind: !0, inside: { keyword: { pattern: /^(\s*)at(?= )/, lookbehind: !0 }, source: [{ pattern: /(\()\w+\.\w+:\d+(?=\))/, lookbehind: !0, inside: { file: /^\w+\.\w+/, punctuation: /:/, "line-number": { pattern: /\b\d+\b/, alias: "number" } } }, { pattern: /(\()[^()]*(?=\))/, lookbehind: !0, inside: { keyword: /^(?:Native Method|Unknown Source)$/ } }], "class-name": /[\w$]+(?=\.(?:|[\w$]+)\()/, function: /(?:|[\w$]+)(?=\()/, "class-loader": { pattern: /(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/, lookbehind: !0, alias: "namespace", inside: { punctuation: /\./ } }, module: { pattern: /([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/, lookbehind: !0, inside: { version: { pattern: /(@)[\s\S]+/, lookbehind: !0, alias: "number" }, punctuation: /[@.]/ } }, namespace: { pattern: /(?:\b[a-z]\w*\.)+/, inside: { punctuation: /\./ } }, punctuation: /[()/.]/ } }, more: { pattern: /^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m, lookbehind: !0, inside: { punctuation: /\.{3}/, number: /\d+/, keyword: /\b[a-z]+(?: [a-z]+)*\b/ } } };
+!function (n) { n.languages.kotlin = n.languages.extend("clike", { keyword: { pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/, lookbehind: !0 }, function: [{ pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/, greedy: !0 }, { pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/, lookbehind: !0, greedy: !0 }], number: /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/, operator: /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/ }), delete n.languages.kotlin["class-name"]; var e = { "interpolation-punctuation": { pattern: /^\$\{?|\}$/, alias: "punctuation" }, expression: { pattern: /[\s\S]+/, inside: n.languages.kotlin } }; n.languages.insertBefore("kotlin", "string", { "string-literal": [{ pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/, alias: "multiline", inside: { interpolation: { pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i, inside: e }, string: /[\s\S]+/ } }, { pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/, alias: "singleline", inside: { interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i, lookbehind: !0, inside: e }, string: /[\s\S]+/ } }], char: { pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/, greedy: !0 } }), delete n.languages.kotlin.string, n.languages.insertBefore("kotlin", "keyword", { annotation: { pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/, alias: "builtin" } }), n.languages.insertBefore("kotlin", "function", { label: { pattern: /\b\w+@|@\w+\b/, alias: "symbol" } }), n.languages.kt = n.languages.kotlin, n.languages.kts = n.languages.kotlin }(Prism);
+Prism.languages.python = { comment: { pattern: /(^|[^\\])#.*/, lookbehind: !0, greedy: !0 }, "string-interpolation": { pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, greedy: !0, inside: { interpolation: { pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/, lookbehind: !0, inside: { "format-spec": { pattern: /(:)[^:(){}]+(?=\}$)/, lookbehind: !0 }, "conversion-option": { pattern: //, alias: "punctuation" }, rest: null } }, string: /[\s\S]+/ } }, "triple-quoted-string": { pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i, greedy: !0, alias: "string" }, string: { pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, greedy: !0 }, function: { pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, lookbehind: !0 }, "class-name": { pattern: /(\bclass\s+)\w+/i, lookbehind: !0 }, decorator: { pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m, lookbehind: !0, alias: ["annotation", "punctuation"], inside: { punctuation: /\./ } }, keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, boolean: /\b(?:False|None|True)\b/, number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i, operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python;
+!function (t) { var n = t.util.clone(t.languages.javascript), e = "(?:\\{*\\.{3}(?:[^{}]|)*\\})"; function a(t, n) { return t = t.replace(//g, (function () { return "(?:\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))\\*/)" })).replace(//g, (function () { return "(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})" })).replace(//g, (function () { return e })), RegExp(t, n) } e = a(e).source, t.languages.jsx = t.languages.extend("markup", n), t.languages.jsx.tag.pattern = a("?(?:[\\w.:-]+(?:+(?:[\\w.:$-]+(?:=(?:\"(?:\\\\[^]|[^\\\\\"])*\"|'(?:\\\\[^]|[^\\\\'])*'|[^\\s{'\"/>=]+|))?|))**/?)?>"), t.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, t.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, t.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, t.languages.jsx.tag.inside.comment = n.comment, t.languages.insertBefore("inside", "attr-name", { spread: { pattern: a(""), inside: t.languages.jsx } }, t.languages.jsx.tag), t.languages.insertBefore("inside", "special-attr", { script: { pattern: a("="), alias: "language-javascript", inside: { "script-punctuation": { pattern: /^=(?=\{)/, alias: "punctuation" }, rest: t.languages.jsx } } }, t.languages.jsx.tag); var s = function (t) { return t ? "string" == typeof t ? t : "string" == typeof t.content ? t.content : t.content.map(s).join("") : "" }, g = function (n) { for (var e = [], a = 0; a < n.length; a++) { var o = n[a], i = !1; if ("string" != typeof o && ("tag" === o.type && o.content[0] && "tag" === o.content[0].type ? "" === o.content[0].content[0].content ? e.length > 0 && e[e.length - 1].tagName === s(o.content[0].content[1]) && e.pop() : "/>" === o.content[o.content.length - 1].content || e.push({ tagName: s(o.content[0].content[1]), openedBraces: 0 }) : e.length > 0 && "punctuation" === o.type && "{" === o.content ? e[e.length - 1].openedBraces++ : e.length > 0 && e[e.length - 1].openedBraces > 0 && "punctuation" === o.type && "}" === o.content ? e[e.length - 1].openedBraces-- : i = !0), (i || "string" == typeof o) && e.length > 0 && 0 === e[e.length - 1].openedBraces) { var r = s(o); a < n.length - 1 && ("string" == typeof n[a + 1] || "plain-text" === n[a + 1].type) && (r += s(n[a + 1]), n.splice(a + 1, 1)), a > 0 && ("string" == typeof n[a - 1] || "plain-text" === n[a - 1].type) && (r = s(n[a - 1]) + r, n.splice(a - 1, 1), a--), n[a] = new t.Token("plain-text", r, null, r) } o.content && "string" != typeof o.content && g(o.content) } }; t.hooks.add("after-tokenize", (function (t) { "jsx" !== t.language && "tsx" !== t.language || g(t.tokens) })) }(Prism);
+!function (e) { e.languages.typescript = e.languages.extend("javascript", { "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/, lookbehind: !0, greedy: !0, inside: null }, builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/ }), e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, /\btype\b(?=\s*(?:[\{*]|$))/), delete e.languages.typescript.parameter, delete e.languages.typescript["literal-property"]; var s = e.languages.extend("typescript", {}); delete s["class-name"], e.languages.typescript["class-name"].inside = s, e.languages.insertBefore("typescript", "function", { decorator: { pattern: /@[$\w\xA0-\uFFFF]+/, inside: { at: { pattern: /^@/, alias: "operator" }, function: /^[\s\S]+/ } }, "generic-function": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/, greedy: !0, inside: { function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/, generic: { pattern: /<[\s\S]+/, alias: "class-name", inside: s } } } }), e.languages.ts = e.languages.typescript }(Prism);
+!function (e) { var a = e.util.clone(e.languages.typescript); e.languages.tsx = e.languages.extend("jsx", a), delete e.languages.tsx.parameter, delete e.languages.tsx["literal-property"]; var t = e.languages.tsx.tag; t.pattern = RegExp("(^|[^\\w$]|(?=))(?:" + t.pattern.source + ")", t.pattern.flags), t.lookbehind = !0 }(Prism);
+!function (e) { e.languages.ruby = e.languages.extend("clike", { comment: { pattern: /#.*|^=begin\s[\s\S]*?^=end/m, greedy: !0 }, "class-name": { pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/, operator: /\.{2,3}|&\.|===|=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/, punctuation: /[(){}[\].,;]/ }), e.languages.insertBefore("ruby", "operator", { "double-colon": { pattern: /::/, alias: "punctuation" } }); var n = { pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/, lookbehind: !0, inside: { content: { pattern: /^(#\{)[\s\S]+(?=\}$)/, lookbehind: !0, inside: e.languages.ruby }, delimiter: { pattern: /^#\{|\}$/, alias: "punctuation" } } }; delete e.languages.ruby.function; var t = "(?:" + ["([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1", "\\((?:[^()\\\\]|\\\\[^]|\\((?:[^()\\\\]|\\\\[^])*\\))*\\)", "\\{(?:[^{}\\\\]|\\\\[^]|\\{(?:[^{}\\\\]|\\\\[^])*\\})*\\}", "\\[(?:[^\\[\\]\\\\]|\\\\[^]|\\[(?:[^\\[\\]\\\\]|\\\\[^])*\\])*\\]", "<(?:[^<>\\\\]|\\\\[^]|<(?:[^<>\\\\]|\\\\[^])*>)*>"].join("|") + ")", i = '(?:"(?:\\\\.|[^"\\\\\r\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\0-\\x7F]+)[?!]?|\\$.)'; e.languages.insertBefore("ruby", "keyword", { "regex-literal": [{ pattern: RegExp("%r" + t + "[egimnosux]{0,6}"), greedy: !0, inside: { interpolation: n, regex: /[\s\S]+/ } }, { pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/, lookbehind: !0, greedy: !0, inside: { interpolation: n, regex: /[\s\S]+/ } }], variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/, symbol: [{ pattern: RegExp("(^|[^:]):" + i), lookbehind: !0, greedy: !0 }, { pattern: RegExp("([\r\n{(,][ \t]*)" + i + "(?=:(?!:))"), lookbehind: !0, greedy: !0 }], "method-definition": { pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/, lookbehind: !0, inside: { function: /\b\w+$/, keyword: /^self\b/, "class-name": /^\w+/, punctuation: /\./ } } }), e.languages.insertBefore("ruby", "string", { "string-literal": [{ pattern: RegExp("%[qQiIwWs]?" + t), greedy: !0, inside: { interpolation: n, string: /[\s\S]+/ } }, { pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/, greedy: !0, inside: { interpolation: n, string: /[\s\S]+/ } }, { pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i, alias: "heredoc-string", greedy: !0, inside: { delimiter: { pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i, inside: { symbol: /\b\w+/, punctuation: /^<<[-~]?/ } }, interpolation: n, string: /[\s\S]+/ } }, { pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i, alias: "heredoc-string", greedy: !0, inside: { delimiter: { pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i, inside: { symbol: /\b\w+/, punctuation: /^<<[-~]?'|'$/ } }, string: /[\s\S]+/ } }], "command-literal": [{ pattern: RegExp("%x" + t), greedy: !0, inside: { interpolation: n, command: { pattern: /[\s\S]+/, alias: "string" } } }, { pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/, greedy: !0, inside: { interpolation: n, command: { pattern: /[\s\S]+/, alias: "string" } } }] }), delete e.languages.ruby.string, e.languages.insertBefore("ruby", "number", { builtin: /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/, constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/ }), e.languages.rb = e.languages.ruby }(Prism);
+!function (e) { for (var a = "/\\*(?:[^*/]|\\*(?!/)|/(?!\\*)|)*\\*/", t = 0; t < 2; t++)a = a.replace(//g, (function () { return a })); a = a.replace(//g, (function () { return "[^\\s\\S]" })), e.languages.rust = { comment: [{ pattern: RegExp("(^|[^\\\\])" + a), lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/, greedy: !0 }, char: { pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/, greedy: !0 }, attribute: { pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/, greedy: !0, alias: "attr-name", inside: { string: null } }, "closure-params": { pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/, lookbehind: !0, greedy: !0, inside: { "closure-punctuation": { pattern: /^\||\|$/, alias: "punctuation" }, rest: null } }, "lifetime-annotation": { pattern: /'\w+/, alias: "symbol" }, "fragment-specifier": { pattern: /(\$\w+:)[a-z]+/, lookbehind: !0, alias: "punctuation" }, variable: /\$\w+/, "function-definition": { pattern: /(\bfn\s+)\w+/, lookbehind: !0, alias: "function" }, "type-definition": { pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/, lookbehind: !0, alias: "class-name" }, "module-declaration": [{ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/, lookbehind: !0, alias: "namespace" }, { pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/, lookbehind: !0, alias: "namespace", inside: { punctuation: /::/ } }], keyword: [/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/], function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/, macro: { pattern: /\b\w+!/, alias: "property" }, constant: /\b[A-Z_][A-Z_\d]+\b/, "class-name": /\b[A-Z]\w*\b/, namespace: { pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/, inside: { punctuation: /::/ } }, number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/, boolean: /\b(?:false|true)\b/, punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<=?|>>?=?|[@?]/ }, e.languages.rust["closure-params"].inside.rest = e.languages.rust, e.languages.rust.attribute.inside.string = e.languages.rust.string }(Prism);
+!function (e) { function n(e) { return e.replace(/__/g, (function () { return "(?:[\\w-]+|'[^'\n\r]*'|\"(?:\\\\.|[^\\\\\"\r\n])*\")" })) } e.languages.toml = { comment: { pattern: /#.*/, greedy: !0 }, table: { pattern: RegExp(n("(^[\t ]*\\[\\s*(?:\\[\\s*)?)__(?:\\s*\\.\\s*__)*(?=\\s*\\])"), "m"), lookbehind: !0, greedy: !0, alias: "class-name" }, key: { pattern: RegExp(n("(^[\t ]*|[{,]\\s*)__(?:\\s*\\.\\s*__)*(?=\\s*=)"), "m"), lookbehind: !0, greedy: !0, alias: "property" }, string: { pattern: /"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/, greedy: !0 }, date: [{ pattern: /\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i, alias: "number" }, { pattern: /\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/, alias: "number" }], number: /(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/, boolean: /\b(?:false|true)\b/, punctuation: /[.,=[\]{}]/ } }(Prism);
+Prism.languages.wasm = { comment: [/\(;[\s\S]*?;\)/, { pattern: /;;.*/, greedy: !0 }], string: { pattern: /"(?:\\[\s\S]|[^"\\])*"/, greedy: !0 }, keyword: [{ pattern: /\b(?:align|offset)=/, inside: { operator: /=/ } }, { pattern: /\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/, inside: { punctuation: /\./ } }, /\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/], variable: /\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/, number: /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/, punctuation: /[()]/ };
\ No newline at end of file
diff --git a/docs/theme.css b/docs/theme.css
new file mode 100644
index 00000000..c1f4b169
--- /dev/null
+++ b/docs/theme.css
@@ -0,0 +1,1321 @@
+/*light*/
+
+.markdown-body {
+ -ms-text-size-adjust: 100%;
+ -webkit-text-size-adjust: 100%;
+ margin: 0;
+ color: #1F2328;
+ background-color: #ffffff;
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
+ font-size: 16px;
+ line-height: 1.5;
+ word-wrap: break-word;
+ width: 894px;
+ margin: auto;
+}
+
+.markdown-body .octicon {
+ display: inline-block;
+ fill: currentColor;
+ vertical-align: text-bottom;
+}
+
+.markdown-body h1:hover .anchor .octicon-link:before,
+.markdown-body h2:hover .anchor .octicon-link:before,
+.markdown-body h3:hover .anchor .octicon-link:before,
+.markdown-body h4:hover .anchor .octicon-link:before,
+.markdown-body h5:hover .anchor .octicon-link:before,
+.markdown-body h6:hover .anchor .octicon-link:before {
+ width: 16px;
+ height: 16px;
+ content: ' ';
+ display: inline-block;
+ background-color: currentColor;
+ -webkit-mask-image: url("data:image/svg+xml,");
+ mask-image: url("data:image/svg+xml,");
+}
+
+.markdown-body details,
+.markdown-body figcaption,
+.markdown-body figure {
+ display: block;
+}
+
+.markdown-body summary {
+ display: list-item;
+}
+
+.markdown-body [hidden] {
+ display: none !important;
+}
+
+.markdown-body a {
+ background-color: transparent;
+ color: #0969da;
+ text-decoration: none;
+}
+
+.markdown-body abbr[title] {
+ border-bottom: none;
+ -webkit-text-decoration: underline dotted;
+ text-decoration: underline dotted;
+}
+
+.markdown-body b,
+.markdown-body strong {
+ font-weight: 600;
+}
+
+.markdown-body dfn {
+ font-style: italic;
+}
+
+.markdown-body h1 {
+ margin: .67em 0;
+ font-weight: 600;
+ padding-bottom: .3em;
+ font-size: 2em;
+ border-bottom: 1px solid hsla(210,18%,87%,1);
+}
+
+.markdown-body mark {
+ background-color: #fff8c5;
+ color: #1F2328;
+}
+
+.markdown-body small {
+ font-size: 90%;
+}
+
+.markdown-body sub,
+.markdown-body sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+.markdown-body sub {
+ bottom: -0.25em;
+}
+
+.markdown-body sup {
+ top: -0.5em;
+}
+
+.markdown-body img {
+ border-style: none;
+ max-width: 100%;
+ box-sizing: content-box;
+ background-color: #ffffff;
+}
+
+.markdown-body code,
+.markdown-body kbd,
+.markdown-body pre,
+.markdown-body samp {
+ font-family: monospace;
+ font-size: 1em;
+}
+
+.markdown-body figure {
+ margin: 1em 40px;
+}
+
+.markdown-body hr {
+ box-sizing: content-box;
+ overflow: hidden;
+ background: transparent;
+ border-bottom: 1px solid hsla(210,18%,87%,1);
+ height: .25em;
+ padding: 0;
+ margin: 24px 0;
+ background-color: #d0d7de;
+ border: 0;
+}
+
+.markdown-body input {
+ font: inherit;
+ margin: 0;
+ overflow: visible;
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit;
+}
+
+.markdown-body [type=button],
+.markdown-body [type=reset],
+.markdown-body [type=submit] {
+ -webkit-appearance: button;
+ appearance: button;
+}
+
+.markdown-body [type=checkbox],
+.markdown-body [type=radio] {
+ box-sizing: border-box;
+ padding: 0;
+}
+
+.markdown-body [type=number]::-webkit-inner-spin-button,
+.markdown-body [type=number]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+.markdown-body [type=search]::-webkit-search-cancel-button,
+.markdown-body [type=search]::-webkit-search-decoration {
+ -webkit-appearance: none;
+ appearance: none;
+}
+
+.markdown-body ::-webkit-input-placeholder {
+ color: inherit;
+ opacity: .54;
+}
+
+.markdown-body ::-webkit-file-upload-button {
+ -webkit-appearance: button;
+ appearance: button;
+ font: inherit;
+}
+
+.markdown-body a:hover {
+ text-decoration: underline;
+}
+
+.markdown-body ::placeholder {
+ color: #6e7781;
+ opacity: 1;
+}
+
+.markdown-body hr::before {
+ display: table;
+ content: "";
+}
+
+.markdown-body hr::after {
+ display: table;
+ clear: both;
+ content: "";
+}
+
+.markdown-body table {
+ border-spacing: 0;
+ border-collapse: collapse;
+ display: block;
+ width: max-content;
+ max-width: 100%;
+ overflow: auto;
+}
+
+.markdown-body td,
+.markdown-body th {
+ padding: 0;
+}
+
+.markdown-body details summary {
+ cursor: pointer;
+}
+
+.markdown-body details:not([open])>*:not(summary) {
+ display: none !important;
+}
+
+.markdown-body a:focus,
+.markdown-body [role=button]:focus,
+.markdown-body input[type=radio]:focus,
+.markdown-body input[type=checkbox]:focus {
+ outline: 2px solid #0969da;
+ outline-offset: -2px;
+ box-shadow: none;
+}
+
+.markdown-body a:focus:not(:focus-visible),
+.markdown-body [role=button]:focus:not(:focus-visible),
+.markdown-body input[type=radio]:focus:not(:focus-visible),
+.markdown-body input[type=checkbox]:focus:not(:focus-visible) {
+ outline: solid 1px transparent;
+}
+
+.markdown-body a:focus-visible,
+.markdown-body [role=button]:focus-visible,
+.markdown-body input[type=radio]:focus-visible,
+.markdown-body input[type=checkbox]:focus-visible {
+ outline: 2px solid #0969da;
+ outline-offset: -2px;
+ box-shadow: none;
+}
+
+.markdown-body a:not([class]):focus,
+.markdown-body a:not([class]):focus-visible,
+.markdown-body input[type=radio]:focus,
+.markdown-body input[type=radio]:focus-visible,
+.markdown-body input[type=checkbox]:focus,
+.markdown-body input[type=checkbox]:focus-visible {
+ outline-offset: 0;
+}
+
+.markdown-body kbd {
+ display: inline-block;
+ padding: 3px 5px;
+ font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
+ line-height: 10px;
+ color: #1F2328;
+ vertical-align: middle;
+ background-color: #f6f8fa;
+ border: solid 1px rgba(175,184,193,0.2);
+ border-bottom-color: rgba(175,184,193,0.2);
+ border-radius: 6px;
+ box-shadow: inset 0 -1px 0 rgba(175,184,193,0.2);
+}
+
+.markdown-body h1,
+.markdown-body h2,
+.markdown-body h3,
+.markdown-body h4,
+.markdown-body h5,
+.markdown-body h6 {
+ margin-top: 24px;
+ margin-bottom: 16px;
+ font-weight: 600;
+ line-height: 1.25;
+}
+
+.markdown-body h2 {
+ font-weight: 600;
+ padding-bottom: .3em;
+ font-size: 1.5em;
+ border-bottom: 1px solid hsla(210,18%,87%,1);
+}
+
+.markdown-body h3 {
+ font-weight: 600;
+ font-size: 1.25em;
+}
+
+.markdown-body h4 {
+ font-weight: 600;
+ font-size: 1em;
+}
+
+.markdown-body h5 {
+ font-weight: 600;
+ font-size: .875em;
+}
+
+.markdown-body h6 {
+ font-weight: 600;
+ font-size: .85em;
+ color: #656d76;
+}
+
+.markdown-body p {
+ margin-top: 0;
+ margin-bottom: 10px;
+}
+
+.markdown-body blockquote {
+ margin: 0;
+ padding: 0 1em;
+ color: #656d76;
+ border-left: .25em solid #d0d7de;
+}
+
+.markdown-body ul,
+.markdown-body ol {
+ margin-top: 0;
+ margin-bottom: 0;
+ padding-left: 2em;
+}
+
+.markdown-body ol ol,
+.markdown-body ul ol {
+ list-style-type: lower-roman;
+}
+
+.markdown-body ul ul ol,
+.markdown-body ul ol ol,
+.markdown-body ol ul ol,
+.markdown-body ol ol ol {
+ list-style-type: lower-alpha;
+}
+
+.markdown-body dd {
+ margin-left: 0;
+}
+
+.markdown-body tt,
+.markdown-body code,
+.markdown-body samp {
+ font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
+ font-size: 12px;
+}
+
+.markdown-body pre {
+ margin-top: 0;
+ margin-bottom: 0;
+ font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;
+ font-size: 12px;
+ word-wrap: normal;
+}
+
+.markdown-body .octicon {
+ display: inline-block;
+ overflow: visible !important;
+ vertical-align: text-bottom;
+ fill: currentColor;
+}
+
+.markdown-body input::-webkit-outer-spin-button,
+.markdown-body input::-webkit-inner-spin-button {
+ margin: 0;
+ -webkit-appearance: none;
+ appearance: none;
+}
+
+.markdown-body .mr-2 {
+ margin-right: 8px !important;
+}
+
+.markdown-body::before {
+ display: table;
+ content: "";
+}
+
+.markdown-body::after {
+ display: table;
+ clear: both;
+ content: "";
+}
+
+.markdown-body>*:first-child {
+ margin-top: 0 !important;
+}
+
+.markdown-body>*:last-child {
+ margin-bottom: 0 !important;
+}
+
+.markdown-body a:not([href]) {
+ color: inherit;
+ text-decoration: none;
+}
+
+.markdown-body .absent {
+ color: #d1242f;
+}
+
+.markdown-body .anchor {
+ float: left;
+ padding-right: 4px;
+ margin-left: -20px;
+ line-height: 1;
+}
+
+.markdown-body .anchor:focus {
+ outline: none;
+}
+
+.markdown-body p,
+.markdown-body blockquote,
+.markdown-body ul,
+.markdown-body ol,
+.markdown-body dl,
+.markdown-body table,
+.markdown-body pre,
+.markdown-body details {
+ margin-top: 0;
+ margin-bottom: 16px;
+}
+
+.markdown-body blockquote>:first-child {
+ margin-top: 0;
+}
+
+.markdown-body blockquote>:last-child {
+ margin-bottom: 0;
+}
+
+.markdown-body h1 .octicon-link,
+.markdown-body h2 .octicon-link,
+.markdown-body h3 .octicon-link,
+.markdown-body h4 .octicon-link,
+.markdown-body h5 .octicon-link,
+.markdown-body h6 .octicon-link {
+ color: #1F2328;
+ vertical-align: middle;
+ visibility: hidden;
+}
+
+.markdown-body h1:hover .anchor,
+.markdown-body h2:hover .anchor,
+.markdown-body h3:hover .anchor,
+.markdown-body h4:hover .anchor,
+.markdown-body h5:hover .anchor,
+.markdown-body h6:hover .anchor {
+ text-decoration: none;
+}
+
+.markdown-body h1:hover .anchor .octicon-link,
+.markdown-body h2:hover .anchor .octicon-link,
+.markdown-body h3:hover .anchor .octicon-link,
+.markdown-body h4:hover .anchor .octicon-link,
+.markdown-body h5:hover .anchor .octicon-link,
+.markdown-body h6:hover .anchor .octicon-link {
+ visibility: visible;
+}
+
+.markdown-body h1 tt,
+.markdown-body h1 code,
+.markdown-body h2 tt,
+.markdown-body h2 code,
+.markdown-body h3 tt,
+.markdown-body h3 code,
+.markdown-body h4 tt,
+.markdown-body h4 code,
+.markdown-body h5 tt,
+.markdown-body h5 code,
+.markdown-body h6 tt,
+.markdown-body h6 code {
+ padding: 0 .2em;
+ font-size: inherit;
+}
+
+.markdown-body summary h1,
+.markdown-body summary h2,
+.markdown-body summary h3,
+.markdown-body summary h4,
+.markdown-body summary h5,
+.markdown-body summary h6 {
+ display: inline-block;
+}
+
+.markdown-body summary h1 .anchor,
+.markdown-body summary h2 .anchor,
+.markdown-body summary h3 .anchor,
+.markdown-body summary h4 .anchor,
+.markdown-body summary h5 .anchor,
+.markdown-body summary h6 .anchor {
+ margin-left: -40px;
+}
+
+.markdown-body summary h1,
+.markdown-body summary h2 {
+ padding-bottom: 0;
+ border-bottom: 0;
+}
+
+.markdown-body ul.no-list,
+.markdown-body ol.no-list {
+ padding: 0;
+ list-style-type: none;
+}
+
+.markdown-body ol[type="a s"] {
+ list-style-type: lower-alpha;
+}
+
+.markdown-body ol[type="A s"] {
+ list-style-type: upper-alpha;
+}
+
+.markdown-body ol[type="i s"] {
+ list-style-type: lower-roman;
+}
+
+.markdown-body ol[type="I s"] {
+ list-style-type: upper-roman;
+}
+
+.markdown-body ol[type="1"] {
+ list-style-type: decimal;
+}
+
+.markdown-body div>ol:not([type]) {
+ list-style-type: decimal;
+}
+
+.markdown-body ul ul,
+.markdown-body ul ol,
+.markdown-body ol ol,
+.markdown-body ol ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+.markdown-body li>p {
+ margin-top: 16px;
+}
+
+.markdown-body li+li {
+ margin-top: .25em;
+}
+
+.markdown-body dl {
+ padding: 0;
+}
+
+.markdown-body dl dt {
+ padding: 0;
+ margin-top: 16px;
+ font-size: 1em;
+ font-style: italic;
+ font-weight: 600;
+}
+
+.markdown-body dl dd {
+ padding: 0 16px;
+ margin-bottom: 16px;
+}
+
+.markdown-body table th {
+ font-weight: 600;
+}
+
+.markdown-body table th,
+.markdown-body table td {
+ padding: 6px 13px;
+ border: 1px solid #d0d7de;
+}
+
+.markdown-body table td>:last-child {
+ margin-bottom: 0;
+}
+
+.markdown-body table tr {
+ background-color: #ffffff;
+ border-top: 1px solid hsla(210,18%,87%,1);
+}
+
+.markdown-body table tr:nth-child(2n) {
+ background-color: #f6f8fa;
+}
+
+.markdown-body table img {
+ background-color: transparent;
+}
+
+.markdown-body img[align=right] {
+ padding-left: 20px;
+}
+
+.markdown-body img[align=left] {
+ padding-right: 20px;
+}
+
+.markdown-body .emoji {
+ max-width: none;
+ vertical-align: text-top;
+ background-color: transparent;
+}
+
+.markdown-body span.frame {
+ display: block;
+ overflow: hidden;
+}
+
+.markdown-body span.frame>span {
+ display: block;
+ float: left;
+ width: auto;
+ padding: 7px;
+ margin: 13px 0 0;
+ overflow: hidden;
+ border: 1px solid #d0d7de;
+}
+
+.markdown-body span.frame span img {
+ display: block;
+ float: left;
+}
+
+.markdown-body span.frame span span {
+ display: block;
+ padding: 5px 0 0;
+ clear: both;
+ color: #1F2328;
+}
+
+.markdown-body span.align-center {
+ display: block;
+ overflow: hidden;
+ clear: both;
+}
+
+.markdown-body span.align-center>span {
+ display: block;
+ margin: 13px auto 0;
+ overflow: hidden;
+ text-align: center;
+}
+
+.markdown-body span.align-center span img {
+ margin: 0 auto;
+ text-align: center;
+}
+
+.markdown-body span.align-right {
+ display: block;
+ overflow: hidden;
+ clear: both;
+}
+
+.markdown-body span.align-right>span {
+ display: block;
+ margin: 13px 0 0;
+ overflow: hidden;
+ text-align: right;
+}
+
+.markdown-body span.align-right span img {
+ margin: 0;
+ text-align: right;
+}
+
+.markdown-body span.float-left {
+ display: block;
+ float: left;
+ margin-right: 13px;
+ overflow: hidden;
+}
+
+.markdown-body span.float-left span {
+ margin: 13px 0 0;
+}
+
+.markdown-body span.float-right {
+ display: block;
+ float: right;
+ margin-left: 13px;
+ overflow: hidden;
+}
+
+.markdown-body span.float-right>span {
+ display: block;
+ margin: 13px auto 0;
+ overflow: hidden;
+ text-align: right;
+}
+
+.markdown-body code,
+.markdown-body tt {
+ padding: .2em .4em;
+ margin: 0;
+ font-size: 85%;
+ white-space: break-spaces;
+ background-color: rgba(175,184,193,0.2);
+ border-radius: 6px;
+}
+
+.markdown-body code br,
+.markdown-body tt br {
+ display: none;
+}
+
+.markdown-body del code {
+ text-decoration: inherit;
+}
+
+.markdown-body samp {
+ font-size: 85%;
+}
+
+.markdown-body pre code {
+ font-size: 100%;
+}
+
+.markdown-body pre>code {
+ padding: 0;
+ margin: 0;
+ word-break: normal;
+ white-space: pre;
+ background: transparent;
+ border: 0;
+}
+
+.markdown-body .highlight {
+ margin-bottom: 16px;
+}
+
+.markdown-body .highlight pre {
+ margin-bottom: 0;
+ word-break: normal;
+}
+
+.markdown-body .highlight pre,
+.markdown-body pre {
+ padding: 16px;
+ overflow: auto;
+ font-size: 85%;
+ line-height: 1.45;
+ color: #1F2328;
+ background-color: #f6f8fa;
+ border-radius: 6px;
+}
+
+.markdown-body pre code,
+.markdown-body pre tt {
+ display: inline;
+ max-width: auto;
+ padding: 0;
+ margin: 0;
+ overflow: visible;
+ line-height: inherit;
+ word-wrap: normal;
+ background-color: transparent;
+ border: 0;
+}
+
+.markdown-body .csv-data td,
+.markdown-body .csv-data th {
+ padding: 5px;
+ overflow: hidden;
+ font-size: 12px;
+ line-height: 1;
+ text-align: left;
+ white-space: nowrap;
+}
+
+.markdown-body .csv-data .blob-num {
+ padding: 10px 8px 9px;
+ text-align: right;
+ background: #ffffff;
+ border: 0;
+}
+
+.markdown-body .csv-data tr {
+ border-top: 0;
+}
+
+.markdown-body .csv-data th {
+ font-weight: 600;
+ background: #f6f8fa;
+ border-top: 0;
+}
+
+.markdown-body [data-footnote-ref]::before {
+ content: "[";
+}
+
+.markdown-body [data-footnote-ref]::after {
+ content: "]";
+}
+
+.markdown-body .footnotes {
+ font-size: 12px;
+ color: #656d76;
+ border-top: 1px solid #d0d7de;
+}
+
+.markdown-body .footnotes ol {
+ padding-left: 16px;
+}
+
+.markdown-body .footnotes ol ul {
+ display: inline-block;
+ padding-left: 16px;
+ margin-top: 16px;
+}
+
+.markdown-body .footnotes li {
+ position: relative;
+}
+
+.markdown-body .footnotes li:target::before {
+ position: absolute;
+ top: -8px;
+ right: -8px;
+ bottom: -8px;
+ left: -24px;
+ pointer-events: none;
+ content: "";
+ border: 2px solid #0969da;
+ border-radius: 6px;
+}
+
+.markdown-body .footnotes li:target {
+ color: #1F2328;
+}
+
+.markdown-body .footnotes .data-footnote-backref g-emoji {
+ font-family: monospace;
+}
+
+.markdown-body .pl-c {
+ color: #57606a;
+}
+
+.markdown-body .pl-c1,
+.markdown-body .pl-s .pl-v {
+ color: #0550ae;
+}
+
+.markdown-body .pl-e,
+.markdown-body .pl-en {
+ color: #6639ba;
+}
+
+.markdown-body .pl-smi,
+.markdown-body .pl-s .pl-s1 {
+ color: #24292f;
+}
+
+.markdown-body .pl-ent {
+ color: #116329;
+}
+
+.markdown-body .pl-k {
+ color: #cf222e;
+}
+
+.markdown-body .pl-s,
+.markdown-body .pl-pds,
+.markdown-body .pl-s .pl-pse .pl-s1,
+.markdown-body .pl-sr,
+.markdown-body .pl-sr .pl-cce,
+.markdown-body .pl-sr .pl-sre,
+.markdown-body .pl-sr .pl-sra {
+ color: #0a3069;
+}
+
+.markdown-body .pl-v,
+.markdown-body .pl-smw {
+ color: #953800;
+}
+
+.markdown-body .pl-bu {
+ color: #82071e;
+}
+
+.markdown-body .pl-ii {
+ color: #f6f8fa;
+ background-color: #82071e;
+}
+
+.markdown-body .pl-c2 {
+ color: #f6f8fa;
+ background-color: #cf222e;
+}
+
+.markdown-body .pl-sr .pl-cce {
+ font-weight: bold;
+ color: #116329;
+}
+
+.markdown-body .pl-ml {
+ color: #3b2300;
+}
+
+.markdown-body .pl-mh,
+.markdown-body .pl-mh .pl-en,
+.markdown-body .pl-ms {
+ font-weight: bold;
+ color: #0550ae;
+}
+
+.markdown-body .pl-mi {
+ font-style: italic;
+ color: #24292f;
+}
+
+.markdown-body .pl-mb {
+ font-weight: bold;
+ color: #24292f;
+}
+
+.markdown-body .pl-md {
+ color: #82071e;
+ background-color: #ffebe9;
+}
+
+.markdown-body .pl-mi1 {
+ color: #116329;
+ background-color: #dafbe1;
+}
+
+.markdown-body .pl-mc {
+ color: #953800;
+ background-color: #ffd8b5;
+}
+
+.markdown-body .pl-mi2 {
+ color: #eaeef2;
+ background-color: #0550ae;
+}
+
+.markdown-body .pl-mdr {
+ font-weight: bold;
+ color: #8250df;
+}
+
+.markdown-body .pl-ba {
+ color: #57606a;
+}
+
+.markdown-body .pl-sg {
+ color: #8c959f;
+}
+
+.markdown-body .pl-corl {
+ text-decoration: underline;
+ color: #0a3069;
+}
+
+.markdown-body g-emoji {
+ display: inline-block;
+ min-width: 1ch;
+ font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
+ font-size: 1em;
+ font-style: normal !important;
+ font-weight: 400;
+ line-height: 1;
+ vertical-align: -0.075em;
+}
+
+.markdown-body g-emoji img {
+ width: 1em;
+ height: 1em;
+}
+
+.markdown-body .task-list-item {
+ list-style-type: none;
+}
+
+.markdown-body .task-list-item label {
+ font-weight: 400;
+}
+
+.markdown-body .task-list-item.enabled label {
+ cursor: pointer;
+}
+
+.markdown-body .task-list-item+.task-list-item {
+ margin-top: 4px;
+}
+
+.markdown-body .task-list-item .handle {
+ display: none;
+}
+
+.markdown-body .task-list-item-checkbox {
+ margin: 0 .2em .25em -1.4em;
+ vertical-align: middle;
+}
+
+.markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox {
+ margin: 0 -1.6em .25em .2em;
+}
+
+.markdown-body .contains-task-list {
+ position: relative;
+}
+
+.markdown-body .contains-task-list:hover .task-list-item-convert-container,
+.markdown-body .contains-task-list:focus-within .task-list-item-convert-container {
+ display: block;
+ width: auto;
+ height: 24px;
+ overflow: visible;
+ clip: auto;
+}
+
+.markdown-body ::-webkit-calendar-picker-indicator {
+ filter: invert(50%);
+}
+
+.markdown-body .markdown-alert {
+ padding: 8px 16px;
+ margin-bottom: 16px;
+ color: inherit;
+ border-left: .25em solid #d0d7de;
+}
+
+.markdown-body .markdown-alert>:first-child {
+ margin-top: 0;
+}
+
+.markdown-body .markdown-alert>:last-child {
+ margin-bottom: 0;
+}
+
+.markdown-body .markdown-alert .markdown-alert-title {
+ display: flex;
+ font-weight: 500;
+ align-items: center;
+ line-height: 1;
+}
+
+.markdown-body .markdown-alert.markdown-alert-note {
+ border-left-color: #0969da;
+}
+
+.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title {
+ color: #0969da;
+}
+
+.markdown-body .markdown-alert.markdown-alert-important {
+ border-left-color: #8250df;
+}
+
+.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title {
+ color: #8250df;
+}
+
+.markdown-body .markdown-alert.markdown-alert-warning {
+ border-left-color: #9a6700;
+}
+
+.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title {
+ color: #9a6700;
+}
+
+.markdown-body .markdown-alert.markdown-alert-tip {
+ border-left-color: #1f883d;
+}
+
+.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title {
+ color: #1a7f37;
+}
+
+.markdown-body .markdown-alert.markdown-alert-caution {
+ border-left-color: #cf222e;
+}
+
+.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title {
+ color: #d1242f;
+}
+
+.codehilite .hll { background-color: #ffffcc }
+.codehilite .c { color: #999988; font-style: italic } /* Comment */
+.codehilite .err { color: #a61717; background-color: #e3d2d2 } /* Error */
+.codehilite .k { color: #000000; font-weight: bold } /* Keyword */
+.codehilite .o { color: #000000; font-weight: bold } /* Operator */
+.codehilite .cm { color: #999988; font-style: italic } /* Comment.Multiline */
+.codehilite .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */
+.codehilite .c1 { color: #999988; font-style: italic } /* Comment.Single */
+.codehilite .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
+.codehilite .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
+.codehilite .ge { color: #000000; font-style: italic } /* Generic.Emph */
+.codehilite .gr { color: #aa0000 } /* Generic.Error */
+.codehilite .gh { color: #999999 } /* Generic.Heading */
+.codehilite .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
+.codehilite .go { color: #888888 } /* Generic.Output */
+.codehilite .gp { color: #555555 } /* Generic.Prompt */
+.codehilite .gs { font-weight: bold } /* Generic.Strong */
+.codehilite .gu { color: #aaaaaa } /* Generic.Subheading */
+.codehilite .gt { color: #aa0000 } /* Generic.Traceback */
+.codehilite .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
+.codehilite .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
+.codehilite .kn { color: #000000; font-weight: bold } /* Keyword.Namespace */
+.codehilite .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
+.codehilite .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
+.codehilite .kt { color: #445588; font-weight: bold } /* Keyword.Type */
+.codehilite .m { color: #009999 } /* Literal.Number */
+.codehilite .s { color: #d01040 } /* Literal.String */
+.codehilite .na { color: #008080 } /* Name.Attribute */
+.codehilite .nb { color: #0086B3 } /* Name.Builtin */
+.codehilite .nc { color: #445588; font-weight: bold } /* Name.Class */
+.codehilite .no { color: #008080 } /* Name.Constant */
+.codehilite .nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */
+.codehilite .ni { color: #800080 } /* Name.Entity */
+.codehilite .ne { color: #990000; font-weight: bold } /* Name.Exception */
+.codehilite .nf { color: #990000; font-weight: bold } /* Name.Function */
+.codehilite .nl { color: #990000; font-weight: bold } /* Name.Label */
+.codehilite .nn { color: #555555 } /* Name.Namespace */
+.codehilite .nt { color: #000080 } /* Name.Tag */
+.codehilite .nv { color: #008080 } /* Name.Variable */
+.codehilite .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.codehilite .w { color: #bbbbbb } /* Text.Whitespace */
+.codehilite .mf { color: #009999 } /* Literal.Number.Float */
+.codehilite .mh { color: #009999 } /* Literal.Number.Hex */
+.codehilite .mi { color: #009999 } /* Literal.Number.Integer */
+.codehilite .mo { color: #009999 } /* Literal.Number.Oct */
+.codehilite .sb { color: #d01040 } /* Literal.String.Backtick */
+.codehilite .sc { color: #d01040 } /* Literal.String.Char */
+.codehilite .sd { color: #d01040 } /* Literal.String.Doc */
+.codehilite .s2 { color: #d01040 } /* Literal.String.Double */
+.codehilite .se { color: #d01040 } /* Literal.String.Escape */
+.codehilite .sh { color: #d01040 } /* Literal.String.Heredoc */
+.codehilite .si { color: #d01040 } /* Literal.String.Interpol */
+.codehilite .sx { color: #d01040 } /* Literal.String.Other */
+.codehilite .sr { color: #009926 } /* Literal.String.Regex */
+.codehilite .s1 { color: #d01040 } /* Literal.String.Single */
+.codehilite .ss { color: #990073 } /* Literal.String.Symbol */
+.codehilite .bp { color: #999999 } /* Name.Builtin.Pseudo */
+.codehilite .vc { color: #008080 } /* Name.Variable.Class */
+.codehilite .vg { color: #008080 } /* Name.Variable.Global */
+.codehilite .vi { color: #008080 } /* Name.Variable.Instance */
+.codehilite .il { color: #009999 } /* Literal.Number.Integer.Long */
+
+
+/*
+Name: Duotone Light
+Author: Simurai, adapted from DuoTone themes for Atom (http://simurai.com/projects/2016/01/01/duotone-themes)
+
+Conversion: Bram de Haan (http://atelierbram.github.io/Base2Tone-prism/output/prism/prism-base2tone-morning-light.css)
+Generated with Base16 Builder (https://github.com/base16-builder/base16-builder)
+*/
+
+code[class*="language-"],
+pre[class*="language-"] {
+ font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
+ font-size: 14px;
+ line-height: 1.375;
+ direction: ltr;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+ background: #faf8f5;
+ color: #728fcb;
+}
+
+pre > code[class*="language-"] {
+ font-size: 1em;
+}
+
+pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
+ text-shadow: none;
+ background: #faf8f5;
+}
+
+pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
+code[class*="language-"]::selection, code[class*="language-"] ::selection {
+ text-shadow: none;
+ background: #faf8f5;
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ padding: 1em;
+ margin: .5em 0;
+ overflow: auto;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ padding: .1em;
+ border-radius: .3em;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: #b6ad9a;
+}
+
+.token.punctuation {
+ color: #b6ad9a;
+}
+
+.token.namespace {
+ opacity: .7;
+}
+
+.token.tag,
+.token.operator,
+.token.number {
+ color: #063289;
+}
+
+.token.property,
+.token.function {
+ color: #b29762;
+}
+
+.token.tag-id,
+.token.selector,
+.token.atrule-id {
+ color: #2d2006;
+}
+
+code.language-javascript,
+.token.attr-name {
+ color: #896724;
+}
+
+code.language-css,
+code.language-scss,
+.token.boolean,
+.token.string,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.language-scss .token.string,
+.style .token.string,
+.token.attr-value,
+.token.keyword,
+.token.control,
+.token.directive,
+.token.unit,
+.token.statement,
+.token.regex,
+.token.atrule {
+ color: #728fcb;
+}
+
+.token.placeholder,
+.token.variable {
+ color: #93abdc;
+}
+
+.token.deleted {
+ text-decoration: line-through;
+}
+
+.token.inserted {
+ border-bottom: 1px dotted #2d2006;
+ text-decoration: none;
+}
+
+.token.italic {
+ font-style: italic;
+}
+
+.token.important,
+.token.bold {
+ font-weight: bold;
+}
+
+.token.important {
+ color: #896724;
+}
+
+.token.entity {
+ cursor: help;
+}
+
+pre > code.highlight {
+ outline: .4em solid #896724;
+ outline-offset: .4em;
+}
+
+/* overrides color-values for the Line Numbers plugin
+ * http://prismjs.com/plugins/line-numbers/
+ */
+.line-numbers.line-numbers .line-numbers-rows {
+ border-right-color: #ece8de;
+}
+
+.line-numbers .line-numbers-rows > span:before {
+ color: #cdc4b1;
+}
+
+/* overrides color-values for the Line Highlight plugin
+ * http://prismjs.com/plugins/line-highlight/
+ */
+.line-highlight.line-highlight {
+ background: rgba(45, 32, 6, 0.2);
+ background: -webkit-linear-gradient(left, rgba(45, 32, 6, 0.2) 70%, rgba(45, 32, 6, 0));
+ background: linear-gradient(to right, rgba(45, 32, 6, 0.2) 70%, rgba(45, 32, 6, 0));
+}
\ No newline at end of file
diff --git a/gh-pages.mjs b/gh-pages.mjs
new file mode 100644
index 00000000..f28fd37e
--- /dev/null
+++ b/gh-pages.mjs
@@ -0,0 +1,41 @@
+#!/usr/bin/env zx
+import ghpages from 'gh-pages';
+
+await $`rm -fr ./dist`
+await $`mkdir -p ./dist`
+await $`cp -r swc-binding/build/dokka/html dist/docs`
+
+await $`cp docs/theme.css dist/theme.css`
+await $`cp docs/prism.js dist/prism.js`
+
+const enMd = await $`npx markdown docs/how-to-implement-swc-jvm-binding.md --stylesheet theme.css --flavor gfm --highlight`
+
+function format(str) {
+ return str
+ .replaceAll('', '')
+ .replaceAll('', '')
+ .replaceAll('<details>', '')
+ .replaceAll('<summary>', '')
+ .replaceAll('</summary>', '
')
+ .replaceAll('</details>\n\n
', '')
+ .replaceAll('<code>', '')
+ .replaceAll('</code>', '')
+ .replaceAll('
', '')
+}
+await fs.writeFile(
+ './dist/how-to-implement-swc-jvm-binding.html',
+ format(enMd.stdout.toString())
+)
+const cnMd = await $`npx markdown docs/how-to-implement-swc-jvm-binding.zh-CN.md --stylesheet theme.css --flavor gfm --highlight`
+
+await fs.writeFile(
+ './dist/how-to-implement-swc-jvm-binding.zh-CN.html',
+ format(cnMd.stdout.toString())
+)
+
+ghpages.publish('./dist', {
+ repo: "https://github.com/yidafu/swc-binding.git",
+}, function(err) {
+ if (err) console.log(err)
+ else console.log(chalk.green("updated github pages"))
+});
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 00000000..241f6fbc
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,12 @@
+# Gradle Properties
+org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
+org.gradle.parallel=true
+org.gradle.caching=true
+
+# Kotlin
+kotlin.code.style=official
+kotlin.incremental=true
+
+# Publishing (placeholder, override via environment or user gradle.properties)
+sonatypeUsername=fakeUser
+sonatypePassword=fakePassword
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 5d522ba6..abf453c7 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
+#Tue Oct 21 23:03:56 CST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.0.2-all.zip
+distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.14-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/package.json b/package.json
new file mode 100644
index 00000000..1e8cd55a
--- /dev/null
+++ b/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "swc-binding",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "gh-pages": "^6.1.1"
+ },
+ "devDependencies": {
+ "@swc/core": "^1.3.0",
+ "github-markdown-css": "^5.5.0",
+ "markdown-to-html": "^0.0.13"
+ }
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
new file mode 100644
index 00000000..193c2a80
--- /dev/null
+++ b/pnpm-lock.yaml
@@ -0,0 +1,921 @@
+lockfileVersion: '9.0'
+
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
+importers:
+
+ .:
+ dependencies:
+ gh-pages:
+ specifier: ^6.1.1
+ version: 6.1.1
+ devDependencies:
+ '@swc/core':
+ specifier: ^1.3.0
+ version: 1.15.2
+ github-markdown-css:
+ specifier: ^5.5.0
+ version: 5.5.0
+ markdown-to-html:
+ specifier: ^0.0.13
+ version: 0.0.13
+
+packages:
+
+ '@swc/core-darwin-arm64@1.15.2':
+ resolution: {integrity: sha512-Ghyz4RJv4zyXzrUC1B2MLQBbppIB5c4jMZJybX2ebdEQAvryEKp3gq1kBksCNsatKGmEgXul88SETU19sMWcrw==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@swc/core-darwin-x64@1.15.2':
+ resolution: {integrity: sha512-7n/PGJOcL2QoptzL42L5xFFfXY5rFxLHnuz1foU+4ruUTG8x2IebGhtwVTpaDN8ShEv2UZObBlT1rrXTba15Zw==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@swc/core-linux-arm-gnueabihf@1.15.2':
+ resolution: {integrity: sha512-ZUQVCfRJ9wimuxkStRSlLwqX4TEDmv6/J+E6FicGkQ6ssLMWoKDy0cAo93HiWt/TWEee5vFhFaSQYzCuBEGO6A==}
+ engines: {node: '>=10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@swc/core-linux-arm64-gnu@1.15.2':
+ resolution: {integrity: sha512-GZh3pYBmfnpQ+JIg+TqLuz+pM+Mjsk5VOzi8nwKn/m+GvQBsxD5ectRtxuWUxMGNG8h0lMy4SnHRqdK3/iJl7A==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@swc/core-linux-arm64-musl@1.15.2':
+ resolution: {integrity: sha512-5av6VYZZeneiYIodwzGMlnyVakpuYZryGzFIbgu1XP8wVylZxduEzup4eP8atiMDFmIm+s4wn8GySJmYqeJC0A==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@swc/core-linux-x64-gnu@1.15.2':
+ resolution: {integrity: sha512-1nO/UfdCLuT/uE/7oB3EZgTeZDCIa6nL72cFEpdegnqpJVNDI6Qb8U4g/4lfVPkmHq2lvxQ0L+n+JdgaZLhrRA==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@swc/core-linux-x64-musl@1.15.2':
+ resolution: {integrity: sha512-Ksfrb0Tx310kr+TLiUOvB/I80lyZ3lSOp6cM18zmNRT/92NB4mW8oX2Jo7K4eVEI2JWyaQUAFubDSha2Q+439A==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@swc/core-win32-arm64-msvc@1.15.2':
+ resolution: {integrity: sha512-IzUb5RlMUY0r1A9IuJrQ7Tbts1wWb73/zXVXT8VhewbHGoNlBKE0qUhKMED6Tv4wDF+pmbtUJmKXDthytAvLmg==}
+ engines: {node: '>=10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@swc/core-win32-ia32-msvc@1.15.2':
+ resolution: {integrity: sha512-kCATEzuY2LP9AlbU2uScjcVhgnCAkRdu62vbce17Ro5kxEHxYWcugkveyBRS3AqZGtwAKYbMAuNloer9LS/hpw==}
+ engines: {node: '>=10'}
+ cpu: [ia32]
+ os: [win32]
+
+ '@swc/core-win32-x64-msvc@1.15.2':
+ resolution: {integrity: sha512-iJaHeYCF4jTn7OEKSa3KRiuVFIVYts8jYjNmCdyz1u5g8HRyTDISD76r8+ljEOgm36oviRQvcXaw6LFp1m0yyA==}
+ engines: {node: '>=10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@swc/core@1.15.2':
+ resolution: {integrity: sha512-OQm+yJdXxvSjqGeaWhP6Ia264ogifwAO7Q12uTDVYj/Ks4jBTI4JknlcjDRAXtRhqbWsfbZyK/5RtuIPyptk3w==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ '@swc/helpers': '>=0.5.17'
+ peerDependenciesMeta:
+ '@swc/helpers':
+ optional: true
+
+ '@swc/counter@0.1.3':
+ resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
+
+ '@swc/types@0.1.25':
+ resolution: {integrity: sha512-iAoY/qRhNH8a/hBvm3zKj9qQ4oc2+3w1unPJa2XvTK3XjeLXtzcCingVPw/9e5mn1+0yPqxcBGp9Jf0pkfMb1g==}
+
+ ajv@6.12.6:
+ resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
+
+ array-union@1.0.2:
+ resolution: {integrity: sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==}
+ engines: {node: '>=0.10.0'}
+
+ array-uniq@1.0.3:
+ resolution: {integrity: sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==}
+ engines: {node: '>=0.10.0'}
+
+ asn1@0.2.6:
+ resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==}
+
+ assert-plus@1.0.0:
+ resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
+ engines: {node: '>=0.8'}
+
+ async@3.2.5:
+ resolution: {integrity: sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==}
+
+ asynckit@0.4.0:
+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
+
+ aws-sign2@0.7.0:
+ resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==}
+
+ aws4@1.12.0:
+ resolution: {integrity: sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==}
+
+ balanced-match@1.0.2:
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+
+ bcrypt-pbkdf@1.0.2:
+ resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}
+
+ bl@0.4.2:
+ resolution: {integrity: sha512-/Jhsskdr/kVmqiA+zn6A1h0Z9pRLXrx/yxOlhKVgwaiCMtb+/UhZOHlefRAqArQVRRuOxOu+MvzQh/yIvFMZlQ==}
+
+ brace-expansion@1.1.11:
+ resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
+
+ caseless@0.12.0:
+ resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}
+
+ combined-stream@1.0.8:
+ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
+ engines: {node: '>= 0.8'}
+
+ commander@11.1.0:
+ resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==}
+ engines: {node: '>=16'}
+
+ commondir@1.0.1:
+ resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
+
+ concat-map@0.0.1:
+ resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+
+ core-util-is@1.0.2:
+ resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
+
+ core-util-is@1.0.3:
+ resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
+
+ dashdash@1.14.1:
+ resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}
+ engines: {node: '>=0.10'}
+
+ delayed-stream@1.0.0:
+ resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
+ engines: {node: '>=0.4.0'}
+
+ ecc-jsbn@0.1.2:
+ resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==}
+
+ email-addresses@5.0.0:
+ resolution: {integrity: sha512-4OIPYlA6JXqtVn8zpHpGiI7vE6EQOAg16aGnDMIAlZVinnoZ8208tW1hAbjWydgN/4PLTT9q+O1K6AH/vALJGw==}
+
+ escape-string-regexp@1.0.5:
+ resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
+ engines: {node: '>=0.8.0'}
+
+ extend@3.0.2:
+ resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
+
+ extsprintf@1.3.0:
+ resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==}
+ engines: {'0': node >=0.6.0}
+
+ fast-deep-equal@3.1.3:
+ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+
+ fast-json-stable-stringify@2.1.0:
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
+
+ filename-reserved-regex@2.0.0:
+ resolution: {integrity: sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==}
+ engines: {node: '>=4'}
+
+ filenamify@4.3.0:
+ resolution: {integrity: sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==}
+ engines: {node: '>=8'}
+
+ find-cache-dir@3.3.2:
+ resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==}
+ engines: {node: '>=8'}
+
+ find-up@4.1.0:
+ resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
+ engines: {node: '>=8'}
+
+ forever-agent@0.6.1:
+ resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==}
+
+ form-data@2.3.3:
+ resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==}
+ engines: {node: '>= 0.12'}
+
+ fs-extra@11.2.0:
+ resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==}
+ engines: {node: '>=14.14'}
+
+ fs.realpath@1.0.0:
+ resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
+
+ getpass@0.1.7:
+ resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==}
+
+ gfm-linkify@0.1.0:
+ resolution: {integrity: sha512-IBlmOdGcoXoVvpfy+21KghIRSZaph3r+HuQkFjyga5oBoHnhkOgS2LP0/zc3OgnnPxrsU/JrjshF10+KTD+T3g==}
+
+ gh-pages@6.1.1:
+ resolution: {integrity: sha512-upnohfjBwN5hBP9w2dPE7HO5JJTHzSGMV1JrLrHvNuqmjoYHg6TBrCcnEoorjG/e0ejbuvnwyKMdTyM40PEByw==}
+ engines: {node: '>=10'}
+ hasBin: true
+
+ github-markdown-css@5.5.0:
+ resolution: {integrity: sha512-Ncp4putm+cGteDhtNYKGdchM4uiIm5tmQcAQx/eEYhuM0sOdjZYNQOauQTaodjDQjfw7whU99MijwC1M0FUY4w==}
+ engines: {node: '>=10'}
+
+ glob@7.2.3:
+ resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
+
+ globby@6.1.0:
+ resolution: {integrity: sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==}
+ engines: {node: '>=0.10.0'}
+
+ graceful-fs@4.2.11:
+ resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
+
+ har-schema@2.0.0:
+ resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==}
+ engines: {node: '>=4'}
+
+ har-validator@5.1.5:
+ resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==}
+ engines: {node: '>=6'}
+ deprecated: this library is no longer supported
+
+ http-signature@1.2.0:
+ resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}
+ engines: {node: '>=0.8', npm: '>=1.3.7'}
+
+ inflight@1.0.6:
+ resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
+
+ inherits@2.0.4:
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
+
+ is-typedarray@1.0.0:
+ resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==}
+
+ isarray@0.0.1:
+ resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==}
+
+ isstream@0.1.2:
+ resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}
+
+ jsbn@0.1.1:
+ resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}
+
+ json-schema-traverse@0.4.1:
+ resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
+
+ json-schema@0.4.0:
+ resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}
+
+ json-stringify-safe@5.0.1:
+ resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
+
+ jsonfile@6.1.0:
+ resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
+
+ jsprim@1.4.2:
+ resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==}
+ engines: {node: '>=0.6.0'}
+
+ locate-path@5.0.0:
+ resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
+ engines: {node: '>=8'}
+
+ make-dir@3.1.0:
+ resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
+ engines: {node: '>=8'}
+
+ markdown-to-html@0.0.13:
+ resolution: {integrity: sha512-Gj4LOPRgwWKh6i2ccXqpf9mBQEG5gS2qhipCp3bugs32nIvEa0HqeOHW4nkmkGLeozvQRoNmqm3VZ5Aj6c+thg==}
+ hasBin: true
+
+ marked@0.3.19:
+ resolution: {integrity: sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==}
+ engines: {node: '>=0.10.0'}
+ hasBin: true
+
+ mime-db@1.52.0:
+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
+ engines: {node: '>= 0.6'}
+
+ mime-types@2.1.35:
+ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
+ engines: {node: '>= 0.6'}
+
+ minimatch@3.1.2:
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
+
+ oauth-sign@0.9.0:
+ resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==}
+
+ object-assign@4.1.1:
+ resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
+ engines: {node: '>=0.10.0'}
+
+ object-keys@0.4.0:
+ resolution: {integrity: sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==}
+
+ once@1.4.0:
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
+
+ open@0.0.5:
+ resolution: {integrity: sha512-+X/dJYLapVO1VbC620DhtNZK9U4/kQVaTQp/Gh7cb6UTLYfGZzzU2ZXkWrOA/wBrf4UqAFwtLqXYTxe4tSnWQQ==}
+ engines: {node: '>= 0.6.0'}
+
+ p-limit@2.3.0:
+ resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
+ engines: {node: '>=6'}
+
+ p-locate@4.1.0:
+ resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
+ engines: {node: '>=8'}
+
+ p-try@2.2.0:
+ resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
+ engines: {node: '>=6'}
+
+ path-exists@4.0.0:
+ resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
+ engines: {node: '>=8'}
+
+ path-is-absolute@1.0.1:
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
+ engines: {node: '>=0.10.0'}
+
+ performance-now@2.1.0:
+ resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
+
+ pify@2.3.0:
+ resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
+ engines: {node: '>=0.10.0'}
+
+ pinkie-promise@2.0.1:
+ resolution: {integrity: sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==}
+ engines: {node: '>=0.10.0'}
+
+ pinkie@2.0.4:
+ resolution: {integrity: sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==}
+ engines: {node: '>=0.10.0'}
+
+ pkg-dir@4.2.0:
+ resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
+ engines: {node: '>=8'}
+
+ psl@1.9.0:
+ resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==}
+
+ punycode@2.3.1:
+ resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
+ engines: {node: '>=6'}
+
+ pygmentize-bundled@2.3.0:
+ resolution: {integrity: sha512-6qdRNJxwOWh3pl06KWWPtcgufBDqBZT18E3DS+PxbqGTgO1UU3MTbeWSFqZo6qMmjZO1wBacB7baLo5EZxeJnQ==}
+ deprecated: no longer maintained
+
+ qs@6.5.3:
+ resolution: {integrity: sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==}
+ engines: {node: '>=0.6'}
+
+ readable-stream@1.0.34:
+ resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==}
+
+ readable-stream@1.1.14:
+ resolution: {integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==}
+
+ request@2.88.2:
+ resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==}
+ engines: {node: '>= 6'}
+ deprecated: request has been deprecated, see https://github.com/request/request/issues/3142
+
+ safe-buffer@5.2.1:
+ resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
+
+ safer-buffer@2.1.2:
+ resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
+
+ semver@6.3.1:
+ resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
+ hasBin: true
+
+ sshpk@1.18.0:
+ resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==}
+ engines: {node: '>=0.10.0'}
+ hasBin: true
+
+ string_decoder@0.10.31:
+ resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==}
+
+ strip-outer@1.0.1:
+ resolution: {integrity: sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==}
+ engines: {node: '>=0.10.0'}
+
+ through2@0.2.3:
+ resolution: {integrity: sha512-mLa8Bn2mZurjyomGKWRu3Bo2mvoQojFks9NvOK8H+k4kDJNkdEqG522KFZsEFBEl6rKkxTgFbE5+OPcgfvPEHA==}
+
+ tmp@0.0.24:
+ resolution: {integrity: sha512-z6TbUngjp7wMWIKNeUTuA24oRTW+HGCN7LlBgUPfNzCv5J/JsLsuF/qBh6tCUS2+ALGQ/4U5W4L4yUk7qIFWrg==}
+ engines: {node: '>=0.4.0'}
+
+ tough-cookie@2.5.0:
+ resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==}
+ engines: {node: '>=0.8'}
+
+ trim-repeated@1.0.0:
+ resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==}
+ engines: {node: '>=0.10.0'}
+
+ tunnel-agent@0.6.0:
+ resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
+
+ tweetnacl@0.14.5:
+ resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}
+
+ universalify@2.0.1:
+ resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
+ engines: {node: '>= 10.0.0'}
+
+ uri-js@4.4.1:
+ resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
+
+ uuid@3.4.0:
+ resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}
+ deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
+ hasBin: true
+
+ verror@1.10.0:
+ resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==}
+ engines: {'0': node >=0.6.0}
+
+ wrappy@1.0.2:
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+
+ xtend@2.1.2:
+ resolution: {integrity: sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==}
+ engines: {node: '>=0.4'}
+
+ yargs@1.3.3:
+ resolution: {integrity: sha512-7OGt4xXoWJQh5ulgZ78rKaqY7dNWbjfK+UKxGcIlaM2j7C4fqGchyv8CPvEWdRPrHp6Ula/YU8yGRpYGOHrI+g==}
+
+snapshots:
+
+ '@swc/core-darwin-arm64@1.15.2':
+ optional: true
+
+ '@swc/core-darwin-x64@1.15.2':
+ optional: true
+
+ '@swc/core-linux-arm-gnueabihf@1.15.2':
+ optional: true
+
+ '@swc/core-linux-arm64-gnu@1.15.2':
+ optional: true
+
+ '@swc/core-linux-arm64-musl@1.15.2':
+ optional: true
+
+ '@swc/core-linux-x64-gnu@1.15.2':
+ optional: true
+
+ '@swc/core-linux-x64-musl@1.15.2':
+ optional: true
+
+ '@swc/core-win32-arm64-msvc@1.15.2':
+ optional: true
+
+ '@swc/core-win32-ia32-msvc@1.15.2':
+ optional: true
+
+ '@swc/core-win32-x64-msvc@1.15.2':
+ optional: true
+
+ '@swc/core@1.15.2':
+ dependencies:
+ '@swc/counter': 0.1.3
+ '@swc/types': 0.1.25
+ optionalDependencies:
+ '@swc/core-darwin-arm64': 1.15.2
+ '@swc/core-darwin-x64': 1.15.2
+ '@swc/core-linux-arm-gnueabihf': 1.15.2
+ '@swc/core-linux-arm64-gnu': 1.15.2
+ '@swc/core-linux-arm64-musl': 1.15.2
+ '@swc/core-linux-x64-gnu': 1.15.2
+ '@swc/core-linux-x64-musl': 1.15.2
+ '@swc/core-win32-arm64-msvc': 1.15.2
+ '@swc/core-win32-ia32-msvc': 1.15.2
+ '@swc/core-win32-x64-msvc': 1.15.2
+
+ '@swc/counter@0.1.3': {}
+
+ '@swc/types@0.1.25':
+ dependencies:
+ '@swc/counter': 0.1.3
+
+ ajv@6.12.6:
+ dependencies:
+ fast-deep-equal: 3.1.3
+ fast-json-stable-stringify: 2.1.0
+ json-schema-traverse: 0.4.1
+ uri-js: 4.4.1
+
+ array-union@1.0.2:
+ dependencies:
+ array-uniq: 1.0.3
+
+ array-uniq@1.0.3: {}
+
+ asn1@0.2.6:
+ dependencies:
+ safer-buffer: 2.1.2
+
+ assert-plus@1.0.0: {}
+
+ async@3.2.5: {}
+
+ asynckit@0.4.0: {}
+
+ aws-sign2@0.7.0: {}
+
+ aws4@1.12.0: {}
+
+ balanced-match@1.0.2: {}
+
+ bcrypt-pbkdf@1.0.2:
+ dependencies:
+ tweetnacl: 0.14.5
+
+ bl@0.4.2:
+ dependencies:
+ readable-stream: 1.0.34
+
+ brace-expansion@1.1.11:
+ dependencies:
+ balanced-match: 1.0.2
+ concat-map: 0.0.1
+
+ caseless@0.12.0: {}
+
+ combined-stream@1.0.8:
+ dependencies:
+ delayed-stream: 1.0.0
+
+ commander@11.1.0: {}
+
+ commondir@1.0.1: {}
+
+ concat-map@0.0.1: {}
+
+ core-util-is@1.0.2: {}
+
+ core-util-is@1.0.3: {}
+
+ dashdash@1.14.1:
+ dependencies:
+ assert-plus: 1.0.0
+
+ delayed-stream@1.0.0: {}
+
+ ecc-jsbn@0.1.2:
+ dependencies:
+ jsbn: 0.1.1
+ safer-buffer: 2.1.2
+
+ email-addresses@5.0.0: {}
+
+ escape-string-regexp@1.0.5: {}
+
+ extend@3.0.2: {}
+
+ extsprintf@1.3.0: {}
+
+ fast-deep-equal@3.1.3: {}
+
+ fast-json-stable-stringify@2.1.0: {}
+
+ filename-reserved-regex@2.0.0: {}
+
+ filenamify@4.3.0:
+ dependencies:
+ filename-reserved-regex: 2.0.0
+ strip-outer: 1.0.1
+ trim-repeated: 1.0.0
+
+ find-cache-dir@3.3.2:
+ dependencies:
+ commondir: 1.0.1
+ make-dir: 3.1.0
+ pkg-dir: 4.2.0
+
+ find-up@4.1.0:
+ dependencies:
+ locate-path: 5.0.0
+ path-exists: 4.0.0
+
+ forever-agent@0.6.1: {}
+
+ form-data@2.3.3:
+ dependencies:
+ asynckit: 0.4.0
+ combined-stream: 1.0.8
+ mime-types: 2.1.35
+
+ fs-extra@11.2.0:
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 6.1.0
+ universalify: 2.0.1
+
+ fs.realpath@1.0.0: {}
+
+ getpass@0.1.7:
+ dependencies:
+ assert-plus: 1.0.0
+
+ gfm-linkify@0.1.0: {}
+
+ gh-pages@6.1.1:
+ dependencies:
+ async: 3.2.5
+ commander: 11.1.0
+ email-addresses: 5.0.0
+ filenamify: 4.3.0
+ find-cache-dir: 3.3.2
+ fs-extra: 11.2.0
+ globby: 6.1.0
+
+ github-markdown-css@5.5.0: {}
+
+ glob@7.2.3:
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 3.1.2
+ once: 1.4.0
+ path-is-absolute: 1.0.1
+
+ globby@6.1.0:
+ dependencies:
+ array-union: 1.0.2
+ glob: 7.2.3
+ object-assign: 4.1.1
+ pify: 2.3.0
+ pinkie-promise: 2.0.1
+
+ graceful-fs@4.2.11: {}
+
+ har-schema@2.0.0: {}
+
+ har-validator@5.1.5:
+ dependencies:
+ ajv: 6.12.6
+ har-schema: 2.0.0
+
+ http-signature@1.2.0:
+ dependencies:
+ assert-plus: 1.0.0
+ jsprim: 1.4.2
+ sshpk: 1.18.0
+
+ inflight@1.0.6:
+ dependencies:
+ once: 1.4.0
+ wrappy: 1.0.2
+
+ inherits@2.0.4: {}
+
+ is-typedarray@1.0.0: {}
+
+ isarray@0.0.1: {}
+
+ isstream@0.1.2: {}
+
+ jsbn@0.1.1: {}
+
+ json-schema-traverse@0.4.1: {}
+
+ json-schema@0.4.0: {}
+
+ json-stringify-safe@5.0.1: {}
+
+ jsonfile@6.1.0:
+ dependencies:
+ universalify: 2.0.1
+ optionalDependencies:
+ graceful-fs: 4.2.11
+
+ jsprim@1.4.2:
+ dependencies:
+ assert-plus: 1.0.0
+ extsprintf: 1.3.0
+ json-schema: 0.4.0
+ verror: 1.10.0
+
+ locate-path@5.0.0:
+ dependencies:
+ p-locate: 4.1.0
+
+ make-dir@3.1.0:
+ dependencies:
+ semver: 6.3.1
+
+ markdown-to-html@0.0.13:
+ dependencies:
+ gfm-linkify: 0.1.0
+ marked: 0.3.19
+ open: 0.0.5
+ pygmentize-bundled: 2.3.0
+ request: 2.88.2
+ tmp: 0.0.24
+ yargs: 1.3.3
+
+ marked@0.3.19: {}
+
+ mime-db@1.52.0: {}
+
+ mime-types@2.1.35:
+ dependencies:
+ mime-db: 1.52.0
+
+ minimatch@3.1.2:
+ dependencies:
+ brace-expansion: 1.1.11
+
+ oauth-sign@0.9.0: {}
+
+ object-assign@4.1.1: {}
+
+ object-keys@0.4.0: {}
+
+ once@1.4.0:
+ dependencies:
+ wrappy: 1.0.2
+
+ open@0.0.5: {}
+
+ p-limit@2.3.0:
+ dependencies:
+ p-try: 2.2.0
+
+ p-locate@4.1.0:
+ dependencies:
+ p-limit: 2.3.0
+
+ p-try@2.2.0: {}
+
+ path-exists@4.0.0: {}
+
+ path-is-absolute@1.0.1: {}
+
+ performance-now@2.1.0: {}
+
+ pify@2.3.0: {}
+
+ pinkie-promise@2.0.1:
+ dependencies:
+ pinkie: 2.0.4
+
+ pinkie@2.0.4: {}
+
+ pkg-dir@4.2.0:
+ dependencies:
+ find-up: 4.1.0
+
+ psl@1.9.0: {}
+
+ punycode@2.3.1: {}
+
+ pygmentize-bundled@2.3.0:
+ dependencies:
+ bl: 0.4.2
+ through2: 0.2.3
+
+ qs@6.5.3: {}
+
+ readable-stream@1.0.34:
+ dependencies:
+ core-util-is: 1.0.3
+ inherits: 2.0.4
+ isarray: 0.0.1
+ string_decoder: 0.10.31
+
+ readable-stream@1.1.14:
+ dependencies:
+ core-util-is: 1.0.3
+ inherits: 2.0.4
+ isarray: 0.0.1
+ string_decoder: 0.10.31
+
+ request@2.88.2:
+ dependencies:
+ aws-sign2: 0.7.0
+ aws4: 1.12.0
+ caseless: 0.12.0
+ combined-stream: 1.0.8
+ extend: 3.0.2
+ forever-agent: 0.6.1
+ form-data: 2.3.3
+ har-validator: 5.1.5
+ http-signature: 1.2.0
+ is-typedarray: 1.0.0
+ isstream: 0.1.2
+ json-stringify-safe: 5.0.1
+ mime-types: 2.1.35
+ oauth-sign: 0.9.0
+ performance-now: 2.1.0
+ qs: 6.5.3
+ safe-buffer: 5.2.1
+ tough-cookie: 2.5.0
+ tunnel-agent: 0.6.0
+ uuid: 3.4.0
+
+ safe-buffer@5.2.1: {}
+
+ safer-buffer@2.1.2: {}
+
+ semver@6.3.1: {}
+
+ sshpk@1.18.0:
+ dependencies:
+ asn1: 0.2.6
+ assert-plus: 1.0.0
+ bcrypt-pbkdf: 1.0.2
+ dashdash: 1.14.1
+ ecc-jsbn: 0.1.2
+ getpass: 0.1.7
+ jsbn: 0.1.1
+ safer-buffer: 2.1.2
+ tweetnacl: 0.14.5
+
+ string_decoder@0.10.31: {}
+
+ strip-outer@1.0.1:
+ dependencies:
+ escape-string-regexp: 1.0.5
+
+ through2@0.2.3:
+ dependencies:
+ readable-stream: 1.1.14
+ xtend: 2.1.2
+
+ tmp@0.0.24: {}
+
+ tough-cookie@2.5.0:
+ dependencies:
+ psl: 1.9.0
+ punycode: 2.3.1
+
+ trim-repeated@1.0.0:
+ dependencies:
+ escape-string-regexp: 1.0.5
+
+ tunnel-agent@0.6.0:
+ dependencies:
+ safe-buffer: 5.2.1
+
+ tweetnacl@0.14.5: {}
+
+ universalify@2.0.1: {}
+
+ uri-js@4.4.1:
+ dependencies:
+ punycode: 2.3.1
+
+ uuid@3.4.0: {}
+
+ verror@1.10.0:
+ dependencies:
+ assert-plus: 1.0.0
+ core-util-is: 1.0.2
+ extsprintf: 1.3.0
+
+ wrappy@1.0.2: {}
+
+ xtend@2.1.2:
+ dependencies:
+ object-keys: 0.4.0
+
+ yargs@1.3.3: {}
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 642cd9a5..27843e48 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -10,6 +10,7 @@
pluginManagement {
repositories {
+ maven("https://repo.huaweicloud.com/repository/maven/")
maven("https://mirrors.cloud.tencent.com/nexus/repository/maven-public")
maven("https://s01.oss.sonatype.org/content/groups/public/")
gradlePluginPortal()
@@ -20,6 +21,13 @@ pluginManagement {
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
+ repositories {
+ maven("https://repo.huaweicloud.com/repository/maven/")
+ maven("https://mirrors.cloud.tencent.com/nexus/repository/maven-public")
+ maven("https://s01.oss.sonatype.org/content/groups/public/")
+ mavenCentral()
+ }
+
versionCatalogs {
create("libs") {
from(files("./build-plugin/libs.versions.toml"))
@@ -33,3 +41,6 @@ rootProject.name = "swc-bing"
include("swc-binding")
project(":swc-binding").name = "swc-binding"
+
+include("swc-generator")
+project(":swc-generator").name = "swc-generator"
diff --git a/setup-ubuntu.sh b/setup-ubuntu.sh
new file mode 100644
index 00000000..13b52809
--- /dev/null
+++ b/setup-ubuntu.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+sudo apt update
+sudo apt upgrade
+sudo apt install build-essential
+sudo apt install llvm
+cargo install cargo-zigbuild
+cargo install cargo-xwin
+
+cd swc-jni
+
+cargo zigbuild --release --target x86_64-unknown-linux-gnu
+cargo zigbuild --release --target aarch64-unknown-linux-gnu
+
+mkdir -p ../swc-binding/src/main/resources/linux-x64-gnu
+mkdir -p ../swc-binding/src/main/resources/linux-aarch64-gnu
+
+cp target/arm-unknown-linux-aarch64/release/libswc_jni.so ../swc-binding/src/main/resources/linux-aarch64-gnu
+cp target/x86_64-unknown-linux-gnu/release/libswc_jni.so ../swc-binding/src/main/resources/linux-x64-gnu
\ No newline at end of file
diff --git a/setup.sh b/setup.sh
new file mode 100755
index 00000000..60030ce3
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,191 @@
+#!/bin/bash
+
+# =============================================================================
+# SWC JNI Binding - Build Setup Script
+# =============================================================================
+# This script prepares the environment for building SWC JNI bindings
+# for multiple platforms with optimal toolchain configurations.
+#
+# Supported platforms:
+# - macOS: darwin-x64-apple, darwin-arm64-apple
+# - Linux: linux-x64-musl, linux-arm64-gnu
+# - Windows: windows-x64-gnu, windows-arm64-gnu
+# =============================================================================
+
+set -e # Exit on any error
+
+echo "🚀 Setting up SWC JNI Binding build environment..."
+echo "=================================================="
+
+# =============================================================================
+# 1. Check Rust installation
+# =============================================================================
+echo "📦 Checking Rust installation..."
+
+if ! command -v rustc &> /dev/null; then
+ echo "❌ Rust is not installed. Please install Rust first:"
+ echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
+ echo " source ~/.cargo/env"
+ exit 1
+fi
+
+RUST_VERSION=$(rustc --version)
+echo "✅ Rust found: $RUST_VERSION"
+
+# =============================================================================
+# 2. Install required Rust targets
+# =============================================================================
+echo "🎯 Installing required Rust targets..."
+
+TARGETS=(
+ "x86_64-apple-darwin" # macOS Intel
+ "aarch64-apple-darwin" # macOS ARM64
+ "x86_64-unknown-linux-musl" # Linux x64 (musl static)
+ "aarch64-unknown-linux-gnu" # Linux ARM64 (GNU)
+ "x86_64-pc-windows-gnu" # Windows x64 (GNU)
+ "aarch64-pc-windows-gnullvm" # Windows ARM64 (GNU)
+)
+
+for target in "${TARGETS[@]}"; do
+ echo " Installing target: $target"
+ rustup target add "$target" || {
+ echo "⚠️ Failed to install target $target, but continuing..."
+ }
+done
+
+echo "✅ Rust targets installation completed"
+
+# =============================================================================
+# 3. Install cargo-zigbuild
+# =============================================================================
+echo "🔧 Installing cargo-zigbuild..."
+
+if ! command -v cargo-zigbuild &> /dev/null; then
+ echo " Installing cargo-zigbuild..."
+ cargo install cargo-zigbuild || {
+ echo "❌ Failed to install cargo-zigbuild"
+ echo " Please install manually: cargo install cargo-zigbuild"
+ exit 1
+ }
+else
+ echo "✅ cargo-zigbuild already installed"
+fi
+
+ZIGBUILD_VERSION=$(cargo-zigbuild --version 2>/dev/null || echo "unknown")
+echo "✅ cargo-zigbuild version: $ZIGBUILD_VERSION"
+
+# =============================================================================
+# 4. Install Zig (required by cargo-zigbuild)
+# =============================================================================
+echo "🧱 Installing Zig..."
+
+if ! command -v zig &> /dev/null; then
+ if command -v brew &> /dev/null; then
+ echo " Using Homebrew to install Zig..."
+ brew install zig || {
+ echo "❌ Failed to install Zig via Homebrew"
+ exit 1
+ }
+ elif command -v apt-get &> /dev/null; then
+ echo " Using apt-get to install Zig..."
+ sudo apt-get update
+ sudo apt-get install -y zig || {
+ echo "❌ Failed to install Zig via apt-get"
+ exit 1
+ }
+ elif command -v pacman &> /dev/null; then
+ echo " Using pacman to install Zig..."
+ sudo pacman -S --noconfirm zig || {
+ echo "❌ Failed to install Zig via pacman"
+ exit 1
+ }
+ else
+ echo "❌ Zig 未安装且无法检测到受支持的包管理器,请手动安装 Zig:"
+ echo " https://ziglang.org/download/"
+ exit 1
+ fi
+else
+ echo "✅ Zig 已安装"
+fi
+
+ZIG_VERSION=$(zig version 2>/dev/null || echo "unknown")
+echo "✅ Zig version: $ZIG_VERSION"
+
+# =============================================================================
+# 5. Verify build environment
+# =============================================================================
+echo "🔍 Verifying build environment..."
+
+# Check if we're in the right directory
+if [ ! -f "swc-jni/Cargo.toml" ]; then
+ echo "❌ Please run this script from the project root directory"
+ echo " Expected to find: swc-jni/Cargo.toml"
+ exit 1
+fi
+
+# Check if build script exists
+if [ ! -f "swc-jni/build.sh" ]; then
+ echo "❌ Build script not found: swc-jni/build.sh"
+ exit 1
+fi
+
+echo "✅ Build environment verified"
+
+# =============================================================================
+# 6. Display build configuration
+# =============================================================================
+echo "📋 Build Configuration Summary"
+echo "==============================="
+echo "Platforms and toolchains:"
+echo " • macOS Intel: darwin-x64-apple (Apple toolchain)"
+echo " • macOS ARM64: darwin-arm64-apple (Apple toolchain)"
+echo " • Linux x64: linux-x64-musl (musl static linking)"
+echo " • Linux ARM64: linux-arm64-gnu (GNU toolchain)"
+echo " • Windows x64: windows-x64-gnu (GNU toolchain)"
+echo " • Windows ARM64: windows-arm64-gnu (GNU toolchain)"
+echo ""
+echo "Build tool: cargo-zigbuild"
+echo "Output directory: swc-binding/src/main/resources/"
+echo ""
+
+# =============================================================================
+# 7. Optional: Test build (if requested)
+# =============================================================================
+if [ "$1" = "--test-build" ]; then
+ echo "🧪 Running test build..."
+ cd swc-jni
+ ./build.sh
+ echo "✅ Test build completed successfully!"
+ cd ..
+fi
+
+# =============================================================================
+# 8. Final instructions
+# =============================================================================
+echo "🎉 Setup completed successfully!"
+echo ""
+echo "Next steps:"
+echo " 1. Run the build script:"
+echo " cd swc-jni && ./build.sh"
+echo ""
+echo " 2. Or run with test build:"
+echo " ./setup.sh --test-build"
+echo ""
+echo " 3. The built libraries will be available in:"
+echo " swc-binding/src/main/resources/"
+echo ""
+echo "For more information, see:"
+echo " • Build script: swc-jni/build.sh"
+echo " • Documentation: docs/"
+echo ""
+
+# =============================================================================
+# 9. Environment variables (optional)
+# =============================================================================
+echo "💡 Optional environment variables:"
+echo " • RUST_LOG=debug # Enable debug logging"
+echo " • CARGO_TARGET_DIR=target # Custom target directory"
+echo " • CC_aarch64_unknown_linux_gnu=zig # Use zig as linker for Linux ARM64"
+echo ""
+
+echo "✨ Ready to build SWC JNI bindings!"
diff --git a/swc-binding/README.md b/swc-binding/README.md
new file mode 100644
index 00000000..52dad7ed
--- /dev/null
+++ b/swc-binding/README.md
@@ -0,0 +1,101 @@
+# swc-binding (module)
+
+[Read this in Chinese: README.zh-CN.md](README.zh-CN.md)
+
+[](../LICENSE)
+[](https://search.maven.org/artifact/dev.yidafu.swc/swc-binding)
+[](https://kotlinlang.org/)
+[](https://github.com/swc-project/swc)
+[](https://www.oracle.com/java/)
+
+Kotlin/JVM library that provides idiomatic bindings to SWC via JNI. This is the published artifact used by applications.
+
+## Installation
+
+```kotlin
+implementation("dev.yidafu.swc:swc-binding:0.7.0")
+```
+
+## Quick Start
+
+```kotlin
+val swc = SwcNative()
+val output = swc.transformSync(
+ code = "const x: number = 42",
+ isModule = true,
+ options = Options().apply {
+ jsc = jscConfig {
+ parser = ParserConfig().apply { syntax = "typescript" }
+ }
+ }
+)
+println(output.code)
+```
+
+## Documentation
+
+- API Docs: https://yidafu.github.io/swc-binding/docs/
+- Samples: `swc-binding/src/test`
+
+## Important Notes
+
+### Manual AST Construction
+
+When manually constructing AST nodes using the DSL, you **must** explicitly set all boolean fields to avoid serialization errors. The Rust backend expects non-null boolean values, but Kotlin's nullable boolean fields (`Boolean?`) will serialize as `null` if not set.
+
+**Example - Correct:**
+```kotlin
+val mod = module {
+ span = emptySpan()
+ body = arrayOf(
+ variableDeclaration {
+ span = emptySpan()
+ kind = VariableDeclarationKind.CONST
+ declare = false // ✅ Explicitly set
+ declarations = arrayOf(
+ variableDeclarator {
+ id = identifier {
+ value = "x"
+ optional = false // ✅ Explicitly set
+ }
+ init = numericLiteral { ... }
+ }
+ )
+ }
+ )
+}
+```
+
+**Example - Incorrect:**
+```kotlin
+val mod = module {
+ body = arrayOf(
+ variableDeclaration {
+ kind = VariableDeclarationKind.CONST
+ // ❌ Missing 'declare = false' - will cause serialization error
+ declarations = arrayOf(...)
+ }
+ )
+}
+```
+
+**Common boolean fields that must be set:**
+- `Identifier.optional: Boolean?` → set to `false`
+- `VariableDeclaration.declare: Boolean?` → set to `false`
+- `ArrowFunctionExpression.async: Boolean?` → set to `false`
+- `ArrowFunctionExpression.generator: Boolean?` → set to `false`
+- `TemplateElement.tail: Boolean?` → set to `false` or `true` (depending on position)
+
+**Recommended approach:** Use `parseSync` to parse code into AST instead of manually constructing it, as parsed ASTs have all fields properly initialized.
+
+```kotlin
+// ✅ Recommended: Parse code instead of manual construction
+val mod = swcNative.parseSync("const x = 42;", esParseOptions { }, "test.js") as Module
+val output = swcNative.printSync(mod, options { })
+```
+
+## License
+
+MIT
+
+
diff --git a/swc-binding/README.zh-CN.md b/swc-binding/README.zh-CN.md
new file mode 100644
index 00000000..a80d72d7
--- /dev/null
+++ b/swc-binding/README.zh-CN.md
@@ -0,0 +1,101 @@
+# swc-binding(模块)
+
+[查看英文版本: README.md](README.md)
+
+[](../LICENSE)
+[](https://search.maven.org/artifact/dev.yidafu.swc/swc-binding)
+[](https://kotlinlang.org/)
+[](https://github.com/swc-project/swc)
+[](https://www.oracle.com/java/)
+
+提供通过 JNI 访问 SWC 的 Kotlin/JVM 库。该模块即对外发布的依赖产物。
+
+## 安装
+
+```kotlin
+implementation("dev.yidafu.swc:swc-binding:0.7.0")
+```
+
+## 快速上手
+
+```kotlin
+val swc = SwcNative()
+val output = swc.transformSync(
+ code = "const x: number = 42",
+ isModule = true,
+ options = Options().apply {
+ jsc = jscConfig {
+ parser = ParserConfig().apply { syntax = "typescript" }
+ }
+ }
+)
+println(output.code)
+```
+
+## 文档
+
+- API 文档:https://yidafu.github.io/swc-binding/docs/
+- 示例:`swc-binding/src/test`
+
+## 重要提示
+
+### 手动构建 AST
+
+使用 DSL 手动构建 AST 节点时,**必须**显式设置所有布尔字段,以避免序列化错误。Rust 后端期望非空的布尔值,但如果 Kotlin 的可空布尔字段(`Boolean?`)未设置,它们会被序列化为 `null`。
+
+**示例 - 正确:**
+```kotlin
+val mod = module {
+ span = emptySpan()
+ body = arrayOf(
+ variableDeclaration {
+ span = emptySpan()
+ kind = VariableDeclarationKind.CONST
+ declare = false // ✅ 显式设置
+ declarations = arrayOf(
+ variableDeclarator {
+ id = identifier {
+ value = "x"
+ optional = false // ✅ 显式设置
+ }
+ init = numericLiteral { ... }
+ }
+ )
+ }
+ )
+}
+```
+
+**示例 - 错误:**
+```kotlin
+val mod = module {
+ body = arrayOf(
+ variableDeclaration {
+ kind = VariableDeclarationKind.CONST
+ // ❌ 缺少 'declare = false' - 会导致序列化错误
+ declarations = arrayOf(...)
+ }
+ )
+}
+```
+
+**必须设置的常见布尔字段:**
+- `Identifier.optional: Boolean?` → 设置为 `false`
+- `VariableDeclaration.declare: Boolean?` → 设置为 `false`
+- `ArrowFunctionExpression.async: Boolean?` → 设置为 `false`
+- `ArrowFunctionExpression.generator: Boolean?` → 设置为 `false`
+- `TemplateElement.tail: Boolean?` → 根据位置设置为 `false` 或 `true`
+
+**推荐做法:** 使用 `parseSync` 解析代码生成 AST,而不是手动构建,因为解析得到的 AST 所有字段都已正确初始化。
+
+```kotlin
+// ✅ 推荐:解析代码而不是手动构建
+val mod = swcNative.parseSync("const x = 42;", esParseOptions { }, "test.js") as Module
+val output = swcNative.printSync(mod, options { })
+```
+
+## 许可协议
+
+MIT
+
+
diff --git a/swc-binding/build.gradle.kts b/swc-binding/build.gradle.kts
index 398c8ab9..1947f454 100644
--- a/swc-binding/build.gradle.kts
+++ b/swc-binding/build.gradle.kts
@@ -1,17 +1,32 @@
plugins {
id("dev.yidafu.library")
- id("org.jetbrains.kotlin.plugin.serialization") version "1.9.21"
+ alias(libs.plugins.kotlin.serialization)
+ id("org.jetbrains.kotlinx.kover") version "0.7.5"
}
group = "dev.yidafu.swc"
-version = "0.6.0"
+version = "0.7.0"
-dependencies {
- testImplementation(kotlin("test"))
- testImplementation(platform("org.junit:junit-bom:5.9.1"))
- testImplementation("org.junit.jupiter:junit-jupiter")
+kotlin {
+ sourceSets {
+ val main by getting {
+ kotlin.srcDir("src/main/kotlin")
+ kotlin.exclude("dev/yidafu/swc/sample/**")
+ }
+ }
+}
+dependencies {
implementation(libs.kotlin.serialization.json)
+
+ testImplementation(libs.kotest.runner.junit5)
+ testImplementation(libs.kotest.assertions.core)
+ testImplementation(libs.kotest.property)
+ testImplementation(libs.kotest.framework.api)
+ testImplementation(libs.kotest.framework.engine)
+ testImplementation(libs.kotlin.test)
+ testImplementation(libs.kotlinx.coroutines.core)
+ testImplementation(libs.kotlinx.coroutines.test)
}
tasks.test {
@@ -21,4 +36,13 @@ tasks.test {
publishMan {
name.set("swc binding")
description.set("swc jvm binding by kotlin")
+}
+
+ktlint {
+ filter {
+ exclude { element ->
+ val path = element.file.path
+ path.contains("/generated/dsl/") || path.contains("/generated/ast/")
+ }
+ }
}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/DllLoader.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/DllLoader.kt
index ccea813c..a935ba3b 100644
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/DllLoader.kt
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/DllLoader.kt
@@ -4,10 +4,41 @@ import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
+/**
+ * Utility object for loading native SWC library files.
+ *
+ * This object handles platform detection and loading of the appropriate
+ * native library (DLL/dylib/so) for the current operating system and architecture.
+ *
+ * ## Supported Platforms
+ * - **Linux**: x64 (musl) and ARM64 (GNU)
+ * - **macOS**: x64 (Apple) and ARM64 (Apple)
+ * - **Windows**: x64 (GNU) and ARM64 (GNU)
+ *
+ * ## Usage
+ * The library is automatically loaded when [SwcNative] is instantiated.
+ * If the library is not found in the system path, it will be extracted
+ * from JAR resources to a temporary directory and loaded from there.
+ *
+ * @example
+ * ```kotlin
+ * // Library loading happens automatically
+ * val swc = SwcNative() // DllLoader is used internally
+ * ```
+ */
object DllLoader {
+ /**
+ * Absolute path to the extracted native library file.
+ * This is cached after the first extraction to avoid repeated file operations.
+ */
var outAbsPath: String = ""
sealed class Platform {
+ /**
+ * Linux platform detection and resource path mapping.
+ * Uses musl static linking for better compatibility.
+ * Resource paths: linux-x64-musl/ or linux-arm64-musl/
+ */
object Linux : Platform() {
private val cpuArch: String by lazy {
System.getProperty("os.arch")
@@ -25,6 +56,11 @@ object DllLoader {
}
}
+ /**
+ * macOS platform detection and resource path mapping.
+ * Uses Apple native toolchain for optimal performance.
+ * Resource paths: darwin-x64-apple/ or darwin-arm64-apple/
+ */
object Mac : Platform() {
private val cpuBrand: String by lazy {
val pb = ProcessBuilder("sysctl", "-n", "machdep.cpu.brand_string")
@@ -45,7 +81,25 @@ object DllLoader {
return "Mac"
}
}
+
+ /**
+ * Windows platform detection and resource path mapping.
+ * Uses GNU toolchain for better cross-platform compatibility.
+ * Resource paths: windows-x64-gnu/ or windows-arm64-gnu/
+ */
object Windows : Platform() {
+ private val cpuArch: String by lazy {
+ System.getProperty("os.arch")
+ }
+
+ fun isArm(): Boolean {
+ return cpuArch.contains("aarch64") || cpuArch.contains("arm64")
+ }
+
+ fun isIntel(): Boolean {
+ return cpuArch.startsWith("x") || cpuArch.contains("amd64")
+ }
+
override fun toString(): String {
return "Windows"
}
@@ -63,10 +117,15 @@ object DllLoader {
}
}
companion object {
+ /**
+ * Detect the current platform and return the appropriate Platform instance.
+ * * Supported platforms and their resource directories:
+ * - Linux: linux-x64-musl/ or linux-arm64-gnu/
+ * - macOS: darwin-x64-apple/ or darwin-arm64-apple/
+ * - Windows: windows-x64-gnu/ or windows-arm64-gnu/
+ */
val current by lazy {
-
val osName = System.getProperty("os.name")
-// darwin-arm64 darwin-x64 lib linux-x64-gnu linux-x64-musl win32-x64-msvc
when {
osName.startsWith("Linux") -> Linux
osName.startsWith("Mac") || osName.startsWith("Darwin") -> Mac
@@ -79,11 +138,21 @@ object DllLoader {
}
}
+ /**
+ * Copy the native library to a temporary directory and return the absolute path.
+ * * Resource directory structure:
+ * - darwin-x64-apple/ - macOS Intel (Apple toolchain)
+ * - darwin-arm64-apple/ - macOS ARM64 (Apple toolchain)
+ * - linux-x64-musl/ - Linux x64 (musl static linking)
+ * - linux-arm64-gnu/ - Linux ARM64 (GNU toolchain)
+ * - windows-x64-gnu/ - Windows x64 (GNU toolchain)
+ * - windows-arm64-gnu/ - Windows ARM64 (GNU toolchain)
+ */
fun copyDll2Temp(libName: String): String {
val jarPath = when (val p = Platform.current) {
- is Platform.Linux -> (if (p.isArm()) "linux-arm-gnueabihf" else "linux-x64-gnu") + "/lib$libName.so"
- is Platform.Mac -> (if (p.isIntel()) "darwin-x64" else "darwin-arm64") + "/lib$libName.dylib"
- is Platform.Windows -> "win32-x64-msvc/$libName.dll"
+ is Platform.Linux -> (if (p.isArm()) "linux-arm64-gnu" else "linux-x64-musl") + "/lib$libName.so"
+ is Platform.Mac -> (if (p.isIntel()) "darwin-x64-apple" else "darwin-arm64-apple") + "/lib$libName.dylib"
+ is Platform.Windows -> (if (p.isArm()) "windows-arm64-gnu" else "windows-x64-gnu") + "/$libName.dll"
// Platform.SOLARIS -> TODO()
// Platform.FREEBSD -> TODO()
// Platform.UNSPECIFIED -> TODO()
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcException.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcException.kt
index 3a70517d..8d22f31e 100644
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcException.kt
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcException.kt
@@ -1,3 +1,20 @@
package dev.yidafu.swc
+/**
+ * Exception thrown when SWC operations fail.
+ *
+ * This exception wraps error messages from the native SWC library
+ * and provides them as a standard Kotlin exception.
+ *
+ * @param msg Error message describing what went wrong
+ *
+ * @example
+ * ```kotlin
+ * try {
+ * val ast = swc.parseSync(code, options, filename)
+ * } catch (e: SwcException) {
+ * println("SWC error: ${e.message}")
+ * }
+ * ```
+ */
class SwcException(msg: String) : RuntimeException(msg)
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcNative.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcNative.kt
index c993e7fd..8d69e78f 100644
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcNative.kt
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/SwcNative.kt
@@ -1,15 +1,106 @@
package dev.yidafu.swc
-import dev.yidafu.swc.types.* // ktlint-disable no-wildcard-imports
+import dev.yidafu.swc.generated.* // ktlint-disable no-wildcard-imports
import kotlinx.serialization.encodeToString
+import kotlin.coroutines.resume
+import kotlin.coroutines.resumeWithException
+import kotlin.coroutines.suspendCoroutine
+import kotlin.jvm.JvmOverloads
import kotlin.jvm.Throws
+/**
+ * Callback interface for async operations.
+ *
+ * This interface is Java-friendly and can be implemented in Java code
+ * using anonymous inner classes or lambda expressions (Java 8+).
+ *
+ * @example Java usage:
+ * ```java
+ * SwcCallback callback = new SwcCallback() {
+ * @Override
+ * public void onSuccess(String result) {
+ * System.out.println("Success: " + result);
+ * }
+ *
+ * @Override
+ * public void onError(String error) {
+ * System.err.println("Error: " + error);
+ * }
+ * };
+ * ```
+ */
+interface SwcCallback {
+ /**
+ * Called when operation succeeds.
+ *
+ * @param result JSON string of the result
+ */
+ fun onSuccess(result: String)
+
+ /**
+ * Called when operation fails.
+ *
+ * @param error Error message describing what went wrong
+ */
+ fun onError(error: String)
+}
+
+/**
+ * Main entry point for SWC (Speedy Web Compiler) operations in Kotlin/Java.
+ *
+ * This class provides both synchronous and asynchronous methods for:
+ * - Parsing JavaScript/TypeScript code to AST
+ * - Transforming code (transpiling, minifying, etc.)
+ * - Printing AST back to code
+ * - Minifying code
+ *
+ * @sample dev.yidafu.swc.sample.parseSyncEsSample
+ * @sample dev.yidafu.swc.sample.parseSyncTsSample
+ *
+ * ## Usage Examples
+ *
+ * ### Synchronous Parsing
+ * ```kotlin
+ * val swc = SwcNative()
+ * val ast = swc.parseSync(
+ * code = "const x = 42;",
+ * options = esParseOptions { },
+ * filename = "test.js"
+ * )
+ * ```
+ *
+ * ### Asynchronous Parsing with Coroutines
+ * ```kotlin
+ * val swc = SwcNative()
+ * val ast = swc.parseAsync(
+ * code = "const x = 42;",
+ * options = esParseOptions { },
+ * filename = "test.js"
+ * )
+ * ```
+ *
+ * ### Transforming Code
+ * ```kotlin
+ * val swc = SwcNative()
+ * val output = swc.transformSync(
+ * code = "const arrow = () => 42;",
+ * isModule = false,
+ * options = options {
+ * jsc {
+ * target = JscTarget.ES5
+ * }
+ * }
+ * )
+ * println(output.code) // Transformed code
+ * ```
+ */
class SwcNative {
init {
try {
- // 加载 DLL 文件
+ // Try to load the native library from system path
System.loadLibrary("swc_jni")
} catch (e: UnsatisfiedLinkError) {
+ // If not found, copy from JAR resources to temp directory and load
val dllPath = DllLoader.copyDll2Temp("swc_jni")
System.load(dllPath)
}
@@ -25,7 +116,7 @@ class SwcNative {
* @sample [dev.yidafu.swc.sample.parseSyncBasicUsage]
* @throws [SwcAnyException]
* @param [code] source code
- * @param [options] options json string. see [dev.yidafu.swc.types.ParserConfig].
+ * @param [options] options json string. see [dev.yidafu.swc.generated.ParserConfig].
* @param [filename] js file name
* @return ast tree json string
*/
@@ -37,27 +128,39 @@ class SwcNative {
): String
/**
- * parse js code to AST Tree
+ * Parse JavaScript/TypeScript code to AST Tree synchronously.
*
* [swc#parsesync](https://swc.rs/docs/usage/core#parsesync)
*
+ * This method is Java-friendly and can be called from Java code.
+ * For Java usage, you can pass `null` for the filename parameter.
+ *
* @sample dev.yidafu.swc.sample.parseSyncEsSample
* @sample dev.yidafu.swc.sample.parseSyncTsSample
* @sample dev.yidafu.swc.sample.parseSyncJsxSample
- * @throws [RuntimeException]
- * @param [code] source code
- * @param [options] parse option
- * @param [filename] source code filename
- * @return ast tree
+ * @throws RuntimeException if parsing fails
+ * @param code Source code to parse
+ * @param options Parser configuration
+ * @param filename Source code filename (can be null)
+ * @return Parsed AST tree
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * ParserConfig options = // ... create options
+ * Program ast = swc.parseSync("const x = 42;", options, null);
+ * ```
*/
@Throws(RuntimeException::class)
+ @JvmOverloads
fun parseSync(
code: String,
options: ParserConfig,
- filename: String?
+ filename: String? = null
): Program {
val optStr = configJson.encodeToString(options)
val output = parseSync(code, optStr, filename)
+ println("parseSync ==> $output")
return parseAstTree(output)
}
@@ -71,7 +174,7 @@ class SwcNative {
* @throws [RuntimeException]
* @sample [dev.yidafu.swc.sample.parseFileSyncBasicUsage]
* @param filepath filepath to source code
- * @param [options] options json string. see [dev.yidafu.swc.types.ParserConfig].
+ * @param [options] options json string. see [dev.yidafu.swc.generated.ParserConfig].
* @return ast tree json string
*/
@Throws(RuntimeException::class)
@@ -110,8 +213,14 @@ class SwcNative {
// }
/**
- * @throws [RuntimeException]
+ * External native method for synchronous code transformation.
+ * Prefer using the overloaded method with [Options] parameter.
*
+ * @param code Source code to transform
+ * @param isModule Whether the code should be treated as a module
+ * @param options Transform options as JSON string
+ * @return Transform output as JSON string
+ * @throws RuntimeException if transformation fails
*/
@Throws(RuntimeException::class)
external fun transformSync(
@@ -121,8 +230,14 @@ class SwcNative {
): String
/**
- * @throws [RuntimeException]
+ * External native method for synchronous file transformation.
+ * Prefer using the overloaded method with [Options] parameter.
*
+ * @param filepath Path to source file
+ * @param isModule Whether the file should be treated as a module
+ * @param options Transform options as JSON string
+ * @return Transform output as JSON string
+ * @throws RuntimeException if transformation fails
*/
@Throws(RuntimeException::class)
external fun transformFileSync(
@@ -132,8 +247,36 @@ class SwcNative {
): String
/**
- * @throws [RuntimeException]
+ * Transform JavaScript/TypeScript code synchronously.
+ *
+ * This method can transpile code (e.g., ES6+ to ES5), apply transformations,
+ * and perform other code modifications based on the provided options.
+ *
+ * @sample dev.yidafu.swc.sample.transformSyncSample
*
+ * @param code Source code to transform
+ * @param isModule Whether the code should be treated as a module (affects parsing)
+ * @param options Transform configuration (target, plugins, etc.)
+ * @return Transform output containing the transformed code
+ * @throws RuntimeException if transformation fails
+ *
+ * @example
+ * ```kotlin
+ * val swc = SwcNative()
+ * val output = swc.transformSync(
+ * code = "const arrow = () => 42;",
+ * isModule = false,
+ * options = options {
+ * jsc {
+ * target = JscTarget.ES5
+ * parser {
+ * syntax = Syntax.ECMASCRIPT
+ * }
+ * }
+ * }
+ * )
+ * println(output.code) // "function arrow() { return 42; }"
+ * ```
*/
@Throws(RuntimeException::class)
fun transformSync(
@@ -143,12 +286,34 @@ class SwcNative {
): TransformOutput {
val optionStr = configJson.encodeToString(options)
val res = transformSync(code, isModule, optionStr)
- return astJson.decodeFromString(res)
+ return outputJson.decodeFromString(res)
}
/**
- * @throws [RuntimeException]
+ * Transform a JavaScript/TypeScript file synchronously.
+ *
+ * @param filepath Path to source file
+ * @param isModule Whether the file should be treated as a module
+ * @param options Transform configuration
+ * @return Transform output containing the transformed code
+ * @throws RuntimeException if transformation fails
*
+ * @example
+ * ```kotlin
+ * val swc = SwcNative()
+ * val output = swc.transformFileSync(
+ * filepath = "src/index.ts",
+ * isModule = true,
+ * options = options {
+ * jsc {
+ * target = JscTarget.ES2020
+ * parser {
+ * syntax = Syntax.TYPESCRIPT
+ * }
+ * }
+ * }
+ * )
+ * ```
*/
@Throws(RuntimeException::class)
fun transformFileSync(
@@ -157,12 +322,17 @@ class SwcNative {
options: Options
): TransformOutput {
val res = transformFileSync(filepath, isModule, configJson.encodeToString(options))
- return astJson.decodeFromString(res)
+ return outputJson.decodeFromString(res)
}
/**
- * @throws [RuntimeException]
+ * External native method for synchronous AST printing.
+ * Prefer using the overloaded method with [Program] and [Options] parameters.
*
+ * @param program AST program as JSON string
+ * @param options Print options as JSON string
+ * @return Generated code as JSON string
+ * @throws RuntimeException if printing fails
*/
@Throws(RuntimeException::class)
external fun printSync(
@@ -171,23 +341,46 @@ class SwcNative {
): String
/**
- * @throws [RuntimeException]
+ * Convert AST program to JavaScript/TypeScript code synchronously.
+ *
+ * This method takes a parsed AST and generates the corresponding source code.
+ * Useful for code generation, AST manipulation, and round-trip transformations.
*
+ * @param program Parsed AST program
+ * @param options Print configuration (target, minify, source maps, etc.)
+ * @return Transform output containing the generated code
+ * @throws RuntimeException if printing fails
+ *
+ * @example
+ * ```kotlin
+ * val swc = SwcNative()
+ * // Parse code to AST
+ * val ast = swc.parseSync("const x = 42;", esParseOptions { }, "test.js")
+ * // Modify AST if needed...
+ * // Print AST back to code
+ * val output = swc.printSync(ast, options { })
+ * println(output.code) // "const x = 42;"
+ * ```
*/
@Throws(RuntimeException::class)
fun printSync(
program: Program,
options: Options
): TransformOutput {
- val pStr = astJson.encodeToString(program)
+ val pStr = astJson.encodeToString(program)
val oStr = configJson.encodeToString(options)
val res = printSync(pStr, oStr)
- return astJson.decodeFromString(res)
+ return outputJson.decodeFromString(res)
}
/**
- * @throws [RuntimeException]
+ * External native method for synchronous code minification.
+ * Prefer using the overloaded method with [Program] and [Options] parameters.
*
+ * @param program Code or program as JSON string
+ * @param options Minify options as JSON string
+ * @return Minified code as JSON string
+ * @throws RuntimeException if minification fails
*/
@Throws(RuntimeException::class)
external fun minifySync(
@@ -196,17 +389,596 @@ class SwcNative {
): String
/**
- * @throws [RuntimeException]
+ * Minify JavaScript/TypeScript code synchronously.
+ *
+ * This method takes source code as a string and minifies it.
+ * Minification reduces code size by removing whitespace, shortening variable names,
+ * and applying other optimizations.
+ *
+ * According to SWC documentation: https://swc.rs/docs/usage/core#minify
+ * The first parameter should be source code string, not AST.
+ *
+ * @param src Source code to minify
+ * @param options Optional minify configuration (compress, mangle, etc.)
+ * @return Transform output containing the minified code
+ * @throws RuntimeException if minification fails
*
+ * @example
+ * ```kotlin
+ * val swc = SwcNative()
+ * val output = swc.minifySync(
+ * src = "function hello() { console.log('Hello World'); }",
+ * options = JsMinifyOptions().apply {
+ * compress = Union.U2(b = true)
+ * mangle = Union.U2(b = true)
+ * }
+ * )
+ * println(output.code) // Minified code
+ * ```
*/
@Throws(RuntimeException::class)
fun minifySync(
- program: Program,
- options: Options
+ src: String,
+ options: JsMinifyOptions = JsMinifyOptions()
): TransformOutput {
- val pStr = astJson.encodeToString(program)
+ // Minify expects MinifyTarget::Single(String), so wrap in quotes
+ val codeStr = configJson.encodeToString(src)
+ // Serialize JsMinifyOptions to JSON
val oStr = configJson.encodeToString(options)
- val res = minifySync(pStr, oStr)
- return astJson.decodeFromString(res)
+ val res = minifySync(codeStr, oStr)
+ return outputJson.decodeFromString(res)
+ }
+
+ // ==================== Async Methods ====================
+
+ /**
+ * Native async parse method (callback-based)
+ * * This method returns immediately and executes parsing in a background thread.
+ * The callback will be invoked when parsing completes or fails.
+ * * @param code Source code to parse
+ * @param options Parser options JSON string
+ * @param filename Source file name
+ * @param callback Callback interface to receive results
+ */
+ external fun parseAsync(
+ code: String,
+ options: String,
+ filename: String?,
+ callback: SwcCallback
+ )
+
+ /**
+ * Native async parse file method (callback-based)
+ * * @param filepath Path to source file
+ * @param options Parser options JSON string
+ * @param callback Callback interface to receive results
+ */
+ external fun parseFileAsync(
+ filepath: String,
+ options: String,
+ callback: SwcCallback
+ )
+
+ /**
+ * Native async transform method (callback-based)
+ * * @param code Source code or AST JSON
+ * @param isModule Whether to treat as module
+ * @param options Transform options JSON string
+ * @param callback Callback interface to receive results
+ */
+ external fun transformAsync(
+ code: String,
+ isModule: Boolean,
+ options: String,
+ callback: SwcCallback
+ )
+
+ /**
+ * Native async transform file method (callback-based)
+ * * @param filepath Path to source file
+ * @param isModule Whether to treat as module
+ * @param options Transform options JSON string
+ * @param callback Callback interface to receive results
+ */
+ external fun transformFileAsync(
+ filepath: String,
+ isModule: Boolean,
+ options: String,
+ callback: SwcCallback
+ )
+
+ /**
+ * Native async print method (callback-based)
+ * * @param program AST program JSON string
+ * @param options Print options JSON string
+ * @param callback Callback interface to receive results
+ */
+ external fun printAsync(
+ program: String,
+ options: String,
+ callback: SwcCallback
+ )
+
+ /**
+ * Native async minify method (callback-based)
+ * * @param program Code or program JSON string
+ * @param options Minify options JSON string
+ * @param callback Callback interface to receive results
+ */
+ external fun minifyAsync(
+ program: String,
+ options: String,
+ callback: SwcCallback
+ )
+
+ // ==================== Kotlin-friendly Lambda Callbacks ====================
+
+ /**
+ * Kotlin-friendly async parse with lambda callbacks.
+ *
+ * This method is also Java-friendly. Java code can use anonymous inner classes
+ * or lambda expressions (Java 8+) for the callbacks.
+ *
+ * @param code Source code to parse
+ * @param options Parser configuration
+ * @param filename Source file name (can be null)
+ * @param onSuccess Called with parsed AST when successful
+ * @param onError Called with error message when failed
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * swc.parseAsync("const x = 42;", options, null,
+ * (Program ast) -> System.out.println("Success"),
+ * (String error) -> System.err.println("Error: " + error)
+ * );
+ * ```
+ */
+ @JvmOverloads
+ fun parseAsync(
+ code: String,
+ options: ParserConfig,
+ filename: String? = null,
+ onSuccess: (Program) -> Unit,
+ onError: (String) -> Unit
+ ) {
+ val optStr = configJson.encodeToString(options)
+
+ parseAsync(
+ code,
+ optStr,
+ filename,
+ object : SwcCallback {
+ override fun onSuccess(result: String) {
+ try {
+ val ast = parseAstTree(result)
+ onSuccess(ast)
+ } catch (e: Exception) {
+ onError("Failed to parse result: ${e.message}")
+ }
+ }
+
+ override fun onError(error: String) {
+ onError(error)
+ }
+ }
+ )
+ }
+
+ /**
+ * Kotlin-friendly async parse file with lambda callbacks.
+ *
+ * This method is also Java-friendly. Java code can use anonymous inner classes
+ * or lambda expressions (Java 8+) for the callbacks.
+ *
+ * @param filepath Path to source file
+ * @param options Parser configuration
+ * @param onSuccess Called with parsed AST when successful
+ * @param onError Called with error message when failed
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * swc.parseFileAsync("path/to/file.js", options,
+ * (Program ast) -> System.out.println("Success"),
+ * (String error) -> System.err.println("Error: " + error)
+ * );
+ * ```
+ */
+ fun parseFileAsync(
+ filepath: String,
+ options: ParserConfig,
+ onSuccess: (Program) -> Unit,
+ onError: (String) -> Unit
+ ) {
+ val optStr = configJson.encodeToString(options)
+
+ parseFileAsync(
+ filepath,
+ optStr,
+ object : SwcCallback {
+ override fun onSuccess(result: String) {
+ try {
+ val ast = parseAstTree(result)
+ onSuccess(ast)
+ } catch (e: Exception) {
+ onError("Failed to parse result: ${e.message}")
+ }
+ }
+
+ override fun onError(error: String) {
+ onError(error)
+ }
+ }
+ )
+ }
+
+ /**
+ * Kotlin-friendly async transform with lambda callbacks.
+ *
+ * This method is also Java-friendly. Java code can use anonymous inner classes
+ * or lambda expressions (Java 8+) for the callbacks.
+ *
+ * @param code Source code
+ * @param isModule Whether to treat as module
+ * @param options Transform configuration
+ * @param onSuccess Called with transform output when successful
+ * @param onError Called with error message when failed
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * swc.transformAsync("const x = 42;", false, options,
+ * (TransformOutput output) -> System.out.println(output.getCode()),
+ * (String error) -> System.err.println("Error: " + error)
+ * );
+ * ```
+ */
+ fun transformAsync(
+ code: String,
+ isModule: Boolean,
+ options: Options,
+ onSuccess: (TransformOutput) -> Unit,
+ onError: (String) -> Unit
+ ) {
+ val optionStr = configJson.encodeToString(options)
+
+ transformAsync(
+ code,
+ isModule,
+ optionStr,
+ object : SwcCallback {
+ override fun onSuccess(result: String) {
+ try {
+ val output = outputJson.decodeFromString(result)
+ onSuccess(output)
+ } catch (e: Exception) {
+ onError("Failed to parse result: ${e.message}")
+ }
+ }
+
+ override fun onError(error: String) {
+ onError(error)
+ }
+ }
+ )
+ }
+
+ /**
+ * Kotlin-friendly async transform file with lambda callbacks.
+ *
+ * This method is also Java-friendly. Java code can use anonymous inner classes
+ * or lambda expressions (Java 8+) for the callbacks.
+ *
+ * @param filepath Path to source file
+ * @param isModule Whether to treat as module
+ * @param options Transform configuration
+ * @param onSuccess Called with transform output when successful
+ * @param onError Called with error message when failed
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * swc.transformFileAsync("path/to/file.ts", true, options,
+ * (TransformOutput output) -> System.out.println(output.getCode()),
+ * (String error) -> System.err.println("Error: " + error)
+ * );
+ * ```
+ */
+ fun transformFileAsync(
+ filepath: String,
+ isModule: Boolean,
+ options: Options,
+ onSuccess: (TransformOutput) -> Unit,
+ onError: (String) -> Unit
+ ) {
+ val optStr = configJson.encodeToString(options)
+
+ transformFileAsync(
+ filepath,
+ isModule,
+ optStr,
+ object : SwcCallback {
+ override fun onSuccess(result: String) {
+ try {
+ val output = outputJson.decodeFromString(result)
+ onSuccess(output)
+ } catch (e: Exception) {
+ onError("Failed to parse result: ${e.message}")
+ }
+ }
+
+ override fun onError(error: String) {
+ onError(error)
+ }
+ }
+ )
+ }
+
+ /**
+ * Kotlin-friendly async print with lambda callbacks.
+ *
+ * This method is also Java-friendly. Java code can use anonymous inner classes
+ * or lambda expressions (Java 8+) for the callbacks.
+ *
+ * @param program AST program
+ * @param options Print options
+ * @param onSuccess Called with transform output when successful
+ * @param onError Called with error message when failed
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * swc.printAsync(program, options,
+ * (TransformOutput output) -> System.out.println(output.getCode()),
+ * (String error) -> System.err.println("Error: " + error)
+ * );
+ * ```
+ */
+ fun printAsync(
+ program: Program,
+ options: Options,
+ onSuccess: (TransformOutput) -> Unit,
+ onError: (String) -> Unit
+ ) {
+ try {
+ val pStr = astJson.encodeToString(program)
+ val oStr = configJson.encodeToString(options)
+
+ printAsync(
+ pStr,
+ oStr,
+ object : SwcCallback {
+ override fun onSuccess(result: String) {
+ try {
+ val output = outputJson.decodeFromString(result)
+ onSuccess(output)
+ } catch (e: Exception) {
+ onError("Failed to parse result: ${e.message}")
+ }
+ }
+
+ override fun onError(error: String) {
+ onError(error)
+ }
+ }
+ )
+ } catch (e: Exception) {
+ onError("Failed to serialize program: ${e.message}")
+ }
+ }
+
+ /**
+ * Kotlin-friendly async minify with lambda callbacks.
+ *
+ * This method is also Java-friendly. Java code can use anonymous inner classes
+ * or lambda expressions (Java 8+) for the callbacks.
+ *
+ * According to SWC documentation: https://swc.rs/docs/usage/core#minify
+ * The first parameter should be source code string, not AST.
+ *
+ * @param src Source code to minify
+ * @param options Minify options
+ * @param onSuccess Called with transform output when successful
+ * @param onError Called with error message when failed
+ *
+ * @example Java usage:
+ * ```java
+ * SwcNative swc = new SwcNative();
+ * swc.minifyAsync("function hello() { console.log('Hello'); }", options,
+ * (TransformOutput output) -> System.out.println(output.getCode()),
+ * (String error) -> System.err.println("Error: " + error)
+ * );
+ * ```
+ */
+ fun minifyAsync(
+ src: String,
+ options: JsMinifyOptions = JsMinifyOptions(),
+ onSuccess: (TransformOutput) -> Unit,
+ onError: (String) -> Unit
+ ) {
+ try {
+ // Minify expects MinifyTarget::Single(String), so wrap in quotes
+ val codeStr = configJson.encodeToString(src)
+ // Serialize JsMinifyOptions to JSON
+ val oStr = configJson.encodeToString(options)
+
+ minifyAsync(
+ codeStr,
+ oStr,
+ object : SwcCallback {
+ override fun onSuccess(result: String) {
+ try {
+ val output = outputJson.decodeFromString(result)
+ onSuccess(output)
+ } catch (e: Exception) {
+ onError("Failed to parse result: ${e.message}")
+ }
+ }
+
+ override fun onError(error: String) {
+ onError(error)
+ }
+ }
+ )
+ } catch (e: Exception) {
+ onError("Failed to serialize code: ${e.message}")
+ }
+ }
+
+ // ==================== Coroutine-based Suspend Functions ====================
+
+ /**
+ * Coroutine-based async parse (suspend function).
+ *
+ * This is the most Kotlin-idiomatic way to use async parsing.
+ * **Note**: This method cannot be called directly from Java.
+ * Java code should use the callback-based [parseAsync] method instead.
+ *
+ * @throws RuntimeException if parsing fails
+ * @param code Source code to parse
+ * @param options Parser configuration
+ * @param filename Source file name (can be null)
+ * @return Parsed AST
+ */
+ suspend fun parseAsync(
+ code: String,
+ options: ParserConfig,
+ filename: String? = null
+ ): Program = suspendCoroutine { continuation ->
+ parseAsync(
+ code = code,
+ options = options,
+ filename = filename,
+ onSuccess = { continuation.resume(it) },
+ onError = { continuation.resumeWithException(RuntimeException(it)) }
+ )
+ }
+
+ /**
+ * Coroutine-based async parse file (suspend function).
+ *
+ * **Note**: This method cannot be called directly from Java.
+ * Java code should use the callback-based [parseFileAsync] method instead.
+ *
+ * @throws RuntimeException if parsing fails
+ * @param filepath Path to source file
+ * @param options Parser configuration
+ * @return Parsed AST
+ */
+ suspend fun parseFileAsync(
+ filepath: String,
+ options: ParserConfig
+ ): Program = suspendCoroutine { continuation ->
+ parseFileAsync(
+ filepath = filepath,
+ options = options,
+ onSuccess = { continuation.resume(it) },
+ onError = { continuation.resumeWithException(RuntimeException(it)) }
+ )
+ }
+
+ /**
+ * Coroutine-based async transform (suspend function).
+ *
+ * **Note**: This method cannot be called directly from Java.
+ * Java code should use the callback-based [transformAsync] method instead.
+ *
+ * @throws RuntimeException if transform fails
+ * @param code Source code
+ * @param isModule Whether to treat as module
+ * @param options Transform options
+ * @return Transform output
+ */
+ suspend fun transformAsync(
+ code: String,
+ isModule: Boolean,
+ options: Options
+ ): TransformOutput = suspendCoroutine { continuation ->
+ transformAsync(
+ code = code,
+ isModule = isModule,
+ options = options,
+ onSuccess = { continuation.resume(it) },
+ onError = { continuation.resumeWithException(RuntimeException(it)) }
+ )
+ }
+
+ /**
+ * Coroutine-based async transform file (suspend function).
+ *
+ * **Note**: This method cannot be called directly from Java.
+ * Java code should use the callback-based [transformFileAsync] method instead.
+ *
+ * @throws RuntimeException if transform fails
+ * @param filepath Path to source file
+ * @param isModule Whether to treat as module
+ * @param options Transform options
+ * @return Transform output
+ */
+ suspend fun transformFileAsync(
+ filepath: String,
+ isModule: Boolean,
+ options: Options
+ ): TransformOutput = suspendCoroutine { continuation ->
+ transformFileAsync(
+ filepath = filepath,
+ isModule = isModule,
+ options = options,
+ onSuccess = { continuation.resume(it) },
+ onError = { continuation.resumeWithException(RuntimeException(it)) }
+ )
+ }
+
+ /**
+ * Coroutine-based async print (suspend function).
+ *
+ * **Note**: This method cannot be called directly from Java.
+ * Java code should use the callback-based [printAsync] method instead.
+ *
+ * @throws RuntimeException if print fails
+ * @param program AST program
+ * @param options Print options
+ * @return Transform output
+ */
+ suspend fun printAsync(
+ program: Program,
+ options: Options
+ ): TransformOutput = suspendCoroutine { continuation ->
+ printAsync(
+ program = program,
+ options = options,
+ onSuccess = { continuation.resume(it) },
+ onError = { continuation.resumeWithException(RuntimeException(it)) }
+ )
+ }
+
+ /**
+ * Coroutine-based async minify (suspend function).
+ *
+ * This is the most Kotlin-idiomatic way to use async minify.
+ * **Note**: This method cannot be called directly from Java.
+ * Java code should use the callback-based [minifyAsync] method instead.
+ *
+ * According to SWC documentation: https://swc.rs/docs/usage/core#minify
+ * The first parameter should be source code string, not AST.
+ *
+ * @throws RuntimeException if minify fails
+ * @param src Source code to minify
+ * @param options Minify options
+ * @return Transform output
+ */
+ suspend fun minifyAsync(
+ src: String,
+ options: JsMinifyOptions = JsMinifyOptions()
+ ): TransformOutput = suspendCoroutine { continuation ->
+ minifyAsync(
+ src = src,
+ options = options,
+ onSuccess = { continuation.resume(it) },
+ onError = { error ->
+ continuation.resumeWithException(RuntimeException(error))
+ }
+ )
}
}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/TransformOutput.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/TransformOutput.kt
index f8b18fd2..894f3c42 100644
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/TransformOutput.kt
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/TransformOutput.kt
@@ -2,5 +2,38 @@ package dev.yidafu.swc
import kotlinx.serialization.Serializable
+/**
+ * Output from SWC transform, print, or minify operations.
+ *
+ * This data class contains the result of code transformations:
+ * - The transformed/generated code
+ * - Optional message (e.g., source map or warnings)
+ *
+ * This class is fully Java-compatible. Java code can access properties using
+ * standard getter methods: `getCode()` and `getMsg()`.
+ *
+ * @param code The transformed or generated code
+ * @param msg Optional message, typically contains source map data or warnings
+ *
+ * @example Kotlin usage:
+ * ```kotlin
+ * val output = swc.transformSync(
+ * code = "const arrow = () => 42;",
+ * isModule = false,
+ * options = options { }
+ * )
+ * println(output.code) // Transformed code
+ * output.msg?.let { println("Message: $it") } // Optional message
+ * ```
+ *
+ * @example Java usage:
+ * ```java
+ * TransformOutput output = swc.transformSync("const arrow = () => 42;", false, options);
+ * System.out.println(output.getCode()); // Transformed code
+ * if (output.getMsg() != null) {
+ * System.out.println("Message: " + output.getMsg());
+ * }
+ * ```
+ */
@Serializable
data class TransformOutput(val code: String, val msg: String? = null)
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/TruePlusMinusSerializer.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/TruePlusMinusSerializer.kt
new file mode 100644
index 00000000..f420f0c2
--- /dev/null
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/TruePlusMinusSerializer.kt
@@ -0,0 +1,59 @@
+package dev.yidafu.swc
+
+import dev.yidafu.swc.generated.TruePlusMinus
+import kotlinx.serialization.KSerializer
+import kotlinx.serialization.descriptors.SerialDescriptor
+import kotlinx.serialization.descriptors.buildClassSerialDescriptor
+import kotlinx.serialization.encoding.Decoder
+import kotlinx.serialization.encoding.Encoder
+import kotlinx.serialization.json.JsonDecoder
+import kotlinx.serialization.json.JsonEncoder
+import kotlinx.serialization.json.JsonPrimitive
+import kotlinx.serialization.json.booleanOrNull
+import kotlinx.serialization.json.jsonPrimitive
+
+/**
+ * Custom serializer for TruePlusMinus enum that handles:
+ * - Boolean true -> TruePlusMinus.TRUE
+ * - String "true" -> TruePlusMinus.TRUE
+ * - String "+" -> TruePlusMinus.Addition
+ * - String "-" -> TruePlusMinus.Subtraction
+ */
+object TruePlusMinusSerializer : KSerializer {
+ override val descriptor: SerialDescriptor = buildClassSerialDescriptor("TruePlusMinus")
+
+ override fun serialize(encoder: Encoder, value: TruePlusMinus) {
+ val jsonEncoder = encoder as? JsonEncoder
+ ?: error("TruePlusMinusSerializer can only be used with JsonEncoder")
+
+ val stringValue = when (value) {
+ TruePlusMinus.TRUE -> "true"
+ TruePlusMinus.Addition -> "+"
+ TruePlusMinus.Subtraction -> "-"
+ }
+ jsonEncoder.encodeJsonElement(JsonPrimitive(stringValue))
+ }
+
+ override fun deserialize(decoder: Decoder): TruePlusMinus {
+ val jsonDecoder = decoder as? JsonDecoder
+ ?: error("TruePlusMinusSerializer can only be used with JsonDecoder")
+
+ val element = jsonDecoder.decodeJsonElement()
+ val primitive = element.jsonPrimitive
+
+ // Handle boolean true
+ val booleanValue = primitive.booleanOrNull
+ if (booleanValue == true) {
+ return TruePlusMinus.TRUE
+ }
+
+ // Handle string values
+ val stringValue = primitive.content
+ return when (stringValue) {
+ "true" -> TruePlusMinus.TRUE
+ "+" -> TruePlusMinus.Addition
+ "-" -> TruePlusMinus.Subtraction
+ else -> error("Invalid TruePlusMinus value: $stringValue")
+ }
+ }
+}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/Union.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/Union.kt
new file mode 100644
index 00000000..eb277cb5
--- /dev/null
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/Union.kt
@@ -0,0 +1,296 @@
+package dev.yidafu.swc
+
+import kotlinx.serialization.KSerializer
+import kotlinx.serialization.Serializable
+import kotlinx.serialization.SerializationException
+import kotlinx.serialization.descriptors.SerialDescriptor
+import kotlinx.serialization.descriptors.buildClassSerialDescriptor
+import kotlinx.serialization.encoding.Decoder
+import kotlinx.serialization.encoding.Encoder
+import kotlinx.serialization.json.JsonDecoder
+import kotlinx.serialization.json.decodeFromJsonElement
+import kotlin.jvm.JvmStatic
+
+/**
+ * Union types for representing TypeScript union types in Kotlin.
+ *
+ * TypeScript union types like `string | number | boolean` are represented
+ * using Union classes (U2, U3) in Kotlin.
+ *
+ * ## Usage Examples
+ *
+ * ### Binary Union (U2)
+ * ```kotlin
+ * // TypeScript: string | number
+ * val value: Union.U2 = Union.U2.ofA("hello")
+ * // or
+ * val value2: Union.U2 = Union.U2.ofB(42)
+ *
+ * // Check which type it is
+ * if (value.isA()) {
+ * println(value.valueOfA()) // "hello"
+ * }
+ * ```
+ *
+ * ### Ternary Union (U3)
+ * ```kotlin
+ * // TypeScript: string | number | boolean
+ * val value: Union.U3 = Union.U3.ofA("hello")
+ * // or
+ * val value2: Union.U3 = Union.U3.ofB(42)
+ * val value3: Union.U3 = Union.U3.ofC(true)
+ * ```
+ *
+ * ### Serialization
+ * Union types are automatically serialized/deserialized when used in AST nodes.
+ * The serializer will try each type in order until one succeeds.
+ *
+ * @see Union.U2 for binary unions
+ * @see Union.U3 for ternary unions
+ */
+@Serializable
+sealed class Union {
+
+ /**
+ * Binary union type: A | B
+ *
+ * Represents a TypeScript union type with two possible types.
+ * Only one of `a` or `b` should be non-null at a time.
+ *
+ * @param A First possible type
+ * @param B Second possible type
+ *
+ * @example
+ * ```kotlin
+ * // TypeScript: string | number
+ * val stringValue = Union.U2.ofA("hello")
+ * val numberValue = Union.U2.ofB(42)
+ *
+ * // Check and access value
+ * when {
+ * stringValue.isA() -> println(stringValue.valueOfA())
+ * stringValue.isB() -> println(stringValue.valueOfB())
+ * }
+ * ```
+ */
+ @Serializable(with = U2.U2Serializer::class)
+ data class U2(
+ val a: A? = null,
+ val b: B? = null
+ ) : Union() {
+ /**
+ * Check if this union contains type A
+ */
+ fun isA(): Boolean = a != null
+
+ /**
+ * Check if this union contains type B
+ */
+ fun isB(): Boolean = b != null
+
+ /**
+ * Get the value of type A, or null if this union contains type B
+ */
+ fun valueOfA(): A? = a
+
+ /**
+ * Get the value of type B, or null if this union contains type A
+ */
+ fun valueOfB(): B? = b
+
+ companion object {
+ /**
+ * Create a U2 union with type A value.
+ *
+ * This method is available as a static method in Java.
+ *
+ * @example Java usage:
+ * ```java
+ * Union.U2 value = Union.U2.ofA("hello");
+ * ```
+ */
+ @JvmStatic
+ fun ofA(value: A): U2 = U2(a = value)
+
+ /**
+ * Create a U2 union with type B value.
+ *
+ * This method is available as a static method in Java.
+ *
+ * @example Java usage:
+ * ```java
+ * Union.U2 value = Union.U2.ofB(42);
+ * ```
+ */
+ @JvmStatic
+ fun ofB(value: B): U2 = U2(b = value)
+
+ fun serializerFor(
+ aSerializer: KSerializer,
+ bSerializer: KSerializer
+ ): KSerializer> = U2Serializer(aSerializer, bSerializer)
+ }
+
+ class U2Serializer(
+ private val aSerializer: KSerializer,
+ private val bSerializer: KSerializer
+ ) : KSerializer> {
+ override val descriptor: SerialDescriptor =
+ buildClassSerialDescriptor("dev.yidafu.swc.Union.U2")
+
+ override fun serialize(encoder: Encoder, value: U2) {
+ value.a?.let {
+ encoder.encodeSerializableValue(aSerializer, it)
+ return
+ }
+ value.b?.let {
+ encoder.encodeSerializableValue(bSerializer, it)
+ return
+ }
+ throw SerializationException("Union.U2 requires either 'a' or 'b' to be non-null")
+ }
+
+ override fun deserialize(decoder: Decoder): U2 {
+ if (decoder !is JsonDecoder) {
+ throw SerializationException("Union.U2 serializer currently supports only Json format")
+ }
+ val element = decoder.decodeJsonElement()
+ val json = decoder.json
+
+ runCatching { json.decodeFromJsonElement(aSerializer, element) }
+ .onSuccess { return U2(a = it) }
+
+ runCatching { json.decodeFromJsonElement(bSerializer, element) }
+ .onSuccess { return U2(b = it) }
+
+ throw SerializationException("Unable to deserialize value as either type A or type B")
+ }
+ }
+ }
+
+ /**
+ * Ternary union type: A | B | C
+ *
+ * Represents a TypeScript union type with three possible types.
+ * Only one of `a`, `b`, or `c` should be non-null at a time.
+ *
+ * @param A First possible type
+ * @param B Second possible type
+ * @param C Third possible type
+ *
+ * @example
+ * ```kotlin
+ * // TypeScript: string | number | boolean
+ * val stringValue = Union.U3.ofA("hello")
+ * val numberValue = Union.U3.ofB(42)
+ * val boolValue = Union.U3.ofC(true)
+ * ```
+ */
+ @Serializable(with = U3.U3Serializer::class)
+ data class U3(
+ val a: A? = null,
+ val b: B? = null,
+ val c: C? = null
+ ) : Union() {
+ /**
+ * Check if this union contains type A
+ */
+ fun isA(): Boolean = a != null
+
+ /**
+ * Check if this union contains type B
+ */
+ fun isB(): Boolean = b != null
+
+ /**
+ * Check if this union contains type C
+ */
+ fun isC(): Boolean = c != null
+
+ /**
+ * Get the value of type A, or null if this union contains another type
+ */
+ fun valueOfA(): A? = a
+
+ /**
+ * Get the value of type B, or null if this union contains another type
+ */
+ fun valueOfB(): B? = b
+
+ /**
+ * Get the value of type C, or null if this union contains another type
+ */
+ fun valueOfC(): C? = c
+
+ companion object {
+ /**
+ * Create a U3 union with type A value.
+ * Available as a static method in Java.
+ */
+ @JvmStatic
+ fun ofA(value: A): U3 = U3(a = value)
+
+ /**
+ * Create a U3 union with type B value.
+ * Available as a static method in Java.
+ */
+ @JvmStatic
+ fun ofB(value: B): U3 = U3(b = value)
+
+ /**
+ * Create a U3 union with type C value.
+ * Available as a static method in Java.
+ */
+ @JvmStatic
+ fun ofC(value: C): U3 = U3(c = value)
+
+ fun serializerFor(
+ aSerializer: KSerializer,
+ bSerializer: KSerializer,
+ cSerializer: KSerializer
+ ): KSerializer> = U3Serializer(aSerializer, bSerializer, cSerializer)
+ }
+
+ class U3Serializer(
+ private val aSerializer: KSerializer,
+ private val bSerializer: KSerializer,
+ private val cSerializer: KSerializer
+ ) : KSerializer> {
+ override val descriptor: SerialDescriptor =
+ buildClassSerialDescriptor("dev.yidafu.swc.Union.U3")
+
+ override fun serialize(encoder: Encoder, value: U3) {
+ value.a?.let {
+ encoder.encodeSerializableValue(aSerializer, it)
+ return
+ }
+ value.b?.let {
+ encoder.encodeSerializableValue(bSerializer, it)
+ return
+ }
+ value.c?.let {
+ encoder.encodeSerializableValue(cSerializer, it)
+ return
+ }
+ throw SerializationException("Union.U3 requires one value to be non-null")
+ }
+
+ override fun deserialize(decoder: Decoder): U3 {
+ if (decoder !is JsonDecoder) {
+ throw SerializationException("Union.U3 serializer currently supports only Json format")
+ }
+ val element = decoder.decodeJsonElement()
+ val json = decoder.json
+
+ runCatching { json.decodeFromJsonElement(aSerializer, element) }
+ .onSuccess { return U3(a = it) }
+ runCatching { json.decodeFromJsonElement(bSerializer, element) }
+ .onSuccess { return U3(b = it) }
+ runCatching { json.decodeFromJsonElement(cSerializer, element) }
+ .onSuccess { return U3(c = it) }
+
+ throw SerializationException("Unable to deserialize value as type A, B, or C")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/booleanable/Booleanable.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/booleanable/Booleanable.kt
deleted file mode 100644
index 43c6635c..00000000
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/booleanable/Booleanable.kt
+++ /dev/null
@@ -1,194 +0,0 @@
-package dev.yidafu.swc.booleanable
-
-import dev.yidafu.swc.types.MatchPattern
-import dev.yidafu.swc.types.TerserCompressOptions
-import dev.yidafu.swc.types.TerserMangleOptions
-import kotlinx.serialization.*
-import kotlinx.serialization.builtins.ArraySerializer
-import kotlinx.serialization.builtins.serializer
-import kotlinx.serialization.descriptors.*
-import kotlinx.serialization.encoding.Decoder
-import kotlinx.serialization.encoding.Encoder
-import kotlinx.serialization.json.*
-
-/**
- * https://github.com/Kotlin/kotlinx.serialization/issues/1175
- */
-open class BooleanableSerializer(
- private val serializer: KSerializer,
- override val descriptor: SerialDescriptor = serializer.descriptor
-) : KSerializer> {
-
- override fun deserialize(decoder: Decoder): Booleanable {
- val input = decoder as JsonDecoder
- val tree: JsonElement = input.decodeJsonElement()
-
- return if (tree is JsonPrimitive) {
- if (tree is JsonNull) {
- Booleanable.ofBool(false) as Booleanable
- } else if (tree.content == "true" || tree.content == "false") {
- Booleanable.ofBool(tree.content == "true") as Booleanable
- } else {
- val value = input.json.decodeFromJsonElement(serializer, tree)
- Booleanable(value, null)
- }
- } else {
- val value = input.json.decodeFromJsonElement(serializer, tree)
- Booleanable(value, null)
- }
- }
-
- override fun serialize(
- encoder: Encoder,
- value: Booleanable
- ) {
- value.onValue {
- serializer.serialize(encoder, it)
- }.onBool {
- encoder.encodeBoolean(it)
- }
- }
-}
-
-/**
- * value may be boolean or [T]
- *
- * Example Usage:
- * ```
- * var value: Booleanable
- * value = Booleanable.ofFalse()
- * value = Booleanable.ofTrue()
- * value = Booleanable.ofValue("string")
- * ```
- * @property [value] actual value
- */
-@Serializable(BooleanableSerializer::class)
-data class Booleanable(
- val value: T?,
- private var bool: Boolean? = null
-) {
- /**
- * return true if value exist (not null)
- */
- fun hasValue(): Boolean {
- return value == null
- }
-
- /**
- * is true
- */
- fun isTrue(): Boolean {
- return bool == true
- }
-
- /**
- * is false
- */
- fun isFalse(): Boolean {
- return bool == false
- }
-
- /**
- * call when value is not null
- *
- * Usage:
- * ```
- * Booleanable.ofValue("str")
- * .onValue {
- * println(it)
- * }
- * .onBool {} // would not been called
- * ```
- * @param [block] callback
- * @return object self
- */
- fun onValue(block: (value: T) -> Unit): Booleanable {
- if (value != null) {
- block(value)
- }
- return this
- }
-
- /**
- * call when value is not null
- *
- * Usage:
- * ```
- * Booleanable.ofTrue()
- * .onBool {
- * println(it)
- * }
- * .onValue {} // would not been called
- * ```
- * @param [block] callback
- * @return object self
- */
- fun onBool(block: (value: Boolean) -> Unit): Booleanable {
- val b = this.bool
- if (b != null) {
- block(b)
- }
- return this
- }
- companion object {
- inline fun ofBool(bool: Boolean): Booleanable {
- return Booleanable(null, bool)
- }
-
- inline fun ofFalse(): Booleanable {
- return Booleanable(null, false)
- }
-
- inline fun ofTrue(): Booleanable {
- return Booleanable(null, true)
- }
-
- inline fun ofValue(value: T): Booleanable {
- return Booleanable(value, null)
- }
- }
-}
-
-@OptIn(InternalSerializationApi::class)
-object BooleanableStringSerializer : BooleanableSerializer(
- String::class.serializer()
-// String::class.serializer().descriptor
-)
-
-@OptIn(InternalSerializationApi::class)
-object BooleanableFloatSerializer : BooleanableSerializer(
- Float::class.serializer()
-)
-
-@OptIn(InternalSerializationApi::class)
-object BooleanableIntSerializer : BooleanableSerializer(
- Int::class.serializer()
-)
-
-@OptIn(ExperimentalSerializationApi::class)
-object BooleanableArrayStringSerializer : BooleanableSerializer>(
- ArraySerializer(String::class, String.serializer())
-)
-
-@OptIn(InternalSerializationApi::class)
-object BooleanableTerserCompressOptionsSerializer : BooleanableSerializer(
- TerserCompressOptions::class.serializer()
-)
-
-@OptIn(InternalSerializationApi::class)
-object BooleanableTerserMangleOptionsSerializer : BooleanableSerializer(
- TerserMangleOptions::class.serializer()
-)
-
-@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
-object BooleanableArrayMatchPatternSerializer : BooleanableSerializer>(
- ArraySerializer(MatchPattern::class, MatchPattern::class.serializer())
-)
-
-typealias BooleanableString = Booleanable
-typealias BooleanableFloat = Booleanable
-typealias BooleanableInt = Booleanable
-typealias BooleanableArrayString = Booleanable>
-typealias BooleanableTerserCompressOptions = Booleanable
-typealias BooleanableTerserMangleOptions = Booleanable
-typealias BooleanableArrayMatchPattern = Booleanable>
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/customType.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/customType.kt
new file mode 100644
index 00000000..fa1a9358
--- /dev/null
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/customType.kt
@@ -0,0 +1,104 @@
+// Custom types that are manually defined to avoid serialization conflicts
+// These types are skipped by the code generator
+
+package dev.yidafu.swc.generated
+
+import dev.yidafu.swc.emptySpan
+import kotlinx.serialization.EncodeDefault
+import kotlinx.serialization.ExperimentalSerializationApi
+import kotlinx.serialization.SerialName
+import kotlinx.serialization.Serializable
+import kotlinx.serialization.json.JsonClassDiscriminator
+
+@SwcDslMarker
+interface Identifier :
+ ExpressionBase,
+ Expression,
+ JSXObject,
+ JSXElementName,
+ JSXAttributeName,
+ ModuleExportName,
+ Property,
+ PropertyName,
+ TsEntityName,
+ TsThisTypeOrIdent,
+ TsEnumMemberId,
+ TsModuleName {
+ // conflict with @SerialName
+ // var type: String?
+ var `value`: String?
+ var optional: Boolean?
+ override var span: Span
+ var ctxt: Int
+}
+
+@SwcDslMarker
+interface BindingIdentifier : PatternBase, Pattern, TsParameterPropertyParameter, TsFnParameter {
+ // conflict with @SerialName
+ // var type: String?
+ var `value`: String?
+ var optional: Boolean?
+ override var typeAnnotation: TsTypeAnnotation?
+ override var span: Span
+}
+
+@OptIn(ExperimentalSerializationApi::class)
+@SwcDslMarker
+@Serializable
+@JsonClassDiscriminator("type")
+@SerialName("Identifier")
+class IdentifierImpl() : Identifier, BindingIdentifier {
+ // conflict with @SerialName
+ // override var type : String? = "Identifier"
+ @EncodeDefault
+ override var `value`: String? = null
+
+ @EncodeDefault
+ override var optional: Boolean? = null
+ override var span: Span = emptySpan()
+
+ @EncodeDefault
+ override var ctxt: Int = 0
+ override var typeAnnotation: TsTypeAnnotation? = null
+}
+
+typealias BindingIdentifierImpl = IdentifierImpl
+
+@SwcDslMarker
+interface TemplateLiteral : ExpressionBase, Expression {
+ // conflict with @SerialName
+ // var type: String?
+ var expressions: Array?
+ var quasis: Array?
+ override var span: Span
+}
+
+@SwcDslMarker
+interface TsTemplateLiteralType : Node, HasSpan, TsLiteral {
+ // conflict with @SerialName
+ // var type: String?
+ var types: Array?
+ var quasis: Array?
+ override var span: Span
+}
+
+@OptIn(ExperimentalSerializationApi::class)
+@SwcDslMarker
+@Serializable
+@JsonClassDiscriminator("type")
+@SerialName("TemplateLiteral")
+class TemplateLiteralImpl : TemplateLiteral, TsTemplateLiteralType {
+ // conflict with @SerialName
+ // override var type : String? = "TemplateLiteral"
+ @EncodeDefault
+ override var types: Array? = null
+
+ @EncodeDefault
+ override var expressions: Array? = null
+
+ @EncodeDefault
+ override var quasis: Array? = null
+ override var span: Span = emptySpan()
+}
+
+typealias TsTemplateLiteralTypeImpl = TemplateLiteralImpl
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl.kt
index 7b76bffe..a0266cb3 100644
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl.kt
+++ b/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl.kt
@@ -1,34 +1,160 @@
-package dev.yidafu.swc
+package dev.yidafu.swc.generated.dsl
-import dev.yidafu.swc.types.*
+import dev.yidafu.swc.generated.*
/**
+ * DSL (Domain-Specific Language) functions for building AST nodes and configuration objects.
+ *
+ * These functions provide a type-safe, builder-pattern API for creating SWC AST nodes
+ * and configuration objects in a more idiomatic Kotlin way.
+ *
* @sample dev.yidafu.swc.sample.createExampleDsl
+ *
+ * ## Usage Examples
+ *
+ * ### Creating a Module
+ * ```kotlin
+ * val module = module {
+ * body = arrayOf(
+ * importDeclaration {
+ * specifiers = arrayOf(importDefaultSpecifier {
+ * local = identifier {
+ * value = "React"
+ * span = emptySpan()
+ * }
+ * })
+ * source = stringLiteral {
+ * value = "react"
+ * raw = "\"react\""
+ * span = emptySpan()
+ * }
+ * span = emptySpan()
+ * }
+ * )
+ * }
+ * ```
+ *
+ * ### Creating Parser Options
+ * ```kotlin
+ * val tsOptions = tsParseOptions {
+ * tsx = true
+ * decorators = true
+ * }
+ *
+ * val esOptions = esParseOptions {
+ * jsx = true
+ * allowReturnOutsideFunction = true
+ * }
+ * ```
+ *
+ * ### Creating Transform Options
+ * ```kotlin
+ * val transformOptions = options {
+ * jsc {
+ * target = JscTarget.ES2020
+ * parser {
+ * syntax = Syntax.TYPESCRIPT
+ * tsx = true
+ * }
+ * }
+ * module {
+ * type = ModuleConfigType.ES6
+ * }
+ * }
+ * ```
*/
-fun module(block: Module.() -> Unit): Module {
- return ModuleImpl().apply(block)
-}
-
-fun options(block: Options.() -> Unit): Options {
- return Options().apply(block)
-}
-
-fun tsParseOptions(block: TsParserConfig.() -> Unit): TsParserConfig {
- return TsParserConfig().apply(block)
-}
-
-fun esParseOptions(block: EsParserConfig.() -> Unit): EsParserConfig {
- return EsParserConfig().apply(block)
-}
-
-fun span(): Span {
- return Span()
-}
-
-fun emptySpan(): Span {
- return Span().apply {
- start = 0
- end = 0
- ctxt = 0
- }
-}
\ No newline at end of file
+
+/**
+ * Create a Module AST node using DSL builder pattern.
+ *
+ * @param block Lambda to configure the module
+ * @return Configured Module node
+ *
+ * @example
+ * ```kotlin
+ * val module = module {
+ * body = arrayOf(
+ * variableDeclaration {
+ * kind = VariableDeclarationKind.CONST
+ * declarations = arrayOf(variableDeclarator {
+ * id = identifier { value = "x"; span = emptySpan() }
+ * init = numericLiteral { value = 42.0; span = emptySpan() }
+ * span = emptySpan()
+ * })
+ * span = emptySpan()
+ * }
+ * )
+ * }
+ * ```
+ */
+fun module(block: Module.() -> Unit): Module = createModule(block)
+
+/**
+ * Create transform Options using DSL builder pattern.
+ *
+ * @param block Lambda to configure the options
+ * @return Configured Options object
+ *
+ * @example
+ * ```kotlin
+ * val opts = options {
+ * jsc {
+ * target = JscTarget.ES5
+ * parser {
+ * syntax = Syntax.ECMASCRIPT
+ * }
+ * }
+ * }
+ * ```
+ */
+fun options(block: Options.() -> Unit): Options = Options().apply(block)
+
+/**
+ * Create TypeScript parser configuration using DSL builder pattern.
+ *
+ * @param block Lambda to configure the parser
+ * @return Configured TsParserConfig
+ */
+fun tsParserConfig(block: TsParserConfig.() -> Unit): TsParserConfig = createTsParserConfig(block)
+
+/**
+ * Create ECMAScript parser configuration using DSL builder pattern.
+ *
+ * @param block Lambda to configure the parser
+ * @return Configured EsParserConfig
+ */
+fun esParserConfig(block: EsParserConfig.() -> Unit): EsParserConfig = createEsParserConfig(block)
+
+/**
+ * Create TypeScript parse options using DSL builder pattern.
+ * This is a convenience function that wraps tsParserConfig.
+ *
+ * @param block Lambda to configure the parse options
+ * @return Configured TsParserConfig
+ *
+ * @example
+ * ```kotlin
+ * val options = tsParseOptions {
+ * tsx = true
+ * decorators = true
+ * }
+ * ```
+ */
+fun tsParseOptions(block: TsParserConfig.() -> Unit = {}): TsParserConfig = tsParserConfig(block)
+
+/**
+ * Create ECMAScript parse options using DSL builder pattern.
+ * This is a convenience function that wraps esParserConfig.
+ *
+ * @param block Lambda to configure the parse options
+ * @return Configured EsParserConfig
+ *
+ * @example
+ * ```kotlin
+ * val options = esParseOptions {
+ * jsx = true
+ * allowReturnOutsideFunction = true
+ * }
+ * ```
+ */
+fun esParseOptions(block: EsParserConfig.() -> Unit = {}): EsParserConfig = esParserConfig(block)
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/Argument.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/Argument.kt
deleted file mode 100644
index 7f7e9bc2..00000000
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/Argument.kt
+++ /dev/null
@@ -1,359 +0,0 @@
-package dev.yidafu.swc.dsl
-
-import dev.yidafu.swc.types.*
-
-fun Argument.span(block: Span.() -> Unit): Span {
- return Span().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ThisExpressionImpl
- */
-fun Argument.thisExpression(block: ThisExpression.() -> Unit): ThisExpression {
- return ThisExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ArrayExpressionImpl
- */
-fun Argument.arrayExpression(block: ArrayExpression.() -> Unit): ArrayExpression {
- return ArrayExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ObjectExpressionImpl
- */
-fun Argument.objectExpression(block: ObjectExpression.() -> Unit): ObjectExpression {
- return ObjectExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> FunctionExpressionImpl
- */
-fun Argument.functionExpression(block: FunctionExpression.() -> Unit): FunctionExpression {
- return FunctionExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> UnaryExpressionImpl
- */
-fun Argument.unaryExpression(block: UnaryExpression.() -> Unit): UnaryExpression {
- return UnaryExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> UpdateExpressionImpl
- */
-fun Argument.updateExpression(block: UpdateExpression.() -> Unit): UpdateExpression {
- return UpdateExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> BinaryExpressionImpl
- */
-fun Argument.binaryExpression(block: BinaryExpression.() -> Unit): BinaryExpression {
- return BinaryExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> AssignmentExpressionImpl
- */
-fun Argument.assignmentExpression(block: AssignmentExpression.() -> Unit): AssignmentExpression {
- return AssignmentExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> MemberExpressionImpl
- */
-fun Argument.memberExpression(block: MemberExpression.() -> Unit): MemberExpression {
- return MemberExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> SuperPropExpressionImpl
- */
-fun Argument.superPropExpression(block: SuperPropExpression.() -> Unit): SuperPropExpression {
- return SuperPropExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ConditionalExpressionImpl
- */
-fun Argument.conditionalExpression(block: ConditionalExpression.() -> Unit): ConditionalExpression {
- return ConditionalExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> CallExpressionImpl
- */
-fun Argument.callExpression(block: CallExpression.() -> Unit): CallExpression {
- return CallExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> NewExpressionImpl
- */
-fun Argument.newExpression(block: NewExpression.() -> Unit): NewExpression {
- return NewExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> SequenceExpressionImpl
- */
-fun Argument.sequenceExpression(block: SequenceExpression.() -> Unit): SequenceExpression {
- return SequenceExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> IdentifierImpl
- */
-fun Argument.identifier(block: Identifier.() -> Unit): Identifier {
- return IdentifierImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> StringLiteralImpl
- */
-fun Argument.stringLiteral(block: StringLiteral.() -> Unit): StringLiteral {
- return StringLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> BooleanLiteralImpl
- */
-fun Argument.booleanLiteral(block: BooleanLiteral.() -> Unit): BooleanLiteral {
- return BooleanLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> NullLiteralImpl
- */
-fun Argument.nullLiteral(block: NullLiteral.() -> Unit): NullLiteral {
- return NullLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> NumericLiteralImpl
- */
-fun Argument.numericLiteral(block: NumericLiteral.() -> Unit): NumericLiteral {
- return NumericLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> BigIntLiteralImpl
- */
-fun Argument.bigIntLiteral(block: BigIntLiteral.() -> Unit): BigIntLiteral {
- return BigIntLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> RegExpLiteralImpl
- */
-fun Argument.regExpLiteral(block: RegExpLiteral.() -> Unit): RegExpLiteral {
- return RegExpLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> JSXTextImpl
- */
-fun Argument.jSXText(block: JSXText.() -> Unit): JSXText {
- return JSXTextImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TemplateLiteralImpl
- */
-fun Argument.templateLiteral(block: TemplateLiteral.() -> Unit): TemplateLiteral {
- return TemplateLiteralImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TaggedTemplateExpressionImpl
- */
-fun Argument.taggedTemplateExpression(block: TaggedTemplateExpression.() -> Unit): TaggedTemplateExpression {
- return TaggedTemplateExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ArrowFunctionExpressionImpl
- */
-fun Argument.arrowFunctionExpression(block: ArrowFunctionExpression.() -> Unit): ArrowFunctionExpression {
- return ArrowFunctionExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ClassExpressionImpl
- */
-fun Argument.classExpression(block: ClassExpression.() -> Unit): ClassExpression {
- return ClassExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> YieldExpressionImpl
- */
-fun Argument.yieldExpression(block: YieldExpression.() -> Unit): YieldExpression {
- return YieldExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> MetaPropertyImpl
- */
-fun Argument.metaProperty(block: MetaProperty.() -> Unit): MetaProperty {
- return MetaPropertyImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> AwaitExpressionImpl
- */
-fun Argument.awaitExpression(block: AwaitExpression.() -> Unit): AwaitExpression {
- return AwaitExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> ParenthesisExpressionImpl
- */
-fun Argument.parenthesisExpression(block: ParenthesisExpression.() -> Unit): ParenthesisExpression {
- return ParenthesisExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> JSXMemberExpressionImpl
- */
-fun Argument.jSXMemberExpression(block: JSXMemberExpression.() -> Unit): JSXMemberExpression {
- return JSXMemberExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> JSXNamespacedNameImpl
- */
-fun Argument.jSXNamespacedName(block: JSXNamespacedName.() -> Unit): JSXNamespacedName {
- return JSXNamespacedNameImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> JSXEmptyExpressionImpl
- */
-fun Argument.jSXEmptyExpression(block: JSXEmptyExpression.() -> Unit): JSXEmptyExpression {
- return JSXEmptyExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> JSXElementImpl
- */
-fun Argument.jSXElement(block: JSXElement.() -> Unit): JSXElement {
- return JSXElementImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> JSXFragmentImpl
- */
-fun Argument.jSXFragment(block: JSXFragment.() -> Unit): JSXFragment {
- return JSXFragmentImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TsTypeAssertionImpl
- */
-fun Argument.tsTypeAssertion(block: TsTypeAssertion.() -> Unit): TsTypeAssertion {
- return TsTypeAssertionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TsConstAssertionImpl
- */
-fun Argument.tsConstAssertion(block: TsConstAssertion.() -> Unit): TsConstAssertion {
- return TsConstAssertionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TsNonNullExpressionImpl
- */
-fun Argument.tsNonNullExpression(block: TsNonNullExpression.() -> Unit): TsNonNullExpression {
- return TsNonNullExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TsAsExpressionImpl
- */
-fun Argument.tsAsExpression(block: TsAsExpression.() -> Unit): TsAsExpression {
- return TsAsExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TsSatisfiesExpressionImpl
- */
-fun Argument.tsSatisfiesExpression(block: TsSatisfiesExpression.() -> Unit): TsSatisfiesExpression {
- return TsSatisfiesExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> TsInstantiationImpl
- */
-fun Argument.tsInstantiation(block: TsInstantiation.() -> Unit): TsInstantiation {
- return TsInstantiationImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> PrivateNameImpl
- */
-fun Argument.privateName(block: PrivateName.() -> Unit): PrivateName {
- return PrivateNameImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> OptionalChainingExpressionImpl
- */
-fun Argument.optionalChainingExpression(block: OptionalChainingExpression.() -> Unit): OptionalChainingExpression {
- return OptionalChainingExpressionImpl().apply(block)
-}
-
-/**
- * Argument#expression: Expression
- * extension function for create Expression -> InvalidImpl
- */
-fun Argument.invalid(block: Invalid.() -> Unit): Invalid {
- return InvalidImpl().apply(block)
-}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrayExpression.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrayExpression.kt
deleted file mode 100644
index d11832f9..00000000
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrayExpression.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package dev.yidafu.swc.dsl
-
-import dev.yidafu.swc.types.*
-
-fun ArrayExpression.exprOrSpread(block: ExprOrSpread.() -> Unit): ExprOrSpread {
- return ExprOrSpread().apply(block)
-}
-
-fun ArrayExpression.span(block: Span.() -> Unit): Span {
- return Span().apply(block)
-}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrayPattern.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrayPattern.kt
deleted file mode 100644
index a75278df..00000000
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrayPattern.kt
+++ /dev/null
@@ -1,399 +0,0 @@
-package dev.yidafu.swc.dsl
-
-import dev.yidafu.swc.types.*
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> BindingIdentifierImpl
- */
-fun ArrayPattern.bindingIdentifier(block: BindingIdentifier.() -> Unit): BindingIdentifier {
- return BindingIdentifierImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> RestElementImpl
- */
-fun ArrayPattern.restElement(block: RestElement.() -> Unit): RestElement {
- return RestElementImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ObjectPatternImpl
- */
-fun ArrayPattern.objectPattern(block: ObjectPattern.() -> Unit): ObjectPattern {
- return ObjectPatternImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> AssignmentPatternImpl
- */
-fun ArrayPattern.assignmentPattern(block: AssignmentPattern.() -> Unit): AssignmentPattern {
- return AssignmentPatternImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> InvalidImpl
- */
-fun ArrayPattern.invalid(block: Invalid.() -> Unit): Invalid {
- return InvalidImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ThisExpressionImpl
- */
-fun ArrayPattern.thisExpression(block: ThisExpression.() -> Unit): ThisExpression {
- return ThisExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ArrayExpressionImpl
- */
-fun ArrayPattern.arrayExpression(block: ArrayExpression.() -> Unit): ArrayExpression {
- return ArrayExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ObjectExpressionImpl
- */
-fun ArrayPattern.objectExpression(block: ObjectExpression.() -> Unit): ObjectExpression {
- return ObjectExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> FunctionExpressionImpl
- */
-fun ArrayPattern.functionExpression(block: FunctionExpression.() -> Unit): FunctionExpression {
- return FunctionExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> UnaryExpressionImpl
- */
-fun ArrayPattern.unaryExpression(block: UnaryExpression.() -> Unit): UnaryExpression {
- return UnaryExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> UpdateExpressionImpl
- */
-fun ArrayPattern.updateExpression(block: UpdateExpression.() -> Unit): UpdateExpression {
- return UpdateExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> BinaryExpressionImpl
- */
-fun ArrayPattern.binaryExpression(block: BinaryExpression.() -> Unit): BinaryExpression {
- return BinaryExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> AssignmentExpressionImpl
- */
-fun ArrayPattern.assignmentExpression(block: AssignmentExpression.() -> Unit): AssignmentExpression {
- return AssignmentExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> MemberExpressionImpl
- */
-fun ArrayPattern.memberExpression(block: MemberExpression.() -> Unit): MemberExpression {
- return MemberExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> SuperPropExpressionImpl
- */
-fun ArrayPattern.superPropExpression(block: SuperPropExpression.() -> Unit): SuperPropExpression {
- return SuperPropExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ConditionalExpressionImpl
- */
-fun ArrayPattern.conditionalExpression(block: ConditionalExpression.() -> Unit): ConditionalExpression {
- return ConditionalExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> CallExpressionImpl
- */
-fun ArrayPattern.callExpression(block: CallExpression.() -> Unit): CallExpression {
- return CallExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> NewExpressionImpl
- */
-fun ArrayPattern.newExpression(block: NewExpression.() -> Unit): NewExpression {
- return NewExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> SequenceExpressionImpl
- */
-fun ArrayPattern.sequenceExpression(block: SequenceExpression.() -> Unit): SequenceExpression {
- return SequenceExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> IdentifierImpl
- */
-fun ArrayPattern.identifier(block: Identifier.() -> Unit): Identifier {
- return IdentifierImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> StringLiteralImpl
- */
-fun ArrayPattern.stringLiteral(block: StringLiteral.() -> Unit): StringLiteral {
- return StringLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> BooleanLiteralImpl
- */
-fun ArrayPattern.booleanLiteral(block: BooleanLiteral.() -> Unit): BooleanLiteral {
- return BooleanLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> NullLiteralImpl
- */
-fun ArrayPattern.nullLiteral(block: NullLiteral.() -> Unit): NullLiteral {
- return NullLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> NumericLiteralImpl
- */
-fun ArrayPattern.numericLiteral(block: NumericLiteral.() -> Unit): NumericLiteral {
- return NumericLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> BigIntLiteralImpl
- */
-fun ArrayPattern.bigIntLiteral(block: BigIntLiteral.() -> Unit): BigIntLiteral {
- return BigIntLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> RegExpLiteralImpl
- */
-fun ArrayPattern.regExpLiteral(block: RegExpLiteral.() -> Unit): RegExpLiteral {
- return RegExpLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> JSXTextImpl
- */
-fun ArrayPattern.jSXText(block: JSXText.() -> Unit): JSXText {
- return JSXTextImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TemplateLiteralImpl
- */
-fun ArrayPattern.templateLiteral(block: TemplateLiteral.() -> Unit): TemplateLiteral {
- return TemplateLiteralImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TaggedTemplateExpressionImpl
- */
-fun ArrayPattern.taggedTemplateExpression(block: TaggedTemplateExpression.() -> Unit): TaggedTemplateExpression {
- return TaggedTemplateExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ArrowFunctionExpressionImpl
- */
-fun ArrayPattern.arrowFunctionExpression(block: ArrowFunctionExpression.() -> Unit): ArrowFunctionExpression {
- return ArrowFunctionExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ClassExpressionImpl
- */
-fun ArrayPattern.classExpression(block: ClassExpression.() -> Unit): ClassExpression {
- return ClassExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> YieldExpressionImpl
- */
-fun ArrayPattern.yieldExpression(block: YieldExpression.() -> Unit): YieldExpression {
- return YieldExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> MetaPropertyImpl
- */
-fun ArrayPattern.metaProperty(block: MetaProperty.() -> Unit): MetaProperty {
- return MetaPropertyImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> AwaitExpressionImpl
- */
-fun ArrayPattern.awaitExpression(block: AwaitExpression.() -> Unit): AwaitExpression {
- return AwaitExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> ParenthesisExpressionImpl
- */
-fun ArrayPattern.parenthesisExpression(block: ParenthesisExpression.() -> Unit): ParenthesisExpression {
- return ParenthesisExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> JSXMemberExpressionImpl
- */
-fun ArrayPattern.jSXMemberExpression(block: JSXMemberExpression.() -> Unit): JSXMemberExpression {
- return JSXMemberExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> JSXNamespacedNameImpl
- */
-fun ArrayPattern.jSXNamespacedName(block: JSXNamespacedName.() -> Unit): JSXNamespacedName {
- return JSXNamespacedNameImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> JSXEmptyExpressionImpl
- */
-fun ArrayPattern.jSXEmptyExpression(block: JSXEmptyExpression.() -> Unit): JSXEmptyExpression {
- return JSXEmptyExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> JSXElementImpl
- */
-fun ArrayPattern.jSXElement(block: JSXElement.() -> Unit): JSXElement {
- return JSXElementImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> JSXFragmentImpl
- */
-fun ArrayPattern.jSXFragment(block: JSXFragment.() -> Unit): JSXFragment {
- return JSXFragmentImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TsTypeAssertionImpl
- */
-fun ArrayPattern.tsTypeAssertion(block: TsTypeAssertion.() -> Unit): TsTypeAssertion {
- return TsTypeAssertionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TsConstAssertionImpl
- */
-fun ArrayPattern.tsConstAssertion(block: TsConstAssertion.() -> Unit): TsConstAssertion {
- return TsConstAssertionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TsNonNullExpressionImpl
- */
-fun ArrayPattern.tsNonNullExpression(block: TsNonNullExpression.() -> Unit): TsNonNullExpression {
- return TsNonNullExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TsAsExpressionImpl
- */
-fun ArrayPattern.tsAsExpression(block: TsAsExpression.() -> Unit): TsAsExpression {
- return TsAsExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TsSatisfiesExpressionImpl
- */
-fun ArrayPattern.tsSatisfiesExpression(block: TsSatisfiesExpression.() -> Unit): TsSatisfiesExpression {
- return TsSatisfiesExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> TsInstantiationImpl
- */
-fun ArrayPattern.tsInstantiation(block: TsInstantiation.() -> Unit): TsInstantiation {
- return TsInstantiationImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> PrivateNameImpl
- */
-fun ArrayPattern.privateName(block: PrivateName.() -> Unit): PrivateName {
- return PrivateNameImpl().apply(block)
-}
-
-/**
- * ArrayPattern#elements: Array
- * extension function for create Array -> OptionalChainingExpressionImpl
- */
-fun ArrayPattern.optionalChainingExpression(block: OptionalChainingExpression.() -> Unit): OptionalChainingExpression {
- return OptionalChainingExpressionImpl().apply(block)
-}
-
-/**
- * ArrayPattern#typeAnnotation: TsTypeAnnotation
- * extension function for create TsTypeAnnotation -> TsTypeAnnotationImpl
- */
-fun ArrayPattern.tsTypeAnnotation(block: TsTypeAnnotation.() -> Unit): TsTypeAnnotation {
- return TsTypeAnnotationImpl().apply(block)
-}
-
-fun ArrayPattern.span(block: Span.() -> Unit): Span {
- return Span().apply(block)
-}
\ No newline at end of file
diff --git a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrowFunctionExpression.kt b/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrowFunctionExpression.kt
deleted file mode 100644
index 062af366..00000000
--- a/swc-binding/src/main/kotlin/dev/yidafu/swc/dsl/ArrowFunctionExpression.kt
+++ /dev/null
@@ -1,415 +0,0 @@
-package dev.yidafu.swc.dsl
-
-import dev.yidafu.swc.types.*
-
-/**
- * ArrowFunctionExpression#params: Array
- * extension function for create Array -> BindingIdentifierImpl
- */
-fun ArrowFunctionExpression.bindingIdentifier(block: BindingIdentifier.() -> Unit): BindingIdentifier {
- return BindingIdentifierImpl().apply(block)
-}
-
-/**
- * ArrowFunctionExpression#params: Array
- * extension function for create Array -> ArrayPatternImpl
- */
-fun ArrowFunctionExpression.arrayPattern(block: ArrayPattern.() -> Unit): ArrayPattern {
- return ArrayPatternImpl().apply(block)
-}
-
-/**
- * ArrowFunctionExpression#params: Array