cluaupp 1.5.1 → 1.5.2-cf

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 (75) hide show
  1. package/README.md +1 -1
  2. package/bin/cluaupp.js +36 -0
  3. package/editors/vscode/syntaxes/clpp.tmLanguage.json +90 -0
  4. package/examples/game/cluaupp.config.json +1 -1
  5. package/examples/game/default.project.json +13 -16
  6. package/examples/game/src/Client/Controllers/DataController.client.clpp +7 -0
  7. package/examples/game/src/Client/Main.client.clpp +4 -0
  8. package/examples/game/src/Modules/Core/Guard.server.clpp +7 -0
  9. package/examples/game/src/{ServerScriptService/Handlers → Modules/Core}/PlayerHandler.server.clpp +2 -2
  10. package/examples/game/src/{ServerScriptService → Server}/Boot/DataBoot.server.clpp +3 -3
  11. package/examples/game/src/Server/Main.server.clpp +4 -0
  12. package/generated/clpp/modules.js +5 -0
  13. package/generated/target/gen-rojo-tree.js +118 -0
  14. package/generated/utils/project.js +8 -0
  15. package/{examples/game/src/ReplicatedFirst/Loading → native/bin}/.gitkeep +1 -1
  16. package/package.json +7 -3
  17. package/rust/cluaupp/Cargo.lock +795 -0
  18. package/rust/cluaupp/Cargo.toml +17 -0
  19. package/rust/cluaupp/src/main.rs +717 -0
  20. package/scripts/postinstall-native.js +52 -0
  21. package/src/clpp/modules.ts +5 -0
  22. package/src/target/gen-rojo-tree.ts +123 -0
  23. package/src/utils/project.ts +9 -0
  24. package/templates/game/cluaupp.config.json +1 -1
  25. package/templates/game/default.project.json +13 -16
  26. package/templates/game/src/Client/Controllers/DataController.client.clpp +7 -0
  27. package/templates/game/src/Client/Main.client.clpp +4 -0
  28. package/templates/game/src/Modules/Core/Guard.server.clpp +7 -0
  29. package/templates/game/src/{ServerScriptService/Handlers → Modules/Core}/PlayerHandler.server.clpp +2 -2
  30. package/templates/game/src/{ServerScriptService → Server}/Boot/DataBoot.server.clpp +3 -3
  31. package/templates/game/src/Server/Main.server.clpp +4 -0
  32. package/examples/game/src/ReplicatedStorage/Shared/Constants/Classes/.gitkeep +0 -1
  33. package/examples/game/src/ReplicatedStorage/Shared/Constants/Primitives/.gitkeep +0 -1
  34. package/examples/game/src/ReplicatedStorage/Shared/Modules/.gitkeep +0 -1
  35. package/examples/game/src/ReplicatedStorage/Shared/Net/.gitkeep +0 -1
  36. package/examples/game/src/ReplicatedStorage/Shared/Net/Net.clh +0 -26
  37. package/examples/game/src/ReplicatedStorage/Shared/Services/.gitkeep +0 -1
  38. package/examples/game/src/ReplicatedStorage/Shared/Types/.gitkeep +0 -1
  39. package/examples/game/src/ReplicatedStorage/Shared/Utils/.gitkeep +0 -1
  40. package/examples/game/src/ServerScriptService/Components/.gitkeep +0 -1
  41. package/examples/game/src/ServerScriptService/Configuration/ServerConfig.clp +0 -4
  42. package/examples/game/src/ServerScriptService/Handlers/Guard.server.clpp +0 -7
  43. package/examples/game/src/ServerScriptService/Services/.gitkeep +0 -1
  44. package/examples/game/src/ServerStorage/Configuration/.gitkeep +0 -1
  45. package/examples/game/src/ServerStorage/Modules/.gitkeep +0 -1
  46. package/examples/game/src/StarterPlayer/StarterCharacterScripts/Character/CharacterReady.client.clpp +0 -6
  47. package/examples/game/src/StarterPlayer/StarterCharacterScripts/Combat/.gitkeep +0 -1
  48. package/examples/game/src/StarterPlayer/StarterCharacterScripts/Movement/.gitkeep +0 -1
  49. package/examples/game/src/StarterPlayer/StarterPlayerScripts/Controllers/DataController.client.clpp +0 -7
  50. package/examples/game/src/StarterPlayer/StarterPlayerScripts/Input/.gitkeep +0 -1
  51. package/examples/game/src/StarterPlayer/StarterPlayerScripts/UI/.gitkeep +0 -1
  52. package/templates/game/src/ReplicatedFirst/Loading/.gitkeep +0 -1
  53. package/templates/game/src/ReplicatedStorage/Shared/Constants/Classes/.gitkeep +0 -1
  54. package/templates/game/src/ReplicatedStorage/Shared/Constants/Primitives/.gitkeep +0 -1
  55. package/templates/game/src/ReplicatedStorage/Shared/Modules/.gitkeep +0 -1
  56. package/templates/game/src/ReplicatedStorage/Shared/Net/.gitkeep +0 -1
  57. package/templates/game/src/ReplicatedStorage/Shared/Services/.gitkeep +0 -1
  58. package/templates/game/src/ReplicatedStorage/Shared/Types/.gitkeep +0 -1
  59. package/templates/game/src/ReplicatedStorage/Shared/Utils/.gitkeep +0 -1
  60. package/templates/game/src/ServerScriptService/Components/.gitkeep +0 -1
  61. package/templates/game/src/ServerScriptService/Configuration/ServerConfig.clp +0 -4
  62. package/templates/game/src/ServerScriptService/Handlers/Guard.server.clpp +0 -7
  63. package/templates/game/src/ServerScriptService/Services/.gitkeep +0 -1
  64. package/templates/game/src/ServerStorage/Configuration/.gitkeep +0 -1
  65. package/templates/game/src/ServerStorage/Modules/.gitkeep +0 -1
  66. package/templates/game/src/StarterPlayer/StarterCharacterScripts/Character/CharacterReady.client.clpp +0 -6
  67. package/templates/game/src/StarterPlayer/StarterCharacterScripts/Combat/.gitkeep +0 -1
  68. package/templates/game/src/StarterPlayer/StarterCharacterScripts/Movement/.gitkeep +0 -1
  69. package/templates/game/src/StarterPlayer/StarterPlayerScripts/Controllers/DataController.client.clpp +0 -7
  70. package/templates/game/src/StarterPlayer/StarterPlayerScripts/Input/.gitkeep +0 -1
  71. package/templates/game/src/StarterPlayer/StarterPlayerScripts/UI/.gitkeep +0 -1
  72. /package/examples/game/src/{ReplicatedStorage/Shared/Net → Declarations}/Net.flare +0 -0
  73. /package/examples/game/src/{ReplicatedStorage/Shared/Constants/Datas/TemplateData.clh → Include/GameTypes.clh} +0 -0
  74. /package/templates/game/src/{ReplicatedStorage/Shared/Net → Declarations}/Net.flare +0 -0
  75. /package/templates/game/src/{ReplicatedStorage/Shared/Constants/Datas/TemplateData.clh → Include/GameTypes.clh} +0 -0
package/README.md CHANGED
@@ -17,7 +17,7 @@ Cluaupp is the **Roblox project host** for [CL++](https://kartzrbx.github.io/CLP
17
17
  Native PascalCase CluauppLibs: **Flare** net, **Sweep** zelador, **Spark** signal, **Keep** data, **Mint** numbers, **Axiom** math, **Roster** tables, **Gleam** UI, **Bloom** effects, **Lens** debug UI, **Crest** topbar, **Pin** billboard, **Stage** viewport 3D, **Coil** spring, **Helm** commands, **Shift** states, **Hive** ECS, **Ward** anti-cheat, **Ember** VFX, **Echo** replication, **Guide** tutorials, **Trace** pretty-print. Schemas pack u8 ids / ColorSequence / tables — never JSON on the hot path. Name map: [`runtime/SOURCES.md`](runtime/SOURCES.md).
18
18
 
19
19
  ```clpp
20
- #include <clpp/roblox.clh>
20
+ link @clpp.roblox;
21
21
 
22
22
  struct HelloServer {
23
23
  void Greet(Player player);
package/bin/cluaupp.js CHANGED
@@ -1,4 +1,40 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
 
4
+ const fs = require("node:fs");
5
+ const path = require("node:path");
6
+ const { spawnSync } = require("node:child_process");
7
+
8
+ function exeName() {
9
+ return process.platform === "win32" ? "cluaupp.exe" : "cluaupp";
10
+ }
11
+
12
+ function nativeCandidates(pkgRoot) {
13
+ const platform = process.platform;
14
+ const arch = process.arch;
15
+ return [
16
+ process.env.CLUAUPP_NATIVE_BIN,
17
+ path.join(pkgRoot, "native", "bin", exeName()),
18
+ path.join(pkgRoot, "native", `${platform}-${arch}`, exeName()),
19
+ ].filter(Boolean);
20
+ }
21
+
22
+ function runNativeIfPresent() {
23
+ const pkgRoot = path.resolve(__dirname, "..");
24
+ process.env.CLUAUPP_HOME = process.env.CLUAUPP_HOME || pkgRoot;
25
+ for (const bin of nativeCandidates(pkgRoot)) {
26
+ if (!fs.existsSync(bin)) continue;
27
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit", windowsHide: true });
28
+ if (typeof result.status === "number") {
29
+ process.exit(result.status);
30
+ }
31
+ if (result.error) {
32
+ console.warn("cluaupp: native failed, falling back to Node:", result.error.message);
33
+ break;
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+
39
+ runNativeIfPresent();
4
40
  require("../generated/cli.js");
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "CL++",
4
+ "scopeName": "source.clpp",
5
+ "patterns": [
6
+ { "include": "#comments" },
7
+ { "include": "#directives" },
8
+ { "include": "#link" },
9
+ { "include": "#attributes" },
10
+ { "include": "#strings" },
11
+ { "include": "#receiver" },
12
+ { "include": "#keywords" },
13
+ { "include": "#types" },
14
+ { "include": "#constants" },
15
+ { "include": "#numbers" },
16
+ { "include": "#operators" },
17
+ { "include": "#properties" },
18
+ { "include": "#functions" }
19
+ ],
20
+ "repository": {
21
+ "comments": {
22
+ "patterns": [
23
+ { "name": "comment.line.double-slash.clpp", "match": "//.*$" },
24
+ { "name": "comment.block.clpp", "begin": "/\\*", "end": "\\*/" }
25
+ ]
26
+ },
27
+ "directives": {
28
+ "patterns": [
29
+ {
30
+ "match": "^\\s*(#(pragma|define|ifdef|ifndef|endif))\\b.*$",
31
+ "name": "meta.preprocessor.clpp",
32
+ "captures": { "1": { "name": "keyword.control.directive.clpp" } }
33
+ }
34
+ ]
35
+ },
36
+ "link": {
37
+ "patterns": [
38
+ { "name": "keyword.control.link.clpp", "match": "^\\s*\\blink\\b" },
39
+ { "name": "keyword.control.link.as.clpp", "match": "\\b(as|from)\\b" },
40
+ { "name": "support.namespace.clpp", "match": "@(clpp|game)(?:\\.[A-Za-z_][A-Za-z0-9_]*)*" }
41
+ ]
42
+ },
43
+ "attributes": {
44
+ "name": "support.type.annotation.clpp",
45
+ "match": "\\[\\[(server|client|shared)\\]\\]|@(server|client|parallel)\\b"
46
+ },
47
+ "strings": {
48
+ "patterns": [
49
+ { "name": "string.quoted.double.clpp", "begin": "\"", "end": "\"" },
50
+ { "name": "string.quoted.single.clpp", "begin": "'", "end": "'" },
51
+ { "name": "string.quoted.other.clpp", "begin": "`", "end": "`" }
52
+ ]
53
+ },
54
+ "keywords": {
55
+ "patterns": [
56
+ { "name": "keyword.control.clpp", "match": "\\b(if|else|guard|for|in|while|switch|case|default|break|return|match|spawn|parallel|async|await|link|as|from)\\b" },
57
+ { "name": "keyword.other.clpp", "match": "\\b(struct|class|namespace|using|template|typedef|enum|public|private|protected|static|const|constexpr|inline|extern|new)\\b" },
58
+ { "name": "storage.modifier.clpp", "match": "\\b(observable|signal|func)\\b" }
59
+ ]
60
+ },
61
+ "types": {
62
+ "patterns": [
63
+ { "name": "storage.type.clpp", "match": "\\b(void|int|float|double|bool|string|auto|func|array|dictionary|map|optional|Option|Result)\\b" }
64
+ ]
65
+ },
66
+ "constants": { "name": "constant.language.clpp", "match": "\\b(true|false|null|nullptr)\\b" },
67
+ "numbers": { "name": "constant.numeric.clpp", "match": "\\b\\d+(\\.\\d+)?\\b" },
68
+ "receiver": {
69
+ "patterns": [
70
+ { "name": "keyword.other.receiver.clpp", "match": "@this\\b" },
71
+ { "match": "(@)([A-Za-z_][A-Za-z0-9_]*)", "captures": { "1": { "name": "keyword.other.receiver.clpp" }, "2": { "name": "variable.other.property.receiver.clpp" } } }
72
+ ]
73
+ },
74
+ "operators": {
75
+ "patterns": [
76
+ { "name": "keyword.operator.concat.clpp", "match": "\\.:" },
77
+ { "name": "keyword.operator.cleanup.clpp", "match": "~>" },
78
+ { "name": "keyword.operator.scope.clpp", "match": "::" },
79
+ { "name": "keyword.operator.arrow.clpp", "match": "=>" },
80
+ { "name": "keyword.operator.assignment.clpp", "match": "\\+=|-=|\\*=|/=|=" }
81
+ ]
82
+ },
83
+ "properties": {
84
+ "patterns": [
85
+ { "match": "\\.(?![:.])([A-Za-z_][A-Za-z0-9_]*)", "captures": { "1": { "name": "variable.other.property.clpp" } } }
86
+ ]
87
+ },
88
+ "functions": { "name": "entity.name.function.clpp", "match": "\\b([A-Za-z_][A-Za-z0-9_]*)\\s*(?=\\()" }
89
+ }
90
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "rootDir": "src",
2
+ "rootDir": "Src",
3
3
  "outDir": "out",
4
4
  "strict": false,
5
5
  "architecture": false
@@ -2,18 +2,23 @@
2
2
  "name": "cluaupp-game",
3
3
  "tree": {
4
4
  "$className": "DataModel",
5
- "ReplicatedFirst": {
6
- "$className": "ReplicatedFirst",
7
- "$path": "out/ReplicatedFirst"
8
- },
9
5
  "ServerScriptService": {
10
6
  "$className": "ServerScriptService",
11
- "$path": "out/ServerScriptService"
7
+ "$path": "out/Server",
8
+ "Parallel": {
9
+ "$path": "out/Parallel"
10
+ }
12
11
  },
13
12
  "ReplicatedStorage": {
14
13
  "$className": "ReplicatedStorage",
15
- "Shared": {
16
- "$path": "out/ReplicatedStorage/Shared"
14
+ "Declarations": {
15
+ "$path": "out/Declarations"
16
+ },
17
+ "Include": {
18
+ "$path": "out/Include"
19
+ },
20
+ "Modules": {
21
+ "$path": "out/Modules"
17
22
  },
18
23
  "CluauppLibs": {
19
24
  "$path": "libs"
@@ -23,17 +28,9 @@
23
28
  "$className": "StarterPlayer",
24
29
  "StarterPlayerScripts": {
25
30
  "$className": "StarterPlayerScripts",
26
- "$path": "out/StarterPlayer/StarterPlayerScripts"
27
- },
28
- "StarterCharacterScripts": {
29
- "$className": "StarterCharacterScripts",
30
- "$path": "out/StarterPlayer/StarterCharacterScripts"
31
+ "$path": "out/Client"
31
32
  }
32
33
  },
33
- "ServerStorage": {
34
- "$className": "ServerStorage",
35
- "$path": "out/ServerStorage"
36
- },
37
34
  "HttpService": {
38
35
  "$className": "HttpService",
39
36
  "$properties": {
@@ -0,0 +1,7 @@
1
+ #pragma strict
2
+ link @clpp.roblox;
3
+ link @clpp.libs.keep as Keep;
4
+
5
+ void init() {
6
+ Keep.Client.Init();
7
+ }
@@ -0,0 +1,4 @@
1
+ #pragma strict
2
+ link @clpp.roblox;
3
+
4
+ void init() {}
@@ -0,0 +1,7 @@
1
+ #pragma strict
2
+ link @clpp.roblox;
3
+ link @clpp.libs.ward as Ward;
4
+
5
+ void init() {
6
+ Ward.Start();
7
+ }
@@ -1,6 +1,6 @@
1
1
  #pragma strict
2
- #include <clpp/roblox.clh>
3
- #include <clpp/libs/keep.clh>
2
+ link @clpp.roblox;
3
+ link @clpp.libs.keep as Keep;
4
4
 
5
5
  void BindLeaderstats(Player player) {
6
6
  auto data = Keep.Server.WaitFor(player);
@@ -1,7 +1,7 @@
1
1
  #pragma strict
2
- #include <clpp/roblox.clh>
3
- #include <clpp/libs/keep.clh>
4
- import { PlayerTemplate } from "../../ReplicatedStorage/Shared/Constants/Datas/TemplateData.clh";
2
+ link @clpp.roblox;
3
+ link @clpp.libs.keep as Keep;
4
+ link "../../Include/GameTypes.clh" as GameTypes;
5
5
 
6
6
  void init() {
7
7
  PlayerTemplate playerData = PlayerTemplate();
@@ -0,0 +1,4 @@
1
+ #pragma strict
2
+
3
+
4
+ void init() {}
@@ -166,6 +166,11 @@ function rewriteGameRootedRequires(luau) {
166
166
  const re = new RegExp(`script(?:\\.Parent)+\\.${svc}\\.`, "g");
167
167
  next = next.replace(re, `${svc}.`);
168
168
  }
169
+ // Domain root folders are mapped under ReplicatedStorage by GenRojoTree.
170
+ for (const folder of ["Include", "Modules", "Declarations"]) {
171
+ const re = new RegExp(`script(?:\\.Parent)+\\.${folder}\\.`, "g");
172
+ next = next.replace(re, `ReplicatedStorage.${folder}.`);
173
+ }
169
174
  return next;
170
175
  }
171
176
  /** Ensure GetService lines exist for any game-rooted require used. */
@@ -0,0 +1,118 @@
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.buildRojoTree = buildRojoTree;
7
+ exports.writeDefaultProject = writeDefaultProject;
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ function walkFiles(dir, files = []) {
11
+ if (!node_fs_1.default.existsSync(dir)) {
12
+ return files;
13
+ }
14
+ for (const entry of node_fs_1.default.readdirSync(dir, { withFileTypes: true })) {
15
+ const full = node_path_1.default.join(dir, entry.name);
16
+ if (entry.isDirectory()) {
17
+ walkFiles(full, files);
18
+ continue;
19
+ }
20
+ files.push(full);
21
+ }
22
+ return files;
23
+ }
24
+ function withPath(node, relPath) {
25
+ node.$path = relPath.replace(/\\/g, "/");
26
+ }
27
+ function ensureNode(root, parts) {
28
+ let current = root;
29
+ for (const part of parts) {
30
+ const next = current[part];
31
+ if (next && typeof next === "object") {
32
+ current = next;
33
+ continue;
34
+ }
35
+ const created = {};
36
+ current[part] = created;
37
+ current = created;
38
+ }
39
+ return current;
40
+ }
41
+ function fileStem(rel) {
42
+ return rel
43
+ .replace(/\.(server|client)\.luau$/i, "")
44
+ .replace(/\.(server|client)\.(clpp|clp|clh)$/i, "")
45
+ .replace(/\.(luau|lua|clpp|clp|clh|flare|hive|mint|bloom|helm|shift|axiom)$/i, "");
46
+ }
47
+ function mapModules(rootTree, rootAbs, modulesRoot) {
48
+ if (!node_fs_1.default.existsSync(modulesRoot)) {
49
+ return;
50
+ }
51
+ const files = walkFiles(modulesRoot).filter((file) => /\.(luau|lua|clpp|clp|clh)$/i.test(file));
52
+ for (const file of files) {
53
+ const rel = node_path_1.default.relative(rootAbs, file).replace(/\\/g, "/");
54
+ const moduleRel = node_path_1.default.relative(modulesRoot, file).replace(/\\/g, "/");
55
+ const stem = fileStem(moduleRel);
56
+ const parts = stem.split("/").filter(Boolean);
57
+ if (parts.length === 0) {
58
+ continue;
59
+ }
60
+ const isServer = /\.server\.(luau|lua|clpp|clp|clh)$/i.test(file);
61
+ const isClient = /\.client\.(luau|lua|clpp|clp|clh)$/i.test(file);
62
+ const rootParts = isServer
63
+ ? ["ServerScriptService", "Modules"]
64
+ : isClient
65
+ ? ["StarterPlayer", "StarterPlayerScripts", "Modules"]
66
+ : ["ReplicatedStorage", "Modules"];
67
+ const parent = ensureNode(rootTree, [...rootParts, ...parts.slice(0, -1)]);
68
+ const leaf = ensureNode(parent, [parts[parts.length - 1]]);
69
+ withPath(leaf, rel);
70
+ }
71
+ }
72
+ function baseTree() {
73
+ return {
74
+ $className: "DataModel",
75
+ ServerScriptService: {
76
+ $className: "ServerScriptService",
77
+ },
78
+ ReplicatedStorage: {
79
+ $className: "ReplicatedStorage",
80
+ CluauppLibs: { $path: "libs" },
81
+ },
82
+ StarterPlayer: {
83
+ $className: "StarterPlayer",
84
+ StarterPlayerScripts: {
85
+ $className: "StarterPlayerScripts",
86
+ },
87
+ },
88
+ HttpService: {
89
+ $className: "HttpService",
90
+ $properties: {
91
+ HttpEnabled: true,
92
+ },
93
+ },
94
+ };
95
+ }
96
+ function buildRojoTree(root, rootDir, outDir) {
97
+ const outRoot = node_path_1.default.join(root, outDir);
98
+ const srcRoot = node_path_1.default.join(root, rootDir);
99
+ const sourceRoot = node_fs_1.default.existsSync(outRoot) ? outRoot : srcRoot;
100
+ const tree = baseTree();
101
+ const relRoot = node_path_1.default.relative(root, sourceRoot).replace(/\\/g, "/");
102
+ withPath(ensureNode(tree, ["ServerScriptService"]), `${relRoot}/Server`);
103
+ withPath(ensureNode(tree, ["ServerScriptService", "Parallel"]), `${relRoot}/Parallel`);
104
+ withPath(ensureNode(tree, ["StarterPlayer", "StarterPlayerScripts"]), `${relRoot}/Client`);
105
+ withPath(ensureNode(tree, ["ReplicatedStorage", "Declarations"]), `${relRoot}/Declarations`);
106
+ withPath(ensureNode(tree, ["ReplicatedStorage", "Include"]), `${relRoot}/Include`);
107
+ mapModules(tree, root, node_path_1.default.join(sourceRoot, "Modules"));
108
+ return tree;
109
+ }
110
+ function writeDefaultProject(root, rootDir, outDir, projectJsonPath) {
111
+ const file = node_path_1.default.resolve(root, projectJsonPath || "default.project.json");
112
+ const body = {
113
+ name: "cluaupp-game",
114
+ tree: buildRojoTree(root, rootDir, outDir),
115
+ };
116
+ node_fs_1.default.writeFileSync(file, `${JSON.stringify(body, null, "\t")}\n`, "utf8");
117
+ return file;
118
+ }
@@ -30,6 +30,7 @@ const flare_version_js_1 = require("../target/flare-version.js");
30
30
  const component_contracts_js_1 = require("../target/component-contracts.js");
31
31
  const authority_check_js_1 = require("../target/authority-check.js");
32
32
  const datamodel_js_1 = require("../target/datamodel.js");
33
+ const gen_rojo_tree_js_1 = require("../target/gen-rojo-tree.js");
33
34
  const build_cache_js_1 = require("../target/build-cache.js");
34
35
  const modules_js_1 = require("../clpp/modules.js");
35
36
  function readProjectConfig(file) {
@@ -305,6 +306,9 @@ function createMapper(root, config, rojoPath) {
305
306
  mapper.loadSync();
306
307
  return mapper;
307
308
  }
309
+ function syncRojoTree(root, config, rojoPath) {
310
+ (0, gen_rojo_tree_js_1.writeDefaultProject)(root, config.rootDir, config.outDir, rojoPath || "default.project.json");
311
+ }
308
312
  function compileOptions(root, config, file, rel) {
309
313
  const srcDir = node_path_1.default.join(root, config.rootDir);
310
314
  return {
@@ -586,6 +590,7 @@ function finishBuild(root, config, compiled, options) {
586
590
  }
587
591
  }
588
592
  const written = writeJobs(root, config, compiled.jobs, format);
593
+ syncRojoTree(root, config, options.rojo);
589
594
  try {
590
595
  const soaPlans = (0, optimizer_soa_js_1.collectSoaPlansFromProject)(root, config.rootDir);
591
596
  if (soaPlans.length) {
@@ -625,6 +630,7 @@ function prepareBuild(root, options) {
625
630
  const exitOnError = options.exitOnError !== false;
626
631
  const holdOnError = options.holdOnError === true;
627
632
  const config = loadConfig(root);
633
+ syncRojoTree(root, config, options.rojo);
628
634
  if (options.strict === true) {
629
635
  config.strict = true;
630
636
  }
@@ -700,6 +706,8 @@ async function init(dest) {
700
706
  copyDir(skills, node_path_1.default.join(target, ".cursor", "skills"));
701
707
  }
702
708
  copyRuntime(target);
709
+ const initConfig = loadConfig(target);
710
+ syncRojoTree(target, initConfig);
703
711
  (0, intellisense_js_1.syncEditorSupport)(target);
704
712
  try {
705
713
  (0, intellisense_js_1.installEditorExtension)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cluaupp",
3
- "version": "1.5.1",
3
+ "version": "1.5.2-cf",
4
4
  "description": "Cluaupp toolchain — compile CL++ to Luau with Rojo and CluauppLibs.",
5
5
  "author": "KartzDev",
6
6
  "license": "MIT",
@@ -17,6 +17,8 @@
17
17
  "bin",
18
18
  "src",
19
19
  "generated",
20
+ "rust",
21
+ "native",
20
22
  "include",
21
23
  "templates",
22
24
  "examples",
@@ -27,6 +29,7 @@
27
29
  "data",
28
30
  "plugins",
29
31
  "scripts/postinstall-editor.js",
32
+ "scripts/postinstall-native.js",
30
33
  "README.md",
31
34
  "LICENSE",
32
35
  "CHANGELOG.md",
@@ -40,10 +43,11 @@
40
43
  "cluau": "node bin/cluaupp.js",
41
44
  "build": "tsc",
42
45
  "build:cli": "tsc",
46
+ "build:native": "cargo build --release --manifest-path rust/cluaupp/Cargo.toml",
43
47
  "dev:cli": "tsx src/cli.ts",
44
48
  "prepare": "tsc",
45
- "postinstall": "node scripts/postinstall-editor.js",
46
- "test": "node test/security.test.js && node test/understander.test.js && node test/out.test.js && node test/types.test.js && node test/modules.test.js && node test/modules-import.test.js && node test/get-service.test.js && node test/clpp.test.js && node test/flare.test.js && node test/native.test.js && node test/postprocess.test.js && node test/api.test.js && node test/api-reuse.test.js && node test/context-safety.test.js && node test/datamodel.test.js && node test/platform-analyzers.test.js && node test/platform-extras.test.js && node test/generator.test.js && node test/studio/smoke.test.js",
49
+ "postinstall": "node scripts/postinstall-native.js && node scripts/postinstall-editor.js",
50
+ "test": "node test/security.test.js && node test/understander.test.js && node test/out.test.js && node test/types.test.js && node test/modules.test.js && node test/modules-import.test.js && node test/gen-rojo-tree.test.js && node test/get-service.test.js && node test/clpp.test.js && node test/flare.test.js && node test/native.test.js && node test/postprocess.test.js && node test/api.test.js && node test/api-reuse.test.js && node test/context-safety.test.js && node test/datamodel.test.js && node test/platform-analyzers.test.js && node test/platform-extras.test.js && node test/generator.test.js && node test/studio/smoke.test.js",
47
51
  "test:clpp-contract": "node test/clpp.test.js",
48
52
  "generate-api": "node scripts/generate-api.js",
49
53
  "vendor-libs": "node scripts/vendor-libs.js",