Skip to content

Commit

Permalink
[Release] Update the examples (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
reboot-dev-bot authored Apr 17, 2024
1 parent 60a32f6 commit 28103c8
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 40 deletions.
15 changes: 2 additions & 13 deletions .rsmrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,17 @@
# rsm subcommand --config=use-foo` #
########################################################################

# We'll run all of the examples assuming the directory of this
# `.rsmrc` as the working directory so that any paths that we specify
# below are relative to it.
protoc --working-directory=.
dev run --working-directory=.
dev run --protoc-watch

# Generate code from our '.proto' files in 'api/'.
protoc --output-directory=api/

# Find '.proto' files in 'api/'.
protoc api/

# Tell `rsm` where to output its generated files.
# The paths are different for backend and frontend code.
protoc -- --resemble_python_out=backend/api --resemble_react_out=web/src/api

# Watch if any generated files are modified.
# Watch if any generated or source files are modified.
dev run --watch=backend/api/**/*.py

# Watch if any of our source files are modified.
dev run --watch=backend/src/**/*.py
dev run --protoc-watch

# PYTHONPATH must be explicitly set to pick up generated code.
dev run --env=PYTHONPATH=backend/api/
Expand Down
5 changes: 2 additions & 3 deletions .tests/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -e # Exit if a command exits with an error.
set -u # Treat expanding an unset variable as an error.
set -x # Echo executed commands to help debug failures.

# Check that this script has been invoked with the right working directory, by
Expand All @@ -21,7 +20,7 @@ done

# Use the published Resemble pip package by default, but allow the test system
# to override them with a different value.
if [ -v REBOOT_RESEMBLE_WHL_FILE ]; then
if [ -n "$REBOOT_RESEMBLE_WHL_FILE" ]; then
# Install the `reboot-resemble` package from the specified path explicitly, over-
# writing the version from `pyproject.toml`.
rye remove --no-sync reboot-resemble
Expand All @@ -44,7 +43,7 @@ pytest backend/
# We will only do this if this machine has the `docker` command installed. That
# means this is skipped on e.g. GitHub's Mac OS X runners.
if command -v docker &> /dev/null; then
if [ -v REBOOT_RESEMBLE_WHL_FILE ]; then
if [ -n "$REBOOT_RESEMBLE_WHL_FILE" ]; then
# If `REBOOT_RESEMBLE_WHL_FILE` is set, have it refer to an absolute non-symlink
# (= canonical) path.
REBOOT_RESEMBLE_WHL_FILE=$(readlink --canonicalize $REBOOT_RESEMBLE_WHL_FILE)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
requires-python = ">= 3.10"
dependencies = [
"reboot-resemble>=0.5.5",
"reboot-resemble>=0.5.6",
]

[tool.rye]
dev-dependencies = [
"reboot-resemble>=0.5.5",
"reboot-resemble>=0.5.6",
"mypy>=1.2.0",
"pytest>=7.4.2",
"types-protobuf>=4.24.0.20240129",
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.1
# via kubernetes
# via kubernetes-asyncio
reboot-resemble==0.5.4
reboot-resemble==0.5.6
requests==2.31.0
# via kubernetes
# via requests-oauthlib
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.1
# via kubernetes
# via kubernetes-asyncio
reboot-resemble==0.5.4
reboot-resemble==0.5.6
requests==2.31.0
# via kubernetes
# via requests-oauthlib
Expand Down
2 changes: 1 addition & 1 deletion web/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_REBOOT_RESEMBLE_ENDPOINT=https://localhost.direct:9991
REACT_APP_REBOOT_RESEMBLE_ENDPOINT=https://dev.localhost.direct:9991
30 changes: 15 additions & 15 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@reboot-dev/resemble-react": "^0.5.5",
"@reboot-dev/resemble-react": "^0.5.6",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
4 changes: 2 additions & 2 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const App = () => {
const [message, setMessage] = useState("Hello, Resemble!");

const { useMessages, mutators } = useHello({ id: STATE_MACHINE_ID });
const { response, isLoading } = useMessages();
const { response } = useMessages();

const handleClick = () => {
mutators.send({ message: message });
Expand Down Expand Up @@ -80,7 +80,7 @@ const App = () => {
If we're loading our first response, show the user a loading message,
so that they don't just see an emtpy screen.
*/}
{isLoading && response === undefined && (
{response === undefined && (
<p className={css.informationText}>Loading...</p>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import reportWebVitals from "./reportWebVitals";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
// Use TLS (via localhost.direct) so we get the advantage of HTTP/2
// Use TLS (via dev.localhost.direct) so we get the advantage of HTTP/2
// multiplexing.
const client = new ResembleClient(
process.env.REACT_APP_REBOOT_RESEMBLE_ENDPOINT as string
Expand Down

0 comments on commit 28103c8

Please sign in to comment.