@@ -10,6 +10,17 @@ local IS_CI = process.env.CI == "true"
10
10
11
11
local WALLY_SCOPE = "lukadev-0"
12
12
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
+
13
24
type Context = {
14
25
rootDir : string ,
15
26
pkgDir : string ,
@@ -252,9 +263,9 @@ local function buildPackage(ctx: Context, progress: ProgressReporter, package: P
252
263
name = `{WALLY_SCOPE }/{package .config .name }` ,
253
264
version = package .config .version ,
254
265
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 ,
258
269
registry = "https://github.com/UpliftGames/wally-index" ,
259
270
},
260
271
dependencies = {},
@@ -275,6 +286,54 @@ local function buildPackage(ctx: Context, progress: ProgressReporter, package: P
275
286
fs .writeFile (`{outDir }/wally.toml` , serde .encode ("toml" , wallyToml , true ))
276
287
end
277
288
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
+
278
337
progress .report ("copying LICENSE" )
279
338
fs .copy (`{ctx .rootDir }/LICENSE` , `{outDir }/LICENSE` )
280
339
0 commit comments