Diagnostics census
sloptor build runs four sequential gates. The gates are the program-option diagnostics, the per-file precheck, the global checker diagnostics, and the transform drain. Each gate returns at the first problem. The precheck gate returns before sloptor queues the transform stage, so one type error anywhere hides every transformer diagnostic in the project.
sloptor check is complete but typecheck-only. It never runs the transformer, so it can't show a noAny-class diagnostic.
sloptor diagnostics runs every file and reports each one's outcome:
| Outcome | Meaning |
|---|---|
ok |
The file transformed with no diagnostics. This doesn't prove the Luau is correct. Sloptor uses types for truthiness, coercion, and loop lowering, so output for a type-broken file can be wrong without a warning |
typeError |
TypeScript rejected the file. Sloptor transforms it anyway |
transformerDiagnostic |
Sloptor's transformer rejected the file, or the file uses comment directives |
internalCompilerError |
A ported upstream assert fired. The output includes the panic value and stack |
sloptor diagnostics --project tsconfig.json --json'{"overlays":{"C:/proj/src/main.ts":"export const x = 1;\n"}}' | sloptor diagnostics --jsonFlags and output
Section titled “Flags and output”--project <path>selects the config.--checkers <n>sets the checker count.-b/--build [path]censuses a whole solution of project references, with--builders <n>. These are the same flags, values, and--builders requires --buildrule thatsloptor builduses.--jsonextends thesloptor build --jsonresult with atransformedcount, anoverlayMatchescount, and afileDiagnosticsarray. Diagnostic positions resolve against the text that sloptor compiled, which keeps them correct under overlays.- Each diagnostic has a
code. TypeScript diagnostics useTS####. Transformer diagnostics use the upstream factory name, such asnoAnyorrotorLabeledStatementFlowControl. Classify oncodeand not on the file'soutcome. A file can have both families at once, andoutcomereports only the most severe. Sloptor omits the key when no code ever existed, such as when a whole run broke and not one diagnostic. filesmeans something different here than forbuild. Forbuildit counts files written. Fordiagnosticsit counts files censused, and the command leaves disk untouched.- The command never writes
outDir,include/, orrotor.d.ts.
Comment directives
Section titled “Comment directives”The tsconfig rbxts key still sets the project's shape: type, rojo, and includePath. But sloptor forces allowCommentDirectives off.
That doesn't stop @ts-ignore from hiding type errors. A directive suppresses them inside the checker, and no compiler flag that sloptor sets undoes that. Forcing the option off adds sloptor's own "comment directives are not supported" diagnostic. A file that uses directives then shows as transformerDiagnostic and can't pass as ok.
The cost is a divergence. A project that sets allowCommentDirectives: true on purpose gets a diagnostic here that sloptor build omits.
Exit code
Section titled “Exit code”Unlike build and check, diagnostics exits 0 whenever it produced a census, even a census full of diagnostics. It exits 1 only when it could not produce one, and 2 for a usage error such as an unknown flag. The command reports and doesn't gate. Read ok and the per-file outcomes to judge the contents.
Overlays
Section titled “Overlays”Optional overlays arrive as JSON on stdin, in the form {"overlays":{"<absolute path>":"<source>"}}. They replace the text of those files for the run only. Overlays use stdin because argv can't hold a project's worth of source.
- Close stdin, or the reader blocks. The command detects an interactive terminal and treats it as no overlays. It can't detect a pipe left open.
- Overlays replace files and can't add them. The overlay filesystem overrides
FileExistsandReadFileonly, and not directory enumeration. A key for a path that the tsconfigincludenever walks to has no effect. - A key that matches no file in the program is an error and not a quiet no-op. Compare
overlayMatchesagainst the number you sent. A green census of the unmodified tree is exactly what this check prevents. Keys may use either path separator and match case-insensitively where the filesystem does. Under--build, the check runs against the union of every project, because a solution divides its files between projects.overlayMatchescounts distinct overlays and not per-project matches. - Unknown top-level fields in the request are an error. A typo in the wrapper key stops the run and doesn't parse to an empty overlay set.
- Overlays work on projects with transformer plugins. You can census your real build tsconfig and don't need a plugin-free copy. For external plugins, sloptor sends the text to the Node sidecar as a changed file and runs the worker's plugins against it. Sloptor then rebuilds the program from the worker's output. That program keeps your overlay on every file the worker didn't transform. Native
[flamework]projects use the native pipeline instead. Declaration emit throughbaseUrlandpathsresolves module names against the same view.
Solutions
Section titled “Solutions”sloptor diagnostics --build [path] censuses every project that the entry tsconfig references, transitively, in dependency order.
- If one project can't undergo a census, the others still run. A solution build blocks the dependents of a broken project, because they consume its missing output. Census runs never read project output, since TypeScript redirects project references to source. Blocking would only leave projects unreported. The command reports the error against its own project, and the run exits 1.
--jsonadds aprojectsarray. Each entry hasprojectDir,configPath,ok,files,transformed,overlayMatches, and the diagnostics that belong to the project and not to one of its files. EachfileDiagnosticsentry gains aprojectkey with the sameconfigPathvalue. The files stay in one flat array and aren't repeated per project.- Every top-level number is a solution-wide aggregate.
files,transformed,overlayMatches, anddiagnosticsare totals, andfileDiagnosticsholds every project's files. A project'sdiagnosticsare the attributed subset of the top-level array and not an addition to it. Solution-level errors belong to no project and appear only at the top. - Without
--build, the output is byte-identical to a solution-unaware sloptor.projectsand the per-fileprojectare the only new keys, and the command omits both. allowCommentDirectivesis forced off for every project of the solution and not only the entry. One referenced project'srbxtskey can't change how sloptor classifies its files.