Skip to content

Commit 0ba47cf

Browse files
authored
fix: improve the default download version of node to be compatible with vite supported node versions (#5)
1 parent 8fa7ab0 commit 0ba47cf

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

dash_vite_plugin/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
support_less: bool = False,
2828
support_sass: bool = False,
2929
download_node: bool = False,
30-
node_version: str = '18.17.0',
30+
node_version: str = '18.20.8',
3131
clean_after: bool = False,
3232
skip_build_if_recent: bool = True,
3333
skip_build_time_threshold: int = 5,

tests/test_dash_integration.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def test_vite_plugin_integration(self, dash_duo: DashComposite):
5959
build_assets_paths=['assets/js'],
6060
entry_js_paths=['assets/js/main.js'],
6161
npm_packages=[NpmPackage('react')],
62+
download_node=True,
6263
clean_after=False,
6364
)
6465

@@ -202,6 +203,7 @@ def test_vite_plugin_with_less_support(self, dash_duo: DashComposite):
202203
entry_js_paths=['assets/js/main.js'],
203204
npm_packages=[NpmPackage('react')],
204205
support_less=True,
206+
download_node=True,
205207
clean_after=False,
206208
)
207209

@@ -289,6 +291,7 @@ def test_vite_plugin_with_assets_path_ignore(self, dash_duo: DashComposite):
289291
build_assets_paths=['./assets/css', 'assets/js'], # These should be ignored by Dash
290292
entry_js_paths=['assets/js/main.js'],
291293
npm_packages=[NpmPackage('react')],
294+
download_node=True,
292295
clean_after=False,
293296
)
294297

@@ -362,6 +365,7 @@ def test_vite_plugin_skip_build_if_recent(self, dash_duo: DashComposite):
362365
build_assets_paths=['assets/js'],
363366
entry_js_paths=['assets/js/main.js'],
364367
npm_packages=[NpmPackage('react')],
368+
download_node=True,
365369
clean_after=False,
366370
skip_build_if_recent=True,
367371
skip_build_time_threshold=5, # 5 second threshold
@@ -459,6 +463,7 @@ def test_vite_plugin_with_custom_tmp_dir(self, dash_duo: DashComposite):
459463
entry_js_paths=['assets/js/main.js'],
460464
npm_packages=[NpmPackage('react')],
461465
plugin_tmp_dir='_custom_vite',
466+
download_node=True,
462467
clean_after=False,
463468
)
464469

@@ -535,6 +540,7 @@ def test_vite_plugin_with_clean_after(self, dash_duo: DashComposite):
535540
build_assets_paths=['assets/js'],
536541
entry_js_paths=['assets/js/main.js'],
537542
npm_packages=[NpmPackage('react')],
543+
download_node=True,
538544
clean_after=True,
539545
)
540546

@@ -678,6 +684,7 @@ def test_vite_plugin_with_vue_support(self, dash_duo: DashComposite):
678684
build_assets_paths=['assets/js', 'assets/vue'],
679685
entry_js_paths=['assets/js/main.js'],
680686
npm_packages=[NpmPackage('vue')],
687+
download_node=True,
681688
clean_after=False,
682689
)
683690

@@ -878,6 +885,7 @@ def test_vite_plugin_with_react_support(self, dash_duo: DashComposite):
878885
NpmPackage('react'),
879886
NpmPackage('react-dom'),
880887
],
888+
download_node=True,
881889
clean_after=False,
882890
)
883891

tests/test_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_plugin_initialization(self):
3838
assert plugin.support_less is False
3939
assert plugin.support_sass is False
4040
assert plugin.download_node is False
41-
assert plugin.node_version == '18.17.0'
41+
assert plugin.node_version == '18.20.8'
4242
assert plugin.clean_after is False
4343
assert plugin.skip_build_if_recent is True
4444
assert plugin.skip_build_time_threshold == 5

0 commit comments

Comments
 (0)