pulse-framework 0.1.38a3__py3-none-any.whl → 0.1.38a4__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.
pulse/cli/cmd.py CHANGED
@@ -139,37 +139,54 @@ def run(
139
139
  web_root if web_root.exists() else app_ctx.app_file
140
140
  )
141
141
 
142
- if not server_only:
143
- # Skip dependency checking and installation in production/CI mode (assumes pre-built)
144
- if env.pulse_env == "dev":
142
+ if env.pulse_env == "dev" and not server_only:
143
+ try:
144
+ to_add = check_web_dependencies(
145
+ web_root,
146
+ pulse_version=PULSE_PY_VERSION,
147
+ )
148
+ except DependencyResolutionError as exc:
149
+ console.log(f"❌ {exc}")
150
+ raise typer.Exit(1) from None
151
+ except DependencyError as exc:
152
+ console.log(f"❌ {exc}")
153
+ raise typer.Exit(1) from None
154
+
155
+ if to_add:
145
156
  try:
146
- to_add = check_web_dependencies(
157
+ dep_plan = prepare_web_dependencies(
147
158
  web_root,
148
159
  pulse_version=PULSE_PY_VERSION,
149
160
  )
150
- except DependencyResolutionError as exc:
151
- console.log(f"❌ {exc}")
161
+ if dep_plan:
162
+ _run_dependency_plan(console, web_root, dep_plan)
163
+ except subprocess.CalledProcessError:
164
+ console.log("❌ Failed to install web dependencies with Bun.")
152
165
  raise typer.Exit(1) from None
153
- except DependencyError as exc:
154
- console.log(f"❌ {exc}")
155
- raise typer.Exit(1) from None
156
-
157
- if to_add:
158
- try:
159
- dep_plan = prepare_web_dependencies(
160
- web_root,
161
- pulse_version=PULSE_PY_VERSION,
162
- )
163
- if dep_plan:
164
- _run_dependency_plan(console, web_root, dep_plan)
165
- except subprocess.CalledProcessError:
166
- console.log("❌ Failed to install web dependencies with Bun.")
167
- raise typer.Exit(1) from None
168
166
 
169
167
  server_args = extra_flags if not web_only else []
170
168
  web_args = extra_flags if web_only else []
171
169
 
172
170
  commands: list[CommandSpec] = []
171
+ # Build web command first (when needed) so we can set PULSE_REACT_SERVER_ADDRESS
172
+ # before building the uvicorn command, which needs that env var
173
+ if not server_only:
174
+ if is_single_server:
175
+ web_port = find_available_port(5173)
176
+ commands.append(
177
+ build_web_command(
178
+ web_root=web_root,
179
+ extra_args=web_args,
180
+ port=web_port,
181
+ mode=app_instance.env,
182
+ )
183
+ )
184
+ # Set env var so app can read the React server address
185
+ react_server_address = f"http://localhost:{web_port}"
186
+ os.environ[ENV_PULSE_REACT_SERVER_ADDRESS] = react_server_address
187
+ else:
188
+ commands.append(build_web_command(web_root=web_root, extra_args=web_args))
189
+
173
190
  if not web_only:
174
191
  commands.append(
175
192
  build_uvicorn_command(
@@ -187,23 +204,6 @@ def run(
187
204
  )
188
205
  )
189
206
 
190
- # In single-server mode, start web server separately (not managed by app lifecycle)
191
- if is_single_server and not server_only:
192
- web_port = find_available_port(5173)
193
- commands.append(
194
- build_web_command(
195
- web_root=web_root,
196
- extra_args=web_args,
197
- port=web_port,
198
- mode=app_instance.env,
199
- )
200
- )
201
- # Set env var so app can read the React server address
202
- react_server_address = f"http://localhost:{web_port}"
203
- os.environ[ENV_PULSE_REACT_SERVER_ADDRESS] = react_server_address
204
- elif not is_single_server and not server_only:
205
- commands.append(build_web_command(web_root=web_root, extra_args=web_args))
206
-
207
207
  tag_colors = {"server": "cyan", "web": "orange1"}
208
208
 
209
209
  with FolderLock(web_root):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pulse-framework
3
- Version: 0.1.38a3
3
+ Version: 0.1.38a4
4
4
  Summary: Pulse - Full-stack framework for building real-time React applications in Python
5
5
  Requires-Dist: websockets>=12.0
6
6
  Requires-Dist: fastapi>=0.104.0
@@ -2,7 +2,7 @@ pulse/__init__.py,sha256=aJg4LvIeLYalXvEe1u47_A9ktS3HGIf4ZeAo6w1tbMQ,31463
2
2
  pulse/app.py,sha256=iBdqEt1SFD_28rDVAaZsaSixu4uhyRUAnwKTjGSEy0c,26906
3
3
  pulse/channel.py,sha256=DuD1mg_xWvkpAWSKZ-EtBYdUzJ8IuKH0fxdgGOvFXpg,13041
4
4
  pulse/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- pulse/cli/cmd.py,sha256=bkWxrQy9DmB8l8gok_9l9ofbj0zu5_PC3Ny-K5fuKrM,13418
5
+ pulse/cli/cmd.py,sha256=wiEn5Qnuu45ieGaMcBIL6GDzEfcIpoeif9IJqGFsO5k,13343
6
6
  pulse/cli/dependencies.py,sha256=ZBqBAfMvMBQUvh4THdPDztTMQ_dyR52S1IuotP_eEZs,5623
7
7
  pulse/cli/folder_lock.py,sha256=kvUmZBg869lwCTIZFoge9dhorv8qPXHTWwVv_jQg1k8,3477
8
8
  pulse/cli/helpers.py,sha256=8bRlV3d7w3w-jHaFvFYt9Pzue6_CbKOq_Z3jBsBOeUk,8820
@@ -65,7 +65,7 @@ pulse/types/event_handler.py,sha256=OF7sOgYBb6iUs59RH1vQIH7aOrGPfs3nAaF7how-4PQ,
65
65
  pulse/user_session.py,sha256=kCZtQpYZe2keDXzusd6jsjjw075am0dXrb25jKLg5JU,7578
66
66
  pulse/vdom.py,sha256=KTNBh2dVvDy9eXRzhneBJgk7F35MyWec8R_puQ4tSRY,12420
67
67
  pulse/version.py,sha256=711vaM1jVIQPgkisGgKZqwmw019qZIsc_QTae75K2pg,1895
68
- pulse_framework-0.1.38a3.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
69
- pulse_framework-0.1.38a3.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
70
- pulse_framework-0.1.38a3.dist-info/METADATA,sha256=ox_UWflZQSQ2pOHJkuzdArLYIDvtkKPUNNCky7A_syU,582
71
- pulse_framework-0.1.38a3.dist-info/RECORD,,
68
+ pulse_framework-0.1.38a4.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
69
+ pulse_framework-0.1.38a4.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
70
+ pulse_framework-0.1.38a4.dist-info/METADATA,sha256=KI5VQeDV1A_JDltz0TVnm2qglvH24zgYNZZA5ryVqck,582
71
+ pulse_framework-0.1.38a4.dist-info/RECORD,,