-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject build information when compiling (#287)
# Problem It can be useful to know the version, channel, and commit hash for a given build of Flipbook, especially to help when debugging. We only include the version right now, the other two would be useful # Solution Created a new BuildInfo component which gets mounted on AboutView. It leverages some new globals that get injected during the darklua build step. I've also removed the inclusion of `wally.toml` in the Flipbook plugin build since the only info we were using was the version, and that's now supplied via `_G.BUILD_VERSION` # Checklist - [x] Ran `lune run test` locally before merging
- Loading branch information
Showing
8 changed files
with
85 additions
and
20 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
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 |
---|---|---|
|
@@ -7,9 +7,6 @@ | |
"Example": { | ||
"$path": "example" | ||
}, | ||
"wally.toml": { | ||
"$path": "wally.toml" | ||
}, | ||
"$path": "src" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,9 +4,6 @@ | |
"Packages": { | ||
"$path": "Packages" | ||
}, | ||
"wally.toml": { | ||
"$path": "wally.toml" | ||
}, | ||
"$path": "build" | ||
} | ||
} |
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,45 @@ | ||
local React = require("@pkg/React") | ||
|
||
local nextLayoutOrder = require("@root/Common/nextLayoutOrder") | ||
local useTheme = require("@root/Common/useTheme") | ||
|
||
local BUILD_INFO = { | ||
{ label = "Version", value = _G.BUILD_VERSION }, | ||
{ label = "Channel", value = _G.BUILD_CHANNEL }, | ||
{ label = "Hash", value = _G.BUILD_HASH }, | ||
} | ||
|
||
export type Props = { | ||
layoutOrder: number?, | ||
} | ||
|
||
local function BuildInfo(props: Props) | ||
local theme = useTheme() | ||
|
||
local children: { [string]: React.Node } = {} | ||
for _, info in BUILD_INFO do | ||
children[info.label] = React.createElement("TextLabel", { | ||
LayoutOrder = nextLayoutOrder(), | ||
AutomaticSize = Enum.AutomaticSize.XY, | ||
BackgroundTransparency = 1, | ||
Font = theme.font, | ||
Text = `{info.label}: {info.value}`, | ||
TextColor3 = theme.textSubtitle, | ||
TextSize = theme.textSize, | ||
}) | ||
end | ||
|
||
return React.createElement("Frame", { | ||
LayoutOrder = props.layoutOrder, | ||
AutomaticSize = Enum.AutomaticSize.XY, | ||
BackgroundTransparency = 1, | ||
}, { | ||
Layout = React.createElement("UIListLayout", { | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
HorizontalAlignment = Enum.HorizontalAlignment.Center, | ||
Padding = theme.paddingSmall, | ||
}), | ||
}, children) | ||
end | ||
|
||
return BuildInfo |
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