Skip to content

Commit e0caaa2

Browse files
author
RoFlection Bot
committed
LUAFDN-1195: Expliticly license each file (#318)
* Expliticly license each file, except upstream-derived files that do not have a license in upstream. Per meeting with Thomas Hwang, Heather Meeker, et al to eliminate unlicensed files that get source distribution through Studio plugins bundle. * Pull in the Code Of Conduct we have in multiple other repos.
1 parent 605a8f3 commit e0caaa2

File tree

82 files changed

+970
-10467
lines changed

Some content is hidden

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

82 files changed

+970
-10467
lines changed

CODE_OF_CONDUCT.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
lua-foundation@roblox.com.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126+
at [https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Roblox
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

bin/spec.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
--[[
2+
* Copyright (c) Roblox Corporation. All rights reserved.
3+
* Licensed under the MIT License (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* https://opensource.org/licenses/MIT
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
]]
115
local processServiceExists, ProcessService = pcall(function()
216
return game:GetService("ProcessService")
317
end)

foreman.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[tools]
22
rotrieve = { source = "roblox/rotriever", version = "=0.5.4" }
33
rojo = { source = "rojo-rbx/rojo", version = "7.2.1" }
4-
selene = { source = "Kampfkarren/selene", version = "0.16.0" }
4+
selene = { source = "Kampfkarren/selene", version = "0.20.0" }
55
stylua = { source = "JohnnyMorganz/StyLua", version = "=0.12.5" }
66
testez = { source = "roblox/testez", version = "0.3.2" }
7-
run-in-roblox = { source = "rojo-rbx/run-in-roblox", version = "0.3.0" }

modules/jest-react/src/JestReact.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
--[[
2-
Roblox upstream: https://github.com/facebook/react/blob/e0f89aa056de95afc4c23909fce3d91fefb7dec7/packages/jest-react/src/JestReact.js
3-
]]
1+
-- ROBLOX upstream: https://github.com/facebook/react/blob/e0f89aa056de95afc4c23909fce3d91fefb7dec7/packages/jest-react/src/JestReact.js
2+
--[[*
3+
* Copyright (c) Facebook, Inc. and its affiliates.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*]]
8+
49
local Packages = script.Parent.Parent
510
local ReactSymbols = require(Packages.Shared).ReactSymbols
611
local REACT_ELEMENT_TYPE = ReactSymbols.REACT_ELEMENT_TYPE

modules/jest-react/src/getJestMatchers.roblox.lua

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
--!strict
12
--[[
2-
Roblox upstream: https://github.com/facebook/react/blob/69060e1da6061af845162dcf6854a5d9af28350a/scripts/jest/matchers/reactTestMatchers.js
3+
ROBLOX upstream: https://github.com/facebook/react/blob/69060e1da6061af845162dcf6854a5d9af28350a/scripts/jest/matchers/reactTestMatchers.js
34
45
Note: this file is partially redundant with modules/scheduler/src/getJestMatchers.roblox.lua
56
That is also happening upstream: https://github.com/facebook/react/blob/47ff31a77add22bef54aaed9d4fb62d5aa693afd/scripts/jest/matchers/schedulerTestMatchers.js
67
]]
8+
9+
--[[**
10+
* Copyright (c) Facebook, Inc. and its affiliates.
11+
*
12+
* This source code is licensed under the MIT license found in the
13+
* LICENSE file in the root directory of this source tree.
14+
*]]
15+
716
local JestReact = require(script.Parent.JestReact)
817

9-
local function captureAssertion(fn)
18+
local function captureAssertion(
19+
fn
20+
): { pass: false, message: () -> string } | { pass: true }
1021
-- Trick to use a TestEZ expectation matcher inside another Jest
1122
-- matcher. `fn` contains an assertion; if it throws, we capture the
1223
-- error and return it, so the stack trace presented to the user points

modules/react-devtools-shared/src/__tests__/init.spec.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
-- ROBLOX upstream: https://github.com/facebook/react/blob/v17.0.1/packages/react-devtools-shared/src/__tests__/setupTests.js
2+
--[[**
3+
* Copyright (c) Facebook, Inc. and its affiliates.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
*
7+
* LICENSE file in the root directory of this source tree.
8+
* @flow
9+
*]]
110
return function()
211
local Packages = script.Parent.Parent.Parent
312
local jestExpect = require(Packages.Dev.JestGlobals).expect

modules/react-devtools-shared/src/__tests__/utils.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ exports.getRendererID = function(): number
168168
end
169169

170170
-- ROBLOX FIXME: create Number.parseInt() in luau-polyfill
171-
return id and tonumber(id) or Number.NaN
171+
return if id then tonumber(id) else Number.NaN
172172
end
173173
exports.requireTestRenderer = function()
174174
local hook

modules/react-devtools-shared/src/backend/renderer.lua

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,10 @@ exports.attach = function(
589589
-- ROBLOX deviation: Use string nil rather than null as it is Roblox convenion
590590
local displayName = getDisplayNameForFiber(fiber) or "nil"
591591
local id = getFiberID(fiber)
592-
local parentDisplayName = parentFiber ~= nil
593-
and getDisplayNameForFiber(
594-
parentFiber :: Fiber
595-
)
596-
or "nil"
597-
local parentID = parentFiber and getFiberID(parentFiber :: Fiber) or ""
592+
local parentDisplayName = if parentFiber ~= nil
593+
then getDisplayNameForFiber(parentFiber :: Fiber)
594+
else "nil"
595+
local parentID = if parentFiber then getFiberID(parentFiber :: Fiber) else ""
598596
-- NOTE: calling getFiberID or getPrimaryFiber is unsafe here
599597
-- because it will put them in the map. For now, we'll omit them.
600598
-- TODO: better debugging story for this.
@@ -605,13 +603,13 @@ exports.attach = function(
605603
name,
606604
displayName,
607605
id,
608-
parentFiber
609-
and string.format(
610-
"%s (%s)",
611-
tostring(parentDisplayName),
612-
tostring(parentID)
613-
)
614-
or ""
606+
if parentFiber
607+
then string.format(
608+
"%s (%s)",
609+
tostring(parentDisplayName),
610+
tostring(parentID)
611+
)
612+
else ""
615613
)
616614
)
617615
end
@@ -1183,7 +1181,7 @@ exports.attach = function(
11831181

11841182
local numUnmountIDs = #pendingRealUnmountedIDs
11851183
+ #pendingSimulatedUnmountedIDs
1186-
+ (pendingUnmountedRootID == nil and 0 or 1)
1184+
+ (if pendingUnmountedRootID == nil then 0 else 1)
11871185
local operations: Array<string | number> = Array.new(
11881186
-- ROBLOX deviation: don't create an array of specified length
11891187
-- Identify which renderer this update is coming from.
@@ -1338,8 +1336,8 @@ exports.attach = function(
13381336
pushOperation(TREE_OPERATION_ADD)
13391337
pushOperation(id)
13401338
pushOperation(ElementTypeRoot)
1341-
pushOperation(isProfilingSupported and 1 or 0)
1342-
pushOperation(hasOwnerMetadata and 1 or 0)
1339+
pushOperation(if isProfilingSupported then 1 else 0)
1340+
pushOperation(if hasOwnerMetadata then 1 else 0)
13431341

13441342
if isProfiling then
13451343
if displayNamesByRootID ~= nil then
@@ -2034,7 +2032,7 @@ exports.attach = function(
20342032
-- The frontend may request this information after profiling has stopped.
20352033
currentCommitProfilingMetadata = {
20362034
-- ROBLOX deviation: use bare table instead of Map type
2037-
changeDescriptions = recordChangeDescriptions and {} or nil,
2035+
changeDescriptions = if recordChangeDescriptions then {} else nil,
20382036
durations = {},
20392037
commitTime = getCurrentTime() - profilingStartTime,
20402038
-- ROBLOX TODO: Work out how to deviate this assignment, it's messy
@@ -2110,7 +2108,7 @@ exports.attach = function(
21102108
-- The frontend may request this information after profiling has stopped.
21112109
currentCommitProfilingMetadata = {
21122110
-- ROBLOX deviation: use bare table instead of Map type
2113-
changeDescriptions = recordChangeDescriptions and {} or nil,
2111+
changeDescriptions = if recordChangeDescriptions then {} else nil,
21142112
durations = {},
21152113
commitTime = getCurrentTime() - profilingStartTime,
21162114
interactions = Array.map(

modules/react-devtools-shared/src/devtools/store.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ function Store:setCollapseNodesByDefault(value: boolean)
402402

403403
localStorageSetItem(
404404
LOCAL_STORAGE_COLLAPSE_ROOTS_BY_DEFAULT_KEY,
405-
value and "true" or "false"
405+
if value then "true" else "false"
406406
)
407407
self:emit("collapseNodesByDefault")
408408
end
@@ -479,7 +479,7 @@ function Store:setRecordChangeDescriptions(value: boolean): ()
479479

480480
localStorageSetItem(
481481
LOCAL_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY,
482-
value and "true" or "false"
482+
if value then "true" else "false"
483483
)
484484
self:emit("recordChangeDescriptions")
485485
end
@@ -555,7 +555,7 @@ function Store:getElementAtIndex(index: number): Element?
555555
for i = 1, numChildren do
556556
local childID = currentElement.children[i]
557557
local child = self._idToElement[childID]
558-
local childWeight = child.isCollapsed and 1 or child.weight
558+
local childWeight = if child.isCollapsed then 1 else child.weight
559559
if index <= currentWeight + childWeight then
560560
currentWeight += 1
561561
currentElement = child
@@ -616,7 +616,7 @@ function Store:getIndexOfElementID(id: number): number | nil
616616
end
617617

618618
local child = self._idToElement[childID]
619-
index += child.isCollapsed and 1 or child.weight
619+
index += if child.isCollapsed then 1 else child.weight
620620
end
621621

622622
-- We found the root; stop crawling.

0 commit comments

Comments
 (0)