-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2929f50
commit db853f9
Showing
60 changed files
with
286 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"generator": "retain_lines", | ||
"rules": [ | ||
{ | ||
"current": { | ||
"name": "path", | ||
"sources": { | ||
"lib": "lib" | ||
} | ||
}, | ||
"rule": "convert_require", | ||
"target": { | ||
"indexing_style": "property", | ||
"name": "roblox", | ||
"rojo_sourcemap": "./sourcemap.json" | ||
} | ||
}, | ||
{ | ||
"identifier": "__DEV__", | ||
"rule": "inject_global_value", | ||
"value": false | ||
}, | ||
"compute_expression", | ||
"remove_unused_if_branch", | ||
"remove_unused_while", | ||
"filter_after_early_return", | ||
"remove_nil_declaration", | ||
"remove_empty_do", | ||
"remove_spaces" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"generator": { | ||
"column_span": 9999999999, | ||
"name": "dense" | ||
}, | ||
"rules": [ | ||
{ | ||
"current": { | ||
"name": "path", | ||
"sources": { | ||
"lib": "lib" | ||
} | ||
}, | ||
"rule": "convert_require", | ||
"target": { | ||
"indexing_style": "property", | ||
"name": "roblox", | ||
"rojo_sourcemap": "./sourcemap.json" | ||
} | ||
}, | ||
{ | ||
"identifier": "__DEV__", | ||
"rule": "inject_global_value", | ||
"value": false | ||
}, | ||
"compute_expression", | ||
"remove_unused_if_branch", | ||
"remove_unused_while", | ||
"filter_after_early_return", | ||
"remove_nil_declaration", | ||
"remove_empty_do", | ||
"remove_spaces" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
local fs = require("@lune/fs") | ||
local path = require("../utils/path") | ||
local pesdeTemplate = require("./templates/pesde") | ||
local process = require("@lune/process") | ||
local rojoProject = require("./templates/rojo") | ||
local serde = require("@lune/serde") | ||
local summon = require("../utils/summon") | ||
local wallyTemplate = require("./templates/wally") | ||
|
||
local PATH_LIB = path(process.cwd, "lib") | ||
local PATH_DIST = path(process.cwd, "dist") | ||
local DARKLUA_DEV = path(process.cwd, ".darklua-dev.json") | ||
local DARKLUA_STD = path(process.cwd, ".darklua.json") | ||
local ROJO_PROJECT = path(process.cwd, "default.project.json") | ||
local ROJO_SOURCEMAP = path(process.cwd, "sourcemap.json") | ||
|
||
local Builder = {} | ||
|
||
local function reset(dir: string) | ||
if not fs.isDir(dir) then | ||
fs.writeDir(dir) | ||
else | ||
for _, file in fs.readDir(dir) do | ||
if fs.isFile(path(dir, file)) then | ||
fs.removeFile(path(dir, file)) | ||
end | ||
end | ||
end | ||
end | ||
|
||
function Builder.build(props: { | ||
createModel: boolean, | ||
createRelease: boolean, | ||
version: string, | ||
}) | ||
-- stylua: ignore | ||
local createModel, createRelease, version = props.createModel, props.createRelease, props.version | ||
assert( | ||
version:match("^(%d+)%.?(%d*)%.?(%d*)(.-)$") ~= nil, | ||
`{version} is not a valid semver version` | ||
) | ||
|
||
reset(PATH_DIST) | ||
|
||
print("Generating sourcemap") | ||
summon("rojo", "sourcemap", ROJO_PROJECT, "-o", ROJO_SOURCEMAP) | ||
|
||
-- FIXME: Darklua is stinky & cant give good types on bundle | ||
print("Processing library files") | ||
local darkluaConfig = createRelease and DARKLUA_STD or DARKLUA_DEV | ||
summon("darklua", "process", PATH_LIB, path(PATH_DIST, "lib"), "-c", darkluaConfig, "-v") | ||
|
||
fs.copy(path(process.cwd, "README.md"), path(PATH_DIST, "README.md")) | ||
|
||
print("Writing Rojo project") | ||
fs.writeFile(path(PATH_DIST, "default.project.json"), serde.encode("json", rojoProject)) | ||
|
||
if createRelease then | ||
print("Writing Wally config") | ||
local wally = table.clone(wallyTemplate) | ||
wally.package.version = version | ||
fs.writeFile(path(PATH_DIST, "wally.toml"), serde.encode("toml", wally)) | ||
|
||
print("Writing Pesde config") | ||
local pesde = table.clone(pesdeTemplate) | ||
pesde.version = version | ||
fs.writeFile(path(PATH_DIST, "pesde.yaml"), serde.encode("yaml", pesde)) | ||
|
||
print("Publishing") | ||
summon("wally", "publish", "-v", "--project-path", PATH_DIST) | ||
process.spawn("pesde", { "publish" }, { | ||
shell = true, | ||
cwd = PATH_DIST, | ||
}) | ||
end | ||
|
||
if createModel then | ||
print("Creating Roblox model") | ||
summon( | ||
"rojo", | ||
"build", | ||
path(PATH_DIST, "default.project.json"), | ||
"-o", | ||
path(PATH_DIST, "pretty-fusion-utils.rbxm") | ||
) | ||
end | ||
end | ||
|
||
return Builder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--!strict | ||
-- (c) Prvd 'M Wrong, dual-licensed under MIT or Apache 2.0 terms. | ||
|
||
local Builder = require("./builder") | ||
local stdio = require("@lune/stdio") | ||
|
||
local createModel = stdio.prompt("confirm", "Create .rbxm models?") | ||
local createRelease = stdio.prompt("confirm", "Release to Wally/Pesde?") | ||
local version = "0.0.0-dev" | ||
if createRelease then | ||
local promptedVersion = stdio.prompt("text", "Semver version to publish as?") | ||
assert( | ||
promptedVersion:match("^(%d+)%.?(%d*)%.?(%d*)(.-)$") ~= nil, | ||
`{version} is not a valid semver version` | ||
) | ||
version = promptedVersion | ||
end | ||
|
||
Builder.build { | ||
createModel = createModel, | ||
createRelease = createRelease, | ||
version = version, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
return { | ||
name = "znotfireman/pretty_fusion_utils", | ||
description = "An opinionated collection of modern Fusion 0.3 utilities.", | ||
version = (nil :: any) :: string, | ||
license = "MIT", | ||
authors = { "znotfireman <znotfireman+hello@gmail.com>" }, | ||
realm = "shared", | ||
repository = "https://github.com/znotfireman/pretty-fusion-utils", | ||
indices = { | ||
default = "https://github.com/daimond113/pesde-index", | ||
}, | ||
exports = { | ||
lib = "./lib/init.luau", | ||
}, | ||
dependencies = {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
return { | ||
name = "pretty-fusion-utils", | ||
tree = { | ||
["$path"] = "lib", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
return { | ||
package = { | ||
name = "znotfireman/pretty-fusion-utils", | ||
description = "An opinionated collection of modern Fusion 0.3 utilities.", | ||
version = (nil :: any) :: string, | ||
license = "Apache-2.0 OR MIT", | ||
authors = { "znotfireman <znotfireman+hello@gmail.com>" }, | ||
realm = "shared", | ||
repository = "https://github.com/znotfireman/pretty-fusion-utils", | ||
registry = "https://github.com/UpliftGames/wally-index", | ||
include = { "./lib", "./default.project.json" }, | ||
exclude = { "node_modules" }, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pretty-fusion-utils", | ||
"tree": { | ||
"$path": "src" | ||
"$path": "lib" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- This file was @generated and is not intended for manual editing. | ||
-- Run `lune run regen` to generate a fresh init file. | ||
|
||
return table.freeze { | ||
useAsync = require("lib/use-async"), | ||
useCamera = require("lib/use-camera"), | ||
useCoroutine = require("lib/use-coroutine"), | ||
useEffect = require("lib/use-effect"), | ||
useEventListener = require("lib/use-event-listener"), | ||
useInterval = require("lib/use-interval"), | ||
useMouse = require("lib/use-mouse"), | ||
usePrevious = require("lib/use-previous"), | ||
usePx = require("lib/use-px"), | ||
useTagged = require("lib/use-tagged"), | ||
useTasks = require("lib/use-tasks"), | ||
useThread = require("lib/use-thread"), | ||
useTimer = require("lib/use-timer"), | ||
useViewport = require("lib/use-viewport"), | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
local Types = require("src/types") | ||
local Types = require("lib/types") | ||
|
||
local function doNothing() end | ||
|
||
|
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/use-event-listener/init.luau → lib/use-event-listener/init.luau
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
local Types = require("src/types") | ||
local Types = require("lib/types") | ||
|
||
type EventLike = | ||
RBXScriptConnection | ||
|
File renamed without changes.
File renamed without changes.
Oops, something went wrong.