cluaupp 1.4.1 → 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.
- package/CHANGELOG.md +55 -0
- package/README.md +10 -5
- package/api/CHANGELOG.md +3 -0
- package/api/chat.js +74 -0
- package/api/fixtures/roblox/README.md +6 -0
- package/api/fixtures/roblox/aux/sample.d.luau +6 -0
- package/api/fixtures/roblox/mini/Mini-API-Dump.json +72 -0
- package/api/generated/bench-latest.json +39 -0
- package/api/generated/capability-profile.json +76 -0
- package/api/generated/lsp-index.json +1 -0
- package/api/generated/luau/classes.d.luau +11221 -0
- package/api/generated/luau/datatypes.d.luau +327 -0
- package/api/generated/luau/enums.d.luau +4918 -0
- package/api/generated/luau/globals.d.luau +12 -0
- package/api/manifests/roblox-target.manifest.json +22 -0
- package/api/normalized/roblox-target.profile.json +237461 -0
- package/api/overrides/classes.json +8 -0
- package/api/overrides/compatibility.json +9 -0
- package/api/overrides/datatypes.json +1579 -0
- package/api/overrides/enums.json +8 -0
- package/api/overrides/globals.json +8 -0
- package/api/overrides/type-mappings.json +9 -0
- package/api/roblox-api.lock.json +9 -0
- package/data/Mini-API-Dump.json +1 -0
- package/editors/vscode/README.md +19 -0
- package/editors/vscode/extension.js +222 -21
- package/editors/vscode/icons/axiom.svg +4 -0
- package/editors/vscode/icons/bloom.svg +5 -0
- package/editors/vscode/icons/flare.svg +5 -0
- package/editors/vscode/icons/helm.svg +4 -0
- package/editors/vscode/icons/hive.svg +5 -0
- package/editors/vscode/icons/mint.svg +4 -0
- package/editors/vscode/icons/shift.svg +6 -0
- package/editors/vscode/language-configuration-schema.json +24 -0
- package/editors/vscode/language-configuration.json +21 -0
- package/editors/vscode/package.json +220 -6
- package/editors/vscode/snippets/axiom.json +12 -0
- package/editors/vscode/snippets/bloom.json +12 -0
- package/editors/vscode/snippets/flare.json +27 -0
- package/editors/vscode/snippets/helm.json +12 -0
- package/editors/vscode/snippets/hive.json +12 -0
- package/editors/vscode/snippets/mint.json +12 -0
- package/editors/vscode/snippets/shift.json +17 -0
- package/editors/vscode/syntaxes/axiom.tmLanguage.json +5 -0
- package/editors/vscode/syntaxes/bloom.tmLanguage.json +5 -0
- package/editors/vscode/syntaxes/flare.tmLanguage.json +75 -0
- package/editors/vscode/syntaxes/helm.tmLanguage.json +5 -0
- package/editors/vscode/syntaxes/hive.tmLanguage.json +5 -0
- package/editors/vscode/syntaxes/mint.tmLanguage.json +5 -0
- package/editors/vscode/syntaxes/schema.tmLanguage.json +89 -0
- package/editors/vscode/syntaxes/shift.tmLanguage.json +5 -0
- package/examples/game/.cluaupp/compile-cache/ReplicatedStorage__Shared__Constants__Datas__TemplateData.clh.json +1 -0
- package/examples/game/.cluaupp/compile-cache/ServerScriptService__Boot__DataBoot.server.clpp.json +1 -0
- package/examples/game/.cluaupp/compile-cache/ServerScriptService__Configuration__ServerConfig.clp.json +1 -0
- package/examples/game/.cluaupp/compile-cache/ServerScriptService__Handlers__Guard.server.clpp.json +1 -0
- package/examples/game/.cluaupp/compile-cache/ServerScriptService__Handlers__PlayerHandler.server.clpp.json +1 -0
- package/examples/game/.cluaupp/compile-cache/StarterPlayer__StarterCharacterScripts__Character__CharacterReady.client.clpp.json +1 -0
- package/examples/game/.cluaupp/compile-cache/StarterPlayer__StarterPlayerScripts__Controllers__DataController.client.clpp.json +1 -0
- package/examples/game/.cluaupp/compile-cache/index.json +12 -0
- package/examples/game/.cluaupp/datamodel-profile.json +94 -0
- package/examples/game/.vscode/extensions.json +3 -1
- package/examples/game/.vscode/settings.json +13 -1
- package/examples/game/include/clpp/datatypes.clh +337 -373
- package/examples/game/include/clpp/generated/datamodel.clh +25 -0
- package/examples/game/include/clpp/generated/enums.clh +1 -1
- package/examples/game/include/clpp/generated/instances.clh +41135 -41064
- package/examples/game/include/clpp/libs/axiom.clh +1 -1
- package/examples/game/include/clpp/libs/math.clh +14 -0
- package/examples/game/include/clpp/libs/roster.clh +6 -0
- package/examples/game/include/clpp/libs/spring.clh +17 -0
- package/examples/game/include/clpp/libs/ward.clh +1 -0
- package/examples/game/include/clpp/roblox.clh +3 -4
- package/examples/game/libs/ArrayIndexer/init.luau +209 -0
- package/examples/game/libs/Axiom/init.luau +608 -0
- package/examples/game/libs/Bloom/init.luau +433 -0
- package/examples/game/libs/Coil/init.luau +215 -0
- package/examples/game/libs/Crest/init.luau +426 -0
- package/examples/game/libs/Echo/init.luau +417 -0
- package/examples/game/libs/Ember/init.luau +365 -0
- package/examples/game/libs/Flare/init.luau +717 -0
- package/examples/game/libs/Gleam/init.luau +729 -0
- package/examples/game/libs/Guide/init.luau +215 -0
- package/examples/game/libs/Helm/init.luau +377 -0
- package/examples/game/libs/Hive/init.luau +241 -0
- package/examples/game/libs/Keep/Client.luau +114 -0
- package/examples/game/libs/Keep/Data.luau +883 -0
- package/examples/game/libs/Keep/Engine.luau +211 -0
- package/examples/game/libs/Keep/Enum.luau +6 -0
- package/examples/game/libs/Keep/Enums.luau +10 -0
- package/examples/game/libs/Keep/Path.luau +236 -0
- package/examples/game/libs/Keep/Replicator.luau +298 -0
- package/examples/game/libs/Keep/Server.luau +251 -0
- package/examples/game/libs/Keep/Store.luau +652 -0
- package/examples/game/libs/Keep/Trade.luau +455 -0
- package/examples/game/libs/Keep/init.luau +205 -0
- package/examples/game/libs/Lens/init.luau +609 -0
- package/examples/game/libs/Mint/init.luau +279 -0
- package/examples/game/libs/Net/init.luau +156 -0
- package/examples/game/libs/Net/src/codec.luau +224 -0
- package/examples/game/libs/Occlude/init.luau +117 -0
- package/examples/game/libs/Pin/init.luau +309 -0
- package/examples/game/libs/Promise/LICENSE +21 -0
- package/examples/game/libs/Promise/_impl/LICENSE +21 -0
- package/examples/game/libs/Promise/_impl/init.lua +1991 -0
- package/examples/game/libs/Promise/init.lua +1990 -0
- package/examples/game/libs/Promise/init.luau +13 -0
- package/examples/game/libs/Promise/types.luau +46 -0
- package/examples/game/libs/Roster/init.luau +686 -0
- package/examples/game/libs/SOURCES.md +31 -0
- package/examples/game/libs/Shift/init.luau +238 -0
- package/examples/game/libs/Spark/init.luau +487 -0
- package/examples/game/libs/Stage/init.luau +178 -0
- package/examples/game/libs/Sweep/init.luau +259 -0
- package/examples/game/libs/Trace/init.luau +213 -0
- package/examples/game/libs/Ward/init.luau +211 -0
- package/examples/game/out/ReplicatedStorage/Shared/Constants/Datas/TemplateData.luau +29 -0
- package/examples/game/out/ReplicatedStorage/Shared/Constants/Datas/TemplateData.luau.map.json +13 -0
- package/examples/game/out/ReplicatedStorage/Shared/Net/Net.luau +83 -0
- package/examples/game/out/ReplicatedStorage/Shared/Net/Net.luau.map.json +13 -0
- package/examples/game/out/ServerScriptService/Boot/DataBoot.server.luau +18 -0
- package/examples/game/out/ServerScriptService/Boot/DataBoot.server.luau.map.json +13 -0
- package/examples/game/out/ServerScriptService/Configuration/ServerConfig.luau +14 -0
- package/examples/game/out/ServerScriptService/Configuration/ServerConfig.luau.map.json +13 -0
- package/examples/game/out/ServerScriptService/Handlers/Guard.server.luau +15 -0
- package/examples/game/out/ServerScriptService/Handlers/Guard.server.luau.map.json +13 -0
- package/examples/game/out/ServerScriptService/Handlers/PlayerHandler.server.luau +50 -0
- package/examples/game/out/ServerScriptService/Handlers/PlayerHandler.server.luau.map.json +13 -0
- package/examples/game/out/StarterPlayer/StarterCharacterScripts/Character/CharacterReady.client.luau +12 -0
- package/examples/game/out/StarterPlayer/StarterCharacterScripts/Character/CharacterReady.client.luau.map.json +13 -0
- package/examples/game/out/StarterPlayer/StarterPlayerScripts/Controllers/DataController.client.luau +16 -0
- package/examples/game/out/StarterPlayer/StarterPlayerScripts/Controllers/DataController.client.luau.map.json +13 -0
- package/examples/game/src/ReplicatedStorage/Shared/Net/Net.clh +26 -0
- package/examples/game/src/ReplicatedStorage/Shared/Net/Net.flare +5 -0
- package/examples/game/src/ServerScriptService/Boot/DataBoot.server.clpp +2 -2
- package/examples/game/src/ServerScriptService/Handlers/PlayerHandler.server.clpp +1 -1
- package/examples/game/stylua.toml +9 -0
- package/generated/api/build-profile.js +115 -0
- package/generated/api/cache.js +44 -0
- package/generated/api/coverage.js +32 -0
- package/generated/api/diff.js +125 -0
- package/generated/api/generators/clpp-headers.js +353 -0
- package/generated/api/generators/docs-reference.js +7 -0
- package/generated/api/generators/lsp-index.js +81 -0
- package/generated/api/generators/luau-defs.js +94 -0
- package/generated/api/ide.js +76 -0
- package/generated/api/identifier.js +47 -0
- package/generated/api/index.js +324 -0
- package/generated/api/loader.js +57 -0
- package/generated/api/merge.js +88 -0
- package/generated/api/model.js +5 -0
- package/generated/api/normalize.js +231 -0
- package/generated/api/overrides-validate.js +58 -0
- package/generated/api/perf.js +12 -0
- package/generated/api/registry.js +136 -0
- package/generated/api/release.js +44 -0
- package/generated/api/resolver.js +250 -0
- package/generated/api/sources/aux-types-diff.js +75 -0
- package/generated/api/sources/client-tracker.js +11 -0
- package/generated/api/sources/creator-docs.js +42 -0
- package/generated/api/sources/luau-types.js +34 -0
- package/generated/api/sources/mini-dump.js +17 -0
- package/generated/api/sources/studio-api.js +8 -0
- package/generated/api/sources/studio-apiv2.js +11 -0
- package/generated/api/sources/studio-full-api.js +8 -0
- package/generated/api/studio-smoke.js +80 -0
- package/generated/api/type-parse.js +49 -0
- package/generated/api/understander.js +51 -0
- package/generated/api/validate.js +135 -0
- package/generated/api-cli.js +421 -0
- package/generated/cli.js +17 -6
- package/generated/clpp/contract.js +3 -3
- package/generated/clpp/format-luau.js +236 -0
- package/generated/clpp/index.js +13 -1
- package/generated/clpp/modules.js +227 -0
- package/generated/clpp/postprocess.js +86 -5
- package/generated/clpp/rewrite-janitor.js +145 -0
- package/generated/clpp/runner.js +14 -2
- package/generated/compile.js +82 -0
- package/generated/flare/index.js +15 -3
- package/generated/flare/language.js +561 -0
- package/generated/flare/parse.js +19 -7
- package/generated/intellisense.js +76 -2
- package/generated/lsp.js +118 -7
- package/generated/native/index.js +217 -16
- package/generated/target/authority-check.js +136 -0
- package/generated/target/authority-graph.js +74 -0
- package/generated/target/build-cache.js +112 -0
- package/generated/target/capabilities.js +89 -0
- package/generated/target/capability-profile.js +30 -0
- package/generated/target/component-contracts.js +60 -0
- package/generated/target/context-check.js +160 -0
- package/generated/target/datamodel-check.js +170 -0
- package/generated/target/datamodel-generate.js +74 -0
- package/generated/target/datamodel.js +233 -0
- package/generated/target/diagnostics.js +63 -0
- package/generated/target/doctor.js +152 -0
- package/generated/target/flare-version.js +58 -0
- package/generated/target/get-service.js +69 -0
- package/generated/target/lifetime-check.js +47 -0
- package/generated/target/luau-stamp.js +39 -0
- package/generated/target/optimizer-advise.js +88 -0
- package/generated/target/optimizer-apply.js +44 -0
- package/generated/target/optimizer-soa.js +254 -0
- package/generated/target/parallel-check.js +136 -0
- package/generated/target/pgo.js +148 -0
- package/generated/target/project-docs.js +69 -0
- package/generated/target/project-graph.js +71 -0
- package/generated/target/roblox.js +63 -0
- package/generated/target/security-check.js +41 -0
- package/generated/target/source-map.js +25 -0
- package/generated/target/studio-bridge.js +112 -0
- package/generated/utils/project.js +178 -8
- package/generated/utils/rojo-mapper.js +11 -3
- package/include/clpp/datatypes.clh +337 -373
- package/include/clpp/generated/enums.clh +1 -1
- package/include/clpp/generated/instances.clh +41135 -41064
- package/include/clpp/libs/axiom.clh +1 -1
- package/include/clpp/libs/hive.clh +1 -0
- package/include/clpp/libs/keep.clh +2 -0
- package/include/clpp/libs/math.clh +14 -0
- package/include/clpp/libs/roster.clh +6 -0
- package/include/clpp/libs/spring.clh +17 -0
- package/include/clpp/libs/ward.clh +1 -0
- package/include/clpp/roblox.clh +3 -4
- package/package.json +10 -3
- package/plugins/CluauppNav/Plugin.luau +207 -0
- package/plugins/CluauppNav/ProfileLogger.luau +27 -0
- package/plugins/CluauppNav/README.md +24 -0
- package/runtime/Axiom/init.luau +10 -7
- package/runtime/Coil/init.luau +8 -2
- package/runtime/Crest/init.luau +1 -0
- package/runtime/Flare/init.luau +2 -1
- package/runtime/Gleam/init.luau +15 -4
- package/runtime/Hive/init.luau +36 -14
- package/runtime/Pin/init.luau +5 -2
- package/runtime/Roster/init.luau +8 -0
- package/runtime/Spark/init.luau +3 -0
- package/runtime/Sweep/init.luau +2 -0
- package/runtime/Trace/init.luau +3 -0
- package/runtime/Ward/init.luau +38 -5
- package/scripts/postinstall-editor.js +17 -0
- package/skills/README.md +13 -0
- package/skills/clpp-hive-flare/SKILL.md +79 -0
- package/skills/clpp-language/SKILL.md +123 -0
- package/skills/clpp-language/compiler.md +89 -0
- package/skills/clpp-style/SKILL.md +95 -0
- package/src/api/build-profile.ts +138 -0
- package/src/api/cache.ts +45 -0
- package/src/api/coverage.ts +46 -0
- package/src/api/diff.ts +143 -0
- package/src/api/generators/clpp-headers.ts +377 -0
- package/src/api/generators/docs-reference.ts +11 -0
- package/src/api/generators/lsp-index.ts +106 -0
- package/src/api/generators/luau-defs.ts +98 -0
- package/src/api/ide.ts +87 -0
- package/src/api/identifier.ts +47 -0
- package/src/api/index.ts +269 -0
- package/src/api/loader.ts +60 -0
- package/src/api/merge.ts +126 -0
- package/src/api/model.ts +283 -0
- package/src/api/normalize.ts +257 -0
- package/src/api/overrides-validate.ts +58 -0
- package/src/api/perf.ts +15 -0
- package/src/api/registry.ts +162 -0
- package/src/api/release.ts +47 -0
- package/src/api/resolver.ts +255 -0
- package/src/api/sources/aux-types-diff.ts +81 -0
- package/src/api/sources/client-tracker.ts +10 -0
- package/src/api/sources/creator-docs.ts +37 -0
- package/src/api/sources/luau-types.ts +30 -0
- package/src/api/sources/mini-dump.ts +50 -0
- package/src/api/sources/studio-api.ts +7 -0
- package/src/api/sources/studio-apiv2.ts +10 -0
- package/src/api/sources/studio-full-api.ts +7 -0
- package/src/api/studio-smoke.ts +82 -0
- package/src/api/type-parse.ts +48 -0
- package/src/api/understander.ts +72 -0
- package/src/api/validate.ts +160 -0
- package/src/api-cli.ts +493 -0
- package/src/api.generated.js +37 -22
- package/src/cli.ts +22 -7
- package/src/clpp/contract.ts +34 -3
- package/src/clpp/format-luau.ts +262 -0
- package/src/clpp/index.ts +13 -2
- package/src/clpp/modules.ts +252 -0
- package/src/clpp/postprocess.ts +100 -5
- package/src/clpp/rewrite-janitor.ts +156 -0
- package/src/clpp/runner.ts +14 -2
- package/src/compile.ts +87 -0
- package/src/flare/index.ts +20 -1
- package/src/flare/language.ts +708 -0
- package/src/flare/parse.ts +20 -7
- package/src/flare/types.ts +2 -0
- package/src/intellisense.ts +76 -2
- package/src/lsp.ts +151 -8
- package/src/native/index.ts +225 -16
- package/src/target/authority-check.ts +162 -0
- package/src/target/authority-graph.ts +80 -0
- package/src/target/build-cache.ts +129 -0
- package/src/target/capabilities.ts +115 -0
- package/src/target/capability-profile.ts +25 -0
- package/src/target/component-contracts.ts +64 -0
- package/src/target/context-check.ts +177 -0
- package/src/target/datamodel-check.ts +188 -0
- package/src/target/datamodel-generate.ts +78 -0
- package/src/target/datamodel.ts +261 -0
- package/src/target/diagnostics.ts +67 -0
- package/src/target/doctor.ts +171 -0
- package/src/target/flare-version.ts +61 -0
- package/src/target/get-service.ts +85 -0
- package/src/target/lifetime-check.ts +45 -0
- package/src/target/luau-stamp.ts +33 -0
- package/src/target/optimizer-advise.ts +93 -0
- package/src/target/optimizer-apply.ts +63 -0
- package/src/target/optimizer-soa.ts +270 -0
- package/src/target/parallel-check.ts +135 -0
- package/src/target/pgo.ts +157 -0
- package/src/target/project-docs.ts +68 -0
- package/src/target/project-graph.ts +75 -0
- package/src/target/roblox.ts +78 -0
- package/src/target/security-check.ts +40 -0
- package/src/target/source-map.ts +36 -0
- package/src/target/studio-bridge.ts +140 -0
- package/src/types.ts +14 -0
- package/src/utils/project.ts +183 -9
- package/src/utils/rojo-mapper.ts +12 -3
- package/stylua.toml +9 -0
- package/templates/game/.vscode/extensions.json +3 -1
- package/templates/game/.vscode/settings.json +8 -1
- package/templates/game/include/clpp/datatypes.clh +337 -373
- package/templates/game/include/clpp/generated/enums.clh +1 -1
- package/templates/game/include/clpp/generated/instances.clh +41135 -41064
- package/templates/game/include/clpp/libs/axiom.clh +1 -1
- package/templates/game/include/clpp/libs/roster.clh +6 -0
- package/templates/game/include/clpp/libs/ward.clh +1 -0
- package/templates/game/include/clpp/roblox.clh +3 -4
- package/templates/game/src/ReplicatedStorage/Shared/Net/Net.flare +5 -0
- package/templates/game/src/ServerScriptService/Boot/DataBoot.server.clpp +2 -2
- package/templates/game/src/ServerScriptService/Handlers/PlayerHandler.server.clpp +1 -1
- package/templates/game/stylua.toml +9 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashBuffer = hashBuffer;
|
|
4
|
+
exports.mapRobloxType = mapRobloxType;
|
|
5
|
+
exports.mapParameter = mapParameter;
|
|
6
|
+
exports.typeToClpp = typeToClpp;
|
|
7
|
+
exports.typeToLuau = typeToLuau;
|
|
8
|
+
exports.eventSignalType = eventSignalType;
|
|
9
|
+
const node_crypto_1 = require("node:crypto");
|
|
10
|
+
const PRIMITIVE_MAP = {
|
|
11
|
+
bool: "boolean",
|
|
12
|
+
boolean: "boolean",
|
|
13
|
+
int: "int",
|
|
14
|
+
int64: "int64",
|
|
15
|
+
float: "float",
|
|
16
|
+
double: "double",
|
|
17
|
+
number: "double",
|
|
18
|
+
string: "string",
|
|
19
|
+
null: "void",
|
|
20
|
+
void: "void",
|
|
21
|
+
nil: "void",
|
|
22
|
+
};
|
|
23
|
+
function hashBuffer(data) {
|
|
24
|
+
return (0, node_crypto_1.createHash)("sha256").update(data).digest("hex");
|
|
25
|
+
}
|
|
26
|
+
function mapRobloxType(ref) {
|
|
27
|
+
if (!ref) {
|
|
28
|
+
return { kind: "Unknown" };
|
|
29
|
+
}
|
|
30
|
+
if (typeof ref === "string") {
|
|
31
|
+
return mapNamedType(ref);
|
|
32
|
+
}
|
|
33
|
+
const category = String(ref.Category || "");
|
|
34
|
+
const name = String(ref.Name || "");
|
|
35
|
+
let mapped;
|
|
36
|
+
switch (category) {
|
|
37
|
+
case "Primitive":
|
|
38
|
+
mapped = mapNamedType(name);
|
|
39
|
+
break;
|
|
40
|
+
case "Class":
|
|
41
|
+
mapped = { kind: "Class", name };
|
|
42
|
+
break;
|
|
43
|
+
case "Enum":
|
|
44
|
+
mapped = { kind: "Enum", name };
|
|
45
|
+
break;
|
|
46
|
+
case "DataType":
|
|
47
|
+
if (name === "Function") {
|
|
48
|
+
mapped = {
|
|
49
|
+
kind: "Function",
|
|
50
|
+
parameters: [{ kind: "Any" }],
|
|
51
|
+
returns: [{ kind: "Any" }],
|
|
52
|
+
variadic: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
else if (name === "buffer" || name === "Buffer") {
|
|
56
|
+
mapped = { kind: "Buffer" };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
mapped = { kind: "Datatype", name };
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case "Group":
|
|
63
|
+
if (name === "Array") {
|
|
64
|
+
mapped = { kind: "Array", element: { kind: "Any" } };
|
|
65
|
+
}
|
|
66
|
+
else if (name === "Dictionary" || name === "Map") {
|
|
67
|
+
mapped = {
|
|
68
|
+
kind: "Dictionary",
|
|
69
|
+
key: { kind: "Any" },
|
|
70
|
+
value: { kind: "Any" },
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
else if (name === "Tuple") {
|
|
74
|
+
mapped = { kind: "Tuple", elements: [{ kind: "Any" }] };
|
|
75
|
+
}
|
|
76
|
+
else if (name === "Variant") {
|
|
77
|
+
mapped = { kind: "Any" };
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
mapped = {
|
|
81
|
+
kind: "Unsupported",
|
|
82
|
+
raw: `${category}:${name}`,
|
|
83
|
+
reason: `Group type ${name} has no direct CL++ mapping yet`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
default:
|
|
88
|
+
if (!name) {
|
|
89
|
+
mapped = { kind: "Unknown" };
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
mapped = mapNamedType(name);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (ref.Optional || /\?$/.test(name)) {
|
|
96
|
+
return { kind: "Optional", inner: stripOptionalMarker(mapped) };
|
|
97
|
+
}
|
|
98
|
+
return mapped;
|
|
99
|
+
}
|
|
100
|
+
function stripOptionalMarker(type) {
|
|
101
|
+
if (type.kind === "Class" || type.kind === "Enum" || type.kind === "Datatype" || type.kind === "Primitive") {
|
|
102
|
+
return { ...type, name: type.name.replace(/\?$/, "") };
|
|
103
|
+
}
|
|
104
|
+
return type;
|
|
105
|
+
}
|
|
106
|
+
function mapNamedType(rawName) {
|
|
107
|
+
const name = rawName.replace(/\?$/, "");
|
|
108
|
+
if (!name) {
|
|
109
|
+
return { kind: "Unknown" };
|
|
110
|
+
}
|
|
111
|
+
if (name === "any") {
|
|
112
|
+
return { kind: "Any" };
|
|
113
|
+
}
|
|
114
|
+
if (name === "unknown") {
|
|
115
|
+
return { kind: "Unknown" };
|
|
116
|
+
}
|
|
117
|
+
if (name === "never") {
|
|
118
|
+
return { kind: "Never" };
|
|
119
|
+
}
|
|
120
|
+
if (name === "buffer" || name === "Buffer") {
|
|
121
|
+
return { kind: "Buffer" };
|
|
122
|
+
}
|
|
123
|
+
if (PRIMITIVE_MAP[name]) {
|
|
124
|
+
return { kind: "Primitive", name: PRIMITIVE_MAP[name] };
|
|
125
|
+
}
|
|
126
|
+
if (/^[A-Z]/.test(name)) {
|
|
127
|
+
return { kind: "Class", name };
|
|
128
|
+
}
|
|
129
|
+
return { kind: "Primitive", name };
|
|
130
|
+
}
|
|
131
|
+
function mapParameter(param, index) {
|
|
132
|
+
const name = param.Name || `arg${index}`;
|
|
133
|
+
const type = mapRobloxType(param.Type);
|
|
134
|
+
const optional = type.kind === "Optional" || param.Default !== undefined;
|
|
135
|
+
const def = classifyDefault(param.Default);
|
|
136
|
+
return {
|
|
137
|
+
name,
|
|
138
|
+
type: optional && type.kind !== "Optional" ? { kind: "Optional", inner: type } : type,
|
|
139
|
+
optional,
|
|
140
|
+
default: param.Default,
|
|
141
|
+
defaultKind: def,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function classifyDefault(value) {
|
|
145
|
+
if (value === undefined) {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
if (value === "null" || value === "nil") {
|
|
149
|
+
return "Null";
|
|
150
|
+
}
|
|
151
|
+
if (value === "true" || value === "false") {
|
|
152
|
+
return "Boolean";
|
|
153
|
+
}
|
|
154
|
+
if (/^-?\d+(\.\d+)?$/.test(value)) {
|
|
155
|
+
return "Number";
|
|
156
|
+
}
|
|
157
|
+
if (/^Enum\./.test(value)) {
|
|
158
|
+
return "EnumItem";
|
|
159
|
+
}
|
|
160
|
+
if (/^['"`]/.test(value)) {
|
|
161
|
+
return "String";
|
|
162
|
+
}
|
|
163
|
+
return "Unknown";
|
|
164
|
+
}
|
|
165
|
+
function typeToClpp(type) {
|
|
166
|
+
switch (type.kind) {
|
|
167
|
+
case "Primitive":
|
|
168
|
+
if (type.name === "boolean") {
|
|
169
|
+
return "bool";
|
|
170
|
+
}
|
|
171
|
+
if (type.name === "void") {
|
|
172
|
+
return "void";
|
|
173
|
+
}
|
|
174
|
+
return type.name;
|
|
175
|
+
case "Class":
|
|
176
|
+
case "Datatype":
|
|
177
|
+
return type.name;
|
|
178
|
+
case "Enum":
|
|
179
|
+
return `Enum::${type.name}`;
|
|
180
|
+
case "Optional":
|
|
181
|
+
return `${typeToClpp(type.inner)}?`;
|
|
182
|
+
case "Array":
|
|
183
|
+
return `array<${typeToClpp(type.element)}>`;
|
|
184
|
+
case "Dictionary":
|
|
185
|
+
case "Map":
|
|
186
|
+
return `dictionary<${typeToClpp(type.key)}, ${typeToClpp(type.value)}>`;
|
|
187
|
+
case "Tuple":
|
|
188
|
+
return `tuple<${type.elements.map(typeToClpp).join(", ")}>`;
|
|
189
|
+
case "Function":
|
|
190
|
+
return "func";
|
|
191
|
+
case "Union":
|
|
192
|
+
return type.members.map(typeToClpp).join(" | ");
|
|
193
|
+
case "Buffer":
|
|
194
|
+
return "buffer";
|
|
195
|
+
case "Any":
|
|
196
|
+
return "auto";
|
|
197
|
+
case "Unknown":
|
|
198
|
+
return "auto";
|
|
199
|
+
case "Never":
|
|
200
|
+
return "void";
|
|
201
|
+
case "Unsupported":
|
|
202
|
+
return "auto";
|
|
203
|
+
default:
|
|
204
|
+
return "auto";
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function typeToLuau(type) {
|
|
208
|
+
switch (type.kind) {
|
|
209
|
+
case "Primitive":
|
|
210
|
+
if (type.name === "int" || type.name === "int64" || type.name === "float" || type.name === "double") {
|
|
211
|
+
return "number";
|
|
212
|
+
}
|
|
213
|
+
if (type.name === "void") {
|
|
214
|
+
return "()";
|
|
215
|
+
}
|
|
216
|
+
return type.name;
|
|
217
|
+
case "Class":
|
|
218
|
+
case "Datatype":
|
|
219
|
+
return type.name;
|
|
220
|
+
case "Enum":
|
|
221
|
+
return `Enum.${type.name}`;
|
|
222
|
+
case "Optional":
|
|
223
|
+
return `${typeToLuau(type.inner)}?`;
|
|
224
|
+
case "Array":
|
|
225
|
+
return `{ ${typeToLuau(type.element)} }`;
|
|
226
|
+
case "Dictionary":
|
|
227
|
+
case "Map":
|
|
228
|
+
return `{ [${typeToLuau(type.key)}]: ${typeToLuau(type.value)} }`;
|
|
229
|
+
case "Buffer":
|
|
230
|
+
return "buffer";
|
|
231
|
+
case "Any":
|
|
232
|
+
return "any";
|
|
233
|
+
case "Unknown":
|
|
234
|
+
return "unknown";
|
|
235
|
+
case "Function":
|
|
236
|
+
return "(...any) -> ...any";
|
|
237
|
+
case "Unsupported":
|
|
238
|
+
return "any";
|
|
239
|
+
default:
|
|
240
|
+
return "any";
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function eventSignalType(parameters) {
|
|
244
|
+
return {
|
|
245
|
+
kind: "Datatype",
|
|
246
|
+
name: parameters.length
|
|
247
|
+
? `RBXScriptSignal/*(${parameters.map((p) => typeToClpp(p.type)).join(", ")})*/`
|
|
248
|
+
: "RBXScriptSignal",
|
|
249
|
+
};
|
|
250
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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.diffAgainstAuxTypes = diffAgainstAuxTypes;
|
|
7
|
+
/**
|
|
8
|
+
* Optional coverage cross-check against @rbxts/types or LuauTypes.
|
|
9
|
+
* Never imported by the compile hot path.
|
|
10
|
+
*/
|
|
11
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
12
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
13
|
+
function collectDeclareClasses(text) {
|
|
14
|
+
const names = new Set();
|
|
15
|
+
const re = /\b(?:declare\s+class|export\s+type|interface|type)\s+([A-Za-z_][\w]*)/g;
|
|
16
|
+
let match;
|
|
17
|
+
while ((match = re.exec(text))) {
|
|
18
|
+
names.add(match[1]);
|
|
19
|
+
}
|
|
20
|
+
return names;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Diff registry class/datatype/enum names against a local types file or directory
|
|
24
|
+
* (e.g. node_modules/@rbxts/types or Studio LuauTypes.d.luau).
|
|
25
|
+
*/
|
|
26
|
+
function diffAgainstAuxTypes(registryNames, auxPath) {
|
|
27
|
+
if (!node_fs_1.default.existsSync(auxPath)) {
|
|
28
|
+
throw new Error(`Aux types path not found: ${auxPath}`);
|
|
29
|
+
}
|
|
30
|
+
const stat = node_fs_1.default.statSync(auxPath);
|
|
31
|
+
let auxSet;
|
|
32
|
+
if (stat.isDirectory()) {
|
|
33
|
+
auxSet = new Set();
|
|
34
|
+
const stack = [auxPath];
|
|
35
|
+
while (stack.length) {
|
|
36
|
+
const dir = stack.pop();
|
|
37
|
+
for (const entry of node_fs_1.default.readdirSync(dir, { withFileTypes: true })) {
|
|
38
|
+
const full = node_path_1.default.join(dir, entry.name);
|
|
39
|
+
if (entry.isDirectory()) {
|
|
40
|
+
stack.push(full);
|
|
41
|
+
}
|
|
42
|
+
else if (/\.(luau|ts|d\.ts)$/i.test(entry.name)) {
|
|
43
|
+
for (const name of collectDeclareClasses(node_fs_1.default.readFileSync(full, "utf8"))) {
|
|
44
|
+
auxSet.add(name);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
auxSet = collectDeclareClasses(node_fs_1.default.readFileSync(auxPath, "utf8"));
|
|
52
|
+
}
|
|
53
|
+
const regSet = new Set(registryNames);
|
|
54
|
+
const onlyInAux = [];
|
|
55
|
+
const onlyInRegistry = [];
|
|
56
|
+
for (const name of auxSet) {
|
|
57
|
+
if (!regSet.has(name)) {
|
|
58
|
+
onlyInAux.push(name);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (const name of regSet) {
|
|
62
|
+
if (!auxSet.has(name)) {
|
|
63
|
+
onlyInRegistry.push(name);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
onlyInAux.sort();
|
|
67
|
+
onlyInRegistry.sort();
|
|
68
|
+
return {
|
|
69
|
+
source: auxPath,
|
|
70
|
+
auxSymbols: auxSet.size,
|
|
71
|
+
registrySymbols: regSet.size,
|
|
72
|
+
onlyInAux,
|
|
73
|
+
onlyInRegistry,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadClientTrackerDump = loadClientTrackerDump;
|
|
4
|
+
const loader_js_1 = require("../loader.js");
|
|
5
|
+
/**
|
|
6
|
+
* Optional Client Tracker adapter (non-authoritative early-diff source).
|
|
7
|
+
* Pass a local API-Dump.json / Full-API-Dump.json checkout path.
|
|
8
|
+
*/
|
|
9
|
+
function loadClientTrackerDump(filePath) {
|
|
10
|
+
return (0, loader_js_1.loadJsonFile)("client-tracker", filePath);
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.loadCreatorDocs = loadCreatorDocs;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const resolver_js_1 = require("../resolver.js");
|
|
10
|
+
/**
|
|
11
|
+
* Creator Docs engine reference walker.
|
|
12
|
+
* Expects a local clone of Roblox/creator-docs (or a fixture subtree).
|
|
13
|
+
*/
|
|
14
|
+
function loadCreatorDocs(rootDir) {
|
|
15
|
+
if (!node_fs_1.default.existsSync(rootDir)) {
|
|
16
|
+
throw new Error(`Creator Docs root not found: ${rootDir}`);
|
|
17
|
+
}
|
|
18
|
+
const pages = [];
|
|
19
|
+
const stack = [rootDir];
|
|
20
|
+
while (stack.length) {
|
|
21
|
+
const dir = stack.pop();
|
|
22
|
+
for (const entry of node_fs_1.default.readdirSync(dir, { withFileTypes: true })) {
|
|
23
|
+
const full = node_path_1.default.join(dir, entry.name);
|
|
24
|
+
if (entry.isDirectory()) {
|
|
25
|
+
stack.push(full);
|
|
26
|
+
}
|
|
27
|
+
else if (/\.(md|mdx|yaml|yml)$/i.test(entry.name)) {
|
|
28
|
+
pages.push(node_path_1.default.relative(rootDir, full).replace(/\\/g, "/"));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
pages.sort();
|
|
33
|
+
return {
|
|
34
|
+
meta: {
|
|
35
|
+
id: "creator-docs",
|
|
36
|
+
path: rootDir,
|
|
37
|
+
hash: (0, resolver_js_1.hashBuffer)(pages.join("\n")),
|
|
38
|
+
loadedAt: new Date().toISOString(),
|
|
39
|
+
},
|
|
40
|
+
data: { pages },
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.loadLuauTypes = loadLuauTypes;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const resolver_js_1 = require("../resolver.js");
|
|
9
|
+
/**
|
|
10
|
+
* Parse LuauTypes.d.luau into a lightweight symbol index.
|
|
11
|
+
* Full type AST is deferred; we extract declare/class/type names for cross-check.
|
|
12
|
+
*/
|
|
13
|
+
function loadLuauTypes(filePath) {
|
|
14
|
+
if (!node_fs_1.default.existsSync(filePath)) {
|
|
15
|
+
throw new Error(`LuauTypes file not found: ${filePath}`);
|
|
16
|
+
}
|
|
17
|
+
const raw = node_fs_1.default.readFileSync(filePath);
|
|
18
|
+
const text = raw.toString("utf8");
|
|
19
|
+
const symbols = new Set();
|
|
20
|
+
const declareRe = /\b(?:declare|type|export type|class)\s+([A-Za-z_][\w.]*)/g;
|
|
21
|
+
let match;
|
|
22
|
+
while ((match = declareRe.exec(text))) {
|
|
23
|
+
symbols.add(match[1].split(".")[0]);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
meta: {
|
|
27
|
+
id: "luau-types",
|
|
28
|
+
path: filePath,
|
|
29
|
+
hash: (0, resolver_js_1.hashBuffer)(raw),
|
|
30
|
+
loadedAt: new Date().toISOString(),
|
|
31
|
+
},
|
|
32
|
+
data: { symbols: [...symbols].sort(), textHash: (0, resolver_js_1.hashBuffer)(raw) },
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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.loadMiniDump = loadMiniDump;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const package_info_js_1 = require("../../package-info.js");
|
|
9
|
+
const loader_js_1 = require("../loader.js");
|
|
10
|
+
function loadMiniDump(filePath) {
|
|
11
|
+
const target = filePath || node_path_1.default.join(package_info_js_1.projectRoot, "data", "Mini-API-Dump.json");
|
|
12
|
+
const loaded = (0, loader_js_1.loadJsonFile)("mini-api-dump", target);
|
|
13
|
+
if (!Array.isArray(loaded.data.Classes) || !Array.isArray(loaded.data.Enums)) {
|
|
14
|
+
throw new Error("Mini-API-Dump.json missing Classes/Enums arrays");
|
|
15
|
+
}
|
|
16
|
+
return loaded;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadStudioApi = loadStudioApi;
|
|
4
|
+
const loader_js_1 = require("../loader.js");
|
|
5
|
+
/** Studio --api JSON (same shape family as Mini dump when exported). */
|
|
6
|
+
function loadStudioApi(filePath) {
|
|
7
|
+
return (0, loader_js_1.loadJsonFile)("studio-api", filePath);
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadStudioApiV2 = loadStudioApiV2;
|
|
4
|
+
const loader_js_1 = require("../loader.js");
|
|
5
|
+
/**
|
|
6
|
+
* Studio --apiV2 JSON export — preferred canonical schema when available.
|
|
7
|
+
* Until a fixture is checked in, callers may pass a local Studio dump path.
|
|
8
|
+
*/
|
|
9
|
+
function loadStudioApiV2(filePath) {
|
|
10
|
+
return (0, loader_js_1.loadJsonFile)("studio-api-v2", filePath);
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadStudioFullApi = loadStudioFullApi;
|
|
4
|
+
const loader_js_1 = require("../loader.js");
|
|
5
|
+
/** Studio --fullApi JSON export. */
|
|
6
|
+
function loadStudioFullApi(filePath) {
|
|
7
|
+
return (0, loader_js_1.loadJsonFile)("studio-full-api", filePath);
|
|
8
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.RUNTIME_SUITE = void 0;
|
|
7
|
+
exports.resolveStudioBinary = resolveStudioBinary;
|
|
8
|
+
exports.runStudioSmoke = runStudioSmoke;
|
|
9
|
+
/**
|
|
10
|
+
* Optional Studio smoke — skip when Studio is absent.
|
|
11
|
+
* Not a parallel Studio test framework; keep minimal.
|
|
12
|
+
*/
|
|
13
|
+
const node_child_process_1 = require("node:child_process");
|
|
14
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
15
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
+
const package_info_js_1 = require("../package-info.js");
|
|
17
|
+
function resolveStudioBinary() {
|
|
18
|
+
if (process.env.ROBLOX_STUDIO) {
|
|
19
|
+
return process.env.ROBLOX_STUDIO;
|
|
20
|
+
}
|
|
21
|
+
const candidates = [
|
|
22
|
+
"C:\\\\Program Files (x86)\\\\Roblox\\\\Versions",
|
|
23
|
+
"C:\\\\Program Files\\\\Roblox\\\\Versions",
|
|
24
|
+
];
|
|
25
|
+
for (const root of candidates) {
|
|
26
|
+
if (!node_fs_1.default.existsSync(root)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
for (const ver of node_fs_1.default.readdirSync(root)) {
|
|
30
|
+
const exe = node_path_1.default.join(root, ver, "RobloxStudioBeta.exe");
|
|
31
|
+
if (node_fs_1.default.existsSync(exe)) {
|
|
32
|
+
return exe;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const SMOKE_SCRIPT = `
|
|
39
|
+
local ok = true
|
|
40
|
+
local function check(cond, msg)
|
|
41
|
+
if not cond then
|
|
42
|
+
ok = false
|
|
43
|
+
warn("[cluaupp-smoke]", msg)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
check(typeof(Instance.new("Folder")) == "Instance", "Instance.new Folder")
|
|
47
|
+
check(game:GetService("Players") ~= nil, "GetService Players")
|
|
48
|
+
check(typeof(Vector3.new(1,2,3)) == "Vector3", "Vector3")
|
|
49
|
+
check(Enum.Material.Plastic ~= nil, "Enum.Material")
|
|
50
|
+
check(task.wait ~= nil, "task.wait")
|
|
51
|
+
print(ok and "SMOKE_OK" or "SMOKE_FAIL")
|
|
52
|
+
`;
|
|
53
|
+
function runStudioSmoke() {
|
|
54
|
+
const studio = resolveStudioBinary();
|
|
55
|
+
if (!studio) {
|
|
56
|
+
return { skipped: true, ok: true, output: "Roblox Studio not found; smoke skipped" };
|
|
57
|
+
}
|
|
58
|
+
const scriptPath = node_path_1.default.join(package_info_js_1.projectRoot, "test", "studio", "smoke.luau");
|
|
59
|
+
node_fs_1.default.mkdirSync(node_path_1.default.dirname(scriptPath), { recursive: true });
|
|
60
|
+
node_fs_1.default.writeFileSync(scriptPath, SMOKE_SCRIPT, "utf8");
|
|
61
|
+
const result = (0, node_child_process_1.spawnSync)(studio, ["--task", "RunScript", scriptPath], {
|
|
62
|
+
encoding: "utf8",
|
|
63
|
+
timeout: 120_000,
|
|
64
|
+
});
|
|
65
|
+
const output = `${result.stdout || ""}${result.stderr || ""}`;
|
|
66
|
+
const ok = output.includes("SMOKE_OK") || result.status === 0;
|
|
67
|
+
return { skipped: false, ok, output };
|
|
68
|
+
}
|
|
69
|
+
exports.RUNTIME_SUITE = [
|
|
70
|
+
"Instance.new",
|
|
71
|
+
"GetService",
|
|
72
|
+
"events",
|
|
73
|
+
"datatypes",
|
|
74
|
+
"ModuleScript",
|
|
75
|
+
"Server",
|
|
76
|
+
"Client",
|
|
77
|
+
"enums",
|
|
78
|
+
"task",
|
|
79
|
+
"require",
|
|
80
|
+
];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseClppTypeString = parseClppTypeString;
|
|
4
|
+
exports.mapNamedTypeLike = mapNamedTypeLike;
|
|
5
|
+
/** Parse simple CL++ type strings from override specs (e.g. "Vector3", "Enum::EasingStyle", "double?"). */
|
|
6
|
+
function parseClppTypeString(raw) {
|
|
7
|
+
const text = String(raw || "").trim();
|
|
8
|
+
if (!text) {
|
|
9
|
+
return { kind: "Unknown" };
|
|
10
|
+
}
|
|
11
|
+
if (text.endsWith("?")) {
|
|
12
|
+
return { kind: "Optional", inner: parseClppTypeString(text.slice(0, -1)) };
|
|
13
|
+
}
|
|
14
|
+
if (text.endsWith("*")) {
|
|
15
|
+
return parseClppTypeString(text.slice(0, -1));
|
|
16
|
+
}
|
|
17
|
+
const arrayMatch = /^LuaArray<(.+)>$/.exec(text) || /^array<(.+)>$/i.exec(text);
|
|
18
|
+
if (arrayMatch) {
|
|
19
|
+
return { kind: "Array", element: parseClppTypeString(arrayMatch[1]) };
|
|
20
|
+
}
|
|
21
|
+
if (text.startsWith("Enum::")) {
|
|
22
|
+
return { kind: "Enum", name: text.slice("Enum::".length) };
|
|
23
|
+
}
|
|
24
|
+
if (text === "bool" || text === "boolean") {
|
|
25
|
+
return { kind: "Primitive", name: "boolean" };
|
|
26
|
+
}
|
|
27
|
+
if (text === "void") {
|
|
28
|
+
return { kind: "Primitive", name: "void" };
|
|
29
|
+
}
|
|
30
|
+
if (text === "string" || text === "int" || text === "int64" || text === "float" || text === "double" || text === "long long") {
|
|
31
|
+
if (text === "long long") {
|
|
32
|
+
return { kind: "Primitive", name: "int64" };
|
|
33
|
+
}
|
|
34
|
+
return { kind: "Primitive", name: text };
|
|
35
|
+
}
|
|
36
|
+
if (text === "buffer") {
|
|
37
|
+
return { kind: "Buffer" };
|
|
38
|
+
}
|
|
39
|
+
if (text === "auto" || text === "any") {
|
|
40
|
+
return { kind: "Any" };
|
|
41
|
+
}
|
|
42
|
+
if (/^[A-Z]/.test(text)) {
|
|
43
|
+
return { kind: "Datatype", name: text };
|
|
44
|
+
}
|
|
45
|
+
return { kind: "Primitive", name: text };
|
|
46
|
+
}
|
|
47
|
+
function mapNamedTypeLike(name) {
|
|
48
|
+
return parseClppTypeString(name);
|
|
49
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INTENT_RULES = void 0;
|
|
4
|
+
exports.matchIntents = matchIntents;
|
|
5
|
+
exports.understandSymbol = understandSymbol;
|
|
6
|
+
const ide_js_1 = require("./ide.js");
|
|
7
|
+
exports.INTENT_RULES = [
|
|
8
|
+
{
|
|
9
|
+
id: "instance-new",
|
|
10
|
+
kind: "create-instance",
|
|
11
|
+
pattern: /\bInstance\s*\.\s*new\b|\bnew\s+[A-Z]\w+\s*\(/,
|
|
12
|
+
description: "Construct a Roblox Instance",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "get-service",
|
|
16
|
+
kind: "get-service",
|
|
17
|
+
pattern: /\bGetService\s*[<(]/,
|
|
18
|
+
description: "Resolve a service via GetService",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "connect-event",
|
|
22
|
+
kind: "connect-event",
|
|
23
|
+
pattern: /\.\s*Connect\s*\(/,
|
|
24
|
+
description: "Connect to an RBXScriptSignal",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "require",
|
|
28
|
+
kind: "require-module",
|
|
29
|
+
pattern: /\brequire\s*\(/,
|
|
30
|
+
description: "Require a ModuleScript / library",
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
function matchIntents(source) {
|
|
34
|
+
return exports.INTENT_RULES.filter((rule) => rule.pattern.test(source));
|
|
35
|
+
}
|
|
36
|
+
function understandSymbol(symbol, registry) {
|
|
37
|
+
const reg = registry || (0, ide_js_1.getApiRegistry)();
|
|
38
|
+
if (reg.classes.has(symbol)) {
|
|
39
|
+
return { registryHit: true, kind: "class", intents: [] };
|
|
40
|
+
}
|
|
41
|
+
if (reg.services.has(symbol)) {
|
|
42
|
+
return { registryHit: true, kind: "service", intents: ["get-service"] };
|
|
43
|
+
}
|
|
44
|
+
if (reg.enums.has(symbol)) {
|
|
45
|
+
return { registryHit: true, kind: "enum", intents: [] };
|
|
46
|
+
}
|
|
47
|
+
if (reg.datatypes.has(symbol)) {
|
|
48
|
+
return { registryHit: true, kind: "datatype", intents: [] };
|
|
49
|
+
}
|
|
50
|
+
return { registryHit: false, intents: [] };
|
|
51
|
+
}
|