Skip to content

Commit 0a80c8d

Browse files
Convert requires and setup npm packages
1 parent a9bd3fa commit 0a80c8d

File tree

315 files changed

+2291
-1784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+2291
-1784
lines changed

modules/TestRunner/default.project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "TestRunner",
2+
"name": "test-runner",
33
"tree": {
44
"Src": {
55
"$path": "src"

modules/jest-react/.npmignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
**/.robloxrc
2+
rotriever.toml
3+
4+
/roblox
5+
/build
6+
7+
.darklua*
8+
.luau-analyze.json
9+
.luaurc
10+
default.project.json
11+
12+
/globalTypes.d.lua
13+
**/sourcemap.json
14+
**/*.project.json
15+
16+
**/__tests__
17+
**/*.test.lua
18+
**/*.spec.lua
19+
**/jest.config.lua
20+
21+
**/*.rbxl
22+
**/*.rbxlx
23+
**/*.rbxl.lock
24+
**/*.rbxlx.lock
25+
**/*.rbxm
26+
**/*.rbxmx

modules/jest-react/default.project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "JestReact",
2+
"name": "jest-react",
33
"tree": {
44
"$path": "src"
55
}

modules/jest-react/src/JestReact.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@
55
* This source code is licensed under the MIT license found in the
66
* LICENSE file in the root directory of this source tree.
77
]]
8-
local Packages = script.Parent.Parent
9-
local LuauPolyfill = require(Packages.LuauPolyfill)
8+
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
109
local Array = LuauPolyfill.Array
1110
-- ROBLOX deviation START: not used
1211
-- local Boolean = LuauPolyfill.Boolean
1312
-- ROBLOX deviation END
1413
local Object = LuauPolyfill.Object
1514
local exports = {}
1615
-- ROBLOX deviation START: fix import
17-
-- local JestGlobals = require(Packages.Dev.JestGlobals)
18-
local JestGlobals = require(Packages.JestGlobals)
16+
-- local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
17+
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
1918
local expect = JestGlobals.expect
2019
-- ROBLOX deviation END
2120
-- ROBLOX deviation START: fix import
2221
-- local sharedReactSymbolsModule = require(Packages.shared.ReactSymbols)
23-
local sharedReactSymbolsModule = require(Packages.Shared).ReactSymbols
22+
local sharedReactSymbolsModule = require("@pkg/@jsdotlua/shared").ReactSymbols
2423
-- ROBLOX deviation END
2524
local REACT_ELEMENT_TYPE = sharedReactSymbolsModule.REACT_ELEMENT_TYPE
2625
local REACT_FRAGMENT_TYPE = sharedReactSymbolsModule.REACT_FRAGMENT_TYPE
2726
-- ROBLOX deviation START: fix import
28-
-- local invariant = require(Packages.shared.invariant).default
29-
local invariant = require(Packages.Shared).invariant
27+
-- local invariant = require("@pkg/@jsdotlua/shared").default
28+
local invariant = require("@pkg/@jsdotlua/shared").invariant
3029
-- ROBLOX deviation END
3130
-- ROBLOX deviation START: predeclare variables
3231
local jsonChildToJSXChild, jsonChildrenToJSXChildren

modules/jest-react/src/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
* This source code is licensed under the MIT license found in the
66
* LICENSE file in the root directory of this source tree.
77
]]
8-
local Packages = script.Parent
9-
local LuauPolyfill = require(Packages.LuauPolyfill)
8+
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
109
local Object = LuauPolyfill.Object
1110
local exports = {}
1211
-- ROBLOX deviation START: extract to variable, fix import and export type
1312
-- Object.assign(exports, require(script.src.JestReact))
14-
local jestReactModule = Object.assign(exports, require(script.JestReact))
13+
local jestReactModule = Object.assign(exports, require("./JestReact"))
1514
return exports :: typeof(exports) & typeof(jestReactModule)
1615
-- ROBLOX deviation END

modules/react-cache/.npmignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
**/.robloxrc
2+
rotriever.toml
3+
4+
/roblox
5+
/build
6+
7+
.darklua*
8+
.luau-analyze.json
9+
.luaurc
10+
default.project.json
11+
12+
/globalTypes.d.lua
13+
**/sourcemap.json
14+
**/*.project.json
15+
16+
**/__tests__
17+
**/*.test.lua
18+
**/*.spec.lua
19+
**/jest.config.lua
20+
21+
**/*.rbxl
22+
**/*.rbxlx
23+
**/*.rbxl.lock
24+
**/*.rbxlx.lock
25+
**/*.rbxm
26+
**/*.rbxmx

modules/react-cache/default.project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ReactCache",
2+
"name": "react-cache",
33
"tree": {
44
"$path": "src"
55
}

modules/react-cache/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@jsdotlua/react-cache",
3+
"version": "17.0.2",
4+
"repository": {
5+
"type": "git",
6+
"url": "https://github.com/jsdotlua/react-lua.git",
7+
"directory": "modules/react-cache"
8+
},
9+
"license": "MIT",
10+
"main": "src/init.lua",
11+
"scripts": {
12+
"prepare": "npmluau"
13+
},
14+
"dependencies": {
15+
"@jsdotlua/luau-polyfill": "^1.2.6",
16+
"@jsdotlua/react": "workspace:^",
17+
"@jsdotlua/scheduler": "workspace:^",
18+
"@jsdotlua/shared": "workspace:^"
19+
},
20+
"devDependencies": {
21+
"npmluau": "^0.1.0"
22+
}
23+
}

modules/react-cache/src/LRU.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
*
88
* @flow
99
]]
10-
local Packages = script.Parent.Parent
11-
local LuauPolyfill = require(Packages.LuauPolyfill)
10+
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
1211
type Object = LuauPolyfill.Object
1312
local exports = {}
1413
-- ROBLOX deviation START: fix import
15-
-- local Scheduler = require(Packages.scheduler) -- Intentionally not named imports because Rollup would
16-
local Scheduler = require(Packages.Scheduler)
14+
-- local Scheduler = require("@pkg/@jsdotlua/scheduler") -- Intentionally not named imports because Rollup would
15+
local Scheduler = require("@pkg/@jsdotlua/scheduler")
1716
-- ROBLOX deviation END
1817
-- use dynamic dispatch for CommonJS interop named imports.
1918
local scheduleCallback, IdlePriority =

modules/react-cache/src/ReactCacheOld.lua

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
*
88
* @flow
99
]]
10-
local Packages = script.Parent.Parent
11-
local LuauPolyfill = require(Packages.LuauPolyfill)
10+
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
1211
-- ROBLOX deviation START: unnecessary import
1312
-- local Boolean = LuauPolyfill.Boolean
1413
-- ROBLOX deviation END
@@ -21,7 +20,7 @@ local inspect = LuauPolyfill.util.inspect
2120
-- ROBLOX deviation END
2221
-- ROBLOX deviation START: use console from React Shared
2322
-- local console = LuauPolyfill.console
24-
local console = require(Packages.Shared).console
23+
local console = require("@pkg/@jsdotlua/shared").console
2524
-- ROBLOX deviation END
2625
type Map<T, U> = LuauPolyfill.Map<T, U>
2726
local exports = {}
@@ -31,13 +30,13 @@ local deleteEntry
3130
-- ROBLOX deviation START: fix import
3231
-- local sharedReactTypesModule = require(Packages.shared.ReactTypes)
3332
-- type Thenable = sharedReactTypesModule.Thenable
34-
local ReactTypes = require(Packages.Shared)
33+
local ReactTypes = require("@pkg/@jsdotlua/shared")
3534
type Thenable<R> = ReactTypes.Thenable<R>
3635
-- ROBLOX deviation END
37-
local React = require(Packages.React)
38-
local createLRU = require(script.Parent.LRU).createLRU
36+
local React = require("@pkg/@jsdotlua/react")
37+
local createLRU = require("./LRU").createLRU
3938
-- ROBLOX deviation START: add this type in an attempt to tighten up the types to detect bugs found manually
40-
local LRU = require(script.Parent.LRU)
39+
local LRU = require("./LRU")
4140
type Entry<T> = LRU.Entry<T>
4241
type Record<K, V> = { [K]: V }
4342
-- ROBLOX deviation END
@@ -71,7 +70,7 @@ local Rejected = 2
7170
local ReactCurrentDispatcher =
7271
-- ROBLOX deviation START: import from Shared package
7372
-- React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher
74-
require(Packages.Shared).ReactSharedInternals.ReactCurrentDispatcher
73+
require("@pkg/@jsdotlua/shared").ReactSharedInternals.ReactCurrentDispatcher
7574
-- ROBLOX deviation END
7675
local function readContext(Context, observedBits)
7776
local dispatcher = ReactCurrentDispatcher.current

0 commit comments

Comments
 (0)