kctl-react 0.6.2__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.
- kctl_react/__init__.py +3 -0
- kctl_react/__main__.py +5 -0
- kctl_react/cli.py +201 -0
- kctl_react/commands/__init__.py +0 -0
- kctl_react/commands/a11y.py +78 -0
- kctl_react/commands/affected.py +170 -0
- kctl_react/commands/apps.py +353 -0
- kctl_react/commands/build.py +376 -0
- kctl_react/commands/bundle_cmd.py +217 -0
- kctl_react/commands/cap.py +1465 -0
- kctl_react/commands/clean.py +76 -0
- kctl_react/commands/codegen.py +491 -0
- kctl_react/commands/compliance.py +587 -0
- kctl_react/commands/config_cmd.py +368 -0
- kctl_react/commands/dashboard.py +163 -0
- kctl_react/commands/deploy.py +318 -0
- kctl_react/commands/deps.py +792 -0
- kctl_react/commands/dev.py +96 -0
- kctl_react/commands/docker_cmd.py +73 -0
- kctl_react/commands/doctor.py +170 -0
- kctl_react/commands/e2e.py +343 -0
- kctl_react/commands/env.py +155 -0
- kctl_react/commands/i18n.py +310 -0
- kctl_react/commands/lint.py +306 -0
- kctl_react/commands/maintenance.py +308 -0
- kctl_react/commands/monitor_cmd.py +50 -0
- kctl_react/commands/observe.py +34 -0
- kctl_react/commands/packages.py +129 -0
- kctl_react/commands/perf.py +762 -0
- kctl_react/commands/pipeline.py +289 -0
- kctl_react/commands/pwa.py +193 -0
- kctl_react/commands/scaffold.py +323 -0
- kctl_react/commands/security.py +660 -0
- kctl_react/commands/skill_cmd.py +54 -0
- kctl_react/commands/state.py +254 -0
- kctl_react/commands/test_cmd.py +418 -0
- kctl_react/commands/ui_audit.py +889 -0
- kctl_react/core/__init__.py +0 -0
- kctl_react/core/analyzers.py +200 -0
- kctl_react/core/callbacks.py +70 -0
- kctl_react/core/compliance/__init__.py +3 -0
- kctl_react/core/compliance/api_check/__init__.py +3 -0
- kctl_react/core/compliance/api_check/checks/__init__.py +18 -0
- kctl_react/core/compliance/api_check/checks/endpoints.py +53 -0
- kctl_react/core/compliance/api_check/checks/envelope.py +44 -0
- kctl_react/core/compliance/api_check/checks/naming.py +60 -0
- kctl_react/core/compliance/api_check/checks/params.py +44 -0
- kctl_react/core/compliance/api_check/checks/requests.py +57 -0
- kctl_react/core/compliance/api_check/checks/types.py +55 -0
- kctl_react/core/compliance/api_check/hooks.py +133 -0
- kctl_react/core/compliance/api_check/matcher.py +55 -0
- kctl_react/core/compliance/api_check/schema.py +151 -0
- kctl_react/core/compliance/api_health/__init__.py +35 -0
- kctl_react/core/compliance/api_health/checks/__init__.py +9 -0
- kctl_react/core/compliance/api_health/checks/auth.py +72 -0
- kctl_react/core/compliance/api_health/checks/reachable.py +44 -0
- kctl_react/core/compliance/api_health/checks/response.py +55 -0
- kctl_react/core/compliance/api_health/checks/timing.py +38 -0
- kctl_react/core/compliance/api_health/client.py +99 -0
- kctl_react/core/compliance/api_health/sampler.py +16 -0
- kctl_react/core/compliance/checks/__init__.py +47 -0
- kctl_react/core/compliance/checks/api.py +101 -0
- kctl_react/core/compliance/checks/codegen.py +94 -0
- kctl_react/core/compliance/checks/darkmode.py +57 -0
- kctl_react/core/compliance/checks/errors.py +68 -0
- kctl_react/core/compliance/checks/features.py +66 -0
- kctl_react/core/compliance/checks/i18n_check.py +105 -0
- kctl_react/core/compliance/checks/imports.py +86 -0
- kctl_react/core/compliance/checks/navigation.py +62 -0
- kctl_react/core/compliance/checks/practices.py +122 -0
- kctl_react/core/compliance/checks/providers.py +85 -0
- kctl_react/core/compliance/checks/pwa.py +101 -0
- kctl_react/core/compliance/checks/responsive.py +47 -0
- kctl_react/core/compliance/checks/scripts.py +85 -0
- kctl_react/core/compliance/checks/shadcn.py +51 -0
- kctl_react/core/compliance/checks/structure.py +76 -0
- kctl_react/core/compliance/checks/testing.py +83 -0
- kctl_react/core/compliance/checks/theme.py +92 -0
- kctl_react/core/compliance/checks/ui_standard.py +185 -0
- kctl_react/core/compliance/checks/vite.py +83 -0
- kctl_react/core/compliance/engine.py +87 -0
- kctl_react/core/compliance/exceptions_map.py +15 -0
- kctl_react/core/compliance/fixes/__init__.py +33 -0
- kctl_react/core/compliance/fixes/codegen_fix.py +28 -0
- kctl_react/core/compliance/fixes/i18n_fix.py +61 -0
- kctl_react/core/compliance/fixes/imports_fix.py +36 -0
- kctl_react/core/compliance/fixes/structure_fix.py +20 -0
- kctl_react/core/compliance/fixes/theme_fix.py +29 -0
- kctl_react/core/compliance/models.py +106 -0
- kctl_react/core/config.py +201 -0
- kctl_react/core/discovery.py +185 -0
- kctl_react/core/exceptions.py +17 -0
- kctl_react/core/git.py +146 -0
- kctl_react/core/history.py +121 -0
- kctl_react/core/output.py +5 -0
- kctl_react/core/plugins.py +13 -0
- kctl_react/core/runner.py +34 -0
- kctl_react/py.typed +0 -0
- kctl_react-0.6.2.dist-info/METADATA +17 -0
- kctl_react-0.6.2.dist-info/RECORD +102 -0
- kctl_react-0.6.2.dist-info/WHEEL +4 -0
- kctl_react-0.6.2.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""Shared package management commands."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import contextlib
|
|
6
|
+
import json
|
|
7
|
+
from typing import Annotated
|
|
8
|
+
|
|
9
|
+
import typer
|
|
10
|
+
|
|
11
|
+
from kctl_react.core.callbacks import AppContext
|
|
12
|
+
from kctl_react.core.discovery import get_app_dir
|
|
13
|
+
|
|
14
|
+
app = typer.Typer(help="Shared package inspection and management.")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@app.command("list")
|
|
18
|
+
def list_(ctx: typer.Context) -> None:
|
|
19
|
+
"""List all shared packages with versions and descriptions."""
|
|
20
|
+
actx: AppContext = ctx.obj
|
|
21
|
+
out = actx.output
|
|
22
|
+
root = actx.project_root
|
|
23
|
+
|
|
24
|
+
rows: list[list[str]] = []
|
|
25
|
+
json_data: list[dict] = []
|
|
26
|
+
|
|
27
|
+
packages_dir = root / "packages"
|
|
28
|
+
for pkg_name in sorted(actx.packages):
|
|
29
|
+
pkg_dir = packages_dir / pkg_name
|
|
30
|
+
pkg_file = pkg_dir / "package.json"
|
|
31
|
+
|
|
32
|
+
if not pkg_file.exists():
|
|
33
|
+
rows.append([f"@kodemeio/{pkg_name}", "[dim]--[/dim]", "[red]missing[/red]", ""])
|
|
34
|
+
continue
|
|
35
|
+
|
|
36
|
+
pkg = json.loads(pkg_file.read_text())
|
|
37
|
+
version = pkg.get("version", "0.0.0")
|
|
38
|
+
description = pkg.get("description", "")
|
|
39
|
+
|
|
40
|
+
# Count exports
|
|
41
|
+
src_dir = pkg_dir / "src"
|
|
42
|
+
ts_files = len(list(src_dir.rglob("*.ts"))) + len(list(src_dir.rglob("*.tsx"))) if src_dir.is_dir() else 0
|
|
43
|
+
|
|
44
|
+
rows.append([f"@kodemeio/{pkg_name}", version, str(ts_files), description[:50]])
|
|
45
|
+
json_data.append(
|
|
46
|
+
{
|
|
47
|
+
"package": f"@kodemeio/{pkg_name}",
|
|
48
|
+
"version": version,
|
|
49
|
+
"files": ts_files,
|
|
50
|
+
"description": description,
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
out.table(
|
|
55
|
+
"Shared Packages",
|
|
56
|
+
[("Package", "cyan"), ("Version", "green"), ("Files", ""), ("Description", "dim")],
|
|
57
|
+
rows,
|
|
58
|
+
data_for_json=json_data,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@app.command()
|
|
63
|
+
def consumers(
|
|
64
|
+
ctx: typer.Context,
|
|
65
|
+
package_name: Annotated[str, typer.Argument(help="Package name (e.g. core, ui, offline)")],
|
|
66
|
+
) -> None:
|
|
67
|
+
"""Show which apps use a specific shared package."""
|
|
68
|
+
actx: AppContext = ctx.obj
|
|
69
|
+
out = actx.output
|
|
70
|
+
root = actx.project_root
|
|
71
|
+
|
|
72
|
+
full_name = f"@kodemeio/{package_name}"
|
|
73
|
+
|
|
74
|
+
rows: list[list[str]] = []
|
|
75
|
+
json_data: list[dict] = []
|
|
76
|
+
|
|
77
|
+
for app_name in actx.app_names:
|
|
78
|
+
pkg_file = get_app_dir(root, app_name) / "package.json"
|
|
79
|
+
if not pkg_file.exists():
|
|
80
|
+
continue
|
|
81
|
+
|
|
82
|
+
pkg = json.loads(pkg_file.read_text())
|
|
83
|
+
all_deps = {**pkg.get("dependencies", {}), **pkg.get("devDependencies", {})}
|
|
84
|
+
|
|
85
|
+
if full_name in all_deps:
|
|
86
|
+
version = all_deps[full_name]
|
|
87
|
+
rows.append([app_name, "[green]Yes[/green]", version])
|
|
88
|
+
json_data.append({"app": app_name, "uses": True, "version": version})
|
|
89
|
+
else:
|
|
90
|
+
rows.append([app_name, "[dim]No[/dim]", ""])
|
|
91
|
+
json_data.append({"app": app_name, "uses": False})
|
|
92
|
+
|
|
93
|
+
out.table(
|
|
94
|
+
f"Consumers of {full_name}",
|
|
95
|
+
[("App", "cyan"), ("Uses", ""), ("Version", "dim")],
|
|
96
|
+
rows,
|
|
97
|
+
data_for_json=json_data,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@app.command()
|
|
102
|
+
def size(ctx: typer.Context) -> None:
|
|
103
|
+
"""Show source size of each shared package."""
|
|
104
|
+
actx: AppContext = ctx.obj
|
|
105
|
+
out = actx.output
|
|
106
|
+
root = actx.project_root
|
|
107
|
+
|
|
108
|
+
rows: list[list[str]] = []
|
|
109
|
+
packages_dir = root / "packages"
|
|
110
|
+
|
|
111
|
+
for pkg_name in sorted(actx.packages):
|
|
112
|
+
src_dir = packages_dir / pkg_name / "src"
|
|
113
|
+
if not src_dir.is_dir():
|
|
114
|
+
rows.append([f"@kodemeio/{pkg_name}", "[dim]--[/dim]", "[dim]--[/dim]"])
|
|
115
|
+
continue
|
|
116
|
+
|
|
117
|
+
files = list(src_dir.rglob("*.ts")) + list(src_dir.rglob("*.tsx"))
|
|
118
|
+
total_lines = 0
|
|
119
|
+
for f in files:
|
|
120
|
+
with contextlib.suppress(Exception):
|
|
121
|
+
total_lines += len(f.read_text().splitlines())
|
|
122
|
+
|
|
123
|
+
rows.append([f"@kodemeio/{pkg_name}", str(len(files)), f"{total_lines:,} lines"])
|
|
124
|
+
|
|
125
|
+
out.table(
|
|
126
|
+
"Package Source Sizes",
|
|
127
|
+
[("Package", "cyan"), ("Files", "green"), ("Lines", "")],
|
|
128
|
+
rows,
|
|
129
|
+
)
|