@quenty/cmdrservice 13.22.3 → 13.22.4-canary.559.339cfa7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [13.22.4-canary.559.339cfa7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/cmdrservice@13.22.3...@quenty/cmdrservice@13.22.4-canary.559.339cfa7.0) (2025-05-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [13.22.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/cmdrservice@13.22.2...@quenty/cmdrservice@13.22.3) (2025-04-10)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/cmdrservice
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/cmdrservice",
3
- "version": "13.22.3",
3
+ "version": "13.22.4-canary.559.339cfa7.0",
4
4
  "description": "Bridge between cmdr and Nevermore services using servicebag",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,18 +25,18 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/loader": "^10.8.3",
29
- "@quenty/maid": "^3.4.3",
30
- "@quenty/permissionprovider": "^14.19.3",
31
- "@quenty/promise": "^10.10.4",
32
- "@quenty/remoting": "^12.18.3",
33
- "@quenty/servicebag": "^11.11.4",
34
- "@quenty/string": "^3.3.3",
35
- "@quenty/templateprovider": "^11.18.3",
28
+ "@quenty/loader": "10.8.4-canary.559.339cfa7.0",
29
+ "@quenty/maid": "3.4.4-canary.559.339cfa7.0",
30
+ "@quenty/permissionprovider": "14.19.4-canary.559.339cfa7.0",
31
+ "@quenty/promise": "10.10.5-canary.559.339cfa7.0",
32
+ "@quenty/remoting": "12.18.4-canary.559.339cfa7.0",
33
+ "@quenty/servicebag": "11.11.5-canary.559.339cfa7.0",
34
+ "@quenty/string": "3.3.3",
35
+ "@quenty/templateprovider": "11.18.4-canary.559.339cfa7.0",
36
36
  "@quentystudios/cmdr": "^1.12.0-quenty.0"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
41
+ "gitHead": "339cfa778736f08768ed7305041f6221faa35bfc"
42
42
  }
@@ -7,17 +7,17 @@
7
7
 
8
8
  local require = require(script.Parent.loader).load(script)
9
9
 
10
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
11
10
  local Players = game:GetService("Players")
11
+ local ReplicatedStorage = game:GetService("ReplicatedStorage")
12
12
  local RunService = game:GetService("RunService")
13
13
 
14
14
  local Maid = require("Maid")
15
15
  local PermissionServiceClient = require("PermissionServiceClient")
16
16
  local Promise = require("Promise")
17
- local promiseChild = require("promiseChild")
18
17
  local PromiseUtils = require("PromiseUtils")
18
+ local ServiceBag = require("ServiceBag")
19
19
  local String = require("String")
20
- local _ServiceBag = require("ServiceBag")
20
+ local promiseChild = require("promiseChild")
21
21
 
22
22
  local CmdrServiceClient = {}
23
23
  CmdrServiceClient.ServiceName = "CmdrServiceClient"
@@ -26,7 +26,7 @@ CmdrServiceClient.ServiceName = "CmdrServiceClient"
26
26
  Starts the cmdr service on the client. Should be done via [ServiceBag].
27
27
  @param serviceBag ServiceBag
28
28
  ]=]
29
- function CmdrServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
29
+ function CmdrServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
30
30
  assert(not self._serviceBag, "Already initialized")
31
31
  self._serviceBag = assert(serviceBag, "No serviceBag")
32
32
  self._maid = Maid.new()
@@ -80,20 +80,20 @@ end
80
80
  function CmdrServiceClient:Start()
81
81
  assert(self._serviceBag, "Not initialized")
82
82
 
83
- self._maid:GivePromise(PromiseUtils.all({
84
- self:PromiseCmdr(),
85
- self._maid:GivePromise(self._permissionServiceClient:PromisePermissionProvider())
86
- :Then(function(provider)
83
+ self._maid
84
+ :GivePromise(PromiseUtils.all({
85
+ self:PromiseCmdr(),
86
+ self._maid:GivePromise(self._permissionServiceClient:PromisePermissionProvider()):Then(function(provider)
87
87
  return provider:PromiseIsAdmin()
88
- end)
89
- }))
90
- :Then(function(cmdr, isAdmin)
91
- if isAdmin then
92
- self:_setBindings(cmdr)
93
- else
94
- cmdr:SetActivationKeys({})
95
- end
96
- end)
88
+ end),
89
+ }))
90
+ :Then(function(cmdr, isAdmin)
91
+ if isAdmin then
92
+ self:_setBindings(cmdr)
93
+ else
94
+ cmdr:SetActivationKeys({})
95
+ end
96
+ end)
97
97
  end
98
98
 
99
99
  function CmdrServiceClient:_setBindings(cmdr)
@@ -107,7 +107,6 @@ function CmdrServiceClient:_setBindings(cmdr)
107
107
  end
108
108
  end))
109
109
 
110
-
111
110
  -- Race condition
112
111
  task.defer(function()
113
112
  -- Default blink for debugging purposes
@@ -132,7 +131,8 @@ function CmdrServiceClient:PromiseCmdr()
132
131
  timeout = 1e10
133
132
  end
134
133
 
135
- self._cmdrPromise = self._maid:GivePromise(promiseChild(ReplicatedStorage, "CmdrClient", timeout))
134
+ self._cmdrPromise = self._maid
135
+ :GivePromise(promiseChild(ReplicatedStorage, "CmdrClient", timeout))
136
136
  :Then(function(cmdClient)
137
137
  return Promise.spawn(function(resolve, _reject)
138
138
  -- Requiring cmdr can yield
@@ -148,4 +148,4 @@ function CmdrServiceClient:Destroy()
148
148
  self._maid:DoCleaning()
149
149
  end
150
150
 
151
- return CmdrServiceClient
151
+ return CmdrServiceClient
@@ -12,11 +12,11 @@ local HttpService = game:GetService("HttpService")
12
12
  local RunService = game:GetService("RunService")
13
13
 
14
14
  local CmdrTemplateProviderServer = require("CmdrTemplateProviderServer")
15
- local Promise = require("Promise")
15
+ local CmdrTypes = require("CmdrTypes")
16
16
  local Maid = require("Maid")
17
17
  local PermissionService = require("PermissionService")
18
- local _ServiceBag = require("ServiceBag")
19
- local _CmdrTypes = require("CmdrTypes")
18
+ local Promise = require("Promise")
19
+ local ServiceBag = require("ServiceBag")
20
20
 
21
21
  local CmdrService = {}
22
22
  CmdrService.ServiceName = "CmdrService"
@@ -24,13 +24,13 @@ CmdrService.ServiceName = "CmdrService"
24
24
  export type CmdrService = typeof(setmetatable(
25
25
  {} :: {
26
26
  _maid: Maid.Maid,
27
- _serviceBag: _ServiceBag.ServiceBag,
27
+ _serviceBag: ServiceBag.ServiceBag,
28
28
  _serviceId: string,
29
29
  _promiseCmdr: Promise.Promise<any>,
30
30
  _cmdrTemplateProviderServer: any,
31
31
  _permissionService: PermissionService.PermissionService,
32
- _definitionData: { [string]: _CmdrTypes.CommandDefinition },
33
- _executeData: { [string]: (context: _CmdrTypes.CommandContext, ...any) -> string? },
32
+ _definitionData: { [string]: CmdrTypes.CommandDefinition },
33
+ _executeData: { [string]: (context: CmdrTypes.CommandContext, ...any) -> string? },
34
34
  },
35
35
  {} :: typeof({ __index = CmdrService })
36
36
  ))
@@ -41,7 +41,7 @@ local GLOBAL_REGISTRY = setmetatable({}, { __mode = "kv" })
41
41
  Initializes the CmdrService. Should be done via [ServiceBag].
42
42
  @param serviceBag ServiceBag
43
43
  ]=]
44
- function CmdrService.Init(self: CmdrService, serviceBag: _ServiceBag.ServiceBag)
44
+ function CmdrService.Init(self: CmdrService, serviceBag: ServiceBag.ServiceBag)
45
45
  assert(not (self :: any)._serviceBag, "Already initialized")
46
46
  self._maid = Maid.new()
47
47
  self._serviceBag = assert(serviceBag, "No serviceBag")
@@ -127,8 +127,8 @@ end
127
127
  ]=]
128
128
  function CmdrService.RegisterCommand(
129
129
  self: CmdrService,
130
- commandData: _CmdrTypes.CommandDefinition,
131
- execute: (context: _CmdrTypes.CommandContext, ...any) -> string?
130
+ commandData: CmdrTypes.CommandDefinition,
131
+ execute: (context: CmdrTypes.CommandContext, ...any) -> string?
132
132
  ): ()
133
133
  assert((self :: any)._promiseCmdr, "Not initialized")
134
134
  assert(commandData, "No commandData")
@@ -206,4 +206,4 @@ function CmdrService.Destroy(self: CmdrService)
206
206
  self._maid:DoCleaning()
207
207
  end
208
208
 
209
- return CmdrService
209
+ return CmdrService
@@ -6,4 +6,4 @@
6
6
  local HttpService = game:GetService("HttpService")
7
7
 
8
8
  local value = script:WaitForChild("CmdrJsonCommandData")
9
- return HttpService:JSONDecode(value.Value)
9
+ return HttpService:JSONDecode(value.Value)
@@ -19,4 +19,4 @@ local cmdrService = commandServiceDefinition:__getServiceFromId(cmdrServiceId)
19
19
 
20
20
  return function(...)
21
21
  return cmdrService:__executeCommand(cmdrCommandId, ...)
22
- end
22
+ end
@@ -7,4 +7,4 @@ local require = require(script.Parent.loader).load(script)
7
7
 
8
8
  local TemplateProvider = require("TemplateProvider")
9
9
 
10
- return TemplateProvider.new(script.Name, script)
10
+ return TemplateProvider.new(script.Name, script)
@@ -1,46 +1,46 @@
1
1
  --!strict
2
2
 
3
3
  export type NamedObject = {
4
- Name: string
4
+ Name: string,
5
5
  }
6
6
 
7
7
  export type TypeDefinition<T> = {
8
- DisplayName: string?,
9
- Prefixes: string?,
10
- Transform: ((string, Player) -> T)?,
11
- Validate: ((T) -> (boolean, string?) | boolean)?,
12
- ValidateOnce: ((T) -> (boolean, string?) | boolean)?,
13
- Autocomplete: ((T) -> ({ string }, { IsPartial: boolean? }?) | { string })?,
14
- Parse: (T) -> any,
15
- Default: ((Player) -> string)?,
16
- Listable: boolean?,
8
+ DisplayName: string?,
9
+ Prefixes: string?,
10
+ Transform: ((string, Player) -> T)?,
11
+ Validate: ((T) -> (boolean, string?) | boolean)?,
12
+ ValidateOnce: ((T) -> (boolean, string?) | boolean)?,
13
+ Autocomplete: ((T) -> ({ string }, { IsPartial: boolean? }?) | { string })?,
14
+ Parse: (T) -> any,
15
+ Default: ((Player) -> string)?,
16
+ Listable: boolean?,
17
17
  }
18
18
 
19
19
  export type CommandArgument = {
20
- Type: string | TypeDefinition<any>,
21
- Name: string,
22
- Description: string,
23
- Optional: boolean?,
24
- Default: any?,
20
+ Type: string | TypeDefinition<any>,
21
+ Name: string,
22
+ Description: string,
23
+ Optional: boolean?,
24
+ Default: any?,
25
25
  }
26
26
 
27
27
  export type CommandContext = {
28
- GetData: (self: CommandContext) -> any,
29
- GetPlayer: (self: CommandContext) -> Player,
30
- GetArgs: (self: CommandContext) -> { any },
31
- GetCommandName: (self: CommandContext) -> string,
32
- GetCommandId: (self: CommandContext) -> string,
28
+ GetData: (self: CommandContext) -> any,
29
+ GetPlayer: (self: CommandContext) -> Player,
30
+ GetArgs: (self: CommandContext) -> { any },
31
+ GetCommandName: (self: CommandContext) -> string,
32
+ GetCommandId: (self: CommandContext) -> string,
33
33
  }
34
34
 
35
35
  export type CommandDefinition = {
36
- Name: string,
37
- Aliases: { string }?,
38
- Description: string,
39
- Group: any?,
40
- Args: { CommandArgument | (CommandContext) -> CommandArgument },
41
- Data: ((CommandContext) -> any)?,
42
- ClientRun: ((CommandContext, ...any) -> string?)?,
43
- AutoExec: { string }?,
36
+ Name: string,
37
+ Aliases: { string }?,
38
+ Description: string,
39
+ Group: any?,
40
+ Args: { CommandArgument | (CommandContext) -> CommandArgument },
41
+ Data: ((CommandContext) -> any)?,
42
+ ClientRun: ((CommandContext, ...any) -> string?)?,
43
+ AutoExec: { string }?,
44
44
  }
45
45
 
46
- return {}
46
+ return {}
@@ -9,4 +9,4 @@ local serviceBag = require("ServiceBag").new()
9
9
  serviceBag:GetService(require("CmdrServiceClient"))
10
10
 
11
11
  serviceBag:Init()
12
- serviceBag:Start()
12
+ serviceBag:Start()
@@ -13,17 +13,17 @@ serviceBag:Init()
13
13
  serviceBag:Start()
14
14
 
15
15
  serviceBag:GetService(require("CmdrService")):RegisterCommand({
16
- Name = "explode";
17
- Aliases = { "boom" };
18
- Description = "Makes players explode";
19
- Group = "Admin";
16
+ Name = "explode",
17
+ Aliases = { "boom" },
18
+ Description = "Makes players explode",
19
+ Group = "Admin",
20
20
  Args = {
21
21
  {
22
- Name = "Players";
23
- Type = "players";
24
- Description = "Victims";
22
+ Name = "Players",
23
+ Type = "players",
24
+ Description = "Victims",
25
25
  },
26
- };
26
+ },
27
27
  }, function(_context, players)
28
28
  for _, player in players do
29
29
  local humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")
@@ -36,4 +36,4 @@ serviceBag:GetService(require("CmdrService")):RegisterCommand({
36
36
  end
37
37
 
38
38
  return "Exploded!"
39
- end)
39
+ end)