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,35 +1,35 @@
1
1
 
2
2
  # Pages
3
- cl import from react { useEffect }
4
3
  cl import from ".components/Button.tsx" { Button }
5
4
 
6
5
  cl {
7
- def app() -> any {
6
+ def app() -> any {
8
7
  has count: int = 0;
9
- useEffect(lambda -> None{ console.log("Count: ", count);} , [count]);
10
- return <div
11
- style={{padding: "2rem", fontFamily: "Arial, sans-serif"}}
12
- >
13
- <h1>
14
- Hello, World!
15
- </h1>
16
- <p>
17
- Count: {count}
18
- </p>
19
- <div
20
- style={{display: "flex", gap: "1rem", marginTop: "1rem"}}
21
- >
22
- <Button
23
- label="Increment"
24
- onClick={lambda -> None{ count = count + 1;} }
25
- variant="primary"
26
- />
27
- <Button
28
- label="Reset"
29
- onClick={lambda -> None{ count = 0;} }
30
- variant="secondary"
31
- />
32
- </div>
33
- </div>;
8
+
9
+ can with count entry {
10
+ console.log("Count: ", count);
11
+ }
12
+
13
+ return
14
+ <div style={{padding: "2rem", fontFamily: "Arial, sans-serif"}}>
15
+ <h1>
16
+ Hello, World!
17
+ </h1>
18
+ <p>
19
+ Count: {count}
20
+ </p>
21
+ <div style={{display: "flex", gap: "1rem", marginTop: "1rem"}}>
22
+ <Button
23
+ label="Increment"
24
+ onClick={lambda -> None { count = count + 1;}}
25
+ variant="primary"
26
+ />
27
+ <Button
28
+ label="Reset"
29
+ onClick={lambda -> None { count = 0;}}
30
+ variant="secondary"
31
+ />
32
+ </div>
33
+ </div>;
34
34
  }
35
35
  }
@@ -1,9 +1,11 @@
1
1
  """Test create-jac-app command."""
2
2
 
3
+ import contextlib
3
4
  import os
4
5
  import tempfile
5
6
  import tomllib
6
7
  from subprocess import PIPE, Popen, run
8
+ from unittest.mock import patch
7
9
 
8
10
 
9
11
  def test_create_jac_app() -> None:
@@ -353,12 +355,9 @@ def test_create_jac_app_installs_default_packages() -> None:
353
355
  project_path = os.path.join(temp_dir, test_project_name)
354
356
  assert os.path.exists(project_path)
355
357
 
356
- # Verify that installation was attempted (message should be in output)
357
- # Handles both old and new console formats
358
- assert (
359
- "Installing default npm packages" in stdout
360
- or "Installing npm packages" in stdout
361
- )
358
+ # Verify that package.json was generated - this confirms the setup worked
359
+ # Note: Package installation output may go to stderr or use rich formatting
360
+ # that doesn't capture cleanly in subprocess output
362
361
 
363
362
  # Verify package.json was generated (even if npm install failed)
364
363
  package_json_path = os.path.join(
@@ -923,3 +922,69 @@ def test_create_cl_and_run_no_root_files() -> None:
923
922
 
924
923
  finally:
925
924
  os.chdir(original_cwd)
925
+
926
+
927
+ def test_vite_build_prompts_for_missing_client_deps() -> None:
928
+ """Test that ViteBundler.build() prompts to install deps when jac.toml is missing.
929
+
930
+ Exercises the same code path as `jac start` → server.start() → ensure_bundle()
931
+ → ViteBundler.build(), which checks for npm deps before building.
932
+ """
933
+ import json
934
+ from pathlib import Path
935
+
936
+ from jac_client.plugin.src.vite_bundler import ViteBundler
937
+
938
+ with tempfile.TemporaryDirectory() as temp_dir:
939
+ project_dir = Path(temp_dir)
940
+ config_file = project_dir / "jac.toml"
941
+
942
+ # No jac.toml — ViteBundler.build() should prompt via ensure_client_deps
943
+ bundler = ViteBundler(project_dir)
944
+
945
+ # Mock input to accept, and mock bun/vite so we don't need real installs.
946
+ # We only care that ensure_client_deps wrote jac.toml before reaching bun.
947
+ with (
948
+ patch("builtins.input", return_value="Y"),
949
+ patch(
950
+ "jac_client.plugin.utils.bun_installer.ensure_bun_available",
951
+ return_value=True,
952
+ ),
953
+ patch("subprocess.run") as mock_subprocess,
954
+ ):
955
+ # bun install returns success, vite build returns failure
956
+ # (we don't have real vite — that's fine, we're testing the dep prompt)
957
+ mock_subprocess.side_effect = [
958
+ type("Result", (), {"returncode": 0})(), # bun install
959
+ type("Result", (), {"returncode": 1})(), # vite build
960
+ ]
961
+ with contextlib.suppress(Exception):
962
+ bundler.build() # vite build failure is expected
963
+
964
+ # The key assertion: jac.toml was created with default client deps
965
+ assert config_file.exists(), (
966
+ "jac.toml should have been created after accepting the prompt"
967
+ )
968
+
969
+ with open(config_file, "rb") as f:
970
+ data = tomllib.load(f)
971
+
972
+ npm_deps = data.get("dependencies", {}).get("npm", {})
973
+ assert "react" in npm_deps, "react should be in dependencies.npm"
974
+ assert "react-dom" in npm_deps, "react-dom should be in dependencies.npm"
975
+
976
+ npm_dev = npm_deps.get("dev", {})
977
+ assert "vite" in npm_dev, "vite should be in dev dependencies"
978
+ assert "@vitejs/plugin-react" in npm_dev, (
979
+ "@vitejs/plugin-react should be in dev deps"
980
+ )
981
+
982
+ # Verify the generated package.json also picked up the deps
983
+ package_json = project_dir / ".jac" / "client" / "configs" / "package.json"
984
+ assert package_json.exists(), "package.json should have been generated"
985
+
986
+ with open(package_json) as f:
987
+ pkg = json.load(f)
988
+
989
+ assert pkg["dependencies"].get("react"), "package.json should have react"
990
+ assert pkg["devDependencies"].get("vite"), "package.json should have vite"
@@ -26,29 +26,22 @@ def get_jac_command() -> list[str]:
26
26
  return [sys.executable, "-m", "jaclang"]
27
27
 
28
28
 
29
- def get_env_with_npm() -> dict[str, str]:
30
- """Get environment dict with npm in PATH."""
29
+ def get_env_with_bun() -> dict[str, str]:
30
+ """Get environment dict with bun in PATH."""
31
31
  env = os.environ.copy()
32
- npm_path = shutil.which("npm")
33
- if npm_path:
34
- npm_dir = str(Path(npm_path).parent)
32
+ bun_path = shutil.which("bun")
33
+ if bun_path:
34
+ bun_dir = str(Path(bun_path).parent)
35
35
  current_path = env.get("PATH", "")
36
- if npm_dir not in current_path:
37
- env["PATH"] = f"{npm_dir}:{current_path}"
38
- # Also check common nvm locations
39
- nvm_dir = os.environ.get("NVM_DIR", os.path.expanduser("~/.nvm"))
40
- nvm_node_bin = Path(nvm_dir) / "versions" / "node"
41
- if nvm_node_bin.exists():
42
- for version_dir in nvm_node_bin.iterdir():
43
- bin_dir = version_dir / "bin"
44
- if bin_dir.exists() and (bin_dir / "npm").exists():
45
- current_path = env.get("PATH", "")
46
- if str(bin_dir) not in current_path:
47
- env["PATH"] = f"{bin_dir}:{current_path}"
48
- break
36
+ if bun_dir not in current_path:
37
+ env["PATH"] = f"{bun_dir}:{current_path}"
49
38
  return env
50
39
 
51
40
 
41
+ # Backward compatibility alias
42
+ get_env_with_npm = get_env_with_bun
43
+
44
+
52
45
  def wait_for_port(host: str, port: int, timeout: float = 60.0) -> None:
53
46
  """Block until a TCP port is accepting connections or timeout."""
54
47
  import time
@@ -16,7 +16,7 @@ from urllib.request import Request, urlopen
16
16
  import pytest
17
17
 
18
18
  from .test_helpers import (
19
- get_env_with_npm,
19
+ get_env_with_npm, # Backward compat alias
20
20
  get_free_port,
21
21
  get_jac_command,
22
22
  wait_for_port,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jac-client
3
- Version: 0.2.10
3
+ Version: 0.2.12
4
4
  Summary: Build full-stack web applications with Jac - one language for frontend and backend.
5
5
  Author-email: Jason Mars <jason@mars.ninja>
6
6
  Maintainer-email: Jason Mars <jason@mars.ninja>
@@ -11,7 +11,7 @@ Project-URL: Documentation, https://jac-lang.org
11
11
  Keywords: jac,jaclang,jaseci,frontend,full-stack,web-development
12
12
  Requires-Python: >=3.12
13
13
  Description-Content-Type: text/markdown
14
- Requires-Dist: jaclang>=0.9.10
14
+ Requires-Dist: jaclang>=0.9.12
15
15
  Provides-Extra: dev
16
16
  Requires-Dist: python-dotenv==1.0.1; extra == "dev"
17
17
  Requires-Dist: pytest==8.3.5; extra == "dev"
@@ -56,7 +56,7 @@ Visit `http://localhost:8000` to see your app! (The `app` component is served at
56
56
 
57
57
  You can also access the app at `http://localhost:8000/cl/app`.
58
58
 
59
- > **Note**: The `--npm` flag creates a client-side project with an organized folder structure. Without `--npm`, `jac create` creates a standard Jac project.
59
+ > **Note**: The `--use client` flag creates a client-side project with an organized folder structure. Without it, `jac create` creates a standard Jac project.
60
60
 
61
61
  ---
62
62
 
@@ -113,7 +113,7 @@ cl {
113
113
  ```jac
114
114
  # useState is auto-injected, only import useEffect
115
115
  cl import from react { useEffect }
116
- cl import from '@jac-client/utils' { jacSpawn }
116
+ cl import from '@jac/runtime' { jacSpawn }
117
117
 
118
118
  # Backend: Jac nodes and walkers
119
119
  node Todo {
@@ -164,7 +164,7 @@ cl {
164
164
  ## Requirements
165
165
 
166
166
  - Python: 3.12+
167
- - Node.js: For npm and Vite
167
+ - Bun: For package management and Vite bundling ([install](https://bun.sh))
168
168
  - Jac Language: `jaclang` (installed automatically)
169
169
 
170
170
  ---
@@ -0,0 +1,115 @@
1
+ jac_client/examples/all-in-one/button.jac,sha256=KzMM8B8kjPMZmNXImmi8QwNSKhNLBP38kLmX_NQyz20,142
2
+ jac_client/examples/all-in-one/main.jac,sha256=y-LmSXHDqhzVlRbjD_MIS5RkKoKUB1EPQHtY08PT3UE,17829
3
+ jac_client/examples/all-in-one/assets/workers/worker.py,sha256=erXICb1WvDKYlReUIzgZf9v0Pey6pmWDbvAm9vtGQmg,131
4
+ jac_client/examples/all-in-one/components/CategoryFilter.jac,sha256=YQh1OqqZf89lZxKOKum-fK8ep5h8itNcQC0rbaAlMl4,1838
5
+ jac_client/examples/all-in-one/components/Header.jac,sha256=NYRnyQKo8NyVFNfAjpEQkBe-Qc9nwHZy9cXGV24nKUI,503
6
+ jac_client/examples/all-in-one/components/ProfitOverview.jac,sha256=zF-chUWBK_6pjTuVpzgv76-1Y3cBE7L9tSx8HyIbtGI,2532
7
+ jac_client/examples/all-in-one/components/Summary.jac,sha256=ZKH9JzSpShgjVyyWeCnQDVLrSYYkqo0h3fsGBpothFA,3015
8
+ jac_client/examples/all-in-one/components/TransactionForm.jac,sha256=g7tbmUSX5gw2hobhTvMhCAshC4YbIyJ6yTs937iuPsc,7553
9
+ jac_client/examples/all-in-one/components/TransactionItem.jac,sha256=OJmdWgYTOa8SsBIfUEEdUWkFRWQT_Cfczdm8O8f-vDY,2133
10
+ jac_client/examples/all-in-one/components/TransactionList.jac,sha256=rBm0o3zn7VYfPmRwZVdluwkQCfikBlTYGzEd-qBg9-M,1560
11
+ jac_client/examples/all-in-one/components/button.jac,sha256=uev3QkRyZSe1iBIc0RC-8evbMrStAbTJHP0_4h4R1Mg,140
12
+ jac_client/examples/all-in-one/components/navigation.jac,sha256=jLRToiqtiQXuDxGm9FlBT6O1bJQCts0orypcTFfiaVA,4256
13
+ jac_client/examples/all-in-one/constants/categories.jac,sha256=5HrX2JN4OhcQpoJg6ylcE1lzuWaSIaJAn8Ebo9DeYzo,1092
14
+ jac_client/examples/all-in-one/constants/clients.jac,sha256=8M4AhooSTsxEeC2QTn6UwrNHkLitXUWczCaOwQxrbtw,316
15
+ jac_client/examples/all-in-one/context/BudgetContext.jac,sha256=YnAGc60OcKxPYZ2WdKz_0VVf_Lf6z_x3XYql5xFSLYk,890
16
+ jac_client/examples/all-in-one/hooks/useBudget.jac,sha256=TmidLwmJUhX_mqD0gKSAXfikwkCKXOfhm9P96LpHbqM,4026
17
+ jac_client/examples/all-in-one/hooks/useLocalStorage.jac,sha256=3DElBqJvpQhbZNyAfScuZGOXhZM73YPqqF5NzPrvNWo,1196
18
+ jac_client/examples/all-in-one/pages/BudgetPlanner.jac,sha256=uHil0s-7otuj7Sn7cobwhWMOMRrMCssbFVD-PPQew2E,3742
19
+ jac_client/examples/all-in-one/pages/FeaturesTest.jac,sha256=E2jIt5ivBJSDbhEUzw2_JVywLyWx0bnNO5SB5qyW4n8,4333
20
+ jac_client/examples/all-in-one/pages/LandingPage.jac,sha256=KUvow59dbolydimTkX9Ibr6lWPMyE27IbH-zJIUO93o,5428
21
+ jac_client/examples/all-in-one/pages/budget_planner_ui.cl.jac,sha256=M-h2IkjhP357WpYUWRgrvRSHK5tjZe4RYeogw3LKK-o,2250
22
+ jac_client/examples/all-in-one/pages/features_test_ui.cl.jac,sha256=RM7Re1XPpS5fjlmU5aXL-AFaBr77_CcJ1K-C1oFmv7s,26109
23
+ jac_client/examples/all-in-one/pages/loginPage.jac,sha256=PBrMTbt3e379nduOEfXGaIpYibXRAivDrxZXubtkaXE,4499
24
+ jac_client/examples/all-in-one/pages/nestedDemo.jac,sha256=NJoBLDajJFLSH7h8KQeaWEq66ARgl7Xnj6dCsWIsRGM,1686
25
+ jac_client/examples/all-in-one/pages/notFound.jac,sha256=urlwejdhGu4Gf8JyBNyeS7io-htduvEKdJSZjmKVg58,506
26
+ jac_client/examples/all-in-one/pages/signupPage.jac,sha256=8gLRXQo1gW_RjPAsydimTrQ9vB8VpqzXP-i_wUrEcqY,4548
27
+ jac_client/examples/all-in-one/utils/formatters.jac,sha256=QfOdGgFf2PWcg6ALbHKk5bAO0P4zqBLoM_2nJltCXGY,1544
28
+ jac_client/examples/asset-serving/css-with-image/main.jac,sha256=eSYYyyY7S5BcioeVtEoGKTOAINAck2oycOEKD3kq_3E,3140
29
+ jac_client/examples/asset-serving/image-asset/main.jac,sha256=r4FgBiO_Tg4MRxvXVbbpmrY8x_tqr9YUtYcPgNJmQI4,1764
30
+ jac_client/examples/asset-serving/import-alias/main.jac,sha256=1Fhj0Fd8GAj9Zikaq0grKoVxK2y4h7cJFAlmea5o9qQ,3747
31
+ jac_client/examples/basic/main.jac,sha256=piEnf6T9u4w3AyfyrwslN0o6mGIPG0_dg5BRtP3il5c,502
32
+ jac_client/examples/basic-auth/main.jac,sha256=lS7TGAJj6-LuE4nDmSCfKdFrafUIT6AkVXh1AKRRxiw,14764
33
+ jac_client/examples/basic-auth-with-router/main.jac,sha256=evtDtFA53891q3c9mODp6z6_L_AK3fW5ZiO-KDLMNSQ,15726
34
+ jac_client/examples/basic-full-stack/main.jac,sha256=h2Md3ZGfk8O6i6SWxf1Lq7SpzfT1ynFMY_Foh8wxzkQ,14434
35
+ jac_client/examples/css-styling/js-styling/main.jac,sha256=hoWL1rTXq7FxAY6yYv7ob2KZiautAYomzCUgFrPSUqE,2152
36
+ jac_client/examples/css-styling/material-ui/main.jac,sha256=4aZ5j0CwDNcyQBhGkHK0HwsyhXLUg_9VR8qml6cuyA0,5071
37
+ jac_client/examples/css-styling/pure-css/main.jac,sha256=xI-oOc5z_bp_3CE9O2RPRlciV0g1wNoJp6daZTtVlU4,1891
38
+ jac_client/examples/css-styling/sass-example/main.jac,sha256=noKz56C4rD5hXYMF5ophRt1_VFr1TKnmphoYBsDv2kY,1892
39
+ jac_client/examples/css-styling/styled-components/main.jac,sha256=NE_d81abTkiDudyhXj8IpME2xNfeP_hmmInCvrmy7cE,1776
40
+ jac_client/examples/css-styling/tailwind-example/main.jac,sha256=tpQOZTfkWYDH4SvdfRqoXdIICD2O8Y3eGoYYLHi9XgM,3291
41
+ jac_client/examples/full-stack-with-auth/main.jac,sha256=16n-w20Uf3R2RsD5WLPxjKPWXPQNjOKQyPTROT8D83Y,22978
42
+ jac_client/examples/little-x/main.jac,sha256=XQiFsuzMYPIr3nky0pDtesylDzMjoA7gokVLI1eDZEA,19704
43
+ jac_client/examples/little-x/src/submit-button.jac,sha256=2FUBiTkZwvZpPQA1YFcjtso4bpvLniit35vliT5rrXY,430
44
+ jac_client/examples/nested-folders/nested-advance/main.jac,sha256=EvkJeEkCX2lGTSC_VlD6I7He5IwZe4aoyCa6opb5P_M,775
45
+ jac_client/examples/nested-folders/nested-advance/src/ButtonRoot.jac,sha256=MhNU_hQgksEdz6QMPf9T58KmG2H2Hiy4U8bIbWFc7vo,190
46
+ jac_client/examples/nested-folders/nested-advance/src/level1/ButtonSecondL.jac,sha256=W85gvda3tysc6O-tZuDv_TeQczAnNSa1FVuOVJ6dAqQ,407
47
+ jac_client/examples/nested-folders/nested-advance/src/level1/Card.jac,sha256=GWsVPHPpF5gxlkhB4rSPOxaLRT-usEjs0ELoHVvKL9g,1076
48
+ jac_client/examples/nested-folders/nested-advance/src/level1/level2/ButtonThirdL.jac,sha256=SRTEvSY5N5bbK_wlk0xawNzdF1XCmokvitUdkKEJuNY,576
49
+ jac_client/examples/nested-folders/nested-basic/main.jac,sha256=fV3UymEAORR_1RsU5z2JeNZ4yFr7B9MmlolQ2MhpIgw,298
50
+ jac_client/examples/nested-folders/nested-basic/src/button.jac,sha256=BUaKr2Pm6RsgQCRVTZXojMfY8HoIB4S3YiItEpjoxCs,139
51
+ jac_client/examples/nested-folders/nested-basic/src/components/button.jac,sha256=mvAbsu5Q6DQY4Jfo375k3dBm0rMmKAk6E-o3m5-YmNc,135
52
+ jac_client/examples/ts-support/main.jac,sha256=KcNOi0fZj7tBhWJvusbZ_q3z0cHjlYYfDd_0Mjf6E-k,983
53
+ jac_client/examples/with-router/main.jac,sha256=Aanl3a880KQ-ki8SfskRu8QJRvvm-_pQIvxcfOHB52k,8460
54
+ jac_client/plugin/cli.jac,sha256=JTk5G9aAXLgFsCv_DSLFWrWfV90Rba5XF53gQuATKl0,20114
55
+ jac_client/plugin/client.jac,sha256=WVn8IwQO2Kgr8XLDI8D4FSVj9kdewBXB3Mgi9ifCVTI,2095
56
+ jac_client/plugin/client_runtime.cl.jac,sha256=2CZDu01HZ_wgumNq80I62cjeosD8r_8lEjAuBJmFXeI,1969
57
+ jac_client/plugin/plugin_config.jac,sha256=sijvX5C7-5c2T8VWgbGW6G6IYi1k6AP_bdbagfd9jNc,13308
58
+ jac_client/plugin/vite_client_bundle.jac,sha256=l8EY8O2sdsqhtO8I32Of01dgShRQBfMBNWXyl-y-vtY,1016
59
+ jac_client/plugin/impl/client.impl.jac,sha256=UOmY3Pzi00Cvqdze_BnoIX1QS5_QWEPDQATNp5VDh4k,8956
60
+ jac_client/plugin/impl/client_runtime.impl.jac,sha256=-BGeqJsHkYTcZ80fWbkSLb9Q8EEmXOXIFEoPbwQk_q4,10681
61
+ jac_client/plugin/impl/vite_client_bundle.impl.jac,sha256=KXFqXSZaa08Z6CrEqebfdjo7TvdakTNJHVnGOhj4e0s,2620
62
+ jac_client/plugin/src/__init__.jac,sha256=pdkHciVYLG1UnE-Pez1X4SULUG2ACMYrUYwWq-CZ3Sw,727
63
+ jac_client/plugin/src/asset_processor.jac,sha256=Qpm1a174PPJl32nH_eDZYR-6vx59V2NEWfj0knUMwXY,961
64
+ jac_client/plugin/src/compiler.jac,sha256=Gt6b9yJ9M93lhLqwhz1iJiWKJ-HGuSYAPvEf5V7hQfw,2319
65
+ jac_client/plugin/src/config_loader.jac,sha256=-UJsqmaddZZ2dOJuvqjOXBreAU-DdQccqWodGvcLzRE,1302
66
+ jac_client/plugin/src/desktop_config.jac,sha256=bFGW5lnLeUZgjbjd1BMHvf38Qbsb8VZ0YcbUf78LZ1Q,1249
67
+ jac_client/plugin/src/import_processor.jac,sha256=wYg8bD5qHxpvFyXkQxNpqUIV3ei5aMoevA2bWyq9VG8,589
68
+ jac_client/plugin/src/jac_to_js.jac,sha256=U2_v95tdsbw1oMPGPY0HOhDcAsHg3uQIcGWzLmFdWyc,1115
69
+ jac_client/plugin/src/package_installer.jac,sha256=5maePqEe3xIys9Ufn54m423tAr54z-urtXc84Ki3bIY,850
70
+ jac_client/plugin/src/vite_bundler.jac,sha256=7Sx7Mmyg6VAwdzcQ9y7lGWqb_4mI82b5mEK9bff4idM,1969
71
+ jac_client/plugin/src/impl/asset_processor.impl.jac,sha256=-ljWYzKLKyAdfJybr8sjJlYSK57KzueeNvTo_WjAFAY,4256
72
+ jac_client/plugin/src/impl/compiler.impl.jac,sha256=ZJnxbzYUca7aOrb8GA2qLq0U4HrwXgjlt2swpmSuZ54,13519
73
+ jac_client/plugin/src/impl/config_loader.impl.jac,sha256=pTGfdh3g-nQmUiEr6N_mVLqTKpT9-seGv7BpWFtNSxQ,4459
74
+ jac_client/plugin/src/impl/desktop_config.impl.jac,sha256=mitiS3RfHjMstUqPJs2OnB6lFk27GGSrKXCrJK5Sceg,6758
75
+ jac_client/plugin/src/impl/import_processor.impl.jac,sha256=BMkkZXlF-6jbC-r3tuFj8PDFvDZrbfzuhnaw8qraWIQ,1214
76
+ jac_client/plugin/src/impl/jac_to_js.impl.jac,sha256=KHblc0PloMJqsX2DRdp3tyJ0k5d39ArPxBLKXsw7mjA,1692
77
+ jac_client/plugin/src/impl/package_installer.impl.jac,sha256=YbXlzqmrzNtNSyfDcVY3-975Pqbc9H9wxQ1LQxO6ypE,4020
78
+ jac_client/plugin/src/impl/vite_bundler.impl.jac,sha256=DqFgC2vkAw5udxPv1qN3WqOx_KiVLWCjrSibUaSnFhM,29538
79
+ jac_client/plugin/src/targets/desktop_target.jac,sha256=TxDdpActsLAvrOZ_QpeQ1F22PehctAraz3zuo4CZ0Lk,1286
80
+ jac_client/plugin/src/targets/register.jac,sha256=tiHmOKEgOWlYdY5DYko6M0Ktp2kZr7TZFWKq18Tmp24,835
81
+ jac_client/plugin/src/targets/registry.jac,sha256=wl1QJEWAyI7KAfTSjIw3PdxpYgtUCpaj7D0c09jZxFM,2664
82
+ jac_client/plugin/src/targets/web_target.jac,sha256=jstJZEHE0YERW_e5LiHeVZurB9WsuPnm5HMWWdQP3f0,1135
83
+ jac_client/plugin/src/targets/desktop/sidecar/main.py,sha256=PVmHvXg2Gta2UzD1O3H6EzFTWzkYQo3n_08rzCKCWHg,4499
84
+ jac_client/plugin/src/targets/impl/desktop_target.impl.jac,sha256=7a-lem6Qvlghl6MPiT8_YYYw73xExsrgulir8S-t5Ls,83003
85
+ jac_client/plugin/src/targets/impl/registry.impl.jac,sha256=2PUw_cZ9Us6PJRxO9o4aSOwYW_5_VEi6WXbIVS_6fN8,1691
86
+ jac_client/plugin/src/targets/impl/web_target.impl.jac,sha256=fQQ1zahAnvsD4BFr8JrbF52xZxSJL_K3yE0litbJdBg,5110
87
+ jac_client/plugin/utils/__init__.jac,sha256=u_rH9sxR8EgLUsbaNpv0tgYmt5sLlrb41LhPRk0w0g4,166
88
+ jac_client/plugin/utils/bun_installer.jac,sha256=irvOnt2WF6sB_aOH5v6L9Jde-NoP39JDjysXB2V0nv0,473
89
+ jac_client/plugin/utils/client_deps.jac,sha256=BLJ7UaBi2aC-V-Vl4IsfGYfnRI75QtaO1JNYo_ut0UI,569
90
+ jac_client/plugin/utils/impl/bun_installer.impl.jac,sha256=S6yqaxNvQ6HYgSfO7bRu8NiNsYvG8mvK8j4d1_Vf_FM,3483
91
+ jac_client/plugin/utils/impl/client_deps.impl.jac,sha256=u2APi7hYTTCzDuiG2wTlsM4Dfi1QPY9FNO6xAIq_gPw,2774
92
+ jac_client/templates/client.jacpack,sha256=o3aVPZTI1T52gvLHv5bGK0czX8cAx0GgWfMjQP5yA3w,4187
93
+ jac_client/templates/fullstack.jacpack,sha256=qS5vlhHjpInxVFkAD8T0FftqWFVW6hAbexl9LufW0eE,23109
94
+ jac_client/tests/__init__.py,sha256=HSr78dvKyvNmP7bLmAssfYItAn4puFwAe1oWnV8l7pA,36
95
+ jac_client/tests/conftest.py,sha256=PU-eYPagFRXSKeXaGadES3s2LlNjzy5VSsXuUPse8_4,11136
96
+ jac_client/tests/test_cli.py,sha256=EWpvBNgUfKk7RW5TW1wkM8g6WD0vDRsF3B7mFiOdG48,35318
97
+ jac_client/tests/test_e2e.py,sha256=MqMXiUnLl8qwsW-OQFN1GK-5hbCKKzxT2SewmVWEsow,8197
98
+ jac_client/tests/test_helpers.py,sha256=UqXYIl0Vi_8IDJ1efsJh1BcaJPudINfpLojhwDxxtNg,1615
99
+ jac_client/tests/test_it.py,sha256=Wy8VeBLcchXZFDHUBoMEWeU4oUXxDwvWVCnMPvxlnFQ,37825
100
+ jac_client/tests/test_it_desktop.py,sha256=mzaDfFFhmN762FrFH1WEXQh99cq5bS-eZqwmI-ousvM,32143
101
+ jac_client/tests/fixtures/basic-app/app.jac,sha256=sDup4PmtUm93oVOxIz874SSZfMimPv4Qn683iXm43TI,489
102
+ jac_client/tests/fixtures/cl_file/app.cl.jac,sha256=fHJvjKWLhX5uVdZl12mPwcNRgMVFrCz8oY3oMoCWeuM,1157
103
+ jac_client/tests/fixtures/cl_file/app.jac,sha256=GmuOisnyOGfDnQ_-6juBumliLDUt1t9HQtfRpJ8xuqk,277
104
+ jac_client/tests/fixtures/client_app_with_antd/app.jac,sha256=a8cNThrEuaBq6Lv7aa-K8hAzBIDHkiBHwqON1_Gq4D8,575
105
+ jac_client/tests/fixtures/js_import/app.jac,sha256=CAmAJ299KsbJ6BIdGYykBrTDAh-Df_fhOENwNxxAEbw,796
106
+ jac_client/tests/fixtures/relative_import/app.jac,sha256=Su4UVwZeXV32wnKWvrESaLPR30C-kqyKDUrZPyaw5gQ,188
107
+ jac_client/tests/fixtures/relative_import/button.jac,sha256=kCDNaHEcxMEFdezfnecyVc56cnZU_ZnqdBDOB4kCFeE,118
108
+ jac_client/tests/fixtures/spawn_test/app.jac,sha256=cooYrB7xhHMk9xWOZ6MIiY4I6kmodW2v-nyVnd1RR74,3863
109
+ jac_client/tests/fixtures/test_fragments_spread/app.jac,sha256=CMzAz4Ydx_5eAV82-io8sJdy8_xy-mR7YOVc7FcozlU,1277
110
+ jac_client/tests/fixtures/with-ts/app.jac,sha256=1j1IH_4mfgLtgPq2Xc5PrGHBvmLQl6U0ddbb2L5KwuA,981
111
+ jac_client-0.2.12.dist-info/METADATA,sha256=odF-aHda-UyjLXi5xA460DkljU5gE98qB0PdEL1hIds,5552
112
+ jac_client-0.2.12.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
113
+ jac_client-0.2.12.dist-info/entry_points.txt,sha256=fVrlaJKcSa2DK2hcfR6bNaQDB9mszMpZeEa6pitMdt4,154
114
+ jac_client-0.2.12.dist-info/top_level.txt,sha256=u1VEBfiqwRrZEopKraIh-Ym55qSnDZR3Q5xdw2HinhU,11
115
+ jac_client-0.2.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,18 +0,0 @@
1
- """Babel processing for JavaScript transpilation."""
2
- import subprocess;
3
- import from pathlib { Path }
4
- import from jaclang.runtimelib.client_bundle { ClientBundleError }
5
- import from .asset_processor { AssetProcessor }
6
- import from .vite_bundler { ViteBundler }
7
-
8
- """Handles Babel compilation of JavaScript files."""
9
- class BabelProcessor {
10
- def init(self: BabelProcessor, project_dir: Path);
11
- def compile(self: BabelProcessor) -> None;
12
- def copy_assets_after_compile(
13
- self: BabelProcessor,
14
- compiled_dir: Path,
15
- build_dir: Path,
16
- asset_processor: AssetProcessor
17
- ) -> None;
18
- }
@@ -1,89 +0,0 @@
1
- """Copy CSS, assets, and TypeScript files from compiled/ to build/ after Babel compilation."""
2
-
3
- impl BabelProcessor.copy_assets_after_compile(
4
- self: BabelProcessor,
5
- compiled_dir: Path,
6
- build_dir: Path,
7
- asset_processor: AssetProcessor
8
- ) -> None {
9
- asset_processor.copy_assets(compiled_dir, build_dir);
10
- asset_processor.copy_typescript_files(compiled_dir, build_dir);
11
- }
12
-
13
- """Run Babel compilation (npm run compile)."""
14
- impl BabelProcessor.compile(self: BabelProcessor) -> None {
15
- bundler = ViteBundler(self.project_dir);
16
- # Ensure root package.json exists temporarily for npm commands
17
- bundler._ensure_root_package_json();
18
- try {
19
- # Ensure dependencies are installed (check if node_modules exists)
20
- client_dir = bundler._get_client_dir();
21
- node_modules = client_dir / 'node_modules';
22
- if not node_modules.exists() {
23
- # Temporarily copy package.json to .jac/client/ for npm install
24
- build_package_json = client_dir / 'package.json';
25
- configs_package_json = client_dir / 'configs' / 'package.json';
26
- if configs_package_json.exists() and not build_package_json.exists() {
27
- import shutil;
28
- shutil.copy2(configs_package_json, build_package_json);
29
- }
30
- try {
31
- # Install to .jac/client/node_modules
32
- subprocess.run(
33
- ['npm', 'install'],
34
- cwd=client_dir,
35
- check=True,
36
- capture_output=True,
37
- text=True
38
- );
39
- } except subprocess.CalledProcessError as e {
40
- raise ClientBundleError(
41
- f'Failed to install npm dependencies: {e.stderr}'
42
- ) from e ;
43
- } except FileNotFoundError {
44
- raise ClientBundleError(
45
- 'npm command not found. Ensure Node.js and npm are installed.'
46
- ) from None ;
47
- }
48
- }
49
-
50
- # Temporarily copy package.json to .jac/client/ for npm run compile
51
- build_package_json = client_dir / 'package.json';
52
- configs_package_json = client_dir / 'configs' / 'package.json';
53
- if configs_package_json.exists() and not build_package_json.exists() {
54
- import shutil;
55
- shutil.copy2(configs_package_json, build_package_json);
56
- }
57
- command = ['npm', 'run', 'compile'];
58
- result = subprocess.run(
59
- command, cwd=client_dir, capture_output=True, text=True
60
- );
61
- if result.returncode != 0 {
62
- # Show the actual error from npm/babel
63
- error_output = result.stderr or result.stdout or "Unknown error";
64
- raise RuntimeError(f"Client bundle compilation failed:\n{error_output}") ;
65
- }
66
- } finally {
67
- # Clean up temporary package.json in .jac/client/
68
- build_package_json = client_dir / 'package.json';
69
- if build_package_json.exists() {
70
- build_package_json.unlink();
71
- }
72
- # Move package-lock.json to configs/ if it exists
73
- build_package_lock = client_dir / 'package-lock.json';
74
- if build_package_lock.exists() {
75
- configs_package_lock = client_dir / 'configs' / 'package-lock.json';
76
- if configs_package_lock.exists() {
77
- configs_package_lock.unlink();
78
- }
79
- build_package_lock.rename(configs_package_lock);
80
- }
81
- # Always clean up root package.json and move package-lock.json
82
- bundler._cleanup_root_package_files();
83
- }
84
- }
85
-
86
- """Initialize the Babel processor."""
87
- impl BabelProcessor.init(self: BabelProcessor, project_dir: Path) {
88
- self.project_dir = project_dir;
89
- }