Skip to content

Commit 02cd54b

Browse files
committed
upgrade snowpack to max possible
there is a regression in snowpack builds FredKSchott/snowpack#1756
1 parent 4f9001b commit 02cd54b

File tree

5 files changed

+109
-48
lines changed

5 files changed

+109
-48
lines changed

idom/client/app/package-lock.json

Lines changed: 98 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idom/client/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"core_modules/*.js"
1313
],
1414
"scripts": {
15-
"build": "npx snowpack build",
15+
"build": "npx snowpack && npx snowpack build",
1616
"format": "npx prettier --write ./core_modules"
1717
},
1818
"devDependencies": {
1919
"prettier": "2.1.1",
20-
"snowpack": "2.8.0"
20+
"snowpack": "2.12.1"
2121
},
2222
"dependencies": {
2323
"fast-json-patch": "^3.0.0-1",

idom/client/manage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def build(config_items: Iterable[ConfigItem] = ()) -> None:
9090

9191
shutil.copytree(temp_build_dir, BUILD_DIR, symlinks=True)
9292

93+
print(BUILD_DIR.exists())
94+
9395
config.save()
9496

9597

idom/client/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ def open_modifiable_json(path: Path) -> Iterator[Any]:
1616
json.dump(data, f)
1717

1818

19-
_JS_MODULE_EXPORT_PATTERN = re.compile(r";export{([0-9a-zA-Z_$\ ,]*)};")
20-
_JS_VARIABLE = r"[a-zA-Z_$][0-9a-zA-Z_$]*"
21-
_JS_MODULE_EXPORT_NAME_PATTERN = re.compile(f";export ({_JS_VARIABLE}) {_JS_VARIABLE};")
19+
_JS_MODULE_EXPORT_PATTERN = re.compile(r";?export *{([0-9a-zA-Z_$\ ,]*)} *;")
20+
_JS_VAR = r"[a-zA-Z_$][0-9a-zA-Z_$]*"
21+
_JS_MODULE_EXPORT_NAME_PATTERN = re.compile(f";?export *({_JS_VAR}) +{_JS_VAR} *;")
2222

2323

2424
def find_js_module_exports_in_source(content: str) -> List[str]:
2525
names: List[str] = []
2626
for match in _JS_MODULE_EXPORT_PATTERN.findall(content):
2727
for export in match.split(","):
2828
export_parts = export.split(" as ", 1)
29-
names.append(export_parts[1].strip())
29+
names.append(export_parts[-1].strip())
3030
names.extend(_JS_MODULE_EXPORT_NAME_PATTERN.findall(content))
3131
return names

tests/test_core/test_hooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,17 @@ def TestElement():
214214
client_r_1_button.click()
215215

216216
driver_wait.until(lambda d: event_count.current == 1)
217-
assert render_count.current == 1
217+
driver_wait.until(lambda d: render_count.current == 1)
218218

219219
client_r_2_button.click()
220220

221221
driver_wait.until(lambda d: event_count.current == 2)
222-
assert render_count.current == 2
222+
driver_wait.until(lambda d: render_count.current == 2)
223223

224224
client_r_2_button.click()
225225

226226
driver_wait.until(lambda d: event_count.current == 3)
227-
assert render_count.current == 2
227+
driver_wait.until(lambda d: render_count.current == 2)
228228

229229

230230
def test_simple_input_with_use_state(driver, display):

0 commit comments

Comments
 (0)