jac-client 0.2.10__py3-none-any.whl → 0.2.12__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.
Files changed (85) hide show
  1. jac_client/examples/all-in-one/button.jac +4 -3
  2. jac_client/examples/all-in-one/components/CategoryFilter.jac +36 -24
  3. jac_client/examples/all-in-one/components/Header.jac +12 -8
  4. jac_client/examples/all-in-one/components/ProfitOverview.jac +49 -35
  5. jac_client/examples/all-in-one/components/Summary.jac +59 -36
  6. jac_client/examples/all-in-one/components/TransactionForm.jac +142 -112
  7. jac_client/examples/all-in-one/components/TransactionItem.jac +37 -30
  8. jac_client/examples/all-in-one/components/TransactionList.jac +33 -26
  9. jac_client/examples/all-in-one/components/button.jac +4 -3
  10. jac_client/examples/all-in-one/components/navigation.jac +111 -117
  11. jac_client/examples/all-in-one/constants/categories.jac +23 -24
  12. jac_client/examples/all-in-one/constants/clients.jac +7 -8
  13. jac_client/examples/all-in-one/context/BudgetContext.jac +9 -6
  14. jac_client/examples/all-in-one/hooks/useBudget.jac +18 -12
  15. jac_client/examples/all-in-one/hooks/useLocalStorage.jac +14 -13
  16. jac_client/examples/all-in-one/main.jac +340 -371
  17. jac_client/examples/all-in-one/pages/BudgetPlanner.jac +19 -12
  18. jac_client/examples/all-in-one/pages/FeaturesTest.jac +31 -15
  19. jac_client/examples/all-in-one/pages/LandingPage.jac +113 -90
  20. jac_client/examples/all-in-one/pages/budget_planner_ui.cl.jac +34 -39
  21. jac_client/examples/all-in-one/pages/features_test_ui.cl.jac +464 -352
  22. jac_client/examples/all-in-one/pages/loginPage.jac +114 -119
  23. jac_client/examples/all-in-one/pages/nestedDemo.jac +43 -50
  24. jac_client/examples/all-in-one/pages/notFound.jac +14 -15
  25. jac_client/examples/all-in-one/pages/signupPage.jac +113 -119
  26. jac_client/examples/all-in-one/utils/formatters.jac +5 -8
  27. jac_client/examples/asset-serving/css-with-image/main.jac +77 -73
  28. jac_client/examples/asset-serving/image-asset/main.jac +47 -46
  29. jac_client/examples/asset-serving/import-alias/main.jac +93 -95
  30. jac_client/examples/basic/main.jac +17 -15
  31. jac_client/examples/basic-auth/main.jac +246 -254
  32. jac_client/examples/basic-auth-with-router/main.jac +272 -285
  33. jac_client/examples/basic-full-stack/main.jac +245 -242
  34. jac_client/examples/css-styling/js-styling/main.jac +41 -62
  35. jac_client/examples/css-styling/material-ui/main.jac +90 -90
  36. jac_client/examples/css-styling/pure-css/main.jac +35 -44
  37. jac_client/examples/css-styling/sass-example/main.jac +35 -44
  38. jac_client/examples/css-styling/styled-components/main.jac +38 -47
  39. jac_client/examples/css-styling/tailwind-example/main.jac +54 -43
  40. jac_client/examples/full-stack-with-auth/main.jac +407 -433
  41. jac_client/examples/little-x/main.jac +306 -344
  42. jac_client/examples/little-x/src/submit-button.jac +15 -14
  43. jac_client/examples/nested-folders/nested-advance/main.jac +18 -27
  44. jac_client/examples/nested-folders/nested-advance/src/ButtonRoot.jac +4 -6
  45. jac_client/examples/nested-folders/nested-advance/src/level1/ButtonSecondL.jac +9 -13
  46. jac_client/examples/nested-folders/nested-advance/src/level1/Card.jac +29 -32
  47. jac_client/examples/nested-folders/nested-advance/src/level1/level2/ButtonThirdL.jac +12 -18
  48. jac_client/examples/nested-folders/nested-basic/main.jac +7 -5
  49. jac_client/examples/nested-folders/nested-basic/src/button.jac +4 -3
  50. jac_client/examples/nested-folders/nested-basic/src/components/button.jac +4 -3
  51. jac_client/examples/ts-support/main.jac +26 -26
  52. jac_client/examples/with-router/main.jac +186 -223
  53. jac_client/plugin/client_runtime.cl.jac +5 -3
  54. jac_client/plugin/impl/client_runtime.impl.jac +1 -1
  55. jac_client/plugin/plugin_config.jac +53 -99
  56. jac_client/plugin/src/__init__.jac +0 -2
  57. jac_client/plugin/src/compiler.jac +0 -1
  58. jac_client/plugin/src/impl/compiler.impl.jac +49 -17
  59. jac_client/plugin/src/impl/jac_to_js.impl.jac +5 -1
  60. jac_client/plugin/src/impl/package_installer.impl.jac +20 -20
  61. jac_client/plugin/src/impl/vite_bundler.impl.jac +146 -84
  62. jac_client/plugin/src/targets/impl/desktop_target.impl.jac +54 -41
  63. jac_client/plugin/utils/__init__.jac +3 -0
  64. jac_client/plugin/utils/bun_installer.jac +16 -0
  65. jac_client/plugin/utils/client_deps.jac +14 -0
  66. jac_client/plugin/utils/impl/bun_installer.impl.jac +99 -0
  67. jac_client/plugin/utils/impl/client_deps.impl.jac +73 -0
  68. jac_client/templates/client.jacpack +0 -4
  69. jac_client/templates/fullstack.jacpack +1 -5
  70. jac_client/tests/conftest.py +56 -41
  71. jac_client/tests/fixtures/spawn_test/app.jac +49 -52
  72. jac_client/tests/fixtures/with-ts/app.jac +27 -27
  73. jac_client/tests/test_cli.py +71 -6
  74. jac_client/tests/test_helpers.py +11 -18
  75. jac_client/tests/test_it.py +1 -1
  76. {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/METADATA +5 -5
  77. jac_client-0.2.12.dist-info/RECORD +115 -0
  78. {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/WHEEL +1 -1
  79. jac_client/plugin/src/babel_processor.jac +0 -18
  80. jac_client/plugin/src/impl/babel_processor.impl.jac +0 -89
  81. jac_client/plugin/utils/impl/node_installer.impl.jac +0 -249
  82. jac_client/plugin/utils/node_installer.jac +0 -41
  83. jac_client-0.2.10.dist-info/RECORD +0 -115
  84. {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/entry_points.txt +0 -0
  85. {jac_client-0.2.10.dist-info → jac_client-0.2.12.dist-info}/top_level.txt +0 -0
@@ -1,132 +1,127 @@
1
- cl import from "@jac-client/utils" {
2
- Link,
3
- useNavigate,
4
- jacLogin
5
- }
1
+ cl import from "@jac/runtime" { Link, useNavigate, jacLogin }
2
+
6
3
  cl {
7
4
  def:pub LoginPage -> any {
8
- has username: str = "";
9
- has password: str = "";
10
- has error: str = "";
11
- navigate = useNavigate();
5
+ has username: str = "",
6
+ password: str = "",
7
+ error: str = "";
12
8
 
13
- async def handleLogin(e: any) -> None {
14
- e.preventDefault();
15
- error = "";
16
- if not username or not password {
17
- error = "Please fill in all fields";
18
- return;
19
- }
20
- success = await jacLogin(username, password);
21
- if success {
22
- navigate("/");
23
- } else {
24
- error = "Invalid credentials";
25
- }
26
- }
9
+ navigate = useNavigate();
27
10
 
28
- def handleUsernameChange(e: any) -> None {
29
- username = e.target.value;
30
- }
11
+ async def handleLogin(e: any) -> None {
12
+ e.preventDefault();
13
+ error = "";
14
+ if not username or not password {
15
+ error = "Please fill in all fields";
16
+ return;
17
+ }
18
+ success = await jacLogin(username, password);
19
+ if success {
20
+ navigate("/");
21
+ } else {
22
+ error = "Invalid credentials";
23
+ }
24
+ }
31
25
 
32
- def handlePasswordChange(e: any) -> None {
33
- password = e.target.value;
34
- }
26
+ def handleUsernameChange(e: any) -> None {
27
+ username = e.target.value;
28
+ }
35
29
 
36
- errorDisplay = None;
37
- if error {
38
- errorDisplay = <div
39
- style={{"color": "#dc2626", "fontSize": "14px", "marginBottom": "12px"}}
40
- >
41
- {error}
42
- </div>;
43
- }
30
+ def handlePasswordChange(e: any) -> None {
31
+ password = e.target.value;
32
+ }
44
33
 
45
- return <div
46
- style={{
47
- "minHeight": "calc(100vh - 56px)",
48
- "display": "flex",
49
- "alignItems": "center",
50
- "justifyContent": "center",
51
- "background": "#f5f5f5"
52
- }}
53
- >
54
- <div
55
- style={{
56
- "background": "#ffffff",
57
- "padding": "32px",
58
- "borderRadius": "8px",
59
- "width": "300px",
60
- "boxShadow": "0 2px 8px rgba(0,0,0,0.1)"
61
- }}
62
- >
63
- <h2
64
- style={{"marginBottom": "24px", "textAlign": "center"}}
34
+ errorDisplay = None;
35
+ if error {
36
+ errorDisplay = <div
37
+ style={{"color": "#dc2626", "fontSize": "14px", "marginBottom": "12px"}}
65
38
  >
66
- Login
67
- </h2>
68
- <form
69
- onSubmit={handleLogin}
39
+ {error}
40
+ </div>;
41
+ }
42
+
43
+ return
44
+ <div
45
+ style={{
46
+ "minHeight": "calc(100vh - 56px)",
47
+ "display": "flex",
48
+ "alignItems": "center",
49
+ "justifyContent": "center",
50
+ "background": "#f5f5f5"
51
+ }}
70
52
  >
71
- <input
72
- type="text"
73
- value={username}
74
- onChange={handleUsernameChange}
75
- placeholder="Username"
76
- style={{
77
- "width": "100%",
78
- "padding": "10px",
79
- "marginBottom": "12px",
80
- "border": "1px solid #ddd",
81
- "borderRadius": "4px",
82
- "boxSizing": "border-box"
83
- }}
84
- />
85
- <input
86
- type="password"
87
- value={password}
88
- onChange={handlePasswordChange}
89
- placeholder="Password"
90
- style={{
91
- "width": "100%",
92
- "padding": "10px",
93
- "marginBottom": "12px",
94
- "border": "1px solid #ddd",
95
- "borderRadius": "4px",
96
- "boxSizing": "border-box"
97
- }}
98
- />
99
- {errorDisplay}
100
- <button
101
- type="submit"
53
+ <div
102
54
  style={{
103
- "width": "100%",
104
- "padding": "10px",
105
- "background": "#3b82f6",
106
- "color": "#ffffff",
107
- "border": "none",
108
- "borderRadius": "4px",
109
- "cursor": "pointer",
110
- "fontWeight": "600"
55
+ "background": "#ffffff",
56
+ "padding": "32px",
57
+ "borderRadius": "8px",
58
+ "width": "300px",
59
+ "boxShadow": "0 2px 8px rgba(0,0,0,0.1)"
111
60
  }}
112
61
  >
113
- Login
114
- </button>
115
- </form>
116
- <p
117
- style={{
118
- "textAlign": "center",
119
- "marginTop": "16px",
120
- "fontSize": "14px"
121
- }}
122
- >
123
- Need an account?
124
- {" "}
125
- <Link to="/signup">
126
- Sign up
127
- </Link>
128
- </p>
129
- </div>
130
- </div>;
131
- }
62
+ <h2 style={{"marginBottom": "24px", "textAlign": "center"}}>
63
+ Login
64
+ </h2>
65
+ <form onSubmit={handleLogin}>
66
+ <input
67
+ type="text"
68
+ value={username}
69
+ onChange={handleUsernameChange}
70
+ placeholder="Username"
71
+ style={{
72
+ "width": "100%",
73
+ "padding": "10px",
74
+ "marginBottom": "12px",
75
+ "border": "1px solid #ddd",
76
+ "borderRadius": "4px",
77
+ "boxSizing": "border-box"
78
+ }}
79
+ />
80
+ <input
81
+ type="password"
82
+ value={password}
83
+ onChange={handlePasswordChange}
84
+ placeholder="Password"
85
+ style={{
86
+ "width": "100%",
87
+ "padding": "10px",
88
+ "marginBottom": "12px",
89
+ "border": "1px solid #ddd",
90
+ "borderRadius": "4px",
91
+ "boxSizing": "border-box"
92
+ }}
93
+ />
94
+ {errorDisplay}
95
+ <button
96
+ type="submit"
97
+ style={{
98
+ "width": "100%",
99
+ "padding": "10px",
100
+ "background": "#3b82f6",
101
+ "color": "#ffffff",
102
+ "border": "none",
103
+ "borderRadius": "4px",
104
+ "cursor": "pointer",
105
+ "fontWeight": "600"
106
+ }}
107
+ >
108
+ Login
109
+ </button>
110
+ </form>
111
+ <p
112
+ style={{
113
+ "textAlign": "center",
114
+ "marginTop": "16px",
115
+ "fontSize": "14px"
116
+ }}
117
+ >
118
+ Need an account?
119
+ {" "}
120
+ <Link to="/signup">
121
+ Sign up
122
+ </Link>
123
+ </p>
124
+ </div>
125
+ </div>;
126
+ }
132
127
  }
@@ -3,59 +3,52 @@ cl import from ..components.nestedDemo.CustomButton.tsx {
3
3
  CustomButton
4
4
  }
5
5
  cl import from ..button { CustomButtonRoot }
6
- cl import from "@jac-client/utils" {
7
-
8
- Navigate,
9
- jacIsLoggedIn
10
- }
11
-
6
+ cl import from "@jac/runtime" { Navigate, jacIsLoggedIn }
12
7
 
13
8
  cl {
14
9
  def:pub NestedImportsDemo -> any {
15
- # Check if user is logged in, redirect if not
16
- if not jacIsLoggedIn() {
17
- return <Navigate to="/login" />;
18
- }
10
+ # Check if user is logged in, redirect if not
11
+ if not jacIsLoggedIn() {
12
+ return
13
+ <Navigate to="/login" />;
14
+ }
19
15
 
20
- return <div
21
- style={{
22
- "padding": "2rem",
23
- "fontFamily": "system-ui, -apple-system, sans-serif"
24
- }}
25
- >
26
- <h1>
27
- 📁 Nested Folder Imports
28
- </h1>
29
- <p>
30
- This page mirrors the
31
- {" "}
32
- <code>
33
- nested-folders/nested-basic
34
- </code>
35
- {" "}
36
- example by importing components from both
37
- {" "}
38
- <code>
39
- components.button
40
- </code>
41
- {" "}
42
- and
43
- {" "}
44
- <code>
45
- button
46
- </code>
47
- </p>
48
- <p
49
- style={{"marginTop": "0.75rem"}}
50
- >
51
- Both buttons below are rendered via relative imports:
52
- </p>
53
- <div
54
- style={{"display": "flex", "gap": "1rem", "marginTop": "1.5rem"}}
55
- >
56
- <CustomButton />
57
- <CustomButtonRoot />
58
- </div>
59
- </div>;
16
+ return
17
+ <div
18
+ style={{
19
+ "padding": "2rem",
20
+ "fontFamily": "system-ui, -apple-system, sans-serif"
21
+ }}
22
+ >
23
+ <h1>
24
+ 📁 Nested Folder Imports
25
+ </h1>
26
+ <p>
27
+ This page mirrors the
28
+ {" "}
29
+ <code>
30
+ nested-folders/nested-basic
31
+ </code>
32
+ {" "}
33
+ example by importing components from both
34
+ {" "}
35
+ <code>
36
+ components.button
37
+ </code>
38
+ {" "}
39
+ and
40
+ {" "}
41
+ <code>
42
+ button
43
+ </code>
44
+ </p>
45
+ <p style={{"marginTop": "0.75rem"}}>
46
+ Both buttons below are rendered via relative imports:
47
+ </p>
48
+ <div style={{"display": "flex", "gap": "1rem", "marginTop": "1.5rem"}}>
49
+ <CustomButton />
50
+ <CustomButtonRoot />
51
+ </div>
52
+ </div>;
60
53
  }
61
54
  }
@@ -1,19 +1,18 @@
1
- cl import from "@jac-client/utils" {
2
- Link
3
- }
1
+ cl import from "@jac/runtime" { Link }
4
2
  cl import "..styles/notFoundPage/NotFoundstyle.css";
5
3
  cl {
6
4
  def:pub NotFound -> any {
7
- return <div className="not-found-container">
8
- <h1>
9
- 🔍 404 - Page Not Found
10
- </h1>
11
- <p>
12
- The page you are looking for does not exist.
13
- </p>
14
- <Link to="/">
15
- Back to Home
16
- </Link>
17
- </div>;
18
- }
5
+ return
6
+ <div className="not-found-container">
7
+ <h1>
8
+ 🔍 404 - Page Not Found
9
+ </h1>
10
+ <p>
11
+ The page you are looking for does not exist.
12
+ </p>
13
+ <Link to="/">
14
+ ← Back to Home
15
+ </Link>
16
+ </div>;
17
+ }
19
18
  }
@@ -1,133 +1,127 @@
1
- cl import from "@jac-client/utils" {
2
- Link,
3
- useNavigate,
4
- jacSignup
5
- }
1
+ cl import from "@jac/runtime" { Link, useNavigate, jacSignup }
6
2
 
7
3
  cl {
8
4
  def:pub SignupPage -> any {
9
- has username: str = "";
10
- has password: str = "";
11
- has error: str = "";
12
- navigate = useNavigate();
5
+ has username: str = "",
6
+ password: str = "",
7
+ error: str = "";
13
8
 
14
- async def handleSignup(e: any) -> None {
15
- e.preventDefault();
16
- error = "";
17
- if not username or not password {
18
- error = "Please fill in all fields";
19
- return;
20
- }
21
- result = await jacSignup(username, password);
22
- if result["success"] {
23
- navigate("/");
24
- } else {
25
- error = result["error"] if result["error"] else "Signup failed";
26
- }
27
- }
9
+ navigate = useNavigate();
28
10
 
29
- def handleUsernameChange(e: any) -> None {
30
- username = e.target.value;
31
- }
11
+ async def handleSignup(e: any) -> None {
12
+ e.preventDefault();
13
+ error = "";
14
+ if not username or not password {
15
+ error = "Please fill in all fields";
16
+ return;
17
+ }
18
+ result = await jacSignup(username, password);
19
+ if result["success"] {
20
+ navigate("/");
21
+ } else {
22
+ error = result["error"] if result["error"] else "Signup failed";
23
+ }
24
+ }
32
25
 
33
- def handlePasswordChange(e: any) -> None {
34
- password = e.target.value;
35
- }
26
+ def handleUsernameChange(e: any) -> None {
27
+ username = e.target.value;
28
+ }
36
29
 
37
- errorDisplay = None;
38
- if error {
39
- errorDisplay = <div
40
- style={{"color": "#dc2626", "fontSize": "14px", "marginBottom": "12px"}}
41
- >
42
- {error}
43
- </div>;
44
- }
30
+ def handlePasswordChange(e: any) -> None {
31
+ password = e.target.value;
32
+ }
45
33
 
46
- return <div
47
- style={{
48
- "minHeight": "calc(100vh - 56px)",
49
- "display": "flex",
50
- "alignItems": "center",
51
- "justifyContent": "center",
52
- "background": "#f5f5f5"
53
- }}
54
- >
55
- <div
56
- style={{
57
- "background": "#ffffff",
58
- "padding": "32px",
59
- "borderRadius": "8px",
60
- "width": "300px",
61
- "boxShadow": "0 2px 8px rgba(0,0,0,0.1)"
62
- }}
63
- >
64
- <h2
65
- style={{"marginBottom": "24px", "textAlign": "center"}}
34
+ errorDisplay = None;
35
+ if error {
36
+ errorDisplay = <div
37
+ style={{"color": "#dc2626", "fontSize": "14px", "marginBottom": "12px"}}
66
38
  >
67
- Sign Up
68
- </h2>
69
- <form
70
- onSubmit={handleSignup}
39
+ {error}
40
+ </div>;
41
+ }
42
+
43
+ return
44
+ <div
45
+ style={{
46
+ "minHeight": "calc(100vh - 56px)",
47
+ "display": "flex",
48
+ "alignItems": "center",
49
+ "justifyContent": "center",
50
+ "background": "#f5f5f5"
51
+ }}
71
52
  >
72
- <input
73
- type="text"
74
- value={username}
75
- onChange={handleUsernameChange}
76
- placeholder="Username"
77
- style={{
78
- "width": "100%",
79
- "padding": "10px",
80
- "marginBottom": "12px",
81
- "border": "1px solid #ddd",
82
- "borderRadius": "4px",
83
- "boxSizing": "border-box"
84
- }}
85
- />
86
- <input
87
- type="password"
88
- value={password}
89
- onChange={handlePasswordChange}
90
- placeholder="Password"
91
- style={{
92
- "width": "100%",
93
- "padding": "10px",
94
- "marginBottom": "12px",
95
- "border": "1px solid #ddd",
96
- "borderRadius": "4px",
97
- "boxSizing": "border-box"
98
- }}
99
- />
100
- {errorDisplay}
101
- <button
102
- type="submit"
53
+ <div
103
54
  style={{
104
- "width": "100%",
105
- "padding": "10px",
106
- "background": "#3b82f6",
107
- "color": "#ffffff",
108
- "border": "none",
109
- "borderRadius": "4px",
110
- "cursor": "pointer",
111
- "fontWeight": "600"
55
+ "background": "#ffffff",
56
+ "padding": "32px",
57
+ "borderRadius": "8px",
58
+ "width": "300px",
59
+ "boxShadow": "0 2px 8px rgba(0,0,0,0.1)"
112
60
  }}
113
61
  >
114
- Sign Up
115
- </button>
116
- </form>
117
- <p
118
- style={{
119
- "textAlign": "center",
120
- "marginTop": "16px",
121
- "fontSize": "14px"
122
- }}
123
- >
124
- Have an account?
125
- {" "}
126
- <Link to="/login">
127
- Login
128
- </Link>
129
- </p>
130
- </div>
131
- </div>;
132
- }
62
+ <h2 style={{"marginBottom": "24px", "textAlign": "center"}}>
63
+ Sign Up
64
+ </h2>
65
+ <form onSubmit={handleSignup}>
66
+ <input
67
+ type="text"
68
+ value={username}
69
+ onChange={handleUsernameChange}
70
+ placeholder="Username"
71
+ style={{
72
+ "width": "100%",
73
+ "padding": "10px",
74
+ "marginBottom": "12px",
75
+ "border": "1px solid #ddd",
76
+ "borderRadius": "4px",
77
+ "boxSizing": "border-box"
78
+ }}
79
+ />
80
+ <input
81
+ type="password"
82
+ value={password}
83
+ onChange={handlePasswordChange}
84
+ placeholder="Password"
85
+ style={{
86
+ "width": "100%",
87
+ "padding": "10px",
88
+ "marginBottom": "12px",
89
+ "border": "1px solid #ddd",
90
+ "borderRadius": "4px",
91
+ "boxSizing": "border-box"
92
+ }}
93
+ />
94
+ {errorDisplay}
95
+ <button
96
+ type="submit"
97
+ style={{
98
+ "width": "100%",
99
+ "padding": "10px",
100
+ "background": "#3b82f6",
101
+ "color": "#ffffff",
102
+ "border": "none",
103
+ "borderRadius": "4px",
104
+ "cursor": "pointer",
105
+ "fontWeight": "600"
106
+ }}
107
+ >
108
+ Sign Up
109
+ </button>
110
+ </form>
111
+ <p
112
+ style={{
113
+ "textAlign": "center",
114
+ "marginTop": "16px",
115
+ "fontSize": "14px"
116
+ }}
117
+ >
118
+ Have an account?
119
+ {" "}
120
+ <Link to="/login">
121
+ Login
122
+ </Link>
123
+ </p>
124
+ </div>
125
+ </div>;
126
+ }
133
127
  }
@@ -1,6 +1,5 @@
1
1
  # Utility functions for formatting
2
2
  # Demonstrates: def:pub exports, string methods
3
-
4
3
  cl {
5
4
  # Format number as currency - demonstrates string methods
6
5
  def:pub formatCurrency(amount: float) -> str {
@@ -12,11 +11,9 @@ cl {
12
11
  # Format ISO date string to readable format
13
12
  def:pub formatDate(dateStr: str) -> str {
14
13
  date = Reflect.construct(Date, [dateStr]);
15
- return date.toLocaleDateString("en-US", {
16
- "month": "short",
17
- "day": "numeric",
18
- "year": "numeric"
19
- });
14
+ return date.toLocaleDateString(
15
+ "en-US", {"month": "short", "day": "numeric", "year": "numeric"}
16
+ );
20
17
  }
21
18
 
22
19
  # Capitalize first letter of string
@@ -39,12 +36,12 @@ cl {
39
36
  def:pub formatCompact(num: float) -> str {
40
37
  if num >= 1000000 {
41
38
  divided = num / 1000000;
42
- rounded = (Math.round(divided * 10) / 10);
39
+ rounded = Math.round(divided * 10) / 10;
43
40
  return (rounded.toString().concat("M"));
44
41
  }
45
42
  if num >= 1000 {
46
43
  divided = num / 1000;
47
- rounded = (Math.round(divided * 10) / 10);
44
+ rounded = Math.round(divided * 10) / 10;
48
45
  return rounded.toString().concat("K");
49
46
  }
50
47
  return Math.round(num).toString();