Skip to content

Commit 2806dac

Browse files
committed
rename static/ dir to app/
1 parent 3c8e162 commit 2806dac

15 files changed

+16
-18
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
graft idom/client/static/build
1+
graft idom/client/app/build
22
include idom/py.typed
33
include LICENSE
44
include requirements/prod.txt

docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ADD setup.py ./
2121
ADD setup.cfg ./
2222
ADD MANIFEST.in ./
2323
ADD README.md ./
24-
ADD idom/client/static/favicon.ico ./
24+
ADD idom/client/app/favicon.ico ./
2525

2626
RUN pip install -e .[all]
2727
RUN python -m idom install victory semantic-ui-react @material-ui/core

docs/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
from sanic import response
88

99
from idom.widgets.utils import multiview
10-
from idom.client.manage import STATIC_DIR
10+
from idom.client.manage import APP_DIR
1111
from idom.server.sanic import PerClientStateServer
1212

1313
here = Path(__file__).parent
1414

1515
app = Sanic(__name__)
1616
app.static("/docs", str(here / "build"))
17-
app.static("/favicon.ico", str(STATIC_DIR / "favicon.ico"))
17+
app.static("/favicon.ico", str(APP_DIR / "favicon.ico"))
1818

1919

2020
@app.route("/")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

idom/client/manage.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
from .utils import Spinner
1010

1111

12-
STATIC_DIR = Path(__file__).parent / "static"
13-
NODE_MODULES = STATIC_DIR / "node_modules"
14-
BUILD_DIR = STATIC_DIR / "build"
15-
CORE_MODULES = BUILD_DIR / "core_modules"
16-
WEB_MODULES = BUILD_DIR / "web_modules"
12+
APP_DIR = Path(__file__).parent / "app"
13+
BUILD_DIR = APP_DIR / "build"
14+
WEB_MODULES_DIR = BUILD_DIR / "web_modules"
1715

1816

1917
STATIC_SHIMS: Dict[str, Path] = {}
@@ -34,7 +32,7 @@ def web_module_path(name: str) -> Optional[Path]:
3432

3533

3634
def web_module_url(name: str) -> str:
37-
path = f"../{WEB_MODULES.name}/{name}.js"
35+
path = f"../{WEB_MODULES_DIR.name}/{name}.js"
3836
if not web_module_exists(name):
3937
raise ValueError(f"Module '{path}' does not exist.")
4038
return path
@@ -89,8 +87,8 @@ def delete_web_modules(names: Sequence[str], skip_missing: bool = False) -> None
8987

9088
def installed() -> List[str]:
9189
names: List[str] = []
92-
for path in WEB_MODULES.rglob("*.js"):
93-
rel_path = path.relative_to(WEB_MODULES)
90+
for path in WEB_MODULES_DIR.rglob("*.js"):
91+
rel_path = path.relative_to(WEB_MODULES_DIR)
9492
if rel_path.parent.name != "common":
9593
names.append(str(rel_path.with_suffix("")))
9694
return list(sorted(names))
@@ -103,7 +101,7 @@ def install(packages: Sequence[str], exports: Sequence[str] = ()) -> None:
103101
temp_build_dir = temp_static_dir / "build"
104102

105103
# copy over the whole ./static directory into the temp one
106-
shutil.copytree(STATIC_DIR, temp_static_dir, symlinks=True)
104+
shutil.copytree(APP_DIR, temp_static_dir, symlinks=True)
107105

108106
cache = Cache(temp_build_dir)
109107
cache.add_packages(packages, exports)
@@ -133,8 +131,8 @@ def install(packages: Sequence[str], exports: Sequence[str] = ()) -> None:
133131
def restore() -> None:
134132
with Spinner("Restoring"):
135133
_delete_os_paths(BUILD_DIR)
136-
_run_subprocess(["npm", "install"], STATIC_DIR)
137-
_run_subprocess(["npm", "run", "build"], STATIC_DIR)
134+
_run_subprocess(["npm", "install"], APP_DIR)
135+
_run_subprocess(["npm", "run", "build"], APP_DIR)
138136
STATIC_SHIMS.clear()
139137

140138

scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
cd idom/client/static
4+
cd idom/client/app
55
rm -rf node_modules
66
rm -rf web_modules
77
npm install

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ max-line-length = 88
1010
max-complexity = 18
1111
select = B,C,E,F,W,T4,B9,N
1212
exclude =
13-
idom/client/static/node_modules/*
13+
idom/client/app/node_modules/*
1414
docs/source/examples/*
1515
.eggs/*
1616
.tox/*

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ commands = mypy --strict idom
3131
skip_install = true
3232
deps = -r requirements/lint.txt
3333
commands =
34-
black . --check --exclude "idom/client/static/node_modules/.*"
34+
black . --check --exclude "idom/client/app/node_modules/.*"
3535
flake8 idom tests docs
3636

3737
[testenv:py38-docs]

0 commit comments

Comments
 (0)