Skip to content

Commit

Permalink
Studio plugin companion
Browse files Browse the repository at this point in the history
  • Loading branch information
1Axen committed Feb 24, 2024
1 parent 8c87687 commit 8f7b600
Show file tree
Hide file tree
Showing 33 changed files with 3,954 additions and 78 deletions.
1 change: 1 addition & 0 deletions aftman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
selene = "Kampfkarren/selene@0.26.1"
lune = "filiptibell/lune@0.8.0"
darklua = "seaofvoices/darklua@0.12.1"
rojo = "rojo-rbx/rojo@7.4.1"
Binary file added assets/plugin/Duplicate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Generate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/GenerateSelected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Invalid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Locate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Navigation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin/Save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions build/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SET ZIP="C:\Program Files\7-Zip\7z.exe"
SET VERSION="0.6.2"

echo Clearing release folder
del /s /q "../release"
rmdir /s/q "../Blink"
mkdir "../Blink"

Expand All @@ -23,6 +24,14 @@ echo Zipping files
%ZIP% a "../release/bytecode.zip" "Bytecode.txt" > nul
%ZIP% a "../release/bytecode.zip" "init.luau" > nul

echo Packaging plugin
cd ../plugin
copy "..\build\.darklua.json" ".\.darklua.json"
darklua process "./src/init.luau" "./bundle/init.server.lua"
rojo build --output "../release/Plugin-%VERSION%.rbxmx"

cd ../build

del "./*.exe"
del "./Bytecode.txt"
rmdir /s/q "../Blink"
Expand Down
1 change: 1 addition & 0 deletions docs/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[Installation](https://github.com/1Axen/Blink/blob/main/docs/Installation.md)
[Getting Started](https://github.com/1Axen/Blink/blob/main/docs/Getting-Started.md)
[Writing network descriptions](https://github.com/1Axen/Blink/blob/main/docs/Using.md)
[Studio Plugin](https://github.com/1Axen/Blink/blob/main/docs/Plugin.md)
# Getting Started
## Write your first network description
If you're looking for an example you can check out the [source file](https://github.com/1Axen/Blink/blob/main/test/Source.txt) used for testing.
Expand Down
7 changes: 6 additions & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[Installation](https://github.com/1Axen/Blink/blob/main/docs/Installation.md)
[Getting Started](https://github.com/1Axen/Blink/blob/main/docs/Getting-Started.md)
[Using Blink](https://github.com/1Axen/Blink/blob/main/docs/Using.md)
[Studio Plugin](https://github.com/1Axen/Blink/blob/main/docs/Plugin.md)
# Installation
## From Aftman
> [!NOTE]
Expand All @@ -14,7 +15,11 @@ aftman add 1Axen/Blink
Download the standalone executable from [Github Releases](https://github.com/1Axen/Blink/releases).
## From Bytecode
Alternative you can run blink from bytecode using line.
You can download the packaged bytecode from [Github Releases](https://github.com/1Axen/Blink/releases).
You can download the packaged bytecode from [Github Releases](https://github.com/1Axen/Blink/releases).
## Studio Plugin
Blink offers a companion studio plugin which allows you to write and generate files within Studio without the need for external tooling.
You can download the latest plugin from [Github Releases](https://github.com/1Axen/Blink/releases).
For more information on how to use it head over to [Studio Plugin](https://github.com/1Axen/Blink/blob/main/docs/Plugin.md).
### Installing lune
Blink uses lune as it's runtime enviornment, you can install lune using aftman:
```
Expand Down
59 changes: 59 additions & 0 deletions docs/Plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Navigation
[Home](https://github.com/1Axen/Blink/blob/main/README.md)
[Installation](https://github.com/1Axen/Blink/blob/main/docs/Installation.md)
[Getting Started](https://github.com/1Axen/Blink/blob/main/docs/Getting-Started.md)
[Using Blink](https://github.com/1Axen/Blink/blob/main/docs/Using.md)
[Studio Plugin](https://github.com/1Axen/Blink/blob/main/docs/Plugin.md)
# Navigating
After installing the plugin locate it within your plugin tab in Studio.
> [!NOTE]
> After opening the plugin you will be prompted to give it access to inject scripts, the plugin needs this in order to generate the output files.
<img src="../assets/plugin/Locate.png">

## Menu
> [!TIP]
> You can open the side menu using the sandwich button on the left hand side.
<img src="../assets/plugin/Menu.png">
Within the menu you can manage your network description files.
<img src="../assets/plugin/Navigation.png">

## Saving
To save a network description simply press the save button at the bottom of the side menu.
This will prompt you to save whatever is currently in the editor.
> [!TIP]
> You can save to already existing files by simply inputting their name
<img src="../assets/plugin/Save.png">

## Generating
To generate your networking modules simply press the "Generate" button on your desired file.
This will open a prompt asking you to select your desired output destination within the game explorer.

<img src="../assets/plugin/Generate.png">

Once you've selected your desired output destination simply press "Generate" and your files will be ready.

<img src="../assets/plugin/GenerateSelected.png">

If no issues arise Blink will generate the following Folder containing your networking modules:

<img src="../assets/plugin/Output.png">

## Editor
> [!NOTE]
> The editor does not currently offer auto completion or error checking.
> This is planned to be fixed within the next release.
<img src="../assets/plugin/Editor.png">


> [!TIP]
> Although it lacks proper error checking while writing it can still detect certain bad syntax, highlighting it in red.
> <img src="../assets/plugin/Invalid.png">
## Errors
Upon generating output files, Blink will parse the source contents and inform you of any errors within your files that are blocking generation.

> <img src="../assets/plugin/Error.png">
1 change: 1 addition & 0 deletions docs/Using.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[Installation](https://github.com/1Axen/Blink/blob/main/docs/Installation.md)
[Getting Started](https://github.com/1Axen/Blink/blob/main/docs/Getting-Started.md)
[Using Blink](https://github.com/1Axen/Blink/blob/main/docs/Using.md)
[Studio Plugin](https://github.com/1Axen/Blink/blob/main/docs/Plugin.md)
# Options
Options go at the top of a source file and are used to configure the output of Blink.
```
Expand Down
32 changes: 32 additions & 0 deletions plugin/.darklua.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"bundle": {
"excludes": [
"@lune/**"
],
"modules_identifier": "__DARKLUA_BUNDLE_MODULES",
"require_mode": {
"name": "path",
"sources": {
"Base": "../src/Templates/Base.txt",
"Client": "../src/Templates/Client.txt",
"Server": "../src/Templates/Server.txt"
}
}
},
"generator": "readable",
"rules": [
"remove_types",
"compute_expression",
"remove_unused_if_branch",
{
"identifier": "BUNDLED",
"rule": "inject_global_value",
"value": true
},
{
"identifier": "VERSION",
"rule": "inject_global_value",
"value": "0.6.2"
}
]
}
5 changes: 5 additions & 0 deletions plugin/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo Off

copy "..\build\.darklua.json" ".\.darklua.json"
darklua process "./src/init.luau" "./bundle/init.server.lua"
rojo build --output "%LocalAppData%\Roblox\Plugins\Blink.rbxmx"
Binary file added plugin/bundle/Error.rbxm
Binary file not shown.
Binary file added plugin/bundle/Widget.rbxm
Binary file not shown.
Loading

0 comments on commit 8f7b600

Please sign in to comment.