Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit596336f

Browse files
committed
Copy birdseye/static into frontend/public in generate_static_files.py so that birdseye works in dev server instead of build only
1 parente3742ac commit596336f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

‎build.sh‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@ set -eux
55
rm -rf dist||true
66
mkdir -p dist/course/
77

8-
export PYTHONPATH=.
98
source$HOME/.poetry/env
109

11-
BIRDSEYE=`poetry run python -c'
12-
import birdseye
13-
from pathlib import Path
14-
print(Path(birdseye.__file__).parent)
15-
'`
16-
cp -r$BIRDSEYE/static/ dist/course/birdseye/
17-
18-
poetry run python core/generate_static_files.py
10+
poetry run python -m core.generate_static_files
1911

2012
cd frontend
2113
CI=false npm run build

‎core/generate_static_files.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
"""
2020

2121
importos
22+
importshutil
2223
importsys
2324
importtarfile
2425
frompathlibimportPath
2526

27+
importbirdseye
2628
fromlittleutilsimportstrip_required_prefix,json_to_file
2729

2830
fromcore.textimportpages,get_pages,chapters
@@ -96,11 +98,16 @@ def tarfile_filter(tar_info):
9698
defmain():
9799
print("Generating files...")
98100
this_dir=Path(__file__).parent
99-
frontend_src=this_dir/"../frontend/src"
101+
frontend=this_dir/"../frontend"
102+
frontend_src=frontend/"src"
100103

101104
json_to_file(get_pages(),frontend_src/"book/pages.json.load_by_url")
102105
json_to_file(chapters,frontend_src/"chapters.json")
103106

107+
birdseye_dest=frontend/"public/birdseye"
108+
shutil.rmtree(birdseye_dest,ignore_errors=True)
109+
shutil.copytree(Path(birdseye.__file__).parent/"static",birdseye_dest,dirs_exist_ok=True)
110+
104111
roots=get_roots()
105112
core_imports="\n".join(roots)
106113
core_imports_path=this_dir/"core_imports.txt"

‎frontend/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ yarn-error.log*
2525
pages.json.load_by_url
2626
chapters.json
2727
python_core.tar
28+
public/birdseye/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp