@barefootjs/jinja 0.1.0 → 0.18.1
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.
- package/dist/adapter/index.js +1 -1
- package/dist/build.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/python/README.md +43 -0
- package/python/pyproject.toml +1 -0
package/dist/adapter/index.js
CHANGED
|
@@ -18568,7 +18568,7 @@ https://github.com/browserify/crypto-browserify`);
|
|
|
18568
18568
|
|
|
18569
18569
|
// ../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js
|
|
18570
18570
|
var require_typescript = __commonJS((exports, module) => {
|
|
18571
|
-
var __dirname = "/
|
|
18571
|
+
var __dirname = "/home/runner/work/barefootjs/barefootjs/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib", __filename = "/home/runner/work/barefootjs/barefootjs/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js";
|
|
18572
18572
|
/*! *****************************************************************************
|
|
18573
18573
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18574
18574
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
package/dist/build.js
CHANGED
|
@@ -18568,7 +18568,7 @@ https://github.com/browserify/crypto-browserify`);
|
|
|
18568
18568
|
|
|
18569
18569
|
// ../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js
|
|
18570
18570
|
var require_typescript = __commonJS((exports, module) => {
|
|
18571
|
-
var __dirname = "/
|
|
18571
|
+
var __dirname = "/home/runner/work/barefootjs/barefootjs/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib", __filename = "/home/runner/work/barefootjs/barefootjs/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js";
|
|
18572
18572
|
/*! *****************************************************************************
|
|
18573
18573
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18574
18574
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
package/dist/index.js
CHANGED
|
@@ -18568,7 +18568,7 @@ https://github.com/browserify/crypto-browserify`);
|
|
|
18568
18568
|
|
|
18569
18569
|
// ../../node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js
|
|
18570
18570
|
var require_typescript = __commonJS((exports, module) => {
|
|
18571
|
-
var __dirname = "/
|
|
18571
|
+
var __dirname = "/home/runner/work/barefootjs/barefootjs/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib", __filename = "/home/runner/work/barefootjs/barefootjs/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js";
|
|
18572
18572
|
/*! *****************************************************************************
|
|
18573
18573
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18574
18574
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/jinja",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Jinja2 adapter for BarefootJS — compiles IR to .jinja templates and ships the Python BarefootJS rendering runtime; runs under any Python web framework (Flask, etc.)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"directory": "packages/adapter-jinja"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@barefootjs/shared": "0.
|
|
56
|
+
"@barefootjs/shared": "0.18.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@barefootjs/jsx": ">=0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@barefootjs/adapter-tests": "0.1.0",
|
|
63
|
-
"@barefootjs/jsx": "0.
|
|
63
|
+
"@barefootjs/jsx": "0.18.1",
|
|
64
64
|
"typescript": "^5.0.0"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/python/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# barefootjs
|
|
2
|
+
|
|
3
|
+
Python runtime for [BarefootJS](https://barefootjs.dev/) marked templates, targeting [Jinja2](https://jinja.palletsprojects.com/).
|
|
4
|
+
|
|
5
|
+
[BarefootJS](https://github.com/piconic-ai/barefootjs) is a fine-grained reactive TSX compiler: you write components in TSX, and the compiler emits templates for your backend's template engine plus the client-side JS that hydrates them. This package is the server half for Python — it renders the `.jinja` templates produced by the `@barefootjs/jinja` adapter.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install barefootjs
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The only dependency is `jinja2`; everything else is stdlib.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Generated `.jinja` templates call the `BarefootJS` instance as a `bf` object (`{{ bf.scope_attr() }}`, `{{ bf.json(x) }}`, `{{ bf.spread_attrs(bag) }}`):
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from barefootjs import BarefootJS, JinjaBackend
|
|
21
|
+
|
|
22
|
+
backend = JinjaBackend(paths=["templates"])
|
|
23
|
+
bf = BarefootJS(None, {"backend": backend})
|
|
24
|
+
html = backend.render_named("counter", bf, {"count": 0})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Package layout
|
|
28
|
+
|
|
29
|
+
| Module | Role |
|
|
30
|
+
|--------|------|
|
|
31
|
+
| `runtime.py` | the engine-agnostic `bf` object |
|
|
32
|
+
| `evaluator.py` | ParsedExpr evaluator for the `*_eval` helpers |
|
|
33
|
+
| `search_params.py` | `searchParams()` SSR reader |
|
|
34
|
+
| `backend_jinja.py` | the Jinja2 engine backend |
|
|
35
|
+
|
|
36
|
+
## Documentation
|
|
37
|
+
|
|
38
|
+
- [barefootjs.dev](https://barefootjs.dev/) — core documentation
|
|
39
|
+
- [GitHub: piconic-ai/barefootjs](https://github.com/piconic-ai/barefootjs) — monorepo (this package lives at `packages/adapter-jinja/python`)
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
package/python/pyproject.toml
CHANGED
|
@@ -6,6 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
name = "barefootjs"
|
|
7
7
|
dynamic = ["version"]
|
|
8
8
|
description = "Python runtime for the @barefootjs/jinja adapter"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
license = {text = "MIT"}
|
|
10
11
|
requires-python = ">=3.10"
|
|
11
12
|
authors = [{ name = "kobaken", email = "kentafly88@gmail.com" }]
|