fastws-cli 0.0.37__tar.gz → 0.0.38__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 (32) hide show
  1. {fastws_cli-0.0.37/fastws_cli.egg-info → fastws_cli-0.0.38}/PKG-INFO +3 -2
  2. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/README.md +2 -1
  3. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/__init__.py +2 -1
  4. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/core.py +33 -8
  5. {fastws_cli-0.0.37 → fastws_cli-0.0.38/fastws_cli.egg-info}/PKG-INFO +3 -2
  6. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_sync.py +14 -6
  7. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/LICENSE +0 -0
  8. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/_toml.py +0 -0
  9. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/build_backend.py +0 -0
  10. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/cargo.py +0 -0
  11. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/integrate.py +0 -0
  12. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/news.py +0 -0
  13. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/procs.py +0 -0
  14. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/releases.py +0 -0
  15. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/store.py +0 -0
  16. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws/timelock.py +0 -0
  17. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws_cli.egg-info/SOURCES.txt +0 -0
  18. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws_cli.egg-info/dependency_links.txt +0 -0
  19. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws_cli.egg-info/entry_points.txt +0 -0
  20. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws_cli.egg-info/requires.txt +0 -0
  21. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/fastws_cli.egg-info/top_level.txt +0 -0
  22. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/pyproject.toml +0 -0
  23. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/setup.cfg +0 -0
  24. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_build.py +0 -0
  25. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_build_backend.py +0 -0
  26. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_integrate.py +0 -0
  27. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_news.py +0 -0
  28. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_procs.py +0 -0
  29. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_releases.py +0 -0
  30. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_setup.py +0 -0
  31. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_store.py +0 -0
  32. {fastws_cli-0.0.37 → fastws_cli-0.0.38}/tests/test_timelock.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastws-cli
3
- Version: 0.0.37
3
+ Version: 0.0.38
4
4
  Summary: Fast workspace tools for multi-repo management
5
5
  Author: Jeremy Howard
6
6
  License-Expression: Apache-2.0
@@ -145,6 +145,7 @@ Clone a workspace repo into a new directory, create its `.venv`, install fastws,
145
145
  ws-setup AnswerDotAI/aai-ws ~/aai-ws
146
146
  ws-setup AnswerDotAI/private-ws ~/aai-ws
147
147
  ws-setup owner/workspace ~/my-workspace --python 3.13
148
+ ws-setup AnswerDotAI/private-ws ~/aai-ws --workers 8
148
149
  ```
149
150
 
150
151
  The destination must not exist, including as an empty directory or a symlink. A failed step stops setup and leaves the checkout in place for inspection; it never deletes a partial workspace automatically. For an existing workspace, activate its environment and use `ws-sync` instead. Workspace repos should include fastws in their repo list or package dependencies so syncing retains the workspace commands.
@@ -345,7 +346,7 @@ Fastws discovers JavaScript packages directly under the workspace root, explicit
345
346
 
346
347
  Each sync updates `packages` in the root `pnpm-workspace.yaml` (creating it with `linkWorkspacePackages: deep`, `preferWorkspacePackages: true`, and `minimumReleaseAge: 1440` by default) and maintains `private: true` in the root `package.json`. It preserves external paths, globs, and unrelated settings, and reports added and removed packages.
347
348
 
348
- Optional tracked `pnpm-workspace.shared.yaml` and `package.json.shared` files are merged into `pnpm-workspace.yaml` and `package.json` on every sync. Object-valued fields merge one level deep, shared values win conflicts, and arrays replace rather than concatenate. Unrelated local settings remain; removing a shared key does not delete its local value. Use these files to declare the workspace's toolchain (`packageManager`, `devEngines.runtime`, `vite-plus`, and matching `vite`/`vitest` overrides) and shared policies such as `allowBuilds`.
349
+ When JavaScript workspace members are present, `ws-sync` reads `vp toolchain --json -g` and populates `devDependencies["vite-plus"]` in `package.json` plus matching `vite@*` and `vitest@*` entries under `overrides` in `pnpm-workspace.yaml`. Optional tracked `pnpm-workspace.shared.yaml` and `package.json.shared` files are merged on top on every sync. Object-valued fields merge one level deep, shared values win conflicts, and arrays replace rather than concatenate. Unrelated local settings remain; removing a shared key does not delete its local value. Use these files to declare `packageManager`, `devEngines.runtime`, shared policies such as `allowBuilds`, or explicit Vite+ overrides.
349
350
 
350
351
  Before `uv sync`, fastws regenerates `tool.uv.no-build-isolation-package` with the sorted package names of projects using `fastws.build_backend`, including external checkouts. These builds use the shared environment's `fastws-cli` and `maturin`. Leave global build isolation enabled for other projects.
351
352
 
@@ -116,6 +116,7 @@ Clone a workspace repo into a new directory, create its `.venv`, install fastws,
116
116
  ws-setup AnswerDotAI/aai-ws ~/aai-ws
117
117
  ws-setup AnswerDotAI/private-ws ~/aai-ws
118
118
  ws-setup owner/workspace ~/my-workspace --python 3.13
119
+ ws-setup AnswerDotAI/private-ws ~/aai-ws --workers 8
119
120
  ```
120
121
 
121
122
  The destination must not exist, including as an empty directory or a symlink. A failed step stops setup and leaves the checkout in place for inspection; it never deletes a partial workspace automatically. For an existing workspace, activate its environment and use `ws-sync` instead. Workspace repos should include fastws in their repo list or package dependencies so syncing retains the workspace commands.
@@ -316,7 +317,7 @@ Fastws discovers JavaScript packages directly under the workspace root, explicit
316
317
 
317
318
  Each sync updates `packages` in the root `pnpm-workspace.yaml` (creating it with `linkWorkspacePackages: deep`, `preferWorkspacePackages: true`, and `minimumReleaseAge: 1440` by default) and maintains `private: true` in the root `package.json`. It preserves external paths, globs, and unrelated settings, and reports added and removed packages.
318
319
 
319
- Optional tracked `pnpm-workspace.shared.yaml` and `package.json.shared` files are merged into `pnpm-workspace.yaml` and `package.json` on every sync. Object-valued fields merge one level deep, shared values win conflicts, and arrays replace rather than concatenate. Unrelated local settings remain; removing a shared key does not delete its local value. Use these files to declare the workspace's toolchain (`packageManager`, `devEngines.runtime`, `vite-plus`, and matching `vite`/`vitest` overrides) and shared policies such as `allowBuilds`.
320
+ When JavaScript workspace members are present, `ws-sync` reads `vp toolchain --json -g` and populates `devDependencies["vite-plus"]` in `package.json` plus matching `vite@*` and `vitest@*` entries under `overrides` in `pnpm-workspace.yaml`. Optional tracked `pnpm-workspace.shared.yaml` and `package.json.shared` files are merged on top on every sync. Object-valued fields merge one level deep, shared values win conflicts, and arrays replace rather than concatenate. Unrelated local settings remain; removing a shared key does not delete its local value. Use these files to declare `packageManager`, `devEngines.runtime`, shared policies such as `allowBuilds`, or explicit Vite+ overrides.
320
321
 
321
322
  Before `uv sync`, fastws regenerates `tool.uv.no-build-isolation-package` with the sorted package names of projects using `fastws.build_backend`, including external checkouts. These builds use the shared environment's `fastws-cli` and `maturin`. Leave global build isolation enabled for other projects.
322
323
 
@@ -1,4 +1,5 @@
1
- __version__ = "0.0.37"
1
+ __version__ = "0.0.38"
2
+
2
3
 
3
4
 
4
5
 
@@ -453,6 +453,7 @@ def ws_setup(
453
453
  repo: str, # Workspace repository: owner/repo or GitHub URL
454
454
  dest: str, # New workspace directory (must not exist)
455
455
  python: str = "3.13", # Python version for the workspace environment
456
+ workers: int = None, # Parallel workers for the initial ws-sync; omit to use its default
456
457
  ):
457
458
  "Clone a workspace, create its environment, install fastws, and sync without changing the caller's environment."
458
459
  root = Path(dest).expanduser().absolute()
@@ -466,7 +467,9 @@ def ws_setup(
466
467
  UV_PROJECT=str(root), UV_WORKING_DIR=str(root), PATH=f'{bindir}{os.pathsep}{os.environ["PATH"]}')
467
468
  subprocess.run(['uv', 'venv', '--python', python, str(venv)], cwd=root, env=env, check=True)
468
469
  subprocess.run(['uv', 'pip', 'install', '--python', str(bindir/'python'), 'fastws-cli>=0.0.14'], cwd=root, env=env, check=True)
469
- subprocess.run([str(bindir/'ws-sync'), '--workspace', str(root)], cwd=root, env=env, check=True)
470
+ sync = [str(bindir/'ws-sync'), '--workspace', str(root)]
471
+ if workers: sync += ['--workers', str(workers)]
472
+ subprocess.run(sync, cwd=root, env=env, check=True)
470
473
  print(f'Workspace ready: {root}\n\nsource {shlex.quote(str(bindir/"activate"))}\ncd {shlex.quote(str(root))}')
471
474
  if (root/'aai-coding/SETUP.md').exists(): print('Then ask your coding agent to follow aai-coding/SETUP.md.')
472
475
 
@@ -1073,8 +1076,8 @@ def _js_dirs(root: Path, repos_file="repos.txt") -> list[Path]:
1073
1076
  else: res.append(spec[1])
1074
1077
  return list(dict.fromkeys(d.resolve() for d in res if ok(d) and d.resolve() not in superseded_wasm))
1075
1078
 
1076
- def _sync_ws_pnpm_workspace(root: Path, members: list[Path]) -> tuple[list[str], list[str]]:
1077
- "Generate/update `pnpm-workspace.yaml`, merging `pnpm-workspace.shared.yaml`; return `(added, removed)` packages."
1079
+ def _sync_ws_pnpm_workspace(root: Path, members: list[Path], toolchain: dict[str, str] = None) -> tuple[list[str], list[str]]:
1080
+ "Generate/update `pnpm-workspace.yaml`, applying Vite+ toolchain overrides and merging `pnpm-workspace.shared.yaml`; return `(added, removed)` packages."
1078
1081
  path = root/"pnpm-workspace.yaml"
1079
1082
  before = path.read_text() if path.exists() else ""
1080
1083
  data = _yaml_load(path) if path.exists() else {}
@@ -1083,7 +1086,20 @@ def _sync_ws_pnpm_workspace(root: Path, members: list[Path]) -> tuple[list[str],
1083
1086
  data.setdefault("preferWorkspacePackages", True)
1084
1087
  data.setdefault("minimumReleaseAge", 1440)
1085
1088
  shared = root/"pnpm-workspace.shared.yaml"
1086
- if shared.exists(): _merge_shared(data, _yaml_load(shared))
1089
+ shared_data = _yaml_load(shared) if shared.exists() else {}
1090
+ shared_ov = shared_data.get("overrides") if isinstance(shared_data.get("overrides"), dict) else {}
1091
+ if toolchain:
1092
+ ov = dict(data.get("overrides") or {})
1093
+ if core_v := toolchain.get("vite-plus-core"):
1094
+ ov.pop("vite", None)
1095
+ if "vite" not in shared_ov: ov["vite@*"] = f"npm:@voidzero-dev/vite-plus-core@{core_v}"
1096
+ else: ov.pop("vite@*", None)
1097
+ if vitest_v := toolchain.get("vitest"):
1098
+ ov.pop("vitest", None)
1099
+ if "vitest" not in shared_ov: ov["vitest@*"] = vitest_v
1100
+ else: ov.pop("vitest@*", None)
1101
+ if ov: data["overrides"] = ov
1102
+ if shared_data: _merge_shared(data, shared_data)
1087
1103
  cur_after = list(data.get("packages") or [])
1088
1104
  kept = [e for e in cur_after if any(c in e for c in "*?[") or not (root/e).resolve().is_relative_to(root.resolve())]
1089
1105
  new = kept + [e for e in (_rel_ws_path(root, d) for d in members) if e not in kept]
@@ -1093,13 +1109,15 @@ def _sync_ws_pnpm_workspace(root: Path, members: list[Path]) -> tuple[list[str],
1093
1109
  path.write_text(rendered)
1094
1110
  return _entry_changes(cur, new)
1095
1111
 
1096
- def _sync_ws_package_json(root: Path) -> bool:
1097
- "Maintain root `package.json`, merging optional `package.json.shared`."
1112
+ def _sync_ws_package_json(root: Path, toolchain: dict[str, str] = None) -> bool:
1113
+ "Maintain root `package.json`, applying the global `vite-plus` version and merging optional `package.json.shared`."
1098
1114
  path = root/"package.json"
1099
1115
  data = json.loads(path.read_text()) if path.exists() else {}
1100
1116
  before = json.dumps(data)
1101
1117
  data["private"] = True
1102
1118
  data.pop("workspaces", None)
1119
+ if toolchain and (vp_v := toolchain.get("vite-plus")):
1120
+ data["devDependencies"] = {**data.get("devDependencies", {}), "vite-plus": vp_v}
1103
1121
  shared = root/"package.json.shared"
1104
1122
  if shared.exists(): _merge_shared(data, json.loads(shared.read_text()))
1105
1123
  if json.dumps(data) == before: return False
@@ -1149,6 +1167,12 @@ def _check_vp():
1149
1167
  "Enable Vite+ managed mode (`vp env on`) and put Vite+'s bin directory first on PATH "
1150
1168
  "(normally via `~/.config/vite-plus/env`), then open a new shell and rerun ws-sync.")
1151
1169
 
1170
+ def _vp_toolchain() -> dict[str, str]:
1171
+ "Versions of `vite-plus`, `vite-plus-core`, and `vitest` from the global `vp` CLI."
1172
+ if not shutil.which("vp"): return {}
1173
+ raw = subprocess.run(["vp", "toolchain", "--json", "-g"], capture_output=True, text=True, check=True).stdout
1174
+ return {n["id"]: n["version"] for n in json.loads(raw).get("nodes", []) if "id" in n and "version" in n}
1175
+
1152
1176
  def _build_wasm(repo: Path):
1153
1177
  "Run `cargo wasm` in `repo` through the workspace's configured Cargo."
1154
1178
  from .cargo import _cargo_command
@@ -1225,8 +1249,9 @@ async def ws_sync(
1225
1249
  if wasm_pkgs: _check_rustup(wasm=True)
1226
1250
  if js_members: _check_vp()
1227
1251
  if js_members or any((root/f).exists() for f in ("pnpm-workspace.yaml", "pnpm-workspace.shared.yaml", "package.json.shared")):
1228
- added_j, removed_j = _sync_ws_pnpm_workspace(root, js_members)
1229
- _sync_ws_package_json(root)
1252
+ tc = _vp_toolchain() if js_members else {}
1253
+ added_j, removed_j = _sync_ws_pnpm_workspace(root, js_members, toolchain=tc)
1254
+ _sync_ws_package_json(root, toolchain=tc)
1230
1255
  if added_j: print(f"JS workspace packages added: {', '.join(added_j)}")
1231
1256
  if removed_j: print(f"JS workspace packages removed: {', '.join(removed_j)}")
1232
1257
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastws-cli
3
- Version: 0.0.37
3
+ Version: 0.0.38
4
4
  Summary: Fast workspace tools for multi-repo management
5
5
  Author: Jeremy Howard
6
6
  License-Expression: Apache-2.0
@@ -145,6 +145,7 @@ Clone a workspace repo into a new directory, create its `.venv`, install fastws,
145
145
  ws-setup AnswerDotAI/aai-ws ~/aai-ws
146
146
  ws-setup AnswerDotAI/private-ws ~/aai-ws
147
147
  ws-setup owner/workspace ~/my-workspace --python 3.13
148
+ ws-setup AnswerDotAI/private-ws ~/aai-ws --workers 8
148
149
  ```
149
150
 
150
151
  The destination must not exist, including as an empty directory or a symlink. A failed step stops setup and leaves the checkout in place for inspection; it never deletes a partial workspace automatically. For an existing workspace, activate its environment and use `ws-sync` instead. Workspace repos should include fastws in their repo list or package dependencies so syncing retains the workspace commands.
@@ -345,7 +346,7 @@ Fastws discovers JavaScript packages directly under the workspace root, explicit
345
346
 
346
347
  Each sync updates `packages` in the root `pnpm-workspace.yaml` (creating it with `linkWorkspacePackages: deep`, `preferWorkspacePackages: true`, and `minimumReleaseAge: 1440` by default) and maintains `private: true` in the root `package.json`. It preserves external paths, globs, and unrelated settings, and reports added and removed packages.
347
348
 
348
- Optional tracked `pnpm-workspace.shared.yaml` and `package.json.shared` files are merged into `pnpm-workspace.yaml` and `package.json` on every sync. Object-valued fields merge one level deep, shared values win conflicts, and arrays replace rather than concatenate. Unrelated local settings remain; removing a shared key does not delete its local value. Use these files to declare the workspace's toolchain (`packageManager`, `devEngines.runtime`, `vite-plus`, and matching `vite`/`vitest` overrides) and shared policies such as `allowBuilds`.
349
+ When JavaScript workspace members are present, `ws-sync` reads `vp toolchain --json -g` and populates `devDependencies["vite-plus"]` in `package.json` plus matching `vite@*` and `vitest@*` entries under `overrides` in `pnpm-workspace.yaml`. Optional tracked `pnpm-workspace.shared.yaml` and `package.json.shared` files are merged on top on every sync. Object-valued fields merge one level deep, shared values win conflicts, and arrays replace rather than concatenate. Unrelated local settings remain; removing a shared key does not delete its local value. Use these files to declare `packageManager`, `devEngines.runtime`, shared policies such as `allowBuilds`, or explicit Vite+ overrides.
349
350
 
350
351
  Before `uv sync`, fastws regenerates `tool.uv.no-build-isolation-package` with the sorted package names of projects using `fastws.build_backend`, including external checkouts. These builds use the shared environment's `fastws-cli` and `maturin`. Leave global build isolation enabled for other projects.
351
352
 
@@ -209,16 +209,24 @@ def test_sync_ws_pnpm_workspace_and_package_json(tmp_path):
209
209
  assert data['linkWorkspacePackages'] == 'deep' and data['preferWorkspacePackages'] is True and data['minimumReleaseAge'] == 1440
210
210
  assert 'overrides' not in data
211
211
 
212
- ws.write_text(ws.read_text() + 'overrides:\n keep: 1.0.0\n')
212
+ ws.write_text(ws.read_text() + 'overrides:\n keep: 1.0.0\n vite: npm:@voidzero-dev/vite-plus-core@8.0.0\n vitest: 4.0.0\n')
213
+ tc = {'vite-plus': '1.8.0', 'vite-plus-core': '8.4.0', 'vitest': '5.2.0'}
214
+ core._sync_ws_pnpm_workspace(tmp_path, [tmp_path/'app'], toolchain=tc)
215
+ assert core._yaml_load(ws)['overrides'] == {'keep': '1.0.0', 'vite@*': 'npm:@voidzero-dev/vite-plus-core@8.4.0', 'vitest@*': '5.2.0'}
216
+
213
217
  ws_shared.write_text('allowBuilds:\n esbuild: true\noverrides:\n vite: npm:@voidzero-dev/vite-plus-core@8.3.8000\n vitest: 5.1.0\n')
214
- core._sync_ws_pnpm_workspace(tmp_path, [tmp_path/'app'])
218
+ core._sync_ws_pnpm_workspace(tmp_path, [tmp_path/'app'], toolchain=tc)
215
219
  assert core._yaml_load(ws)['overrides'] == {'keep': '1.0.0', 'vite': 'npm:@voidzero-dev/vite-plus-core@8.3.8000', 'vitest': '5.1.0'}
216
220
 
217
221
  pkg, pkg_shared = tmp_path/'package.json', tmp_path/'package.json.shared'
218
222
  pkg.write_text(json.dumps({'name': 'local', 'workspaces': ['stale'], 'devDependencies': {'keep': '1'}}))
219
- pkg_shared.write_text(json.dumps({'packageManager': 'pnpm@10.34.9', 'devDependencies': {'vite-plus': '1.7.0'}}))
220
- assert core._sync_ws_package_json(tmp_path) is True
223
+ pkg_shared.write_text(json.dumps({'packageManager': 'pnpm@10.34.9'}))
224
+ assert core._sync_ws_package_json(tmp_path, toolchain=tc) is True
221
225
  out = json.loads(pkg.read_text())
222
226
  assert 'workspaces' not in out and out['private'] is True
223
- assert out['devDependencies'] == {'keep': '1', 'vite-plus': '1.7.0'}
224
- assert out['packageManager'] == 'pnpm@10.34.9'
227
+ assert out['devDependencies'] == {'keep': '1', 'vite-plus': '1.8.0'}
228
+ assert out['packageManager'] == 'pnpm@10.34.9'
229
+
230
+ pkg_shared.write_text(json.dumps({'packageManager': 'pnpm@10.34.9', 'devDependencies': {'vite-plus': '1.7.0'}}))
231
+ assert core._sync_ws_package_json(tmp_path, toolchain=tc) is True
232
+ assert json.loads(pkg.read_text())['devDependencies'] == {'keep': '1', 'vite-plus': '1.7.0'}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes