From 46839fe748610c7229044c158fdcdd3120994d25 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Sat, 30 Aug 2025 16:26:52 +0200 Subject: [PATCH 01/10] update pesde.toml authors --- pesde.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pesde.toml b/pesde.toml index 53a785b..6752ccd 100644 --- a/pesde.toml +++ b/pesde.toml @@ -1,7 +1,7 @@ name = "ewdev/multitarget" version = "0.4.2-rc.1" description = "[Fork] Customizable and flexible build script for multiple pesde targets" -authors = ["jiwonz ", "EwDev"] +authors = ["jiwonz ", "EwDev (https://ewdev.net/)"] repository = "https://github.com/ewd3v/pesde-multitarget" license = "MIT" includes = ["src/**", "LICENSE", "README.md", "pesde.toml"] From 7174eced51cfc442a093c08e21e0225d980bb11c Mon Sep 17 00:00:00 2001 From: EwDev <74792428+ewd3v@users.noreply.github.com> Date: Sat, 30 Aug 2025 14:36:27 +0000 Subject: [PATCH 02/10] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d660240..1153fac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# [pesde-multitarget](https://pesde.dev/packages/jiwonz/multitarget) +Fork of https://github.com/jiwonz/pesde-multitarget containing my fixes & updates that may not merged into the official repository yet. + +# [pesde-multitarget](https://pesde.dev/packages/ewdev/multitarget) Customizable and flexible build script for multiple pesde targets Build your pure pesde project easier targeting both `luau` and `roblox` targets at the same time. @@ -11,7 +13,7 @@ Add & Install this pesde package and darklua as a dev_dependency: ```sh pesde add pesde/darklua --dev -t lune # Pass if darklua is installed already. -pesde add jiwonz/multitarget --dev -t lune +pesde add ewdev/multitarget --dev -t lune pesde install ``` @@ -53,7 +55,7 @@ pesde run build ### `pesde x` Execute directly without installation: ```sh -pesde x jiwonz/multitarget -- --help +pesde x ewdev/multitarget -- --help ``` ## Usage @@ -68,7 +70,7 @@ multitarget setup ``` With `pesde x`: ```sh -pesde x jiwonz/multitarget -- setup +pesde x ewdev/multitarget -- setup ``` ### `build` @@ -88,5 +90,5 @@ multitarget build -w -a --build-files src # Build for every(-a --all) targets wi ``` With `pesde x`: ```sh -pesde x jiwonz/multitarget -- build ... +pesde x ewdev/multitarget -- build ... ``` From 652b519fd7e3fe4cfb19c42ec3cb73a6d0634402 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Sat, 30 Aug 2025 16:37:37 +0200 Subject: [PATCH 03/10] bump version --- pesde.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pesde.toml b/pesde.toml index 6752ccd..52b828f 100644 --- a/pesde.toml +++ b/pesde.toml @@ -1,5 +1,5 @@ name = "ewdev/multitarget" -version = "0.4.2-rc.1" +version = "0.4.2-rc.2" description = "[Fork] Customizable and flexible build script for multiple pesde targets" authors = ["jiwonz ", "EwDev (https://ewdev.net/)"] repository = "https://github.com/ewd3v/pesde-multitarget" From ca99612f7beaa40fcfbcac94bf62562f2b294aa4 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Sat, 30 Aug 2025 20:37:08 +0200 Subject: [PATCH 04/10] bump version --- pesde.lock | 4 ++-- pesde.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pesde.lock b/pesde.lock index 8c3339e..cee07fd 100644 --- a/pesde.lock +++ b/pesde.lock @@ -1,8 +1,8 @@ # This file is automatically @generated by pesde. # It is not intended for manual editing. format = 2 -name = "jiwonz/multitarget" -version = "0.4.0-rc.30" +name = "ewdev/multitarget" +version = "0.4.2-rc.3" target = "lune" [graph."caveful_games/argparse@0.1.2 lune"] diff --git a/pesde.toml b/pesde.toml index 52b828f..98bde03 100644 --- a/pesde.toml +++ b/pesde.toml @@ -1,5 +1,5 @@ name = "ewdev/multitarget" -version = "0.4.2-rc.2" +version = "0.4.2-rc.3" description = "[Fork] Customizable and flexible build script for multiple pesde targets" authors = ["jiwonz ", "EwDev (https://ewdev.net/)"] repository = "https://github.com/ewd3v/pesde-multitarget" From 0d0a2819bcbd2222756e3d5bb4343577f58a12a6 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:28:56 +0200 Subject: [PATCH 05/10] update existing dependencies for newer luau semantics --- pesde.lock | 116 +++++++++++++++++++++++++++-------------------------- pesde.toml | 16 ++++---- 2 files changed, 68 insertions(+), 64 deletions(-) diff --git a/pesde.lock b/pesde.lock index 8c3339e..69fccee 100644 --- a/pesde.lock +++ b/pesde.lock @@ -25,113 +25,117 @@ direct = ["table_helper", { name = "caveful_games/table_helper", version = "^0.2 ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."corecii/greentea@0.4.11 lune"] -direct = ["greentea", { name = "corecii/greentea", version = "^0.4.11", index = "default" }, "standard"] +[graph."jiwonz/darklua_lune@0.3.0 lune"] +direct = ["darklua_lune", { name = "jiwonz/darklua_lune", version = "^0.3.0", index = "default" }, "standard"] -[graph."corecii/greentea@0.4.11 lune".pkg_ref] +[graph."jiwonz/darklua_lune@0.3.0 lune".dependencies] +dirs = ["jiwonz/dirs@0.6.0 lune", "standard"] +greentea = ["jiwonz/greentea_luau@0.2.0 luau", "standard"] + +[graph."jiwonz/darklua_lune@0.3.0 lune".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/darklua_lune@0.2.0 lune"] -direct = ["darklua_lune", { name = "jiwonz/darklua_lune", version = "^0.2.0", index = "default" }, "standard"] +[graph."jiwonz/darklua_lune@0.3.0 lune".pkg_ref.dependencies] +dirs = [{ name = "jiwonz/dirs", version = "^0.6.0", index = "https://github.com/pesde-pkg/index" }, "standard"] +greentea = [{ name = "jiwonz/greentea_luau", version = "^0.2.0", index = "https://github.com/pesde-pkg/index", target = "luau" }, "standard"] -[graph."jiwonz/darklua_lune@0.2.0 lune".dependencies] -dirs = ["jiwonz/dirs@0.5.1 lune", "standard"] -greentea = ["corecii/greentea@0.4.11 lune", "standard"] +[graph."jiwonz/dirs@0.6.0 lune".dependencies] +greentea = ["jiwonz/greentea_luau@0.2.0 luau", "standard"] +pathfs = ["jiwonz/pathfs@0.6.0 lune", "standard"] -[graph."jiwonz/darklua_lune@0.2.0 lune".pkg_ref] +[graph."jiwonz/dirs@0.6.0 lune".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/darklua_lune@0.2.0 lune".pkg_ref.dependencies] -dirs = [{ name = "jiwonz/dirs", version = "^0.5.1", index = "https://github.com/pesde-pkg/index" }, "standard"] -greentea = [{ name = "corecii/greentea", version = "^0.4.11", index = "https://github.com/pesde-pkg/index" }, "standard"] +[graph."jiwonz/dirs@0.6.0 lune".pkg_ref.dependencies] +greentea = [{ name = "jiwonz/greentea_luau", version = "^0.2.0", index = "https://github.com/pesde-pkg/index", target = "luau" }, "standard"] +pathfs = [{ name = "jiwonz/pathfs", version = "^0.6.0", index = "https://github.com/pesde-pkg/index" }, "standard"] + +[graph."jiwonz/glob@0.2.0 lune"] +direct = ["glob", { name = "jiwonz/glob", version = "^0.2.0", index = "default" }, "standard"] -[graph."jiwonz/dirs@0.5.1 lune".dependencies] -greentea = ["corecii/greentea@0.4.11 lune", "standard"] -pathfs = ["jiwonz/pathfs@0.6.0-rc.8 lune", "standard"] +[graph."jiwonz/glob@0.2.0 lune".dependencies] +globrex_lune = ["kimpure/globrex_lune@0.2.9 lune", "standard"] +pathfs = ["jiwonz/pathfs@0.6.0 lune", "standard"] -[graph."jiwonz/dirs@0.5.1 lune".pkg_ref] +[graph."jiwonz/glob@0.2.0 lune".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/dirs@0.5.1 lune".pkg_ref.dependencies] -greentea = [{ name = "corecii/greentea", version = "^0.4.10", index = "https://github.com/daimond113/pesde-index" }, "standard"] -pathfs = [{ name = "jiwonz/pathfs", version = "^0.6.0-rc.6", index = "https://github.com/daimond113/pesde-index" }, "standard"] - -[graph."jiwonz/glob@0.1.2 lune"] -direct = ["glob", { name = "jiwonz/glob", version = "^0.1.1", index = "default" }, "standard"] +[graph."jiwonz/glob@0.2.0 lune".pkg_ref.dependencies] +globrex_lune = [{ name = "kimpure/globrex_lune", version = "^0.2.9", index = "https://github.com/pesde-pkg/index" }, "standard"] +pathfs = [{ name = "jiwonz/pathfs", version = "^0.6.0", index = "https://github.com/pesde-pkg/index" }, "standard"] -[graph."jiwonz/glob@0.1.2 lune".dependencies] -globrex_lune = ["kimpure/globrex_lune@0.2.4 lune", "standard"] -pathfs = ["jiwonz/pathfs@0.6.0-rc.8 lune", "standard"] +[graph."jiwonz/greentea_luau@0.2.0 luau"] +direct = ["greentea", { name = "jiwonz/greentea_luau", version = "^0.2.0", index = "default", target = "luau" }, "standard"] -[graph."jiwonz/glob@0.1.2 lune".pkg_ref] +[graph."jiwonz/greentea_luau@0.2.0 luau".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/glob@0.1.2 lune".pkg_ref.dependencies] -globrex_lune = [{ name = "kimpure/globrex_lune", version = "^0.2.4", index = "https://github.com/pesde-pkg/index" }, "standard"] -pathfs = [{ name = "jiwonz/pathfs", version = "^0.6.0-rc.3", index = "https://github.com/pesde-pkg/index" }, "standard"] - -[graph."jiwonz/luau_disk@0.1.4 luau".pkg_ref] +[graph."jiwonz/luau_disk@0.2.0 luau".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/luau_path@0.1.4 luau".dependencies] -luau_disk = ["jiwonz/luau_disk@0.1.4 luau", "standard"] +[graph."jiwonz/luau_path@0.2.0 luau".dependencies] +luau_disk = ["jiwonz/luau_disk@0.2.0 luau", "standard"] -[graph."jiwonz/luau_path@0.1.4 luau".pkg_ref] +[graph."jiwonz/luau_path@0.2.0 luau".pkg_ref] ref_ty = "pesde" -index_url = "https://github.com/daimond113/pesde-index" +index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/luau_path@0.1.4 luau".pkg_ref.dependencies] -luau_disk = [{ name = "jiwonz/luau_disk", version = "^0.1.4", index = "https://github.com/pesde-pkg/index" }, "standard"] +[graph."jiwonz/luau_path@0.2.0 luau".pkg_ref.dependencies] +luau_disk = [{ name = "jiwonz/luau_disk", version = "^0.2.0", index = "https://github.com/pesde-pkg/index" }, "standard"] [graph."jiwonz/luau_regexp@0.1.3 luau".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/pathfs@0.6.0-rc.8 lune"] -direct = ["pathfs", { name = "jiwonz/pathfs", version = "^0.6.0-rc.8", index = "default" }, "standard"] +[graph."jiwonz/pathfs@0.6.0 lune"] +direct = ["pathfs", { name = "jiwonz/pathfs", version = "^0.6.0", index = "default" }, "standard"] -[graph."jiwonz/pathfs@0.6.0-rc.8 lune".dependencies] -greentea = ["corecii/greentea@0.4.11 lune", "standard"] -luau_path = ["jiwonz/luau_path@0.1.4 luau", "standard"] +[graph."jiwonz/pathfs@0.6.0 lune".dependencies] +greentea = ["jiwonz/greentea_luau@0.2.0 luau", "standard"] +luau_path = ["jiwonz/luau_path@0.2.0 luau", "standard"] -[graph."jiwonz/pathfs@0.6.0-rc.8 lune".pkg_ref] +[graph."jiwonz/pathfs@0.6.0 lune".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."jiwonz/pathfs@0.6.0-rc.8 lune".pkg_ref.dependencies] -frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://github.com/daimond113/pesde-index" }, "dev"] -greentea = [{ name = "corecii/greentea", version = "^0.4.11", index = "https://github.com/daimond113/pesde-index" }, "standard"] -luau_path = [{ name = "jiwonz/luau_path", version = "^0.1.4", index = "https://github.com/daimond113/pesde-index", target = "luau" }, "standard"] +[graph."jiwonz/pathfs@0.6.0 lune".pkg_ref.dependencies] +frktest = [{ name = "itsfrank/frktest", version = "^0.0.4", index = "https://github.com/pesde-pkg/index", target = "luau" }, "dev"] +greentea = [{ name = "jiwonz/greentea_luau", version = "^0.2.0", index = "https://github.com/pesde-pkg/index", target = "luau" }, "standard"] +luau_path = [{ name = "jiwonz/luau_path", version = "^0.2.0", index = "https://github.com/pesde-pkg/index", target = "luau" }, "standard"] -[graph."kimpure/chalk_luau@0.1.7 luau"] -direct = ["chalk_luau", { name = "kimpure/chalk_luau", version = "^0.1.7", index = "default", target = "luau" }, "standard"] +[graph."kimpure/chalk_luau@0.1.8 luau"] +direct = ["chalk_luau", { name = "kimpure/chalk_luau", version = "^0.1.8", index = "default", target = "luau" }, "standard"] -[graph."kimpure/chalk_luau@0.1.7 luau".pkg_ref] +[graph."kimpure/chalk_luau@0.1.8 luau".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."kimpure/globrex_lune@0.2.4 lune".dependencies] +[graph."kimpure/chalk_luau@0.1.8 luau".pkg_ref.dependencies] +darklua = [{ name = "pesde/darklua", version = "^0.16.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"] +multitarget = [{ name = "jiwonz/multitarget", version = "^0.4.0-rc.28", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"] + +[graph."kimpure/globrex_lune@0.2.9 lune".dependencies] luau_regexp = ["jiwonz/luau_regexp@0.1.3 luau", "standard"] -[graph."kimpure/globrex_lune@0.2.4 lune".pkg_ref] +[graph."kimpure/globrex_lune@0.2.9 lune".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" -[graph."kimpure/globrex_lune@0.2.4 lune".pkg_ref.dependencies] +[graph."kimpure/globrex_lune@0.2.9 lune".pkg_ref.dependencies] luau_check = [{ name = "jiwonz/luau_check", version = "^0.2.2", index = "https://github.com/pesde-pkg/index" }, "dev"] luau_lsp = [{ name = "pesde/luau_lsp", version = "^1.38.1", index = "https://github.com/pesde-pkg/index" }, "dev"] luau_regexp = [{ name = "jiwonz/luau_regexp", version = "^0.1.0", index = "https://github.com/pesde-pkg/index", target = "luau" }, "standard"] selene = [{ name = "pesde/selene", version = "^0.27.1", index = "https://github.com/pesde-pkg/index" }, "dev"] stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index" }, "dev"] -[graph."lukadev_0/result@1.2.0 lune"] -direct = ["result", { name = "lukadev_0/result", version = "^1.2.0", index = "default" }, "standard"] +[graph."lukadev_0/result@1.2.1 lune"] +direct = ["result", { name = "lukadev_0/result", version = "^1.2.1", index = "default" }, "standard"] -[graph."lukadev_0/result@1.2.0 lune".pkg_ref] +[graph."lukadev_0/result@1.2.1 lune".pkg_ref] ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" diff --git a/pesde.toml b/pesde.toml index 09b7ee1..9af70fe 100644 --- a/pesde.toml +++ b/pesde.toml @@ -18,15 +18,15 @@ default = "https://github.com/pesde-pkg/index" example = "scripts/example.luau" [engines] -lune = "^0.9.4" -pesde = "^0.7.0-rc.1" +lune = "^0.10.3" +pesde = "^0.7.1" [dependencies] -pathfs = { name = "jiwonz/pathfs", version = "^0.6.0-rc.8" } -greentea = { name = "corecii/greentea", version = "^0.4.11" } +pathfs = { name = "jiwonz/pathfs", version = "^0.6.0" } +greentea = { name = "jiwonz/greentea_luau", version = "^0.2.0", target = "luau" } argparse = { name = "caveful_games/argparse", version = "^0.1.2" } -glob = { name = "jiwonz/glob", version = "^0.1.1" } -darklua_lune = { name = "jiwonz/darklua_lune", version = "^0.2.0" } -result = { name = "lukadev_0/result", version = "^1.2.0" } -chalk_luau = { name = "kimpure/chalk_luau", version = "^0.1.7", target = "luau" } +glob = { name = "jiwonz/glob", version = "^0.2.0" } +darklua_lune = { name = "jiwonz/darklua_lune", version = "^0.3.0" } +result = { name = "lukadev_0/result", version = "^1.2.1" } +chalk_luau = { name = "kimpure/chalk_luau", version = "^0.1.8", target = "luau" } table_helper = { name = "caveful_games/table_helper", version = "^0.2.0-rc.1", target = "luau" } From 135ccc82c46b58846920504f50767eead2ffd276 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Wed, 29 Oct 2025 16:26:09 +0100 Subject: [PATCH 06/10] remove table_helper dependency --- pesde.lock | 7 ------- pesde.toml | 1 - src/bin.luau | 9 +++++---- src/lib.luau | 12 +++++++----- src/tableUtils/copy.luau | 20 ++++++++++++++++++++ src/tableUtils/set.luau | 16 ++++++++++++++++ 6 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 src/tableUtils/copy.luau create mode 100644 src/tableUtils/set.luau diff --git a/pesde.lock b/pesde.lock index 69fccee..0fd20f6 100644 --- a/pesde.lock +++ b/pesde.lock @@ -18,13 +18,6 @@ luau_lsp = [{ name = "pesde/luau_lsp", version = "^1.38.0", index = "https://git selene = [{ name = "pesde/selene", version = "^0.27.1", index = "https://github.com/pesde-pkg/index" }, "dev"] stylua = [{ name = "pesde/stylua", version = "^2.0.2", index = "https://github.com/pesde-pkg/index" }, "dev"] -[graph."caveful_games/table_helper@0.2.0-rc.1 luau"] -direct = ["table_helper", { name = "caveful_games/table_helper", version = "^0.2.0-rc.1", index = "default", target = "luau" }, "standard"] - -[graph."caveful_games/table_helper@0.2.0-rc.1 luau".pkg_ref] -ref_ty = "pesde" -index_url = "https://github.com/pesde-pkg/index" - [graph."jiwonz/darklua_lune@0.3.0 lune"] direct = ["darklua_lune", { name = "jiwonz/darklua_lune", version = "^0.3.0", index = "default" }, "standard"] diff --git a/pesde.toml b/pesde.toml index 9af70fe..50c0c3e 100644 --- a/pesde.toml +++ b/pesde.toml @@ -29,4 +29,3 @@ glob = { name = "jiwonz/glob", version = "^0.2.0" } darklua_lune = { name = "jiwonz/darklua_lune", version = "^0.3.0" } result = { name = "lukadev_0/result", version = "^1.2.1" } chalk_luau = { name = "kimpure/chalk_luau", version = "^0.1.8", target = "luau" } -table_helper = { name = "caveful_games/table_helper", version = "^0.2.0-rc.1", target = "luau" } diff --git a/src/bin.luau b/src/bin.luau index 187dfc9..319186f 100644 --- a/src/bin.luau +++ b/src/bin.luau @@ -6,7 +6,8 @@ local stdio = require("@lune/stdio") local serde = require("@lune/serde") local process = require("@lune/process") local chalk = require("../luau_packages/chalk_luau") -local tableHelper = require("../luau_packages/table_helper") + +local set = require("./tableUtils/set") local DEFAULT_OUTPUT_DIR = multitarget.DEFAULT_OUTPUT_DIR local DEFAULT_LUA_ENV_GLOBAL = multitarget.DEFAULT_LUA_ENV_GLOBAL @@ -175,8 +176,8 @@ setup:action(function() `Found dependencies in pesde.toml. Would you like to add default aliases '@{DEFAULT_PKG_ALIAS}' and '@{DEFAULT_LUAU_PKG_ALIAS}' in .luaurc for each target's dependencies?` ) then - tableHelper.set(luaurc, { "aliases", DEFAULT_PKG_ALIAS }, pkgPath) - tableHelper.set(luaurc, { "aliases", DEFAULT_LUAU_PKG_ALIAS }, "./luau_packages/") + set(luaurc, { "aliases", DEFAULT_PKG_ALIAS }, pkgPath) + set(luaurc, { "aliases", DEFAULT_LUAU_PKG_ALIAS }, "./luau_packages/") luaurcFile:writeFile(serde.encode("json", luaurc, true)) end end @@ -226,7 +227,7 @@ setup:action(function() `Found a selene.toml file. Would you like to add the default lua environment global variable name('{DEFAULT_LUA_ENV_GLOBAL}') to the ignore pattern?` ) then - tableHelper.set(seleneToml, path, DEFAULT_LUA_ENV_GLOBAL) + set(seleneToml, path, DEFAULT_LUA_ENV_GLOBAL) seleneFile:writeFile(serde.encode("toml", seleneToml, true)) end end diff --git a/src/lib.luau b/src/lib.luau index f2e412e..9561c3a 100644 --- a/src/lib.luau +++ b/src/lib.luau @@ -7,7 +7,9 @@ local glob = require("../lune_packages/glob") local process = require("@lune/process") local darklua = require("../lune_packages/darklua_lune") local Result = require("../lune_packages/result") -local tableHelper = require("../luau_packages/table_helper") + +local set = require("./tableUtils/set") +local copy = require("./tableUtils/copy") local DEFAULT_DARKLUA_RULES = { "remove_unused_if_branch", @@ -240,7 +242,7 @@ function multitarget.build( targetDir:writeDir() -- assure it exists (may not exist later if the user uses "includes" incorrectly, which would throw an undescriptive error later when trying to access this directory) -- selene: allow(shadowing) - local newPesdeToml = tableHelper.copy(pesdeToml, true) + local newPesdeToml = copy(pesdeToml, true) if newPesdeToml.includes then for _, include in newPesdeToml.includes do for _, path in @@ -290,12 +292,12 @@ function multitarget.build( } = if luaurcFile:isFile() then serde.decode("json", luaurcFile:readFile()) else {} - tableHelper.set(luaurc, { "aliases", pkgAlias }, `./{target}_packages/`) + set(luaurc, { "aliases", pkgAlias }, `./{target}_packages/`) if targets.lune then if target == "lune" then - tableHelper.set(luaurc, { "aliases", luauPkgAlias }, `./luau_packages/`) + set(luaurc, { "aliases", luauPkgAlias }, `./luau_packages/`) elseif target == "roblox" then - tableHelper.set(luaurc, { "aliases", luauPkgAlias }, `./roblox_packages/`) + set(luaurc, { "aliases", luauPkgAlias }, `./roblox_packages/`) end end luaurcFile:writeFile(serde.encode("json", luaurc, true)) diff --git a/src/tableUtils/copy.luau b/src/tableUtils/copy.luau new file mode 100644 index 0000000..ea48765 --- /dev/null +++ b/src/tableUtils/copy.luau @@ -0,0 +1,20 @@ +-- From: https://github.com/CavefulGames/luau-table-helper/blob/main/src/lib/init.luau +-- TODO: Remove when https://github.com/CavefulGames/luau-table-helper/pull/6 gets merged & released + +local function copy(t: T, deep: boolean?): T + if not deep then + return (table.clone(t :: any) :: any) :: T + end + local function deepCopy(tbl: { any }) + local tCopy = table.clone(tbl) + for k, v in tCopy do + if type(v) == "table" then + tCopy[k] = deepCopy(v) + end + end + return tCopy + end + return deepCopy(t :: any) :: T +end + +return copy diff --git a/src/tableUtils/set.luau b/src/tableUtils/set.luau new file mode 100644 index 0000000..b3814a3 --- /dev/null +++ b/src/tableUtils/set.luau @@ -0,0 +1,16 @@ +-- From: https://github.com/CavefulGames/luau-table-helper/blob/main/src/lib/init.luau +-- TODO: Remove when https://github.com/CavefulGames/luau-table-helper/pull/6 gets merged & released + +local function set(t: {}, path: { any }, value: any) + local current = t + for i = 1, #path - 1 do + local key = path[i] + if not current[key] then + current[key] = {} + end + current = current[key] + end + current[path[#path]] = value +end + +return set From 47e98040a04d19be8136d1269b89801c121abb70 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:15:12 +0100 Subject: [PATCH 07/10] reimplement some pathfs types --- pesde.lock | 3 +++ pesde.toml | 1 + src/lib.luau | 9 +++++---- src/pathfsTypes.luau | 23 +++++++++++++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 src/pathfsTypes.luau diff --git a/pesde.lock b/pesde.lock index 0fd20f6..4bd2fbf 100644 --- a/pesde.lock +++ b/pesde.lock @@ -71,6 +71,9 @@ index_url = "https://github.com/pesde-pkg/index" ref_ty = "pesde" index_url = "https://github.com/pesde-pkg/index" +[graph."jiwonz/luau_path@0.2.0 luau"] +direct = ["luau_path", { name = "jiwonz/luau_path", version = "^0.2.0", index = "default", target = "luau" }, "standard"] + [graph."jiwonz/luau_path@0.2.0 luau".dependencies] luau_disk = ["jiwonz/luau_disk@0.2.0 luau", "standard"] diff --git a/pesde.toml b/pesde.toml index 50c0c3e..f93a544 100644 --- a/pesde.toml +++ b/pesde.toml @@ -29,3 +29,4 @@ glob = { name = "jiwonz/glob", version = "^0.2.0" } darklua_lune = { name = "jiwonz/darklua_lune", version = "^0.3.0" } result = { name = "lukadev_0/result", version = "^1.2.1" } chalk_luau = { name = "kimpure/chalk_luau", version = "^0.1.8", target = "luau" } +luau_path = { name = "jiwonz/luau_path", version = "^0.2.0", target = "luau" } diff --git a/src/lib.luau b/src/lib.luau index 9561c3a..5c47bdf 100644 --- a/src/lib.luau +++ b/src/lib.luau @@ -2,11 +2,12 @@ local stdio = require("@lune/stdio") local serde = require("@lune/serde") local pathfs = require("../lune_packages/pathfs") local fs = pathfs.fs -local gt = require("../lune_packages/greentea") +local gt = require("../luau_packages/greentea") local glob = require("../lune_packages/glob") local process = require("@lune/process") local darklua = require("../lune_packages/darklua_lune") local Result = require("../lune_packages/result") +local pathfsTypes = require("./pathfsTypes") local set = require("./tableUtils/set") local copy = require("./tableUtils/copy") @@ -58,7 +59,7 @@ local targetsType = gt.build(gt.table({ local environmentType = gt.build(gt.union(gt.literal("luau"), gt.literal("lune"), gt.literal("roblox"))) local optionalStringType = gt.build(gt.opt(gt.string())) local optionalStringArrayType = gt.build(gt.opt(gt.array(gt.string()))) -local optionalAsPathType = gt.build(gt.opt(pathfs.types.AsPath:type())) +local optionalAsPathType = gt.build(gt.opt(pathfsTypes.AsPathType:type())) local optionalBooleanType = gt.build(gt.opt(gt.boolean())) local requireModeName = gt.union(gt.literal("path"), gt.literal("luau")) @@ -114,8 +115,8 @@ function multitarget.build( message: string, outputDir: pathfs.Directory?, }> - pathfs.types.AsPath:assert(pesdeTomlPath) - pathfs.types.AsPath:assert(outputPath) + pathfsTypes.AsPathType:assert(pesdeTomlPath) + pathfsTypes.AsPathType:assert(outputPath) targetsType:assert(targets) optionalStringArrayType:assert(buildFiles) optionalStringType:assert(luaEnvGlobal) diff --git a/src/pathfsTypes.luau b/src/pathfsTypes.luau new file mode 100644 index 0000000..198758a --- /dev/null +++ b/src/pathfsTypes.luau @@ -0,0 +1,23 @@ +-- This file only exists because pathfs doesn't re-export it's internal types +-- So this is just a stripped down version of https://github.com/jiwonz/lune-pathfs/blob/main/src/types.luau + +local luauPath = require("../luau_packages/luau_path") +local Path = luauPath.Path +local gt = require("../luau_packages/greentea") + +export type Components = typeof(Path.new(""):components()) + +local PathType = gt.build(gt.custom(luauPath.Path.is, "Path") :: luauPath.Path) +local Components = getmetatable(Path.from("a"):components() :: any).__index :: Components & { + new: (path: string, prefix: any?, hasPhysicalRoot: boolean) -> Components, + is: (value: unknown) -> boolean, +} +local ComponentsType = gt.build(gt.custom(Components.is, "Components") :: Components) +local AsPathType = gt.build(gt.union(gt.string(), PathType:type(), ComponentsType:type())) + +return { + PathType = PathType, + Components = Components, + ComponentsType = ComponentsType, + AsPathType = AsPathType, +} From cd0bb47c3b186ddf285252126010e32e87c847a3 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:40:23 +0100 Subject: [PATCH 08/10] upgrade codebase to work with pathfs 0.6.0 --- scripts/example.luau | 2 +- src/lib.luau | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/example.luau b/scripts/example.luau index 8460b64..4e7ac8a 100644 --- a/scripts/example.luau +++ b/scripts/example.luau @@ -9,7 +9,7 @@ lib.build( }, "dist", { - "src", + "src", }, "LUA_ENV", "pkg" diff --git a/src/lib.luau b/src/lib.luau index 5c47bdf..99bafaf 100644 --- a/src/lib.luau +++ b/src/lib.luau @@ -111,9 +111,9 @@ function multitarget.build( luauPkgAlias: typeof(optionalStringType:type()), strict: typeof(optionalBooleanType:type()), requireMode: typeof(optionalRequireModeType:type()) -): Result.Result pathfsTypes.AsPathType:assert(pesdeTomlPath) pathfsTypes.AsPathType:assert(outputPath) @@ -138,7 +138,7 @@ function multitarget.build( -- selene: allow(shadowing) local pkgAlias = pkgAlias or DEFAULT_PKG_ALIAS -- selene: allow(shadowing) - local pesdeTomlFile = pathfs.File.fromExisting(pesdeTomlPath) + local pesdeTomlFile = pathfs.FilePath.fromExisting(pesdeTomlPath) local outputDir = pathfs.findDir(outputPath) if outputDir then return Result.Err({ @@ -146,7 +146,7 @@ function multitarget.build( }) end -- selene: allow(shadowing) - local outputDir = pathfs.Directory.create(outputPath) + local outputDir = pathfs.DirectoryPath.new(outputPath):withDirWritten() local workingDirPath = pathfs.canonicalize(pesdeTomlFile.path):parent() or pathfs.cwd() local pesdeToml: { @@ -239,7 +239,7 @@ function multitarget.build( end environmentType:assert(target) - local targetDir = pathfs.Directory.new(outputDir.path:join(target)) + local targetDir = pathfs.DirectoryPath.new(outputDir.path:join(target)) targetDir:writeDir() -- assure it exists (may not exist later if the user uses "includes" incorrectly, which would throw an undescriptive error later when trying to access this directory) -- selene: allow(shadowing) @@ -287,7 +287,7 @@ function multitarget.build( newPesdeToml.private = nil if #pesdeAddParams > 0 then -- there are dependencies - local luaurcFile = pathfs.File.new(targetDir.path:join(".luaurc")) + local luaurcFile = pathfs.FilePath.new(targetDir.path:join(".luaurc")) local luaurc: { aliases: { [string]: string? }?, } = if luaurcFile:isFile() @@ -370,7 +370,7 @@ function multitarget.build( continue end - local targetDir = pathfs.Directory.new(outputDir.path:join(target)) + local targetDir = pathfs.DirectoryPath.new(outputDir.path:join(target)) local injectGlobalValueRule = { rule = "inject_global_value", identifier = luaEnvGlobal, From 086d0713e1ffbd6da7a41f01d9614782f95bb039 Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Thu, 30 Oct 2025 23:02:04 +0100 Subject: [PATCH 09/10] Revert "Merge branch 'main' into lune-v10" This reverts commit f5c59088ac0ae1554524c4990955921d0162e575, reversing changes made to cd0bb47c3b186ddf285252126010e32e87c847a3. --- README.md | 12 +++++------- pesde.lock | 4 ++-- pesde.toml | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1153fac..d660240 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -Fork of https://github.com/jiwonz/pesde-multitarget containing my fixes & updates that may not merged into the official repository yet. - -# [pesde-multitarget](https://pesde.dev/packages/ewdev/multitarget) +# [pesde-multitarget](https://pesde.dev/packages/jiwonz/multitarget) Customizable and flexible build script for multiple pesde targets Build your pure pesde project easier targeting both `luau` and `roblox` targets at the same time. @@ -13,7 +11,7 @@ Add & Install this pesde package and darklua as a dev_dependency: ```sh pesde add pesde/darklua --dev -t lune # Pass if darklua is installed already. -pesde add ewdev/multitarget --dev -t lune +pesde add jiwonz/multitarget --dev -t lune pesde install ``` @@ -55,7 +53,7 @@ pesde run build ### `pesde x` Execute directly without installation: ```sh -pesde x ewdev/multitarget -- --help +pesde x jiwonz/multitarget -- --help ``` ## Usage @@ -70,7 +68,7 @@ multitarget setup ``` With `pesde x`: ```sh -pesde x ewdev/multitarget -- setup +pesde x jiwonz/multitarget -- setup ``` ### `build` @@ -90,5 +88,5 @@ multitarget build -w -a --build-files src # Build for every(-a --all) targets wi ``` With `pesde x`: ```sh -pesde x ewdev/multitarget -- build ... +pesde x jiwonz/multitarget -- build ... ``` diff --git a/pesde.lock b/pesde.lock index 476b7db..4bd2fbf 100644 --- a/pesde.lock +++ b/pesde.lock @@ -1,8 +1,8 @@ # This file is automatically @generated by pesde. # It is not intended for manual editing. format = 2 -name = "ewdev/multitarget" -version = "0.4.2-rc.3" +name = "jiwonz/multitarget" +version = "0.4.0-rc.30" target = "lune" [graph."caveful_games/argparse@0.1.2 lune"] diff --git a/pesde.toml b/pesde.toml index 55ea137..f93a544 100644 --- a/pesde.toml +++ b/pesde.toml @@ -1,8 +1,8 @@ -name = "ewdev/multitarget" -version = "0.4.2-rc.3" -description = "[Fork] Customizable and flexible build script for multiple pesde targets" -authors = ["jiwonz ", "EwDev (https://ewdev.net/)"] -repository = "https://github.com/ewd3v/pesde-multitarget" +name = "jiwonz/multitarget" +version = "0.4.0-rc.30" +description = "Customizable and flexible build script for multiple pesde targets" +authors = ["jiwonz "] +repository = "https://github.com/jiwonz/pesde-multitarget" license = "MIT" includes = ["src/**", "LICENSE", "README.md", "pesde.toml"] From 37f6df6f1fdc6882a48e4561a2b766736e12a88d Mon Sep 17 00:00:00 2001 From: ewd3v <74792428+ewd3v@users.noreply.github.com> Date: Mon, 3 Nov 2025 18:39:25 +0100 Subject: [PATCH 10/10] fix binary to work with newer pathfs --- src/bin.luau | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin.luau b/src/bin.luau index 319186f..26beca9 100644 --- a/src/bin.luau +++ b/src/bin.luau @@ -126,7 +126,7 @@ end local setup = cli:command("setup", "Setup your project before building") setup:action(function() do - local pesdeToml = pathfs.File.new("pesde.toml") + local pesdeToml = pathfs.FilePath.new("pesde.toml") if not pesdeToml:isFile() then stdio.ewrite(`{ERROR_PREFIX} pesde.toml is not found. Are you in the right directory?\n`) process.exit(1) @@ -146,7 +146,7 @@ setup:action(function() `{WARN_PREFIX} It is recommended to set 'private = true' in pesde.toml to prevent accidental publishing the root project.` ) end - local luaurcFile = pathfs.File.new(".luaurc") + local luaurcFile = pathfs.FilePath.new(".luaurc") local luaurc: { aliases: { [string]: string? }?, } = if luaurcFile:isFile() @@ -243,7 +243,7 @@ setup:action(function() end end do - local declarationFile = pathfs.File.new(".d.luau") + local declarationFile = pathfs.FilePath.new(".d.luau") if not declarationFile:isFile() then if stdio.prompt( @@ -256,8 +256,8 @@ setup:action(function() end end do - local vscodeDir = pathfs.Directory.new(".vscode") - local vscodeSettings = pathfs.File.new(vscodeDir.path:join("settings.json")) + local vscodeDir = pathfs.DirectoryPath.new(".vscode") + local vscodeSettings = pathfs.FilePath.new(vscodeDir.path:join("settings.json")) local settings: { ["luau-lsp.types.definitionFiles"]: { string }?, } = if vscodeSettings:isFile() @@ -293,7 +293,7 @@ end) local version = cli:command("version", "Show the version of multitarget") version:action(function() - local multitargetPesdeToml = pathfs.File.fromExisting(pathfs.Path.from(_G.PESDE_ROOT):join("pesde.toml")) + local multitargetPesdeToml = pathfs.FilePath.fromExisting(pathfs.Path.from(_G.PESDE_ROOT):join("pesde.toml")) local pesdeManifest: { version: string, } = serde.decode("toml", multitargetPesdeToml:readFile())