MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / main

Function main

scripts/gen-ui-licenses.py:68–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67
68def main():
69 ui_dir = sys.argv[1]
70 # shell=True so the npm shim resolves on every platform (npm.cmd on
71 # Windows is not found by bare-name exec). Constant command, no injection.
72 ls = subprocess.run(
73 "npm ls --omit=dev --all --json",
74 shell=True, cwd=ui_dir, capture_output=True, text=True, check=False,
75 )
76 tree = json.loads(ls.stdout or "{}")
77 pkgs = set()
78 excluded = set()
79 collect(ui_dir, tree.get("dependencies"), pkgs, excluded)
80
81 print("## External Graph UI asset pack — bundled npm packages")
82 print()
83 print("The `-ui` archives ship a compiled frontend asset pack beside the binary.")
84 print("The packages below are its production dependency tree; license texts are")
85 print("reproduced verbatim from the packages as installed at build time.")
86 print("The whole production dependency tree is covered conservatively.")
87 print()
88
89 for name, version in sorted(pkgs):
90 pkg_dir = os.path.join(ui_dir, "node_modules", *name.split("/"))
91 lic = declared_license(pkg_dir)
92 text = license_text(pkg_dir)
93 print(f"### {name}@{version} — {lic}")
94 print()
95 if text:
96 print(text)
97 else:
98 print(f"(no license file shipped in the package; declared license: {lic})")
99 print()
100
101 if excluded:
102 print("### Platform-specific build tooling (not part of the bundle)")
103 print()
104 print("Resolved in the dependency tree but excluded above: these are")
105 print("native per-platform build binaries whose code does not ship in")
106 print("the browser bundle.")
107 print()
108 for name, version in sorted(excluded):
109 print(f"- {name}@{version}")
110 print()
111
112
113if __name__ == "__main__":

Callers 1

gen-ui-licenses.pyFile · 0.70

Calls 6

setFunction · 0.85
declared_licenseFunction · 0.85
license_textFunction · 0.85
collectFunction · 0.70
getMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected