feat(generate-blueprint): add TypeScript blueprint generation support#32863
Open
chengyixu wants to merge 1 commit intojhipster:mainfrom
Open
feat(generate-blueprint): add TypeScript blueprint generation support#32863chengyixu wants to merge 1 commit intojhipster:mainfrom
chengyixu wants to merge 1 commit intojhipster:mainfrom
Conversation
Add --ts CLI option to generate TypeScript (.ts) blueprints instead of JavaScript (.js/.mjs). When enabled: - Generated blueprint files use .ts extensions - TypeScript type annotations replace JSDoc @type comments - tsconfig.json configured with module:preserve, noEmit, and rewriteRelativeImportExtensions for native TS execution - typescript added as devDependency with tsc in pretest - .blueprint/ internal files also output as .ts - Published files pattern updated for .ts spec exclusion Backward compatible - existing JS/MJS generation is unchanged. Closes jhipster#32217 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Adds a
--tsCLI option to thegenerate-blueprintgenerator that produces TypeScript (.ts) blueprints instead of JavaScript (.js/.mjs).Changes
tsconfig option (--tsCLI flag) to opt into TypeScript blueprint generationts=true,blueprintMjsExtensionresolves to'ts'instead of'js'/'mjs'index.ts,command.ts,generator.ts,generator.spec.ts) use.tsextensions with proper TypeScript type annotations (replacing JSDoc@typecomments).blueprint/internal files (commands.ts,generator.ts,index.ts, etc.) also output as.tswith TypeScript syntaxtsconfig.jsontemplate updated with TypeScript-optimized settings whentsis enabled:module: "preserve"for native TS executionnoEmit: truerewriteRelativeImportExtensions: trueerasableSyntaxOnly: trueverbatimModuleSyntax: truepackage.jsonadditions for TypeScript mode:typescriptadded as a devDependencytscadded to thepretestscript.tsand exclude.spec.tstypescriptEslintenabled whentsmode is activeDesign Decisions
blueprintMjsExtensionproperty (extending it to support'ts'value) rather than creating a parallel systemtsoption automatically setsjs: falsein the configuring phaseblueprintMjsExtension === 'ts'Closes #32217
Test plan
tsc --noEmitpasses (confirmed locally)generate-blueprintwith--tsflag and verify.tsfiles are generatedgenerate-blueprintwithout--tsand verify existing behavior unchangedgenerate-blueprint --ts --local-blueprintand verify.mjsbehavior for local blueprints🤖 Generated with Claude Code