jx 0.3.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jx-0.3.0/src/jx.egg-info → jx-0.5.0}/PKG-INFO +11 -12
- {jx-0.3.0 → jx-0.5.0}/README.md +8 -9
- {jx-0.3.0 → jx-0.5.0}/pyproject.toml +12 -5
- {jx-0.3.0 → jx-0.5.0}/src/jx/catalog.py +2 -2
- {jx-0.3.0 → jx-0.5.0}/src/jx/parser.py +1 -1
- {jx-0.3.0 → jx-0.5.0/src/jx.egg-info}/PKG-INFO +11 -12
- {jx-0.3.0 → jx-0.5.0}/tests/test_component.py +27 -0
- {jx-0.3.0 → jx-0.5.0}/LICENSE +0 -0
- {jx-0.3.0 → jx-0.5.0}/setup.cfg +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx/__init__.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx/attrs.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx/component.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx/exceptions.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx/meta.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx/utils.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx.egg-info/SOURCES.txt +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx.egg-info/dependency_links.txt +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx.egg-info/requires.txt +0 -0
- {jx-0.3.0 → jx-0.5.0}/src/jx.egg-info/top_level.txt +0 -0
- {jx-0.3.0 → jx-0.5.0}/tests/test_attrs.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/tests/test_catalog.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/tests/test_meta.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/tests/test_parser.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/tests/test_slots.py +0 -0
- {jx-0.3.0 → jx-0.5.0}/tests/test_thread_safety.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jx
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Replace your HTML templates with Python server-Side components
|
|
5
5
|
Author-email: Juan Pablo Scaletti <juanpablo@jpscaletti.com>
|
|
6
|
-
Project-URL:
|
|
7
|
-
Project-URL:
|
|
6
|
+
Project-URL: Code, https://github.com/jpsca/jx
|
|
7
|
+
Project-URL: Documentation, https://jx.scaletti.dev/
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Environment :: Web Environment
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
@@ -24,17 +24,16 @@ License-File: LICENSE
|
|
|
24
24
|
Requires-Dist: jinja2>=3.0
|
|
25
25
|
Dynamic: license-file
|
|
26
26
|
|
|
27
|
-
<
|
|
28
|
-
<img src="
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<p>
|
|
34
|
-
<img alt="python: 3.11, 3.12, 3.13, 3.14" src="./docs/python.svg">
|
|
35
|
-
<img alt="license: MIT" src="./docs/license.svg">
|
|
27
|
+
<div align="center">
|
|
28
|
+
<h1><img alt="Jx" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/assets/images/logo-jx.png" height="100" align="top"></h1>
|
|
29
|
+
</div>
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img alt="python: 3.12, 3.13, 3.14" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/python.svg">
|
|
32
|
+
<img alt="license: MIT" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/license.svg">
|
|
36
33
|
</p>
|
|
37
34
|
|
|
35
|
+
### Python server-side components
|
|
36
|
+
|
|
38
37
|
From chaos to clarity: The power of components in your server-side-rendered Python web app.
|
|
39
38
|
|
|
40
39
|
<!-- Documentation: https://jx.scaletti.dev/ -->
|
{jx-0.3.0 → jx-0.5.0}/README.md
RENAMED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
<
|
|
2
|
-
<img src="
|
|
3
|
-
</
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<p>
|
|
8
|
-
<img alt="python: 3.11, 3.12, 3.13, 3.14" src="./docs/python.svg">
|
|
9
|
-
<img alt="license: MIT" src="./docs/license.svg">
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1><img alt="Jx" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/assets/images/logo-jx.png" height="100" align="top"></h1>
|
|
3
|
+
</div>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<img alt="python: 3.12, 3.13, 3.14" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/python.svg">
|
|
6
|
+
<img alt="license: MIT" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/license.svg">
|
|
10
7
|
</p>
|
|
11
8
|
|
|
9
|
+
### Python server-side components
|
|
10
|
+
|
|
12
11
|
From chaos to clarity: The power of components in your server-side-rendered Python web app.
|
|
13
12
|
|
|
14
13
|
<!-- Documentation: https://jx.scaletti.dev/ -->
|
|
@@ -4,7 +4,7 @@ requires = ["setuptools"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "jx"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.5.0"
|
|
8
8
|
description = "Replace your HTML templates with Python server-Side components"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Juan Pablo Scaletti", email = "juanpablo@jpscaletti.com"},
|
|
@@ -32,8 +32,8 @@ dependencies = [
|
|
|
32
32
|
]
|
|
33
33
|
|
|
34
34
|
[project.urls]
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
Code = "https://github.com/jpsca/jx"
|
|
36
|
+
Documentation = "https://jx.scaletti.dev/"
|
|
37
37
|
|
|
38
38
|
[dependency-groups]
|
|
39
39
|
dev = [
|
|
@@ -55,6 +55,13 @@ test = [
|
|
|
55
55
|
[tool.setuptools.packages.find]
|
|
56
56
|
where = ["src"]
|
|
57
57
|
|
|
58
|
+
|
|
59
|
+
[tool.ty.src]
|
|
60
|
+
exclude = [
|
|
61
|
+
"docs",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
|
|
58
65
|
[tool.coverage.run]
|
|
59
66
|
branch = true
|
|
60
67
|
|
|
@@ -81,9 +88,9 @@ addopts = "--doctest-modules"
|
|
|
81
88
|
legacy_tox_ini = """
|
|
82
89
|
[tox]
|
|
83
90
|
env_list =
|
|
84
|
-
3.14
|
|
85
|
-
3.13
|
|
86
91
|
3.12
|
|
92
|
+
3.13
|
|
93
|
+
3.14
|
|
87
94
|
|
|
88
95
|
[testenv]
|
|
89
96
|
runner = uv-venv-lock-runner
|
|
@@ -232,8 +232,8 @@ class Catalog:
|
|
|
232
232
|
globals = globals or {}
|
|
233
233
|
globals.update({
|
|
234
234
|
"assets": {
|
|
235
|
-
"
|
|
236
|
-
"
|
|
235
|
+
"collect_css": co.collect_css,
|
|
236
|
+
"collect_js": co.collect_js,
|
|
237
237
|
"render_css": co.render_css,
|
|
238
238
|
"render_js": co.render_js,
|
|
239
239
|
"render": co.render_assets,
|
|
@@ -24,7 +24,7 @@ RX_TAG_NAME = re.compile(rf"<(?P<tag>{re_tag_name})(\s|\n|/|>)")
|
|
|
24
24
|
re_attr_name = r""
|
|
25
25
|
re_equal = r""
|
|
26
26
|
re_attr = r"""
|
|
27
|
-
(?P<name>[:a-zA-Z@$_][a-zA-Z@:$_0-9
|
|
27
|
+
(?P<name>[:a-zA-Z@$_][a-zA-Z@:$_0-9-\.]*)
|
|
28
28
|
(?:
|
|
29
29
|
\s*=\s*
|
|
30
30
|
(?P<value>".*?"|'.*?'|\{\{.*?\}\})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jx
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Replace your HTML templates with Python server-Side components
|
|
5
5
|
Author-email: Juan Pablo Scaletti <juanpablo@jpscaletti.com>
|
|
6
|
-
Project-URL:
|
|
7
|
-
Project-URL:
|
|
6
|
+
Project-URL: Code, https://github.com/jpsca/jx
|
|
7
|
+
Project-URL: Documentation, https://jx.scaletti.dev/
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Environment :: Web Environment
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
@@ -24,17 +24,16 @@ License-File: LICENSE
|
|
|
24
24
|
Requires-Dist: jinja2>=3.0
|
|
25
25
|
Dynamic: license-file
|
|
26
26
|
|
|
27
|
-
<
|
|
28
|
-
<img src="
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<p>
|
|
34
|
-
<img alt="python: 3.11, 3.12, 3.13, 3.14" src="./docs/python.svg">
|
|
35
|
-
<img alt="license: MIT" src="./docs/license.svg">
|
|
27
|
+
<div align="center">
|
|
28
|
+
<h1><img alt="Jx" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/assets/images/logo-jx.png" height="100" align="top"></h1>
|
|
29
|
+
</div>
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img alt="python: 3.12, 3.13, 3.14" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/python.svg">
|
|
32
|
+
<img alt="license: MIT" src="https://raw.githubusercontent.com/jpsca/jx/main/docs/license.svg">
|
|
36
33
|
</p>
|
|
37
34
|
|
|
35
|
+
### Python server-side components
|
|
36
|
+
|
|
38
37
|
From chaos to clarity: The power of components in your server-side-rendered Python web app.
|
|
39
38
|
|
|
40
39
|
<!-- Documentation: https://jx.scaletti.dev/ -->
|
|
@@ -473,3 +473,30 @@ AFTER
|
|
|
473
473
|
<link rel="stylesheet" href="before.css">
|
|
474
474
|
BEFORE
|
|
475
475
|
""".strip()
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
def test_alpine_sintax(folder):
|
|
479
|
+
(folder / "greeting.jinja").write_text("""
|
|
480
|
+
{#def message #}
|
|
481
|
+
<button @click.prevent="alert('{{ message }}')">Say Hi</button>""")
|
|
482
|
+
cat = Catalog(folder, auto_reload=False)
|
|
483
|
+
|
|
484
|
+
html = cat.render("greeting.jinja", message="Hello world!")
|
|
485
|
+
print(html)
|
|
486
|
+
assert html == """<button @click.prevent="alert('Hello world!')">Say Hi</button>"""
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
def test_alpine_sintax_in_component(folder):
|
|
490
|
+
(folder / "button.jinja").write_text(
|
|
491
|
+
"""<button {{ attrs.render() }}>{{ content }}</button>"""
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
(folder / "greeting.jinja").write_text("""
|
|
495
|
+
{# import "button.jinja" as Button #}
|
|
496
|
+
<Button @click.prevent="alert('Hello world!')">Say Hi</Button>
|
|
497
|
+
""")
|
|
498
|
+
cat = Catalog(folder, auto_reload=False)
|
|
499
|
+
|
|
500
|
+
html = cat.render("greeting.jinja")
|
|
501
|
+
print(html)
|
|
502
|
+
assert html == """<button @click.prevent="alert('Hello world!')">Say Hi</button>"""
|
{jx-0.3.0 → jx-0.5.0}/LICENSE
RENAMED
|
File without changes
|
{jx-0.3.0 → jx-0.5.0}/setup.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|