Skip to content

Commit fd0d3ab

Browse files
committed
add emit-dts as an alias for gen-dts and make it the canonical alias
deprecate `generate-type-declaration`, `gen-type-declaration`, `gen-types`
1 parent 1110443 commit fd0d3ab

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/bin/hsm.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,16 @@ ${colourN(`--hackmud-path`)}=${colourB(`<path>`)} option or ${colourN(`HSM_HACKM
320320
case `generate-type-declaration`:
321321
case `gen-type-declaration`:
322322
case `gen-dts`:
323-
case `gen-types`: {
323+
case `gen-types`:
324+
case `emit-dts`: {
325+
if (commands[0] != `emit-dts` && commands[0] != `gen-dts`) {
326+
console.warn(colourF(`\
327+
Warning: ${colourC(`hsm`)} ${colourL(commands[0])} is being deprecated and will be removed
328+
in the next minor release of HSM
329+
You should switch to using its alias ${colourC(`hsm`)} ${colourL(`emit-dts`)}\n`
330+
))
331+
}
332+
324333
const hackmudPath = getHackmudPath()
325334
const target = commands[1]
326335

@@ -468,7 +477,16 @@ ${colourN(`--watch`)}
468477
case `generate-type-declaration`:
469478
case `gen-type-declaration`:
470479
case `gen-dts`:
471-
case `gen-types`: {
480+
case `gen-types`:
481+
case `emit-dts`: {
482+
if (commands[0] != `emit-dts` && commands[0] != `gen-dts`) {
483+
console.warn(colourF(`\
484+
Warning: ${colourC(`hsm`)} ${colourL(commands[0])} is being deprecated and will be removed
485+
in the next minor release of HSM
486+
You should switch to using its alias ${colourC(`hsm`)} ${colourL(`emit-dts`)}\n`
487+
))
488+
}
489+
472490
console.log(colourS(`\
473491
${colourJ(generateTypeDeclarationCommandDescription)}
474492
@@ -501,7 +519,7 @@ ${colourL(`dev`)}
501519
${watchCommandDescription}
502520
${colourL(`golf`)}
503521
${minifyCommandDescription}
504-
${colourL(`gen-dts`)}
522+
${colourL(`emit-dts`)}
505523
${generateTypeDeclarationCommandDescription}
506524
${colourL(`sync-macros`)}
507525
${syncMacrosCommandDescription}

0 commit comments

Comments
 (0)