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
2 changes: 1 addition & 1 deletion .darklua.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"process": [
"rules": [
{
"rule": "inject_global_value",
"identifier": "__DEV__",
Expand Down
2 changes: 1 addition & 1 deletion .styluaignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.snap.lua
*.snap.luau
4 changes: 2 additions & 2 deletions foreman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ rojo = { source = "rojo-rbx/rojo", version = "7.3.0" }
selene = { source = "Kampfkarren/selene", version = "0.26.1" }
stylua = { source = "JohnnyMorganz/StyLua", version = "=0.15.1" }
wally = { github = "UpliftGames/wally", version = "=0.3.2" }
luau-lsp = { github = "johnnymorganz/luau-lsp", version = "=1.23.0" }
darklua = { github = "seaofvoices/darklua", version = "=0.12.1" }
luau-lsp = { github = "johnnymorganz/luau-lsp", version = "=1.35.0" }
darklua = { github = "seaofvoices/darklua", version = "=0.14.0" }
lune = { github = "filiptibell/lune", version = "0.7.11" }
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions modules/jest-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@jsdotlua/jest-react",
"version": "17.2.0",
"repository": {
"type": "git",
"url": "https://github.com/jsdotlua/react-lua.git",
"directory": "modules/jest-react"
},
"license": "MIT",
"main": "src/init.luau",
"scripts": {
"prepare": "npmluau"
},
"dependencies": {
"@jsdotlua/jest-globals": "^3.6.1-rc.2",
"@jsdotlua/luau-polyfill": "^1.2.6",
"@jsdotlua/shared": "workspace:^"
},
"devDependencies": {
"npmluau": "^0.1.0"
}
}
4 changes: 4 additions & 0 deletions modules/react-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"@jsdotlua/shared": "workspace:^"
},
"devDependencies": {
"@jsdotlua/jest-globals": "^3.6.1-rc.2",
"@jsdotlua/jest-react": "workspace:^",
"@jsdotlua/promise": "^3.5.0",
"@jsdotlua/react-test-renderer": "workspace:^",
"npmluau": "^0.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("ReactCache", function()
Suspense = React.Suspense
-- ROBLOX deviation START: fix require
-- ReactCache = require_("react-cache")
ReactCache = require(".")
ReactCache = require("..")
-- ROBLOX deviation END
createResource = ReactCache.unstable_createResource
-- ROBLOX deviation START: fix requires
Expand Down
5 changes: 5 additions & 0 deletions modules/react-debug-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"@jsdotlua/shared": "workspace:^"
},
"devDependencies": {
"@jsdotlua/jest-globals": "^3.6.1-rc.2",
"@jsdotlua/promise": "^3.5.0",
"@jsdotlua/react": "workspace:^",
"@jsdotlua/react-test-renderer": "workspace:^",
"@jsdotlua/scheduler": "workspace:^",
"npmluau": "^0.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @emails react-core
* @jest-environment node
]]
local Packages = script.Parent.Parent.Parent
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
-- ROBLOX deviation START: not needed
-- local Boolean = LuauPolyfill.Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @emails react-core
* @jest-environment node
]]
local Packages = script.Parent.Parent.Parent
-- ROBLOX deviation START: not needed
-- local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
-- local Boolean = LuauPolyfill.Boolean
Expand Down
2 changes: 2 additions & 0 deletions modules/react-devtools-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"@jsdotlua/shared": "workspace:^"
},
"devDependencies": {
"@jsdotlua/jest-globals": "^3.6.1-rc.2",
"@jsdotlua/react-test-renderer": "workspace:^",
"npmluau": "^0.1.0"
}
}
4 changes: 4 additions & 0 deletions modules/react-devtools-shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"@jsdotlua/shared": "workspace:^"
},
"devDependencies": {
"@jsdotlua/jest-globals": "^3.6.1-rc.2",
"@jsdotlua/promise": "^3.5.0",
"@jsdotlua/react-test-renderer": "workspace:^",
"@jsdotlua/scheduler": "workspace:^",
"npmluau": "^0.1.0"
}
}
3 changes: 1 addition & 2 deletions modules/react-devtools-shared/src/__tests__/bridge.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local describe = JestGlobals.describe
local it = JestGlobals.it
Expand All @@ -19,7 +18,7 @@ describe("bridge", function()
beforeEach(function()
jest.resetModules()
jest.useFakeTimers()
Bridge = require("./bridge")
Bridge = require("../bridge")
end)

it("should shutdown properly", function()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local describe = JestGlobals.describe
local xit = JestGlobals.xit
Expand Down
3 changes: 1 addition & 2 deletions modules/react-devtools-shared/src/__tests__/events.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
-- * @flow
-- */

local Packages = script.Parent.Parent.Parent
local Error = require("@pkg/@jsdotlua/luau-polyfill").Error
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local describe = JestGlobals.describe
Expand All @@ -21,7 +20,7 @@ describe("events", function()
local dispatcher
beforeEach(function()
jest.resetModules()
local EventEmitter = require("./events")
local EventEmitter = require("../events")
dispatcher = EventEmitter.new()
end)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
* @flow
]]

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jest = JestGlobals.jest
local jestExpect = JestGlobals.expect
local xdescribe = JestGlobals.xdescribe
local it = JestGlobals.it
local beforeEach = JestGlobals.beforeEach

local devtoolsTypes = require("./devtools/types")
local devtoolsTypes = require("../devtools/types")
type Store = devtoolsTypes.Store

local global = _G
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
*
* @flow
]]

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local xdescribe = JestGlobals.xdescribe
Expand All @@ -21,13 +19,13 @@ local afterEach = JestGlobals.afterEach
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
local Error = LuauPolyfill.Error

local Bridge = require("./bridge")
local Bridge = require("../bridge")
type FrontendBridge = Bridge.FrontendBridge

local devtoolsTypes = require("./devtools/types")
local devtoolsTypes = require("../devtools/types")
type Store = devtoolsTypes.Store

local ProfilerTypes = require("./devtools/views/Profiler/types")
local ProfilerTypes = require("../devtools/views/Profiler/types")
type ProfilingDataFrontend = ProfilerTypes.ProfilingDataFrontend

local global = _G
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @flow
]]

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local xdescribe = JestGlobals.xdescribe
local beforeEach = JestGlobals.beforeEach
Expand All @@ -18,7 +17,7 @@ local describe = JestGlobals.describe
local it = JestGlobals.it
local jestExpect = JestGlobals.expect

local devtoolsTypes = require("./devtools/types")
local devtoolsTypes = require("../devtools/types")
type Store = devtoolsTypes.Store

xdescribe("profiling charts", function()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
* @flow
]]

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local xdescribe = JestGlobals.xdescribe
local beforeEach = JestGlobals.beforeEach
local it = JestGlobals.it
local jestExpect = JestGlobals.expect

local devtoolsTypes = require("./devtools/types")
local devtoolsTypes = require("../devtools/types")
type Store = devtoolsTypes.Store

local global = _G
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @flow
]]

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
Expand All @@ -18,7 +17,7 @@ local beforeEach = JestGlobals.beforeEach
describe("profiling utils", function()
local utils
beforeEach(function()
utils = require("./devtools/views/Profiler/utils")
utils = require("../devtools/views/Profiler/utils")
end)
it("should throw if importing older/unsupported data", function()
jestExpect(function()
Expand Down
12 changes: 6 additions & 6 deletions modules/react-devtools-shared/src/__tests__/setupTests.luau
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ beforeEach(function()
-- rather than imported at the head of the module.
-- That's because we reset modules between tests,
-- which disconnects the DevTool's cache from the current dispatcher ref.
local Agent = require("./backend/agent")
local initBackend = require("./backend").initBackend
local Bridge = require("./bridge")
local Store = require("./devtools/store")
local installHook = require("./hook").installHook
local utils = require("./utils")
local Agent = require("../backend/agent")
local initBackend = require("../backend").initBackend
local Bridge = require("../bridge")
local Store = require("../devtools/store")
local installHook = require("../hook").installHook
local utils = require("../utils")
local getDefaultComponentFilters = utils.getDefaultComponentFilters
local saveComponentFilters = utils.saveComponentFilters

Expand Down
7 changes: 3 additions & 4 deletions modules/react-devtools-shared/src/__tests__/store.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ local fill = function(count, value)
return output
end

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jest = JestGlobals.jest
local jestExpect = JestGlobals.expect
Expand All @@ -36,7 +35,7 @@ type Array<T> = { [number]: T }
local ReactRoblox
local React
-- ROBLOX deviation: bring in the Agent type
local Agent = require("./backend/agent")
local Agent = require("../backend/agent")
type Agent = Agent.Agent

describe("Store", function()
Expand All @@ -54,8 +53,8 @@ describe("Store", function()
React = require("@pkg/@jsdotlua/react")
jest.resetModules()
ReactRoblox = require("@pkg/@jsdotlua/react-roblox")
devtoolsUtils = require("./devtools/utils")
constants = require("./constants")
devtoolsUtils = require("../devtools/utils")
constants = require("../constants")

jest.useFakeTimers()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
]]

type Function = (...any) -> ...any
local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jest = JestGlobals.jest
local describe = JestGlobals.describe
Expand All @@ -20,9 +19,9 @@ local jestExpect = JestGlobals.expect

local global = _G

local bridgeModule = require("./bridge")
local bridgeModule = require("../bridge")
type FrontendBridge = bridgeModule.FrontendBridge
local devtoolsTypes = require("./devtools/types")
local devtoolsTypes = require("../devtools/types")
type Store = devtoolsTypes.Store

describe("Store component filters", function()
Expand Down Expand Up @@ -55,9 +54,9 @@ describe("Store component filters", function()

React = require("@pkg/@jsdotlua/react")
ReactRoblox = require("@pkg/@jsdotlua/react-roblox")
Types = require("./types")
Types = require("../types")
utils = require("./utils")
devtoolsUtils = require("./devtools/utils")
devtoolsUtils = require("../devtools/utils")
end)

it("should throw if filters are updated while profiling", function()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @flow
]]

local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
Expand Down Expand Up @@ -38,7 +37,7 @@ describeIfDev("Store owners list", function()
Boolean = LuauPolyfill.Boolean
React = require("@pkg/@jsdotlua/react")
ReactRoblox = require("@pkg/@jsdotlua/react-roblox")
devtoolsUtils = require("./devtools/utils")
devtoolsUtils = require("../devtools/utils")
printOwnersList = devtoolsUtils.printOwnersList

local utils = require("./utils")
Expand Down
10 changes: 5 additions & 5 deletions modules/react-devtools-shared/src/__tests__/utils.luau
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ type Function = (...any) -> any?
local global = _G
local exports = {}

local Bridge = require("./bridge")
local Bridge = require("../bridge")
type FrontendBridge = Bridge.FrontendBridge
local devtoolsTypes = require("./devtools/types")
local devtoolsTypes = require("../devtools/types")
type Store = devtoolsTypes.Store
local ProfilerTypes = require("./devtools/views/Profiler/types")
local ProfilerTypes = require("../devtools/views/Profiler/types")
type ProfilingDataFrontend = ProfilerTypes.ProfilingDataFrontend
local Types = require("./types")
local Types = require("../types")
type ElementType = Types.ElementType

exports.act = function(callback: () -> ()): ()
Expand Down Expand Up @@ -198,7 +198,7 @@ exports.requireTestRenderer = function(): any
end

exports.exportImportHelper = function(bridge: FrontendBridge, store: Store): ()
local utils = require("./devtools/views/Profiler/utils")
local utils = require("../devtools/views/Profiler/utils")
local prepareProfilingDataExport = utils.prepareProfilingDataExport
local prepareProfilingDataFrontendFromExport =
utils.prepareProfilingDataFrontendFromExport
Expand Down
3 changes: 1 addition & 2 deletions modules/react-devtools-shared/src/__tests__/utils.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-- *
-- * @flow
-- */
local Packages = script.Parent.Parent.Parent
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
Expand All @@ -17,7 +16,7 @@ local beforeEach = JestGlobals.beforeEach
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
local Symbol = LuauPolyfill.Symbol

local utils = require("./utils")
local utils = require("../utils")
local getDisplayName = utils.getDisplayName
local getDisplayNameForReactElement = utils.getDisplayNameForReactElement
local SuspenseList, StrictMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Set<T> = LuauPolyfill.Set<T>

local exports = {}

local devtoolsTypes = require("./types")
local devtoolsTypes = require("../../types")
type ProfilerStore = devtoolsTypes.ProfilerStore

local formatDuration = require("./utils").formatDuration
Expand Down
Loading
Loading