From dd764dcf539f380a6c4c54f0d2865a35f7fbb00f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 00:16:37 +0000 Subject: [PATCH] deploy: f92d1076e7e59c847a9e373b1e3d76cf928c9faf --- 404.html | 2 +- assets/js/f03df807.28955b70.js | 1 - assets/js/f03df807.8efbcbb3.js | 1 + .../{runtime~main.4427136b.js => runtime~main.b1bf70a5.js} | 2 +- docs/getting-started/examples/index.html | 2 +- docs/getting-started/installation/index.html | 2 +- docs/guides/commands/index.html | 2 +- docs/guides/index.html | 2 +- docs/guides/registration/index.html | 5 +---- docs/guides/types/index.html | 2 +- docs/index.html | 2 +- index.html | 2 +- 12 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 assets/js/f03df807.28955b70.js create mode 100644 assets/js/f03df807.8efbcbb3.js rename assets/js/{runtime~main.4427136b.js => runtime~main.b1bf70a5.js} (98%) diff --git a/404.html b/404.html index e24efd37..25cc049b 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Page Not Found | Commander - + diff --git a/assets/js/f03df807.28955b70.js b/assets/js/f03df807.28955b70.js deleted file mode 100644 index b56a9dd2..00000000 --- a/assets/js/f03df807.28955b70.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[441],{619:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>i,metadata:()=>d,toc:()=>c});var s=r(1527),t=r(7540);const i={description:"Learn how to register commands and types"},o="Registration",d={id:"guides/registration",title:"Registration",description:"Learn how to register commands and types",source:"@site/docs/guides/registration.mdx",sourceDirName:"guides",slug:"/guides/registration",permalink:"/commander/docs/guides/registration",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{description:"Learn how to register commands and types"},sidebar:"docsSidebar",previous:{title:"Types",permalink:"/commander/docs/guides/types"}},a={},c=[{value:"Registering commands",id:"registering-commands",level:2},{value:"Registering types",id:"registering-types",level:2},{value:"Summary",id:"summary",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"registration",children:"Registration"}),"\n",(0,s.jsxs)(n.admonition,{type:"warning",children:[(0,s.jsx)(n.p,{children:"Commands and types can only be registered when starting Commander."}),(0,s.jsx)(n.p,{children:"An error will be thrown if you attempt registration after it has been started."})]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.a,{href:"/commander/docs/guides/commands",children:"Commands"})," and ",(0,s.jsx)(n.a,{href:"/commander/docs/guides/types",children:"Types"})," must be registered in order to be used."]}),"\n",(0,s.jsxs)(n.p,{children:["You can only register commands and types in the callback you provide when starting Commander:\n",(0,s.jsx)(n.code,{children:"CommanderServer.start"})," and ",(0,s.jsx)(n.code,{children:"CommanderClient.start"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"registering-commands",children:"Registering commands"}),"\n",(0,s.jsxs)(n.p,{children:["In order to register commands, you must use the ",(0,s.jsx)(n.code,{children:"registerCommandsIn"})," method."]}),"\n",(0,s.jsxs)(n.p,{children:["This searches for all children that are a ",(0,s.jsx)(n.code,{children:"ModuleScript"})," in the provided ",(0,s.jsx)(n.code,{children:"Instance"}),". These will then be\nloaded and any methods that have the ",(0,s.jsx)(n.code,{children:"@Command"})," decorator will be registered. Commands will only be registered\nif their parent class has the ",(0,s.jsx)(n.code,{children:"@Commander"})," decorator."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers",children:'CommanderServer.start((registry) => {\n const commandContainer = script.Parent.commands;\n registry.registerCommandsIn(commandContainer)\n}).catch((err) => warn("Commander could not be started:", tostring(err)));\n'})}),"\n",(0,s.jsx)(n.h2,{id:"registering-types",children:"Registering types"}),"\n",(0,s.jsxs)(n.p,{children:["Types should be registered using the ",(0,s.jsx)(n.code,{children:"registerContainer"})," method."]}),"\n",(0,s.jsxs)(n.p,{children:["This searches for all children that are a ",(0,s.jsx)(n.code,{children:"ModuleScript"})," and export a function in the provided ",(0,s.jsx)(n.code,{children:"Instance"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"If any ModuleScripts that export a function are found, the function will be called with the registry."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers",children:"export = (registry: BaseRegistry) => {\n registry.registerType(someType)\n\n // You can also register multiple types at once\n register.registerTypes(someOtherType, yetAnotherType)\n\n // You can register commands here as well, if you want!\n const commandContainer = script.Parent.commands;\n register.registerCommandsIn(commandContainer)\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"summary",children:"Summary"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Commands are registered using ",(0,s.jsx)(n.code,{children:"registerCommandsIn"})]}),"\n",(0,s.jsxs)(n.li,{children:["Types are registered using ",(0,s.jsx)(n.code,{children:"registerContainer"})]}),"\n"]})]})}function l(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},7540:(e,n,r)=>{r.d(n,{Z:()=>d,a:()=>o});var s=r(959);const t={},i=s.createContext(t);function o(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f03df807.8efbcbb3.js b/assets/js/f03df807.8efbcbb3.js new file mode 100644 index 00000000..1dea0224 --- /dev/null +++ b/assets/js/f03df807.8efbcbb3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[441],{619:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>i,metadata:()=>d,toc:()=>c});var s=r(1527),t=r(7540);const i={description:"Learn how to register commands and types"},o="Registration",d={id:"guides/registration",title:"Registration",description:"Learn how to register commands and types",source:"@site/docs/guides/registration.mdx",sourceDirName:"guides",slug:"/guides/registration",permalink:"/commander/docs/guides/registration",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{description:"Learn how to register commands and types"},sidebar:"docsSidebar",previous:{title:"Types",permalink:"/commander/docs/guides/types"}},a={},c=[{value:"Registering commands",id:"registering-commands",level:2},{value:"Registering types",id:"registering-types",level:2},{value:"Summary",id:"summary",level:2}];function m(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"registration",children:"Registration"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.a,{href:"/commander/docs/guides/commands",children:"Commands"})," and ",(0,s.jsx)(n.a,{href:"/commander/docs/guides/types",children:"Types"})," must be registered in order to be used."]}),"\n",(0,s.jsx)(n.h2,{id:"registering-commands",children:"Registering commands"}),"\n",(0,s.jsxs)(n.p,{children:["In order to register commands, you must use the ",(0,s.jsx)(n.code,{children:"registerCommandsIn"})," method."]}),"\n",(0,s.jsxs)(n.p,{children:["This searches for all children that are a ",(0,s.jsx)(n.code,{children:"ModuleScript"})," in the provided ",(0,s.jsx)(n.code,{children:"Instance"}),". These will then be\nloaded and any methods that have the ",(0,s.jsx)(n.code,{children:"@Command"})," decorator will be registered. Commands will only be registered\nif their parent class has the ",(0,s.jsx)(n.code,{children:"@Commander"})," decorator."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers",children:'CommanderServer.start((registry) => {\n const commandContainer = script.Parent.commands;\n registry.registerCommandsIn(commandContainer)\n}).catch((err) => warn("Commander could not be started:", tostring(err)));\n'})}),"\n",(0,s.jsx)(n.h2,{id:"registering-types",children:"Registering types"}),"\n",(0,s.jsxs)(n.p,{children:["Types should be registered using the ",(0,s.jsx)(n.code,{children:"registerContainer"})," method."]}),"\n",(0,s.jsxs)(n.p,{children:["This searches for all children that are a ",(0,s.jsx)(n.code,{children:"ModuleScript"})," and export a function in the provided ",(0,s.jsx)(n.code,{children:"Instance"}),"."]}),"\n",(0,s.jsx)(n.p,{children:"If any ModuleScripts that export a function are found, the function will be called with the registry."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers",children:"export = (registry: BaseRegistry) => {\n registry.registerType(someType)\n\n // You can also register multiple types at once\n register.registerTypes(someOtherType, yetAnotherType)\n\n // You can register commands here as well, if you want!\n const commandContainer = script.Parent.commands;\n register.registerCommandsIn(commandContainer)\n}\n"})}),"\n",(0,s.jsx)(n.h2,{id:"summary",children:"Summary"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Commands are registered using ",(0,s.jsx)(n.code,{children:"registerCommandsIn"})]}),"\n",(0,s.jsxs)(n.li,{children:["Types are registered using ",(0,s.jsx)(n.code,{children:"registerContainer"})]}),"\n"]})]})}function l(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},7540:(e,n,r)=>{r.d(n,{Z:()=>d,a:()=>o});var s=r(959);const t={},i=s.createContext(t);function o(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.4427136b.js b/assets/js/runtime~main.b1bf70a5.js similarity index 98% rename from assets/js/runtime~main.4427136b.js rename to assets/js/runtime~main.b1bf70a5.js index 6e910232..94e50c5d 100644 --- a/assets/js/runtime~main.4427136b.js +++ b/assets/js/runtime~main.b1bf70a5.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,r,a,o,n={},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=n,d.c=f,e=[],d.O=(t,r,a,o)=>{if(!r){var n=1/0;for(u=0;u=o)&&Object.keys(d.O).every((e=>d.O[e](r[i])))?r.splice(i--,1):(f=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&a&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({33:"a6e64c5a",53:"935f2afb",237:"1df93b7f",326:"0042d53a",338:"15d99295",368:"a94703ab",441:"f03df807",518:"a7bd4aaa",559:"bbaff741",661:"5e95c892",667:"efdcbdaa",868:"6459b84b",907:"457515c8",918:"17896441",923:"10589cea"}[e]||e)+"."+{33:"c77cedad",53:"dff3cb17",237:"755ac2d4",326:"29e23462",338:"aa40b93c",368:"3a5f44e4",441:"28955b70",518:"bfea2e6d",559:"2e2b2bd2",652:"7b987256",661:"5619d354",667:"5c74e30b",868:"36f89981",907:"1d61f4e7",918:"ffcc2052",923:"7f84fb6c"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="docs:",d.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var f,i;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{f.onerror=f.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=b.bind(null,f.onerror),f.onload=b.bind(null,f.onload),i&&document.head.appendChild(f)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/commander/",d.gca=function(e){return e={17896441:"918",a6e64c5a:"33","935f2afb":"53","1df93b7f":"237","0042d53a":"326","15d99295":"338",a94703ab:"368",f03df807:"441",a7bd4aaa:"518",bbaff741:"559","5e95c892":"661",efdcbdaa:"667","6459b84b":"868","457515c8":"907","10589cea":"923"}[e]||e,d.p+d.u(e)},(()=>{var e={303:0,532:0};d.f.j=(t,r)=>{var a=d.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=d.p+d.u(t),f=new Error;d.l(n,(r=>{if(d.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",f.name="ChunkLoadError",f.type=o,f.request=n,a[1](f)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],f=r[1],i=r[2],c=0;if(n.some((t=>0!==e[t]))){for(a in f)d.o(f,a)&&(d.m[a]=f[a]);if(i)var u=i(d)}for(t&&t(r);c{"use strict";var e,t,r,a,o,n={},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=n,d.c=f,e=[],d.O=(t,r,a,o)=>{if(!r){var n=1/0;for(u=0;u=o)&&Object.keys(d.O).every((e=>d.O[e](r[i])))?r.splice(i--,1):(f=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var f=2&a&&e;"object"==typeof f&&!~t.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({33:"a6e64c5a",53:"935f2afb",237:"1df93b7f",326:"0042d53a",338:"15d99295",368:"a94703ab",441:"f03df807",518:"a7bd4aaa",559:"bbaff741",661:"5e95c892",667:"efdcbdaa",868:"6459b84b",907:"457515c8",918:"17896441",923:"10589cea"}[e]||e)+"."+{33:"c77cedad",53:"dff3cb17",237:"755ac2d4",326:"29e23462",338:"aa40b93c",368:"3a5f44e4",441:"8efbcbb3",518:"bfea2e6d",559:"2e2b2bd2",652:"7b987256",661:"5619d354",667:"5c74e30b",868:"36f89981",907:"1d61f4e7",918:"ffcc2052",923:"7f84fb6c"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="docs:",d.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var f,i;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{f.onerror=f.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],f.parentNode&&f.parentNode.removeChild(f),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=b.bind(null,f.onerror),f.onload=b.bind(null,f.onload),i&&document.head.appendChild(f)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/commander/",d.gca=function(e){return e={17896441:"918",a6e64c5a:"33","935f2afb":"53","1df93b7f":"237","0042d53a":"326","15d99295":"338",a94703ab:"368",f03df807:"441",a7bd4aaa:"518",bbaff741:"559","5e95c892":"661",efdcbdaa:"667","6459b84b":"868","457515c8":"907","10589cea":"923"}[e]||e,d.p+d.u(e)},(()=>{var e={303:0,532:0};d.f.j=(t,r)=>{var a=d.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(303|532)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=d.p+d.u(t),f=new Error;d.l(n,(r=>{if(d.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;f.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",f.name="ChunkLoadError",f.type=o,f.request=n,a[1](f)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],f=r[1],i=r[2],c=0;if(n.some((t=>0!==e[t]))){for(a in f)d.o(f,a)&&(d.m[a]=f[a]);if(i)var u=i(d)}for(t&&t(r);c Examples | Commander - + diff --git a/docs/getting-started/installation/index.html b/docs/getting-started/installation/index.html index 0172b4d0..b3d84113 100644 --- a/docs/getting-started/installation/index.html +++ b/docs/getting-started/installation/index.html @@ -4,7 +4,7 @@ Installation | Commander - + diff --git a/docs/guides/commands/index.html b/docs/guides/commands/index.html index dc2029ad..774a181e 100644 --- a/docs/guides/commands/index.html +++ b/docs/guides/commands/index.html @@ -4,7 +4,7 @@ Commands | Commander - + diff --git a/docs/guides/index.html b/docs/guides/index.html index e25f1289..38127636 100644 --- a/docs/guides/index.html +++ b/docs/guides/index.html @@ -4,7 +4,7 @@ Guides | Commander - + diff --git a/docs/guides/registration/index.html b/docs/guides/registration/index.html index 4b23bfa6..c7917893 100644 --- a/docs/guides/registration/index.html +++ b/docs/guides/registration/index.html @@ -4,15 +4,12 @@ Registration | Commander - +

Registration

-
warning

Commands and types can only be registered when starting Commander.

An error will be thrown if you attempt registration after it has been started.

Commands and Types must be registered in order to be used.

-

You can only register commands and types in the callback you provide when starting Commander: -CommanderServer.start and CommanderClient.start.

Registering commands

In order to register commands, you must use the registerCommandsIn method.

This searches for all children that are a ModuleScript in the provided Instance. These will then be diff --git a/docs/guides/types/index.html b/docs/guides/types/index.html index fe07a27b..fc06b507 100644 --- a/docs/guides/types/index.html +++ b/docs/guides/types/index.html @@ -4,7 +4,7 @@ Types | Commander - + diff --git a/docs/index.html b/docs/index.html index a3ebb046..2dd6d0d0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ Getting Started | Commander - + diff --git a/index.html b/index.html index 486cea71..70e865a3 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Commander Documentation | Commander - +