Modernize TypeScript toolchain: NodeNext, tsdown, oxfmt#4
Merged
Conversation
Convert LogLevel and ServerType enums to `as const` object + derived type union pattern. Add LOG_LEVEL_NAMES reverse map for LogLevel. Convert constructor parameter property to explicit field assignment in MockShinyServer. These changes prepare the codebase for enabling erasableSyntaxOnly in tsconfig.
- module: ESNext → NodeNext - moduleResolution: bundler → nodenext - Add moduleDetection: force, verbatimModuleSyntax, erasableSyntaxOnly - Simplify include from src/**/* to src
- Replace legacy main field with exports map - Add sideEffects: false - Fix repository URL to use git+https:// prefix
Replace tsup (esbuild) with tsdown (Rolldown/Oxc) for bundling. Output extension changes from .js to .mjs (tsdown default for ESM). Update bin entries, exports map, and test paths accordingly. Net reduction of 83 npm dependencies.
Replace Prettier with oxfmt (Rust-based, Prettier-compatible formatter). Migrate config via `oxfmt --migrate=prettier`, add ignore pattern for generated report HTML. Update format and pre-push scripts. Zero formatting diff on all 47 source files.
The report template imports index.html as a raw string asset. With NodeNext module resolution, Vite's import analysis tries to parse the HTML as JS. Adding assetsInclude tells Vite to treat HTML files as assets instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernize the TypeScript build and developer toolchain:
NodeNextmodule resolution witherasableSyntaxOnly,verbatimModuleSyntax, andmoduleDetection: forceas const: ConvertLogLevelandServerTypeenums toas constobjects with derived type unions (required forerasableSyntaxOnly)exportsmap,sideEffects: false, fix repo URL formatVerification