@stacksjs/rpx 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -11789,7 +11789,7 @@ pluralize.addIrregularRule = (single, plural) => {
11789
11789
  /pox$/i,
11790
11790
  /sheep$/i
11791
11791
  ].forEach(pluralize.addUncountableRule);
11792
- var charMap = JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\u00FF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`);
11792
+ var charMap = JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`);
11793
11793
  var locales = JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');
11794
11794
  init_consola_36c0034f();
11795
11795
  init_core();
@@ -20461,11 +20461,11 @@ var quotes = collect([
20461
20461
  ]);
20462
20462
  var export_prompts = import_prompts.default;
20463
20463
  // package.json
20464
- var version = "0.4.0";
20464
+ var version = "0.5.0";
20465
20465
 
20466
20466
  // src/config.ts
20467
- import os2 from "os";
20468
- import path from "path";
20467
+ import { homedir } from "os";
20468
+ import { join as join2 } from "path";
20469
20469
 
20470
20470
  // node_modules/bun-config/dist/index.js
20471
20471
  import { resolve } from "path";
@@ -20517,24 +20517,27 @@ async function loadConfig({ name, cwd, defaultConfig }) {
20517
20517
  }
20518
20518
 
20519
20519
  // src/config.ts
20520
+ var defaultConfig = {
20521
+ from: "localhost:5173",
20522
+ to: "stacks.localhost",
20523
+ https: {
20524
+ basePath: "",
20525
+ caCertPath: join2(homedir(), ".stacks", "ssl", `stacks.localhost.ca.crt`),
20526
+ certPath: join2(homedir(), ".stacks", "ssl", `stacks.localhost.crt`),
20527
+ keyPath: join2(homedir(), ".stacks", "ssl", `stacks.localhost.crt.key`)
20528
+ },
20529
+ etcHostsCleanup: true,
20530
+ verbose: true
20531
+ };
20520
20532
  var config4 = await loadConfig({
20521
20533
  name: "reverse-proxy",
20522
- defaultConfig: {
20523
- from: "localhost:5173",
20524
- to: "stacks.localhost",
20525
- https: {
20526
- caCertPath: path.join(os2.homedir(), ".stacks", "ssl", `stacks.localhost.ca.crt`),
20527
- certPath: path.join(os2.homedir(), ".stacks", "ssl", `stacks.localhost.crt`),
20528
- keyPath: path.join(os2.homedir(), ".stacks", "ssl", `stacks.localhost.crt.key`)
20529
- },
20530
- etcHostsCleanup: true,
20531
- verbose: true
20532
- }
20534
+ defaultConfig
20533
20535
  });
20534
20536
 
20535
20537
  // src/https.ts
20536
- import os5 from "os";
20537
- import path4 from "path";
20538
+ import fs3 from "fs/promises";
20539
+ import { homedir as homedir2 } from "os";
20540
+ import { join as join4 } from "path";
20538
20541
 
20539
20542
  // node_modules/@stacksjs/tlsx/dist/index.js
20540
20543
  import fs2 from "fs";
@@ -20558,7 +20561,7 @@ import {
20558
20561
  dirname as dirname3,
20559
20562
  extname as extname2,
20560
20563
  isAbsolute as isAbsolute2,
20561
- join as join2,
20564
+ join as join3,
20562
20565
  normalize as normalize2,
20563
20566
  parse as parse2,
20564
20567
  relative as relative2,
@@ -20573,7 +20576,7 @@ import process8 from "process";
20573
20576
  import process102 from "process";
20574
20577
  import process182 from "process";
20575
20578
  import process112 from "process";
20576
- import os3 from "os";
20579
+ import os2 from "os";
20577
20580
  import tty32 from "tty";
20578
20581
  import process142 from "process";
20579
20582
  import process132 from "process";
@@ -20582,11 +20585,11 @@ import process162 from "process";
20582
20585
  import process172 from "process";
20583
20586
  import process192 from "process";
20584
20587
  import os22 from "os";
20585
- import path2 from "path";
20588
+ import path from "path";
20586
20589
  import { resolve as resolve3 } from "path";
20587
20590
  import process22 from "process";
20588
20591
  import fs from "fs";
20589
- import path22 from "path";
20592
+ import path2 from "path";
20590
20593
  var __create3 = Object.create;
20591
20594
  var __getProtoOf3 = Object.getPrototypeOf;
20592
20595
  var __defProp3 = Object.defineProperty;
@@ -48038,7 +48041,7 @@ pluralize2.addIrregularRule = (single, plural) => {
48038
48041
  /pox$/i,
48039
48042
  /sheep$/i
48040
48043
  ].forEach(pluralize2.addUncountableRule);
48041
- var charMap2 = JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\u00FF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`);
48044
+ var charMap2 = JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`);
48042
48045
  var locales2 = JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');
48043
48046
  init_consola_36c0034f2();
48044
48047
  init_core2();
@@ -48110,29 +48113,29 @@ var log2 = {
48110
48113
  },
48111
48114
  echo: (...args) => console.log(...args)
48112
48115
  };
48113
- function userDatabasePath2(path23) {
48114
- return projectPath2(`database/${path23 || ""}`);
48116
+ function userDatabasePath2(path22) {
48117
+ return projectPath2(`database/${path22 || ""}`);
48115
48118
  }
48116
- function appPath2(path23) {
48117
- return projectPath2(`app/${path23 || ""}`);
48119
+ function appPath2(path22) {
48120
+ return projectPath2(`app/${path22 || ""}`);
48118
48121
  }
48119
- function commandsPath2(path23) {
48120
- return appPath2(`Commands/${path23 || ""}`);
48122
+ function commandsPath2(path22) {
48123
+ return appPath2(`Commands/${path22 || ""}`);
48121
48124
  }
48122
- function logsPath2(path23) {
48123
- return storagePath2(`logs/${path23 || ""}`);
48125
+ function logsPath2(path22) {
48126
+ return storagePath2(`logs/${path22 || ""}`);
48124
48127
  }
48125
48128
  function projectPath2(filePath = "", options2) {
48126
- let path23 = process52.cwd();
48127
- while (path23.includes("storage"))
48128
- path23 = resolve22(path23, "..");
48129
- const finalPath = resolve22(path23, filePath);
48129
+ let path22 = process52.cwd();
48130
+ while (path22.includes("storage"))
48131
+ path22 = resolve22(path22, "..");
48132
+ const finalPath = resolve22(path22, filePath);
48130
48133
  if (options2?.relative)
48131
48134
  return relative2(process52.cwd(), finalPath);
48132
48135
  return finalPath;
48133
48136
  }
48134
- function storagePath2(path23) {
48135
- return projectPath2(`storage/${path23 || ""}`);
48137
+ function storagePath2(path22) {
48138
+ return projectPath2(`storage/${path22 || ""}`);
48136
48139
  }
48137
48140
  var config6 = {
48138
48141
  ai: {
@@ -54219,7 +54222,7 @@ function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
54219
54222
  return min;
54220
54223
  }
54221
54224
  if (process112.platform === "win32") {
54222
- const osRelease = os3.release().split(".");
54225
+ const osRelease = os2.release().split(".");
54223
54226
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
54224
54227
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
54225
54228
  }
@@ -56793,35 +56796,37 @@ function deepMerge2(target, source) {
56793
56796
  function isObject32(item) {
56794
56797
  return Boolean(item && typeof item === "object" && !Array.isArray(item));
56795
56798
  }
56796
- async function loadConfig2({ name, cwd, defaultConfig }) {
56799
+ async function loadConfig2({ name, cwd, defaultConfig: defaultConfig2 }) {
56797
56800
  const configPath = resolve3(cwd || process22.cwd(), `${name}.config`);
56798
56801
  try {
56799
56802
  const importedConfig = await import(configPath);
56800
56803
  const loadedConfig = importedConfig.default || importedConfig;
56801
- return deepMerge2(defaultConfig, loadedConfig);
56804
+ return deepMerge2(defaultConfig2, loadedConfig);
56802
56805
  } catch (error) {
56803
- return defaultConfig;
56804
- }
56805
- }
56806
+ return defaultConfig2;
56807
+ }
56808
+ }
56809
+ var defaultConfig2 = {
56810
+ altNameIPs: ["127.0.0.1"],
56811
+ altNameURIs: ["localhost"],
56812
+ organizationName: "Local Development",
56813
+ countryName: "US",
56814
+ stateName: "California",
56815
+ localityName: "Playa Vista",
56816
+ commonName: "stacks.localhost",
56817
+ validityDays: 825,
56818
+ hostCertCN: "stacks.localhost",
56819
+ domain: "stacks.localhost",
56820
+ rootCA: { certificate: "", privateKey: "" },
56821
+ basePath: "",
56822
+ caCertPath: path.join(os22.homedir(), ".stacks", "ssl", `stacks.localhost.ca.crt`),
56823
+ certPath: path.join(os22.homedir(), ".stacks", "ssl", `stacks.localhost.crt`),
56824
+ keyPath: path.join(os22.homedir(), ".stacks", "ssl", `stacks.localhost.crt.key`),
56825
+ verbose: false
56826
+ };
56806
56827
  var config42 = await loadConfig2({
56807
56828
  name: "tls",
56808
- defaultConfig: {
56809
- altNameIPs: ["127.0.0.1"],
56810
- altNameURIs: ["localhost"],
56811
- organizationName: "Local Development",
56812
- countryName: "US",
56813
- stateName: "California",
56814
- localityName: "Playa Vista",
56815
- commonName: "stacks.localhost",
56816
- validityDays: 825,
56817
- hostCertCN: "stacks.localhost",
56818
- domain: "stacks.localhost",
56819
- rootCAObject: { certificate: "", privateKey: "" },
56820
- caCertPath: path2.join(os22.homedir(), ".stacks", "ssl", `stacks.localhost.ca.crt`),
56821
- certPath: path2.join(os22.homedir(), ".stacks", "ssl", `stacks.localhost.crt`),
56822
- keyPath: path2.join(os22.homedir(), ".stacks", "ssl", `stacks.localhost.crt.key`),
56823
- verbose: false
56824
- }
56829
+ defaultConfig: defaultConfig2
56825
56830
  });
56826
56831
  var import_node_forge = __toESM3(require_lib2(), 1);
56827
56832
  function makeNumberPositive(hexString) {
@@ -56837,7 +56842,7 @@ function findFoldersWithFile(rootDir, fileName) {
56837
56842
  try {
56838
56843
  const files = fs.readdirSync(dir);
56839
56844
  for (const file of files) {
56840
- const filePath = path22.join(dir, file);
56845
+ const filePath = path2.join(dir, file);
56841
56846
  const stats = fs.lstatSync(filePath);
56842
56847
  if (stats.isDirectory()) {
56843
56848
  search(filePath);
@@ -56955,12 +56960,12 @@ async function createRootCA(options22 = {}) {
56955
56960
  async function generateCertificate(options22) {
56956
56961
  debugLog("cert", "Generating new certificate", options22.verbose);
56957
56962
  debugLog("cert", `Options: ${JSON.stringify(options22)}`, options22.verbose);
56958
- if (!options22.rootCAObject?.certificate || !options22.rootCAObject?.privateKey) {
56963
+ if (!options22.rootCA?.certificate || !options22.rootCA?.privateKey) {
56959
56964
  throw new Error("Root CA certificate and private key are required");
56960
56965
  }
56961
- const caCert = import_node_forge2.pki.certificateFromPem(options22.rootCAObject.certificate);
56962
- const caKey = import_node_forge2.pki.privateKeyFromPem(options22.rootCAObject.privateKey);
56963
- debugLog("cert", "Generating 2048-bit RSA key pair for host certificate", options22?.verbose);
56966
+ const caCert = import_node_forge2.pki.certificateFromPem(options22.rootCA.certificate);
56967
+ const caKey = import_node_forge2.pki.privateKeyFromPem(options22.rootCA.privateKey);
56968
+ debugLog("cert", "Generating 2048-bit RSA key pair for host certificate", options22.verbose);
56964
56969
  const keySize = 2048;
56965
56970
  const { privateKey, publicKey } = import_node_forge2.pki.rsa.generateKeyPair(keySize);
56966
56971
  const attributes = options22.certificateAttributes || [
@@ -57033,8 +57038,8 @@ async function addCertToSystemTrustStoreAndSaveCert(cert, caCert, options22) {
57033
57038
  }
57034
57039
  function storeCertificate(cert, options22) {
57035
57040
  debugLog("storage", `Storing certificate and private key with options: ${JSON.stringify(options22)}`, options22?.verbose);
57036
- const certPath = options22?.certPath || config42.certPath;
57037
- const certKeyPath = options22?.keyPath || config42.keyPath;
57041
+ const certPath = path3.join(options22?.basePath || config42.basePath, options22?.certPath || config42.certPath);
57042
+ const certKeyPath = path3.join(options22?.basePath || config42.basePath, options22?.keyPath || config42.keyPath);
57038
57043
  debugLog("storage", `Certificate path: ${certPath}`, options22?.verbose);
57039
57044
  debugLog("storage", `Private key path: ${certKeyPath}`, options22?.verbose);
57040
57045
  const certDir = path3.dirname(certPath);
@@ -57056,7 +57061,7 @@ function storeCertificate(cert, options22) {
57056
57061
  }
57057
57062
  function storeCACertificate(caCert, options22) {
57058
57063
  debugLog("storage", "Storing CA certificate", options22?.verbose);
57059
- const caCertPath = options22?.caCertPath || config42.caCertPath;
57064
+ const caCertPath = path3.join(options22?.basePath || config42.basePath, options22?.caCertPath || config42.caCertPath);
57060
57065
  debugLog("storage", `CA certificate path: ${caCertPath}`, options22?.verbose);
57061
57066
  const caCertDir = path3.dirname(caCertPath);
57062
57067
  if (!fs2.existsSync(caCertDir)) {
@@ -57078,114 +57083,172 @@ function debugLog2(category, message, verbose) {
57078
57083
  console.debug(`[rpx:${category}] ${message}`);
57079
57084
  }
57080
57085
  }
57081
- function extractDomains(options3) {
57082
- if (isMultiProxyConfig(options3)) {
57086
+ function extractHostname(options3) {
57087
+ if (isMultiProxyOptions(options3)) {
57083
57088
  return options3.proxies.map((proxy) => {
57084
- const domain2 = proxy.to || "stacks.localhost";
57085
- return domain2.startsWith("http") ? new URL(domain2).hostname : domain2;
57089
+ const domain = proxy.to || "stacks.localhost";
57090
+ return domain.startsWith("http") ? new URL(domain).hostname : domain;
57086
57091
  });
57087
57092
  }
57088
- const domain = options3.to || "stacks.localhost";
57089
- return [domain.startsWith("http") ? new URL(domain).hostname : domain];
57093
+ if (isSingleProxyOptions(options3)) {
57094
+ const domain = options3.to || "stacks.localhost";
57095
+ return [domain.startsWith("http") ? new URL(domain).hostname : domain];
57096
+ }
57097
+ return ["stacks.localhost"];
57098
+ }
57099
+ function isValidRootCA(value) {
57100
+ return typeof value === "object" && value !== null && "certificate" in value && "privateKey" in value && typeof value.certificate === "string" && typeof value.privateKey === "string";
57090
57101
  }
57091
57102
 
57092
57103
  // src/https.ts
57093
57104
  var cachedSSLConfig = null;
57094
57105
  function isMultiProxyConfig(options3) {
57095
- return "proxies" in options3;
57106
+ return "proxies" in options3 && Array.isArray(options3.proxies);
57107
+ }
57108
+ function isMultiProxyOptions(options3) {
57109
+ return "proxies" in options3 && Array.isArray(options3.proxies);
57110
+ }
57111
+ function isSingleProxyOptions(options3) {
57112
+ return "to" in options3 && typeof options3.to === "string";
57113
+ }
57114
+ function resolveSSLPaths(options3, defaultConfig3) {
57115
+ const domain = isMultiProxyConfig(options3) ? options3.proxies[0].to || "stacks.localhost" : options3.to || "stacks.localhost";
57116
+ if (typeof options3.https === "object" && typeof defaultConfig3.https === "object") {
57117
+ const hasAllPaths = options3.https.caCertPath && options3.https.certPath && options3.https.keyPath;
57118
+ if (hasAllPaths) {
57119
+ const baseConfig = httpsConfig({
57120
+ ...options3,
57121
+ to: domain,
57122
+ https: defaultConfig3.https
57123
+ });
57124
+ const altNameIPs = options3.https.altNameIPs?.filter((ip) => ip !== undefined) || baseConfig.altNameIPs;
57125
+ const altNameURIs = options3.https.altNameURIs?.filter((uri) => uri !== undefined) || baseConfig.altNameURIs;
57126
+ return {
57127
+ ...baseConfig,
57128
+ caCertPath: options3.https.caCertPath || baseConfig.caCertPath,
57129
+ certPath: options3.https.certPath || baseConfig.certPath,
57130
+ keyPath: options3.https.keyPath || baseConfig.keyPath,
57131
+ basePath: options3.https.basePath || baseConfig.basePath,
57132
+ commonName: options3.https.commonName || baseConfig.commonName,
57133
+ organizationName: options3.https.organizationName || baseConfig.organizationName,
57134
+ countryName: options3.https.countryName || baseConfig.countryName,
57135
+ stateName: options3.https.stateName || baseConfig.stateName,
57136
+ localityName: options3.https.localityName || baseConfig.localityName,
57137
+ validityDays: options3.https.validityDays || baseConfig.validityDays,
57138
+ altNameIPs,
57139
+ altNameURIs,
57140
+ verbose: options3.verbose || baseConfig.verbose
57141
+ };
57142
+ }
57143
+ }
57144
+ return httpsConfig({
57145
+ ...options3,
57146
+ to: domain
57147
+ });
57096
57148
  }
57097
57149
  function generateWildcardPatterns(domain) {
57098
57150
  const patterns = new Set;
57099
57151
  patterns.add(domain);
57100
57152
  const parts = domain.split(".");
57101
- if (parts.length >= 2) {
57153
+ if (parts.length >= 2)
57102
57154
  patterns.add(`*.${parts.slice(1).join(".")}`);
57103
- }
57104
57155
  return Array.from(patterns);
57105
57156
  }
57106
- function generateBaseConfig(options3, verbose) {
57107
- const domains = extractDomains(options3);
57108
- const sslBase = path4.join(os5.homedir(), ".stacks", "ssl");
57109
- const httpsConfig = options3.https === true ? {
57110
- caCertPath: path4.join(sslBase, "rpx-ca.crt"),
57111
- certPath: path4.join(sslBase, "rpx.crt"),
57112
- keyPath: path4.join(sslBase, "rpx.key")
57113
- } : typeof config4.https === "object" ? {
57114
- ...options3.https,
57115
- ...config4.https
57116
- } : {};
57117
- debugLog2("ssl", `Extracted domains: ${domains.join(", ")}`, verbose);
57118
- debugLog2("ssl", `Using SSL base path: ${sslBase}`, verbose);
57119
- debugLog2("ssl", `Using HTTPS config: ${JSON.stringify(httpsConfig)}`, verbose);
57120
- const allPatterns = new Set;
57121
- domains.forEach((domain) => {
57122
- allPatterns.add(domain);
57123
- generateWildcardPatterns(domain).forEach((pattern) => allPatterns.add(pattern));
57124
- });
57125
- allPatterns.add("localhost");
57126
- allPatterns.add("*.localhost");
57127
- const uniqueDomains = Array.from(allPatterns);
57128
- debugLog2("ssl", `Generated domain patterns: ${uniqueDomains.join(", ")}`, verbose);
57157
+ function getPrimaryDomain(options3) {
57158
+ if (!options3)
57159
+ return "stacks.localhost";
57160
+ if (isMultiProxyOptions(options3) && options3.proxies.length > 0)
57161
+ return options3.proxies[0].to || "stacks.localhost";
57162
+ if (isSingleProxyOptions(options3))
57163
+ return options3.to || "stacks.localhost";
57164
+ return "stacks.localhost";
57165
+ }
57166
+ function generateSSLPaths(options3) {
57167
+ const domain = getPrimaryDomain(options3);
57168
+ let basePath = "";
57169
+ if (typeof options3?.https === "object") {
57170
+ basePath = options3.https.basePath || "";
57171
+ return {
57172
+ caCertPath: options3.https.caCertPath || join4(basePath, `${domain}.ca.crt`),
57173
+ certPath: options3.https.certPath || join4(basePath, `${domain}.crt`),
57174
+ keyPath: options3.https.keyPath || join4(basePath, `${domain}.key`)
57175
+ };
57176
+ }
57177
+ const sslBase = basePath || join4(homedir2(), ".stacks", "ssl");
57178
+ const sanitizedDomain = domain.replace(/\*/g, "wildcard");
57129
57179
  return {
57130
- domain: domains[0],
57131
- hostCertCN: domains[0],
57132
- caCertPath: httpsConfig?.caCertPath ?? path4.join(sslBase, "rpx-ca.crt"),
57133
- certPath: httpsConfig?.certPath ?? path4.join(sslBase, "rpx.crt"),
57134
- keyPath: httpsConfig?.keyPath ?? path4.join(sslBase, "rpx.key"),
57135
- altNameIPs: httpsConfig?.altNameIPs ?? ["127.0.0.1", "::1"],
57136
- altNameURIs: httpsConfig?.altNameURIs ?? [],
57137
- commonName: httpsConfig?.commonName ?? domains[0],
57138
- organizationName: httpsConfig?.organizationName ?? "Local Development",
57139
- countryName: httpsConfig?.countryName ?? "US",
57140
- stateName: httpsConfig?.stateName ?? "California",
57141
- localityName: httpsConfig?.localityName ?? "Playa Vista",
57142
- validityDays: httpsConfig?.validityDays ?? 825,
57143
- verbose: verbose ?? false,
57144
- subjectAltNames: uniqueDomains.map((domain) => ({
57145
- type: 2,
57146
- value: domain
57147
- }))
57180
+ caCertPath: join4(sslBase, `${sanitizedDomain}.ca.crt`),
57181
+ certPath: join4(sslBase, `${sanitizedDomain}.crt`),
57182
+ keyPath: join4(sslBase, `${sanitizedDomain}.key`)
57148
57183
  };
57149
57184
  }
57150
- function generateRootCAConfig() {
57151
- const sslBase = path4.join(os5.homedir(), ".stacks", "ssl");
57152
- return {
57153
- domain: "stacks.localhost",
57154
- hostCertCN: "stacks.localhost",
57155
- caCertPath: path4.join(sslBase, "rpx-root-ca.crt"),
57156
- certPath: path4.join(sslBase, "rpx-certificate.crt"),
57157
- keyPath: path4.join(sslBase, "rpx-certificate.key"),
57158
- altNameIPs: ["127.0.0.1", "::1"],
57159
- altNameURIs: [],
57160
- organizationName: "Stacks Local Development",
57161
- countryName: "US",
57162
- stateName: "California",
57163
- localityName: "Playa Vista",
57164
- commonName: "stacks.localhost",
57165
- validityDays: 3650,
57166
- verbose: true
57167
- };
57185
+ function getAllDomains(options3) {
57186
+ const domains = new Set;
57187
+ if (isMultiProxyOptions(options3)) {
57188
+ options3.proxies.forEach((proxy) => {
57189
+ const domain = proxy.to || "stacks.localhost";
57190
+ generateWildcardPatterns(domain).forEach((pattern) => domains.add(pattern));
57191
+ });
57192
+ } else if (isSingleProxyOptions(options3)) {
57193
+ const domain = options3.to || "stacks.localhost";
57194
+ generateWildcardPatterns(domain).forEach((pattern) => domains.add(pattern));
57195
+ } else {
57196
+ domains.add("stacks.localhost");
57197
+ }
57198
+ domains.add("localhost");
57199
+ domains.add("*.localhost");
57200
+ return domains;
57168
57201
  }
57169
- function httpsConfig(options3) {
57170
- return generateBaseConfig(options3, options3.verbose);
57202
+ async function loadSSLConfig(options3) {
57203
+ debugLog2("ssl", `Loading SSL configuration`, options3.verbose);
57204
+ const mergedOptions = {
57205
+ ...config4,
57206
+ ...options3
57207
+ };
57208
+ options3.https = httpsConfig(mergedOptions);
57209
+ if (!options3.https?.keyPath && !options3.https?.certPath) {
57210
+ debugLog2("ssl", "No SSL configuration provided", options3.verbose);
57211
+ return null;
57212
+ }
57213
+ if (options3.https?.keyPath && !options3.https?.certPath || !options3.https?.keyPath && options3.https?.certPath) {
57214
+ const missing = !options3.https?.keyPath ? "keyPath" : "certPath";
57215
+ debugLog2("ssl", `Invalid SSL configuration - missing ${missing}`, options3.verbose);
57216
+ throw new Error(`SSL Configuration requires both keyPath and certPath. Missing: ${missing}`);
57217
+ }
57218
+ try {
57219
+ if (!options3.https?.keyPath || !options3.https?.certPath)
57220
+ return null;
57221
+ try {
57222
+ debugLog2("ssl", "Reading SSL certificate files", options3.verbose);
57223
+ const key = await fs3.readFile(options3.https?.keyPath, "utf8");
57224
+ const cert = await fs3.readFile(options3.https?.certPath, "utf8");
57225
+ debugLog2("ssl", "SSL configuration loaded successfully", options3.verbose);
57226
+ return { key, cert };
57227
+ } catch (error) {
57228
+ debugLog2("ssl", `Failed to read certificates: ${error}`, options3.verbose);
57229
+ return null;
57230
+ }
57231
+ } catch (err3) {
57232
+ debugLog2("ssl", `SSL configuration error: ${err3}`, options3.verbose);
57233
+ throw err3;
57234
+ }
57171
57235
  }
57172
57236
  async function generateCertificate2(options3) {
57173
57237
  if (cachedSSLConfig) {
57174
- const verbose2 = isMultiProxyConfig(options3) ? options3.verbose : options3.verbose;
57175
- debugLog2("ssl", "Using cached SSL configuration", verbose2);
57238
+ debugLog2("ssl", "Using cached SSL configuration", options3.verbose);
57176
57239
  return;
57177
57240
  }
57178
- const domains = isMultiProxyConfig(options3) ? [options3.proxies[0].to, ...options3.proxies.map((proxy) => proxy.to)] : [options3.to];
57179
- const verbose = isMultiProxyConfig(options3) ? options3.verbose : options3.verbose;
57180
- debugLog2("ssl", `Generating certificate for domains: ${domains.join(", ")}`, verbose);
57181
- const rootCAConfig = generateRootCAConfig();
57241
+ const domains = isMultiProxyOptions(options3) ? options3.proxies.map((proxy) => proxy.to) : [options3.to];
57242
+ debugLog2("ssl", `Generating certificate for domains: ${domains.join(", ")}`, options3.verbose);
57243
+ const rootCAConfig = httpsConfig(options3, options3.verbose);
57182
57244
  log.info("Generating Root CA certificate...");
57183
57245
  const caCert = await createRootCA(rootCAConfig);
57184
- const hostConfig = generateBaseConfig(options3, verbose);
57246
+ const hostConfig = httpsConfig(options3, options3.verbose);
57247
+ console.log("hostConfig", hostConfig);
57185
57248
  log.info(`Generating host certificate for: ${domains.join(", ")}`);
57186
57249
  const hostCert = await generateCertificate({
57187
57250
  ...hostConfig,
57188
- rootCAObject: {
57251
+ rootCA: {
57189
57252
  certificate: caCert.certificate,
57190
57253
  privateKey: caCert.privateKey
57191
57254
  }
@@ -57197,14 +57260,88 @@ async function generateCertificate2(options3) {
57197
57260
  ca: caCert.certificate
57198
57261
  };
57199
57262
  log.success(`Certificate generated successfully for ${domains.length} domain${domains.length > 1 ? "s" : ""}`);
57200
- debugLog2("ssl", `Certificate includes domains: ${domains.join(", ")}`, verbose);
57263
+ debugLog2("ssl", `Certificate includes domains: ${domains.join(", ")}`, options3.verbose);
57201
57264
  }
57202
57265
  function getSSLConfig() {
57203
57266
  return cachedSSLConfig;
57204
57267
  }
57268
+ async function checkExistingCertificates(options3) {
57269
+ const name = getPrimaryDomain(options3);
57270
+ const paths = generateSSLPaths(options3);
57271
+ try {
57272
+ debugLog2("ssl", `Checking certificates for ${name} at paths:`, options3?.verbose);
57273
+ debugLog2("ssl", `CA: ${paths.caCertPath}`, options3?.verbose);
57274
+ debugLog2("ssl", `Cert: ${paths.certPath}`, options3?.verbose);
57275
+ debugLog2("ssl", `Key: ${paths.keyPath}`, options3?.verbose);
57276
+ const key = await fs3.readFile(paths.keyPath, "utf8");
57277
+ const cert = await fs3.readFile(paths.certPath, "utf8");
57278
+ let ca;
57279
+ if (paths.caCertPath) {
57280
+ try {
57281
+ ca = await fs3.readFile(paths.caCertPath, "utf8");
57282
+ } catch (err3) {
57283
+ debugLog2("ssl", `Failed to read CA cert: ${err3}`, options3?.verbose);
57284
+ }
57285
+ }
57286
+ return { key, cert, ca };
57287
+ } catch (err3) {
57288
+ debugLog2("ssl", `Failed to read certificates: ${err3}`, options3?.verbose);
57289
+ return null;
57290
+ }
57291
+ }
57292
+ function httpsConfig(options3, verbose) {
57293
+ const primaryDomain = getPrimaryDomain(options3);
57294
+ debugLog2("ssl", `Primary domain: ${primaryDomain}`, verbose);
57295
+ const defaultPaths = generateSSLPaths(options3);
57296
+ if (typeof options3.https === "object") {
57297
+ const config5 = {
57298
+ domain: primaryDomain,
57299
+ hostCertCN: primaryDomain,
57300
+ basePath: options3.https.basePath || "",
57301
+ caCertPath: options3.https.caCertPath || defaultPaths.caCertPath,
57302
+ certPath: options3.https.certPath || defaultPaths.certPath,
57303
+ keyPath: options3.https.keyPath || defaultPaths.keyPath,
57304
+ altNameIPs: ["127.0.0.1", "::1"],
57305
+ altNameURIs: [],
57306
+ commonName: options3.https.commonName || primaryDomain,
57307
+ organizationName: options3.https.organizationName || "Local Development",
57308
+ countryName: options3.https.countryName || "US",
57309
+ stateName: options3.https.stateName || "California",
57310
+ localityName: options3.https.localityName || "Playa Vista",
57311
+ validityDays: options3.https.validityDays || 825,
57312
+ verbose: verbose || false,
57313
+ subjectAltNames: Array.from(getAllDomains(options3)).map((domain) => ({
57314
+ type: 2,
57315
+ value: domain
57316
+ }))
57317
+ };
57318
+ if (isValidRootCA(options3.https.rootCA)) {
57319
+ config5.rootCA = options3.https.rootCA;
57320
+ }
57321
+ return config5;
57322
+ }
57323
+ return {
57324
+ domain: primaryDomain,
57325
+ hostCertCN: primaryDomain,
57326
+ basePath: "",
57327
+ ...defaultPaths,
57328
+ altNameIPs: ["127.0.0.1", "::1"],
57329
+ altNameURIs: [],
57330
+ commonName: primaryDomain,
57331
+ organizationName: "Local Development",
57332
+ countryName: "US",
57333
+ stateName: "California",
57334
+ localityName: "Playa Vista",
57335
+ validityDays: 825,
57336
+ verbose: verbose || false,
57337
+ subjectAltNames: Array.from(getAllDomains(options3)).map((domain) => ({
57338
+ type: 2,
57339
+ value: domain
57340
+ }))
57341
+ };
57342
+ }
57205
57343
 
57206
57344
  // src/start.ts
57207
- import * as fs5 from "fs";
57208
57345
  import * as http from "http";
57209
57346
  import * as https from "https";
57210
57347
  import * as net from "net";
@@ -57212,29 +57349,29 @@ import process9 from "process";
57212
57349
 
57213
57350
  // src/hosts.ts
57214
57351
  import { spawn } from "child_process";
57215
- import fs3 from "fs";
57216
- import os7 from "os";
57217
- import path6 from "path";
57352
+ import fs5 from "fs";
57353
+ import os3 from "os";
57354
+ import path4 from "path";
57218
57355
  import process3 from "process";
57219
- var hostsFilePath = process3.platform === "win32" ? path6.join(process3.env.windir || "C:\\Windows", "System32", "drivers", "etc", "hosts") : "/etc/hosts";
57356
+ var hostsFilePath = process3.platform === "win32" ? path4.join(process3.env.windir || "C:\\Windows", "System32", "drivers", "etc", "hosts") : "/etc/hosts";
57220
57357
  async function sudoWrite(operation, content) {
57221
57358
  return new Promise((resolve4, reject) => {
57222
57359
  if (process3.platform === "win32") {
57223
57360
  reject(new Error("Administrator privileges required on Windows"));
57224
57361
  return;
57225
57362
  }
57226
- const tmpFile = path6.join(os7.tmpdir(), "hosts.tmp");
57363
+ const tmpFile = path4.join(os3.tmpdir(), "hosts.tmp");
57227
57364
  try {
57228
57365
  if (operation === "append") {
57229
- const currentContent = fs3.readFileSync(hostsFilePath, "utf8");
57230
- fs3.writeFileSync(tmpFile, currentContent + content, "utf8");
57366
+ const currentContent = fs5.readFileSync(hostsFilePath, "utf8");
57367
+ fs5.writeFileSync(tmpFile, currentContent + content, "utf8");
57231
57368
  } else {
57232
- fs3.writeFileSync(tmpFile, content, "utf8");
57369
+ fs5.writeFileSync(tmpFile, content, "utf8");
57233
57370
  }
57234
57371
  const sudo = spawn("sudo", ["cp", tmpFile, hostsFilePath]);
57235
57372
  sudo.on("close", (code) => {
57236
57373
  try {
57237
- fs3.unlinkSync(tmpFile);
57374
+ fs5.unlinkSync(tmpFile);
57238
57375
  if (code === 0)
57239
57376
  resolve4();
57240
57377
  else
@@ -57245,7 +57382,7 @@ async function sudoWrite(operation, content) {
57245
57382
  });
57246
57383
  sudo.on("error", (err3) => {
57247
57384
  try {
57248
- fs3.unlinkSync(tmpFile);
57385
+ fs5.unlinkSync(tmpFile);
57249
57386
  } catch {
57250
57387
  }
57251
57388
  reject(err3);
@@ -57259,7 +57396,7 @@ async function addHosts(hosts, verbose) {
57259
57396
  debugLog2("hosts", `Adding hosts: ${hosts.join(", ")}`, verbose);
57260
57397
  debugLog2("hosts", `Using hosts file at: ${hostsFilePath}`, verbose);
57261
57398
  try {
57262
- const existingContent = await fs3.promises.readFile(hostsFilePath, "utf-8");
57399
+ const existingContent = await fs5.promises.readFile(hostsFilePath, "utf-8");
57263
57400
  const newEntries = hosts.filter((host) => {
57264
57401
  const ipv4Entry = `127.0.0.1 ${host}`;
57265
57402
  const ipv6Entry = `::1 ${host}`;
@@ -57276,7 +57413,7 @@ async function addHosts(hosts, verbose) {
57276
57413
  ::1 ${host}`).join(`
57277
57414
  `);
57278
57415
  try {
57279
- await fs3.promises.appendFile(hostsFilePath, hostEntries, { flag: "a" });
57416
+ await fs5.promises.appendFile(hostsFilePath, hostEntries, { flag: "a" });
57280
57417
  log.success(`Added new hosts: ${newEntries.join(", ")}`);
57281
57418
  } catch (writeErr) {
57282
57419
  if (writeErr.code === "EACCES") {
@@ -57314,7 +57451,7 @@ On Unix systems:`);
57314
57451
  async function removeHosts(hosts, verbose) {
57315
57452
  debugLog2("hosts", `Removing hosts: ${hosts.join(", ")}`, verbose);
57316
57453
  try {
57317
- const content = await fs3.promises.readFile(hostsFilePath, "utf-8");
57454
+ const content = await fs5.promises.readFile(hostsFilePath, "utf-8");
57318
57455
  const lines = content.split(`
57319
57456
  `);
57320
57457
  const filteredLines = lines.filter((line, index) => {
@@ -57330,7 +57467,7 @@ async function removeHosts(hosts, verbose) {
57330
57467
  `)}
57331
57468
  `;
57332
57469
  try {
57333
- await fs3.promises.writeFile(hostsFilePath, newContent);
57470
+ await fs5.promises.writeFile(hostsFilePath, newContent);
57334
57471
  log.success("Hosts removed successfully");
57335
57472
  } catch (writeErr) {
57336
57473
  if (writeErr.code === "EACCES") {
@@ -57370,7 +57507,7 @@ On Unix systems:`);
57370
57507
  }
57371
57508
  async function checkHosts(hosts, verbose) {
57372
57509
  debugLog2("hosts", `Checking hosts: ${hosts}`, verbose);
57373
- const content = await fs3.promises.readFile(hostsFilePath, "utf-8");
57510
+ const content = await fs5.promises.readFile(hostsFilePath, "utf-8");
57374
57511
  return hosts.map((host) => {
57375
57512
  const ipv4Entry = `127.0.0.1 ${host}`;
57376
57513
  const ipv6Entry = `::1 ${host}`;
@@ -57424,39 +57561,6 @@ process9.on("uncaughtException", (err3) => {
57424
57561
  log.error("Uncaught exception:", err3);
57425
57562
  cleanup();
57426
57563
  });
57427
- async function loadSSLConfig(options3) {
57428
- debugLog2("ssl", `Loading SSL configuration`, options3.verbose);
57429
- if (options3.https === true)
57430
- options3.https = httpsConfig(options3);
57431
- else if (options3.https === false)
57432
- return null;
57433
- if (!options3.https?.keyPath && !options3.https?.certPath) {
57434
- debugLog2("ssl", "No SSL configuration provided", options3.verbose);
57435
- return null;
57436
- }
57437
- if (options3.https?.keyPath && !options3.https?.certPath || !options3.https?.keyPath && options3.https?.certPath) {
57438
- const missing = !options3.https?.keyPath ? "keyPath" : "certPath";
57439
- debugLog2("ssl", `Invalid SSL configuration - missing ${missing}`, options3.verbose);
57440
- throw new Error(`SSL Configuration requires both keyPath and certPath. Missing: ${missing}`);
57441
- }
57442
- try {
57443
- if (!options3.https?.keyPath || !options3.https?.certPath)
57444
- return null;
57445
- try {
57446
- debugLog2("ssl", "Reading SSL certificate files", options3.verbose);
57447
- const key = await fs5.promises.readFile(options3.https?.keyPath, "utf8");
57448
- const cert = await fs5.promises.readFile(options3.https?.certPath, "utf8");
57449
- debugLog2("ssl", "SSL configuration loaded successfully", options3.verbose);
57450
- return { key, cert };
57451
- } catch (error) {
57452
- debugLog2("ssl", `Failed to read certificates: ${error}`, options3.verbose);
57453
- return null;
57454
- }
57455
- } catch (err3) {
57456
- debugLog2("ssl", `SSL configuration error: ${err3}`, options3.verbose);
57457
- throw err3;
57458
- }
57459
- }
57460
57564
  function isPortInUse(port, hostname, verbose) {
57461
57565
  debugLog2("port", `Checking if port ${port} is in use on ${hostname}`, verbose);
57462
57566
  return new Promise((resolve4) => {
@@ -57512,8 +57616,8 @@ async function testConnection(hostname, port, verbose) {
57512
57616
  }
57513
57617
  async function startServer(options3) {
57514
57618
  debugLog2("server", `Starting server with options: ${JSON.stringify(options3)}`, options3.verbose);
57515
- const fromUrl = new URL(options3.from.startsWith("http") ? options3.from : `http://${options3.from}`);
57516
- const toUrl = new URL(options3.to.startsWith("http") ? options3.to : `http://${options3.to}`);
57619
+ const fromUrl = new URL((options3.from?.startsWith("http") ? options3.from : `http://${options3.from}`) || "localhost:5173");
57620
+ const toUrl = new URL((options3.to?.startsWith("http") ? options3.to : `http://${options3.to}`) || "stacks.localhost");
57517
57621
  const fromPort = Number.parseInt(fromUrl.port) || (fromUrl.protocol.includes("https:") ? 443 : 80);
57518
57622
  const hostsToCheck = [toUrl.hostname];
57519
57623
  if (!toUrl.hostname.includes("localhost") && !toUrl.hostname.includes("127.0.0.1")) {
@@ -57597,7 +57701,7 @@ async function startServer(options3) {
57597
57701
  debugLog2("server", `Setting up reverse proxy with SSL config for ${toUrl.hostname}`, options3.verbose);
57598
57702
  await setupReverseProxy({
57599
57703
  ...options3,
57600
- from: options3.from,
57704
+ from: options3.from || "localhost:5173",
57601
57705
  to: toUrl.hostname,
57602
57706
  fromPort,
57603
57707
  sourceUrl: {
@@ -57752,51 +57856,77 @@ function startHttpRedirectServer(verbose) {
57752
57856
  debugLog2("redirect", "HTTP redirect server started", verbose);
57753
57857
  }
57754
57858
  function startProxy(options3) {
57755
- debugLog2("proxy", `Starting proxy with options: ${JSON.stringify(options3)}`, options3?.verbose);
57859
+ const mergedOptions = {
57860
+ ...config4,
57861
+ ...options3
57862
+ };
57863
+ debugLog2("proxy", `Starting proxy with options: ${JSON.stringify(mergedOptions)}`, mergedOptions?.verbose);
57756
57864
  const serverOptions = {
57757
- from: options3?.from || "localhost:5173",
57758
- to: options3?.to || "stacks.localhost",
57759
- https: httpsConfig(options3),
57760
- etcHostsCleanup: options3?.etcHostsCleanup || false,
57761
- verbose: options3?.verbose || false
57865
+ from: mergedOptions.from,
57866
+ to: mergedOptions.to,
57867
+ https: httpsConfig(mergedOptions),
57868
+ etcHostsCleanup: mergedOptions.etcHostsCleanup,
57869
+ verbose: mergedOptions.verbose
57762
57870
  };
57763
57871
  console.log("serverOptions", serverOptions);
57764
57872
  startServer(serverOptions).catch((err3) => {
57765
- debugLog2("proxy", `Failed to start proxy: ${err3}`, options3.verbose);
57873
+ debugLog2("proxy", `Failed to start proxy: ${err3}`, mergedOptions.verbose);
57766
57874
  log.error(`Failed to start proxy: ${err3.message}`);
57767
57875
  cleanup({
57768
- domains: [options3.to],
57769
- etcHostsCleanup: options3.etcHostsCleanup,
57770
- verbose: options3.verbose
57876
+ domains: [mergedOptions.to],
57877
+ etcHostsCleanup: mergedOptions.etcHostsCleanup,
57878
+ verbose: mergedOptions.verbose
57771
57879
  });
57772
57880
  });
57773
57881
  }
57774
57882
  async function startProxies(options3) {
57775
- if (!options3)
57776
- return;
57777
- debugLog2("proxies", "Starting proxies setup", isMultiProxyConfig2(options3) ? options3.verbose : options3.verbose);
57778
- if (options3.https) {
57779
- await generateCertificate2(options3);
57883
+ debugLog2("proxies", "Starting proxy setup", options3?.verbose);
57884
+ const mergedOptions = {
57885
+ ...config4,
57886
+ ...options3
57887
+ };
57888
+ const primaryDomain = isMultiProxyConfig(mergedOptions) ? mergedOptions.proxies[0].to || "stacks.localhost" : mergedOptions.to || "stacks.localhost";
57889
+ if (mergedOptions.https) {
57890
+ const existingSSLConfig = await checkExistingCertificates(mergedOptions);
57891
+ if (existingSSLConfig) {
57892
+ debugLog2("ssl", `Using existing certificates for ${primaryDomain}`, mergedOptions.verbose);
57893
+ mergedOptions._cachedSSLConfig = existingSSLConfig;
57894
+ } else {
57895
+ debugLog2("ssl", `No valid certificates found for ${primaryDomain}, generating new ones`, mergedOptions.verbose);
57896
+ await generateCertificate2(mergedOptions);
57897
+ const sslConfig2 = await checkExistingCertificates(mergedOptions);
57898
+ if (!sslConfig2) {
57899
+ throw new Error(`Failed to load SSL certificates after generation for ${primaryDomain}. Please check file permissions and paths.`);
57900
+ }
57901
+ mergedOptions._cachedSSLConfig = sslConfig2;
57902
+ }
57780
57903
  }
57781
- const proxyOptions = isMultiProxyConfig2(options3) ? options3.proxies.map((proxy) => ({
57904
+ const proxyOptions = isMultiProxyConfig(mergedOptions) ? mergedOptions.proxies.map((proxy) => ({
57782
57905
  ...proxy,
57783
- https: options3.https,
57784
- etcHostsCleanup: options3.etcHostsCleanup,
57785
- verbose: options3.verbose,
57786
- _cachedSSLConfig: options3._cachedSSLConfig
57787
- })) : [options3];
57788
- const domains = extractDomains(options3);
57789
- const sslConfig = options3.https ? getSSLConfig() : null;
57906
+ https: mergedOptions.https,
57907
+ etcHostsCleanup: mergedOptions.etcHostsCleanup,
57908
+ verbose: mergedOptions.verbose,
57909
+ _cachedSSLConfig: mergedOptions._cachedSSLConfig
57910
+ })) : [{
57911
+ from: mergedOptions.from || "localhost:5173",
57912
+ to: mergedOptions.to || "stacks.localhost",
57913
+ https: mergedOptions.https,
57914
+ etcHostsCleanup: mergedOptions.etcHostsCleanup,
57915
+ verbose: mergedOptions.verbose,
57916
+ _cachedSSLConfig: mergedOptions._cachedSSLConfig
57917
+ }];
57918
+ const domains = proxyOptions.map((opt) => opt.to || "stacks.localhost");
57919
+ const sslConfig = mergedOptions._cachedSSLConfig;
57790
57920
  const cleanupHandler = () => cleanup({
57791
57921
  domains,
57792
- etcHostsCleanup: isMultiProxyConfig2(options3) ? options3.etcHostsCleanup : options3.etcHostsCleanup || false,
57793
- verbose: isMultiProxyConfig2(options3) ? options3.verbose : options3.verbose || false
57922
+ etcHostsCleanup: mergedOptions.etcHostsCleanup || false,
57923
+ verbose: mergedOptions.verbose || false
57794
57924
  });
57795
57925
  process9.on("SIGINT", cleanupHandler);
57796
57926
  process9.on("SIGTERM", cleanupHandler);
57797
57927
  process9.on("uncaughtException", (err3) => {
57798
57928
  debugLog2("process", `Uncaught exception: ${err3}`, true);
57799
- log.error("Uncaught exception:", err3);
57929
+ console.error("Uncaught exception:", err3);
57800
57930
  cleanupHandler();
57801
57931
  });
57802
57932
  for (const option of proxyOptions) {
@@ -57813,14 +57943,11 @@ async function startProxies(options3) {
57813
57943
  });
57814
57944
  } catch (err3) {
57815
57945
  debugLog2("proxies", `Failed to start proxy for ${option.to}: ${err3}`, option.verbose);
57816
- log.error(`Failed to start proxy for ${option.to}:`, err3);
57946
+ console.error(`Failed to start proxy for ${option.to}:`, err3);
57817
57947
  cleanupHandler();
57818
57948
  }
57819
57949
  }
57820
57950
  }
57821
- function isMultiProxyConfig2(options3) {
57822
- return "proxies" in options3;
57823
- }
57824
57951
 
57825
57952
  // bin/cli.ts
57826
57953
  var cli = new CAC("reverse-proxy");