vite-plugin-nudo
v0.5.2
Published
Vite plugin for build-time JavaScript type inference with Nudo
Maintainers
Readme
vite-plugin-nudo
Vite plugin for build-time JavaScript type inference with Nudo.
What is Nudo?
Nudo is a type inference engine for JavaScript. The type system is Abs (shape × term × pred × conf); analysis runs Abs-native via abstract interpretation — no TypeScript, no build step.
This package
vite-plugin-nudo runs Nudo analysis during your Vite build, reporting type diagnostics as build warnings or errors.
Install
npm install -D vite-plugin-nudoUsage
// vite.config.js
import nudo from 'vite-plugin-nudo'
export default {
plugins: [
nudo({
// include / exclude accept `string | string[]` (normalized to string[] at runtime)
include: ['**/*.js', '**/*.mjs', '**/*.ts'], // default — matches isNudoTargetPath (.js/.mjs/.ts)
exclude: ['**/node_modules/**', '**/*.d.ts'], // default
failOnError: false, // default — contract errors warn, do not fail the build
}),
],
}Analysis gating
File selection is two-stage:
- Path globs (
include/exclude) — defaults cover**/*.js,**/*.mjs,**/*.ts(the same extensionsisNudoTargetPathaccepts;.cjs/.cts/.mts/.tsx/.d.ts/*.nudo.jsare not analysis targets). nudo.analysis.modeviashouldAnalyzeFile— same gate as the LSP/CLI. Shipped default is"exports"(files with@nudo:,export, or a sidecar are analyzed). Set"all"or"directives"inpackage.json#nudo.analysisto widen or tighten the gate.
Diagnostics & failOnError
- Diagnostics tier follows
package.json#nudo.analysis.diagnosticswhen set. With a projectnudoconfig present but no explicit tier, the plugin uses the sameanalysisConfigdefault as the LSP (mode=directives→errors;exports/all→default). Without a project config the plugin keeps its historicaldefaulttier (errors + warnings) so ad-hoc files still surface warnings in build logs. failOnErrordefaults to false (intentional, E3): build-time diagnostics warn rather than fail, so broad analysis modes do not break CI on false positives. Usenudo checkas the contract CI gate, or passfailOnError: trueto block the build on error-severity contract diagnostics.- Display filtering via
nudo.analysis.diagnostics: "off"silences plugin diagnostics; it does not replacenudo check.
