feat: migrate to TypeScript#19
Merged
Merged
Conversation
- Convert all source files to TypeScript (lib/, src/nodes/, test/) - Flatten layout to src/ root matching node-red-contrib-interactive-inject - Move tests to src/__tests__/ with inline ts-jest config - Add tsconfig.build.json (no sourcemaps for prod), tsconfig.json for IDE - Use proper Node-RED types: NodeAPI, NodeDef, Node, NodeStatusFill, NodeMessageInFlow - Build pipeline: tsc + html-minifier-terser + icon copy to dist/ - Add clean script, watch script, peerDependencies, and overrides for typescript - Update files field to explicit dist/ entries only
neostandard 0.13.0 bumped find-up to ^8.0.0 (ESM-only), which breaks on Node 18 because neostandard's resolve-gitignore.js uses require(). Version 0.12.2 uses find-up ^5.0.0 (CJS) and still supports ts:true.
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
lib/,src/nodes/,test/)node-red-contrib-interactive-injectas a referenceanytypes with proper Node-RED types from@types/node-red(NodeAPI,NodeDef,Node,NodeStatusFill,NodeMessageInFlow)Key structural changes
src/layout (src/threshold-control.ts,src/threshold-logic.ts)src/__tests__/(collocated with source, matches reference)tsconfig.jsonwithrootDir: ./src→ cleandist/threshold-control.jsoutputtsconfig.build.jsonextending base config with sourcemaps disabled for prodjest.config.jsuses inline tsconfig instead of a separatetsconfig.test.jsontsc -p tsconfig.build.json+html-minifier-terser+cp -r src/icons dist/iconsfilesfield lists explicit dist entries instead of the whole directoryclean,watch,peerDependencies, andoverridesfor typescriptTest plan
npm test— 22 tests passnpm run build— compiles cleanly todist/, HTML minified, icons copiednpm run lint— no errorsnpm pack --dry-run— verify onlydist/files are included