@@ -99,7 +99,7 @@ async def build_ui(app_path: Path):
99
99
100
100
ui_dir = Path (__file__ ).parent .parent / "ui"
101
101
build_dir = app_path / "static" / "ui"
102
- out_dir = ui_dir / "out"
102
+ out_dir = ui_dir / "build" / " out"
103
103
104
104
build_command = "node_modules/.bin/next build"
105
105
@@ -273,6 +273,7 @@ async def build_frontend( # noqa: C901
273
273
# Create temporary file. json file extension is added for easy
274
274
# webpack JSON parsing.
275
275
dot_env_file = Path (__file__ ).parent .parent / "ui" / ".env"
276
+ build_id_dot_env_file = Path (__file__ ).parent .parent / "ui" / "build" / ".env"
276
277
env_config = {}
277
278
278
279
ui_config_file = Path (__file__ ).parent .parent / "ui" / "hyperglass.json"
@@ -320,7 +321,7 @@ async def build_frontend( # noqa: C901
320
321
write_favicon_formats (favicons .formats ())
321
322
322
323
build_data = {
323
- "params" : params .export_dict (),
324
+ "params" : sorted ( params .export_dict () ),
324
325
"version" : __version__ ,
325
326
"package_json" : package_json ,
326
327
}
@@ -333,19 +334,19 @@ async def build_frontend( # noqa: C901
333
334
334
335
# Read hard-coded environment file from last build. If build ID
335
336
# matches this build's ID, don't run a new build.
336
- if dot_env_file .exists () and not force :
337
- env_data = dotenv_to_dict (dot_env_file )
337
+ if build_id_dot_env_file .exists () and not force :
338
+ env_data = dotenv_to_dict (build_id_dot_env_file )
338
339
env_build_id = env_data .get ("HYPERGLASS_BUILD_ID" , "None" )
339
340
log .bind (id = env_build_id ).debug ("Previous build detected" )
340
341
341
342
if env_build_id == build_id :
342
343
log .debug ("UI parameters unchanged since last build, skipping UI build..." )
343
344
return True
344
345
345
- env_config .update ({"HYPERGLASS_BUILD_ID" : build_id })
346
-
347
346
dot_env_file .write_text ("\n " .join (f"{ k } ={ v } " for k , v in env_config .items ()))
348
347
log .bind (path = str (dot_env_file )).debug ("Wrote UI environment file" )
348
+ build_id_dot_env_file .write_text (f"HYPERGLASS_BUILD_ID={ build_id } " )
349
+ log .bind (path = str (build_id_dot_env_file )).debug ("Wrote UI build environment file" )
349
350
350
351
# Initiate Next.JS export process.
351
352
if any ((not dev_mode , force , full )):
0 commit comments