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
14 changes: 0 additions & 14 deletions packages/reflex-base/src/reflex_base/constants/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,6 @@ class Commands(SimpleNamespace):
DEV = "react-router dev --host"
EXPORT = "react-router build"

@staticmethod
def get_prod_command(frontend_path: str = "") -> str:
"""Get the prod command with the correct 404.html path for the given frontend_path.

Args:
frontend_path: The frontend path prefix (e.g. "/app").

Returns:
The sirv command with the correct --single fallback path.
"""
stripped = frontend_path.strip("/")
fallback = f"{stripped}/404.html" if stripped else "404.html"
return f"sirv ./build/client --single {fallback} --host"

PATH = "package.json"

_react_version = _determine_react_version()
Expand Down
19 changes: 0 additions & 19 deletions tests/units/test_prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest
from click.testing import CliRunner
from reflex_base.config import Config
from reflex_base.constants.installer import PackageJson
from reflex_base.utils.decorator import cached_procedure

from reflex.reflex import cli
Expand Down Expand Up @@ -91,24 +90,6 @@ def test_initialise_vite_config(config, expected_output):
assert expected_output in output


@pytest.mark.parametrize(
("frontend_path", "expected_command"),
[
("", "sirv ./build/client --single 404.html --host"),
("/", "sirv ./build/client --single 404.html --host"),
("/app", "sirv ./build/client --single app/404.html --host"),
("/app/", "sirv ./build/client --single app/404.html --host"),
("app", "sirv ./build/client --single app/404.html --host"),
(
"/deep/nested/path",
"sirv ./build/client --single deep/nested/path/404.html --host",
),
],
)
def test_get_prod_command(frontend_path, expected_command):
assert PackageJson.Commands.get_prod_command(frontend_path) == expected_command


def test_cached_procedure():
call_count = 0

Expand Down
Loading