kctl-react 0.6.2__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.
- kctl_react-0.6.2/.gitignore +8 -0
- kctl_react-0.6.2/PKG-INFO +17 -0
- kctl_react-0.6.2/README.md +253 -0
- kctl_react-0.6.2/e2e/.gitignore +3 -0
- kctl_react-0.6.2/e2e/README.md +28 -0
- kctl_react-0.6.2/e2e/fixtures/auth.ts +15 -0
- kctl_react-0.6.2/e2e/package.json +15 -0
- kctl_react-0.6.2/e2e/playwright.config.ts +15 -0
- kctl_react-0.6.2/e2e/tests/smoke/connectivity.spec.ts +14 -0
- kctl_react-0.6.2/pyproject.toml +45 -0
- kctl_react-0.6.2/skills/react-dev/SKILL.md +288 -0
- kctl_react-0.6.2/src/kctl_react/__init__.py +3 -0
- kctl_react-0.6.2/src/kctl_react/__main__.py +5 -0
- kctl_react-0.6.2/src/kctl_react/cli.py +201 -0
- kctl_react-0.6.2/src/kctl_react/commands/__init__.py +0 -0
- kctl_react-0.6.2/src/kctl_react/commands/a11y.py +78 -0
- kctl_react-0.6.2/src/kctl_react/commands/affected.py +170 -0
- kctl_react-0.6.2/src/kctl_react/commands/apps.py +353 -0
- kctl_react-0.6.2/src/kctl_react/commands/build.py +376 -0
- kctl_react-0.6.2/src/kctl_react/commands/bundle_cmd.py +217 -0
- kctl_react-0.6.2/src/kctl_react/commands/cap.py +1465 -0
- kctl_react-0.6.2/src/kctl_react/commands/clean.py +76 -0
- kctl_react-0.6.2/src/kctl_react/commands/codegen.py +491 -0
- kctl_react-0.6.2/src/kctl_react/commands/compliance.py +587 -0
- kctl_react-0.6.2/src/kctl_react/commands/config_cmd.py +368 -0
- kctl_react-0.6.2/src/kctl_react/commands/dashboard.py +163 -0
- kctl_react-0.6.2/src/kctl_react/commands/deploy.py +318 -0
- kctl_react-0.6.2/src/kctl_react/commands/deps.py +792 -0
- kctl_react-0.6.2/src/kctl_react/commands/dev.py +96 -0
- kctl_react-0.6.2/src/kctl_react/commands/docker_cmd.py +73 -0
- kctl_react-0.6.2/src/kctl_react/commands/doctor.py +170 -0
- kctl_react-0.6.2/src/kctl_react/commands/e2e.py +343 -0
- kctl_react-0.6.2/src/kctl_react/commands/env.py +155 -0
- kctl_react-0.6.2/src/kctl_react/commands/i18n.py +310 -0
- kctl_react-0.6.2/src/kctl_react/commands/lint.py +306 -0
- kctl_react-0.6.2/src/kctl_react/commands/maintenance.py +308 -0
- kctl_react-0.6.2/src/kctl_react/commands/monitor_cmd.py +50 -0
- kctl_react-0.6.2/src/kctl_react/commands/observe.py +34 -0
- kctl_react-0.6.2/src/kctl_react/commands/packages.py +129 -0
- kctl_react-0.6.2/src/kctl_react/commands/perf.py +762 -0
- kctl_react-0.6.2/src/kctl_react/commands/pipeline.py +289 -0
- kctl_react-0.6.2/src/kctl_react/commands/pwa.py +193 -0
- kctl_react-0.6.2/src/kctl_react/commands/scaffold.py +323 -0
- kctl_react-0.6.2/src/kctl_react/commands/security.py +660 -0
- kctl_react-0.6.2/src/kctl_react/commands/skill_cmd.py +54 -0
- kctl_react-0.6.2/src/kctl_react/commands/state.py +254 -0
- kctl_react-0.6.2/src/kctl_react/commands/test_cmd.py +418 -0
- kctl_react-0.6.2/src/kctl_react/commands/ui_audit.py +889 -0
- kctl_react-0.6.2/src/kctl_react/core/__init__.py +0 -0
- kctl_react-0.6.2/src/kctl_react/core/analyzers.py +200 -0
- kctl_react-0.6.2/src/kctl_react/core/callbacks.py +70 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/__init__.py +3 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/__init__.py +3 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/__init__.py +18 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/endpoints.py +53 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/envelope.py +44 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/naming.py +60 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/params.py +44 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/requests.py +57 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/checks/types.py +55 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/hooks.py +133 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/matcher.py +55 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_check/schema.py +151 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/__init__.py +35 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/checks/__init__.py +9 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/checks/auth.py +72 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/checks/reachable.py +44 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/checks/response.py +55 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/checks/timing.py +38 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/client.py +99 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/api_health/sampler.py +16 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/__init__.py +47 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/api.py +101 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/codegen.py +94 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/darkmode.py +57 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/errors.py +68 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/features.py +66 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/i18n_check.py +105 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/imports.py +86 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/navigation.py +62 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/practices.py +122 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/providers.py +85 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/pwa.py +101 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/responsive.py +47 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/scripts.py +85 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/shadcn.py +51 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/structure.py +76 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/testing.py +83 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/theme.py +92 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/ui_standard.py +185 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/checks/vite.py +83 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/engine.py +87 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/exceptions_map.py +15 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/fixes/__init__.py +33 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/fixes/codegen_fix.py +28 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/fixes/i18n_fix.py +61 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/fixes/imports_fix.py +36 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/fixes/structure_fix.py +20 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/fixes/theme_fix.py +29 -0
- kctl_react-0.6.2/src/kctl_react/core/compliance/models.py +106 -0
- kctl_react-0.6.2/src/kctl_react/core/config.py +201 -0
- kctl_react-0.6.2/src/kctl_react/core/discovery.py +185 -0
- kctl_react-0.6.2/src/kctl_react/core/exceptions.py +17 -0
- kctl_react-0.6.2/src/kctl_react/core/git.py +146 -0
- kctl_react-0.6.2/src/kctl_react/core/history.py +121 -0
- kctl_react-0.6.2/src/kctl_react/core/output.py +5 -0
- kctl_react-0.6.2/src/kctl_react/core/plugins.py +13 -0
- kctl_react-0.6.2/src/kctl_react/core/runner.py +34 -0
- kctl_react-0.6.2/src/kctl_react/py.typed +0 -0
- kctl_react-0.6.2/tests/__init__.py +0 -0
- kctl_react-0.6.2/tests/conftest.py +299 -0
- kctl_react-0.6.2/tests/test_analyzers.py +182 -0
- kctl_react-0.6.2/tests/test_api_check.py +652 -0
- kctl_react-0.6.2/tests/test_api_health.py +409 -0
- kctl_react-0.6.2/tests/test_cap.py +469 -0
- kctl_react-0.6.2/tests/test_commands.py +1342 -0
- kctl_react-0.6.2/tests/test_compliance.py +1210 -0
- kctl_react-0.6.2/tests/test_config.py +156 -0
- kctl_react-0.6.2/tests/test_exceptions.py +58 -0
- kctl_react-0.6.2/tests/test_output.py +77 -0
- kctl_react-0.6.2/tests/test_pipeline.py +142 -0
- kctl_react-0.6.2/tests/test_runner.py +40 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kctl-react
|
|
3
|
+
Version: 0.6.2
|
|
4
|
+
Summary: Kodemeio React CLI — manage the kodemeio-react monorepo
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Requires-Dist: httpx>=0.28.0
|
|
7
|
+
Requires-Dist: kctl-lib>=0.8.0
|
|
8
|
+
Requires-Dist: pydantic>=2.10.0
|
|
9
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
10
|
+
Requires-Dist: rich>=13.9.0
|
|
11
|
+
Requires-Dist: typer>=0.15.0
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: mypy>=1.14.0; extra == 'dev'
|
|
14
|
+
Requires-Dist: pytest-httpx>=0.35.0; extra == 'dev'
|
|
15
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
16
|
+
Requires-Dist: ruff>=0.9.0; extra == 'dev'
|
|
17
|
+
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# kctl-react
|
|
2
|
+
|
|
3
|
+
Kodemeio React Monorepo CLI — manage 11 Vite PWAs + 14 shared packages.
|
|
4
|
+
|
|
5
|
+
Part of the kctl-\* CLI ecosystem (alongside kctl-ak, kctl-odoo, kctl-pg, etc.), built with Python + Typer + Rich.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd cli && uv tool install .
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
kctl-react dashboard # Full monorepo overview
|
|
17
|
+
kctl-react apps list # List all 11 apps
|
|
18
|
+
kctl-react doctor # Comprehensive health check
|
|
19
|
+
kctl-react info # Quick project info
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Command Groups
|
|
23
|
+
|
|
24
|
+
| Group | Key Subcommands | Purpose |
|
|
25
|
+
| ------------- | ------------------------------------------------------------------------- | ---------------------------------------- |
|
|
26
|
+
| `apps` | `list`, `ports`, `status`, `health --watch`, `info`, `dashboard`, `doctor`, `clean` | App inventory, health & routing |
|
|
27
|
+
| `dev` | `start`, `logs`, `list` | Dev server management |
|
|
28
|
+
| `build` | `[app] --analyze`, `size`, `compare`, `history`, `chunks`, `bundle` | Production builds + bundle analysis |
|
|
29
|
+
| `test` | `[app] --coverage --watch`, `count`, `summary`, `coverage`, `naming`, `threshold`, `snapshots` | Vitest testing |
|
|
30
|
+
| `lint` | `[app] --fix`, `format --check`, `strict-check`, `tsconfig-audit`, `conventions` | ESLint + TypeScript + Prettier |
|
|
31
|
+
| `codegen` | `[app]`, `status`, `diff`, `endpoints`, `verify`, `drift`, `schema-health` | OpenAPI type generation |
|
|
32
|
+
| `deps` | `outdated`, `audit`, `graph`, `list`, `why`, `duplicates`, `size`, `upgrade`, `stack`, `health` | Dependency management |
|
|
33
|
+
| `env` | `show`, `diff`, `validate` | .env management |
|
|
34
|
+
| `scaffold` | `page`, `hook`, `form`, `test`, `component` | Code scaffolding |
|
|
35
|
+
| `deploy` | `build`, `status`, `logs`, `down --force`, `images`, `ps`, `readiness` | Docker Compose deployment |
|
|
36
|
+
| `packages` | `list`, `consumers`, `size` | Shared package inspection |
|
|
37
|
+
| `clean` | `[app] --all` | Clean build artifacts |
|
|
38
|
+
| `pwa` | `status`, `cache-list`, `cache-clear`, `manifest-validate`, `offline-report`, `sw-info` | PWA / service worker management |
|
|
39
|
+
| `e2e` | `test`, `list`, `report`, `discover`, `install`, `screenshots` | Playwright E2E testing |
|
|
40
|
+
| `perf` | `lighthouse`, `history`, `pwa`, `bundle`, `vitals`, `images`, `fonts` | Performance & Core Web Vitals |
|
|
41
|
+
| `security` | `audit`, `scan`, `secrets`, `headers`, `licenses`, `report` | Security & license scanning |
|
|
42
|
+
| `a11y` | `audit`, `report`, `violations` | Accessibility audits (axe-core) |
|
|
43
|
+
| `i18n` | `coverage`, `missing`, `unused`, `sort`, `diff`, `validate`, `interpolation`, `sync-stub` | i18n key management |
|
|
44
|
+
| `state` | `query-keys`, `consistency`, `hooks-audit`, `invalidation-map` | TanStack Query state analysis |
|
|
45
|
+
| `bundle` | `budget`, `duplicates`, `treeshake`, `compare`, `impact` | Bundle budget & tree-shaking |
|
|
46
|
+
| `ui` | `audit`, `compliance`, `anti-patterns`, `components`, `theme-check`, `add`, `diff`, `search`, `docs`, `preset` | shadcn/ui component audit |
|
|
47
|
+
| `observe` | `sentry`, `errors`, `uptime` | Error tracking & uptime observability |
|
|
48
|
+
| `monitor` | `health`, `ssl` | HTTP health + SSL certificate checks |
|
|
49
|
+
| `affected` | `[default]`, `test`, `build`, `lint` | Turborepo affected graph queries |
|
|
50
|
+
| `pipeline` | `gate`, `affected-gate`, `release` | CI/CD pipeline gates |
|
|
51
|
+
| `cap` | `status`, `doctor`, `init`, `add`, `sync`, `run`, `open`, `build`, `dev`, `devices` | Capacitor native mobile |
|
|
52
|
+
| `docker` | `ps`, `logs`, `restart`, `image-size` | Docker container management |
|
|
53
|
+
| `maintenance` | `health-report`, `cleanup`, `dr-status`, `count-test-files`, `deps-sync` | Repo maintenance & DR checks |
|
|
54
|
+
| `compliance` | `audit`, `fix`, `prompt`, `api-check`, `api-health` | Compliance policy enforcement |
|
|
55
|
+
| `doctor` | `check` | Comprehensive health check |
|
|
56
|
+
| `dashboard` | `show --watch --interval` | Monorepo overview |
|
|
57
|
+
| `config` | `init`, `add`, `use`, `show`, `set`, `validate`, `remove`, `profiles`, `current` | Profile management |
|
|
58
|
+
| `skill` | `generate` | Auto-generate SKILL.md from CLI |
|
|
59
|
+
| `info` | | Quick project summary |
|
|
60
|
+
|
|
61
|
+
## Monorepo Architecture
|
|
62
|
+
|
|
63
|
+
kctl-react manages a **Turborepo monorepo** with Vite PWAs, shared packages, and Docker-based deployments:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
kodemeio-react/
|
|
67
|
+
├── apps/ # 11 Vite PWA apps (+ optional Next.js)
|
|
68
|
+
│ ├── sfa/ # Sales Force Automation
|
|
69
|
+
│ ├── hrms/ # Human Resource Management
|
|
70
|
+
│ ├── iam/ # Identity & Access Management
|
|
71
|
+
│ ├── fin/ # Finance & Accounting
|
|
72
|
+
│ ├── inv/ # Inventory & Warehouse
|
|
73
|
+
│ ├── crm/ # Customer Relationship Management
|
|
74
|
+
│ ├── ops/ # Operations Management
|
|
75
|
+
│ ├── procurement/ # Procurement & Purchasing
|
|
76
|
+
│ ├── pos/ # Point of Sale
|
|
77
|
+
│ ├── dashboard/ # Executive Dashboard
|
|
78
|
+
│ └── portal/ # Customer/Vendor Portal
|
|
79
|
+
├── packages/ # 14 shared packages
|
|
80
|
+
│ ├── ui/ # shadcn/ui component library
|
|
81
|
+
│ ├── api-client/ # Generated OpenAPI clients
|
|
82
|
+
│ ├── auth/ # Authentik OIDC integration
|
|
83
|
+
│ ├── i18n/ # i18next translations
|
|
84
|
+
│ ├── hooks/ # Shared React hooks
|
|
85
|
+
│ ├── utils/ # Shared utilities
|
|
86
|
+
│ └── ... # Additional domain packages
|
|
87
|
+
├── turbo.json # Turborepo pipeline config
|
|
88
|
+
├── pnpm-workspace.yaml # pnpm workspace definition
|
|
89
|
+
└── docker-compose.yml # Multi-app compose (nginx routing)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Tech Stack
|
|
93
|
+
|
|
94
|
+
| Layer | Technology |
|
|
95
|
+
|-------|-----------|
|
|
96
|
+
| Bundler | Vite 6 |
|
|
97
|
+
| Framework | React 19 + TypeScript (strict) |
|
|
98
|
+
| Styling | Tailwind CSS v4 |
|
|
99
|
+
| Components | shadcn/ui |
|
|
100
|
+
| Server state | TanStack Query v5 |
|
|
101
|
+
| Forms | react-hook-form + zod |
|
|
102
|
+
| PWA | vite-plugin-pwa (Workbox) |
|
|
103
|
+
| E2E | Playwright |
|
|
104
|
+
| Testing | Vitest |
|
|
105
|
+
| Monorepo | Turborepo + pnpm workspaces |
|
|
106
|
+
| API clients | OpenAPI-generated (never hand-written) |
|
|
107
|
+
|
|
108
|
+
## 11 PWA Apps Overview
|
|
109
|
+
|
|
110
|
+
Each app is a full Vite PWA with service worker, offline support, and OIDC authentication via Authentik:
|
|
111
|
+
|
|
112
|
+
| App | Domain Pattern | Description |
|
|
113
|
+
|-----|---------------|-------------|
|
|
114
|
+
| `sfa` | sfa.{tenant}.com | Sales Force Automation — orders, pipelines, visits |
|
|
115
|
+
| `hrms` | hrms.{tenant}.com | Human Resources — employees, attendance, payroll |
|
|
116
|
+
| `iam` | iam.{tenant}.com | Identity & Access — roles, users, permissions |
|
|
117
|
+
| `fin` | fin.{tenant}.com | Finance — invoices, payments, journals |
|
|
118
|
+
| `inv` | inv.{tenant}.com | Inventory — stock moves, warehouses, lots |
|
|
119
|
+
| `crm` | crm.{tenant}.com | CRM — leads, opportunities, pipelines |
|
|
120
|
+
| `ops` | ops.{tenant}.com | Operations — projects, tasks, timesheets |
|
|
121
|
+
| `procurement` | proc.{tenant}.com | Procurement — RFQs, purchase orders, vendors |
|
|
122
|
+
| `pos` | pos.{tenant}.com | Point of Sale — sessions, orders, payments |
|
|
123
|
+
| `dashboard` | dash.{tenant}.com | Executive dashboards — KPIs, charts |
|
|
124
|
+
| `portal` | portal.{tenant}.com | Customer/vendor self-service portal |
|
|
125
|
+
|
|
126
|
+
All apps connect to the `kctl-api` FastAPI backend and Odoo 18 via generated API clients.
|
|
127
|
+
|
|
128
|
+
## Global Options
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
kctl-react [OPTIONS] COMMAND [ARGS]...
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
| Option | Short | Description |
|
|
135
|
+
|--------|-------|-------------|
|
|
136
|
+
| `--json` | | Machine-readable JSON output (data to stdout, status to stderr) |
|
|
137
|
+
| `--quiet` | `-q` | Suppress info messages |
|
|
138
|
+
| `--profile NAME` | `-p` | Config profile name |
|
|
139
|
+
| `--root PATH` | | Monorepo root override (auto-detects from `turbo.json`) |
|
|
140
|
+
| `--format FORMAT` | `-f` | Output format: `pretty`, `json`, `csv`, `yaml` |
|
|
141
|
+
| `--no-header` | | Omit header row in CSV output |
|
|
142
|
+
| `--version` | `-V` | Show version and exit |
|
|
143
|
+
|
|
144
|
+
## Shell Completions
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Install completions (run once)
|
|
148
|
+
kctl-react --install-completion
|
|
149
|
+
|
|
150
|
+
# Or generate and source manually
|
|
151
|
+
kctl-react --show-completion zsh # zsh
|
|
152
|
+
kctl-react --show-completion bash # bash
|
|
153
|
+
kctl-react --show-completion fish # fish
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Completions are generated by Typer and cover all command groups, subcommands, and flags.
|
|
157
|
+
|
|
158
|
+
## Configuration
|
|
159
|
+
|
|
160
|
+
Shared config at `~/.config/kodemeio/config.yaml` (same file as kctl-ak, kctl-odoo, etc.):
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
default_profile: default
|
|
164
|
+
profiles:
|
|
165
|
+
default:
|
|
166
|
+
react:
|
|
167
|
+
project_root: /path/to/kodemeio-react
|
|
168
|
+
api_url: https://api.kodeme.io
|
|
169
|
+
mac:
|
|
170
|
+
react:
|
|
171
|
+
project_root: /path/to/kodemeio-react
|
|
172
|
+
api_url: https://api.mandiriagro.com
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Auto-detects project root from `turbo.json` when not configured.
|
|
176
|
+
|
|
177
|
+
### Config Commands
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
kctl-react config init # Initialize config profile
|
|
181
|
+
kctl-react config add --profile mac # Add a new profile
|
|
182
|
+
kctl-react config use mac # Switch active profile
|
|
183
|
+
kctl-react config show # Show current config (secrets masked)
|
|
184
|
+
kctl-react config validate # Validate config file
|
|
185
|
+
kctl-react config profiles # List all profiles
|
|
186
|
+
kctl-react config current # Show active profile name
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Common Workflows
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# Daily development
|
|
193
|
+
kctl-react dev start sfa # Start SFA dev server
|
|
194
|
+
kctl-react dev logs sfa # Follow dev server logs
|
|
195
|
+
kctl-react apps health --watch # Watch app health status
|
|
196
|
+
|
|
197
|
+
# Build & test
|
|
198
|
+
kctl-react build sfa --analyze # Build with bundle analyzer
|
|
199
|
+
kctl-react test sfa --coverage # Test with coverage report
|
|
200
|
+
kctl-react lint sfa --fix # Lint + auto-fix
|
|
201
|
+
|
|
202
|
+
# Code generation
|
|
203
|
+
kctl-react codegen sfa # Regenerate OpenAPI types
|
|
204
|
+
kctl-react codegen drift # Detect API drift vs spec
|
|
205
|
+
|
|
206
|
+
# E2E testing
|
|
207
|
+
kctl-react e2e install # Install Playwright + browsers
|
|
208
|
+
kctl-react e2e test --app sfa # Run E2E tests for SFA
|
|
209
|
+
kctl-react e2e screenshots # Screenshot all apps
|
|
210
|
+
|
|
211
|
+
# Performance
|
|
212
|
+
kctl-react perf lighthouse sfa # Lighthouse audit
|
|
213
|
+
kctl-react perf vitals sfa # Core Web Vitals check
|
|
214
|
+
|
|
215
|
+
# Security
|
|
216
|
+
kctl-react security audit # pnpm audit (vulnerabilities)
|
|
217
|
+
kctl-react security secrets # Scan for hardcoded secrets
|
|
218
|
+
kctl-react security licenses # License compliance check
|
|
219
|
+
|
|
220
|
+
# PWA management
|
|
221
|
+
kctl-react pwa status sfa # Service worker status
|
|
222
|
+
kctl-react pwa manifest-validate sfa # Validate PWA manifest
|
|
223
|
+
|
|
224
|
+
# Deployment
|
|
225
|
+
kctl-react deploy build sfa # Build Docker image
|
|
226
|
+
kctl-react deploy status # Show running containers
|
|
227
|
+
kctl-react deploy logs sfa # Container logs
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Development
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
cd cli
|
|
234
|
+
uv run --extra dev pytest tests/ -v # Run 73 tests
|
|
235
|
+
uv run --extra dev ruff check src/ # Lint
|
|
236
|
+
uv run --extra dev mypy src/ # Type check
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Architecture
|
|
240
|
+
|
|
241
|
+
Follows the kctl-\* ecosystem pattern:
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
cli/src/kctl_react/
|
|
245
|
+
├── core/ # Config, output, callbacks, runner, exceptions
|
|
246
|
+
├── commands/ # One file per command group (31 groups)
|
|
247
|
+
├── cli.py # Main Typer app + command registration
|
|
248
|
+
└── py.typed # PEP 561 marker
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Each command module registers a Typer sub-app that is mounted in `cli.py`. The `AppContext` dataclass (in `core/callbacks.py`) carries lazy-initialized `Output`, resolved `project_root`, and discovered `apps`/`packages` maps across all commands.
|
|
252
|
+
|
|
253
|
+
Third-party plugins are auto-discovered via `kctl_react.plugins` entry points — external packages can add new command groups without modifying this repo.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# kctl-react E2E Tests
|
|
2
|
+
|
|
3
|
+
Playwright-based E2E tests for kctl-react against the kodemeio-react monorepo.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
pnpm run install-browsers
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Point at local monorepo checkout
|
|
16
|
+
export REACT_MONOREPO_PATH=/path/to/kodemeio-react
|
|
17
|
+
pnpm test
|
|
18
|
+
|
|
19
|
+
# Smoke tests only
|
|
20
|
+
pnpm test:smoke
|
|
21
|
+
|
|
22
|
+
# Visible browser
|
|
23
|
+
pnpm test:headed
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Env Vars
|
|
27
|
+
|
|
28
|
+
- `REACT_MONOREPO_PATH` — Absolute path to the kodemeio-react monorepo checkout
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { test as base } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
export interface AuthFixtures {
|
|
4
|
+
monorepoPath: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const test = base.extend<AuthFixtures>({
|
|
8
|
+
monorepoPath: async ({}, use) => {
|
|
9
|
+
const path = process.env.REACT_MONOREPO_PATH;
|
|
10
|
+
if (!path) throw new Error("REACT_MONOREPO_PATH env var required");
|
|
11
|
+
await use(path);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { expect } from "@playwright/test";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kctl-react-e2e",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "playwright test",
|
|
7
|
+
"test:smoke": "playwright test --project=smoke",
|
|
8
|
+
"test:headed": "playwright test --headed",
|
|
9
|
+
"install-browsers": "playwright install chromium"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@playwright/test": "^1.48.0",
|
|
13
|
+
"typescript": "^5.5.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
testDir: "./tests",
|
|
5
|
+
timeout: 60_000,
|
|
6
|
+
retries: 1,
|
|
7
|
+
reporter: "list",
|
|
8
|
+
use: {
|
|
9
|
+
baseURL: process.env.REACT_MONOREPO_PATH || ".",
|
|
10
|
+
},
|
|
11
|
+
projects: [
|
|
12
|
+
{ name: "smoke", testMatch: /smoke\/.*\.spec\.ts/ },
|
|
13
|
+
{ name: "scenarios", testMatch: /scenarios\/.*\.spec\.ts/ },
|
|
14
|
+
],
|
|
15
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { test, expect } from "@playwright/test";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
|
|
4
|
+
test.describe("kctl-react CLI", () => {
|
|
5
|
+
test.skip(!process.env.REACT_MONOREPO_PATH, "REACT_MONOREPO_PATH not set");
|
|
6
|
+
|
|
7
|
+
test("can list apps in monorepo", async () => {
|
|
8
|
+
const output = execFileSync("kctl-react", ["apps", "list"], {
|
|
9
|
+
cwd: process.env.REACT_MONOREPO_PATH,
|
|
10
|
+
encoding: "utf-8",
|
|
11
|
+
});
|
|
12
|
+
expect(output).toContain("sfa");
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "kctl-react"
|
|
7
|
+
version = "0.6.2"
|
|
8
|
+
description = "Kodemeio React CLI — manage the kodemeio-react monorepo"
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"kctl-lib>=0.8.0",
|
|
12
|
+
"typer>=0.15.0",
|
|
13
|
+
"rich>=13.9.0",
|
|
14
|
+
"pydantic>=2.10.0",
|
|
15
|
+
"pyyaml>=6.0.2",
|
|
16
|
+
"httpx>=0.28.0",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.optional-dependencies]
|
|
20
|
+
dev = [
|
|
21
|
+
"pytest>=8.3.0",
|
|
22
|
+
"pytest-httpx>=0.35.0",
|
|
23
|
+
"ruff>=0.9.0",
|
|
24
|
+
"mypy>=1.14.0",
|
|
25
|
+
"types-PyYAML>=6.0.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
kctl-react = "kctl_react.cli:app"
|
|
30
|
+
|
|
31
|
+
[tool.uv.sources]
|
|
32
|
+
kctl-lib = { workspace = true }
|
|
33
|
+
|
|
34
|
+
[project.entry-points."kctl_react.plugins"]
|
|
35
|
+
|
|
36
|
+
[tool.hatch.build.targets.wheel]
|
|
37
|
+
packages = ["src/kctl_react"]
|
|
38
|
+
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
target-version = "py312"
|
|
41
|
+
line-length = 120
|
|
42
|
+
|
|
43
|
+
[tool.mypy]
|
|
44
|
+
python_version = "3.12"
|
|
45
|
+
strict = true
|