Skip to content

Commit 3a2fba6

Browse files
committed
feat: pesde support
1 parent 5cb0ebf commit 3a2fba6

File tree

2 files changed

+63
-3
lines changed

2 files changed

+63
-3
lines changed

.lune/build.luau

+62-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ local IS_CI = process.env.CI == "true"
1010

1111
local WALLY_SCOPE = "lukadev-0"
1212

13+
local function pesdeify(str)
14+
return str:gsub("-", "_")
15+
end
16+
17+
local packageMetadata = {
18+
license = "MIT",
19+
authors = { "LukaDev <[email protected]> (https://lukadev.me/)" },
20+
realm = "shared",
21+
repository = "https://github.com/lukadev-0/util.luau",
22+
}
23+
1324
type Context = {
1425
rootDir: string,
1526
pkgDir: string,
@@ -252,9 +263,9 @@ local function buildPackage(ctx: Context, progress: ProgressReporter, package: P
252263
name = `{WALLY_SCOPE}/{package.config.name}`,
253264
version = package.config.version,
254265
description = package.config.description,
255-
license = "MIT",
256-
authors = { "LukaDev" },
257-
realm = "shared",
266+
license = packageMetadata.license,
267+
authors = packageMetadata.authors,
268+
realm = packageMetadata.realm,
258269
registry = "https://github.com/UpliftGames/wally-index",
259270
},
260271
dependencies = {},
@@ -275,6 +286,54 @@ local function buildPackage(ctx: Context, progress: ProgressReporter, package: P
275286
fs.writeFile(`{outDir}/wally.toml`, serde.encode("toml", wallyToml, true))
276287
end
277288

289+
progress.report("creating pesde.yaml")
290+
do
291+
local pesdeYaml = {
292+
name = pesdeify(`{WALLY_SCOPE}/{package.config.name}`),
293+
version = package.config.version,
294+
description = package.config.description,
295+
license = packageMetadata.license,
296+
authors = packageMetadata.authors,
297+
realm = packageMetadata.realm,
298+
repository = packageMetadata.repository,
299+
indices = {
300+
default = "https://github.com/daimond113/pesde-index",
301+
},
302+
exports = {
303+
lib = "./init.luau",
304+
},
305+
dependencies = {},
306+
}
307+
308+
if package.config.dependencies then
309+
for _, dependencyName in package.config.dependencies do
310+
local dependency = ctx.packages[dependencyName]
311+
if dependency == nil then
312+
progress.fail(`dependency {dependencyName} not found`)
313+
process.exit(1)
314+
end
315+
316+
pesdeYaml.dependencies[dependencyName] = {
317+
name = pesdeify(`{WALLY_SCOPE}/{dependencyName}`),
318+
version = dependency.config.version,
319+
}
320+
end
321+
end
322+
323+
fs.writeFile(`{outDir}/pesde.yaml`, serde.encode("yaml", pesdeYaml, true))
324+
end
325+
326+
progress.report("creating README.md")
327+
do
328+
local s = ""
329+
s ..= `# {package.config.name}\n\n`
330+
s ..= `{package.config.description}\n\n`
331+
s ..= `Learn more in the [documentation](https://lukadev-0.github.io/util.luau/reference/{package.config.name}).\n`
332+
s ..= `This package is part of [util.luau](https://lukadev-0.github.io/util.luau).\n`
333+
334+
fs.writeFile(`{outDir}/README.md`, s)
335+
end
336+
278337
progress.report("copying LICENSE")
279338
fs.copy(`{ctx.rootDir}/LICENSE`, `{outDir}/LICENSE`)
280339

aftman.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ wally = "UpliftGames/[email protected]"
55
selene = "Kampfkarren/[email protected]"
66
stylua = "JohnnyMorganz/[email protected]"
77
darklua = "seaofvoices/[email protected]"
8+
pesde = "daimond113/[email protected]"

0 commit comments

Comments
 (0)