hackmud-script-manager 0.18.0-b0e9141 → 0.19.0-0d87e53

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- import e from"@babel/traverse";import t from"@babel/types";import{v as i}from"../constants-9bb78688.js";import{getReferencePathsToGlobal as r}from"./shared.js";import{a as n}from"../assert-1556d989.js";function clearObject(e,t){for(const t of Object.getOwnPropertyNames(e))delete e[t];for(const t of Object.getOwnPropertySymbols(e))delete e[t];void 0!==t&&Object.setPrototypeOf(e,t)}const{default:o}=e,a=["Map","Set","Date","JSON","Math","Array","Error","isNaN","Number","Object","RegExp","String","Symbol","BigInt"];function transform(e,s,{uniqueID:p="00000000000",scriptUser:c="UNKNOWN",scriptName:l="UNKNOWN",seclevel:d=4}={}){const f=`_${p}_SCRIPT_`,b=new Map,y=new Map;let m;if(o(e,{Program(e){m=e,e.skip()}}),m.scope.hasGlobal("_SOURCE"))for(const e of r("_SOURCE",m))e.replaceWith(t.stringLiteral(s));if(m.scope.hasGlobal("_BUILD_DATE"))for(const e of r("_BUILD_DATE",m))e.replaceWith(t.numericLiteral(Date.now()));if(m.scope.hasGlobal("_SCRIPT_USER"))for(const e of r("_SCRIPT_USER",m))1==c?e.replaceWith(t.stringLiteral(`$${p}$SCRIPT_USER$`)):e.replaceWith(t.stringLiteral(c));if(m.scope.hasGlobal("_SCRIPT_NAME"))for(const e of r("_SCRIPT_NAME",m))1==l?e.replaceWith(t.stringLiteral(`$${p}$SCRIPT_NAME$`)):e.replaceWith(t.stringLiteral(l));if(m.scope.hasGlobal("_FULL_SCRIPT_NAME"))for(const e of r("_FULL_SCRIPT_NAME",m))1==c||1==l?e.replaceWith(t.stringLiteral(`$${p}$FULL_SCRIPT_NAME$`)):e.replaceWith(t.stringLiteral(`${c}.${l}`));let $=!1;if(m.scope.hasGlobal("Function")){const e=r("Function",m);if(1==e.length){const t=e[0];n("MemberExpression"==t.parent.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),n("Identifier"==t.parent.property.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),n("prototype"==t.parent.property.name,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),t.parentPath.replaceWith(createGetFunctionPrototypeNode())}else{for(const i of e)n("MemberExpression"==i.parent.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),n("Identifier"==i.parent.property.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),n("prototype"==i.parent.property.name,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),$=!0,i.parentPath.replaceWith(t.identifier(`_${p}_FUNCTION_DOT_PROTOTYPE_`));$=!0}}let h=4;for(const e of["$fs","$4s","$s"])m.scope.hasGlobal(e)&&processFakeSubscriptObject(e);for(const e of["$hs","$3s"])m.scope.hasGlobal(e)&&(h=3,processFakeSubscriptObject(e));for(const e of["$ms","$2s"])m.scope.hasGlobal(e)&&(h=2,processFakeSubscriptObject(e));for(const e of["$ls","$1s"])m.scope.hasGlobal(e)&&(h=1,processFakeSubscriptObject(e));for(const e of["$ns","$0s"])m.scope.hasGlobal(e)&&(h=0,processFakeSubscriptObject(e));if(d=Math.min(d,h),m.scope.hasGlobal("$db"))for(const e of r("$db",m)){var E;n("MemberExpression"==e.parentPath.node.type),n("Identifier"==e.parentPath.node.property.type);const r=e.parentPath.node.property.name;n(i.includes(r),`invalid db method "${r}", valid db methods are "${i.join('", "')}"`),"CallExpression"==(null===(E=e.parentPath.parentPath)||void 0===E?void 0:E.type)?e.parentPath.replaceWith(t.identifier(`$${p}$DB$${r}$`)):"ObjectId"==r?e.parentPath.replaceWith(t.arrowFunctionExpression([],t.callExpression(t.identifier(`$${p}$DB$${r}$`),[]))):"i"==r||"r"==r?e.parentPath.replaceWith(t.arrowFunctionExpression([t.identifier("a")],t.callExpression(t.identifier(`$${p}$DB$${r}$`),[t.identifier("a")]))):e.parentPath.replaceWith(t.arrowFunctionExpression([t.identifier("a"),t.identifier("b")],t.callExpression(t.identifier(`$${p}$DB$${r}$`),[t.identifier("a"),t.identifier("b")])))}if(m.scope.hasGlobal("$D"))for(const e of r("$D",m))"CallExpression"==e.parentPath.type?e.replaceWith(t.identifier(`$${p}$DEBUG$`)):e.replaceWith(t.arrowFunctionExpression([t.identifier("a")],t.callExpression(t.identifier(`$${p}$DEBUG$`),[t.identifier("a")])));if(m.scope.hasGlobal("$FMCL"))for(const e of r("$FMCL",m))e.replaceWith(t.identifier(`$${p}$FMCL$`));if(m.scope.hasGlobal("$G"))for(const e of r("$G",m))e.replaceWith(t.identifier(`$${p}$GLOBAL$`));if(m.scope.hasGlobal("_SECLEVEL"))for(const e of r("_SECLEVEL",m))e.replaceWith(t.numericLiteral(d));let _=!1,u=!1;if(m.scope.hasGlobal("Object"))for(const e of r("Object",m))"MemberExpression"!=e.parent.type||e.parent.computed||(n("Identifier"==e.parent.property.type),"getPrototypeOf"==e.parent.property.name?(e.parentPath.replaceWith(t.identifier(`_${p}_GET_PROTOTYPE_OF_`)),_=!0):"setPrototypeOf"==e.parent.property.name&&(e.parentPath.replaceWith(t.identifier(`_${p}_SET_PROTOTYPE_OF_`)),u=!0));const P=m.node.body[m.node.body.length-1];let O;if(n(P,"program is empty"),"ExportNamedDeclaration"==P.type){m.node.body.pop();for(const e of P.specifiers){n("ExportSpecifier"==e.type,`${e.type} is currently unsupported`);const t="Identifier"==e.exported.type?e.exported.name:e.exported.value;"default"==t?O=e.local.name:b.set(e.local.name,t)}}const x=t.blockStatement([]);let S;for(const e of m.node.body)if("VariableDeclaration"==e.type)for(const i of e.declarations)if("Identifier"!=i.id.type||i.id.name!=O||!i.init||"FunctionExpression"!=i.init.type&&"ArrowFunctionExpression"!=i.init.type||i.init.async||i.init.generator){for(const r in t.getBindingIdentifiers(i.id))r==O&&(S=t.functionDeclaration(t.identifier(f),[t.identifier("context"),t.identifier("args")],t.blockStatement([t.returnStatement(t.callExpression(t.identifier(O),[]))]))),"const"!=e.kind&&b.has(r)&&(y.set(r,b.get(r)),b.delete(r)),x.body.push(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(r))]));i.init&&x.body.push(t.expressionStatement(t.assignmentExpression("=",i.id,i.init)))}else S=t.functionDeclaration(t.identifier(f),i.init.params,"BlockStatement"==i.init.body.type?i.init.body:t.blockStatement([t.returnStatement(i.init.body)]));else"FunctionDeclaration"==e.type?e.id.name==O?S=e:x.body.push(t.variableDeclaration("let",[t.variableDeclarator(e.id,t.functionExpression(void 0,e.params,e.body,e.generator,e.async))])):x.body.push(e);if(S||(S=t.functionDeclaration(t.identifier(f),[t.identifier("context"),t.identifier("args")],t.blockStatement([]))),m.node.body=[S],x.body.length){(b.size||y.size)&&S.body.body.push(t.returnStatement(t.objectExpression([...[...b].map((([e,i])=>t.objectProperty(t.identifier(i),t.identifier(e)))),...[...y].map((([e,i])=>t.objectMethod("get",t.identifier(i),[],t.blockStatement([t.returnStatement(t.identifier(e))]))))]))),m.scope.crawl();const e=new Set;let i=0;for(const[r,o]of[...x.body.entries()].reverse())if("VariableDeclaration"==o.type){n(1==o.declarations.length);const a=o.declarations[0];if(n("Identifier"==a.id.type,`declarator.id.type was "${a.id.type}"`),m.scope.crawl(),m.scope.hasGlobal(a.id.name)){x.body.splice(r,1);const[s]=m.unshiftContainer("body",x),[c]=m.unshiftContainer("body",o);if(m.scope.crawl(),!a.init||"FunctionExpression"!=a.init.type&&"ArrowFunctionExpression"!=a.init.type||Object.keys(m.scope.globals).some((t=>e.has(t)))){const e=m.scope.getBinding(a.id.name);n(e);for(const i of e.referencePaths)n("Identifier"==i.node.type),i.replaceWith(t.memberExpression(t.identifier(`$${p}$GLOBAL$`),t.identifier(i.node.name)));for(const i of e.constantViolations)if("AssignmentExpression"==i.node.type)for(const[e,r]of Object.entries(t.getBindingIdentifiers(i.node)))e==a.id.name&&(clearObject(r),Object.assign(r,t.memberExpression(t.identifier(`$${p}$GLOBAL$`),t.identifier(e))));s.remove(),c.remove(),a.init&&x.body.splice(r,0,t.expressionStatement(t.assignmentExpression("=",t.memberExpression(t.identifier(`$${p}$GLOBAL$`),t.identifier(a.id.name)),a.init)))}else s.remove(),c.remove(),S.body.body.unshift(o),i++}else e.add(a.id.name)}else if("ClassDeclaration"==o.type&&(m.scope.crawl(),m.scope.hasGlobal(o.id.name))){x.body.splice(r,1);const[e]=m.unshiftContainer("body",x),[i]=m.unshiftContainer("body",o);m.scope.crawl();const a=m.scope.getBinding(o.id.name);n(a);for(const e of a.referencePaths)n("Identifier"==e.node.type),e.replaceWith(t.memberExpression(t.identifier(`$${p}$GLOBAL$`),t.identifier(e.node.name)));e.remove(),i.remove(),x.body.splice(r,0,t.expressionStatement(t.assignmentExpression("=",t.memberExpression(t.identifier(`$${p}$GLOBAL$`),t.identifier(o.id.name)),t.classExpression(void 0,o.superClass,o.body,o.decorators))))}if(m.scope.hasGlobal("_EXPORTS"))for(const e of r("_EXPORTS",m))e.replaceWith(t.arrayExpression([...b.keys(),...y.keys()].map((e=>t.stringLiteral(e)))));x.body.length&&S.body.body.splice(i,0,t.ifStatement(t.unaryExpression("!",t.identifier(`$${p}$FMCL$`)),x))}return $&&S.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_FUNCTION_DOT_PROTOTYPE_`),createGetFunctionPrototypeNode())])),u&&S.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_SET_PROTOTYPE_OF_`),t.callExpression(t.memberExpression(t.memberExpression(t.identifier("Object"),t.identifier("call")),t.identifier("bind")),[t.identifier(`_${p}_DUNDER_PROTO_SETTER_`)]))])),_&&S.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_GET_PROTOTYPE_OF_`),t.callExpression(t.memberExpression(t.memberExpression(t.identifier("Object"),t.identifier("call")),t.identifier("bind")),[t.identifier(`_${p}_DUNDER_PROTO_GETTER_`)]))])),(_||u)&&S.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.objectPattern(_?u?[t.objectProperty(t.identifier("get"),t.identifier(`_${p}_DUNDER_PROTO_GETTER_`)),t.objectProperty(t.identifier("set"),t.identifier(`_${p}_DUNDER_PROTO_SETTER_`))]:[t.objectProperty(t.identifier("get"),t.identifier(`_${p}_DUNDER_PROTO_GETTER_`))]:[t.objectProperty(t.identifier("set"),t.identifier(`_${p}_DUNDER_PROTO_SETTER_`))]),t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("getOwnPropertyDescriptor")),[t.memberExpression(t.identifier("Object"),t.identifier("prototype")),t.stringLiteral("__proto__")]))])),o(e,{BlockStatement({node:e}){for(const[i,r]of e.body.entries())"FunctionDeclaration"!=r.type||r.generator||(e.body.splice(i,1),e.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(r.id,t.arrowFunctionExpression(r.params,r.body,r.async))])))},ClassBody({node:e,scope:i,parent:r}){n(t.isClass(r));let a=!1;for(const r of e.body){if("ClassMethod"!=r.type)continue;let e=!1;if(o(r.body,{ThisExpression(i){e=!0,a=!0,i.replaceWith(t.identifier(`_${p}_THIS_`))},Function(e){e.skip()}},i),e)if("constructor"!=r.kind)r.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_THIS_`),t.callExpression(t.memberExpression(t.super(),t.identifier("valueOf")),[]))]));else{const e=[];if(o(r.body,{CallExpression(t){"Super"==t.node.callee.type&&e.push(t)}},i),e.length)if(1==e.length&&"ExpressionStatement"==e[0].parent.type&&e[0].parentPath.parentPath.parent==r)e[0].parentPath.replaceWith(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_THIS_`),e[0].node)]));else{for(const i of e)i.replaceWith(t.assignmentExpression("=",t.identifier(`_${p}_THIS_`),i.node));r.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_THIS_`))]))}else r.body.body.unshift(t.variableDeclaration("let",[t.variableDeclarator(t.identifier(`_${p}_THIS_`),t.callExpression(t.super(),[]))]))}}!r.superClass&&a&&(r.superClass=t.identifier("Object"))},VariableDeclaration({node:e}){"const"==e.kind&&(e.kind="let")},ThisExpression(e){e.replaceWith(t.identifier("undefined"))},BigIntLiteral(e){const i=Number(e.node.value);BigInt(i)==BigInt(e.node.value)?e.replaceWith(t.callExpression(t.identifier("BigInt"),[t.numericLiteral(i)])):e.replaceWith(t.callExpression(t.identifier("BigInt"),[t.stringLiteral(e.node.value)]))}}),{file:e,seclevel:d};function processFakeSubscriptObject(e){for(const a of r(e,m)){var i,o;n("MemberExpression"==a.parent.type),n("Identifier"==a.parent.property.type),n("MemberExpression"==(null===(i=a.parentPath.parentPath)||void 0===i?void 0:i.node.type)),n("Identifier"==a.parentPath.parentPath.node.property.type),n(/^[_a-z][\d_a-z]{0,24}$/.test(a.parent.property.name),`invalid user "${a.parent.property.name}" in subscript`),n(/^[_a-z][\d_a-z]{0,24}$/.test(a.parentPath.parentPath.node.property.name),`invalid script name "${a.parentPath.parentPath.node.property.name}" in subscript`),"CallExpression"==(null===(o=a.parentPath.parentPath.parentPath)||void 0===o?void 0:o.type)?a.parentPath.parentPath.replaceWith(t.identifier(`$${p}$SUBSCRIPT$${a.parent.property.name}$${a.parentPath.parentPath.node.property.name}$`)):a.parentPath.parentPath.replaceWith(t.arrowFunctionExpression([t.restElement(t.identifier("args"))],t.callExpression(t.identifier(`$${p}$SUBSCRIPT$${a.parent.property.name}$${a.parentPath.parentPath.node.property.name}$`),[t.spreadElement(t.identifier("args"))])))}}function createGetFunctionPrototypeNode(){for(const e of a)if(!m.scope.hasOwnBinding(e))return t.memberExpression(t.memberExpression(t.identifier(e),t.identifier("constructor")),t.identifier("prototype"));return t.memberExpression(t.memberExpression(t.arrowFunctionExpression([t.identifier("_")],t.identifier("_")),t.identifier("constructor")),t.identifier("prototype"))}}export{transform as default,transform};
1
+ import e from"@babel/traverse";import i from"@babel/types";import{assert as t}from"@samual/lib/assert";import{clearObject as r}from"@samual/lib/clearObject";import{validDBMethods as n}from"../constants.js";import{getReferencePathsToGlobal as o}from"./shared.js";const{default:a}=e,s=["Map","Set","Date","JSON","Math","Array","Error","isNaN","Number","Object","RegExp","String","Symbol","BigInt"],transform=(e,p,{uniqueID:l="00000000000",scriptUser:c="UNKNOWN",scriptName:d="UNKNOWN",seclevel:f=4}={})=>{const b=`_${l}_SCRIPT_`,y=new Map,m=new Map;let $;if(a(e,{Program(e){$=e,e.skip()}}),$.scope.hasGlobal("_SOURCE"))for(const e of o("_SOURCE",$))e.replaceWith(i.stringLiteral(p));if($.scope.hasGlobal("_BUILD_DATE"))for(const e of o("_BUILD_DATE",$))e.replaceWith(i.numericLiteral(Date.now()));if($.scope.hasGlobal("_SCRIPT_USER"))for(const e of o("_SCRIPT_USER",$))1==c?e.replaceWith(i.stringLiteral(`$${l}$SCRIPT_USER$`)):e.replaceWith(i.stringLiteral(c));if($.scope.hasGlobal("_SCRIPT_NAME"))for(const e of o("_SCRIPT_NAME",$))1==d?e.replaceWith(i.stringLiteral(`$${l}$SCRIPT_NAME$`)):e.replaceWith(i.stringLiteral(d));if($.scope.hasGlobal("_FULL_SCRIPT_NAME"))for(const e of o("_FULL_SCRIPT_NAME",$))1==c||1==d?e.replaceWith(i.stringLiteral(`$${l}$FULL_SCRIPT_NAME$`)):e.replaceWith(i.stringLiteral(`${c}.${d}`));let h=!1;const createGetFunctionPrototypeNode=()=>{for(const e of s)if(!$.scope.hasOwnBinding(e))return i.memberExpression(i.memberExpression(i.identifier(e),i.identifier("constructor")),i.identifier("prototype"));return i.memberExpression(i.memberExpression(i.arrowFunctionExpression([i.identifier("_")],i.identifier("_")),i.identifier("constructor")),i.identifier("prototype"))};if($.scope.hasGlobal("Function")){const e=o("Function",$);if(1==e.length){const i=e[0];t("MemberExpression"==i.parent.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),t("Identifier"==i.parent.property.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),t("prototype"==i.parent.property.name,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),i.parentPath.replaceWith(createGetFunctionPrototypeNode())}else{for(const r of e)t("MemberExpression"==r.parent.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),t("Identifier"==r.parent.property.type,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),t("prototype"==r.parent.property.name,"`Function` isn't available in hackmud, only `Function.prototype` is accessible"),h=!0,r.parentPath.replaceWith(i.identifier(`_${l}_FUNCTION_DOT_PROTOTYPE_`));h=!0}}let E=4;const processFakeSubscriptObject=e=>{for(const r of o(e,$))t("MemberExpression"==r.parent.type),t("Identifier"==r.parent.property.type),t("MemberExpression"==r.parentPath.parentPath?.node.type),t("Identifier"==r.parentPath.parentPath.node.property.type),t(/^[_a-z][\d_a-z]{0,24}$/.test(r.parent.property.name),`invalid user "${r.parent.property.name}" in subscript`),t(/^[_a-z][\d_a-z]{0,24}$/.test(r.parentPath.parentPath.node.property.name),`invalid script name "${r.parentPath.parentPath.node.property.name}" in subscript`),"CallExpression"==r.parentPath.parentPath.parentPath?.type?r.parentPath.parentPath.replaceWith(i.identifier(`$${l}$SUBSCRIPT$${r.parent.property.name}$${r.parentPath.parentPath.node.property.name}$`)):r.parentPath.parentPath.replaceWith(i.arrowFunctionExpression([i.restElement(i.identifier("args"))],i.callExpression(i.identifier(`$${l}$SUBSCRIPT$${r.parent.property.name}$${r.parentPath.parentPath.node.property.name}$`),[i.spreadElement(i.identifier("args"))])))};for(const e of["$fs","$4s","$s"])$.scope.hasGlobal(e)&&processFakeSubscriptObject(e);for(const e of["$hs","$3s"])$.scope.hasGlobal(e)&&(E=3,processFakeSubscriptObject(e));for(const e of["$ms","$2s"])$.scope.hasGlobal(e)&&(E=2,processFakeSubscriptObject(e));for(const e of["$ls","$1s"])$.scope.hasGlobal(e)&&(E=1,processFakeSubscriptObject(e));for(const e of["$ns","$0s"])$.scope.hasGlobal(e)&&(E=0,processFakeSubscriptObject(e));if(f=Math.min(f,E),$.scope.hasGlobal("$db"))for(const e of o("$db",$)){t("MemberExpression"==e.parentPath.node.type),t("Identifier"==e.parentPath.node.property.type);const r=e.parentPath.node.property.name;t(n.includes(r),`invalid db method "${r}", valid db methods are "${n.join('", "')}"`),"CallExpression"==e.parentPath.parentPath?.type?e.parentPath.replaceWith(i.identifier(`$${l}$DB$${r}$`)):"ObjectId"==r?e.parentPath.replaceWith(i.arrowFunctionExpression([],i.callExpression(i.identifier(`$${l}$DB$${r}$`),[]))):"i"==r||"r"==r?e.parentPath.replaceWith(i.arrowFunctionExpression([i.identifier("a")],i.callExpression(i.identifier(`$${l}$DB$${r}$`),[i.identifier("a")]))):e.parentPath.replaceWith(i.arrowFunctionExpression([i.identifier("a"),i.identifier("b")],i.callExpression(i.identifier(`$${l}$DB$${r}$`),[i.identifier("a"),i.identifier("b")])))}if($.scope.hasGlobal("$D"))for(const e of o("$D",$))"CallExpression"==e.parentPath.type?e.replaceWith(i.identifier(`$${l}$DEBUG$`)):e.replaceWith(i.arrowFunctionExpression([i.identifier("a")],i.callExpression(i.identifier(`$${l}$DEBUG$`),[i.identifier("a")])));if($.scope.hasGlobal("$FMCL"))for(const e of o("$FMCL",$))e.replaceWith(i.identifier(`$${l}$FMCL$`));if($.scope.hasGlobal("$G"))for(const e of o("$G",$))e.replaceWith(i.identifier(`$${l}$GLOBAL$`));if($.scope.hasGlobal("_SECLEVEL"))for(const e of o("_SECLEVEL",$))e.replaceWith(i.numericLiteral(f));let _=!1,u=!1;if($.scope.hasGlobal("Object"))for(const e of o("Object",$))"MemberExpression"!=e.parent.type||e.parent.computed||(t("Identifier"==e.parent.property.type),"getPrototypeOf"==e.parent.property.name?(e.parentPath.replaceWith(i.identifier(`_${l}_GET_PROTOTYPE_OF_`)),_=!0):"setPrototypeOf"==e.parent.property.name&&(e.parentPath.replaceWith(i.identifier(`_${l}_SET_PROTOTYPE_OF_`)),u=!0));const P=$.node.body.at(-1);let x;if(t(P,"program is empty"),"ExportNamedDeclaration"==P.type){$.node.body.pop();for(const e of P.specifiers){t("ExportSpecifier"==e.type,`${e.type} is currently unsupported`);const i="Identifier"==e.exported.type?e.exported.name:e.exported.value;"default"==i?x=e.local.name:y.set(e.local.name,i)}}const O=i.blockStatement([]);let D;for(const e of $.node.body)if("VariableDeclaration"==e.type)for(const t of e.declarations)if("Identifier"!=t.id.type||t.id.name!=x||!t.init||"FunctionExpression"!=t.init.type&&"ArrowFunctionExpression"!=t.init.type||t.init.async||t.init.generator){for(const r in i.getBindingIdentifiers(t.id))r==x&&(D=i.functionDeclaration(i.identifier(b),[i.identifier("context"),i.identifier("args")],i.blockStatement([i.returnStatement(i.callExpression(i.identifier(x),[]))]))),"const"!=e.kind&&y.has(r)&&(m.set(r,y.get(r)),y.delete(r)),O.body.push(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(r))]));t.init&&O.body.push(i.expressionStatement(i.assignmentExpression("=",t.id,t.init)))}else D=i.functionDeclaration(i.identifier(b),t.init.params,"BlockStatement"==t.init.body.type?t.init.body:i.blockStatement([i.returnStatement(t.init.body)]));else"FunctionDeclaration"==e.type?e.id.name==x?D=e:O.body.push(i.variableDeclaration("let",[i.variableDeclarator(e.id,i.functionExpression(void 0,e.params,e.body,e.generator,e.async))])):O.body.push(e);if(D||=i.functionDeclaration(i.identifier(b),[i.identifier("context"),i.identifier("args")],i.blockStatement([])),$.node.body=[D],O.body.length){(y.size||m.size)&&D.body.body.push(i.returnStatement(i.objectExpression([...[...y].map((([e,t])=>i.objectProperty(i.identifier(t),i.identifier(e)))),...[...m].map((([e,t])=>i.objectMethod("get",i.identifier(t),[],i.blockStatement([i.returnStatement(i.identifier(e))]))))]))),$.scope.crawl();const e=new Set;let n=0;for(const[o,a]of[...O.body.entries()].reverse())if("VariableDeclaration"==a.type){t(1==a.declarations.length);const s=a.declarations[0];if(t("Identifier"==s.id.type,`declarator.id.type was "${s.id.type}"`),$.scope.crawl(),$.scope.hasGlobal(s.id.name)){O.body.splice(o,1);const[p]=$.unshiftContainer("body",O),[c]=$.unshiftContainer("body",a);if($.scope.crawl(),!s.init||"FunctionExpression"!=s.init.type&&"ArrowFunctionExpression"!=s.init.type||Object.keys($.scope.globals).some((i=>e.has(i)))){const e=$.scope.getBinding(s.id.name);t(e);for(const r of e.referencePaths)t("Identifier"==r.node.type),r.replaceWith(i.memberExpression(i.identifier(`$${l}$GLOBAL$`),i.identifier(r.node.name)));for(const t of e.constantViolations)if("AssignmentExpression"==t.node.type)for(const[e,n]of Object.entries(i.getBindingIdentifiers(t.node)))e==s.id.name&&(r(n),Object.assign(n,i.memberExpression(i.identifier(`$${l}$GLOBAL$`),i.identifier(e))));p.remove(),c.remove(),s.init&&O.body.splice(o,0,i.expressionStatement(i.assignmentExpression("=",i.memberExpression(i.identifier(`$${l}$GLOBAL$`),i.identifier(s.id.name)),s.init)))}else p.remove(),c.remove(),D.body.body.unshift(a),n++}else e.add(s.id.name)}else if("ClassDeclaration"==a.type&&($.scope.crawl(),t(a.id,"src/processScript/transform.ts:564:37"),$.scope.hasGlobal(a.id.name))){O.body.splice(o,1);const[e]=$.unshiftContainer("body",O),[r]=$.unshiftContainer("body",a);$.scope.crawl();const n=$.scope.getBinding(a.id.name);t(n);for(const e of n.referencePaths)t("Identifier"==e.node.type),e.replaceWith(i.memberExpression(i.identifier(`$${l}$GLOBAL$`),i.identifier(e.node.name)));e.remove(),r.remove(),O.body.splice(o,0,i.expressionStatement(i.assignmentExpression("=",i.memberExpression(i.identifier(`$${l}$GLOBAL$`),i.identifier(a.id.name)),i.classExpression(void 0,a.superClass,a.body,a.decorators))))}if($.scope.hasGlobal("_EXPORTS"))for(const e of o("_EXPORTS",$))e.replaceWith(i.arrayExpression([...y.keys(),...m.keys()].map((e=>i.stringLiteral(e)))));O.body.length&&D.body.body.splice(n,0,i.ifStatement(i.unaryExpression("!",i.identifier(`$${l}$FMCL$`)),O))}return h&&D.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_FUNCTION_DOT_PROTOTYPE_`),createGetFunctionPrototypeNode())])),u&&D.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_SET_PROTOTYPE_OF_`),i.callExpression(i.memberExpression(i.memberExpression(i.identifier("Object"),i.identifier("call")),i.identifier("bind")),[i.identifier(`_${l}_DUNDER_PROTO_SETTER_`)]))])),_&&D.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_GET_PROTOTYPE_OF_`),i.callExpression(i.memberExpression(i.memberExpression(i.identifier("Object"),i.identifier("call")),i.identifier("bind")),[i.identifier(`_${l}_DUNDER_PROTO_GETTER_`)]))])),(_||u)&&D.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.objectPattern(_?u?[i.objectProperty(i.identifier("get"),i.identifier(`_${l}_DUNDER_PROTO_GETTER_`)),i.objectProperty(i.identifier("set"),i.identifier(`_${l}_DUNDER_PROTO_SETTER_`))]:[i.objectProperty(i.identifier("get"),i.identifier(`_${l}_DUNDER_PROTO_GETTER_`))]:[i.objectProperty(i.identifier("set"),i.identifier(`_${l}_DUNDER_PROTO_SETTER_`))]),i.callExpression(i.memberExpression(i.identifier("Object"),i.identifier("getOwnPropertyDescriptor")),[i.memberExpression(i.identifier("Object"),i.identifier("prototype")),i.stringLiteral("__proto__")]))])),a(e,{BlockStatement({node:e}){for(const[t,r]of e.body.entries())"FunctionDeclaration"!=r.type||r.generator||(e.body.splice(t,1),e.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(r.id,i.arrowFunctionExpression(r.params,r.body,r.async))])))},ClassBody({node:e,scope:r,parent:n}){t(i.isClass(n));let o=!1;for(const t of e.body){if("ClassMethod"!=t.type)continue;let e=!1;if(a(t.body,{ThisExpression(t){e=!0,o=!0,t.replaceWith(i.identifier(`_${l}_THIS_`))},Function(e){e.skip()}},r),e)if("constructor"!=t.kind)t.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_THIS_`),i.callExpression(i.memberExpression(i.super(),i.identifier("valueOf")),[]))]));else{const e=[];if(a(t.body,{CallExpression(i){"Super"==i.node.callee.type&&e.push(i)}},r),e.length)if(1==e.length&&"ExpressionStatement"==e[0].parent.type&&e[0].parentPath.parentPath.parent==t)e[0].parentPath.replaceWith(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_THIS_`),e[0].node)]));else{for(const t of e)t.replaceWith(i.assignmentExpression("=",i.identifier(`_${l}_THIS_`),t.node));t.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_THIS_`))]))}else t.body.body.unshift(i.variableDeclaration("let",[i.variableDeclarator(i.identifier(`_${l}_THIS_`),i.callExpression(i.super(),[]))]))}}!n.superClass&&o&&(n.superClass=i.identifier("Object"))},VariableDeclaration({node:e}){"const"==e.kind&&(e.kind="let")},ThisExpression(e){e.replaceWith(i.identifier("undefined"))},BigIntLiteral(e){const t=Number(e.node.value);BigInt(t)==BigInt(e.node.value)?e.replaceWith(i.callExpression(i.identifier("BigInt"),[i.numericLiteral(t)])):e.replaceWith(i.callExpression(i.identifier("BigInt"),[i.stringLiteral(e.node.value)]))}}),{file:e,seclevel:f}};export{transform as default,transform};
package/pull.d.ts CHANGED
@@ -5,5 +5,5 @@
5
5
  * @param hackmudPath path to hackmud directory
6
6
  * @param script to pull in `user.name` format
7
7
  */
8
- export declare function pull(sourceFolderPath: string, hackmudPath: string, script: string): Promise<void>;
8
+ export declare const pull: (sourceFolderPath: string, hackmudPath: string, script: string) => Promise<void>;
9
9
  export default pull;
package/pull.js CHANGED
@@ -1 +1 @@
1
- import{dirname as t,resolve as r}from"path";import i from"fs";const{mkdir:s,copyFile:o}=i.promises;async function pull(i,e,a){const[c,n]=a.split(".");if(!c||!n)throw new Error('`script` argument must be in "user.name" format');await function copyFilePersistent(r,i,e){return o(r,i,e).catch((async a=>{if("ENOENT"!=a.code)throw a;await s(t(i),{recursive:!0}),await o(r,i,e)}))}(r(e,c,"scripts",`${n}.js`),r(i,c,`${n}.js`))}export{pull as default,pull};
1
+ import{copyFilePersistent as t}from"@samual/lib/copyFilePersistent";import{resolve as r}from"path";const pull=async(s,a,i)=>{const[o,e]=i.split(".");if(!o||!e)throw new Error('`script` argument must be in "user.name" format');await t(r(a,o,"scripts",`${e}.js`),r(s,o,`${e}.js`))};export{pull as default,pull};
package/push.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { LaxPartial } from "@samual/lib";
2
- import { Info } from ".";
3
- export declare type PushOptions = {
1
+ import type { LaxPartial } from "@samual/lib";
2
+ import type { Info } from ".";
3
+ export type PushOptions = {
4
4
  /** whether to do the minify step (defaults to `true`) */
5
5
  minify: boolean;
6
6
  /** whether to mangle function and class names (defaults to `false`) */
@@ -33,5 +33,5 @@ export declare type PushOptions = {
33
33
  * @param options {@link PushOptions details}
34
34
  * @returns array of info on pushed scripts
35
35
  */
36
- export declare function push(sourceDirectory: string, hackmudDirectory: string, { scripts, onPush, minify, mangleNames, forceQuineCheats }?: LaxPartial<PushOptions>): Promise<Info[]>;
36
+ export declare const push: (sourceDirectory: string, hackmudDirectory: string, { scripts, onPush, minify, mangleNames, forceQuineCheats }?: LaxPartial<PushOptions>) => Promise<Info[]>;
37
37
  export default push;
package/push.js CHANGED
@@ -1 +1 @@
1
- import e from"fs";import{resolve as i,extname as t,basename as r}from"path";import{s as a}from"./constants-9bb78688.js";import{processScript as s}from"./processScript/index.js";import{D as o,w as p}from"./writeFilePersistent-72dc81a3.js";import{c as n}from"./countHackmudCharacters-1e122984.js";import"@babel/generator";import"@babel/parser";import"@babel/plugin-proposal-class-properties";import"@babel/plugin-proposal-class-static-block";import"@babel/plugin-proposal-decorators";import"@babel/plugin-proposal-json-strings";import"@babel/plugin-proposal-logical-assignment-operators";import"@babel/plugin-proposal-nullish-coalescing-operator";import"@babel/plugin-proposal-numeric-separator";import"@babel/plugin-proposal-object-rest-spread";import"@babel/plugin-proposal-optional-catch-binding";import"@babel/plugin-proposal-optional-chaining";import"@babel/plugin-proposal-private-property-in-object";import"@babel/plugin-transform-exponentiation-operator";import"@babel/traverse";import"@babel/types";import"@rollup/plugin-babel";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-node-resolve";import"prettier";import"rollup";import"./processScript/minify.js";import"acorn";import"terser";import"./processScript/shared.js";import"./assert-1556d989.js";import"./spliceString-2c6f214f.js";import"./processScript/postprocess.js";import"./processScript/preprocess.js";import"import-meta-resolve";import"./processScript/transform.js";const{readFile:l,readdir:m}=e.promises;async function push(e,c,{scripts:f=["*.*"],onPush:u=(()=>{}),minify:g=!0,mangleNames:d=!1,forceQuineCheats:h}={}){const b=new o((e=>new Set)),w=new Set,$=new Set;let y=!1;for(const e of f){const[i,t]=e.split(".");i&&"*"!=i?t&&"*"!=t?b.get(i).add(t):w.add(i):t&&"*"!=t?$.add(t):y=!0}const S=new o((e=>new Set)),j=[],P=new o((e=>new Set));let N;if($.size||y){const t=await m(i(c),{withFileTypes:!0}),r=new Set([...(N=await m(i(e),{withFileTypes:!0})).filter((e=>e.isDirectory())).map((e=>e.name)),...t.filter((e=>e.isDirectory())).map((e=>e.name)),...t.filter((e=>e.isFile()&&e.name.endsWith(".key"))).map((e=>e.name.slice(0,-4))),...b.keys(),...w]);if(y)for(const e of r)w.add(e);else for(const e of r){const i=b.get(e);for(const e of $)i.add(e)}}return await Promise.all([...w].map((async o=>{await m(i(e,o),{withFileTypes:!0}).then((async m=>{await Promise.all(m.map((async m=>{if(m.name.endsWith(".d.ts"))return;const f=t(m.name);if(m.isFile()&&a.includes(f)){const t=r(m.name,f),a=i(e,o,m.name),{script:b}=await s(await l(a,{encoding:"utf-8"}),{minify:g,scriptUser:o,scriptName:t,filePath:a,mangleNames:d,forceQuineCheats:h}),w={file:`${o}/${m.name}`,users:[o],minLength:n(b),error:void 0};P.get(o).add(t),j.push(w),await p(i(c,o,`scripts/${t}.js`),b),u(w)}})))}),(e=>{if("ENOENT"!=e.code)throw e}))}))),await Promise.all([...b].map((async([t,r])=>{w.has(t)||await Promise.all([...r].map((async r=>{let o,m,f;for(const s of a)try{m=`${r}${s}`,o=await l(f=i(e,t,m),{encoding:"utf-8"});break}catch{}if(o){const{script:e}=await s(o,{minify:g,scriptUser:t,scriptName:r,filePath:f,mangleNames:d,forceQuineCheats:h}),a={file:`${t}/${m}`,users:[t],minLength:n(e),error:void 0};j.push(a),await p(i(c,t,"scripts",`${r}.js`),e),u(a)}else S.get(r).add(t)})))}))),await(w.size?Promise.all((N||await m(i(e),{withFileTypes:!0})).map((async o=>{if(o.name.endsWith(".d.ts"))return;const m=t(o.name);if(!o.isFile()||!a.includes(m))return;const f=r(o.name,m),b=[...w,...S.get(f)].filter((e=>!P.get(e).has(f)));if(!b.length)return;const $=Math.floor(Math.random()*2**52).toString(36).padStart(11,"0"),y=i(e,o.name),{script:N}=await s(await l(y,{encoding:"utf-8"}),{minify:g,scriptUser:!0,scriptName:f,uniqueID:$,filePath:y,mangleNames:d,forceQuineCheats:h}),F={file:o.name,users:b,minLength:n(N),error:void 0};await Promise.all(b.map((e=>p(i(c,e,`scripts/${f}.js`),N.replace(new RegExp(`\\$${$}\\$SCRIPT_USER\\$`,"g"),e).replace(new RegExp(`\\$${$}\\$FULL_SCRIPT_NAME\\$`,"g"),`${e}.${f}`))))),j.push(F),u(F)}))):Promise.all([...S].map((async([t,r])=>{let o,m,f;for(const r of a)try{m=`${t}${r}`,o=await l(f=i(e,m),{encoding:"utf-8"});break}catch{}if(o){const e=Math.floor(Math.random()*2**52).toString(36).padStart(11,"0"),{script:a}=await s(o,{minify:g,scriptUser:!0,scriptName:t,uniqueID:e,filePath:f,mangleNames:d,forceQuineCheats:h}),l={file:m,users:[...r],minLength:n(a),error:void 0};await Promise.all([...r].map((r=>p(i(c,r,`scripts/${t}.js`),a.replace(new RegExp(`\\$${e}\\$SCRIPT_USER\\$`,"g"),r).replace(new RegExp(`\\$${e}\\$FULL_SCRIPT_NAME\\$`,"g"),`${r}.${t}`))))),j.push(l),u(l)}})))),j}export{push as default,push};
1
+ import{DynamicMap as e}from"@samual/lib/DynamicMap";import{countHackmudCharacters as t}from"@samual/lib/countHackmudCharacters";import{writeFilePersistent as r}from"@samual/lib/writeFilePersistent";import{readdir as i,readFile as a}from"fs/promises";import{resolve as s,extname as o,basename as n}from"path";import{supportedExtensions as p}from"./constants.js";import{processScript as m}from"./processScript/index.js";import"@babel/generator";import"@babel/parser";import"@babel/plugin-proposal-decorators";import"@babel/plugin-proposal-destructuring-private";import"@babel/plugin-proposal-explicit-resource-management";import"@babel/plugin-transform-class-properties";import"@babel/plugin-transform-class-static-block";import"@babel/plugin-transform-exponentiation-operator";import"@babel/plugin-transform-json-strings";import"@babel/plugin-transform-logical-assignment-operators";import"@babel/plugin-transform-nullish-coalescing-operator";import"@babel/plugin-transform-numeric-separator";import"@babel/plugin-transform-object-rest-spread";import"@babel/plugin-transform-optional-catch-binding";import"@babel/plugin-transform-optional-chaining";import"@babel/plugin-transform-private-property-in-object";import"@babel/plugin-transform-unicode-sets-regex";import"@babel/traverse";import"@babel/types";import"@rollup/plugin-babel";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-node-resolve";import"@samual/lib/assert";import"prettier";import"rollup";import"./processScript/minify.js";import"@samual/lib/spliceString";import"acorn";import"terser";import"./processScript/shared.js";import"./processScript/postprocess.js";import"./processScript/preprocess.js";import"import-meta-resolve";import"./processScript/transform.js";import"@samual/lib/clearObject";const push=async(l,c,{scripts:f=["*.*"],onPush:u=(()=>{}),minify:g=!0,mangleNames:b=!1,forceQuineCheats:d}={})=>{const h=new e((e=>new Set)),w=new Set,$=new Set;let y=!1;for(const e of f){const[t,r]=e.split(".");t&&"*"!=t?r&&"*"!=r?h.get(t).add(r):w.add(t):r&&"*"!=r?$.add(r):y=!0}const S=new e((e=>new Set)),P=[],j=new e((e=>new Set));let N;if($.size||y){const e=await i(s(c),{withFileTypes:!0}),t=new Set([...(N=await i(s(l),{withFileTypes:!0})).filter((e=>e.isDirectory())).map((e=>e.name)),...e.filter((e=>e.isDirectory())).map((e=>e.name)),...e.filter((e=>e.isFile()&&e.name.endsWith(".key"))).map((e=>e.name.slice(0,-4))),...h.keys(),...w]);if(y)for(const e of t)w.add(e);else for(const e of t){const t=h.get(e);for(const e of $)t.add(e)}}return await Promise.all([...w].map((async e=>{await i(s(l,e),{withFileTypes:!0}).then((async i=>{await Promise.all(i.map((async i=>{if(i.name.endsWith(".d.ts"))return;const f=o(i.name);if(i.isFile()&&p.includes(f)){const o=n(i.name,f),p=s(l,e,i.name),{script:h}=await m(await a(p,{encoding:"utf-8"}),{minify:g,scriptUser:e,scriptName:o,filePath:p,mangleNames:b,forceQuineCheats:d}),w={file:`${e}/${i.name}`,users:[e],minLength:t(h),error:void 0};j.get(e).add(o),P.push(w),await r(s(c,e,`scripts/${o}.js`),h),u(w)}})))}),(e=>{if("ENOENT"!=e.code)throw e}))}))),await Promise.all([...h].map((async([e,i])=>{w.has(e)||await Promise.all([...i].map((async i=>{let o,n,f;for(const t of p)try{n=`${i}${t}`,o=await a(f=s(l,e,n),{encoding:"utf-8"});break}catch{}if(o){const{script:a}=await m(o,{minify:g,scriptUser:e,scriptName:i,filePath:f,mangleNames:b,forceQuineCheats:d}),p={file:`${e}/${n}`,users:[e],minLength:t(a),error:void 0};P.push(p),await r(s(c,e,"scripts",`${i}.js`),a),u(p)}else S.get(i).add(e)})))}))),await(w.size?Promise.all((N||await i(s(l),{withFileTypes:!0})).map((async e=>{if(e.name.endsWith(".d.ts"))return;const i=o(e.name);if(!e.isFile()||!p.includes(i))return;const f=n(e.name,i),h=[...w,...S.get(f)].filter((e=>!j.get(e).has(f)));if(!h.length)return;const $=Math.floor(Math.random()*2**52).toString(36).padStart(11,"0"),y=s(l,e.name),{script:N}=await m(await a(y,{encoding:"utf-8"}),{minify:g,scriptUser:!0,scriptName:f,uniqueID:$,filePath:y,mangleNames:b,forceQuineCheats:d}),C={file:e.name,users:h,minLength:t(N),error:void 0};await Promise.all(h.map((e=>r(s(c,e,`scripts/${f}.js`),N.replace(new RegExp(`\\$${$}\\$SCRIPT_USER\\$`,"g"),e).replace(new RegExp(`\\$${$}\\$FULL_SCRIPT_NAME\\$`,"g"),`${e}.${f}`))))),P.push(C),u(C)}))):Promise.all([...S].map((async([e,i])=>{let o,n,f;for(const t of p)try{n=`${e}${t}`,o=await a(f=s(l,n),{encoding:"utf-8"});break}catch{}if(o){const a=Math.floor(Math.random()*2**52).toString(36).padStart(11,"0"),{script:p}=await m(o,{minify:g,scriptUser:!0,scriptName:e,uniqueID:a,filePath:f,mangleNames:b,forceQuineCheats:d}),l={file:n,users:[...i],minLength:t(p),error:void 0};await Promise.all([...i].map((t=>r(s(c,t,`scripts/${e}.js`),p.replace(new RegExp(`\\$${a}\\$SCRIPT_USER\\$`,"g"),t).replace(new RegExp(`\\$${a}\\$FULL_SCRIPT_NAME\\$`,"g"),`${t}.${e}`))))),P.push(l),u(l)}})))),P};export{push as default,push};
package/syncMacros.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare function syncMacros(hackmudPath: string): Promise<{
1
+ export declare const syncMacros: (hackmudPath: string) => Promise<{
2
2
  macrosSynced: number;
3
3
  usersSynced: number;
4
4
  }>;
package/syncMacros.js CHANGED
@@ -1 +1 @@
1
- import e from"fs";import{extname as a,basename as s,resolve as t}from"path";const{readFile:o,readdir:n,stat:r,writeFile:c}=e.promises;async function syncMacros(e){const i=await n(e,{withFileTypes:!0}),m=new Map,l=[];await Promise.all(i.map((async n=>{if(n.isFile())switch(a(n.name)){case".macros":{const[a,s]=await Promise.all([o(t(e,n.name),{encoding:"utf-8"}).then((e=>e.split("\n"))),r(t(e,n.name)).then((({mtime:e})=>e))]);for(let e=0;e<a.length/2-1;e++){const t=a[2*e],o=m.get(t);(!o||s>o.date)&&m.set(t,{date:s,macro:a[2*e+1]})}}break;case".key":l.push(s(n.name,".key"))}})));let f="",p=0;for(const[e,{macro:a}]of[...m].sort((([e],[a])=>(e>a)-(e<a))))a[0]==a[0].toLowerCase()&&(f+=`${e}\n${a}\n`,p++);for(const a of l)c(t(e,`${a}.macros`),f);return{macrosSynced:p,usersSynced:l.length}}export{syncMacros as default,syncMacros};
1
+ import{readdir as e,readFile as t,stat as a,writeFile as s}from"fs/promises";import{extname as o,basename as n,resolve as r}from"path";const syncMacros=async c=>{const m=await e(c,{withFileTypes:!0}),i=new Map,l=[];await Promise.all(m.map((async e=>{if(e.isFile())switch(o(e.name)){case".macros":{const[s,o]=await Promise.all([t(r(c,e.name),{encoding:"utf-8"}).then((e=>e.split("\n"))),a(r(c,e.name)).then((({mtime:e})=>e))]);for(let e=0;e<s.length/2-1;e++){const t=s[2*e],a=i.get(t);(!a||o>a.date)&&i.set(t,{date:o,macro:s[2*e+1]})}}break;case".key":l.push(n(e.name,".key"))}})));let f="",p=0;for(const[e,{macro:t}]of[...i].sort((([e],[t])=>(e>t)-(e<t))))t[0]==t[0].toLowerCase()&&(f+=`${e}\n${t}\n`,p++);for(const e of l)s(r(c,`${e}.macros`),f);return{macrosSynced:p,usersSynced:l.length}};export{syncMacros as default,syncMacros};
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es5.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.dom.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.scripthost.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../../usr/local/lib/node_modules/typescript/lib/lib.es2022.full.d.ts","../src/constants.ts","../src/env.d.ts","../src/generateTypeDeclaration.ts","../node_modules/.pnpm/@babel+types@7.23.6/node_modules/@babel/types/lib/index.d.ts","../node_modules/.pnpm/@types+babel__generator@7.6.8/node_modules/@types/babel__generator/index.d.ts","../node_modules/.pnpm/@babel+parser@7.23.6/node_modules/@babel/parser/typings/babel-parser.d.ts","../node_modules/.pnpm/@types+babel__template@7.4.4/node_modules/@types/babel__template/index.d.ts","../node_modules/.pnpm/@types+babel__traverse@7.20.5/node_modules/@types/babel__traverse/index.d.ts","../node_modules/.pnpm/@types+babel__core@7.20.5/node_modules/@types/babel__core/index.d.ts","../node_modules/.pnpm/@types+estree@1.0.5/node_modules/@types/estree/index.d.ts","../node_modules/.pnpm/rollup@4.9.5/node_modules/rollup/dist/rollup.d.ts","../node_modules/.pnpm/@rollup+pluginutils@5.1.0_rollup@4.9.5/node_modules/@rollup/pluginutils/types/index.d.ts","../node_modules/.pnpm/@rollup+plugin-babel@6.0.4_@babel+core@7.23.7_@types+babel__core@7.20.5_rollup@4.9.5/node_modules/@rollup/plugin-babel/types/index.d.ts","../node_modules/.pnpm/@rollup+plugin-commonjs@25.0.7_rollup@4.9.5/node_modules/@rollup/plugin-commonjs/types/index.d.ts","../node_modules/.pnpm/@rollup+plugin-json@6.1.0_rollup@4.9.5/node_modules/@rollup/plugin-json/types/index.d.ts","../node_modules/.pnpm/@rollup+plugin-node-resolve@15.2.3_rollup@4.9.5/node_modules/@rollup/plugin-node-resolve/types/index.d.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/index.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/assert.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/assert/strict.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/header.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/readable.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/file.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/fetch.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/formdata.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/connector.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/client.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/errors.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/dispatcher.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/global-dispatcher.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/global-origin.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/pool-stats.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/pool.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/handlers.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/balanced-pool.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/agent.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-interceptor.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-agent.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-client.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-pool.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-errors.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/proxy-agent.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/api.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/cookies.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/patch.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/filereader.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/websocket.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/content-type.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/cache.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/interceptors.d.ts","../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/index.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/globals.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/async_hooks.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/buffer.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/child_process.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/cluster.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/console.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/constants.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/crypto.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/dgram.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/dns.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/dns/promises.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/domain.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/dom-events.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/events.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/fs.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/fs/promises.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/http.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/http2.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/https.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/inspector.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/module.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/net.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/os.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/path.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/perf_hooks.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/process.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/punycode.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/querystring.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/readline.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/readline/promises.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/repl.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/stream.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/stream/promises.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/stream/consumers.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/stream/web.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/string_decoder.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/test.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/timers.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/timers/promises.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/tls.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/trace_events.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/tty.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/url.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/util.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/v8.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/vm.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/wasi.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/worker_threads.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/zlib.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/globals.global.d.ts","../node_modules/.pnpm/@types+node@20.11.0/node_modules/@types/node/index.d.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/assert.d.ts","../node_modules/.pnpm/prettier@3.2.2/node_modules/prettier/doc.d.ts","../node_modules/.pnpm/prettier@3.2.2/node_modules/prettier/index.d.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/countHackmudCharacters.d.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/spliceString.d.ts","../node_modules/.pnpm/acorn@8.11.3/node_modules/acorn/dist/acorn.d.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.21/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.21/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.21/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts","../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.21/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts","../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts","../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts","../node_modules/.pnpm/@jridgewell+gen-mapping@0.3.3/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts","../node_modules/.pnpm/@jridgewell+source-map@0.3.5/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts","../node_modules/.pnpm/terser@5.26.0/node_modules/terser/tools/terser.d.ts","../src/processScript/shared.ts","../src/processScript/minify.ts","../src/processScript/postprocess.ts","../node_modules/.pnpm/import-meta-resolve@4.0.0/node_modules/import-meta-resolve/lib/errors.d.ts","../node_modules/.pnpm/import-meta-resolve@4.0.0/node_modules/import-meta-resolve/lib/package-json-reader.d.ts","../node_modules/.pnpm/import-meta-resolve@4.0.0/node_modules/import-meta-resolve/lib/package-config.d.ts","../node_modules/.pnpm/import-meta-resolve@4.0.0/node_modules/import-meta-resolve/lib/resolve.d.ts","../node_modules/.pnpm/import-meta-resolve@4.0.0/node_modules/import-meta-resolve/index.d.ts","../src/processScript/preprocess.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/clearObject.d.ts","../src/processScript/transform.ts","../src/processScript/index.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/copyFilePersistent.d.ts","../src/pull.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/DynamicMap.d.ts","../node_modules/.pnpm/@samual+lib@0.9.1/node_modules/@samual/lib/writeFilePersistent.d.ts","../src/push.ts","../src/syncMacros.ts","../node_modules/.pnpm/anymatch@3.1.3/node_modules/anymatch/index.d.ts","../node_modules/.pnpm/chokidar@3.5.3/node_modules/chokidar/types/index.d.ts","../src/watch.ts","../src/index.ts","../package.json","../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.d.ts","../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.d.ts","../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.d.ts","../src/bin/hsm.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/classes/semver.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/parse.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/valid.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/clean.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/inc.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/diff.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/major.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/minor.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/patch.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/compare.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/sort.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/rsort.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/gt.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/lt.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/eq.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/neq.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/gte.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/lte.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/cmp.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/coerce.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/classes/comparator.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/classes/range.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/valid.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/outside.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/ranges/subset.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/.pnpm/@types+semver@7.5.6/node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"86a34c7a13de9cabc43161348f663624b56871ed80986e41d214932ddd8d6719","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1df2366de6650547b3dc1d7c4147355c0f6b4729c964e3839636fa418982d131",{"version":"9581880726f6a7c2ac58f242e0ff574b217544c9715815d557465e0b42beadd0","signature":"e326f4296ab10bbe0d9fc4bbc0ec6bd8ad47e5f3120471aedf482a0704974dab"},{"version":"a5010b48b8e8774342e907222976ed9a102ab61b7237f4c6bc382970a574aaba","affectsGlobalScope":true},{"version":"48da7777fb5b3d49f8bca6e373eeff5230f3df6434fbb16721352e214b5c337a","signature":"a2dc116b16fae95e29d3c0c34ccdce1d0c5222110739a088eb15bfd3d6243859"},"923c136dcbf20f140c369078a7eb56f6697889d104397d694f70e21dd08b1810","2c8e55457aaf4902941dfdba4061935922e8ee6e120539c9801cd7b400fae050","8041cfce439ff29d339742389de04c136e3029d6b1817f07b2d7fcbfb7534990","670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","9d38964b57191567a14b396422c87488cecd48f405c642daa734159875ee81d9","069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","ee7d8894904b465b072be0d2e4b45cf6b887cdba16a467645c4e200982ece7ea",{"version":"bf1b2e7c6fc81ec0118c8264c4d004458e60ed8af4c16b3267885a932e2a6c11","affectsGlobalScope":true},"77b55f8bfab90aa408704132d98b72f8762e2fe955eeda093ace44120d6adc1a","1a51e4b4124e594679e6d180c78744fc71a653498ab2fca15936213ae44988f5","062c4a701f1ae473443a9b9e44db248226679716362b4759b7f5f682a97a5e8c","c730d00be50adc461f9fbf58c6db9cda705939a09409cd87a1856797db87bdf8","a4d75759d36a6e0f3ad9714c580297645982e6e815c589f0477d9e986463ad02","277a0682c771c8ee4a8a2f47f517981b144f91c8e3202c24e2e4a20c77693ed8","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"e2eb1ce13a9c0fa7ab62c63909d81973ef4b707292667c64f1e25e6e53fa7afa","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","91073e48c8e2833110f328848b2c298425bd596a332107f248de6f28b2311f5e","bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","f1ace2d2f98429e007d017c7a445efad2aaebf8233135abdb2c88b8c0fef91ab","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"1b6d2b76e8a526c7e26f96df0f4fb49510b281597dbf95225c231781fa2d1614","affectsGlobalScope":true},"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"9335b283875185dc274fe8ad30989fdfc5bd9772efbe1d6e4ec72044a3f1a46a","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12",{"version":"f325631e35c2bc4815911085c55e21109b7c500d8e467524252363bd859f6e50","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","8013f6c4d1632da8f1c4d3d702ae559acccd0f1be05360c31755f272587199c9",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","fb09d1e831c5bb08826df31594347b56562ec45b6f3809b5bfa945de118b8113","2f848b4e660b568651a6350565afc8ac5b0644853a2a863862807602cf244a05","e7049308a11ff36ca7eee4ff33df35106eb108018ea4cd4cdb00efe8e9711ce0","ce8b68c4394368261823cd31b6dd3b02457aa93b3488e93302d1a5438dbe8107","93931e9bf03fc64df77f6617fbd8df48ad86c636eb97188c7ef979a4c338cd9e","6c468c66d622b07d6ad6c4dc2fbec2ce1ca3d50e22c247a69a8ca7a214ceabd8","971f12a5fc236419ced0b7b9f23a53c1758233713f565635bbf4b85e2b23f55a","51c277caca9790c4dd52de192d73572cac050c79073e004c27abc0886f88ab3d","695b586df2d8c78b78cdd7cc6943594f3f4bc52948f13b31cdedfa3ce8d97c31","bd3019a70c9f483f94b7518b4fb13bee022815f72991110e7a618de137b51d12","cadb68b67b80b14a9a5bb64cce3093168fb2bfe2c7b10096d230df5203218de1","8fdf499a5ff78160bf99bc2f276e6025c785f095d0e7a6c6ec3c752cafcbc0b9","d527195559dd49fefc932ee71ebc7ed34a64f5611cbe45557ba7f27d74dc7bee","693015483017a74f286180d19da286d238a328b98595e6e3d37d556538b03bd4","dbcc562d761bc8912ddcabcadf3e80b0678faf8e954b122a8cbdd84079dbb674",{"version":"15eb1ed602c940e54df2f6f603ae0a2e27429ba037c0a48cfb8bcace4f9d0ae1","signature":"51560636940c1db1f5890df21603e3a01ca8c82f514e6ed7fc74ece5f133d7cd"},{"version":"a7ae614005023c91e1a28b3f6ea018d4f23fa5c79a1e8a823c28918363579f08","signature":"820055ca96c42524f9d97bd807ad04b9409232ad7eaded419dc8045ecce562b7"},{"version":"81219c1dacc7c3684e450781d4fabef365fd7cbb7c59ea7b0f1e3bd363e9b61f","signature":"910d2fac24fd87cec6419572d00528987cebb27ad85e573dbcadc85fb8b8c905"},"50fe7227e5ec1fb3af6533cfbf768b0ec9e7720cd4c3a23d487250fc7e5ef787","c402f0c81658ab9b62fa1c2cee7019fccb6c8bde30afbbfe4d174eb700d5c4e3","9a31c55a8db9f8a598572259178ad9fe894f9988aae18b55460f4f44af1b76ce","94e21187921b012a2bb763962655ea237d6b9a09e6555b9718e3cf9992cba585","1acf4222a7c7f9c3e7caae92fd073713dd122913f1c53b3fa14b2fc0474ac9f2",{"version":"8e7164057b822abfe9a89081b14426f080883f435226a7bfdc7d41f52f099c95","signature":"44908da5d98afedda43aca5cc6ccc20055089cc72bdb55160ee376df5abfda65"},"af919f385be19f5567a9b541f219ff2b9efe8a054e59460e9884415a4c81d67f",{"version":"01d081ae0840a0057b5dfe7b96de71f51d8268a63b34680ad2e68ee21f8c0f5a","signature":"538f66dbbfadf1ff4a8009046c9c2c221d381455543a254ba45be92df5289f20"},{"version":"8d38dbc4eee91ce95a3b6191c54a8905d9ed2746daf65d1ebdf5d236693c9412","signature":"64292e0c80e414624a458a479f6e125e6c11fe363620a59f990ffd880ce72eeb"},"945525e692865e8aefdbfe701542f15fe256babb642c538893979994f9f91c0a",{"version":"886fb5e32df42461989c99405ec5a7de5ba220563d2251899d52c3e9204ab292","signature":"b54e6fba7b99116a7817e98eccb5ea6e7919eb6f6aa668909b418cd208fd4040"},"4736c32fd0f12018bec7e0509d10597b966cf5f022c4d9cdf321ba73826c7c53","ee9e05db3595260d6b0711bd770b95284726d007013ff332ee1842de60da0bb6",{"version":"2995cb78adc7c6b00ce2647d81b6fb3e95e22dfe4e559556add13691b80ab023","signature":"734ceff6664514d97e76c9da86de362aadaa4b0562e7c632c48a4b1ecc8c3b12"},{"version":"b2828fa6f99e5dff31bf79f441ab0ad57d59c5e632c4ae880ee537b3208eeaca","signature":"0545a204da459bca62369c9187bb92da117c080d630b7178e0dc5658eb5ccd27"},"eac647a94fb1f09789e12dfecb52dcd678d05159a4796b4e415aa15892f3b103","a7e430e32eaefba6b1ebf23a94a4562bfe7051cc83558d33ddc8ff342f3c18e9",{"version":"f2c7a233a531b7ccbb4ca94aaf9a02e7fae295454a08515364776c410fc0dfd5","signature":"9b3959dfd00878828934ee3dcffa80739d0179efdf66951540eec602ef2edd8b"},{"version":"7a646667c717666665bc01ed14c9a7b216d72b2df354764937f414c0de82fa1d","signature":"793472fa703dabd65bc3bcdb71e0ed66fddcc1de57e3ea274a648dbe0e5a029d"},"efcc80543966c5dd63f9940dac602bcfacdfb90d731dd557762482108b7dd21e","acfed6cc001e7f7f26d2ba42222a180ba669bb966d4dd9cb4ad5596516061b13","f61a4dc92450609c353738f0a2daebf8cae71b24716dbd952456d80b1e1a48b6","b1adbadd9e2b45fa099362a19f95fec9d145b4b7f74f81c18d8fa1a163da47e0",{"version":"f5ba0a3b4a3f8d84e693b2dfc7cb49d5fa10aed07bb7fe5d74dc59719f49704b","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},"5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a"],"root":[[63,65],[181,183],189,191,192,194,197,198,201,202,207],"options":{"allowUnreachableCode":false,"allowUnusedLabels":false,"checkJs":true,"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"strictNullChecks":true,"target":9,"useUnknownInCatchVariables":true},"fileIdsList":[[66],[175,177],[176],[175,178],[173,175],[172,173,174],[172,175],[71,73,74],[73,74],[73],[72],[79,165],[129,165],[128,129,146,165],[66,67,68,69,70],[66,68],[80],[115],[116,121,149],[117,128,129,136,146,157],[117,118,128,136],[119,158],[120,121,129,137],[121,146,154],[122,124,128,136],[115,123],[124,125],[128],[126,128],[115,128],[128,129,130,146,157],[128,129,130,143,146,149],[113,116,162],[124,128,131,136,146,157],[128,129,131,132,136,146,154,157],[131,133,146,154,157],[80,81,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164],[128,134],[135,157,162],[124,128,136,146],[137],[138],[115,139],[140,156,162],[141],[142],[128,143,144],[143,145,158,160],[116,128,146,147,148,149],[116,146,148],[146,147],[149],[150],[115,146],[128,152,153],[152,153],[121,136,146,154],[155],[136,156],[116,131,142,157],[121,158],[146,159],[135,160],[161],[116,121,128,130,139,146,157,160,162],[146,163],[208,247],[208,232,247],[247],[208],[208,233,247],[208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246],[233,247],[204,205],[156],[128,129,165,199],[184,187],[157,165,185],[184],[157,165,184,186],[167],[179],[90,94,157],[90,146,157],[85],[87,90,154,157],[136,154],[165],[85,165],[87,90,136,157],[82,83,86,89,116,128,146,157],[82,88],[86,90,116,149,157,165],[116,165],[106,116,165],[84,85,165],[90],[84,85,86,87,88,89,90,91,92,94,95,96,97,98,99,100,101,102,103,104,105,107,108,109,110,111,112],[90,97,98],[88,90,98,99],[89],[82,85,90],[90,94,98,99],[94],[88,90,93,157],[82,87,88,90,94,97],[116,146],[85,90,106,116,162,165],[63,65,130,137,138,166,169,192,194,195,196,197,198,200,201,202,203,206],[130,138],[63,65,192,194,197,198,201],[63,64,66,67,68,70,71,73,75,76,77,78,79,138,166,168,181,182,183,189,191],[66,67,70,79,166,169,170,171,180,181],[66,67,68,70,166,170,188],[66,70,166],[63,66,70,166,181,190],[138,193],[63,79,130,138,169,192,195,196,202],[63,65,79,130,138,166,169,192,195,196,197,200],[79,182,183,189,191],[66,79],[66,70],[79,202],[79,197]],"referencedMap":[[68,1],[178,2],[177,3],[179,4],[174,5],[175,6],[173,7],[75,8],[76,9],[77,9],[78,10],[74,11],[166,12],[193,13],[196,14],[71,15],[67,1],[69,16],[70,1],[80,17],[81,17],[115,18],[116,19],[117,20],[118,21],[119,22],[120,23],[121,24],[122,25],[123,26],[124,27],[125,27],[127,28],[126,29],[128,30],[129,31],[130,32],[114,33],[131,34],[132,35],[133,36],[165,37],[134,38],[135,39],[136,40],[137,41],[138,42],[139,43],[140,44],[141,45],[142,46],[143,47],[144,47],[145,48],[146,49],[148,50],[147,51],[149,52],[150,53],[151,54],[152,55],[153,56],[154,57],[155,58],[156,59],[157,60],[158,61],[159,62],[160,63],[161,64],[162,65],[163,66],[232,67],[233,68],[208,69],[211,69],[230,67],[231,67],[221,67],[220,70],[218,67],[213,67],[226,67],[224,67],[228,67],[212,67],[225,67],[229,67],[214,67],[215,67],[227,67],[209,67],[216,67],[217,67],[219,67],[223,67],[234,71],[222,67],[210,67],[247,72],[241,71],[243,73],[242,71],[235,71],[236,71],[238,71],[240,71],[244,73],[245,73],[237,73],[239,73],[206,74],[205,75],[200,76],[188,77],[186,78],[185,79],[187,80],[168,81],[73,11],[180,82],[97,83],[104,84],[96,83],[111,85],[88,86],[87,87],[110,88],[105,89],[108,90],[90,91],[89,92],[85,93],[84,94],[107,95],[86,96],[91,97],[95,97],[113,98],[112,97],[99,99],[100,100],[102,101],[98,102],[101,103],[106,88],[93,104],[94,105],[103,106],[83,107],[109,108],[207,109],[65,110],[202,111],[192,112],[182,113],[189,114],[181,115],[191,116],[194,117],[197,118],[198,110],[201,119]],"exportedModulesMap":[[68,1],[178,2],[177,3],[179,4],[174,5],[175,6],[173,7],[75,8],[76,9],[77,9],[78,10],[74,11],[166,12],[193,13],[196,14],[71,15],[67,1],[69,16],[70,1],[80,17],[81,17],[115,18],[116,19],[117,20],[118,21],[119,22],[120,23],[121,24],[122,25],[123,26],[124,27],[125,27],[127,28],[126,29],[128,30],[129,31],[130,32],[114,33],[131,34],[132,35],[133,36],[165,37],[134,38],[135,39],[136,40],[137,41],[138,42],[139,43],[140,44],[141,45],[142,46],[143,47],[144,47],[145,48],[146,49],[148,50],[147,51],[149,52],[150,53],[151,54],[152,55],[153,56],[154,57],[155,58],[156,59],[157,60],[158,61],[159,62],[160,63],[161,64],[162,65],[163,66],[232,67],[233,68],[208,69],[211,69],[230,67],[231,67],[221,67],[220,70],[218,67],[213,67],[226,67],[224,67],[228,67],[212,67],[225,67],[229,67],[214,67],[215,67],[227,67],[209,67],[216,67],[217,67],[219,67],[223,67],[234,71],[222,67],[210,67],[247,72],[241,71],[243,73],[242,71],[235,71],[236,71],[238,71],[240,71],[244,73],[245,73],[237,73],[239,73],[206,74],[205,75],[200,76],[188,77],[186,78],[185,79],[187,80],[168,81],[73,11],[180,82],[97,83],[104,84],[96,83],[111,85],[88,86],[87,87],[110,88],[105,89],[108,90],[90,91],[89,92],[85,93],[84,94],[107,95],[86,96],[91,97],[95,97],[113,98],[112,97],[99,99],[100,100],[102,101],[98,102],[101,103],[106,88],[93,104],[94,105],[103,106],[83,107],[109,108],[202,111],[192,120],[182,121],[181,122],[191,1],[197,123],[201,124]],"semanticDiagnosticsPerFile":[68,66,178,176,177,179,174,172,175,173,75,76,77,78,74,195,166,190,193,169,79,170,196,71,67,69,70,72,80,81,115,116,117,118,119,120,121,122,123,124,125,127,126,128,129,130,114,164,131,132,133,165,134,135,136,137,138,139,140,141,142,143,144,145,146,148,147,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,232,233,208,211,230,231,221,220,218,213,226,224,228,212,225,229,214,215,227,209,216,217,219,223,234,222,210,247,246,241,243,242,235,236,238,240,244,245,237,239,171,199,206,204,205,200,188,184,186,185,187,167,168,73,180,97,104,96,111,88,87,110,105,108,90,89,85,84,107,86,91,92,95,82,113,112,99,100,102,98,101,106,93,94,103,83,109,203,207,63,64,65,202,192,182,183,189,181,191,194,197,198,201,60,61,10,11,15,14,2,16,17,18,19,20,21,22,23,3,4,24,28,25,26,27,29,30,31,5,32,33,34,35,6,39,36,37,38,40,7,41,46,47,42,43,44,45,8,51,48,49,50,52,9,53,62,54,55,58,56,57,1,59,13,12],"latestChangedDtsFile":"./bin/hsm.d.ts"},"version":"5.3.3"}
package/watch.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { LaxPartial } from "@samual/lib";
2
- import { PushOptions } from "./push";
3
- export declare type WatchOptions = PushOptions & {
1
+ import type { LaxPartial } from "@samual/lib";
2
+ import type { PushOptions } from "./push";
3
+ export type WatchOptions = PushOptions & {
4
4
  /**
5
5
  * if provided, will write typescript type declarations for all the scripts on every change detected
6
6
  *
@@ -16,5 +16,5 @@ export declare type WatchOptions = PushOptions & {
16
16
  * @param hackmudDirectory path to hackmud directory
17
17
  * @param options {@link WatchOptions details} and {@link PushOptions more details}
18
18
  */
19
- export declare function watch(sourceDirectory: string, hackmudDirectory: string, { scripts, onPush, minify, mangleNames, typeDeclarationPath: typeDeclarationPath_, onReady, forceQuineCheats }?: LaxPartial<WatchOptions>): Promise<void>;
19
+ export declare const watch: (sourceDirectory: string, hackmudDirectory: string, { scripts, onPush, minify, mangleNames, typeDeclarationPath: typeDeclarationPath_, onReady, forceQuineCheats }?: LaxPartial<WatchOptions>) => Promise<void>;
20
20
  export default watch;
package/watch.js CHANGED
@@ -1 +1 @@
1
- import{watch as r}from"chokidar";import t from"fs";import{extname as e,basename as o,resolve as i}from"path";import{s as a}from"./constants-9bb78688.js";import{generateTypeDeclaration as s}from"./generateTypeDeclaration.js";import{processScript as n}from"./processScript/index.js";import{D as p,w as l}from"./writeFilePersistent-72dc81a3.js";import{a as c}from"./assert-1556d989.js";import{c as m}from"./countHackmudCharacters-1e122984.js";import"@babel/generator";import"@babel/parser";import"@babel/plugin-proposal-class-properties";import"@babel/plugin-proposal-class-static-block";import"@babel/plugin-proposal-decorators";import"@babel/plugin-proposal-json-strings";import"@babel/plugin-proposal-logical-assignment-operators";import"@babel/plugin-proposal-nullish-coalescing-operator";import"@babel/plugin-proposal-numeric-separator";import"@babel/plugin-proposal-object-rest-spread";import"@babel/plugin-proposal-optional-catch-binding";import"@babel/plugin-proposal-optional-chaining";import"@babel/plugin-proposal-private-property-in-object";import"@babel/plugin-transform-exponentiation-operator";import"@babel/traverse";import"@babel/types";import"@rollup/plugin-babel";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-node-resolve";import"prettier";import"rollup";import"./processScript/minify.js";import"acorn";import"terser";import"./processScript/shared.js";import"./spliceString-2c6f214f.js";import"./processScript/postprocess.js";import"./processScript/preprocess.js";import"import-meta-resolve";import"./processScript/transform.js";const{readFile:f,readdir:u,writeFile:d}=t.promises;async function watch(t,h,{scripts:g=["*.*"],onPush:w,minify:b=!0,mangleNames:y=!1,typeDeclarationPath:j,onReady:S,forceQuineCheats:D}={}){if(!g.length)throw new Error("scripts option was an empty array");const T=new p((r=>new Set)),$=new Set,v=new Set;let F=!1;for(const r of g){const[t,e]=r.split(".");t&&"*"!=t?e&&"*"!=e?T.get(e).add(t):$.add(t):e&&"*"!=e?v.add(e):F=!0}const E=r(["*.ts","*.js"],{depth:1,cwd:t,awaitWriteFinish:{stabilityThreshold:100},ignored:"*.d.ts"}).on("change",(async r=>{if(r.endsWith(".d.ts"))return;const s=e(r);if(!a.includes(s))return;const d=o(r,s);if(r==o(r)){if(!(F||$.size||v.has(d)||T.has(d)))return;const s=new p((r=>[]));await Promise.all((await u(t,{withFileTypes:!0})).map((async r=>{if(r.isDirectory())for(const n of await u(i(t,r.name),{withFileTypes:!0})){if(!n.isFile())continue;const t=e(n.name);a.includes(t)&&s.get(o(n.name,t)).push(r.name)}})));const g=new Set;if(F||v.has(d)){for(const r of await u(i(t),{withFileTypes:!0}))r.isDirectory()&&g.add(r.name);for(const r of await u(i(h),{withFileTypes:!0}))r.isDirectory()?g.add(r.name):r.isFile()&&r.name.endsWith(".key")&&g.add(r.name.slice(0,-4));for(const r of T.values())for(const t of r)g.add(t)}for(const r of $)g.add(r);for(const r of T.get(d))g.add(r);const j=[...g].filter((r=>!s.has(r)));if(!j.length)return void(null==w||w({file:r,users:[],minLength:0,error:new Error("no users to push to")}));const S=Math.floor(Math.random()*2**52).toString(36).padStart(11,"0"),E=i(t,r);let P;try{({script:P}=await n(await f(E,{encoding:"utf-8"}),{minify:b,scriptUser:!0,scriptName:d,uniqueID:S,filePath:E,mangleNames:y,forceQuineCheats:D}))}catch(t){return c(t instanceof Error),void(null==w||w({file:r,users:[],minLength:0,error:t}))}return await Promise.all(j.map((r=>l(i(h,r,`scripts/${d}.js`),P.replace(new RegExp(`\\$${S}\\$SCRIPT_USER\\$`,"g"),r).replace(new RegExp(`\\$${S}\\$FULL_SCRIPT_NAME\\$`,"g"),`${r}.${d}`))))),void(null==w||w({file:r,users:j,minLength:m(P),error:void 0}))}const g=o(i(r,".."));if(!(F||$.size||v.has(d)||T.get(d).has(g)))return;const j=i(t,r),S=await f(j,{encoding:"utf-8"});let E;try{({script:E}=await n(S,{minify:b,scriptUser:g,scriptName:d,filePath:j,mangleNames:y,forceQuineCheats:D}))}catch(t){return c(t instanceof Error),void(null==w||w({file:r,users:[],minLength:0,error:t}))}await l(i(h,g,"scripts",`${d}.js`),E),null==w||w({file:r,users:[g],minLength:m(E),error:void 0})}));if(S&&E.on("ready",S),!j)return;let P=j;async function writeTypeDeclaration(){const r=await s(t,h);try{await d(P,r)}catch(t){if(c(t instanceof Error),"EISDIR"!=t.code)throw t;P=i(P,"player.d.ts"),await d(P,r)}}await writeTypeDeclaration(),E.on("add",writeTypeDeclaration),E.on("unlink",writeTypeDeclaration)}export{watch as default,watch};
1
+ import{DynamicMap as r}from"@samual/lib/DynamicMap";import{assert as t}from"@samual/lib/assert";import{countHackmudCharacters as e}from"@samual/lib/countHackmudCharacters";import{writeFilePersistent as i}from"@samual/lib/writeFilePersistent";import{watch as o}from"chokidar";import{readdir as a,readFile as s,writeFile as n}from"fs/promises";import{extname as p,basename as l,resolve as m}from"path";import{supportedExtensions as c}from"./constants.js";import{generateTypeDeclaration as f}from"./generateTypeDeclaration.js";import{processScript as u}from"./processScript/index.js";import"@babel/generator";import"@babel/parser";import"@babel/plugin-proposal-decorators";import"@babel/plugin-proposal-destructuring-private";import"@babel/plugin-proposal-explicit-resource-management";import"@babel/plugin-transform-class-properties";import"@babel/plugin-transform-class-static-block";import"@babel/plugin-transform-exponentiation-operator";import"@babel/plugin-transform-json-strings";import"@babel/plugin-transform-logical-assignment-operators";import"@babel/plugin-transform-nullish-coalescing-operator";import"@babel/plugin-transform-numeric-separator";import"@babel/plugin-transform-object-rest-spread";import"@babel/plugin-transform-optional-catch-binding";import"@babel/plugin-transform-optional-chaining";import"@babel/plugin-transform-private-property-in-object";import"@babel/plugin-transform-unicode-sets-regex";import"@babel/traverse";import"@babel/types";import"@rollup/plugin-babel";import"@rollup/plugin-commonjs";import"@rollup/plugin-json";import"@rollup/plugin-node-resolve";import"prettier";import"rollup";import"./processScript/minify.js";import"@samual/lib/spliceString";import"acorn";import"terser";import"./processScript/shared.js";import"./processScript/postprocess.js";import"./processScript/preprocess.js";import"import-meta-resolve";import"./processScript/transform.js";import"@samual/lib/clearObject";const watch=async(d,g,{scripts:b=["*.*"],onPush:h,minify:w=!0,mangleNames:y=!1,typeDeclarationPath:j,onReady:S,forceQuineCheats:v}={})=>{if(!b.length)throw new Error("scripts option was an empty array");const $=new r((r=>new Set)),E=new Set,F=new Set;let P=!1;for(const r of b){const[t,e]=r.split(".");t&&"*"!=t?e&&"*"!=e?$.get(e).add(t):E.add(t):e&&"*"!=e?F.add(e):P=!0}const D=o(["*/*.ts","*/*.js"],{cwd:d,awaitWriteFinish:{stabilityThreshold:100},ignored:"*.d.ts"}).on("change",(async o=>{if(o.endsWith(".d.ts"))return;const n=p(o);if(!c.includes(n))return;const f=l(o,n);if(o==l(o)){if(!(P||E.size||F.has(f)||$.has(f)))return;const n=new r((r=>[]));await Promise.all((await a(d,{withFileTypes:!0})).map((async r=>{if(r.isDirectory())for(const t of await a(m(d,r.name),{withFileTypes:!0})){if(!t.isFile())continue;const e=p(t.name);c.includes(e)&&n.get(l(t.name,e)).push(r.name)}})));const b=new Set;if(P||F.has(f)){for(const r of await a(m(d),{withFileTypes:!0}))r.isDirectory()&&b.add(r.name);for(const r of await a(m(g),{withFileTypes:!0}))r.isDirectory()?b.add(r.name):r.isFile()&&r.name.endsWith(".key")&&b.add(r.name.slice(0,-4));for(const r of $.values())for(const t of r)b.add(t)}for(const r of E)b.add(r);for(const r of $.get(f))b.add(r);const j=[...b].filter((r=>!n.has(r)));if(!j.length)return void h?.({file:o,users:[],minLength:0,error:new Error("no users to push to")});const S=Math.floor(Math.random()*2**52).toString(36).padStart(11,"0"),D=m(d,o);let T;try{({script:T}=await u(await s(D,{encoding:"utf-8"}),{minify:w,scriptUser:!0,scriptName:f,uniqueID:S,filePath:D,mangleNames:y,forceQuineCheats:v}))}catch(r){return t(r instanceof Error),void h?.({file:o,users:[],minLength:0,error:r})}return await Promise.all(j.map((r=>i(m(g,r,`scripts/${f}.js`),T.replace(new RegExp(`\\$${S}\\$SCRIPT_USER\\$`,"g"),r).replace(new RegExp(`\\$${S}\\$FULL_SCRIPT_NAME\\$`,"g"),`${r}.${f}`))))),void h?.({file:o,users:j,minLength:e(T),error:void 0})}const b=l(m(o,".."));if(!(P||E.size||F.has(f)||$.get(f).has(b)))return;const j=m(d,o),S=await s(j,{encoding:"utf-8"});let D;try{({script:D}=await u(S,{minify:w,scriptUser:b,scriptName:f,filePath:j,mangleNames:y,forceQuineCheats:v}))}catch(r){return t(r instanceof Error),void h?.({file:o,users:[],minLength:0,error:r})}await i(m(g,b,"scripts",`${f}.js`),D),h?.({file:o,users:[b],minLength:e(D),error:void 0})}));if(S&&D.on("ready",S),!j)return;let T=j;const writeTypeDeclaration=async()=>{const r=await f(d,g);try{await n(T,r)}catch(e){if(t(e instanceof Error),"EISDIR"!=e.code)throw e;T=m(T,"player.d.ts"),await n(T,r)}};await writeTypeDeclaration(),D.on("add",writeTypeDeclaration),D.on("unlink",writeTypeDeclaration)};export{watch as default,watch};
@@ -1 +0,0 @@
1
- const e=function createErrorClass(e){const r={[e]:class extends Error{}}[e];return Object.defineProperty(r.prototype,"name",{value:e}),r}("AssertError");function assert(r,s="assertion failed"){if(!r)throw new e(s)}function ensure(e,r="ensure failed"){return assert(e,r),e}export{assert as a,ensure as e};
@@ -1 +0,0 @@
1
- function countHackmudCharacters(u){return u.replace(/\/\/.*/g,"").replace(/[ \t\n\r\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]/g,"").length}export{countHackmudCharacters as c};
@@ -1 +0,0 @@
1
- function spliceString(i,e,s,c=0){return i.slice(0,s)+e+i.slice(s+c)}export{spliceString as s};
@@ -1 +0,0 @@
1
- import e from"fs";import{dirname as r}from"path";class DynamicMap extends Map{constructor(e){super(),this.fallbackHandler=e}get(e){if(super.has(e))return super.get(e);const r=this.fallbackHandler(e);return super.set(e,r),r}}const{writeFile:t,mkdir:s}=e.promises;function writeFilePersistent(e,a,i){return t(e,a,i).catch((async n=>{if("ENOENT"!=n.code)throw n;await s(r(e),{recursive:!0}),await t(e,a,i)}))}export{DynamicMap as D,writeFilePersistent as w};