Skip to content

Commit

Permalink
react migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sircfenner committed Apr 30, 2024
1 parent 02dc63a commit f22e148
Show file tree
Hide file tree
Showing 234 changed files with 7,616 additions and 4,098 deletions.
18 changes: 18 additions & 0 deletions .darklua-wally.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"process": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "."
}
},
"target": {
"name": "roblox",
"rojo_sourcemap": "./sourcemap.json",
"indexing_style": "find_first_child"
}
}
]
}
18 changes: 18 additions & 0 deletions .darklua.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"rules": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@pkg": "node_modules/.luau-aliases"
}
},
"target": {
"name": "roblox",
"rojo_sourcemap": "./darklua-sourcemap.json",
"indexing_style": "find_first_child"
}
}
]
}
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text eol=lf
*.luau linguist-language=Lua

*.gif binary
*.ico binary
*.jpg binary
*.png binary
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Closes #[issue number]

<!-- description of the changes -->

- [ ] add entry to the changelog
148 changes: 148 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Release

"on":
workflow_dispatch:
inputs:
release_tag:
description: The version to release starting with `v`
required: true
type: string
release_ref:
description: The branch, tag or SHA to checkout (default to latest)
default: ""
type: string

permissions:
contents: write

jobs:
publish-package:
name: Publish package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable

- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: package-lock.json

- name: Install packages
run: npm ci

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-wally-package:
needs: publish-package
name: Publish wally package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable

- uses: Roblox/setup-foreman@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: package-lock.json

- name: Install packages
run: npm ci

- name: Build assets
run: npm run build-assets

- name: Login to wally
run: wally login --project-path build/wally --token ${{ secrets.WALLY_ACCESS_TOKEN }}

- name: Publish to wally
run: wally publish --project-path build/wally

create-release:
needs: publish-package
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4

- name: Create tag
run: |
git fetch --tags --no-recurse-submodules
if [ ! $(git tag -l ${{ inputs.release_tag }}) ]; then
git tag ${{ inputs.release_tag }}
git push origin ${{ inputs.release_tag }}
fi
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.release_tag }}
name: ${{ inputs.release_tag }}
draft: false

build-assets:
needs: create-release
name: Add assets
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- artifact-name: studiocomponents.rbxm
path: build/studiocomponents.rbxm
asset-type: application/octet-stream
steps:
- uses: actions/checkout@v4

- uses: Roblox/setup-foreman@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: package-lock.json

- name: Install packages
run: npm ci

- name: Build assets
run: npm run build-assets

- name: Upload asset
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.path }}

- name: Add asset to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ matrix.path }}
asset_name: ${{ matrix.artifact-name }}
asset_content_type: ${{ matrix.asset-type }}
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

"on":
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: Roblox/setup-foreman@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: package-lock.json

- name: Install packages
run: npm ci

- name: Run linter
run: npm run lint:selene
# skip luau-lsp as it cannot ignore errors in node_modules

- name: Verify code style
run: npm run style-check

- name: Build assets
run: npm run build-assets
31 changes: 20 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Roblox
/Packages
/site
/assets

/*.rbxl
/*.rbxlx
/*.rbxl.lock
/*.rbxlx.lock
/*.rbxm
/*.rbxmx

# Dev
/.vscode
/roblox.toml
sourcemap.json
/build
/serve
/temp
/NOTES.txt

# Docs
/assets
/out
/site
/archived
/node_modules

.yarn

/globalTypes.d.lua

**/sourcemap.json
**/darklua-sourcemap.json
6 changes: 6 additions & 0 deletions .luau-analyze.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"luau-lsp.require.mode": "relativeToFile",
"luau-lsp.require.directoryAliases": {
"@pkg": "node_modules/.luau-aliases"
}
}
10 changes: 10 additions & 0 deletions .luaurc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"languageMode": "strict",
"lintErrors": true,
"lint": {
"*": true
},
"aliases": {
"pkg": "./node_modules/.luau-aliases"
}
}
16 changes: 16 additions & 0 deletions .moonwave/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
td:nth-child(1) {
background-color: rgb(46, 46, 46);
}

td:nth-child(2) {
background-color: rgb(255, 255, 255)
}

td {
width: auto;
}

td.min {
width: 1%;
white-space: nowrap;
}
Binary file added .moonwave/static/components/background/dark.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 .moonwave/static/components/background/light.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 .moonwave/static/components/button/dark.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 .moonwave/static/components/button/light.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 .moonwave/static/components/checkbox/dark.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 .moonwave/static/components/checkbox/light.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 .moonwave/static/components/colorpicker/dark.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 .moonwave/static/components/colorpicker/light.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 .moonwave/static/components/dropdown/dark.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 .moonwave/static/components/dropdown/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 .moonwave/static/components/label/dark.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 .moonwave/static/components/label/light.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 .moonwave/static/components/loadingdots/dark.gif
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 .moonwave/static/components/loadingdots/light.gif
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 .moonwave/static/components/mainbutton/dark.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 .moonwave/static/components/mainbutton/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 .moonwave/static/components/numericinput/dark.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 .moonwave/static/components/numericinput/light.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 .moonwave/static/components/progressbar/dark.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 .moonwave/static/components/progressbar/light.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 .moonwave/static/components/radiobutton/dark.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 .moonwave/static/components/radiobutton/light.png
Binary file added .moonwave/static/components/scrollframe/dark.png
Binary file added .moonwave/static/components/scrollframe/light.png
Binary file added .moonwave/static/components/slider/dark.png
Binary file added .moonwave/static/components/slider/light.png
Binary file added .moonwave/static/components/splitter/dark.png
Binary file added .moonwave/static/components/splitter/light.png
Binary file added .moonwave/static/components/tabcontainer/dark.png
Binary file added .moonwave/static/components/textinput/dark.png
Binary file added .moonwave/static/components/textinput/light.png
27 changes: 27 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/.*
/scripts
/assets
/docs
/site

/build
/serve
/temp

/*.json
/*.json5
/*.yml
/*.toml
/*.md
/*.txt
/*.tgz

*.d.lua
*.d.luau

**/*.rbxl
**/*.rbxlx
**/*.rbxl.lock
**/*.rbxlx.lock
**/*.rbxm
**/*.rbxmx
7 changes: 7 additions & 0 deletions .styluaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/node_modules
/temp
/build
/serve

**/*.d.lua
**/*.d.luau
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"johnnymorganz.luau-lsp",
"johnnymorganz.stylua",
"kampfkarren.selene-vscode"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"luau-lsp.require.directoryAliases": {
"@pkg": "node_modules/.luau-aliases"
},
"luau-lsp.require.mode": "relativeToFile",
"luau-lsp.completion.imports.requireStyle": "alwaysRelative",
"luau-lsp.types.roblox": true,
"luau-lsp.sourcemap.rojoProjectFile": "model.project.json",
}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Changelog

## 1.0.0

Migrated from [Roact](https://github.com/Roblox/roact) to [react-lua](https://github.com/jsdotlua/react-lua)
and rewrote the library from the ground up.

There are many API differences; consult the docs on this. Removal of some components was either due
to no longer being in scope for this project or requiring an API redesign which didn't make it
into v1.0.0.

### Added

- Full type annotations
- Components: DropShadowFrame, LoadingDots, NumberSequencePicker, NumericInput, ProgressBar
- Hooks: useMouseIcon

### Removed

- Components: BaseButton, Tooltip, VerticalCollapsibleSection, VerticalExpandingList, Widget, withTheme
- Contexts: ThemeContext
- Hooks: usePlugin

## 0.1.0 - 0.1.4

Initial release through to the final Roact version. Added various components and changed APIs.
Loading

0 comments on commit f22e148

Please sign in to comment.