
Building a Type-Safe Runtime from Scratch: Kernel, Host & Inferred CLI Types in Velnora
Starting the Schemas So, discovery is working. Now we need to define what we are discovering. This is where the schemas come in. The goal is to have a strict contract for every part of the system. If Velnora detects a package, it needs to know exactly what that package is capable of. The first question was: what does a discovered project actually look like at runtime? I needed a Project interface — a strict contract that captures everything the system needs to know about a package. But package.json alone isn't enough. It gives you the name, version, and dependencies — but nothing Velnora-specific. Where does the adapter config go? The framework hints? The build targets? Polluting package.json with custom fields felt wrong. So the Project interface pulls from two sources of truth : packageJson — the raw package.json , stored as-is so adapters and plugins can inspect dependencies without re-reading the file. config — the resolved VelnoraAppConfig from velnora.config.ts (or an empty objec
Continue reading on Dev.to JavaScript
Opens in a new tab



