usabl init: support monorepos and non-root app directories
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript, vite
- Ambito
- testing-qa, tooling
Direzione di ricerca
Start by reading the usabl init discovery code and the Vite and router lookup paths; the issue names platform/vite.config.ts, framework/vite.config.ts, and the runtime route assembly in platform/main/PlatformRoutes.tsx. Reproduce the empty draft on a monorepo, then check how discovery reports missing routes and empty uiFileGlobs. Done means init produces a usable draft for a named workspace or explains why it refuses and gives the manual next step, while preserving the single-app path.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
usabl init assumes a single application at the repository root. On a monorepo it finds neither the Vite config nor the router, writes an empty draft, and leaves the whole config to be hand-authored.
Found while dogfooding on a real second project (#110): ansible/ansible-ui at devel, a PatternFly 6.3.1 monorepo.
What happened
$ usabl init
Wrote usabl.config.json, usabl.routes.json.
Review: no Vite config found; using http://127.0.0.1:5173.
Review: no router file found. Routes sidecar will be empty.
Review: these files are drafts. Merge only after you check routes, globs, and URLs.
The drafts came out with uiFileGlobs: [], surfaces: [], and routes: []. A config in that state resolves to nothing to check, so the gate reports idle on every change.
Why it happened
Two separate assumptions, both reasonable for a single-app repo and both wrong here.
-
Vite config lookup is root-only. This repo's config is at
platform/vite.config.ts, and there is a second one atframework/vite.config.ts. init looked at the root, found nothing, and fell back to the default port. The real dev server runs on 4100 over https, not 5173 over http, so the fallback URL is wrong in three ways at once. -
Router discovery expects a static route file. This repo composes routes at runtime from hooks (
platform/routes/useGetPlatform*Routes.tsx, assembled inplatform/main/PlatformRoutes.tsx), and the path values are relative fragments joined into a tree. There is no file a static reader can parse into absolute URLs.
What it got right
It refused to guess. Every failed inference printed a Review: line naming what it could not determine, and it wrote empty collections rather than inventing routes. A wrong route map would have been worse than a missing one, and the honesty invariant held. This issue is about reach, not about correctness.
Proposed direction
Not a design decision yet, just the options as they look from here.
- Detect nested Vite configs and, when more than one is found, refuse and print the candidates for the operator to choose rather than picking one.
- Read the resolved dev server port and protocol from the chosen Vite config instead of assuming the default, since
server.portand https are both set explicitly here. - Accept an operator-supplied application subdirectory, so
usabl init --app platformscopes discovery to one workspace. - When routes cannot be derived statically, say so explicitly and point at the manual surface mapping path, rather than writing an empty sidecar that silently reads as idle.
- Consider whether an empty
uiFileGlobsshould be a refusal rather than a draft, since the resulting config cannot ever produce a verdict.
Acceptance
usabl initon a monorepo either produces a usable draft for a named workspace or refuses with the reason and the manual next step.- A config that can never produce a verdict is not written silently.
- The existing single-app path is unchanged.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 0
- Merge medio
- 2h 48m
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di usabl-dev/usabl
-
area: engine bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Stop hook allows a stop on an unknown verdict, and the self-check prints IDLE for a null verdictApertaarea: assistants bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
area: engine bug security
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Overlay: browser context failures are counted per plugin, not per browser, and close is not sharedApertaarea: overlay bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
area: engine enhancement performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di usabl-dev/usabl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
farion1231/cc-switch#8829 ·
I maintainer di solito rispondono entro 1 giorno
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverApertadoc-audit enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Snapshot capture failure (EPERM spawning git) fails the whole step despite the best-effort contractApertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
anomalyco/opencode#58685 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno