jac-client 0.2.14__tar.gz → 0.2.15__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.
Files changed (125) hide show
  1. {jac_client-0.2.14 → jac_client-0.2.15}/PKG-INFO +2 -2
  2. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/test_it.py +247 -0
  3. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client.egg-info/PKG-INFO +2 -2
  4. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client.egg-info/requires.txt +1 -1
  5. {jac_client-0.2.14 → jac_client-0.2.15}/pyproject.toml +2 -2
  6. {jac_client-0.2.14 → jac_client-0.2.15}/README.md +0 -0
  7. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/assets/workers/worker.py +0 -0
  8. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/button.jac +0 -0
  9. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/CategoryFilter.jac +0 -0
  10. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/Header.jac +0 -0
  11. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/ProfitOverview.jac +0 -0
  12. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/Summary.jac +0 -0
  13. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/TransactionForm.jac +0 -0
  14. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/TransactionItem.jac +0 -0
  15. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/TransactionList.jac +0 -0
  16. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/button.jac +0 -0
  17. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/components/navigation.jac +0 -0
  18. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/constants/categories.jac +0 -0
  19. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/constants/clients.jac +0 -0
  20. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/context/BudgetContext.jac +0 -0
  21. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/hooks/useBudget.jac +0 -0
  22. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/hooks/useLocalStorage.jac +0 -0
  23. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/main.jac +0 -0
  24. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/(auth)/index.jac +0 -0
  25. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/(auth)/nested.jac +0 -0
  26. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/(public)/login.jac +0 -0
  27. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/(public)/signup.jac +0 -0
  28. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/[...notFound].jac +0 -0
  29. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/budget.jac +0 -0
  30. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/budget_planner_ui.cl.jac +0 -0
  31. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/features.jac +0 -0
  32. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/features_test_ui.cl.jac +0 -0
  33. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/landing.jac +0 -0
  34. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/pages/layout.jac +0 -0
  35. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/all-in-one/utils/formatters.jac +0 -0
  36. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/asset-serving/css-with-image/main.jac +0 -0
  37. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/asset-serving/image-asset/main.jac +0 -0
  38. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/asset-serving/import-alias/main.jac +0 -0
  39. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/basic/main.jac +0 -0
  40. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/basic-auth/main.jac +0 -0
  41. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/basic-auth-with-router/main.jac +0 -0
  42. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/basic-full-stack/main.jac +0 -0
  43. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/css-styling/js-styling/main.jac +0 -0
  44. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/css-styling/material-ui/main.jac +0 -0
  45. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/css-styling/pure-css/main.jac +0 -0
  46. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/css-styling/sass-example/main.jac +0 -0
  47. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/css-styling/styled-components/main.jac +0 -0
  48. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/css-styling/tailwind-example/main.jac +0 -0
  49. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/full-stack-with-auth/main.jac +0 -0
  50. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/little-x/main.jac +0 -0
  51. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/little-x/src/submit-button.jac +0 -0
  52. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/main.jac +0 -0
  53. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/ButtonRoot.jac +0 -0
  54. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/level1/ButtonSecondL.jac +0 -0
  55. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/level1/Card.jac +0 -0
  56. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-advance/src/level1/level2/ButtonThirdL.jac +0 -0
  57. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-basic/main.jac +0 -0
  58. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-basic/src/button.jac +0 -0
  59. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/nested-folders/nested-basic/src/components/button.jac +0 -0
  60. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/ts-support/main.jac +0 -0
  61. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/examples/with-router/main.jac +0 -0
  62. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/cli.jac +0 -0
  63. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/client.jac +0 -0
  64. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/client_runtime.cl.jac +0 -0
  65. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/impl/client.impl.jac +0 -0
  66. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/impl/client_runtime.impl.jac +0 -0
  67. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/impl/vite_client_bundle.impl.jac +0 -0
  68. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/plugin_config.jac +0 -0
  69. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/__init__.jac +0 -0
  70. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/asset_processor.jac +0 -0
  71. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/compiler.jac +0 -0
  72. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/config_loader.jac +0 -0
  73. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/desktop_config.jac +0 -0
  74. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/asset_processor.impl.jac +0 -0
  75. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/compiler.impl.jac +0 -0
  76. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/config_loader.impl.jac +0 -0
  77. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/desktop_config.impl.jac +0 -0
  78. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/import_processor.impl.jac +0 -0
  79. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/jac_to_js.impl.jac +0 -0
  80. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/package_installer.impl.jac +0 -0
  81. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/route_scanner.impl.jac +0 -0
  82. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/impl/vite_bundler.impl.jac +0 -0
  83. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/import_processor.jac +0 -0
  84. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/jac_to_js.jac +0 -0
  85. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/package_installer.jac +0 -0
  86. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/route_scanner.jac +0 -0
  87. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/desktop/sidecar/main.py +0 -0
  88. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/desktop_target.jac +0 -0
  89. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/impl/desktop_target.impl.jac +0 -0
  90. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/impl/registry.impl.jac +0 -0
  91. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/impl/web_target.impl.jac +0 -0
  92. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/register.jac +0 -0
  93. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/registry.jac +0 -0
  94. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/targets/web_target.jac +0 -0
  95. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/src/vite_bundler.jac +0 -0
  96. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/utils/__init__.jac +0 -0
  97. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/utils/bun_installer.jac +0 -0
  98. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/utils/client_deps.jac +0 -0
  99. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/utils/impl/bun_installer.impl.jac +0 -0
  100. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/utils/impl/client_deps.impl.jac +0 -0
  101. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/plugin/vite_client_bundle.jac +0 -0
  102. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/templates/client.jacpack +0 -0
  103. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/templates/fullstack.jacpack +0 -0
  104. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/__init__.py +0 -0
  105. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/conftest.py +0 -0
  106. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/basic-app/app.jac +0 -0
  107. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/cl_file/app.cl.jac +0 -0
  108. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/cl_file/app.jac +0 -0
  109. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/client_app_with_antd/app.jac +0 -0
  110. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/js_import/app.jac +0 -0
  111. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/relative_import/app.jac +0 -0
  112. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/relative_import/button.jac +0 -0
  113. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/spawn_test/app.jac +0 -0
  114. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/test_fragments_spread/app.jac +0 -0
  115. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/fixtures/with-ts/app.jac +0 -0
  116. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/test_cli.py +0 -0
  117. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/test_desktop_api_url.py +0 -0
  118. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/test_e2e.py +0 -0
  119. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/test_helpers.py +0 -0
  120. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client/tests/test_it_desktop.py +0 -0
  121. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client.egg-info/SOURCES.txt +0 -0
  122. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client.egg-info/dependency_links.txt +0 -0
  123. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client.egg-info/entry_points.txt +0 -0
  124. {jac_client-0.2.14 → jac_client-0.2.15}/jac_client.egg-info/top_level.txt +0 -0
  125. {jac_client-0.2.14 → jac_client-0.2.15}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jac-client
3
- Version: 0.2.14
3
+ Version: 0.2.15
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.14
14
+ Requires-Dist: jaclang>=0.9.15
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"
@@ -976,3 +976,250 @@ def test_configurable_api_base_url_in_bundle() -> None:
976
976
  print(f"[DEBUG] Restoring working directory to {original_cwd}")
977
977
  os.chdir(original_cwd)
978
978
  gc.collect()
979
+
980
+
981
+ def _setup_all_in_one_project(temp_dir: str, app_name: str) -> str:
982
+ """Shared helper: scaffold a jac client app, copy all-in-one into it, install npm deps.
983
+
984
+ Returns the project directory path.
985
+ """
986
+ tests_dir = os.path.dirname(__file__)
987
+ jac_client_root = os.path.dirname(tests_dir)
988
+ all_in_one_path = os.path.join(jac_client_root, "examples", "all-in-one")
989
+
990
+ assert os.path.isdir(all_in_one_path), "all-in-one example directory missing"
991
+
992
+ jac_cmd = get_jac_command()
993
+ env = get_env_with_npm()
994
+
995
+ # Create a new Jac client app
996
+ process = Popen(
997
+ [*jac_cmd, "create", "--use", "client", app_name],
998
+ stdin=PIPE,
999
+ stdout=PIPE,
1000
+ stderr=PIPE,
1001
+ text=True,
1002
+ env=env,
1003
+ )
1004
+ stdout, stderr = process.communicate()
1005
+ if process.returncode != 0 and "unrecognized arguments: --use" in stderr:
1006
+ pytest.fail(
1007
+ "Test failed: installed `jac` CLI does not support `create --use client`."
1008
+ )
1009
+ assert process.returncode == 0, (
1010
+ f"jac create --use client failed\nSTDOUT:\n{stdout}\nSTDERR:\n{stderr}\n"
1011
+ )
1012
+
1013
+ project_path = os.path.join(temp_dir, app_name)
1014
+ assert os.path.isdir(project_path)
1015
+
1016
+ # Copy all-in-one contents (skip build artifacts)
1017
+ for entry in os.listdir(all_in_one_path):
1018
+ src = os.path.join(all_in_one_path, entry)
1019
+ dst = os.path.join(project_path, entry)
1020
+ if entry in {"node_modules", "build", "dist", ".pytest_cache"}:
1021
+ continue
1022
+ if os.path.isdir(src):
1023
+ shutil.copytree(src, dst, dirs_exist_ok=True)
1024
+ else:
1025
+ shutil.copy2(src, dst)
1026
+
1027
+ # Install npm packages
1028
+ jac_add_result = run(
1029
+ [*jac_cmd, "add", "--npm"],
1030
+ cwd=project_path,
1031
+ capture_output=True,
1032
+ text=True,
1033
+ env=env,
1034
+ )
1035
+ if jac_add_result.returncode != 0:
1036
+ pytest.fail(
1037
+ f"jac add --npm failed\nSTDOUT:\n{jac_add_result.stdout}\n"
1038
+ f"STDERR:\n{jac_add_result.stderr}\n"
1039
+ )
1040
+
1041
+ return project_path
1042
+
1043
+
1044
+ def test_profile_config_applies_to_server() -> None:
1045
+ """Verify that ``--profile prod`` loads jac.prod.toml and its settings take effect.
1046
+
1047
+ The prod profile overrides ``[plugins.client.app_meta_data] title``.
1048
+ We start the server with ``--profile prod`` and confirm the HTML ``<title>``
1049
+ reflects the prod value, proving the profile overlay pipeline works end-to-end.
1050
+ """
1051
+ print("[DEBUG] Starting test_profile_config_applies_to_server")
1052
+
1053
+ prod_title = "All-In-One Prod"
1054
+ base_title = "All-In-One"
1055
+ app_name = "e2e-profile-test"
1056
+
1057
+ with tempfile.TemporaryDirectory() as temp_dir:
1058
+ print(f"[DEBUG] Created temporary directory at {temp_dir}")
1059
+ original_cwd = os.getcwd()
1060
+ try:
1061
+ os.chdir(temp_dir)
1062
+
1063
+ project_path = _setup_all_in_one_project(temp_dir, app_name)
1064
+ print(f"[DEBUG] Project set up at {project_path}")
1065
+
1066
+ prod_toml = os.path.join(project_path, "jac.prod.toml")
1067
+ assert os.path.isfile(prod_toml), (
1068
+ "jac.prod.toml should be copied from all-in-one example"
1069
+ )
1070
+
1071
+ server: Popen[bytes] | None = None
1072
+ server_port = get_free_port()
1073
+ jac_cmd = get_jac_command()
1074
+ env = get_env_with_npm()
1075
+ try:
1076
+ print(
1077
+ f"[DEBUG] Starting server with "
1078
+ f"'jac start main.jac -p {server_port} --profile prod'"
1079
+ )
1080
+ server = Popen(
1081
+ [
1082
+ *jac_cmd,
1083
+ "start",
1084
+ "main.jac",
1085
+ "-p",
1086
+ str(server_port),
1087
+ "--profile",
1088
+ "prod",
1089
+ ],
1090
+ cwd=project_path,
1091
+ env=env,
1092
+ )
1093
+
1094
+ print(f"[DEBUG] Waiting for server on 127.0.0.1:{server_port}")
1095
+ wait_for_port("127.0.0.1", server_port, timeout=90.0)
1096
+ print(
1097
+ f"[DEBUG] Server accepting connections on 127.0.0.1:{server_port}"
1098
+ )
1099
+
1100
+ root_bytes = _wait_for_endpoint(
1101
+ f"http://127.0.0.1:{server_port}",
1102
+ timeout=120.0,
1103
+ poll_interval=2.0,
1104
+ request_timeout=30.0,
1105
+ )
1106
+ root_body = root_bytes.decode("utf-8", errors="ignore")
1107
+ print(f"[DEBUG] Root response (truncated):\n{root_body[:500]}")
1108
+ assert "<html" in root_body.lower(), "Root should return HTML"
1109
+
1110
+ assert f"<title>{prod_title}</title>" in root_body, (
1111
+ f"Expected prod title '{prod_title}' in HTML, "
1112
+ f"but found base title instead. "
1113
+ f"This means --profile prod did not load jac.prod.toml correctly.\n"
1114
+ f"HTML (first 500 chars): {root_body[:500]}"
1115
+ )
1116
+ assert f"<title>{base_title}</title>" not in root_body, (
1117
+ "Base title should be overridden by prod profile"
1118
+ )
1119
+ print(
1120
+ f"[DEBUG] Confirmed title='{prod_title}' in HTML "
1121
+ f"- profile config applied successfully"
1122
+ )
1123
+
1124
+ finally:
1125
+ if server is not None:
1126
+ print("[DEBUG] Terminating server process")
1127
+ server.terminate()
1128
+ try:
1129
+ server.wait(timeout=15)
1130
+ except Exception:
1131
+ server.kill()
1132
+ server.wait(timeout=5)
1133
+ time.sleep(1)
1134
+ gc.collect()
1135
+
1136
+ finally:
1137
+ os.chdir(original_cwd)
1138
+ gc.collect()
1139
+
1140
+
1141
+ def test_no_profile_omits_profile_settings() -> None:
1142
+ """Verify that without ``--profile``, prod-only settings are NOT applied.
1143
+
1144
+ Starts the server without any profile flag and confirms the HTML
1145
+ ``<title>`` uses the base config value, not the prod override.
1146
+ This is the control test for ``test_profile_config_applies_to_server``.
1147
+ """
1148
+ print("[DEBUG] Starting test_no_profile_omits_profile_settings")
1149
+
1150
+ prod_title = "All-In-One Prod"
1151
+ base_title = "All-In-One"
1152
+ app_name = "e2e-no-profile-test"
1153
+
1154
+ with tempfile.TemporaryDirectory() as temp_dir:
1155
+ print(f"[DEBUG] Created temporary directory at {temp_dir}")
1156
+ original_cwd = os.getcwd()
1157
+ try:
1158
+ os.chdir(temp_dir)
1159
+
1160
+ project_path = _setup_all_in_one_project(temp_dir, app_name)
1161
+ print(f"[DEBUG] Project set up at {project_path}")
1162
+
1163
+ local_toml = os.path.join(project_path, "jac.local.toml")
1164
+ if os.path.isfile(local_toml):
1165
+ os.remove(local_toml)
1166
+
1167
+ server: Popen[bytes] | None = None
1168
+ server_port = get_free_port()
1169
+ jac_cmd = get_jac_command()
1170
+ env = get_env_with_npm()
1171
+ try:
1172
+ print(
1173
+ f"[DEBUG] Starting server with "
1174
+ f"'jac start main.jac -p {server_port}' (no profile)"
1175
+ )
1176
+ server = Popen(
1177
+ [*jac_cmd, "start", "main.jac", "-p", str(server_port)],
1178
+ cwd=project_path,
1179
+ env=env,
1180
+ )
1181
+
1182
+ print(f"[DEBUG] Waiting for server on 127.0.0.1:{server_port}")
1183
+ wait_for_port("127.0.0.1", server_port, timeout=90.0)
1184
+ print(
1185
+ f"[DEBUG] Server accepting connections on 127.0.0.1:{server_port}"
1186
+ )
1187
+
1188
+ root_bytes = _wait_for_endpoint(
1189
+ f"http://127.0.0.1:{server_port}",
1190
+ timeout=120.0,
1191
+ poll_interval=2.0,
1192
+ request_timeout=30.0,
1193
+ )
1194
+ root_body = root_bytes.decode("utf-8", errors="ignore")
1195
+ assert "<html" in root_body.lower()
1196
+
1197
+ assert f"<title>{base_title}</title>" in root_body, (
1198
+ f"Expected base title '{base_title}' in HTML when no profile is set.\n"
1199
+ f"HTML (first 500 chars): {root_body[:500]}"
1200
+ )
1201
+ assert f"<title>{prod_title}</title>" not in root_body, (
1202
+ f"Prod title '{prod_title}' should NOT appear "
1203
+ f"when no profile is specified. "
1204
+ f"Profile settings are leaking without --profile."
1205
+ )
1206
+ print(
1207
+ f"[DEBUG] Confirmed title='{base_title}' in HTML "
1208
+ f"- profile settings correctly isolated"
1209
+ )
1210
+
1211
+ finally:
1212
+ if server is not None:
1213
+ print("[DEBUG] Terminating server process")
1214
+ server.terminate()
1215
+ try:
1216
+ server.wait(timeout=15)
1217
+ except Exception:
1218
+ server.kill()
1219
+ server.wait(timeout=5)
1220
+ time.sleep(1)
1221
+ gc.collect()
1222
+
1223
+ finally:
1224
+ os.chdir(original_cwd)
1225
+ gc.collect()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jac-client
3
- Version: 0.2.14
3
+ Version: 0.2.15
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.14
14
+ Requires-Dist: jaclang>=0.9.15
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"
@@ -1,4 +1,4 @@
1
- jaclang>=0.9.14
1
+ jaclang>=0.9.15
2
2
 
3
3
  [dev]
4
4
  python-dotenv==1.0.1
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "jac-client"
3
- version = "0.2.14"
3
+ version = "0.2.15"
4
4
  description = "Build full-stack web applications with Jac - one language for frontend and backend."
5
5
  authors = [{name = "Jason Mars", email = "jason@mars.ninja"}]
6
6
  maintainers = [{name = "Jason Mars", email = "jason@mars.ninja"}]
@@ -16,7 +16,7 @@ keywords = [
16
16
  ]
17
17
  requires-python = ">=3.12"
18
18
  dependencies = [
19
- "jaclang>=0.9.14",
19
+ "jaclang>=0.9.15",
20
20
  ]
21
21
 
22
22
  [project.urls]
File without changes
File without changes