jac-client 0.2.6__py3-none-any.whl → 0.2.8__py3-none-any.whl
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.
- jac_client/examples/all-in-one/app.jac +573 -0
- jac_client/examples/all-in-one/components/CategoryFilter.jac +35 -0
- jac_client/examples/all-in-one/components/Header.jac +13 -0
- jac_client/examples/all-in-one/components/ProfitOverview.jac +50 -0
- jac_client/examples/all-in-one/components/Summary.jac +53 -0
- jac_client/examples/all-in-one/components/TransactionForm.jac +158 -0
- jac_client/examples/all-in-one/components/TransactionItem.jac +55 -0
- jac_client/examples/all-in-one/components/TransactionList.jac +37 -0
- jac_client/examples/all-in-one/components/navigation.jac +132 -0
- jac_client/examples/all-in-one/constants/categories.jac +37 -0
- jac_client/examples/all-in-one/constants/clients.jac +13 -0
- jac_client/examples/all-in-one/context/BudgetContext.jac +28 -0
- jac_client/examples/all-in-one/hooks/useBudget.jac +116 -0
- jac_client/examples/all-in-one/hooks/useLocalStorage.jac +36 -0
- jac_client/examples/all-in-one/pages/BudgetPlanner.cl.jac +70 -0
- jac_client/examples/all-in-one/pages/BudgetPlanner.jac +126 -0
- jac_client/examples/all-in-one/pages/FeaturesTest.cl.jac +552 -0
- jac_client/examples/all-in-one/pages/FeaturesTest.jac +126 -0
- jac_client/examples/all-in-one/pages/LandingPage.jac +101 -0
- jac_client/examples/all-in-one/pages/loginPage.jac +132 -0
- jac_client/examples/all-in-one/pages/nestedDemo.jac +61 -0
- jac_client/examples/all-in-one/pages/notFound.jac +24 -0
- jac_client/examples/all-in-one/pages/signupPage.jac +133 -0
- jac_client/examples/all-in-one/utils/formatters.jac +52 -0
- jac_client/examples/asset-serving/css-with-image/src/app.jac +3 -3
- jac_client/examples/asset-serving/image-asset/src/app.jac +3 -3
- jac_client/examples/asset-serving/import-alias/src/app.jac +3 -3
- jac_client/examples/basic/src/app.jac +3 -3
- jac_client/examples/basic-auth/src/app.jac +31 -37
- jac_client/examples/basic-auth-with-router/src/app.jac +16 -16
- jac_client/examples/basic-full-stack/src/app.jac +24 -30
- jac_client/examples/css-styling/js-styling/src/app.jac +5 -5
- jac_client/examples/css-styling/material-ui/src/app.jac +5 -5
- jac_client/examples/css-styling/pure-css/src/app.jac +5 -5
- jac_client/examples/css-styling/sass-example/src/app.jac +5 -5
- jac_client/examples/css-styling/styled-components/src/app.jac +5 -5
- jac_client/examples/css-styling/tailwind-example/src/app.jac +5 -5
- jac_client/examples/full-stack-with-auth/src/app.jac +16 -16
- jac_client/examples/ts-support/src/app.jac +4 -4
- jac_client/examples/with-router/src/app.jac +4 -4
- jac_client/plugin/cli.jac +160 -203
- jac_client/plugin/client.jac +8 -15
- jac_client/plugin/client_runtime.cl.jac +18 -14
- jac_client/plugin/impl/client.impl.jac +85 -26
- jac_client/plugin/impl/client_runtime.impl.jac +27 -9
- jac_client/plugin/plugin_config.jac +11 -11
- jac_client/plugin/src/compiler.jac +2 -1
- jac_client/plugin/src/impl/babel_processor.impl.jac +22 -17
- jac_client/plugin/src/impl/compiler.impl.jac +55 -18
- jac_client/plugin/src/impl/vite_bundler.impl.jac +215 -102
- jac_client/plugin/src/package_installer.jac +1 -1
- jac_client/plugin/src/vite_bundler.jac +9 -1
- jac_client/tests/conftest.py +10 -8
- jac_client/tests/fixtures/spawn_test/app.jac +15 -18
- jac_client/tests/fixtures/with-ts/app.jac +4 -4
- jac_client/tests/test_cli.py +105 -49
- jac_client/tests/test_it.py +297 -82
- {jac_client-0.2.6.dist-info → jac_client-0.2.8.dist-info}/METADATA +16 -7
- jac_client-0.2.8.dist-info/RECORD +97 -0
- jac_client/examples/all-in-one/src/app.jac +0 -841
- jac_client-0.2.6.dist-info/RECORD +0 -74
- /jac_client/examples/all-in-one/{src/button.jac → button.jac} +0 -0
- /jac_client/examples/all-in-one/{src/components → components}/button.jac +0 -0
- {jac_client-0.2.6.dist-info → jac_client-0.2.8.dist-info}/WHEEL +0 -0
- {jac_client-0.2.6.dist-info → jac_client-0.2.8.dist-info}/entry_points.txt +0 -0
- {jac_client-0.2.6.dist-info → jac_client-0.2.8.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Budget Planner Page
|
|
2
|
+
# Main application page with budget tracking features
|
|
3
|
+
|
|
4
|
+
# Local JAC file imports
|
|
5
|
+
cl import from ..context.BudgetContext { useBudgetContext }
|
|
6
|
+
cl import from ..components.Header { Header }
|
|
7
|
+
cl import from ..components.Summary { Summary }
|
|
8
|
+
cl import from ..components.ProfitOverview { ProfitOverview }
|
|
9
|
+
cl import from ..components.TransactionForm { TransactionForm }
|
|
10
|
+
cl import from ..components.TransactionList { TransactionList }
|
|
11
|
+
cl import from ..components.CategoryFilter { CategoryFilter }
|
|
12
|
+
cl import from ..constants.categories { CATEGORY_COLORS }
|
|
13
|
+
|
|
14
|
+
# cl import from "..components.PieChart.tsx" { PieChart }
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
cl def:pub BudgetPlanner() -> any {
|
|
18
|
+
[filter, setFilter] = useState("ALL");
|
|
19
|
+
budget = useBudgetContext();
|
|
20
|
+
|
|
21
|
+
# Filter transactions based on selected category
|
|
22
|
+
filtered = budget["transactions"];
|
|
23
|
+
if filter != "ALL" {
|
|
24
|
+
filtered = filtered.filter(lambda tx: dict -> bool {
|
|
25
|
+
return tx["category"] == filter;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# Sort by date (newest first)
|
|
30
|
+
sorted = filtered.slice().sort(lambda a: dict, b: dict -> int {
|
|
31
|
+
return Reflect.construct(Date, [b["date"]]).getTime() - Reflect.construct(Date, [a["date"]]).getTime();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
# Prepare chart data with colors
|
|
35
|
+
chartData = budget["expensesByCategory"].map(lambda item: dict -> dict {
|
|
36
|
+
return {
|
|
37
|
+
"name": item["name"],
|
|
38
|
+
"value": item["value"],
|
|
39
|
+
"color": CATEGORY_COLORS[item["name"]]
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return <div className="app-container">
|
|
44
|
+
<Header />
|
|
45
|
+
|
|
46
|
+
<main className="main-content">
|
|
47
|
+
<div className="left-panel">
|
|
48
|
+
<Summary />
|
|
49
|
+
<ProfitOverview />
|
|
50
|
+
<TransactionForm />
|
|
51
|
+
<CategoryFilter
|
|
52
|
+
selectedCategory={filter}
|
|
53
|
+
onSelect={setFilter}
|
|
54
|
+
/>
|
|
55
|
+
<TransactionList
|
|
56
|
+
transactions={sorted}
|
|
57
|
+
onDelete={budget["deleteTransaction"]}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div className="right-panel">
|
|
62
|
+
# <PieChart
|
|
63
|
+
# data={chartData}
|
|
64
|
+
# title="Expense Breakdown"
|
|
65
|
+
# colors={CATEGORY_COLORS}
|
|
66
|
+
# />
|
|
67
|
+
</div>
|
|
68
|
+
</main>
|
|
69
|
+
</div>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Features Test Page - Backend Logic
|
|
2
|
+
# This file is intentionally kept empty to demonstrate the separation of concerns
|
|
3
|
+
# where UI logic resides in .cl.jac files and backend walker logic in app.jac
|
|
4
|
+
|
|
5
|
+
# All walker implementations for this feature are in src/app.jac
|
|
6
|
+
# This demonstrates that you can have separate .jac files for different purposes
|
|
7
|
+
# Features Test - Backend Walkers
|
|
8
|
+
# This file demonstrates walker functionality for testing various JAC features
|
|
9
|
+
|
|
10
|
+
import from datetime { datetime, timedelta }
|
|
11
|
+
|
|
12
|
+
# Node definition for storing test data
|
|
13
|
+
node TestData {
|
|
14
|
+
has message: str;
|
|
15
|
+
has count: int = 0;
|
|
16
|
+
has created_at: str = "";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
# Walker: Create test data
|
|
20
|
+
walker create_test_data {
|
|
21
|
+
has message: str;
|
|
22
|
+
|
|
23
|
+
can create with `root entry {
|
|
24
|
+
new_data = here ++> TestData(
|
|
25
|
+
message=self.message,
|
|
26
|
+
count=1,
|
|
27
|
+
created_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
28
|
+
);
|
|
29
|
+
report new_data;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Walker: Read all test data
|
|
34
|
+
walker read_test_data {
|
|
35
|
+
can read with `root entry {
|
|
36
|
+
visit [-->(`?TestData)];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
can report_data with exit {
|
|
40
|
+
report here;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Walker: Update test data
|
|
45
|
+
walker update_test_data {
|
|
46
|
+
has new_message: str;
|
|
47
|
+
|
|
48
|
+
can update with TestData entry {
|
|
49
|
+
here.message = self.new_message;
|
|
50
|
+
here.count = here.count + 1;
|
|
51
|
+
report here;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# Walker: Delete test data
|
|
56
|
+
walker delete_test_data {
|
|
57
|
+
can delete with TestData entry {
|
|
58
|
+
del here;
|
|
59
|
+
report {"status": "deleted"};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# Walker: String manipulation test
|
|
64
|
+
walker test_string_methods {
|
|
65
|
+
has input_text: str;
|
|
66
|
+
|
|
67
|
+
can process with `root entry {
|
|
68
|
+
result = {
|
|
69
|
+
"original": self.input_text,
|
|
70
|
+
"uppercase": self.input_text.upper(),
|
|
71
|
+
"lowercase": self.input_text.lower(),
|
|
72
|
+
"capitalized": self.input_text.capitalize(),
|
|
73
|
+
"reversed": self.input_text[::-1],
|
|
74
|
+
"length": len(self.input_text),
|
|
75
|
+
"words": self.input_text.split(),
|
|
76
|
+
"trimmed": self.input_text.strip(),
|
|
77
|
+
"replaced": self.input_text.replace("test", "demo")
|
|
78
|
+
};
|
|
79
|
+
report result;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
# Walker: Array/List operations test
|
|
84
|
+
walker test_list_operations {
|
|
85
|
+
has numbers: list;
|
|
86
|
+
|
|
87
|
+
can process with `root entry {
|
|
88
|
+
result = {
|
|
89
|
+
"original": self.numbers,
|
|
90
|
+
"sorted": sorted(self.numbers),
|
|
91
|
+
"reversed": list(reversed(self.numbers)),
|
|
92
|
+
"sum": sum(self.numbers),
|
|
93
|
+
"max": max(self.numbers) if len(self.numbers) > 0 else 0,
|
|
94
|
+
"min": min(self.numbers) if len(self.numbers) > 0 else 0,
|
|
95
|
+
"length": len(self.numbers),
|
|
96
|
+
"doubled": [x * 2 for x in self.numbers]
|
|
97
|
+
};
|
|
98
|
+
report result;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Walker: Complex data processing
|
|
103
|
+
walker process_complex_data {
|
|
104
|
+
has items: list;
|
|
105
|
+
|
|
106
|
+
can process with `root entry {
|
|
107
|
+
processed = [];
|
|
108
|
+
for item in self.items {
|
|
109
|
+
processed.append({
|
|
110
|
+
"id": item.get("id", 0),
|
|
111
|
+
"name": item.get("name", "").upper(),
|
|
112
|
+
"value": item.get("value", 0) * 2,
|
|
113
|
+
"processed_at": datetime.now().strftime("%H:%M:%S")
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
result = {
|
|
118
|
+
"original_count": len(self.items),
|
|
119
|
+
"processed_count": len(processed),
|
|
120
|
+
"items": processed,
|
|
121
|
+
"total_value": sum([p["value"] for p in processed])
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
report result;
|
|
125
|
+
}
|
|
126
|
+
}
|