cluaupp 1.5.0 → 1.5.1

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.
Files changed (323) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +10 -5
  3. package/api/CHANGELOG.md +3 -0
  4. package/api/chat.js +74 -0
  5. package/api/fixtures/roblox/README.md +6 -0
  6. package/api/fixtures/roblox/aux/sample.d.luau +6 -0
  7. package/api/fixtures/roblox/mini/Mini-API-Dump.json +72 -0
  8. package/api/generated/bench-latest.json +39 -0
  9. package/api/generated/capability-profile.json +76 -0
  10. package/api/generated/lsp-index.json +1 -0
  11. package/api/generated/luau/classes.d.luau +11221 -0
  12. package/api/generated/luau/datatypes.d.luau +327 -0
  13. package/api/generated/luau/enums.d.luau +4918 -0
  14. package/api/generated/luau/globals.d.luau +12 -0
  15. package/api/manifests/roblox-target.manifest.json +22 -0
  16. package/api/normalized/roblox-target.profile.json +237461 -0
  17. package/api/overrides/classes.json +8 -0
  18. package/api/overrides/compatibility.json +9 -0
  19. package/api/overrides/datatypes.json +1579 -0
  20. package/api/overrides/enums.json +8 -0
  21. package/api/overrides/globals.json +8 -0
  22. package/api/overrides/type-mappings.json +9 -0
  23. package/api/roblox-api.lock.json +9 -0
  24. package/data/Mini-API-Dump.json +1 -0
  25. package/editors/vscode/README.md +12 -10
  26. package/editors/vscode/extension.js +82 -0
  27. package/editors/vscode/icons/axiom.svg +4 -0
  28. package/editors/vscode/icons/bloom.svg +5 -0
  29. package/editors/vscode/icons/helm.svg +4 -0
  30. package/editors/vscode/icons/hive.svg +5 -0
  31. package/editors/vscode/icons/mint.svg +4 -0
  32. package/editors/vscode/icons/shift.svg +6 -0
  33. package/editors/vscode/language-configuration-schema.json +24 -0
  34. package/editors/vscode/package.json +172 -12
  35. package/editors/vscode/snippets/axiom.json +12 -0
  36. package/editors/vscode/snippets/bloom.json +12 -0
  37. package/editors/vscode/snippets/helm.json +12 -0
  38. package/editors/vscode/snippets/hive.json +12 -0
  39. package/editors/vscode/snippets/mint.json +12 -0
  40. package/editors/vscode/snippets/shift.json +17 -0
  41. package/editors/vscode/syntaxes/axiom.tmLanguage.json +5 -0
  42. package/editors/vscode/syntaxes/bloom.tmLanguage.json +5 -0
  43. package/editors/vscode/syntaxes/helm.tmLanguage.json +5 -0
  44. package/editors/vscode/syntaxes/hive.tmLanguage.json +5 -0
  45. package/editors/vscode/syntaxes/mint.tmLanguage.json +5 -0
  46. package/editors/vscode/syntaxes/schema.tmLanguage.json +89 -0
  47. package/editors/vscode/syntaxes/shift.tmLanguage.json +5 -0
  48. package/examples/game/.cluaupp/compile-cache/ReplicatedStorage__Shared__Constants__Datas__TemplateData.clh.json +1 -0
  49. package/examples/game/.cluaupp/compile-cache/ServerScriptService__Boot__DataBoot.server.clpp.json +1 -0
  50. package/examples/game/.cluaupp/compile-cache/ServerScriptService__Configuration__ServerConfig.clp.json +1 -0
  51. package/examples/game/.cluaupp/compile-cache/ServerScriptService__Handlers__Guard.server.clpp.json +1 -0
  52. package/examples/game/.cluaupp/compile-cache/ServerScriptService__Handlers__PlayerHandler.server.clpp.json +1 -0
  53. package/examples/game/.cluaupp/compile-cache/StarterPlayer__StarterCharacterScripts__Character__CharacterReady.client.clpp.json +1 -0
  54. package/examples/game/.cluaupp/compile-cache/StarterPlayer__StarterPlayerScripts__Controllers__DataController.client.clpp.json +1 -0
  55. package/examples/game/.cluaupp/compile-cache/index.json +12 -0
  56. package/examples/game/.cluaupp/datamodel-profile.json +94 -0
  57. package/examples/game/.vscode/settings.json +12 -1
  58. package/examples/game/include/clpp/datatypes.clh +337 -373
  59. package/examples/game/include/clpp/generated/datamodel.clh +25 -0
  60. package/examples/game/include/clpp/generated/enums.clh +1 -1
  61. package/examples/game/include/clpp/generated/instances.clh +41135 -41064
  62. package/examples/game/include/clpp/libs/axiom.clh +1 -1
  63. package/examples/game/include/clpp/libs/math.clh +14 -0
  64. package/examples/game/include/clpp/libs/spring.clh +17 -0
  65. package/examples/game/include/clpp/libs/ward.clh +1 -0
  66. package/examples/game/include/clpp/roblox.clh +3 -4
  67. package/examples/game/libs/ArrayIndexer/init.luau +209 -0
  68. package/examples/game/libs/Axiom/init.luau +608 -0
  69. package/examples/game/libs/Bloom/init.luau +433 -0
  70. package/examples/game/libs/Coil/init.luau +215 -0
  71. package/examples/game/libs/Crest/init.luau +426 -0
  72. package/examples/game/libs/Echo/init.luau +417 -0
  73. package/examples/game/libs/Ember/init.luau +365 -0
  74. package/examples/game/libs/Flare/init.luau +717 -0
  75. package/examples/game/libs/Gleam/init.luau +729 -0
  76. package/examples/game/libs/Guide/init.luau +215 -0
  77. package/examples/game/libs/Helm/init.luau +377 -0
  78. package/examples/game/libs/Hive/init.luau +241 -0
  79. package/examples/game/libs/Keep/Client.luau +114 -0
  80. package/examples/game/libs/Keep/Data.luau +883 -0
  81. package/examples/game/libs/Keep/Engine.luau +211 -0
  82. package/examples/game/libs/Keep/Enum.luau +6 -0
  83. package/examples/game/libs/Keep/Enums.luau +10 -0
  84. package/examples/game/libs/Keep/Path.luau +236 -0
  85. package/examples/game/libs/Keep/Replicator.luau +298 -0
  86. package/examples/game/libs/Keep/Server.luau +251 -0
  87. package/examples/game/libs/Keep/Store.luau +652 -0
  88. package/examples/game/libs/Keep/Trade.luau +455 -0
  89. package/examples/game/libs/Keep/init.luau +205 -0
  90. package/examples/game/libs/Lens/init.luau +609 -0
  91. package/examples/game/libs/Mint/init.luau +279 -0
  92. package/examples/game/libs/Net/init.luau +156 -0
  93. package/examples/game/libs/Net/src/codec.luau +224 -0
  94. package/examples/game/libs/Occlude/init.luau +117 -0
  95. package/examples/game/libs/Pin/init.luau +309 -0
  96. package/examples/game/libs/Promise/LICENSE +21 -0
  97. package/examples/game/libs/Promise/_impl/LICENSE +21 -0
  98. package/examples/game/libs/Promise/_impl/init.lua +1991 -0
  99. package/examples/game/libs/Promise/init.lua +1990 -0
  100. package/examples/game/libs/Promise/init.luau +13 -0
  101. package/examples/game/libs/Promise/types.luau +46 -0
  102. package/examples/game/libs/Roster/init.luau +686 -0
  103. package/examples/game/libs/SOURCES.md +31 -0
  104. package/examples/game/libs/Shift/init.luau +238 -0
  105. package/examples/game/libs/Spark/init.luau +487 -0
  106. package/examples/game/libs/Stage/init.luau +178 -0
  107. package/examples/game/libs/Sweep/init.luau +259 -0
  108. package/examples/game/libs/Trace/init.luau +213 -0
  109. package/examples/game/libs/Ward/init.luau +211 -0
  110. package/examples/game/out/ReplicatedStorage/Shared/Constants/Datas/TemplateData.luau +29 -0
  111. package/examples/game/out/ReplicatedStorage/Shared/Constants/Datas/TemplateData.luau.map.json +13 -0
  112. package/examples/game/out/ReplicatedStorage/Shared/Net/Net.luau +83 -0
  113. package/examples/game/out/ReplicatedStorage/Shared/Net/Net.luau.map.json +13 -0
  114. package/examples/game/out/ServerScriptService/Boot/DataBoot.server.luau +18 -0
  115. package/examples/game/out/ServerScriptService/Boot/DataBoot.server.luau.map.json +13 -0
  116. package/examples/game/out/ServerScriptService/Configuration/ServerConfig.luau +14 -0
  117. package/examples/game/out/ServerScriptService/Configuration/ServerConfig.luau.map.json +13 -0
  118. package/examples/game/out/ServerScriptService/Handlers/Guard.server.luau +15 -0
  119. package/examples/game/out/ServerScriptService/Handlers/Guard.server.luau.map.json +13 -0
  120. package/examples/game/out/ServerScriptService/Handlers/PlayerHandler.server.luau +50 -0
  121. package/examples/game/out/ServerScriptService/Handlers/PlayerHandler.server.luau.map.json +13 -0
  122. package/examples/game/out/StarterPlayer/StarterCharacterScripts/Character/CharacterReady.client.luau +12 -0
  123. package/examples/game/out/StarterPlayer/StarterCharacterScripts/Character/CharacterReady.client.luau.map.json +13 -0
  124. package/examples/game/out/StarterPlayer/StarterPlayerScripts/Controllers/DataController.client.luau +16 -0
  125. package/examples/game/out/StarterPlayer/StarterPlayerScripts/Controllers/DataController.client.luau.map.json +13 -0
  126. package/examples/game/src/ReplicatedStorage/Shared/Net/Net.clh +26 -0
  127. package/examples/game/src/ServerScriptService/Boot/DataBoot.server.clpp +1 -1
  128. package/examples/game/src/ServerScriptService/Handlers/PlayerHandler.server.clpp +1 -1
  129. package/examples/game/stylua.toml +9 -0
  130. package/generated/api/build-profile.js +115 -0
  131. package/generated/api/cache.js +44 -0
  132. package/generated/api/coverage.js +32 -0
  133. package/generated/api/diff.js +125 -0
  134. package/generated/api/generators/clpp-headers.js +353 -0
  135. package/generated/api/generators/docs-reference.js +7 -0
  136. package/generated/api/generators/lsp-index.js +81 -0
  137. package/generated/api/generators/luau-defs.js +94 -0
  138. package/generated/api/ide.js +76 -0
  139. package/generated/api/identifier.js +47 -0
  140. package/generated/api/index.js +324 -0
  141. package/generated/api/loader.js +57 -0
  142. package/generated/api/merge.js +88 -0
  143. package/generated/api/model.js +5 -0
  144. package/generated/api/normalize.js +231 -0
  145. package/generated/api/overrides-validate.js +58 -0
  146. package/generated/api/perf.js +12 -0
  147. package/generated/api/registry.js +136 -0
  148. package/generated/api/release.js +44 -0
  149. package/generated/api/resolver.js +250 -0
  150. package/generated/api/sources/aux-types-diff.js +75 -0
  151. package/generated/api/sources/client-tracker.js +11 -0
  152. package/generated/api/sources/creator-docs.js +42 -0
  153. package/generated/api/sources/luau-types.js +34 -0
  154. package/generated/api/sources/mini-dump.js +17 -0
  155. package/generated/api/sources/studio-api.js +8 -0
  156. package/generated/api/sources/studio-apiv2.js +11 -0
  157. package/generated/api/sources/studio-full-api.js +8 -0
  158. package/generated/api/studio-smoke.js +80 -0
  159. package/generated/api/type-parse.js +49 -0
  160. package/generated/api/understander.js +51 -0
  161. package/generated/api/validate.js +135 -0
  162. package/generated/api-cli.js +421 -0
  163. package/generated/cli.js +16 -5
  164. package/generated/clpp/contract.js +3 -3
  165. package/generated/clpp/format-luau.js +236 -0
  166. package/generated/clpp/index.js +13 -1
  167. package/generated/clpp/modules.js +227 -0
  168. package/generated/clpp/postprocess.js +86 -5
  169. package/generated/clpp/rewrite-janitor.js +145 -0
  170. package/generated/clpp/runner.js +14 -2
  171. package/generated/compile.js +82 -0
  172. package/generated/flare/parse.js +12 -1
  173. package/generated/intellisense.js +57 -1
  174. package/generated/native/index.js +217 -16
  175. package/generated/target/authority-check.js +136 -0
  176. package/generated/target/authority-graph.js +74 -0
  177. package/generated/target/build-cache.js +112 -0
  178. package/generated/target/capabilities.js +89 -0
  179. package/generated/target/capability-profile.js +30 -0
  180. package/generated/target/component-contracts.js +60 -0
  181. package/generated/target/context-check.js +160 -0
  182. package/generated/target/datamodel-check.js +170 -0
  183. package/generated/target/datamodel-generate.js +74 -0
  184. package/generated/target/datamodel.js +233 -0
  185. package/generated/target/diagnostics.js +63 -0
  186. package/generated/target/doctor.js +152 -0
  187. package/generated/target/flare-version.js +58 -0
  188. package/generated/target/get-service.js +69 -0
  189. package/generated/target/lifetime-check.js +47 -0
  190. package/generated/target/luau-stamp.js +39 -0
  191. package/generated/target/optimizer-advise.js +88 -0
  192. package/generated/target/optimizer-apply.js +44 -0
  193. package/generated/target/optimizer-soa.js +254 -0
  194. package/generated/target/parallel-check.js +136 -0
  195. package/generated/target/pgo.js +148 -0
  196. package/generated/target/project-docs.js +69 -0
  197. package/generated/target/project-graph.js +71 -0
  198. package/generated/target/roblox.js +63 -0
  199. package/generated/target/security-check.js +41 -0
  200. package/generated/target/source-map.js +25 -0
  201. package/generated/target/studio-bridge.js +112 -0
  202. package/generated/utils/project.js +178 -8
  203. package/generated/utils/rojo-mapper.js +11 -3
  204. package/include/clpp/datatypes.clh +337 -373
  205. package/include/clpp/generated/enums.clh +1 -1
  206. package/include/clpp/generated/instances.clh +41135 -41064
  207. package/include/clpp/libs/axiom.clh +1 -1
  208. package/include/clpp/libs/hive.clh +1 -0
  209. package/include/clpp/libs/keep.clh +2 -0
  210. package/include/clpp/libs/math.clh +14 -0
  211. package/include/clpp/libs/spring.clh +17 -0
  212. package/include/clpp/libs/ward.clh +1 -0
  213. package/include/clpp/roblox.clh +3 -4
  214. package/package.json +10 -3
  215. package/plugins/CluauppNav/Plugin.luau +207 -0
  216. package/plugins/CluauppNav/ProfileLogger.luau +27 -0
  217. package/plugins/CluauppNav/README.md +24 -0
  218. package/runtime/Axiom/init.luau +10 -7
  219. package/runtime/Coil/init.luau +8 -2
  220. package/runtime/Crest/init.luau +1 -0
  221. package/runtime/Flare/init.luau +2 -1
  222. package/runtime/Gleam/init.luau +15 -4
  223. package/runtime/Hive/init.luau +36 -14
  224. package/runtime/Pin/init.luau +5 -2
  225. package/runtime/Roster/init.luau +2 -0
  226. package/runtime/Spark/init.luau +3 -0
  227. package/runtime/Sweep/init.luau +2 -0
  228. package/runtime/Trace/init.luau +3 -0
  229. package/runtime/Ward/init.luau +38 -5
  230. package/scripts/postinstall-editor.js +17 -0
  231. package/skills/README.md +13 -0
  232. package/skills/clpp-hive-flare/SKILL.md +79 -0
  233. package/skills/clpp-language/SKILL.md +123 -0
  234. package/skills/clpp-language/compiler.md +89 -0
  235. package/skills/clpp-style/SKILL.md +95 -0
  236. package/src/api/build-profile.ts +138 -0
  237. package/src/api/cache.ts +45 -0
  238. package/src/api/coverage.ts +46 -0
  239. package/src/api/diff.ts +143 -0
  240. package/src/api/generators/clpp-headers.ts +377 -0
  241. package/src/api/generators/docs-reference.ts +11 -0
  242. package/src/api/generators/lsp-index.ts +106 -0
  243. package/src/api/generators/luau-defs.ts +98 -0
  244. package/src/api/ide.ts +87 -0
  245. package/src/api/identifier.ts +47 -0
  246. package/src/api/index.ts +269 -0
  247. package/src/api/loader.ts +60 -0
  248. package/src/api/merge.ts +126 -0
  249. package/src/api/model.ts +283 -0
  250. package/src/api/normalize.ts +257 -0
  251. package/src/api/overrides-validate.ts +58 -0
  252. package/src/api/perf.ts +15 -0
  253. package/src/api/registry.ts +162 -0
  254. package/src/api/release.ts +47 -0
  255. package/src/api/resolver.ts +255 -0
  256. package/src/api/sources/aux-types-diff.ts +81 -0
  257. package/src/api/sources/client-tracker.ts +10 -0
  258. package/src/api/sources/creator-docs.ts +37 -0
  259. package/src/api/sources/luau-types.ts +30 -0
  260. package/src/api/sources/mini-dump.ts +50 -0
  261. package/src/api/sources/studio-api.ts +7 -0
  262. package/src/api/sources/studio-apiv2.ts +10 -0
  263. package/src/api/sources/studio-full-api.ts +7 -0
  264. package/src/api/studio-smoke.ts +82 -0
  265. package/src/api/type-parse.ts +48 -0
  266. package/src/api/understander.ts +72 -0
  267. package/src/api/validate.ts +160 -0
  268. package/src/api-cli.ts +493 -0
  269. package/src/api.generated.js +37 -22
  270. package/src/cli.ts +21 -6
  271. package/src/clpp/contract.ts +34 -3
  272. package/src/clpp/format-luau.ts +262 -0
  273. package/src/clpp/index.ts +13 -2
  274. package/src/clpp/modules.ts +252 -0
  275. package/src/clpp/postprocess.ts +100 -5
  276. package/src/clpp/rewrite-janitor.ts +156 -0
  277. package/src/clpp/runner.ts +14 -2
  278. package/src/compile.ts +87 -0
  279. package/src/flare/parse.ts +14 -1
  280. package/src/flare/types.ts +2 -0
  281. package/src/intellisense.ts +58 -1
  282. package/src/native/index.ts +225 -16
  283. package/src/target/authority-check.ts +162 -0
  284. package/src/target/authority-graph.ts +80 -0
  285. package/src/target/build-cache.ts +129 -0
  286. package/src/target/capabilities.ts +115 -0
  287. package/src/target/capability-profile.ts +25 -0
  288. package/src/target/component-contracts.ts +64 -0
  289. package/src/target/context-check.ts +177 -0
  290. package/src/target/datamodel-check.ts +188 -0
  291. package/src/target/datamodel-generate.ts +78 -0
  292. package/src/target/datamodel.ts +261 -0
  293. package/src/target/diagnostics.ts +67 -0
  294. package/src/target/doctor.ts +171 -0
  295. package/src/target/flare-version.ts +61 -0
  296. package/src/target/get-service.ts +85 -0
  297. package/src/target/lifetime-check.ts +45 -0
  298. package/src/target/luau-stamp.ts +33 -0
  299. package/src/target/optimizer-advise.ts +93 -0
  300. package/src/target/optimizer-apply.ts +63 -0
  301. package/src/target/optimizer-soa.ts +270 -0
  302. package/src/target/parallel-check.ts +135 -0
  303. package/src/target/pgo.ts +157 -0
  304. package/src/target/project-docs.ts +68 -0
  305. package/src/target/project-graph.ts +75 -0
  306. package/src/target/roblox.ts +78 -0
  307. package/src/target/security-check.ts +40 -0
  308. package/src/target/source-map.ts +36 -0
  309. package/src/target/studio-bridge.ts +140 -0
  310. package/src/types.ts +14 -0
  311. package/src/utils/project.ts +183 -9
  312. package/src/utils/rojo-mapper.ts +12 -3
  313. package/stylua.toml +9 -0
  314. package/templates/game/.vscode/settings.json +7 -1
  315. package/templates/game/include/clpp/datatypes.clh +337 -373
  316. package/templates/game/include/clpp/generated/enums.clh +1 -1
  317. package/templates/game/include/clpp/generated/instances.clh +41135 -41064
  318. package/templates/game/include/clpp/libs/axiom.clh +1 -1
  319. package/templates/game/include/clpp/libs/ward.clh +1 -0
  320. package/templates/game/include/clpp/roblox.clh +3 -4
  321. package/templates/game/src/ServerScriptService/Boot/DataBoot.server.clpp +1 -1
  322. package/templates/game/src/ServerScriptService/Handlers/PlayerHandler.server.clpp +1 -1
  323. package/templates/game/stylua.toml +9 -0
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.loadJsonFile = loadJsonFile;
7
+ exports.readOverrideFile = readOverrideFile;
8
+ exports.overridesHash = overridesHash;
9
+ const node_fs_1 = __importDefault(require("node:fs"));
10
+ const node_path_1 = __importDefault(require("node:path"));
11
+ const package_info_js_1 = require("../package-info.js");
12
+ const resolver_js_1 = require("./resolver.js");
13
+ function loadJsonFile(id, filePath) {
14
+ const absolute = node_path_1.default.isAbsolute(filePath) ? filePath : node_path_1.default.join(package_info_js_1.projectRoot, filePath);
15
+ if (!node_fs_1.default.existsSync(absolute)) {
16
+ throw new Error(`API source not found: ${absolute}`);
17
+ }
18
+ const raw = node_fs_1.default.readFileSync(absolute);
19
+ const text = raw.toString("utf8");
20
+ const data = JSON.parse(text);
21
+ return {
22
+ meta: {
23
+ id,
24
+ path: absolute,
25
+ hash: (0, resolver_js_1.hashBuffer)(raw),
26
+ loadedAt: new Date().toISOString(),
27
+ version: typeof data.Version !== "undefined"
28
+ ? data.Version
29
+ : undefined,
30
+ },
31
+ data,
32
+ };
33
+ }
34
+ function readOverrideFile(relativeName) {
35
+ const filePath = node_path_1.default.join(package_info_js_1.projectRoot, "api", "overrides", relativeName);
36
+ if (!node_fs_1.default.existsSync(filePath)) {
37
+ return { meta: null, data: {} };
38
+ }
39
+ const parsed = JSON.parse(node_fs_1.default.readFileSync(filePath, "utf8"));
40
+ const meta = parsed._meta || null;
41
+ const { _meta: _, ...rest } = parsed;
42
+ return { meta, data: rest };
43
+ }
44
+ function overridesHash() {
45
+ const dir = node_path_1.default.join(package_info_js_1.projectRoot, "api", "overrides");
46
+ if (!node_fs_1.default.existsSync(dir)) {
47
+ return (0, resolver_js_1.hashBuffer)("");
48
+ }
49
+ const parts = [];
50
+ for (const name of node_fs_1.default.readdirSync(dir).sort()) {
51
+ if (!name.endsWith(".json")) {
52
+ continue;
53
+ }
54
+ parts.push(name, node_fs_1.default.readFileSync(node_path_1.default.join(dir, name), "utf8"));
55
+ }
56
+ return (0, resolver_js_1.hashBuffer)(parts.join("\n"));
57
+ }
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapNamedTypeLike = void 0;
4
+ exports.applyDatatypeOverrides = applyDatatypeOverrides;
5
+ exports.applyGlobalsOverrides = applyGlobalsOverrides;
6
+ exports.applyLibraryOverrides = applyLibraryOverrides;
7
+ exports.applyClassOverrides = applyClassOverrides;
8
+ const type_parse_js_1 = require("./type-parse.js");
9
+ Object.defineProperty(exports, "mapNamedTypeLike", { enumerable: true, get: function () { return type_parse_js_1.mapNamedTypeLike; } });
10
+ function applyDatatypeOverrides(existing, raw) {
11
+ const out = { ...existing };
12
+ for (const [name, spec] of Object.entries(raw)) {
13
+ out[name] = convertDatatypeOverride(name, spec);
14
+ }
15
+ return out;
16
+ }
17
+ function convertDatatypeOverride(name, spec) {
18
+ const fields = (spec.fields || []).map((f) => {
19
+ const parts = f.trim().split(/\s+/);
20
+ const fieldName = parts.pop() || "value";
21
+ const typeStr = parts.join(" ") || "auto";
22
+ return { name: fieldName, type: (0, type_parse_js_1.parseClppTypeString)(typeStr) };
23
+ });
24
+ const constructors = (spec.ctors || []).map((params, i) => ({
25
+ owner: name,
26
+ overloadIndex: i,
27
+ parameters: params.map((p, idx) => parseParamString(p, idx)),
28
+ tags: [],
29
+ }));
30
+ const staticMethods = (spec.staticMethods || []).map((m, i) => ({
31
+ name: m[0],
32
+ owner: name,
33
+ overloadIndex: i,
34
+ parameters: (m[2] || []).map((p, idx) => parseParamString(p, idx)),
35
+ returnTypes: [(0, type_parse_js_1.parseClppTypeString)(m[1])],
36
+ canYield: false,
37
+ tags: ["static"],
38
+ }));
39
+ const instanceMethods = (spec.methods || []).map((m, i) => ({
40
+ name: m[0],
41
+ owner: name,
42
+ overloadIndex: i,
43
+ parameters: (m[2] || []).map((p, idx) => parseParamString(p, idx)),
44
+ returnTypes: [(0, type_parse_js_1.parseClppTypeString)(m[1])],
45
+ canYield: false,
46
+ tags: [],
47
+ }));
48
+ return {
49
+ name,
50
+ summary: spec.summary,
51
+ fields,
52
+ constructors,
53
+ staticProperties: spec.statics || [],
54
+ staticMethods,
55
+ instanceMethods,
56
+ source: "override",
57
+ };
58
+ }
59
+ function parseParamString(raw, index) {
60
+ const parts = raw.trim().split(/\s+/);
61
+ const name = parts.pop() || `arg${index}`;
62
+ const typeStr = parts.join(" ") || "auto";
63
+ const type = (0, type_parse_js_1.parseClppTypeString)(typeStr);
64
+ return { name, type, optional: type.kind === "Optional" };
65
+ }
66
+ function applyGlobalsOverrides(existing, raw) {
67
+ const out = { ...existing };
68
+ for (const [name, g] of Object.entries(raw)) {
69
+ out[name] = {
70
+ name,
71
+ type: g.type ? (0, type_parse_js_1.parseClppTypeString)(g.type) : { kind: "Any" },
72
+ layer: g.layer || "roblox-engine",
73
+ description: g.description,
74
+ };
75
+ }
76
+ return out;
77
+ }
78
+ function applyLibraryOverrides(existing, raw) {
79
+ return { ...existing, ...raw };
80
+ }
81
+ function applyClassOverrides(classes, raw) {
82
+ for (const [name, patch] of Object.entries(raw)) {
83
+ if (!classes[name]) {
84
+ continue;
85
+ }
86
+ Object.assign(classes[name], patch, { name });
87
+ }
88
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /** Canonical Roblox API model for Cluaupp (RobloxTargetProfile schemaVersion 2). */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ROBLOX_TARGET_SCHEMA_VERSION = void 0;
5
+ exports.ROBLOX_TARGET_SCHEMA_VERSION = 2;
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeMiniDump = normalizeMiniDump;
4
+ const resolver_js_1 = require("./resolver.js");
5
+ function tagsOf(member) {
6
+ return Array.isArray(member.Tags)
7
+ ? member.Tags.map((t) => (typeof t === "string" ? t : String(t.PreferredDescriptorName || JSON.stringify(t))))
8
+ : [];
9
+ }
10
+ function hasTag(tags, tag) {
11
+ return tags.some((t) => t.toLowerCase() === tag.toLowerCase());
12
+ }
13
+ function securityString(sec) {
14
+ if (!sec) {
15
+ return undefined;
16
+ }
17
+ if (typeof sec === "string") {
18
+ return sec;
19
+ }
20
+ return sec.Read || sec.Write;
21
+ }
22
+ function mapThreadSafety(raw) {
23
+ if (!raw) {
24
+ return undefined;
25
+ }
26
+ switch (raw) {
27
+ case "Unsafe":
28
+ case "ReadSafe":
29
+ case "LocalSafe":
30
+ case "Safe":
31
+ return raw;
32
+ default:
33
+ return "Unknown";
34
+ }
35
+ }
36
+ function creationPolicy(tags) {
37
+ const service = hasTag(tags, "Service");
38
+ const notCreatable = hasTag(tags, "NotCreatable");
39
+ const deprecated = hasTag(tags, "Deprecated");
40
+ const pluginOnly = hasTag(tags, "PluginSecurity") || hasTag(tags, "NotBrowsable");
41
+ return {
42
+ kind: service ? "service" : notCreatable ? "abstract" : "creatable",
43
+ creatable: !notCreatable && !service,
44
+ service,
45
+ abstract: notCreatable && !service,
46
+ pluginOnly,
47
+ notes: deprecated ? "deprecated" : undefined,
48
+ };
49
+ }
50
+ function parseParams(member) {
51
+ return (member.Parameters || []).map((p, i) => (0, resolver_js_1.mapParameter)(p, i));
52
+ }
53
+ function returnTypes(member) {
54
+ if (member.ReturnType) {
55
+ return [(0, resolver_js_1.mapRobloxType)(member.ReturnType)];
56
+ }
57
+ return [{ kind: "Primitive", name: "void" }];
58
+ }
59
+ function collectUnsupported(type, symbol, unsupported) {
60
+ if (type.kind === "Unsupported") {
61
+ unsupported.push({
62
+ symbol,
63
+ source: "mini-api-dump",
64
+ reason: type.reason,
65
+ fallback: "auto",
66
+ severity: "warning",
67
+ });
68
+ }
69
+ else if (type.kind === "Optional") {
70
+ collectUnsupported(type.inner, symbol, unsupported);
71
+ }
72
+ else if (type.kind === "Array") {
73
+ collectUnsupported(type.element, symbol, unsupported);
74
+ }
75
+ else if (type.kind === "Dictionary" || type.kind === "Map") {
76
+ collectUnsupported(type.key, symbol, unsupported);
77
+ collectUnsupported(type.value, symbol, unsupported);
78
+ }
79
+ else if (type.kind === "Union" || type.kind === "Intersection" || type.kind === "Tuple") {
80
+ const members = type.kind === "Tuple" ? type.elements : type.members;
81
+ for (const m of members) {
82
+ collectUnsupported(m, symbol, unsupported);
83
+ }
84
+ }
85
+ }
86
+ function normalizeClass(raw, unsupported) {
87
+ const tags = tagsOf(raw);
88
+ const creation = creationPolicy(tags);
89
+ const properties = [];
90
+ const methods = [];
91
+ const events = [];
92
+ const callbacks = [];
93
+ const methodOverloads = new Map();
94
+ for (const member of raw.Members || []) {
95
+ const mTags = tagsOf(member);
96
+ const deprecated = hasTag(mTags, "Deprecated")
97
+ ? { deprecated: true, message: "Deprecated in Roblox API dump" }
98
+ : undefined;
99
+ const symbol = `${raw.Name}.${member.Name}`;
100
+ switch (member.MemberType) {
101
+ case "Property": {
102
+ const valueType = (0, resolver_js_1.mapRobloxType)(member.ValueType);
103
+ collectUnsupported(valueType, symbol, unsupported);
104
+ const sec = typeof member.Security === "object" ? member.Security : undefined;
105
+ properties.push({
106
+ name: member.Name,
107
+ owner: raw.Name,
108
+ valueType,
109
+ readable: !hasTag(mTags, "WriteOnly"),
110
+ writable: !hasTag(mTags, "ReadOnly"),
111
+ readSecurity: sec?.Read || (typeof member.Security === "string" ? member.Security : undefined),
112
+ writeSecurity: sec?.Write,
113
+ threadSafety: mapThreadSafety(member.ThreadSafety),
114
+ tags: mTags,
115
+ defaultValue: member.Default,
116
+ deprecated,
117
+ });
118
+ break;
119
+ }
120
+ case "Function":
121
+ case "Method": {
122
+ const idx = methodOverloads.get(member.Name) || 0;
123
+ methodOverloads.set(member.Name, idx + 1);
124
+ const parameters = parseParams(member);
125
+ const returns = returnTypes(member);
126
+ for (const p of parameters) {
127
+ collectUnsupported(p.type, `${symbol}(${p.name})`, unsupported);
128
+ }
129
+ for (const r of returns) {
130
+ collectUnsupported(r, `${symbol}:return`, unsupported);
131
+ }
132
+ methods.push({
133
+ name: member.Name,
134
+ owner: raw.Name,
135
+ overloadIndex: idx,
136
+ parameters,
137
+ returnTypes: returns,
138
+ canYield: hasTag(mTags, "Yields") || hasTag(mTags, "CanYield"),
139
+ security: securityString(member.Security),
140
+ threadSafety: mapThreadSafety(member.ThreadSafety),
141
+ tags: mTags,
142
+ deprecated,
143
+ });
144
+ break;
145
+ }
146
+ case "Event": {
147
+ const parameters = parseParams(member);
148
+ for (const p of parameters) {
149
+ collectUnsupported(p.type, `${symbol}(${p.name})`, unsupported);
150
+ }
151
+ events.push({
152
+ name: member.Name,
153
+ owner: raw.Name,
154
+ parameters,
155
+ listenSecurity: securityString(member.Security),
156
+ threadSafety: mapThreadSafety(member.ThreadSafety),
157
+ tags: mTags,
158
+ deprecated,
159
+ });
160
+ break;
161
+ }
162
+ case "Callback": {
163
+ const parameters = parseParams(member);
164
+ const returns = returnTypes(member);
165
+ callbacks.push({
166
+ name: member.Name,
167
+ owner: raw.Name,
168
+ parameters,
169
+ returnTypes: returns,
170
+ canYield: hasTag(mTags, "Yields"),
171
+ security: securityString(member.Security),
172
+ threadSafety: mapThreadSafety(member.ThreadSafety),
173
+ tags: mTags,
174
+ deprecated,
175
+ });
176
+ break;
177
+ }
178
+ default:
179
+ unsupported.push({
180
+ symbol,
181
+ source: "mini-api-dump",
182
+ reason: `Unhandled MemberType ${member.MemberType}`,
183
+ fallback: "skip",
184
+ severity: "info",
185
+ });
186
+ }
187
+ }
188
+ return {
189
+ name: raw.Name,
190
+ superclass: raw.Superclass && raw.Superclass !== "<<<ROOT>>>" ? raw.Superclass : null,
191
+ subclasses: [],
192
+ tags,
193
+ deprecated: hasTag(tags, "Deprecated") ? { deprecated: true } : undefined,
194
+ creatable: creation.creatable,
195
+ service: creation.service,
196
+ creation,
197
+ properties,
198
+ methods,
199
+ events,
200
+ callbacks,
201
+ constructors: [],
202
+ };
203
+ }
204
+ function normalizeMiniDump(dump) {
205
+ const unsupported = [];
206
+ const classes = {};
207
+ for (const raw of dump.Classes) {
208
+ classes[raw.Name] = normalizeClass(raw, unsupported);
209
+ }
210
+ for (const cls of Object.values(classes)) {
211
+ if (cls.superclass && classes[cls.superclass]) {
212
+ classes[cls.superclass].subclasses.push(cls.name);
213
+ }
214
+ }
215
+ for (const cls of Object.values(classes)) {
216
+ cls.subclasses.sort();
217
+ }
218
+ const enums = {};
219
+ for (const e of dump.Enums) {
220
+ enums[e.Name] = {
221
+ name: e.Name,
222
+ items: (e.Items || []).map((item) => ({
223
+ name: item.Name,
224
+ numericValue: item.Value,
225
+ tags: [],
226
+ })),
227
+ tags: [],
228
+ };
229
+ }
230
+ return { classes, enums, unsupported };
231
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.validateOverrides = validateOverrides;
7
+ exports.diffOverrideFiles = diffOverrideFiles;
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const package_info_js_1 = require("../package-info.js");
11
+ /** Validate override JSON files carry audit metadata. */
12
+ function validateOverrides() {
13
+ const dir = node_path_1.default.join(package_info_js_1.projectRoot, "api", "overrides");
14
+ const issues = [];
15
+ if (!node_fs_1.default.existsSync(dir)) {
16
+ return [{ file: "api/overrides", message: "overrides directory missing" }];
17
+ }
18
+ for (const name of node_fs_1.default.readdirSync(dir).sort()) {
19
+ if (!name.endsWith(".json")) {
20
+ continue;
21
+ }
22
+ const full = node_path_1.default.join(dir, name);
23
+ const parsed = JSON.parse(node_fs_1.default.readFileSync(full, "utf8"));
24
+ if (!parsed._meta) {
25
+ issues.push({ file: name, message: "missing _meta" });
26
+ continue;
27
+ }
28
+ for (const key of ["reason", "source", "introducedAt"]) {
29
+ if (!parsed._meta[key]) {
30
+ issues.push({ file: name, message: `missing _meta.${key}` });
31
+ }
32
+ }
33
+ }
34
+ return issues;
35
+ }
36
+ function diffOverrideFiles(beforeDir, afterDir) {
37
+ const before = new Set(node_fs_1.default.existsSync(beforeDir) ? node_fs_1.default.readdirSync(beforeDir).filter((f) => f.endsWith(".json")) : []);
38
+ const after = new Set(node_fs_1.default.existsSync(afterDir) ? node_fs_1.default.readdirSync(afterDir).filter((f) => f.endsWith(".json")) : []);
39
+ const changes = [];
40
+ for (const f of after) {
41
+ if (!before.has(f)) {
42
+ changes.push(`ADDED ${f}`);
43
+ }
44
+ else {
45
+ const a = node_fs_1.default.readFileSync(node_path_1.default.join(beforeDir, f), "utf8");
46
+ const b = node_fs_1.default.readFileSync(node_path_1.default.join(afterDir, f), "utf8");
47
+ if (a !== b) {
48
+ changes.push(`CHANGED ${f}`);
49
+ }
50
+ }
51
+ }
52
+ for (const f of before) {
53
+ if (!after.has(f)) {
54
+ changes.push(`REMOVED ${f}`);
55
+ }
56
+ }
57
+ return changes;
58
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timeCall = timeCall;
4
+ exports.formatPerf = formatPerf;
5
+ function timeCall(label, fn) {
6
+ const started = Date.now();
7
+ const value = fn();
8
+ return { value, sample: { label, ms: Date.now() - started } };
9
+ }
10
+ function formatPerf(samples) {
11
+ return samples.map((s) => `${s.label}=${s.ms}ms`).join(" ");
12
+ }
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildRegistry = buildRegistry;
4
+ exports.flattenMembers = flattenMembers;
5
+ exports.deriveServices = deriveServices;
6
+ exports.searchRegistry = searchRegistry;
7
+ function buildRegistry(profile) {
8
+ const classes = new Map(Object.entries(profile.classes));
9
+ const services = new Map(Object.entries(profile.services));
10
+ const enums = new Map(Object.entries(profile.enums));
11
+ const datatypes = new Map(Object.entries(profile.datatypes));
12
+ const members = new Map();
13
+ const methods = new Map();
14
+ const properties = new Map();
15
+ const events = new Map();
16
+ const ancestors = new Map();
17
+ for (const cls of classes.values()) {
18
+ ancestors.set(cls.name, collectAncestors(cls.name, profile.classes));
19
+ for (const prop of cls.properties) {
20
+ const key = `${cls.name}.${prop.name}`;
21
+ properties.set(key, prop);
22
+ members.set(key, { owner: cls.name, kind: "property", name: prop.name });
23
+ }
24
+ for (const method of cls.methods) {
25
+ const key = `${cls.name}.${method.name}`;
26
+ const list = methods.get(key) || [];
27
+ list.push(method);
28
+ methods.set(key, list);
29
+ members.set(key, { owner: cls.name, kind: "method", name: method.name });
30
+ }
31
+ for (const event of cls.events) {
32
+ const key = `${cls.name}.${event.name}`;
33
+ events.set(key, event);
34
+ members.set(key, { owner: cls.name, kind: "event", name: event.name });
35
+ }
36
+ for (const cb of cls.callbacks) {
37
+ members.set(`${cls.name}.${cb.name}`, { owner: cls.name, kind: "callback", name: cb.name });
38
+ }
39
+ }
40
+ return {
41
+ profile,
42
+ classes,
43
+ services,
44
+ enums,
45
+ datatypes,
46
+ members,
47
+ methods,
48
+ properties,
49
+ events,
50
+ ancestors,
51
+ };
52
+ }
53
+ function collectAncestors(name, classes) {
54
+ const chain = [];
55
+ let current = classes[name]?.superclass || null;
56
+ const seen = new Set();
57
+ while (current && !seen.has(current)) {
58
+ seen.add(current);
59
+ chain.push(current);
60
+ current = classes[current]?.superclass || null;
61
+ }
62
+ return chain;
63
+ }
64
+ /** Flattened IntelliSense view — does not mutate ClassGraph. */
65
+ function flattenMembers(registry, className) {
66
+ const order = [className, ...(registry.ancestors.get(className) || [])];
67
+ const properties = [];
68
+ const methods = [];
69
+ const events = [];
70
+ const seenProp = new Set();
71
+ const seenMethod = new Set();
72
+ const seenEvent = new Set();
73
+ for (const name of order) {
74
+ const cls = registry.classes.get(name);
75
+ if (!cls) {
76
+ continue;
77
+ }
78
+ for (const p of cls.properties) {
79
+ if (!seenProp.has(p.name)) {
80
+ seenProp.add(p.name);
81
+ properties.push(p);
82
+ }
83
+ }
84
+ for (const m of cls.methods) {
85
+ const key = `${m.name}#${m.overloadIndex}`;
86
+ if (!seenMethod.has(key)) {
87
+ seenMethod.add(key);
88
+ methods.push(m);
89
+ }
90
+ }
91
+ for (const e of cls.events) {
92
+ if (!seenEvent.has(e.name)) {
93
+ seenEvent.add(e.name);
94
+ events.push(e);
95
+ }
96
+ }
97
+ }
98
+ return { properties, methods, events };
99
+ }
100
+ function deriveServices(classes) {
101
+ const services = {};
102
+ for (const cls of Object.values(classes)) {
103
+ if (!cls.service && !cls.creation.service) {
104
+ continue;
105
+ }
106
+ services[cls.name] = {
107
+ name: cls.name,
108
+ className: cls.name,
109
+ kind: "service",
110
+ accessor: "game:GetService",
111
+ singleton: true,
112
+ type: { kind: "Class", name: cls.name },
113
+ };
114
+ }
115
+ return services;
116
+ }
117
+ function searchRegistry(registry, query, limit = 50) {
118
+ const q = query.toLowerCase();
119
+ const hits = [];
120
+ for (const name of registry.classes.keys()) {
121
+ if (name.toLowerCase().includes(q)) {
122
+ hits.push({ kind: "class", symbol: name });
123
+ }
124
+ }
125
+ for (const name of registry.enums.keys()) {
126
+ if (name.toLowerCase().includes(q)) {
127
+ hits.push({ kind: "enum", symbol: name });
128
+ }
129
+ }
130
+ for (const [key] of registry.members) {
131
+ if (key.toLowerCase().includes(q)) {
132
+ hits.push({ kind: "member", symbol: key });
133
+ }
134
+ }
135
+ return hits.slice(0, limit);
136
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildReleaseChecklist = buildReleaseChecklist;
7
+ exports.writeApiChangelog = writeApiChangelog;
8
+ /** Release / checksum helpers for Roblox Target artifacts. */
9
+ const node_fs_1 = __importDefault(require("node:fs"));
10
+ const node_path_1 = __importDefault(require("node:path"));
11
+ const package_info_js_1 = require("../package-info.js");
12
+ const package_info_js_2 = require("../package-info.js");
13
+ const resolver_js_1 = require("./resolver.js");
14
+ const model_js_1 = require("./model.js");
15
+ function buildReleaseChecklist() {
16
+ const lockPath = node_path_1.default.join(package_info_js_1.projectRoot, "api", "roblox-api.lock.json");
17
+ const manifestPath = node_path_1.default.join(package_info_js_1.projectRoot, "api", "manifests", "roblox-target.manifest.json");
18
+ const checksums = {};
19
+ for (const rel of [
20
+ "include/clpp/generated/enums.clh",
21
+ "include/clpp/datatypes.clh",
22
+ "include/clpp/generated/instances.clh",
23
+ "api/overrides/datatypes.json",
24
+ ]) {
25
+ const full = node_path_1.default.join(package_info_js_1.projectRoot, rel);
26
+ if (node_fs_1.default.existsSync(full)) {
27
+ checksums[rel] = (0, resolver_js_1.hashBuffer)(node_fs_1.default.readFileSync(full));
28
+ }
29
+ }
30
+ return {
31
+ schemaVersion: model_js_1.ROBLOX_TARGET_SCHEMA_VERSION,
32
+ generatorVersion: package_info_js_2.pkg.version,
33
+ lockPresent: node_fs_1.default.existsSync(lockPath),
34
+ manifestPresent: node_fs_1.default.existsSync(manifestPath),
35
+ checksums,
36
+ };
37
+ }
38
+ function writeApiChangelog(entries, outPath) {
39
+ const target = outPath || node_path_1.default.join(package_info_js_1.projectRoot, "api", "CHANGELOG.md");
40
+ const body = [`# Roblox API changelog`, ``, ...entries.map((e) => `- ${e}`), ``].join("\n");
41
+ node_fs_1.default.mkdirSync(node_path_1.default.dirname(target), { recursive: true });
42
+ node_fs_1.default.writeFileSync(target, body, "utf8");
43
+ return target;
44
+ }