Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .darklua-bundle-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"bundle": {
"require_mode": {
"name": "path",
"sources": {
"@pkg": "node_modules/.luau-aliases"
}
}
},
"generator": "dense",
"process": [
{
"rule": "inject_global_value",
"identifier": "__DEV__",
"value": true
},
"remove_types",
"remove_comments",
"remove_spaces",
"compute_expression",
"remove_unused_if_branch",
"remove_unused_while",
"filter_after_early_return",
"remove_nil_declaration",
"remove_empty_do"
]
}
27 changes: 27 additions & 0 deletions .darklua-bundle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"bundle": {
"require_mode": {
"name": "path",
"sources": {
"@pkg": "node_modules/.luau-aliases"
}
}
},
"generator": "dense",
"process": [
{
"rule": "inject_global_value",
"identifier": "__DEV__",
"value": false
},
"remove_types",
"remove_comments",
"remove_spaces",
"compute_expression",
"remove_unused_if_branch",
"remove_unused_while",
"filter_after_early_return",
"remove_nil_declaration",
"remove_empty_do"
]
}
29 changes: 29 additions & 0 deletions .darklua-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"process": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "node_modules/.luau-aliases"
}
},
"target": {
"name": "roblox",
"indexing_style": "wait_for_child",
"rojo_sourcemap": "sourcemap.json"
}
},
{
"rule": "inject_global_value",
"identifier": "__DEV__",
"value": true
},
"compute_expression",
"remove_unused_if_branch",
"remove_unused_while",
"filter_after_early_return",
"remove_nil_declaration",
"remove_empty_do"
]
}
24 changes: 24 additions & 0 deletions .darklua-wally.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"process": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "."
}
},
"target": {
"name": "roblox",
"indexing_style": "wait_for_child",
"rojo_sourcemap": "./sourcemap.json"
}
},
"compute_expression",
"remove_unused_if_branch",
"remove_unused_while",
"filter_after_early_return",
"remove_nil_declaration",
"remove_empty_do"
]
}
29 changes: 29 additions & 0 deletions .darklua.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"process": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "node_modules/.luau-aliases"
}
},
"target": {
"name": "roblox",
"indexing_style": "wait_for_child",
"rojo_sourcemap": "sourcemap.json"
}
},
{
"rule": "inject_global_value",
"identifier": "__DEV__",
"value": false
},
"compute_expression",
"remove_unused_if_branch",
"remove_unused_while",
"filter_after_early_return",
"remove_nil_declaration",
"remove_empty_do"
]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ Packages/*
debug.log
.idea
.vscode/launch.json

**/sourcemap.json
**/node_modules
/build
/roblox
.yarn
41 changes: 41 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/.*
/bin
/Packages
**/.robloxrc
rotriever.toml

/.github/
/.vscode/

/roblox
/build

/*.json
/*.toml
/*.yml
/*.md
/*.js
/*.tgz

/scripts
/globalTypes.d.lua
**/sourcemap.json
**/*.project.json

/test

**/__tests__
**/__tests__
**/__testUtils__
**/__fixtures__
**/TestMatchers
**/*.test.lua
**/*.spec.lua
**/jest.config.lua

**/*.rbxl
**/*.rbxlx
**/*.rbxl.lock
**/*.rbxlx.lock
**/*.rbxm
**/*.rbxmx
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion default.project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "GraphQL",
"name": "graphql",
"tree": {
"$path": "src"
}
Expand Down
10 changes: 5 additions & 5 deletions foreman.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tools]
rotrieve = { source = "roblox/rotriever", version = "0.5.4" }
selene = { source = "Roblox/Kampfkarren-selene", version = "0.19.1" }
stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "0.13.1" }
testez = { source = "roblox/testez", version = "0.3.2" }
rbx-aged-cli = { source = "roblox/rbx-aged-tool", version = "5.x.x" }
selene = { github = "Kampfkarren/selene", version = "=0.19.1" }
stylua = { github = "JohnnyMorganz/StyLua", version = "=0.13.1" }
luau-lsp = { github = "johnnymorganz/luau-lsp", version = "=1.23.0"}
darklua = { github = "seaofvoices/darklua", version = "=0.12.1" }
wally = { github = "UpliftGames/wally", version = "=0.3.2" }
9 changes: 9 additions & 0 deletions model.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "GraphQL",
"tree": {
"$path": "src",
"node_modules": {
"$path": "node_modules"
}
}
}
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@jsdotlua/graphql",
"version": "15.6.1",
"repository": {
"type": "git",
"url": "https://github.com/jsdotlua/graphql-lua.git"
},
"license": "MIT",
"main": "src/init.lua",
"scripts": {
"prepare": "npmluau",
"build-assets": "sh ./scripts/build-assets.sh",
"lint": "selene src",
"format": "stylua src",
"style-check": "stylua --check src",
"clean": "rm -rf roblox build node_modules"
},
"dependencies": {
"@jsdotlua/luau-polyfill": "^1.2.6",
"@jsdotlua/promise": "^3.5.0",
"luau-regexp": "^0.2.1"
},
"devDependencies": {
"npmluau": "^0.1.1"
}
}
7 changes: 7 additions & 0 deletions scripts/build-assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

set -e

./scripts/build-roblox-model.sh
./scripts/build-single-file.sh
./scripts/build-wally-package.sh
36 changes: 36 additions & 0 deletions scripts/build-roblox-model.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

set -e

build_with_darklua_config () {
DARKLUA_CONFIG=$1
OUTPUT=build/$2

rm -rf roblox

mkdir -p roblox

cp -r src/ roblox/
./scripts/remove-tests.sh roblox

rojo sourcemap model.project.json -o sourcemap.json

darklua process --config $DARKLUA_CONFIG node_modules roblox/node_modules

cp $DARKLUA_CONFIG roblox/
cp sourcemap.json roblox/

darklua process --config roblox/$DARKLUA_CONFIG roblox/src roblox/src

./scripts/remove-tests.sh roblox

cp model.project.json roblox/

mkdir -p build
mkdir -p $(dirname $OUTPUT)

rojo build roblox/model.project.json -o $OUTPUT
}

build_with_darklua_config .darklua.json graphql.rbxm
build_with_darklua_config .darklua-dev.json debug/graphql.rbxm
12 changes: 12 additions & 0 deletions scripts/build-single-file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -e

mkdir -p build
mkdir -p build/debug

rm -f build/graphql.lua
rm -f build/debug/graphql.lua

darklua process --config .darklua-bundle.json src/init.lua build/graphql.lua
darklua process --config .darklua-bundle-dev.json src/init.lua build/debug/graphql.lua
31 changes: 31 additions & 0 deletions scripts/build-wally-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

set -e

rm -rf roblox

mkdir -p roblox

cp -r src roblox/src

./scripts/remove-tests.sh roblox

wally_package=build/wally
rm -rf $wally_package

echo Process package

mkdir -p $wally_package
cp LICENSE $wally_package/LICENSE

node ./scripts/npm-to-wally.js package.json $wally_package/wally.toml roblox/wally-package.project.json

cp .darklua-wally.json roblox
cp -r node_modules/.luau-aliases/* roblox

rojo sourcemap roblox/wally-package.project.json --output roblox/sourcemap.json

darklua process --config roblox/.darklua-wally.json roblox/src $wally_package/src

cp default.project.json $wally_package
wally package --project-path $wally_package --list
Loading