Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
* Fix to comply with latest require-by-string RFC
* Add author_fix to correct usernames
  • Loading branch information
gaymeowing committed Feb 5, 2025
1 parent d3e9141 commit bc53fe0
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 16 deletions.
8 changes: 4 additions & 4 deletions scripts/depgraph.luau
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
-- dep graph
-- module for generating a dependency graph for all libraries

local remove_from_end = require("remove_from_end")
local require_pattern = require("require_pattern")
local iter_scripts = require("iter_scripts")
local remove_from_end = require("./remove_from_end")
local require_pattern = require("./require_pattern")
local iter_scripts = require("./iter_scripts")
local process = require("@lune/process")
local remove = require("remove")
local remove = require("./remove")
local fs = require("@lune/fs")

export type DependencyInfo = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/iter_scripts.luau
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
-- recursively iterates over every luau file in a directory
-- and calls a callback that can then optionally overwrite the file

local ends_with = require("./ends_with")
local iter_dir = require("./iter_dir")
local ends_with = require("ends_with")

local function iter_scripts(dir: string, f: (path: string, src: string) -> string?)
iter_dir(dir, function(info)
Expand Down
14 changes: 14 additions & 0 deletions scripts/release/author_fix.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--!native

-- author fix
-- changes author names to the authors new username

local function author_fix(author: string): string
if author == "Kalrnlo" then
return "gaymeowing"
else
return author
end
end

return author_fix
7 changes: 6 additions & 1 deletion scripts/release/gitlog.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
-- gitlog
-- gets the gitlog after a unixtimestamp for a library

local first_release_time = require("first_release_time")
local first_release_time = require("./first_release_time")
local author_fix = require("./author_fix")
local summon = require("../summon")

export type Commit = {
Expand Down Expand Up @@ -54,6 +55,10 @@ local function gitlog(lib: string, time: number?): { Commit }
local commits = {}

for hash, author, date, title in GMATCH(log, GIT_LOG_PATTERN) do
if author == "Kalrnlo" then
author = "gaymeowing"
end

table.insert(commits, table.freeze({
date = parse_git_date(date),
author = author,
Expand Down
8 changes: 4 additions & 4 deletions scripts/release/packager.luau
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ local remove_from_end = require("../remove_from_end")
local iter_scripts = require("../iter_scripts")
local depgraph = require("../depgraph")
local roblox = require("@lune/roblox")
local modulify = require("modulify")
local license = require("license")
local libinfo = require("libinfo")
local modulify = require("./modulify")
local license = require("./license")
local libinfo = require("./libinfo")
local fs = require("@lune/fs")
local zip = require("zip")
local zip = require("./zip")

export type PackagedLibInfo = {
base_file_name_with_deps: nil,
Expand Down
3 changes: 2 additions & 1 deletion scripts/release/pull_requests.luau
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- util for getting pull requests after a unix timestamp

local first_release_time = require("first_release_time")
local author_fix = require("./author_fix")
local datetime = require("@lune/datetime")
local serde = require("@lune/serde")
local summon = require("../summon")
Expand Down Expand Up @@ -66,7 +67,7 @@ do
if prs then
table.insert(prs, {
merged_at = datetime.fromIsoDate(pr.mergedAt).unixTimestamp,
author = pr.author.login,
author = author_fix(pr.author.login),
title = pr.title,
num = pr.number,
})
Expand Down
2 changes: 1 addition & 1 deletion scripts/remove_from_end.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- remove from end
-- utility func for removing a string from the end of another string

local ends_with = require("ends_with")
local ends_with = require("./ends_with")

local SUB = string.sub

Expand Down
8 changes: 4 additions & 4 deletions scripts/test_runner.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
-- test runner
-- script for running tests for ci

local diff_reader = require("diff_reader")
local mock_roblox = require("mock/roblox")
local diff_reader = require("./diff_reader")
local mock_roblox = require("./mock/roblox")
local process = require("@lune/process")
local roblox = require("@lune/roblox")
local depgraph = require("depgraph")
local depgraph = require("./depgraph")
local task = require("@lune/task")
local fs = require("@lune/fs")
local ansi = require("ansi")
local ansi = require("./ansi")

local function get_libs_to_test(): { string }
local args = table.clone(process.args)
Expand Down

0 comments on commit bc53fe0

Please sign in to comment.