devmap 0.2.3__tar.gz → 0.3.1__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devmap
3
- Version: 0.2.3
4
- Summary: Map your machine's dev environment and surface issues (PATH conflicts, ghost binaries, multi-version collisions). fastfetch-for-dev-tools. Install the CLI via `npm i -g devmap` or `bun i -g devmap`; this PyPI package is a thin name-reservation shim.
3
+ Version: 0.3.1
4
+ Summary: Map your machine's dev environment and surface issues (PATH conflicts, ghost binaries, multi-version collisions). fastfetch-for-dev-tools. This PyPI package ships the real devmap CLI (a bundled JavaScript app launched via Node.js or Bun), so `pip install devmap && devmap` works standalone.
5
5
  Author: devmap contributors
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://github.com/StevenLOL/devmap
@@ -0,0 +1,54 @@
1
+ """devmap — standalone CLI shipped via PyPI.
2
+
3
+ This package embeds the compiled devmap app (a self-contained JavaScript bundle,
4
+ ``_devmap.mjs``) and launches it with Node.js (or Bun) when you run ``devmap``.
5
+ So ``pip install devmap && devmap`` works on its own — no separate npm/bun
6
+ install required, as long as a JavaScript runtime is on PATH.
7
+
8
+ If you already manage devmap via ``npm i -g devmap`` / ``bun i -g devmap``,
9
+ that install takes precedence on PATH and is equally valid.
10
+ """
11
+
12
+ import os
13
+ import shutil
14
+ import subprocess
15
+ import sys
16
+
17
+ __version__ = "0.2.5"
18
+
19
+ _BUNDLE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_devmap.mjs")
20
+
21
+
22
+ def _find_runtime() -> "str | None":
23
+ for name in ("node", "node.exe", "bun", "bun.exe"):
24
+ path = shutil.which(name)
25
+ if path:
26
+ return path
27
+ return None
28
+
29
+
30
+ def main() -> None:
31
+ runtime = _find_runtime()
32
+ if runtime is None:
33
+ sys.stderr.write(
34
+ "devmap requires Node.js (or Bun) to run.\n"
35
+ "Install Node.js from https://nodejs.org (or Bun from https://bun.sh)\n"
36
+ "and make sure it is on your PATH, then re-run `devmap`.\n"
37
+ )
38
+ sys.exit(1)
39
+ if not os.path.exists(_BUNDLE):
40
+ sys.stderr.write(
41
+ f"devmap: bundled app not found at {_BUNDLE}.\n"
42
+ "Reinstall with `pip install --force-reinstall --no-cache-dir devmap`.\n"
43
+ )
44
+ sys.exit(1)
45
+ try:
46
+ proc = subprocess.run([runtime, _BUNDLE, *sys.argv[1:]])
47
+ except Exception as exc: # pragma: no cover - defensive
48
+ sys.stderr.write(f"devmap: failed to launch runtime `{runtime}`: {exc}\n")
49
+ sys.exit(1)
50
+ sys.exit(proc.returncode)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ main()