Path: blob/main/package/src/common/import-report/package_report.qmd
6452 views
---
title: Package bundling health report
format: html
embed-resources: true
---
```{python}
#| echo: false
import re
import subprocess
def run(what):
ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
str = subprocess.run(
("quarto run --dev %s ../../../../src/quarto.ts" % what).split(" "),
capture_output = True
).stdout.decode('utf-8').replace("Bad import from ", "").replace(" to ", " -> ")
return ansi_escape.sub("", str)
```
Terminal files (`types.ts`, etc) with bad imports:
```{python}
#| echo: false
print(run("find-bad-types-constants.ts"))
```
Other bad imports:
```{python}
#| echo: false
print(run("find-bad-imports.ts"))
```