@rsbuild/core 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/toml-loader/index.d.ts +1 -0
- package/compiled/toml-loader/index.js +1 -0
- package/compiled/toml-loader/license +22 -0
- package/compiled/toml-loader/package.json +1 -0
- package/dist/cli/commands.d.ts +1 -1
- package/dist/cli/commands.js +5 -5
- package/dist/cli/prepare.js +1 -1
- package/dist/plugins/bundleAnalyzer.js +11 -1
- package/dist/plugins/toml.js +2 -2
- package/dist/provider/core/createContext.js +1 -1
- package/dist/provider/plugins/css.js +1 -1
- package/dist/rspack/HtmlAppIconPlugin.js +1 -1
- package/dist/rspack/InlineChunkHtmlPlugin.js +1 -1
- package/dist/rspack/RemoveCssSourcemapPlugin.js +1 -2
- package/dist/server/devServer.js +1 -1
- package/dist/server/helper.d.ts +1 -0
- package/dist/server/middlewares.d.ts +1 -1
- package/dist/server/middlewares.js +9 -1
- package/dist/server/prodServer.js +1 -1
- package/package.json +2 -2
- package/compiled/commander/index.js +0 -1
- package/compiled/commander/license +0 -22
- package/compiled/commander/package.json +0 -1
- package/compiled/commander/typings/index.d.ts +0 -889
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={229:(e,r,i)=>{var s=i(518);e.exports=function(e){this.cacheable&&this.cacheable();var r=s.parse(e);this.value=[r];return"module.exports = "+JSON.stringify(r,undefined,"\t")}},518:(e,r,i)=>{var s=i(749);var t=i(883);e.exports={parse:function(e){var r=s.parse(e.toString());return t.compile(r)}}},883:e=>{"use strict";function compile(e){var r=[];var i=[];var s="";var t={};var l=t;var a=false;return reduce(e);function reduce(e){var r;for(var i=0;i<e.length;i++){r=e[i];switch(r.type){case"Assign":assign(r);break;case"ObjectPath":setPath(r);break;case"ArrayPath":addTableArray(r);break}}return t}function genError(e,r,i){var s=new Error(e);s.line=r;s.column=i;throw s}function assign(e){var t=e.key;var a=e.value;var n=e.line;var p=e.column;var f;if(s){f=s+"."+t}else{f=t}if(typeof l[t]!=="undefined"){genError("Cannot redefine existing key '"+f+"'.",n,p)}l[t]=reduceValueNode(a);if(!pathAssigned(f)){r.push(f);i.push(f)}}function pathAssigned(e){return r.indexOf(e)!==-1}function reduceValueNode(e){if(e.type==="Array"){return reduceArrayWithTypeChecking(e.value)}else if(e.type==="InlineTable"){return reduceInlineTableNode(e.value)}else{return e.value}}function reduceInlineTableNode(e){var r={};for(var i=0;i<e.length;i++){var s=e[i];if(s.value.type==="InlineTable"){r[s.key]=reduceInlineTableNode(s.value.value)}else if(s.type==="InlineTableValue"){r[s.key]=reduceValueNode(s.value)}}return r}function setPath(e){var i=e.value;var a=i.map(quoteDottedString).join(".");var n=e.line;var p=e.column;if(pathAssigned(a)){genError("Cannot redefine existing key '"+i+"'.",n,p)}r.push(a);l=deepRef(t,i,{},n,p);s=i}function addTableArray(e){var i=e.value;var a=i.map(quoteDottedString).join(".");var n=e.line;var p=e.column;if(!pathAssigned(a)){r.push(a)}r=r.filter((function(e){return e.indexOf(a)!==0}));r.push(a);l=deepRef(t,i,[],n,p);s=a;if(l instanceof Array){var f={};l.push(f);l=f}else{genError("Cannot redefine existing key '"+i+"'.",n,p)}}function deepRef(e,r,s,t,l){var a=[];var n="";var p=r.join(".");var f=e;for(var u=0;u<r.length;u++){var o=r[u];a.push(o);n=a.join(".");if(typeof f[o]==="undefined"){if(u===r.length-1){f[o]=s}else{f[o]={}}}else if(u!==r.length-1&&i.indexOf(n)>-1){genError("Cannot redefine existing key '"+n+"'.",t,l)}f=f[o];if(f instanceof Array&&f.length&&u<r.length-1){f=f[f.length-1]}}return f}function reduceArrayWithTypeChecking(e){var r=null;for(var i=0;i<e.length;i++){var s=e[i];if(r===null){r=s.type}else{if(s.type!==r){genError("Cannot add value of type "+s.type+" to array of type "+r+".",s.line,s.column)}}}return e.map(reduceValueNode)}function quoteDottedString(e){if(e.indexOf(".")>-1){return'"'+e+'"'}else{return e}}}e.exports={compile:compile}},749:e=>{e.exports=function(){function peg$subclass(e,r){function ctor(){this.constructor=e}ctor.prototype=r.prototype;e.prototype=new ctor}function SyntaxError(e,r,i,s,t,l){this.message=e;this.expected=r;this.found=i;this.offset=s;this.line=t;this.column=l;this.name="SyntaxError"}peg$subclass(SyntaxError,Error);function parse(e){var r=arguments.length>1?arguments[1]:{},i={},s={start:peg$parsestart},t=peg$parsestart,l=[],peg$c1=function(){return je},a=i,n="#",p={type:"literal",value:"#",description:'"#"'},f=void 0,u={type:"any",description:"any character"},o="[",g={type:"literal",value:"[",description:'"["'},c="]",$={type:"literal",value:"]",description:'"]"'},peg$c11=function(e){addNode(node("ObjectPath",e,line,column))},peg$c12=function(e){addNode(node("ArrayPath",e,line,column))},peg$c13=function(e,r){return e.concat(r)},peg$c14=function(e){return[e]},peg$c15=function(e){return e},h=".",d={type:"literal",value:".",description:'"."'},v="=",_={type:"literal",value:"=",description:'"="'},peg$c20=function(e,r){addNode(node("Assign",r,line,column,e))},peg$c21=function(e){return e.join("")},peg$c22=function(e){return e.value},x='"""',y={type:"literal",value:'"""',description:'"\\"\\"\\""'},P=null,peg$c26=function(e){return node("String",e.join(""),line,column)},A='"',S={type:"literal",value:'"',description:'"\\""'},I="'''",C={type:"literal",value:"'''",description:"\"'''\""},m="'",E={type:"literal",value:"'",description:'"\'"'},peg$c33=function(e){return e},peg$c34=function(e){return e},D="\\",b={type:"literal",value:"\\",description:'"\\\\"'},peg$c37=function(){return""},w="e",R={type:"literal",value:"e",description:'"e"'},N="E",T={type:"literal",value:"E",description:'"E"'},peg$c42=function(e,r){return node("Float",parseFloat(e+"e"+r),line,column)},peg$c43=function(e){return node("Float",parseFloat(e),line,column)},O="+",U={type:"literal",value:"+",description:'"+"'},peg$c46=function(e){return e.join("")},k="-",G={type:"literal",value:"-",description:'"-"'},peg$c49=function(e){return"-"+e.join("")},peg$c50=function(e){return node("Integer",parseInt(e,10),line,column)},q="true",F={type:"literal",value:"true",description:'"true"'},peg$c53=function(){return node("Boolean",true,line,column)},L="false",j={type:"literal",value:"false",description:'"false"'},peg$c56=function(){return node("Boolean",false,line,column)},peg$c57=function(){return node("Array",[],line,column)},peg$c58=function(e){return node("Array",e?[e]:[],line,column)},peg$c59=function(e){return node("Array",e,line,column)},peg$c60=function(e,r){return node("Array",e.concat(r),line,column)},peg$c61=function(e){return e},H=",",X={type:"literal",value:",",description:'","'},Z="{",B={type:"literal",value:"{",description:'"{"'},V="}",z={type:"literal",value:"}",description:'"}"'},peg$c68=function(e){return node("InlineTable",e,line,column)},peg$c69=function(e,r){return node("InlineTableValue",r,line,column,e)},peg$c70=function(e){return"."+e},peg$c71=function(e){return e.join("")},M=":",W={type:"literal",value:":",description:'":"'},peg$c74=function(e){return e.join("")},J="T",K={type:"literal",value:"T",description:'"T"'},Q="Z",Y={type:"literal",value:"Z",description:'"Z"'},peg$c79=function(e,r){return node("Date",new Date(e+"T"+r+"Z"),line,column)},peg$c80=function(e,r){return node("Date",new Date(e+"T"+r),line,column)},ee=/^[ \t]/,re={type:"class",value:"[ \\t]",description:"[ \\t]"},ie="\n",se={type:"literal",value:"\n",description:'"\\n"'},te="\r",le={type:"literal",value:"\r",description:'"\\r"'},ae=/^[0-9a-f]/i,ne={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},pe=/^[0-9]/,fe={type:"class",value:"[0-9]",description:"[0-9]"},ue="_",oe={type:"literal",value:"_",description:'"_"'},peg$c93=function(){return""},ge=/^[A-Za-z0-9_\-]/,ce={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},peg$c96=function(e){return e.join("")},$e='\\"',he={type:"literal",value:'\\"',description:'"\\\\\\""'},peg$c99=function(){return'"'},de="\\\\",ve={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},peg$c102=function(){return"\\"},_e="\\b",xe={type:"literal",value:"\\b",description:'"\\\\b"'},peg$c105=function(){return"\b"},ye="\\t",Pe={type:"literal",value:"\\t",description:'"\\\\t"'},peg$c108=function(){return"\t"},Ae="\\n",Se={type:"literal",value:"\\n",description:'"\\\\n"'},peg$c111=function(){return"\n"},Ie="\\f",Ce={type:"literal",value:"\\f",description:'"\\\\f"'},peg$c114=function(){return"\f"},me="\\r",Ee={type:"literal",value:"\\r",description:'"\\\\r"'},peg$c117=function(){return"\r"},De="\\U",be={type:"literal",value:"\\U",description:'"\\\\U"'},peg$c120=function(e){return convertCodePoint(e.join(""))},we="\\u",Re={type:"literal",value:"\\u",description:'"\\\\u"'},Ne=0,Te=0,Oe=0,Ue={line:1,column:1,seenCR:false},ke=0,Ge=[],qe=0,Fe={},Le;if("startRule"in r){if(!(r.startRule in s)){throw new Error("Can't start parsing from rule \""+r.startRule+'".')}t=s[r.startRule]}function text(){return e.substring(Te,Ne)}function offset(){return Te}function line(){return peg$computePosDetails(Te).line}function column(){return peg$computePosDetails(Te).column}function expected(e){throw peg$buildException(null,[{type:"other",description:e}],Te)}function error(e){throw peg$buildException(e,null,Te)}function peg$computePosDetails(r){function advance(r,i,s){var t,l;for(t=i;t<s;t++){l=e.charAt(t);if(l==="\n"){if(!r.seenCR){r.line++}r.column=1;r.seenCR=false}else if(l==="\r"||l==="\u2028"||l==="\u2029"){r.line++;r.column=1;r.seenCR=true}else{r.column++;r.seenCR=false}}}if(Oe!==r){if(Oe>r){Oe=0;Ue={line:1,column:1,seenCR:false}}advance(Ue,Oe,r);Oe=r}return Ue}function peg$fail(e){if(Ne<ke){return}if(Ne>ke){ke=Ne;Ge=[]}Ge.push(e)}function peg$buildException(r,i,s){function cleanupExpected(e){var r=1;e.sort((function(e,r){if(e.description<r.description){return-1}else if(e.description>r.description){return 1}else{return 0}}));while(r<e.length){if(e[r-1]===e[r]){e.splice(r,1)}else{r++}}}function buildMessage(e,r){function stringEscape(e){function hex(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+hex(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+hex(e)})).replace(/[\u0180-\u0FFF]/g,(function(e){return"\\u0"+hex(e)})).replace(/[\u1080-\uFFFF]/g,(function(e){return"\\u"+hex(e)}))}var i=new Array(e.length),s,t,l;for(l=0;l<e.length;l++){i[l]=e[l].description}s=e.length>1?i.slice(0,-1).join(", ")+" or "+i[e.length-1]:i[0];t=r?'"'+stringEscape(r)+'"':"end of input";return"Expected "+s+" but "+t+" found."}var t=peg$computePosDetails(s),l=s<e.length?e.charAt(s):null;if(i!==null){cleanupExpected(i)}return new SyntaxError(r!==null?r:buildMessage(i,l),i,l,s,t.line,t.column)}function peg$parsestart(){var e,r,s;var t=Ne*49+0,l=Fe[t];if(l){Ne=l.nextPos;return l.result}e=Ne;r=[];s=peg$parseline();while(s!==i){r.push(s);s=peg$parseline()}if(r!==i){Te=e;r=peg$c1()}e=r;Fe[t]={nextPos:Ne,result:e};return e}function peg$parseline(){var e,r,s,t,l,n,p;var f=Ne*49+1,u=Fe[f];if(u){Ne=u.nextPos;return u.result}e=Ne;r=[];s=peg$parseS();while(s!==i){r.push(s);s=peg$parseS()}if(r!==i){s=peg$parseexpression();if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){l=[];n=peg$parsecomment();while(n!==i){l.push(n);n=peg$parsecomment()}if(l!==i){n=[];p=peg$parseNL();if(p!==i){while(p!==i){n.push(p);p=peg$parseNL()}}else{n=a}if(n===i){n=peg$parseEOF()}if(n!==i){r=[r,s,t,l,n];e=r}else{Ne=e;e=a}}else{Ne=e;e=a}}else{Ne=e;e=a}}else{Ne=e;e=a}}else{Ne=e;e=a}if(e===i){e=Ne;r=[];s=peg$parseS();if(s!==i){while(s!==i){r.push(s);s=peg$parseS()}}else{r=a}if(r!==i){s=[];t=peg$parseNL();if(t!==i){while(t!==i){s.push(t);t=peg$parseNL()}}else{s=a}if(s===i){s=peg$parseEOF()}if(s!==i){r=[r,s];e=r}else{Ne=e;e=a}}else{Ne=e;e=a}if(e===i){e=peg$parseNL()}}Fe[f]={nextPos:Ne,result:e};return e}function peg$parseexpression(){var e;var r=Ne*49+2,s=Fe[r];if(s){Ne=s.nextPos;return s.result}e=peg$parsecomment();if(e===i){e=peg$parsepath();if(e===i){e=peg$parsetablearray();if(e===i){e=peg$parseassignment()}}}Fe[r]={nextPos:Ne,result:e};return e}function peg$parsecomment(){var r,s,t,l,o,g;var c=Ne*49+3,$=Fe[c];if($){Ne=$.nextPos;return $.result}r=Ne;if(e.charCodeAt(Ne)===35){s=n;Ne++}else{s=i;if(qe===0){peg$fail(p)}}if(s!==i){t=[];l=Ne;o=Ne;qe++;g=peg$parseNL();if(g===i){g=peg$parseEOF()}qe--;if(g===i){o=f}else{Ne=o;o=a}if(o!==i){if(e.length>Ne){g=e.charAt(Ne);Ne++}else{g=i;if(qe===0){peg$fail(u)}}if(g!==i){o=[o,g];l=o}else{Ne=l;l=a}}else{Ne=l;l=a}while(l!==i){t.push(l);l=Ne;o=Ne;qe++;g=peg$parseNL();if(g===i){g=peg$parseEOF()}qe--;if(g===i){o=f}else{Ne=o;o=a}if(o!==i){if(e.length>Ne){g=e.charAt(Ne);Ne++}else{g=i;if(qe===0){peg$fail(u)}}if(g!==i){o=[o,g];l=o}else{Ne=l;l=a}}else{Ne=l;l=a}}if(t!==i){s=[s,t];r=s}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[c]={nextPos:Ne,result:r};return r}function peg$parsepath(){var r,s,t,l,n,p;var f=Ne*49+4,u=Fe[f];if(u){Ne=u.nextPos;return u.result}r=Ne;if(e.charCodeAt(Ne)===91){s=o;Ne++}else{s=i;if(qe===0){peg$fail(g)}}if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){l=peg$parsetable_key();if(l!==i){n=[];p=peg$parseS();while(p!==i){n.push(p);p=peg$parseS()}if(n!==i){if(e.charCodeAt(Ne)===93){p=c;Ne++}else{p=i;if(qe===0){peg$fail($)}}if(p!==i){Te=r;s=peg$c11(l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[f]={nextPos:Ne,result:r};return r}function peg$parsetablearray(){var r,s,t,l,n,p,f,u;var h=Ne*49+5,d=Fe[h];if(d){Ne=d.nextPos;return d.result}r=Ne;if(e.charCodeAt(Ne)===91){s=o;Ne++}else{s=i;if(qe===0){peg$fail(g)}}if(s!==i){if(e.charCodeAt(Ne)===91){t=o;Ne++}else{t=i;if(qe===0){peg$fail(g)}}if(t!==i){l=[];n=peg$parseS();while(n!==i){l.push(n);n=peg$parseS()}if(l!==i){n=peg$parsetable_key();if(n!==i){p=[];f=peg$parseS();while(f!==i){p.push(f);f=peg$parseS()}if(p!==i){if(e.charCodeAt(Ne)===93){f=c;Ne++}else{f=i;if(qe===0){peg$fail($)}}if(f!==i){if(e.charCodeAt(Ne)===93){u=c;Ne++}else{u=i;if(qe===0){peg$fail($)}}if(u!==i){Te=r;s=peg$c12(n);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[h]={nextPos:Ne,result:r};return r}function peg$parsetable_key(){var e,r,s;var t=Ne*49+6,l=Fe[t];if(l){Ne=l.nextPos;return l.result}e=Ne;r=[];s=peg$parsedot_ended_table_key_part();if(s!==i){while(s!==i){r.push(s);s=peg$parsedot_ended_table_key_part()}}else{r=a}if(r!==i){s=peg$parsetable_key_part();if(s!==i){Te=e;r=peg$c13(r,s);e=r}else{Ne=e;e=a}}else{Ne=e;e=a}if(e===i){e=Ne;r=peg$parsetable_key_part();if(r!==i){Te=e;r=peg$c14(r)}e=r}Fe[t]={nextPos:Ne,result:e};return e}function peg$parsetable_key_part(){var e,r,s,t,l;var n=Ne*49+7,p=Fe[n];if(p){Ne=p.nextPos;return p.result}e=Ne;r=[];s=peg$parseS();while(s!==i){r.push(s);s=peg$parseS()}if(r!==i){s=peg$parsekey();if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){Te=e;r=peg$c15(s);e=r}else{Ne=e;e=a}}else{Ne=e;e=a}}else{Ne=e;e=a}if(e===i){e=Ne;r=[];s=peg$parseS();while(s!==i){r.push(s);s=peg$parseS()}if(r!==i){s=peg$parsequoted_key();if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){Te=e;r=peg$c15(s);e=r}else{Ne=e;e=a}}else{Ne=e;e=a}}else{Ne=e;e=a}}Fe[n]={nextPos:Ne,result:e};return e}function peg$parsedot_ended_table_key_part(){var r,s,t,l,n,p,f;var u=Ne*49+8,o=Fe[u];if(o){Ne=o.nextPos;return o.result}r=Ne;s=[];t=peg$parseS();while(t!==i){s.push(t);t=peg$parseS()}if(s!==i){t=peg$parsekey();if(t!==i){l=[];n=peg$parseS();while(n!==i){l.push(n);n=peg$parseS()}if(l!==i){if(e.charCodeAt(Ne)===46){n=h;Ne++}else{n=i;if(qe===0){peg$fail(d)}}if(n!==i){p=[];f=peg$parseS();while(f!==i){p.push(f);f=peg$parseS()}if(p!==i){Te=r;s=peg$c15(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;s=[];t=peg$parseS();while(t!==i){s.push(t);t=peg$parseS()}if(s!==i){t=peg$parsequoted_key();if(t!==i){l=[];n=peg$parseS();while(n!==i){l.push(n);n=peg$parseS()}if(l!==i){if(e.charCodeAt(Ne)===46){n=h;Ne++}else{n=i;if(qe===0){peg$fail(d)}}if(n!==i){p=[];f=peg$parseS();while(f!==i){p.push(f);f=peg$parseS()}if(p!==i){Te=r;s=peg$c15(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[u]={nextPos:Ne,result:r};return r}function peg$parseassignment(){var r,s,t,l,n,p;var f=Ne*49+9,u=Fe[f];if(u){Ne=u.nextPos;return u.result}r=Ne;s=peg$parsekey();if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){if(e.charCodeAt(Ne)===61){l=v;Ne++}else{l=i;if(qe===0){peg$fail(_)}}if(l!==i){n=[];p=peg$parseS();while(p!==i){n.push(p);p=peg$parseS()}if(n!==i){p=peg$parsevalue();if(p!==i){Te=r;s=peg$c20(s,p);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;s=peg$parsequoted_key();if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){if(e.charCodeAt(Ne)===61){l=v;Ne++}else{l=i;if(qe===0){peg$fail(_)}}if(l!==i){n=[];p=peg$parseS();while(p!==i){n.push(p);p=peg$parseS()}if(n!==i){p=peg$parsevalue();if(p!==i){Te=r;s=peg$c20(s,p);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[f]={nextPos:Ne,result:r};return r}function peg$parsekey(){var e,r,s;var t=Ne*49+10,l=Fe[t];if(l){Ne=l.nextPos;return l.result}e=Ne;r=[];s=peg$parseASCII_BASIC();if(s!==i){while(s!==i){r.push(s);s=peg$parseASCII_BASIC()}}else{r=a}if(r!==i){Te=e;r=peg$c21(r)}e=r;Fe[t]={nextPos:Ne,result:e};return e}function peg$parsequoted_key(){var e,r;var s=Ne*49+11,t=Fe[s];if(t){Ne=t.nextPos;return t.result}e=Ne;r=peg$parsedouble_quoted_single_line_string();if(r!==i){Te=e;r=peg$c22(r)}e=r;if(e===i){e=Ne;r=peg$parsesingle_quoted_single_line_string();if(r!==i){Te=e;r=peg$c22(r)}e=r}Fe[s]={nextPos:Ne,result:e};return e}function peg$parsevalue(){var e;var r=Ne*49+12,s=Fe[r];if(s){Ne=s.nextPos;return s.result}e=peg$parsestring();if(e===i){e=peg$parsedatetime();if(e===i){e=peg$parsefloat();if(e===i){e=peg$parseinteger();if(e===i){e=peg$parseboolean();if(e===i){e=peg$parsearray();if(e===i){e=peg$parseinline_table()}}}}}}Fe[r]={nextPos:Ne,result:e};return e}function peg$parsestring(){var e;var r=Ne*49+13,s=Fe[r];if(s){Ne=s.nextPos;return s.result}e=peg$parsedouble_quoted_multiline_string();if(e===i){e=peg$parsedouble_quoted_single_line_string();if(e===i){e=peg$parsesingle_quoted_multiline_string();if(e===i){e=peg$parsesingle_quoted_single_line_string()}}}Fe[r]={nextPos:Ne,result:e};return e}function peg$parsedouble_quoted_multiline_string(){var r,s,t,l,n;var p=Ne*49+14,f=Fe[p];if(f){Ne=f.nextPos;return f.result}r=Ne;if(e.substr(Ne,3)===x){s=x;Ne+=3}else{s=i;if(qe===0){peg$fail(y)}}if(s!==i){t=peg$parseNL();if(t===i){t=P}if(t!==i){l=[];n=peg$parsemultiline_string_char();while(n!==i){l.push(n);n=peg$parsemultiline_string_char()}if(l!==i){if(e.substr(Ne,3)===x){n=x;Ne+=3}else{n=i;if(qe===0){peg$fail(y)}}if(n!==i){Te=r;s=peg$c26(l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[p]={nextPos:Ne,result:r};return r}function peg$parsedouble_quoted_single_line_string(){var r,s,t,l;var n=Ne*49+15,p=Fe[n];if(p){Ne=p.nextPos;return p.result}r=Ne;if(e.charCodeAt(Ne)===34){s=A;Ne++}else{s=i;if(qe===0){peg$fail(S)}}if(s!==i){t=[];l=peg$parsestring_char();while(l!==i){t.push(l);l=peg$parsestring_char()}if(t!==i){if(e.charCodeAt(Ne)===34){l=A;Ne++}else{l=i;if(qe===0){peg$fail(S)}}if(l!==i){Te=r;s=peg$c26(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[n]={nextPos:Ne,result:r};return r}function peg$parsesingle_quoted_multiline_string(){var r,s,t,l,n;var p=Ne*49+16,f=Fe[p];if(f){Ne=f.nextPos;return f.result}r=Ne;if(e.substr(Ne,3)===I){s=I;Ne+=3}else{s=i;if(qe===0){peg$fail(C)}}if(s!==i){t=peg$parseNL();if(t===i){t=P}if(t!==i){l=[];n=peg$parsemultiline_literal_char();while(n!==i){l.push(n);n=peg$parsemultiline_literal_char()}if(l!==i){if(e.substr(Ne,3)===I){n=I;Ne+=3}else{n=i;if(qe===0){peg$fail(C)}}if(n!==i){Te=r;s=peg$c26(l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[p]={nextPos:Ne,result:r};return r}function peg$parsesingle_quoted_single_line_string(){var r,s,t,l;var n=Ne*49+17,p=Fe[n];if(p){Ne=p.nextPos;return p.result}r=Ne;if(e.charCodeAt(Ne)===39){s=m;Ne++}else{s=i;if(qe===0){peg$fail(E)}}if(s!==i){t=[];l=peg$parseliteral_char();while(l!==i){t.push(l);l=peg$parseliteral_char()}if(t!==i){if(e.charCodeAt(Ne)===39){l=m;Ne++}else{l=i;if(qe===0){peg$fail(E)}}if(l!==i){Te=r;s=peg$c26(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[n]={nextPos:Ne,result:r};return r}function peg$parsestring_char(){var r,s,t;var l=Ne*49+18,n=Fe[l];if(n){Ne=n.nextPos;return n.result}r=peg$parseESCAPED();if(r===i){r=Ne;s=Ne;qe++;if(e.charCodeAt(Ne)===34){t=A;Ne++}else{t=i;if(qe===0){peg$fail(S)}}qe--;if(t===i){s=f}else{Ne=s;s=a}if(s!==i){if(e.length>Ne){t=e.charAt(Ne);Ne++}else{t=i;if(qe===0){peg$fail(u)}}if(t!==i){Te=r;s=peg$c33(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[l]={nextPos:Ne,result:r};return r}function peg$parseliteral_char(){var r,s,t;var l=Ne*49+19,n=Fe[l];if(n){Ne=n.nextPos;return n.result}r=Ne;s=Ne;qe++;if(e.charCodeAt(Ne)===39){t=m;Ne++}else{t=i;if(qe===0){peg$fail(E)}}qe--;if(t===i){s=f}else{Ne=s;s=a}if(s!==i){if(e.length>Ne){t=e.charAt(Ne);Ne++}else{t=i;if(qe===0){peg$fail(u)}}if(t!==i){Te=r;s=peg$c33(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[l]={nextPos:Ne,result:r};return r}function peg$parsemultiline_string_char(){var r,s,t;var l=Ne*49+20,n=Fe[l];if(n){Ne=n.nextPos;return n.result}r=peg$parseESCAPED();if(r===i){r=peg$parsemultiline_string_delim();if(r===i){r=Ne;s=Ne;qe++;if(e.substr(Ne,3)===x){t=x;Ne+=3}else{t=i;if(qe===0){peg$fail(y)}}qe--;if(t===i){s=f}else{Ne=s;s=a}if(s!==i){if(e.length>Ne){t=e.charAt(Ne);Ne++}else{t=i;if(qe===0){peg$fail(u)}}if(t!==i){Te=r;s=peg$c34(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}}Fe[l]={nextPos:Ne,result:r};return r}function peg$parsemultiline_string_delim(){var r,s,t,l,n;var p=Ne*49+21,f=Fe[p];if(f){Ne=f.nextPos;return f.result}r=Ne;if(e.charCodeAt(Ne)===92){s=D;Ne++}else{s=i;if(qe===0){peg$fail(b)}}if(s!==i){t=peg$parseNL();if(t!==i){l=[];n=peg$parseNLS();while(n!==i){l.push(n);n=peg$parseNLS()}if(l!==i){Te=r;s=peg$c37();r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[p]={nextPos:Ne,result:r};return r}function peg$parsemultiline_literal_char(){var r,s,t;var l=Ne*49+22,n=Fe[l];if(n){Ne=n.nextPos;return n.result}r=Ne;s=Ne;qe++;if(e.substr(Ne,3)===I){t=I;Ne+=3}else{t=i;if(qe===0){peg$fail(C)}}qe--;if(t===i){s=f}else{Ne=s;s=a}if(s!==i){if(e.length>Ne){t=e.charAt(Ne);Ne++}else{t=i;if(qe===0){peg$fail(u)}}if(t!==i){Te=r;s=peg$c33(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[l]={nextPos:Ne,result:r};return r}function peg$parsefloat(){var r,s,t,l;var n=Ne*49+23,p=Fe[n];if(p){Ne=p.nextPos;return p.result}r=Ne;s=peg$parsefloat_text();if(s===i){s=peg$parseinteger_text()}if(s!==i){if(e.charCodeAt(Ne)===101){t=w;Ne++}else{t=i;if(qe===0){peg$fail(R)}}if(t===i){if(e.charCodeAt(Ne)===69){t=N;Ne++}else{t=i;if(qe===0){peg$fail(T)}}}if(t!==i){l=peg$parseinteger_text();if(l!==i){Te=r;s=peg$c42(s,l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;s=peg$parsefloat_text();if(s!==i){Te=r;s=peg$c43(s)}r=s}Fe[n]={nextPos:Ne,result:r};return r}function peg$parsefloat_text(){var r,s,t,l,n,p;var f=Ne*49+24,u=Fe[f];if(u){Ne=u.nextPos;return u.result}r=Ne;if(e.charCodeAt(Ne)===43){s=O;Ne++}else{s=i;if(qe===0){peg$fail(U)}}if(s===i){s=P}if(s!==i){t=Ne;l=peg$parseDIGITS();if(l!==i){if(e.charCodeAt(Ne)===46){n=h;Ne++}else{n=i;if(qe===0){peg$fail(d)}}if(n!==i){p=peg$parseDIGITS();if(p!==i){l=[l,n,p];t=l}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}if(t!==i){Te=r;s=peg$c46(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;if(e.charCodeAt(Ne)===45){s=k;Ne++}else{s=i;if(qe===0){peg$fail(G)}}if(s!==i){t=Ne;l=peg$parseDIGITS();if(l!==i){if(e.charCodeAt(Ne)===46){n=h;Ne++}else{n=i;if(qe===0){peg$fail(d)}}if(n!==i){p=peg$parseDIGITS();if(p!==i){l=[l,n,p];t=l}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}if(t!==i){Te=r;s=peg$c49(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[f]={nextPos:Ne,result:r};return r}function peg$parseinteger(){var e,r;var s=Ne*49+25,t=Fe[s];if(t){Ne=t.nextPos;return t.result}e=Ne;r=peg$parseinteger_text();if(r!==i){Te=e;r=peg$c50(r)}e=r;Fe[s]={nextPos:Ne,result:e};return e}function peg$parseinteger_text(){var r,s,t,l,n;var p=Ne*49+26,u=Fe[p];if(u){Ne=u.nextPos;return u.result}r=Ne;if(e.charCodeAt(Ne)===43){s=O;Ne++}else{s=i;if(qe===0){peg$fail(U)}}if(s===i){s=P}if(s!==i){t=[];l=peg$parseDIGIT_OR_UNDER();if(l!==i){while(l!==i){t.push(l);l=peg$parseDIGIT_OR_UNDER()}}else{t=a}if(t!==i){l=Ne;qe++;if(e.charCodeAt(Ne)===46){n=h;Ne++}else{n=i;if(qe===0){peg$fail(d)}}qe--;if(n===i){l=f}else{Ne=l;l=a}if(l!==i){Te=r;s=peg$c46(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;if(e.charCodeAt(Ne)===45){s=k;Ne++}else{s=i;if(qe===0){peg$fail(G)}}if(s!==i){t=[];l=peg$parseDIGIT_OR_UNDER();if(l!==i){while(l!==i){t.push(l);l=peg$parseDIGIT_OR_UNDER()}}else{t=a}if(t!==i){l=Ne;qe++;if(e.charCodeAt(Ne)===46){n=h;Ne++}else{n=i;if(qe===0){peg$fail(d)}}qe--;if(n===i){l=f}else{Ne=l;l=a}if(l!==i){Te=r;s=peg$c49(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[p]={nextPos:Ne,result:r};return r}function peg$parseboolean(){var r,s;var t=Ne*49+27,l=Fe[t];if(l){Ne=l.nextPos;return l.result}r=Ne;if(e.substr(Ne,4)===q){s=q;Ne+=4}else{s=i;if(qe===0){peg$fail(F)}}if(s!==i){Te=r;s=peg$c53()}r=s;if(r===i){r=Ne;if(e.substr(Ne,5)===L){s=L;Ne+=5}else{s=i;if(qe===0){peg$fail(j)}}if(s!==i){Te=r;s=peg$c56()}r=s}Fe[t]={nextPos:Ne,result:r};return r}function peg$parsearray(){var r,s,t,l,n;var p=Ne*49+28,f=Fe[p];if(f){Ne=f.nextPos;return f.result}r=Ne;if(e.charCodeAt(Ne)===91){s=o;Ne++}else{s=i;if(qe===0){peg$fail(g)}}if(s!==i){t=[];l=peg$parsearray_sep();while(l!==i){t.push(l);l=peg$parsearray_sep()}if(t!==i){if(e.charCodeAt(Ne)===93){l=c;Ne++}else{l=i;if(qe===0){peg$fail($)}}if(l!==i){Te=r;s=peg$c57();r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;if(e.charCodeAt(Ne)===91){s=o;Ne++}else{s=i;if(qe===0){peg$fail(g)}}if(s!==i){t=peg$parsearray_value();if(t===i){t=P}if(t!==i){if(e.charCodeAt(Ne)===93){l=c;Ne++}else{l=i;if(qe===0){peg$fail($)}}if(l!==i){Te=r;s=peg$c58(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;if(e.charCodeAt(Ne)===91){s=o;Ne++}else{s=i;if(qe===0){peg$fail(g)}}if(s!==i){t=[];l=peg$parsearray_value_list();if(l!==i){while(l!==i){t.push(l);l=peg$parsearray_value_list()}}else{t=a}if(t!==i){if(e.charCodeAt(Ne)===93){l=c;Ne++}else{l=i;if(qe===0){peg$fail($)}}if(l!==i){Te=r;s=peg$c59(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;if(e.charCodeAt(Ne)===91){s=o;Ne++}else{s=i;if(qe===0){peg$fail(g)}}if(s!==i){t=[];l=peg$parsearray_value_list();if(l!==i){while(l!==i){t.push(l);l=peg$parsearray_value_list()}}else{t=a}if(t!==i){l=peg$parsearray_value();if(l!==i){if(e.charCodeAt(Ne)===93){n=c;Ne++}else{n=i;if(qe===0){peg$fail($)}}if(n!==i){Te=r;s=peg$c60(t,l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}}}Fe[p]={nextPos:Ne,result:r};return r}function peg$parsearray_value(){var e,r,s,t,l;var n=Ne*49+29,p=Fe[n];if(p){Ne=p.nextPos;return p.result}e=Ne;r=[];s=peg$parsearray_sep();while(s!==i){r.push(s);s=peg$parsearray_sep()}if(r!==i){s=peg$parsevalue();if(s!==i){t=[];l=peg$parsearray_sep();while(l!==i){t.push(l);l=peg$parsearray_sep()}if(t!==i){Te=e;r=peg$c61(s);e=r}else{Ne=e;e=a}}else{Ne=e;e=a}}else{Ne=e;e=a}Fe[n]={nextPos:Ne,result:e};return e}function peg$parsearray_value_list(){var r,s,t,l,n,p,f;var u=Ne*49+30,o=Fe[u];if(o){Ne=o.nextPos;return o.result}r=Ne;s=[];t=peg$parsearray_sep();while(t!==i){s.push(t);t=peg$parsearray_sep()}if(s!==i){t=peg$parsevalue();if(t!==i){l=[];n=peg$parsearray_sep();while(n!==i){l.push(n);n=peg$parsearray_sep()}if(l!==i){if(e.charCodeAt(Ne)===44){n=H;Ne++}else{n=i;if(qe===0){peg$fail(X)}}if(n!==i){p=[];f=peg$parsearray_sep();while(f!==i){p.push(f);f=peg$parsearray_sep()}if(p!==i){Te=r;s=peg$c61(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[u]={nextPos:Ne,result:r};return r}function peg$parsearray_sep(){var e;var r=Ne*49+31,s=Fe[r];if(s){Ne=s.nextPos;return s.result}e=peg$parseS();if(e===i){e=peg$parseNL();if(e===i){e=peg$parsecomment()}}Fe[r]={nextPos:Ne,result:e};return e}function peg$parseinline_table(){var r,s,t,l,n,p;var f=Ne*49+32,u=Fe[f];if(u){Ne=u.nextPos;return u.result}r=Ne;if(e.charCodeAt(Ne)===123){s=Z;Ne++}else{s=i;if(qe===0){peg$fail(B)}}if(s!==i){t=[];l=peg$parseS();while(l!==i){t.push(l);l=peg$parseS()}if(t!==i){l=[];n=peg$parseinline_table_assignment();while(n!==i){l.push(n);n=peg$parseinline_table_assignment()}if(l!==i){n=[];p=peg$parseS();while(p!==i){n.push(p);p=peg$parseS()}if(n!==i){if(e.charCodeAt(Ne)===125){p=V;Ne++}else{p=i;if(qe===0){peg$fail(z)}}if(p!==i){Te=r;s=peg$c68(l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[f]={nextPos:Ne,result:r};return r}function peg$parseinline_table_assignment(){var r,s,t,l,n,p,f,u,o,g,c;var $=Ne*49+33,h=Fe[$];if(h){Ne=h.nextPos;return h.result}r=Ne;s=[];t=peg$parseS();while(t!==i){s.push(t);t=peg$parseS()}if(s!==i){t=peg$parsekey();if(t!==i){l=[];n=peg$parseS();while(n!==i){l.push(n);n=peg$parseS()}if(l!==i){if(e.charCodeAt(Ne)===61){n=v;Ne++}else{n=i;if(qe===0){peg$fail(_)}}if(n!==i){p=[];f=peg$parseS();while(f!==i){p.push(f);f=peg$parseS()}if(p!==i){f=peg$parsevalue();if(f!==i){u=[];o=peg$parseS();while(o!==i){u.push(o);o=peg$parseS()}if(u!==i){if(e.charCodeAt(Ne)===44){o=H;Ne++}else{o=i;if(qe===0){peg$fail(X)}}if(o!==i){g=[];c=peg$parseS();while(c!==i){g.push(c);c=peg$parseS()}if(g!==i){Te=r;s=peg$c69(t,f);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;s=[];t=peg$parseS();while(t!==i){s.push(t);t=peg$parseS()}if(s!==i){t=peg$parsekey();if(t!==i){l=[];n=peg$parseS();while(n!==i){l.push(n);n=peg$parseS()}if(l!==i){if(e.charCodeAt(Ne)===61){n=v;Ne++}else{n=i;if(qe===0){peg$fail(_)}}if(n!==i){p=[];f=peg$parseS();while(f!==i){p.push(f);f=peg$parseS()}if(p!==i){f=peg$parsevalue();if(f!==i){Te=r;s=peg$c69(t,f);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[$]={nextPos:Ne,result:r};return r}function peg$parsesecfragment(){var r,s,t;var l=Ne*49+34,n=Fe[l];if(n){Ne=n.nextPos;return n.result}r=Ne;if(e.charCodeAt(Ne)===46){s=h;Ne++}else{s=i;if(qe===0){peg$fail(d)}}if(s!==i){t=peg$parseDIGITS();if(t!==i){Te=r;s=peg$c70(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}Fe[l]={nextPos:Ne,result:r};return r}function peg$parsedate(){var r,s,t,l,n,p,f,u,o,g,c,$;var h=Ne*49+35,d=Fe[h];if(d){Ne=d.nextPos;return d.result}r=Ne;s=Ne;t=peg$parseDIGIT_OR_UNDER();if(t!==i){l=peg$parseDIGIT_OR_UNDER();if(l!==i){n=peg$parseDIGIT_OR_UNDER();if(n!==i){p=peg$parseDIGIT_OR_UNDER();if(p!==i){if(e.charCodeAt(Ne)===45){f=k;Ne++}else{f=i;if(qe===0){peg$fail(G)}}if(f!==i){u=peg$parseDIGIT_OR_UNDER();if(u!==i){o=peg$parseDIGIT_OR_UNDER();if(o!==i){if(e.charCodeAt(Ne)===45){g=k;Ne++}else{g=i;if(qe===0){peg$fail(G)}}if(g!==i){c=peg$parseDIGIT_OR_UNDER();if(c!==i){$=peg$parseDIGIT_OR_UNDER();if($!==i){t=[t,l,n,p,f,u,o,g,c,$];s=t}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}if(s!==i){Te=r;s=peg$c71(s)}r=s;Fe[h]={nextPos:Ne,result:r};return r}function peg$parsetime(){var r,s,t,l,n,p,f,u,o,g,c;var $=Ne*49+36,h=Fe[$];if(h){Ne=h.nextPos;return h.result}r=Ne;s=Ne;t=peg$parseDIGIT_OR_UNDER();if(t!==i){l=peg$parseDIGIT_OR_UNDER();if(l!==i){if(e.charCodeAt(Ne)===58){n=M;Ne++}else{n=i;if(qe===0){peg$fail(W)}}if(n!==i){p=peg$parseDIGIT_OR_UNDER();if(p!==i){f=peg$parseDIGIT_OR_UNDER();if(f!==i){if(e.charCodeAt(Ne)===58){u=M;Ne++}else{u=i;if(qe===0){peg$fail(W)}}if(u!==i){o=peg$parseDIGIT_OR_UNDER();if(o!==i){g=peg$parseDIGIT_OR_UNDER();if(g!==i){c=peg$parsesecfragment();if(c===i){c=P}if(c!==i){t=[t,l,n,p,f,u,o,g,c];s=t}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}if(s!==i){Te=r;s=peg$c74(s)}r=s;Fe[$]={nextPos:Ne,result:r};return r}function peg$parsetime_with_offset(){var r,s,t,l,n,p,f,u,o,g,c,$,h,d,v,_,x;var y=Ne*49+37,A=Fe[y];if(A){Ne=A.nextPos;return A.result}r=Ne;s=Ne;t=peg$parseDIGIT_OR_UNDER();if(t!==i){l=peg$parseDIGIT_OR_UNDER();if(l!==i){if(e.charCodeAt(Ne)===58){n=M;Ne++}else{n=i;if(qe===0){peg$fail(W)}}if(n!==i){p=peg$parseDIGIT_OR_UNDER();if(p!==i){f=peg$parseDIGIT_OR_UNDER();if(f!==i){if(e.charCodeAt(Ne)===58){u=M;Ne++}else{u=i;if(qe===0){peg$fail(W)}}if(u!==i){o=peg$parseDIGIT_OR_UNDER();if(o!==i){g=peg$parseDIGIT_OR_UNDER();if(g!==i){c=peg$parsesecfragment();if(c===i){c=P}if(c!==i){if(e.charCodeAt(Ne)===45){$=k;Ne++}else{$=i;if(qe===0){peg$fail(G)}}if($===i){if(e.charCodeAt(Ne)===43){$=O;Ne++}else{$=i;if(qe===0){peg$fail(U)}}}if($!==i){h=peg$parseDIGIT_OR_UNDER();if(h!==i){d=peg$parseDIGIT_OR_UNDER();if(d!==i){if(e.charCodeAt(Ne)===58){v=M;Ne++}else{v=i;if(qe===0){peg$fail(W)}}if(v!==i){_=peg$parseDIGIT_OR_UNDER();if(_!==i){x=peg$parseDIGIT_OR_UNDER();if(x!==i){t=[t,l,n,p,f,u,o,g,c,$,h,d,v,_,x];s=t}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}}else{Ne=s;s=a}if(s!==i){Te=r;s=peg$c74(s)}r=s;Fe[y]={nextPos:Ne,result:r};return r}function peg$parsedatetime(){var r,s,t,l,n;var p=Ne*49+38,f=Fe[p];if(f){Ne=f.nextPos;return f.result}r=Ne;s=peg$parsedate();if(s!==i){if(e.charCodeAt(Ne)===84){t=J;Ne++}else{t=i;if(qe===0){peg$fail(K)}}if(t!==i){l=peg$parsetime();if(l!==i){if(e.charCodeAt(Ne)===90){n=Q;Ne++}else{n=i;if(qe===0){peg$fail(Y)}}if(n!==i){Te=r;s=peg$c79(s,l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;s=peg$parsedate();if(s!==i){if(e.charCodeAt(Ne)===84){t=J;Ne++}else{t=i;if(qe===0){peg$fail(K)}}if(t!==i){l=peg$parsetime_with_offset();if(l!==i){Te=r;s=peg$c80(s,l);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[p]={nextPos:Ne,result:r};return r}function peg$parseS(){var r;var s=Ne*49+39,t=Fe[s];if(t){Ne=t.nextPos;return t.result}if(ee.test(e.charAt(Ne))){r=e.charAt(Ne);Ne++}else{r=i;if(qe===0){peg$fail(re)}}Fe[s]={nextPos:Ne,result:r};return r}function peg$parseNL(){var r,s,t;var l=Ne*49+40,n=Fe[l];if(n){Ne=n.nextPos;return n.result}if(e.charCodeAt(Ne)===10){r=ie;Ne++}else{r=i;if(qe===0){peg$fail(se)}}if(r===i){r=Ne;if(e.charCodeAt(Ne)===13){s=te;Ne++}else{s=i;if(qe===0){peg$fail(le)}}if(s!==i){if(e.charCodeAt(Ne)===10){t=ie;Ne++}else{t=i;if(qe===0){peg$fail(se)}}if(t!==i){s=[s,t];r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[l]={nextPos:Ne,result:r};return r}function peg$parseNLS(){var e;var r=Ne*49+41,s=Fe[r];if(s){Ne=s.nextPos;return s.result}e=peg$parseNL();if(e===i){e=peg$parseS()}Fe[r]={nextPos:Ne,result:e};return e}function peg$parseEOF(){var r,s;var t=Ne*49+42,l=Fe[t];if(l){Ne=l.nextPos;return l.result}r=Ne;qe++;if(e.length>Ne){s=e.charAt(Ne);Ne++}else{s=i;if(qe===0){peg$fail(u)}}qe--;if(s===i){r=f}else{Ne=r;r=a}Fe[t]={nextPos:Ne,result:r};return r}function peg$parseHEX(){var r;var s=Ne*49+43,t=Fe[s];if(t){Ne=t.nextPos;return t.result}if(ae.test(e.charAt(Ne))){r=e.charAt(Ne);Ne++}else{r=i;if(qe===0){peg$fail(ne)}}Fe[s]={nextPos:Ne,result:r};return r}function peg$parseDIGIT_OR_UNDER(){var r,s;var t=Ne*49+44,l=Fe[t];if(l){Ne=l.nextPos;return l.result}if(pe.test(e.charAt(Ne))){r=e.charAt(Ne);Ne++}else{r=i;if(qe===0){peg$fail(fe)}}if(r===i){r=Ne;if(e.charCodeAt(Ne)===95){s=ue;Ne++}else{s=i;if(qe===0){peg$fail(oe)}}if(s!==i){Te=r;s=peg$c93()}r=s}Fe[t]={nextPos:Ne,result:r};return r}function peg$parseASCII_BASIC(){var r;var s=Ne*49+45,t=Fe[s];if(t){Ne=t.nextPos;return t.result}if(ge.test(e.charAt(Ne))){r=e.charAt(Ne);Ne++}else{r=i;if(qe===0){peg$fail(ce)}}Fe[s]={nextPos:Ne,result:r};return r}function peg$parseDIGITS(){var e,r,s;var t=Ne*49+46,l=Fe[t];if(l){Ne=l.nextPos;return l.result}e=Ne;r=[];s=peg$parseDIGIT_OR_UNDER();if(s!==i){while(s!==i){r.push(s);s=peg$parseDIGIT_OR_UNDER()}}else{r=a}if(r!==i){Te=e;r=peg$c96(r)}e=r;Fe[t]={nextPos:Ne,result:e};return e}function peg$parseESCAPED(){var r,s;var t=Ne*49+47,l=Fe[t];if(l){Ne=l.nextPos;return l.result}r=Ne;if(e.substr(Ne,2)===$e){s=$e;Ne+=2}else{s=i;if(qe===0){peg$fail(he)}}if(s!==i){Te=r;s=peg$c99()}r=s;if(r===i){r=Ne;if(e.substr(Ne,2)===de){s=de;Ne+=2}else{s=i;if(qe===0){peg$fail(ve)}}if(s!==i){Te=r;s=peg$c102()}r=s;if(r===i){r=Ne;if(e.substr(Ne,2)===_e){s=_e;Ne+=2}else{s=i;if(qe===0){peg$fail(xe)}}if(s!==i){Te=r;s=peg$c105()}r=s;if(r===i){r=Ne;if(e.substr(Ne,2)===ye){s=ye;Ne+=2}else{s=i;if(qe===0){peg$fail(Pe)}}if(s!==i){Te=r;s=peg$c108()}r=s;if(r===i){r=Ne;if(e.substr(Ne,2)===Ae){s=Ae;Ne+=2}else{s=i;if(qe===0){peg$fail(Se)}}if(s!==i){Te=r;s=peg$c111()}r=s;if(r===i){r=Ne;if(e.substr(Ne,2)===Ie){s=Ie;Ne+=2}else{s=i;if(qe===0){peg$fail(Ce)}}if(s!==i){Te=r;s=peg$c114()}r=s;if(r===i){r=Ne;if(e.substr(Ne,2)===me){s=me;Ne+=2}else{s=i;if(qe===0){peg$fail(Ee)}}if(s!==i){Te=r;s=peg$c117()}r=s;if(r===i){r=peg$parseESCAPED_UNICODE()}}}}}}}Fe[t]={nextPos:Ne,result:r};return r}function peg$parseESCAPED_UNICODE(){var r,s,t,l,n,p,f,u,o,g,c;var $=Ne*49+48,h=Fe[$];if(h){Ne=h.nextPos;return h.result}r=Ne;if(e.substr(Ne,2)===De){s=De;Ne+=2}else{s=i;if(qe===0){peg$fail(be)}}if(s!==i){t=Ne;l=peg$parseHEX();if(l!==i){n=peg$parseHEX();if(n!==i){p=peg$parseHEX();if(p!==i){f=peg$parseHEX();if(f!==i){u=peg$parseHEX();if(u!==i){o=peg$parseHEX();if(o!==i){g=peg$parseHEX();if(g!==i){c=peg$parseHEX();if(c!==i){l=[l,n,p,f,u,o,g,c];t=l}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}if(t!==i){Te=r;s=peg$c120(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}if(r===i){r=Ne;if(e.substr(Ne,2)===we){s=we;Ne+=2}else{s=i;if(qe===0){peg$fail(Re)}}if(s!==i){t=Ne;l=peg$parseHEX();if(l!==i){n=peg$parseHEX();if(n!==i){p=peg$parseHEX();if(p!==i){f=peg$parseHEX();if(f!==i){l=[l,n,p,f];t=l}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}}else{Ne=t;t=a}if(t!==i){Te=r;s=peg$c120(t);r=s}else{Ne=r;r=a}}else{Ne=r;r=a}}Fe[$]={nextPos:Ne,result:r};return r}var je=[];function genError(e,r,i){var s=new Error(e);s.line=r;s.column=i;throw s}function addNode(e){je.push(e)}function node(e,r,i,s,t){var l={type:e,value:r,line:i(),column:s()};if(t)l.key=t;return l}function convertCodePoint(e,r,i){var s=parseInt("0x"+e);if(!isFinite(s)||Math.floor(s)!=s||s<0||s>1114111||s>55295&&s<57344){genError("Invalid Unicode escape code: "+e,r,i)}else{return fromCodePoint(s)}}function fromCodePoint(){var e=16384;var r=[];var i;var s;var t=-1;var l=arguments.length;if(!l){return""}var a="";while(++t<l){var n=Number(arguments[t]);if(n<=65535){r.push(n)}else{n-=65536;i=(n>>10)+55296;s=n%1024+56320;r.push(i,s)}if(t+1==l||r.length>e){a+=String.fromCharCode.apply(null,r);r.length=0}}return a}Le=t();if(Le!==i&&Ne===e.length){return Le}else{if(Le!==i&&Ne<e.length){peg$fail({type:"end",description:"end of input"})}throw peg$buildException(null,Ge,ke)}}return{SyntaxError:SyntaxError,parse:parse}}()}};var r={};function __nccwpck_require__(i){var s=r[i];if(s!==undefined){return s.exports}var t=r[i]={exports:{}};var l=true;try{e[i](t,t.exports,__nccwpck_require__);l=false}finally{if(l)delete r[i]}return t.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(229);module.exports=i})();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Kyle Mathews
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"toml-loader","author":"Kyle Mathews <mathews.kyle@gmail.com>","version":"1.0.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
package/dist/cli/commands.d.ts
CHANGED
package/dist/cli/commands.js
CHANGED
|
@@ -34,7 +34,7 @@ __export(commands_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(commands_exports);
|
|
35
35
|
var import_path = require("path");
|
|
36
36
|
var import_shared = require("@rsbuild/shared");
|
|
37
|
-
var import_commander = require("
|
|
37
|
+
var import_commander = require("@rsbuild/shared/commander");
|
|
38
38
|
var import_loadEnv = require("../loadEnv");
|
|
39
39
|
var import_config = require("./config");
|
|
40
40
|
let commonOpts = {};
|
|
@@ -60,7 +60,7 @@ async function init({
|
|
|
60
60
|
};
|
|
61
61
|
if (commonOpts.open && !config.dev?.startUrl) {
|
|
62
62
|
config.dev || (config.dev = {});
|
|
63
|
-
config.dev.startUrl =
|
|
63
|
+
config.dev.startUrl = commonOpts.open;
|
|
64
64
|
}
|
|
65
65
|
if (commonOpts.host) {
|
|
66
66
|
config.server || (config.server = {});
|
|
@@ -83,8 +83,8 @@ async function init({
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
function runCli() {
|
|
86
|
-
import_commander.program.name("rsbuild").usage("<command> [options]").version("0.2.
|
|
87
|
-
import_commander.program.command("dev").option("--open", "open the page in browser on startup").option(
|
|
86
|
+
import_commander.program.name("rsbuild").usage("<command> [options]").version("0.2.14");
|
|
87
|
+
import_commander.program.command("dev").option("--open [url]", "open the page in browser on startup").option(
|
|
88
88
|
"--port <port>",
|
|
89
89
|
"specify a port number for Rsbuild Server to listen"
|
|
90
90
|
).option(
|
|
@@ -118,7 +118,7 @@ function runCli() {
|
|
|
118
118
|
process.exit(1);
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
-
import_commander.program.command("preview").option("--open", "open the page in browser on startup").option(
|
|
121
|
+
import_commander.program.command("preview").option("--open [url]", "open the page in browser on startup").option(
|
|
122
122
|
"--port <port>",
|
|
123
123
|
"specify a port number for Rsbuild Server to listen"
|
|
124
124
|
).option(
|
package/dist/cli/prepare.js
CHANGED
|
@@ -34,7 +34,7 @@ function prepareCli() {
|
|
|
34
34
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js")) {
|
|
35
35
|
console.log();
|
|
36
36
|
}
|
|
37
|
-
import_rslog.logger.greet(` ${`Rsbuild v${"0.2.
|
|
37
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"0.2.14"}`}
|
|
38
38
|
`);
|
|
39
39
|
}
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -31,13 +31,23 @@ __export(bundleAnalyzer_exports, {
|
|
|
31
31
|
pluginBundleAnalyzer: () => pluginBundleAnalyzer
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(bundleAnalyzer_exports);
|
|
34
|
+
var import_shared = require("@rsbuild/shared");
|
|
35
|
+
const isUseAnalyzer = (config) => process.env.BUNDLE_ANALYZE || config.performance?.bundleAnalyze;
|
|
34
36
|
function pluginBundleAnalyzer() {
|
|
35
37
|
return {
|
|
36
38
|
name: "rsbuild:bundle-analyzer",
|
|
37
39
|
setup(api) {
|
|
40
|
+
api.modifyRsbuildConfig((config) => {
|
|
41
|
+
if ((0, import_shared.isProd)() || !isUseAnalyzer(config)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
config.dev || (config.dev = {});
|
|
45
|
+
config.dev.writeToDisk = true;
|
|
46
|
+
return config;
|
|
47
|
+
});
|
|
38
48
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, target }) => {
|
|
39
49
|
const config = api.getNormalizedConfig();
|
|
40
|
-
if (!
|
|
50
|
+
if (!isUseAnalyzer(config)) {
|
|
41
51
|
return;
|
|
42
52
|
}
|
|
43
53
|
const { default: BundleAnalyzer } = await Promise.resolve().then(() => __toESM(require("@rsbuild/shared/webpack-bundle-analyzer")));
|
package/dist/plugins/toml.js
CHANGED
|
@@ -21,12 +21,12 @@ __export(toml_exports, {
|
|
|
21
21
|
pluginToml: () => pluginToml
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(toml_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_path = require("path");
|
|
25
25
|
const pluginToml = () => ({
|
|
26
26
|
name: "rsbuild:toml",
|
|
27
27
|
setup(api) {
|
|
28
28
|
api.modifyBundlerChain((chain, { CHAIN_ID }) => {
|
|
29
|
-
chain.module.rule(CHAIN_ID.RULE.TOML).type("javascript/auto").test(/\.toml$/).use(CHAIN_ID.USE.TOML).loader((0,
|
|
29
|
+
chain.module.rule(CHAIN_ID.RULE.TOML).type("javascript/auto").test(/\.toml$/).use(CHAIN_ID.USE.TOML).loader((0, import_path.join)(__dirname, "../../compiled", "toml-loader"));
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
});
|
|
@@ -59,7 +59,7 @@ function createContextByConfig(options, bundlerType, config = {}) {
|
|
|
59
59
|
const context = {
|
|
60
60
|
entry: config.source?.entry || getDefaultEntry(rootPath),
|
|
61
61
|
targets: config.output?.targets || [],
|
|
62
|
-
version: "0.2.
|
|
62
|
+
version: "0.2.14",
|
|
63
63
|
rootPath,
|
|
64
64
|
distPath,
|
|
65
65
|
cachePath,
|
|
@@ -68,7 +68,7 @@ async function applyBaseCSSRule({
|
|
|
68
68
|
},
|
|
69
69
|
options: config.tools.styleLoader
|
|
70
70
|
});
|
|
71
|
-
rule.use(CHAIN_ID.USE.STYLE).loader(
|
|
71
|
+
rule.use(CHAIN_ID.USE.STYLE).loader((0, import_shared.getSharedPkgCompiledPath)("style-loader")).options(styleLoaderOptions).end();
|
|
72
72
|
if (enableCSSModuleTS && cssLoaderOptions.modules) {
|
|
73
73
|
rule.use(CHAIN_ID.USE.CSS_MODULES_TS).loader(
|
|
74
74
|
(0, import_shared.resolvePackage)(
|
|
@@ -71,7 +71,7 @@ class HtmlAppIconPlugin {
|
|
|
71
71
|
compilation.hooks.processAssets.tap(
|
|
72
72
|
{
|
|
73
73
|
name: this.name,
|
|
74
|
-
stage:
|
|
74
|
+
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_PRE_PROCESS
|
|
75
75
|
},
|
|
76
76
|
(assets) => {
|
|
77
77
|
const source = import_fs.default.readFileSync(this.iconPath);
|
|
@@ -163,7 +163,7 @@ class InlineChunkHtmlPlugin {
|
|
|
163
163
|
* Remove marked inline assets in summarize stage,
|
|
164
164
|
* which should be later than the emitting of html-webpack-plugin
|
|
165
165
|
*/
|
|
166
|
-
stage:
|
|
166
|
+
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
167
167
|
},
|
|
168
168
|
() => {
|
|
169
169
|
const { devtool } = compiler.options;
|
|
@@ -21,7 +21,6 @@ __export(RemoveCssSourcemapPlugin_exports, {
|
|
|
21
21
|
RemoveCssSourcemapPlugin: () => RemoveCssSourcemapPlugin
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(RemoveCssSourcemapPlugin_exports);
|
|
24
|
-
var import_shared = require("@rsbuild/shared");
|
|
25
24
|
class RemoveCssSourcemapPlugin {
|
|
26
25
|
constructor() {
|
|
27
26
|
this.name = "RemoveCssSourcemapPlugin";
|
|
@@ -31,7 +30,7 @@ class RemoveCssSourcemapPlugin {
|
|
|
31
30
|
compilation.hooks.processAssets.tap(
|
|
32
31
|
{
|
|
33
32
|
name: this.name,
|
|
34
|
-
stage:
|
|
33
|
+
stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
35
34
|
},
|
|
36
35
|
() => {
|
|
37
36
|
Object.keys(compilation.assets).forEach((name) => {
|
package/dist/server/devServer.js
CHANGED
|
@@ -135,7 +135,7 @@ async function startDevServer(options, createDevMiddleware, {
|
|
|
135
135
|
(0, import_shared.debug)("create dev server done");
|
|
136
136
|
const protocol = https ? "https" : "http";
|
|
137
137
|
let urls = (0, import_shared.getAddressUrls)(protocol, port, host);
|
|
138
|
-
if (printURLs) {
|
|
138
|
+
if (printURLs && devServerConfig.printUrls !== false) {
|
|
139
139
|
if ((0, import_shared.isFunction)(printURLs)) {
|
|
140
140
|
urls = printURLs(urls);
|
|
141
141
|
if (!Array.isArray(urls)) {
|
package/dist/server/helper.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare const getDevOptions: ({ rsbuildConfig, getPortSilently, }: {
|
|
|
54
54
|
historyApiFallback?: boolean | import("@rsbuild/shared").HistoryApiFallbackOptions | undefined;
|
|
55
55
|
proxy?: import("@rsbuild/shared").ProxyOptions | undefined;
|
|
56
56
|
strictPort?: boolean | undefined;
|
|
57
|
+
printUrls?: boolean | undefined;
|
|
57
58
|
};
|
|
58
59
|
port: number;
|
|
59
60
|
host: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestHandler as Middleware
|
|
1
|
+
import { type HtmlFallback, type RequestHandler as Middleware } from '@rsbuild/shared';
|
|
2
2
|
export declare const faviconFallbackMiddleware: Middleware;
|
|
3
3
|
export declare const notFoundMiddleware: Middleware;
|
|
4
4
|
export declare const getHtmlFallbackMiddleware: (params: {
|
|
@@ -60,7 +60,15 @@ const getHtmlFallbackMiddleware = ({ htmlFallback, distPath, callback }) => {
|
|
|
60
60
|
return next();
|
|
61
61
|
}
|
|
62
62
|
const { url } = req;
|
|
63
|
-
|
|
63
|
+
let pathname = url;
|
|
64
|
+
try {
|
|
65
|
+
pathname = decodeURIComponent(url);
|
|
66
|
+
} catch (err) {
|
|
67
|
+
import_shared.logger.error(
|
|
68
|
+
new Error(`Invalid URL: ${import_shared.color.yellow(url)}`, { cause: err })
|
|
69
|
+
);
|
|
70
|
+
return next();
|
|
71
|
+
}
|
|
64
72
|
let outputFileSystem = import_fs.default;
|
|
65
73
|
if (res.locals.webpack) {
|
|
66
74
|
const { devMiddleware } = res.locals.webpack;
|
|
@@ -154,7 +154,7 @@ async function startProdServer(context, rsbuildConfig, { printURLs = true, getPo
|
|
|
154
154
|
routes
|
|
155
155
|
});
|
|
156
156
|
const urls = (0, import_shared.getAddressUrls)(https ? "https" : "http", port);
|
|
157
|
-
if (printURLs) {
|
|
157
|
+
if (printURLs && serverConfig.printUrls !== false) {
|
|
158
158
|
(0, import_helper.printServerURLs)(
|
|
159
159
|
(0, import_shared.isFunction)(printURLs) ? printURLs(urls) : urls,
|
|
160
160
|
routes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Unleash the power of Rspack with the out-of-the-box build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"core-js": "~3.32.2",
|
|
61
61
|
"html-webpack-plugin": "npm:html-rspack-plugin@5.5.7",
|
|
62
62
|
"postcss": "8.4.31",
|
|
63
|
-
"@rsbuild/shared": "0.2.
|
|
63
|
+
"@rsbuild/shared": "0.2.14"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "16.x",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var t={81:t=>{"use strict";t.exports=require("child_process")},361:t=>{"use strict";t.exports=require("events")},147:t=>{"use strict";t.exports=require("fs")},17:t=>{"use strict";t.exports=require("path")},282:t=>{"use strict";t.exports=require("process")},275:(t,e,i)=>{const{Argument:n}=i(392);const{Command:s}=i(358);const{CommanderError:r,InvalidArgumentError:o}=i(882);const{Help:a}=i(571);const{Option:l}=i(155);e=t.exports=new s;e.program=e;e.Argument=n;e.Command=s;e.CommanderError=r;e.Help=a;e.InvalidArgumentError=o;e.InvalidOptionArgumentError=o;e.Option=l},392:(t,e,i)=>{const{InvalidArgumentError:n}=i(882);class Argument{constructor(t,e){this.description=e||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,e){if(e===this.defaultValue||!Array.isArray(e)){return[t]}return e.concat(t)}default(t,e){this.defaultValue=t;this.defaultValueDescription=e;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,e)=>{if(!this.argChoices.includes(t)){throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,e)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}e.Argument=Argument;e.humanReadableArgName=humanReadableArgName},358:(t,e,i)=>{const n=i(361).EventEmitter;const s=i(81);const r=i(17);const o=i(147);const a=i(282);const{Argument:l,humanReadableArgName:h}=i(392);const{CommanderError:u}=i(882);const{Help:c}=i(571);const{Option:p,splitOptionFlags:m,DualOptions:d}=i(155);const{suggestSimilar:f}=i(829);class Command extends n{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>a.stdout.write(t),writeErr:t=>a.stderr.write(t),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:undefined,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:undefined,outputError:(t,e)=>e(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,e,i){let n=e;let s=i;if(typeof n==="object"&&n!==null){s=n;n=null}s=s||{};const[,r,o]=t.match(/([^ ]+) *(.*)/);const a=this.createCommand(r);if(n){a.description(n);a._executableHandler=true}if(s.isDefault)this._defaultCommandName=a._name;a._hidden=!!(s.noHelp||s.hidden);a._executableFile=s.executableFile||null;if(o)a.arguments(o);this.commands.push(a);a.parent=this;a.copyInheritedSettings(this);if(n)return this;return a}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new c,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,e){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}e=e||{};if(e.isDefault)this._defaultCommandName=t._name;if(e.noHelp||e.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,e){return new l(t,e)}argument(t,e,i,n){const s=this.createArgument(t,e);if(typeof i==="function"){s.default(n).argParser(i)}else{s.default(i)}this.addArgument(s);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const e=this._args.slice(-1)[0];if(e&&e.variadic){throw new Error(`only the last argument can be variadic '${e.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,e){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=e||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,e){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(e)}else{this._lifeCycleHooks[t]=[e]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,e,i){if(this._exitCallback){this._exitCallback(new u(t,e,i))}a.exit(t)}action(t){const listener=e=>{const i=this._args.length;const n=e.slice(0,i);if(this._storeOptionsAsProperties){n[i]=this}else{n[i]=this.opts()}n.push(this);return t.apply(this,n)};this._actionHandler=listener;return this}createOption(t,e){return new p(t,e)}addOption(t){const e=t.name();const i=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");if(!this._findOption(e)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(e,n,s)=>{if(e==null&&t.presetArg!==undefined){e=t.presetArg}const r=this.getOptionValue(i);if(e!==null&&t.parseArg){try{e=t.parseArg(e,r)}catch(t){if(t.code==="commander.invalidArgument"){const e=`${n} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}}else if(e!==null&&t.variadic){e=t._concatValue(e,r)}if(e==null){if(t.negate){e=false}else if(t.isBoolean()||t.optional){e=true}else{e=""}}this.setOptionValueWithSource(i,e,s)};this.on("option:"+e,(e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;handleOptionValue(e,i,"cli")}));if(t.envVar){this.on("optionEnv:"+e,(e=>{const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;handleOptionValue(e,i,"env")}))}return this}_optionEx(t,e,i,n,s){if(typeof e==="object"&&e instanceof p){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const r=this.createOption(e,i);r.makeOptionMandatory(!!t.mandatory);if(typeof n==="function"){r.default(s).argParser(n)}else if(n instanceof RegExp){const t=n;n=(e,i)=>{const n=t.exec(e);return n?n[0]:i};r.default(s).argParser(n)}else{r.default(n)}return this.addOption(r)}option(t,e,i,n){return this._optionEx({},t,e,i,n)}requiredOption(t,e,i,n){return this._optionEx({mandatory:true},t,e,i,n)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,undefined)}setOptionValueWithSource(t,e,i){if(this._storeOptionsAsProperties){this[t]=e}else{this._optionValues[t]=e}this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;getCommandAndParents(this).forEach((i=>{if(i.getOptionValueSource(t)!==undefined){e=i.getOptionValueSource(t)}}));return e}_prepareUserArgs(t,e){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}e=e||{};if(t===undefined){t=a.argv;if(a.versions&&a.versions.electron){e.from="electron"}}this.rawArgs=t.slice();let i;switch(e.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(a.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,e){const i=this._prepareUserArgs(t,e);this._parseCommand([],i);return this}async parseAsync(t,e){const i=this._prepareUserArgs(t,e);await this._parseCommand([],i);return this}_executeSubCommand(t,e){e=e.slice();let i=false;const n=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,e){const i=r.resolve(t,e);if(o.existsSync(i))return i;if(n.includes(r.extname(e)))return undefined;const s=n.find((t=>o.existsSync(`${i}${t}`)));if(s)return`${i}${s}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let l=t._executableFile||`${this._name}-${t._name}`;let h=this._executableDir||"";if(this._scriptPath){let t;try{t=o.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}h=r.resolve(r.dirname(t),h)}if(h){let e=findFile(h,l);if(!e&&!t._executableFile&&this._scriptPath){const i=r.basename(this._scriptPath,r.extname(this._scriptPath));if(i!==this._name){e=findFile(h,`${i}-${t._name}`)}}l=e||l}i=n.includes(r.extname(l));let c;if(a.platform!=="win32"){if(i){e.unshift(l);e=incrementNodeInspectorPort(a.execArgv).concat(e);c=s.spawn(a.argv[0],e,{stdio:"inherit"})}else{c=s.spawn(l,e,{stdio:"inherit"})}}else{e.unshift(l);e=incrementNodeInspectorPort(a.execArgv).concat(e);c=s.spawn(a.execPath,e,{stdio:"inherit"})}if(!c.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{a.on(t,(()=>{if(c.killed===false&&c.exitCode===null){c.kill(t)}}))}))}const p=this._exitCallback;if(!p){c.on("close",a.exit.bind(a))}else{c.on("close",(()=>{p(new u(a.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}c.on("error",(e=>{if(e.code==="ENOENT"){const e=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${l}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e}`;throw new Error(i)}else if(e.code==="EACCES"){throw new Error(`'${l}' not executable`)}if(!p){a.exit(1)}else{const t=new u(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e;p(t)}}));this.runningCommand=c}_dispatchSubcommand(t,e,i){const n=this._findCommand(t);if(!n)this.help({error:true});let s;s=this._chainOrCallSubCommandHook(s,n,"preSubcommand");s=this._chainOrCall(s,(()=>{if(n._executableHandler){this._executeSubCommand(n,e.concat(i))}else{return n._parseCommand(e,i)}}));return s}_checkNumberOfArguments(){this._args.forEach(((t,e)=>{if(t.required&&this.args[e]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,e,i)=>{let n=e;if(e!==null&&t.parseArg){try{n=t.parseArg(e,i)}catch(i){if(i.code==="commander.invalidArgument"){const n=`error: command-argument value '${e}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(n,{exitCode:i.exitCode,code:i.code})}throw i}}return n};this._checkNumberOfArguments();const t=[];this._args.forEach(((e,i)=>{let n=e.defaultValue;if(e.variadic){if(i<this.args.length){n=this.args.slice(i);if(e.parseArg){n=n.reduce(((t,i)=>myParseArg(e,i,t)),e.defaultValue)}}else if(n===undefined){n=[]}}else if(i<this.args.length){n=this.args[i];if(e.parseArg){n=myParseArg(e,n,e.defaultValue)}}t[i]=n}));this.processedArgs=t}_chainOrCall(t,e){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>e()))}return e()}_chainOrCallHooks(t,e){let i=t;const n=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[e]!==undefined)).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{n.push({hookedCommand:t,callback:e})}))}));if(e==="postAction"){n.reverse()}n.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_chainOrCallSubCommandHook(t,e,i){let n=t;if(this._lifeCycleHooks[i]!==undefined){this._lifeCycleHooks[i].forEach((t=>{n=this._chainOrCall(n,(()=>t(this,e)))}))}return n}_parseCommand(t,e){const i=this.parseOptions(e);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(i.operands);e=i.unknown;this.args=t.concat(e);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),e)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,e);return this._dispatchSubcommand(this._defaultCommandName,t,e)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const n=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(n,t,e)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(n)){checkForUnknownOptions();this._processArguments();this.parent.emit(n,t,e)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,e)}if(this.listenerCount("command:*")){this.emit("command:*",t,e)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((e=>{if(e.mandatory&&t.getOptionValue(e.attributeName())===undefined){t.missingMandatoryOptionValue(e)}}))}}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();if(this.getOptionValue(e)===undefined){return false}return this.getOptionValueSource(e)!=="default"}));const e=t.filter((t=>t.conflictsWith.length>0));e.forEach((e=>{const i=t.find((t=>e.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(e,i)}}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent){t._checkForConflictingLocalOptions()}}parseOptions(t){const e=[];const i=[];let n=e;const s=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let r=null;while(s.length){const t=s.shift();if(t==="--"){if(n===i)n.push(t);n.push(...s);break}if(r&&!maybeOption(t)){this.emit(`option:${r.name()}`,t);continue}r=null;if(maybeOption(t)){const e=this._findOption(t);if(e){if(e.required){const t=s.shift();if(t===undefined)this.optionMissingArgument(e);this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;if(s.length>0&&!maybeOption(s[0])){t=s.shift()}this.emit(`option:${e.name()}`,t)}else{this.emit(`option:${e.name()}`)}r=e.variadic?e:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const e=this._findOption(`-${t[1]}`);if(e){if(e.required||e.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${e.name()}`,t.slice(2))}else{this.emit(`option:${e.name()}`);s.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("=");const i=this._findOption(t.slice(0,e));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(e+1));continue}}if(maybeOption(t)){n=i}if((this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&i.length===0){if(this._findCommand(t)){e.push(t);if(s.length>0)i.push(...s);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){e.push(t);if(s.length>0)e.push(...s);break}else if(this._defaultCommandName){i.push(t);if(s.length>0)i.push(...s);break}}if(this._passThroughOptions){n.push(t);if(s.length>0)n.push(...s);break}n.push(t)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const e=this.options.length;for(let i=0;i<e;i++){const e=this.options[i].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,e)=>Object.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=e||{};const n=i.exitCode||1;const s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in a.env){const e=t.attributeName();if(this.getOptionValue(e)===undefined||["default","config","env"].includes(this.getOptionValueSource(e))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,a.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new d(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((e=>e.implied!==undefined&&hasCustomOptionValue(e.attributeName())&&t.valueFromOption(this.getOptionValue(e.attributeName()),e))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const findBestOptionFromValue=t=>{const e=t.attributeName();const i=this.getOptionValue(e);const n=this.options.find((t=>t.negate&&e===t.attributeName()));const s=this.options.find((t=>!t.negate&&e===t.attributeName()));if(n&&(n.presetArg===undefined&&i===false||n.presetArg!==undefined&&i===n.presetArg)){return n}return s||t};const getErrorMessage=t=>{const e=findBestOptionFromValue(t);const i=e.attributeName();const n=this.getOptionValueSource(i);if(n==="env"){return`environment variable '${e.envVar}'`}return`option '${e.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(e)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let n=this;do{const t=n.createHelp().visibleOptions(n).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);n=n.parent}while(n&&!n._enablePositionalOptions);e=f(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this._args.length;const i=e===1?"":"s";const n=this.parent?` for '${this.name()}'`:"";const s=`error: too many arguments${n}. Expected ${e} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));e=f(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(t===undefined)return this._version;this._version=t;e=e||"-V, --version";i=i||"output the version number";const n=this.createOption(e,i);this._versionOptionName=n.attributeName();this.options.push(n);this.on("option:"+n.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,e){if(t===undefined&&e===undefined)return this._description;this._description=t;if(e){this._argsDescription=e}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){e=this.commands[this.commands.length-1]}if(t===e._name)throw new Error("Command alias can't be the same as its name");e._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>h(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=r.basename(t,r.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const e=this.createHelp();if(e.helpWidth===undefined){e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return e.formatHelp(this,e)}_getHelpContext(t){t=t||{};const e={error:!!t.error};let i;if(e.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}e.write=t.write||i;e.command=this;return e}outputHelp(t){let e;if(typeof t==="function"){e=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let n=this.helpInformation(i);if(e){n=e(n);if(typeof n!=="string"&&!Buffer.isBuffer(n)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(n);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,e){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=e||this._helpDescription;const i=m(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let e=a.exitCode||0;if(e===0&&t&&typeof t!=="function"&&t.error){e=1}this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const n=`${t}Help`;this.on(n,(t=>{let i;if(typeof e==="function"){i=e({error:t.error,command:t.command})}else{i=e}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,e){const i=t._hasHelpOption&&e.find((e=>e===t._helpLongFlag||e===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let e;let i="127.0.0.1";let n="9229";let s;if((s=t.match(/^(--inspect(-brk)?)$/))!==null){e=s[1]}else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){e=s[1];if(/^\d+$/.test(s[3])){n=s[3]}else{i=s[3]}}else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){e=s[1];i=s[3];n=s[4]}if(e&&n!=="0"){return`${e}=${i}:${parseInt(n)+1}`}return t}))}function getCommandAndParents(t){const e=[];for(let i=t;i;i=i.parent){e.push(i)}return e}e.Command=Command},882:(t,e)=>{class CommanderError extends Error{constructor(t,e,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=e;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}e.CommanderError=CommanderError;e.InvalidArgumentError=InvalidArgumentError},571:(t,e,i)=>{const{humanReadableArgName:n}=i(392);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,n]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const s=t.createCommand(i).helpOption(false);s.description(t._helpCommandDescription);if(n)s.arguments(n);e.push(s)}if(this.sortSubcommands){e.sort(((t,e)=>t.name().localeCompare(e.name())))}return e}compareOptions(t,e){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return getSortKey(t).localeCompare(getSortKey(e))}visibleOptions(t){const e=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const n=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||n){let s;if(!i){s=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!n){s=t.createOption(t._helpShortFlag,t._helpDescription)}else{s=t.createOption(t._helpFlags,t._helpDescription)}e.push(s)}if(this.sortOptions){e.sort(this.compareOptions)}return e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const e=[];for(let i=t.parent;i;i=i.parent){const t=i.options.filter((t=>!t.hidden));e.push(...t)}if(this.sortOptions){e.sort(this.compareOptions)}return e}visibleArguments(t){if(t._argsDescription){t._args.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const e=t._args.map((t=>n(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,i)=>Math.max(t,e.subcommandTerm(i).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,i)=>Math.max(t,e.argumentTerm(i).length)),0)}commandUsage(t){let e=t._name;if(t._aliases[0]){e=e+"|"+t._aliases[0]}let i="";for(let e=t.parent;e;e=e.parent){i=e.name()+" "+i}return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];if(t.argChoices){e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){e.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){e.push(`env: ${t.envVar}`)}if(e.length>0){return`${t.description} (${e.join(", ")})`}return t.description}argumentDescription(t){const e=[];if(t.argChoices){e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(e.length>0){const i=`(${e.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,e){const i=e.padWidth(t,e);const n=e.helpWidth||80;const s=2;const r=2;function formatItem(t,o){if(o){const a=`${t.padEnd(i+r)}${o}`;return e.wrap(a,n-s,i+r)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(s))}let o=[`Usage: ${e.commandUsage(t)}`,""];const a=e.commandDescription(t);if(a.length>0){o=o.concat([e.wrap(a,n,0),""])}const l=e.visibleArguments(t).map((t=>formatItem(e.argumentTerm(t),e.argumentDescription(t))));if(l.length>0){o=o.concat(["Arguments:",formatList(l),""])}const h=e.visibleOptions(t).map((t=>formatItem(e.optionTerm(t),e.optionDescription(t))));if(h.length>0){o=o.concat(["Options:",formatList(h),""])}if(this.showGlobalOptions){const i=e.visibleGlobalOptions(t).map((t=>formatItem(e.optionTerm(t),e.optionDescription(t))));if(i.length>0){o=o.concat(["Global Options:",formatList(i),""])}}const u=e.visibleCommands(t).map((t=>formatItem(e.subcommandTerm(t),e.subcommandDescription(t))));if(u.length>0){o=o.concat(["Commands:",formatList(u),""])}return o.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,i,n=40){const s=" \\f\\t\\v - \ufeff";const r=new RegExp(`[\\n][${s}]+`);if(t.match(r))return t;const o=e-i;if(o<n)return t;const a=t.slice(0,i);const l=t.slice(i).replace("\r\n","\n");const h=" ".repeat(i);const u="";const c=`\\s${u}`;const p=new RegExp(`\n|.{1,${o-1}}([${c}]|$)|[^${c}]+?([${c}]|$)`,"g");const m=l.match(p)||[];return a+m.map(((t,e)=>{if(t==="\n")return"";return(e>0?h:"")+t.trimEnd()})).join("\n")}}e.Help=Help},155:(t,e,i)=>{const{InvalidArgumentError:n}=i(882);class Option{constructor(t,e){this.flags=t;this.description=e||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,e){this.defaultValue=t;this.defaultValueDescription=e;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){let e=t;if(typeof t==="string"){e={[t]:true}}this.implied=Object.assign(this.implied||{},e);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,e){if(e===this.defaultValue||!Array.isArray(e)){return[t]}return e.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,e)=>{if(!this.argChoices.includes(t)){throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,e)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,e)=>{if(this.positiveOptions.has(e)){this.dualOptions.add(e)}}))}valueFromOption(t,e){const i=e.attributeName();if(!this.dualOptions.has(i))return true;const n=this.negativeOptions.get(i).presetArg;const s=n!==undefined?n:false;return e.negate===(s===t)}}function camelcase(t){return t.split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}function splitOptionFlags(t){let e;let i;const n=t.split(/[ |,]+/);if(n.length>1&&!/^[[<]/.test(n[1]))e=n.shift();i=n.shift();if(!e&&/^-[^-]$/.test(i)){e=i;i=undefined}return{shortFlag:e,longFlag:i}}e.Option=Option;e.splitOptionFlags=splitOptionFlags;e.DualOptions=DualOptions},829:(t,e)=>{const i=3;function editDistance(t,e){if(Math.abs(t.length-e.length)>i)return Math.max(t.length,e.length);const n=[];for(let e=0;e<=t.length;e++){n[e]=[e]}for(let t=0;t<=e.length;t++){n[0][t]=t}for(let i=1;i<=e.length;i++){for(let s=1;s<=t.length;s++){let r=1;if(t[s-1]===e[i-1]){r=0}else{r=1}n[s][i]=Math.min(n[s-1][i]+1,n[s][i-1]+1,n[s-1][i-1]+r);if(s>1&&i>1&&t[s-1]===e[i-2]&&t[s-2]===e[i-1]){n[s][i]=Math.min(n[s][i],n[s-2][i-2]+1)}}}return n[t.length][e.length]}function suggestSimilar(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));const n=t.startsWith("--");if(n){t=t.slice(2);e=e.map((t=>t.slice(2)))}let s=[];let r=i;const o=.4;e.forEach((e=>{if(e.length<=1)return;const i=editDistance(t,e);const n=Math.max(t.length,e.length);const a=(n-i)/n;if(a>o){if(i<r){r=i;s=[e]}else if(i===r){s.push(e)}}}));s.sort(((t,e)=>t.localeCompare(e)));if(n){s=s.map((t=>`--${t}`))}if(s.length>1){return`\n(Did you mean one of ${s.join(", ")}?)`}if(s.length===1){return`\n(Did you mean ${s[0]}?)`}return""}e.suggestSimilar=suggestSimilar}};var e={};function __nccwpck_require__(i){var n=e[i];if(n!==undefined){return n.exports}var s=e[i]={exports:{}};var r=true;try{t[i](s,s.exports,__nccwpck_require__);r=false}finally{if(r)delete e[i]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(275);module.exports=i})();
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
(The MIT License)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
'Software'), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"commander","author":"TJ Holowaychuk <tj@vision-media.ca>","version":"10.0.1","license":"MIT","types":"typings/index.d.ts","type":"commonjs"}
|