diff --git a/.gitignore b/.gitignore index cdd52d9..b79fda6 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,9 @@ dist/ # Wally files DevPackages Packages +luau_packages wally.lock +pesde.lock WallyPatches # Typescript @@ -55,7 +57,6 @@ WallyPatches roblox.toml sourcemap.json globalTypes.d.luau -# Used for testing, unfortunately we can't just install it with wally and expect it to work in vanilla luau -jecs.luau +jecs_src.luau # Stores Github PAT .env diff --git a/.luaurc b/.luaurc index 332de00..1525a3d 100644 --- a/.luaurc +++ b/.luaurc @@ -1,8 +1,7 @@ { "languageMode": "strict", "aliases": { - "jecs_utils": "lib", - "testkit": "test/testkit", - "jecs": "jecs" + "lib": "lib", + "pkg": "luau_packages" } } diff --git a/.lune/download-jecs.luau b/.lune/download-jecs.luau index 2d23e65..e3fb185 100644 --- a/.lune/download-jecs.luau +++ b/.lune/download-jecs.luau @@ -64,4 +64,6 @@ end local gh_api_tag: gh_api_tag = serde.decode("json", response.body) -spawn.start(`curl https://raw.githubusercontent.com/ukendio/jecs/{gh_api_tag.object.sha}/src/init.luau -o jecs.luau`) +spawn.start( + `curl https://raw.githubusercontent.com/ukendio/jecs/{gh_api_tag.object.sha}/src/init.luau -o jecs_src.luau` +) diff --git a/.zed/settings.json b/.zed/settings.json index 6482f28..aff71f6 100644 --- a/.zed/settings.json +++ b/.zed/settings.json @@ -18,15 +18,7 @@ "rojoProjectFile": "dev.project.json" }, "require": { - "mode": "relativeToFile", - "fileAliases": { - "@jecs_utils": "lib", - "@testkit": "test/testkit", - "@jecs": "Packages/jecs" - }, - "directoryAliases": { - "@lune": ".lune/.lune-defs/" - } + "mode": "relativeToFile" } }, "ext": { diff --git a/jecs.luau b/jecs.luau new file mode 100644 index 0000000..0eb11dc --- /dev/null +++ b/jecs.luau @@ -0,0 +1,13 @@ +--!strict +--!native +--!optimize 2 +-- pesde adds dependencies by including a folder with them in the package +-- wally just adds a file for each dependency +-- this is here to mitigate that +local jecs = require("luau_packages/jecs") +export type Archetype = jecs.Archetype +export type Id = jecs.Id +export type Pair = jecs.Pair +export type Entity = jecs.Entity +export type World = jecs.World +return jecs diff --git a/lib/handle.luau b/lib/handle.luau index d4ee535..70bc7e2 100644 --- a/lib/handle.luau +++ b/lib/handle.luau @@ -2,7 +2,7 @@ --!optimize 2 local jecs = require("../jecs") type entity = jecs.Entity -type id = entity | jecs.Pair +type id = jecs.Id local world = require("./world").get diff --git a/pesde.toml b/pesde.toml index 094da34..607ef7d 100644 --- a/pesde.toml +++ b/pesde.toml @@ -1,10 +1,10 @@ name = "mark_marks/jecs_utils" -version = "0.1.6" +version = "0.1.7-rc.0" description = "A set of utilities for jecs" authors = ["marked/Mark-Marks"] repository = "https://github.com/mark-marks/jecs-utils" license = "MIT" -includes = ["lib", "LICENSE", "pesde.toml", "README.md"] +includes = ["lib", "LICENSE", "pesde.toml", "README.md", "jecs.luau"] [target] environment = "luau" diff --git a/rokit.toml b/rokit.toml index 2c63b39..af47a6b 100644 --- a/rokit.toml +++ b/rokit.toml @@ -8,7 +8,7 @@ wally = "upliftgames/wally@0.3.2" rojo = "rojo-rbx/rojo@7.4.4" lune = "lune-org/lune@0.8.9" selene = "kampfkarren/selene@0.27.1" -luau-lsp = "johnnymorganz/luau-lsp@1.32.4" +luau-lsp = "johnnymorganz/luau-lsp@1.36.0" stylua = "johnnymorganz/stylua@0.20.0" wally-package-types = "johnnymorganz/wally-package-types@1.3.2" darklua = "seaofvoices/darklua@0.13.1" diff --git a/test/tests.luau b/test/tests.luau index 3ea84b9..d8c9500 100644 --- a/test/tests.luau +++ b/test/tests.luau @@ -1,8 +1,8 @@ --!strict -- stylua: ignore start -local jecs = require("@jecs") -local jecs_utils = require("@jecs_utils") -local testkit = require("@testkit") +local jecs = require("@pkg/jecs") +local jecs_utils = require("@lib/init") +local testkit = require("./testkit") type entity = jecs.Entity diff --git a/wally.toml b/wally.toml index a8f4a38..156ee6b 100644 --- a/wally.toml +++ b/wally.toml @@ -1,6 +1,6 @@ [package] name = "mark-marks/jecs-utils" -version = "0.1.6" +version = "0.1.7-rc.0" registry = "https://github.com/UpliftGames/wally-index" realm = "shared" license = "MIT" @@ -15,4 +15,4 @@ include = [ ] [dependencies] -jecs = "ukendio/jecs@0.3.2" +jecs = "ukendio/jecs@0.4.0"