mirror of
https://github.com/azaion/ui.git
synced 2026-06-21 16:21:11 +00:00
[AZ-485] Add Public API barrels + STC-ARCH-01 (F4 close)
Closes architecture baseline finding F4. Every component now exposes its Public API through `src/<component>/index.ts`; cross-component imports go through the barrel. `scripts/check-arch-imports.mjs` plus `STC-ARCH-01` in the static profile enforce the rule; tests in `tests/architecture_imports.test.ts` cover AC-4/AC-5 + 2 exemption cases. One F3-pending exemption (`classColors`) is documented in 5 places (barrel, consumer, script, doc, test) to avoid a circular import. Phase B cycle 1 batch 1 of 2 (epic AZ-447). Batch 2 is AZ-486 (endpoint builders) — blocked on this commit landing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -470,6 +470,24 @@ if [ "$RUN_STATIC" = "true" ]; then
|
||||
'
|
||||
}
|
||||
|
||||
# AZ-485 F4 — STC-ARCH-01: no cross-component deep imports. After F4 every
|
||||
# component exposes its Public API via `src/<component>/index.ts`; cross-
|
||||
# component imports MUST go through the barrel, not reach into another
|
||||
# component's internal files. Flags imports of the form
|
||||
# from '../api/client'
|
||||
# from '../../components/ConfirmDialog'
|
||||
# from '../src/features/annotations/AnnotationsPage' (test files)
|
||||
# Allowed:
|
||||
# - barrel imports: from '../api', from '../../components'
|
||||
# - intra-component: from './sse', from './MediaList' (./ not ..)
|
||||
# - F3-pending edge: from '../features/annotations/classColors'
|
||||
# (classColors lives under 06_annotations until F3 moves it; importing
|
||||
# through the 06_annotations barrel would create a circular import
|
||||
# AnnotationsPage → DetectionClasses → barrel → AnnotationsPage.)
|
||||
static_check_no_cross_component_deep_imports() {
|
||||
node "$PROJECT_ROOT/scripts/check-arch-imports.mjs"
|
||||
}
|
||||
|
||||
# AZ-479 NFT-PERF-01 / NFT-RES-LIM-01 — initial JS bundle ≤ 2 MB gzipped.
|
||||
# Same threshold + measurement as scripts/run-performance-tests.sh; this
|
||||
# entry routes the gate through the static profile so every commit is
|
||||
@@ -516,6 +534,7 @@ if [ "$RUN_STATIC" = "true" ]; then
|
||||
run_static "STC-T1" "tsc --noEmit (test config)" "AC-6" "n/a" static_check_typecheck
|
||||
run_static "STC-B1" "vite build succeeds" "AC-6" "n/a" static_check_vite_build
|
||||
run_static "STC-S5" "mission-planner not in dist/" "AC-31" "n/a" static_check_dist_no_mission_planner
|
||||
run_static "STC-ARCH-01" "no cross-component deep imports (barrel-only)" "F4" "AZ-485" static_check_no_cross_component_deep_imports
|
||||
run_static "STC-PERF01" "initial JS bundle ≤ 2 MB gz" "NFT-PERF-01" "40" static_check_bundle_size
|
||||
run_static "STC-RES02" "nginx client_max_body_size 500M" "NFT-RES-LIM-02" "n/a" static_check_nginx_body_cap
|
||||
run_static "STC-RES03" "Dockerfile final stage nginx:alpine no Node" "NFT-RES-LIM-03" "n/a" static_check_dockerfile_nginx_alpine
|
||||
|
||||
Reference in New Issue
Block a user